sykpcomposer 0.0.32 → 0.0.34

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,42 +1,42 @@
1
- (function(Pe,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],P):(Pe=typeof globalThis<"u"?globalThis:Pe||self,P(Pe.ViteButton={},Pe.React,Pe.ReactDOM))})(this,function(Pe,P,di){"use strict";function Ps(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 Vn=Ps(P);var Jn={exports:{}},it={};/*
1
+ (function(Re,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],P):(Re=typeof globalThis<"u"?globalThis:Re||self,P(Re.ViteButton={},Re.React,Re.ReactDOM))})(this,function(Re,P,_i){"use strict";function $s(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 lt=$s(P);var Xn={exports:{}},at={};/*
2
2
  object-assign
3
3
  (c) Sindre Sorhus
4
4
  @license MIT
5
- */var Zn,fi;function gi(){if(fi)return Zn;fi=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 Zn=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 f in l)e.call(l,f)&&(a[f]=l[f]);if(n){c=n(l);for(var d=0;d<c.length;d++)t.call(l,c[d])&&(a[c[d]]=l[c[d]])}}return a},Zn}/** @license React v17.0.2
5
+ */var qn,yi;function xi(){if(yi)return qn;yi=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[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 qn=o()?Object.assign:function(i,s){for(var l,a=r(i),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)e.call(l,f)&&(a[f]=l[f]);if(n){c=n(l);for(var d=0;d<c.length;d++)t.call(l,c[d])&&(a[c[d]]=l[c[d]])}}return a},qn}/** @license React v17.0.2
6
6
  * react-jsx-runtime.production.min.js
7
7
  *
8
8
  * Copyright (c) Facebook, Inc. and its affiliates.
9
9
  *
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
- */var hi;function zs(){if(hi)return it;hi=1,gi();var n=P,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,f={},d=null,g=null;c!==void 0&&(d=""+c),a.key!==void 0&&(d=""+a.key),a.ref!==void 0&&(g=a.ref);for(u in a)i.call(a,u)&&!o.hasOwnProperty(u)&&(f[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:e,type:l,key:d,ref:g,props:f,_owner:r.current}}return it.jsx=s,it.jsxs=s,it}var qn={};/** @license React v17.0.2
12
+ */var vi;function Us(){if(vi)return at;vi=1,xi();var n=P,e=60103;if(at.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),at.Fragment=t("react.fragment")}var r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o=Object.prototype.hasOwnProperty,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,a,c){var u,f={},d=null,g=null;c!==void 0&&(d=""+c),a.key!==void 0&&(d=""+a.key),a.ref!==void 0&&(g=a.ref);for(u in a)o.call(a,u)&&!i.hasOwnProperty(u)&&(f[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:e,type:l,key:d,ref:g,props:f,_owner:r.current}}return at.jsx=s,at.jsxs=s,at}var er={};/** @license React v17.0.2
13
13
  * react-jsx-runtime.development.js
14
14
  *
15
15
  * Copyright (c) Facebook, Inc. and its affiliates.
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var pi;function Rs(){return pi||(pi=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=P,t=gi(),r=60103,i=60106;n.Fragment=60107;var o=60108,s=60114,l=60109,a=60110,c=60112,u=60113,f=60120,d=60115,g=60116,h=60121,m=60122,_=60117,v=60129,x=60131;if(typeof Symbol=="function"&&Symbol.for){var y=Symbol.for;r=y("react.element"),i=y("react.portal"),n.Fragment=y("react.fragment"),o=y("react.strict_mode"),s=y("react.profiler"),l=y("react.provider"),a=y("react.context"),c=y("react.forward_ref"),u=y("react.suspense"),f=y("react.suspense_list"),d=y("react.memo"),g=y("react.lazy"),h=y("react.block"),m=y("react.server.block"),_=y("react.fundamental"),y("react.scope"),y("react.opaque.id"),v=y("react.debug_trace_mode"),y("react.offscreen"),x=y("react.legacy_hidden")}var b=typeof Symbol=="function"&&Symbol.iterator,T="@@iterator";function S(p){if(p===null||typeof p!="object")return null;var w=b&&p[b]||p[T];return typeof w=="function"?w:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function N(p){{for(var w=arguments.length,I=new Array(w>1?w-1:0),z=1;z<w;z++)I[z-1]=arguments[z];M("error",p,I)}}function M(p,w,I){{var z=E.ReactDebugCurrentFrame,K=z.getStackAddendum();K!==""&&(w+="%s",I=I.concat([K]));var Q=I.map(function(U){return""+U});Q.unshift("Warning: "+w),Function.prototype.apply.call(console[p],console,Q)}}var R=!1;function B(p){return!!(typeof p=="string"||typeof p=="function"||p===n.Fragment||p===s||p===v||p===o||p===u||p===f||p===x||R||typeof p=="object"&&p!==null&&(p.$$typeof===g||p.$$typeof===d||p.$$typeof===l||p.$$typeof===a||p.$$typeof===c||p.$$typeof===_||p.$$typeof===h||p[0]===m))}function ee(p,w,I){var z=w.displayName||w.name||"";return p.displayName||(z!==""?I+"("+z+")":I)}function J(p){return p.displayName||"Context"}function F(p){if(p==null)return null;if(typeof p.tag=="number"&&N("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 f:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case a:var w=p;return J(w)+".Consumer";case l:var I=p;return J(I._context)+".Provider";case c:return ee(p,p.render,"ForwardRef");case d:return F(p.type);case h:return F(p._render);case g:{var z=p,K=z._payload,Q=z._init;try{return F(Q(K))}catch{return null}}}return null}var V=0,ce,De,Ke,Ht,Xt,en,xt;function vt(){}vt.__reactDisabledLog=!0;function Ct(){{if(V===0){ce=console.log,De=console.info,Ke=console.warn,Ht=console.error,Xt=console.group,en=console.groupCollapsed,xt=console.groupEnd;var p={configurable:!0,enumerable:!0,value:vt,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}V++}}function St(){{if(V--,V===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},p,{value:ce}),info:t({},p,{value:De}),warn:t({},p,{value:Ke}),error:t({},p,{value:Ht}),group:t({},p,{value:Xt}),groupCollapsed:t({},p,{value:en}),groupEnd:t({},p,{value:xt})})}V<0&&N("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=E.ReactCurrentDispatcher,nt;function Me(p,w,I){{if(nt===void 0)try{throw Error()}catch(K){var z=K.stack.trim().match(/\n( *(at )?)/);nt=z&&z[1]||""}return`
20
- `+nt+p}}var Qe=!1,rt;{var dc=typeof WeakMap=="function"?WeakMap:Map;rt=new dc}function Ts(p,w){if(!p||Qe)return"";{var I=rt.get(p);if(I!==void 0)return I}var z;Qe=!0;var K=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Q;Q=pe.current,pe.current=null,Ct();try{if(w){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(Ae){z=Ae}Reflect.construct(p,[],U)}else{try{U.call()}catch(Ae){z=Ae}p.call(U.prototype)}}else{try{throw Error()}catch(Ae){z=Ae}p()}}catch(Ae){if(Ae&&z&&typeof Ae.stack=="string"){for(var W=Ae.stack.split(`
21
- `),ue=z.stack.split(`
22
- `),q=W.length-1,H=ue.length-1;q>=1&&H>=0&&W[q]!==ue[H];)H--;for(;q>=1&&H>=0;q--,H--)if(W[q]!==ue[H]){if(q!==1||H!==1)do if(q--,H--,H<0||W[q]!==ue[H]){var Oe=`
23
- `+W[q].replace(" at new "," at ");return typeof p=="function"&&rt.set(p,Oe),Oe}while(q>=1&&H>=0);break}}}finally{Qe=!1,pe.current=Q,St(),Error.prepareStackTrace=K}var Nt=p?p.displayName||p.name:"",As=Nt?Me(Nt):"";return typeof p=="function"&&rt.set(p,As),As}function Ns(p,w,I){return Ts(p,!1)}function fc(p){var w=p.prototype;return!!(w&&w.isReactComponent)}function Kn(p,w,I){if(p==null)return"";if(typeof p=="function")return Ts(p,fc(p));if(typeof p=="string")return Me(p);switch(p){case u:return Me("Suspense");case f:return Me("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case c:return Ns(p.render);case d:return Kn(p.type,w,I);case h:return Ns(p._render);case g:{var z=p,K=z._payload,Q=z._init;try{return Kn(Q(K),w,I)}catch{}}}return""}var bs={},ws=E.ReactDebugCurrentFrame;function Qn(p){if(p){var w=p._owner,I=Kn(p.type,p._source,w?w.type:null);ws.setExtraStackFrame(I)}else ws.setExtraStackFrame(null)}function gc(p,w,I,z,K){{var Q=Function.call.bind(Object.prototype.hasOwnProperty);for(var U in p)if(Q(p,U)){var W=void 0;try{if(typeof p[U]!="function"){var ue=Error((z||"React class")+": "+I+" type `"+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[U]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ue.name="Invariant Violation",ue}W=p[U](w,U,z,I,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(q){W=q}W&&!(W instanceof Error)&&(Qn(K),N("%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).",z||"React class",I,U,typeof W),Qn(null)),W instanceof Error&&!(W.message in bs)&&(bs[W.message]=!0,Qn(K),N("Failed %s type: %s",I,W.message),Qn(null))}}}var tn=E.ReactCurrentOwner,si=Object.prototype.hasOwnProperty,hc={key:!0,ref:!0,__self:!0,__source:!0},Ms,Es,li;li={};function pc(p){if(si.call(p,"ref")){var w=Object.getOwnPropertyDescriptor(p,"ref").get;if(w&&w.isReactWarning)return!1}return p.ref!==void 0}function _c(p){if(si.call(p,"key")){var w=Object.getOwnPropertyDescriptor(p,"key").get;if(w&&w.isReactWarning)return!1}return p.key!==void 0}function mc(p,w){if(typeof p.ref=="string"&&tn.current&&w&&tn.current.stateNode!==w){var I=F(tn.current.type);li[I]||(N('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',F(tn.current.type),p.ref),li[I]=!0)}}function yc(p,w){{var I=function(){Ms||(Ms=!0,N("%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)",w))};I.isReactWarning=!0,Object.defineProperty(p,"key",{get:I,configurable:!0})}}function xc(p,w){{var I=function(){Es||(Es=!0,N("%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)",w))};I.isReactWarning=!0,Object.defineProperty(p,"ref",{get:I,configurable:!0})}}var vc=function(p,w,I,z,K,Q,U){var W={$$typeof:r,type:p,key:w,ref:I,props:U,_owner:Q};return W._store={},Object.defineProperty(W._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(W,"_self",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.defineProperty(W,"_source",{configurable:!1,enumerable:!1,writable:!1,value:K}),Object.freeze&&(Object.freeze(W.props),Object.freeze(W)),W};function Cc(p,w,I,z,K){{var Q,U={},W=null,ue=null;I!==void 0&&(W=""+I),_c(w)&&(W=""+w.key),pc(w)&&(ue=w.ref,mc(w,K));for(Q in w)si.call(w,Q)&&!hc.hasOwnProperty(Q)&&(U[Q]=w[Q]);if(p&&p.defaultProps){var q=p.defaultProps;for(Q in q)U[Q]===void 0&&(U[Q]=q[Q])}if(W||ue){var H=typeof p=="function"?p.displayName||p.name||"Unknown":p;W&&yc(U,H),ue&&xc(U,H)}return vc(p,W,ue,K,z,tn.current,U)}}var ai=E.ReactCurrentOwner,ks=E.ReactDebugCurrentFrame;function Tt(p){if(p){var w=p._owner,I=Kn(p.type,p._source,w?w.type:null);ks.setExtraStackFrame(I)}else ks.setExtraStackFrame(null)}var ci;ci=!1;function ui(p){return typeof p=="object"&&p!==null&&p.$$typeof===r}function Ls(){{if(ai.current){var p=F(ai.current.type);if(p)return`
19
+ */var Ci;function Ys(){return Ci||(Ci=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=P,t=xi(),r=60103,o=60106;n.Fragment=60107;var i=60108,s=60114,l=60109,a=60110,c=60112,u=60113,f=60120,d=60115,g=60116,h=60121,m=60122,_=60117,v=60129,x=60131;if(typeof Symbol=="function"&&Symbol.for){var y=Symbol.for;r=y("react.element"),o=y("react.portal"),n.Fragment=y("react.fragment"),i=y("react.strict_mode"),s=y("react.profiler"),l=y("react.provider"),a=y("react.context"),c=y("react.forward_ref"),u=y("react.suspense"),f=y("react.suspense_list"),d=y("react.memo"),g=y("react.lazy"),h=y("react.block"),m=y("react.server.block"),_=y("react.fundamental"),y("react.scope"),y("react.opaque.id"),v=y("react.debug_trace_mode"),y("react.offscreen"),x=y("react.legacy_hidden")}var b=typeof Symbol=="function"&&Symbol.iterator,C="@@iterator";function T(p){if(p===null||typeof p!="object")return null;var N=b&&p[b]||p[C];return typeof N=="function"?N:null}var M=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(p){{for(var N=arguments.length,L=new Array(N>1?N-1:0),R=1;R<N;R++)L[R-1]=arguments[R];E("error",p,L)}}function E(p,N,L){{var R=M.ReactDebugCurrentFrame,K=R.getStackAddendum();K!==""&&(N+="%s",L=L.concat([K]));var V=L.map(function($){return""+$});V.unshift("Warning: "+N),Function.prototype.apply.call(console[p],console,V)}}var z=!1;function B(p){return!!(typeof p=="string"||typeof p=="function"||p===n.Fragment||p===s||p===v||p===i||p===u||p===f||p===x||z||typeof p=="object"&&p!==null&&(p.$$typeof===g||p.$$typeof===d||p.$$typeof===l||p.$$typeof===a||p.$$typeof===c||p.$$typeof===_||p.$$typeof===h||p[0]===m))}function ee(p,N,L){var R=N.displayName||N.name||"";return p.displayName||(R!==""?L+"("+R+")":L)}function J(p){return p.displayName||"Context"}function F(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 o:return"Portal";case s:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case f:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case a:var N=p;return J(N)+".Consumer";case l:var L=p;return J(L._context)+".Provider";case c:return ee(p,p.render,"ForwardRef");case d:return F(p.type);case h:return F(p._render);case g:{var R=p,K=R._payload,V=R._init;try{return F(V(K))}catch{return null}}}return null}var Z=0,ce,je,Ve,nn,rn,on,St;function Tt(){}Tt.__reactDisabledLog=!0;function wt(){{if(Z===0){ce=console.log,je=console.info,Ve=console.warn,nn=console.error,rn=console.group,on=console.groupCollapsed,St=console.groupEnd;var p={configurable:!0,enumerable:!0,value:Tt,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}Z++}}function Nt(){{if(Z--,Z===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},p,{value:ce}),info:t({},p,{value:je}),warn:t({},p,{value:Ve}),error:t({},p,{value:nn}),group:t({},p,{value:rn}),groupCollapsed:t({},p,{value:on}),groupEnd:t({},p,{value:St})})}Z<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=M.ReactCurrentDispatcher,ot;function Ee(p,N,L){{if(ot===void 0)try{throw Error()}catch(K){var R=K.stack.trim().match(/\n( *(at )?)/);ot=R&&R[1]||""}return`
20
+ `+ot+p}}var Ze=!1,st;{var bc=typeof WeakMap=="function"?WeakMap:Map;st=new bc}function Ms(p,N){if(!p||Ze)return"";{var L=st.get(p);if(L!==void 0)return L}var R;Ze=!0;var K=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var V;V=pe.current,pe.current=null,wt();try{if(N){var $=function(){throw Error()};if(Object.defineProperty($.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($,[])}catch(Pe){R=Pe}Reflect.construct(p,[],$)}else{try{$.call()}catch(Pe){R=Pe}p.call($.prototype)}}else{try{throw Error()}catch(Pe){R=Pe}p()}}catch(Pe){if(Pe&&R&&typeof Pe.stack=="string"){for(var W=Pe.stack.split(`
21
+ `),ue=R.stack.split(`
22
+ `),H=W.length-1,X=ue.length-1;H>=1&&X>=0&&W[H]!==ue[X];)X--;for(;H>=1&&X>=0;H--,X--)if(W[H]!==ue[X]){if(H!==1||X!==1)do if(H--,X--,X<0||W[H]!==ue[X]){var Ae=`
23
+ `+W[H].replace(" at new "," at ");return typeof p=="function"&&st.set(p,Ae),Ae}while(H>=1&&X>=0);break}}}finally{Ze=!1,pe.current=V,Nt(),Error.prepareStackTrace=K}var kt=p?p.displayName||p.name:"",Bs=kt?Ee(kt):"";return typeof p=="function"&&st.set(p,Bs),Bs}function Is(p,N,L){return Ms(p,!1)}function Sc(p){var N=p.prototype;return!!(N&&N.isReactComponent)}function Hn(p,N,L){if(p==null)return"";if(typeof p=="function")return Ms(p,Sc(p));if(typeof p=="string")return Ee(p);switch(p){case u:return Ee("Suspense");case f:return Ee("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case c:return Is(p.render);case d:return Hn(p.type,N,L);case h:return Is(p._render);case g:{var R=p,K=R._payload,V=R._init;try{return Hn(V(K),N,L)}catch{}}}return""}var Ds={},Ls=M.ReactDebugCurrentFrame;function Gn(p){if(p){var N=p._owner,L=Hn(p.type,p._source,N?N.type:null);Ls.setExtraStackFrame(L)}else Ls.setExtraStackFrame(null)}function Tc(p,N,L,R,K){{var V=Function.call.bind(Object.prototype.hasOwnProperty);for(var $ in p)if(V(p,$)){var W=void 0;try{if(typeof p[$]!="function"){var ue=Error((R||"React class")+": "+L+" 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}W=p[$](N,$,R,L,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(H){W=H}W&&!(W instanceof Error)&&(Gn(K),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).",R||"React class",L,$,typeof W),Gn(null)),W instanceof Error&&!(W.message in Ds)&&(Ds[W.message]=!0,Gn(K),w("Failed %s type: %s",L,W.message),Gn(null))}}}var sn=M.ReactCurrentOwner,fi=Object.prototype.hasOwnProperty,wc={key:!0,ref:!0,__self:!0,__source:!0},Os,js,gi;gi={};function Nc(p){if(fi.call(p,"ref")){var N=Object.getOwnPropertyDescriptor(p,"ref").get;if(N&&N.isReactWarning)return!1}return p.ref!==void 0}function Ec(p){if(fi.call(p,"key")){var N=Object.getOwnPropertyDescriptor(p,"key").get;if(N&&N.isReactWarning)return!1}return p.key!==void 0}function kc(p,N){if(typeof p.ref=="string"&&sn.current&&N&&sn.current.stateNode!==N){var L=F(sn.current.type);gi[L]||(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',F(sn.current.type),p.ref),gi[L]=!0)}}function Mc(p,N){{var L=function(){Os||(Os=!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)",N))};L.isReactWarning=!0,Object.defineProperty(p,"key",{get:L,configurable:!0})}}function Ic(p,N){{var L=function(){js||(js=!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)",N))};L.isReactWarning=!0,Object.defineProperty(p,"ref",{get:L,configurable:!0})}}var Dc=function(p,N,L,R,K,V,$){var W={$$typeof:r,type:p,key:N,ref:L,props:$,_owner:V};return W._store={},Object.defineProperty(W._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(W,"_self",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.defineProperty(W,"_source",{configurable:!1,enumerable:!1,writable:!1,value:K}),Object.freeze&&(Object.freeze(W.props),Object.freeze(W)),W};function Lc(p,N,L,R,K){{var V,$={},W=null,ue=null;L!==void 0&&(W=""+L),Ec(N)&&(W=""+N.key),Nc(N)&&(ue=N.ref,kc(N,K));for(V in N)fi.call(N,V)&&!wc.hasOwnProperty(V)&&($[V]=N[V]);if(p&&p.defaultProps){var H=p.defaultProps;for(V in H)$[V]===void 0&&($[V]=H[V])}if(W||ue){var X=typeof p=="function"?p.displayName||p.name||"Unknown":p;W&&Mc($,X),ue&&Ic($,X)}return Dc(p,W,ue,K,R,sn.current,$)}}var hi=M.ReactCurrentOwner,As=M.ReactDebugCurrentFrame;function Et(p){if(p){var N=p._owner,L=Hn(p.type,p._source,N?N.type:null);As.setExtraStackFrame(L)}else As.setExtraStackFrame(null)}var pi;pi=!1;function mi(p){return typeof p=="object"&&p!==null&&p.$$typeof===r}function Ps(){{if(hi.current){var p=F(hi.current.type);if(p)return`
24
24
 
25
- Check the render method of \``+p+"`."}return""}}function Sc(p){{if(p!==void 0){var w=p.fileName.replace(/^.*[\\\/]/,""),I=p.lineNumber;return`
25
+ Check the render method of \``+p+"`."}return""}}function Oc(p){{if(p!==void 0){var N=p.fileName.replace(/^.*[\\\/]/,""),L=p.lineNumber;return`
26
26
 
27
- Check your code at `+w+":"+I+"."}return""}}var js={};function Tc(p){{var w=Ls();if(!w){var I=typeof p=="string"?p:p.displayName||p.name;I&&(w=`
27
+ Check your code at `+N+":"+L+"."}return""}}var Rs={};function jc(p){{var N=Ps();if(!N){var L=typeof p=="string"?p:p.displayName||p.name;L&&(N=`
28
28
 
29
- Check the top-level render call using <`+I+">.")}return w}}function Is(p,w){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var I=Tc(w);if(js[I])return;js[I]=!0;var z="";p&&p._owner&&p._owner!==ai.current&&(z=" It was passed a child from "+F(p._owner.type)+"."),Tt(p),N('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',I,z),Tt(null)}}function Ds(p,w){{if(typeof p!="object")return;if(Array.isArray(p))for(var I=0;I<p.length;I++){var z=p[I];ui(z)&&Is(z,w)}else if(ui(p))p._store&&(p._store.validated=!0);else if(p){var K=S(p);if(typeof K=="function"&&K!==p.entries)for(var Q=K.call(p),U;!(U=Q.next()).done;)ui(U.value)&&Is(U.value,w)}}}function Nc(p){{var w=p.type;if(w==null||typeof w=="string")return;var I;if(typeof w=="function")I=w.propTypes;else if(typeof w=="object"&&(w.$$typeof===c||w.$$typeof===d))I=w.propTypes;else return;if(I){var z=F(w);gc(I,p.props,"prop",z,p)}else if(w.PropTypes!==void 0&&!ci){ci=!0;var K=F(w);N("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",K||"Unknown")}typeof w.getDefaultProps=="function"&&!w.getDefaultProps.isReactClassApproved&&N("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function bc(p){{for(var w=Object.keys(p.props),I=0;I<w.length;I++){var z=w[I];if(z!=="children"&&z!=="key"){Tt(p),N("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",z),Tt(null);break}}p.ref!==null&&(Tt(p),N("Invalid attribute `ref` supplied to `React.Fragment`."),Tt(null))}}function Os(p,w,I,z,K,Q){{var U=B(p);if(!U){var W="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(W+=" 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=Sc(K);ue?W+=ue:W+=Ls();var q;p===null?q="null":Array.isArray(p)?q="array":p!==void 0&&p.$$typeof===r?(q="<"+(F(p.type)||"Unknown")+" />",W=" Did you accidentally export a JSX literal instead of a component?"):q=typeof p,N("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",q,W)}var H=Cc(p,w,I,K,Q);if(H==null)return H;if(U){var Oe=w.children;if(Oe!==void 0)if(z)if(Array.isArray(Oe)){for(var Nt=0;Nt<Oe.length;Nt++)Ds(Oe[Nt],p);Object.freeze&&Object.freeze(Oe)}else N("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 Ds(Oe,p)}return p===n.Fragment?bc(H):Nc(H),H}}function wc(p,w,I){return Os(p,w,I,!0)}function Mc(p,w,I){return Os(p,w,I,!1)}var Ec=Mc,kc=wc;n.jsx=Ec,n.jsxs=kc}()}(qn)),qn}process.env.NODE_ENV==="production"?Jn.exports=zs():Jn.exports=Rs();var A=Jn.exports;function Fs(n){return{}}const nn={},Ws={},_i={},Ve={},ot={},rn={},st={},Gn={},Hn={},bt={},wt={},de={},on={},sn={},Bs={},mi={},Us={},yi={},$s={},xi={},vi={},ln={},Ys={},Ci={},Si={},Ti={},Ks={},Qs={},Vs={},Ni={},bi={},Mt={},wi={},Mi={},Js={},an={},Xn={},er={},Zs={},qs={},Et={},kt={},Gs={},Hs={},Xs={},_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),ze=_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),Ei=_e&&/^(?=.*Chrome).*/i.test(navigator.userAgent),nl=_e&&tl&&Ei,nr=_e&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ei,Lt=1,Re=3,Je=0,ki=1,lt=2,rl=0,il=1,ol=2,dn=4,fn=8,rr=128,sl=112|(3|dn|fn)|rr,ir=1,or=2,sr=3,lr=4,ar=5,cr=6,gn=tr||un||nr?" ":"​",Ee=`
29
+ Check the top-level render call using <`+L+">.")}return N}}function zs(p,N){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var L=jc(N);if(Rs[L])return;Rs[L]=!0;var R="";p&&p._owner&&p._owner!==hi.current&&(R=" It was passed a child from "+F(p._owner.type)+"."),Et(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.',L,R),Et(null)}}function Fs(p,N){{if(typeof p!="object")return;if(Array.isArray(p))for(var L=0;L<p.length;L++){var R=p[L];mi(R)&&zs(R,N)}else if(mi(p))p._store&&(p._store.validated=!0);else if(p){var K=T(p);if(typeof K=="function"&&K!==p.entries)for(var V=K.call(p),$;!($=V.next()).done;)mi($.value)&&zs($.value,N)}}}function Ac(p){{var N=p.type;if(N==null||typeof N=="string")return;var L;if(typeof N=="function")L=N.propTypes;else if(typeof N=="object"&&(N.$$typeof===c||N.$$typeof===d))L=N.propTypes;else return;if(L){var R=F(N);Tc(L,p.props,"prop",R,p)}else if(N.PropTypes!==void 0&&!pi){pi=!0;var K=F(N);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",K||"Unknown")}typeof N.getDefaultProps=="function"&&!N.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Pc(p){{for(var N=Object.keys(p.props),L=0;L<N.length;L++){var R=N[L];if(R!=="children"&&R!=="key"){Et(p),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",R),Et(null);break}}p.ref!==null&&(Et(p),w("Invalid attribute `ref` supplied to `React.Fragment`."),Et(null))}}function Ws(p,N,L,R,K,V){{var $=B(p);if(!$){var W="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(W+=" 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=Oc(K);ue?W+=ue:W+=Ps();var H;p===null?H="null":Array.isArray(p)?H="array":p!==void 0&&p.$$typeof===r?(H="<"+(F(p.type)||"Unknown")+" />",W=" Did you accidentally export a JSX literal instead of a component?"):H=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",H,W)}var X=Lc(p,N,L,K,V);if(X==null)return X;if($){var Ae=N.children;if(Ae!==void 0)if(R)if(Array.isArray(Ae)){for(var kt=0;kt<Ae.length;kt++)Fs(Ae[kt],p);Object.freeze&&Object.freeze(Ae)}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(Ae,p)}return p===n.Fragment?Pc(X):Ac(X),X}}function Rc(p,N,L){return Ws(p,N,L,!0)}function zc(p,N,L){return Ws(p,N,L,!1)}var Fc=zc,Wc=Rc;n.jsx=Fc,n.jsxs=Wc}()}(er)),er}process.env.NODE_ENV==="production"?Xn.exports=Us():Xn.exports=Ys();var j=Xn.exports;function Ks(n){return{}}const ln={},Vs={},bi={},Je={},ct={},an={},ut={},tr={},nr={},Mt={},It={},de={},cn={},un={},Zs={},Si={},Js={},Ti={},Qs={},wi={},Ni={},dn={},Hs={},Ei={},ki={},Mi={},Gs={},Xs={},qs={},Ii={},Di={},Dt={},Li={},Oi={},el={},fn={},rr={},ir={},tl={},nl={},Lt={},Ot={},rl={},il={},ol={},me=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,sl=me&&"documentMode"in document?document.documentMode:null,_e=me&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ze=me&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),gn=!(!me||!("InputEvent"in window)||sl)&&"getTargetRanges"in new window.InputEvent("input"),or=me&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),hn=me&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ll=me&&/Android/.test(navigator.userAgent),ji=me&&/^(?=.*Chrome).*/i.test(navigator.userAgent),al=me&&ll&&ji,sr=me&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!ji,jt=1,Fe=3,Qe=0,Ai=1,dt=2,cl=0,ul=1,dl=2,pn=4,mn=8,lr=128,fl=112|(3|pn|mn)|lr,ar=1,cr=2,ur=3,dr=4,fr=5,gr=6,_n=or||hn||sr?" ":"​",ke=`
30
30
 
31
- `,ll=ze?" ":gn,Li="֑-߿יִ-﷽ﹰ-ﻼ",ji="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",al=new RegExp("^[^"+ji+"]*["+Li+"]"),cl=new RegExp("^[^"+Li+"]*["+ji+"]"),ke={bold:1,code:16,highlight:rr,italic:2,strikethrough:dn,subscript:32,superscript:64,underline:fn},ul={directionless:1,unmergeable:2},Ii={center:or,end:cr,justify:lr,left:ir,right:sr,start:ar},dl={[or]:"center",[cr]:"end",[lr]:"justify",[ir]:"left",[sr]:"right",[ar]:"start"},fl={normal:0,segmented:2,token:1},gl={[rl]:"normal",[ol]:"segmented",[il]:"token"};function hl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var L=hl(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 hn(...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,dr=0;function _l(n){dr=n.timeStamp}function fr(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function ml(n,e,t){const r=Te(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(k(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===Re&&t.isAttached()}function Di(n,e,t){ur=!0;const r=performance.now()-dr>pl;try{he(n,()=>{const i=O()||function(d){return d.getEditorState().read(()=>{const g=O();return g!==null?g.clone():null})}(n),o=new Map,s=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let d=0;d<e.length;d++){const g=e[d],h=g.type,m=g.target;let _=qe(m,l);if(!(_===null&&m!==s||Y(_))){if(h==="characterData")r&&j(_)&&yl(i,m,_)&&ml(m,_,n);else if(h==="childList"){c=!0;const v=g.addedNodes;for(let b=0;b<v.length;b++){const T=v[b],S=Ui(T),E=T.parentNode;if(E!=null&&T!==a&&S===null&&(T.nodeName!=="BR"||!fr(T,E,n))){if(ze){const N=T.innerText||T.nodeValue;N&&(u+=N)}E.removeChild(T)}}const x=g.removedNodes,y=x.length;if(y>0){let b=0;for(let T=0;T<y;T++){const S=x[T];(S.nodeName==="BR"&&fr(S,m,n)||a===S)&&(m.appendChild(S),b++)}y!==b&&(m===s&&(_=Ki(l)),o.set(m,_))}}}}if(o.size>0)for(const[d,g]of o)if(C(g)){const h=g.getChildrenKeys();let m=d.firstChild;for(let _=0;_<h.length;_++){const v=h[_],x=n.getElementByKey(v);x!==null&&(m==null?(d.appendChild(x),m=x):m!==x&&d.replaceChild(x,m),m=m.nextSibling)}}else j(g)&&g.markDirty();const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const g=f[d],h=g.addedNodes,m=g.target;for(let _=0;_<h.length;_++){const v=h[_],x=v.parentNode;x==null||v.nodeName!=="BR"||fr(v,m,n)||x.removeChild(v)}}t.takeRecords()}i!==null&&(c&&(i.dirty=!0,Se(i)),ze&&to(n)&&i.insertRawText(u))})}finally{ur=!1}}function Oi(n){const e=n._observer;e!==null&&Di(n,e.takeRecords(),e)}function Ai(n){(function(e){dr===0&&Cn(e).addEventListener("textInput",_l,!0)})(n),n._observer=new MutationObserver((e,t)=>{Di(n,e,t)})}function Pi(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 zi(n,e){const t=n.mergeWithSibling(e),r=Z()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Ri(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(Pi(e,r)){r=zi(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&j(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Pi(r,t)){r=zi(r,t);break}break}t.remove()}}else r.remove()}function Fi(n){return Wi(n.anchor),Wi(n.focus),n}function Wi(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),j(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 xl=1;const vl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function gr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return Y(qe(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&pn(e)==null)}function jt(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!gr(e)&&Bi(e)===n}catch{return!1}}function hr(n){return n instanceof Fn}function Bi(n){let e=n;for(;e!=null;){const t=pn(e);if(hr(t))return t;e=vn(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===Re}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=ke[e];if(t!==null&&(n&r)==(t&r))return n;let i=n^r;return e==="subscript"?i&=~ke.superscript:e==="superscript"&&(i&=~ke.subscript),i}function Sl(n,e){if(e!=null)return void(n.__key=e);ge(),Wo();const t=Z(),r=Ie(),i=""+xl++;r._nodeMap.set(i,n),C(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=ki,n.__key=i}function Ze(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){Wo();const e=n.getLatest(),t=e.__parent,r=Ie(),i=Z(),o=r._nodeMap,s=i._dirtyElements;t!==null&&function(a,c,u){let f=a;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}}(t,o,s);const l=e.__key;i._dirtyType=ki,C(n)?s.set(l,!0):i._dirtyLeaves.add(l)}function re(n){ge();const e=Z(),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 Fe(){return Zt()?null:Z()._compositionKey}function se(n,e){const t=(e||Ie())._nodeMap.get(n);return t===void 0?null:t}function Ui(n,e){const t=n[`__lexicalKey_${Z()._key}`];return t!==void 0?se(t,e):null}function qe(n,e){let t=n;for(;t!=null;){const r=Ui(t,e);if(r!==null)return r;t=vn(t)}return null}function $i(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Yi(n){return n.read(()=>G().getTextContent())}function G(){return Ki(Ie())}function Ki(n){return n._nodeMap.get("root")}function Se(n){ge();const e=Ie();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function ct(n){const e=Z(),t=function(r,i){let o=r;for(;o!=null;){const s=o[`__lexicalKey_${i._key}`];if(s!==void 0)return s;o=vn(o)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function Qi(n,e){return e?n.getTextContentSize():0}function Vi(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 Ji(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Zi(n){return n.nodeType===Re?n.nodeValue:null}function mr(n,e,t){const r=Te(e._window);if(r===null)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(i!==null){let l=Zi(i);const a=qe(i);if(l!==null&&j(a)){if(l===gn&&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]===gn&&(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 m=Z();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const c=o.getParent(),u=Jt(),f=o.getTextContentSize(),d=Fe(),g=o.getKey();if(o.isToken()||d!==null&&g===d&&!s||k(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===f&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const h=O();if(!k(h)||t===null||r===null)return void o.setTextContent(l);if(h.setTextNodeRange(o,t,o,r),o.isSegmented()){const m=ie(o.getTextContent());o.replace(m),o=m}o.setTextContent(l)}}}function Tl(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(j(s)||C(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function qi(n){return n==="ArrowLeft"}function Gi(n){return n==="ArrowRight"}function It(n,e){return me?n:e}function Hi(n){return n==="Enter"}function Dt(n){return n==="Backspace"}function Ot(n){return n==="Delete"}function Xi(n,e,t){return n.toLowerCase()==="a"&&It(e,t)}function Nl(){const n=G();Se(Fi(n.select(0,n.getChildrenSize())))}function At(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=hn(i);return t[e]=o,o}return i}function xr(n,e,t,r,i){if(t.size===0)return;const o=r.__type,s=r.__key,l=e.get(o);l===void 0&&L(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),f=u==="destroyed"&&i==="created";(u===void 0||f)&&c.set(s,f?"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 Pt(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 D(n,e,t){return Ko(n,e,t)}function yn(n){return!oe(n)&&!n.isLastChild()&&!n.isInline()}function xn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&L(75,e),t}function vn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function vr(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&&L(78),e}function bl(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 Sn(n){const e=Z(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&L(97);const i=r.replace;if(i!==null){const o=i(n);return o instanceof n.constructor||L(98),o}return n}function Cr(n,e){!oe(n.getParent())||C(e)||Y(e)||L(99)}function Sr(n){return(Y(n)||C(n)&&!n.canBeEmpty())&&!n.isInline()}function Tr(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function wl(n,e,t){let r=n._blockCursorElement;if(k(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())Sr(o.getChildAtIndex(s-1))&&(l=!0);else{const c=o.getChildAtIndex(s);if(Sr(c)){const u=c.getPreviousSibling();(u===null||Sr(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 f=u.theme,d=document.createElement("div");d.contentEditable="false",d.setAttribute("data-lexical-cursor","true");let g=f.blockCursor;if(g!==void 0){if(typeof g=="string"){const h=hn(g);g=f.blockCursor=h}g!==void 0&&d.classList.add(...g)}return d}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&Tr(r,n,e)}function Te(n){return _e?(n||window).getSelection():null}function Nr(n){return n.nodeType===1}function br(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 Tn(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 dt(n){if(oe(n)||Y(n)&&!n.isInline())return!0;if(!C(n)||ut(n))return!1;const e=n.getFirstChild(),t=e===null||Kt(e)||j(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function wr(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function Ml(){return Z()}const no=new WeakMap,El=new Map;function kl(n){if(!n._readOnly&&n.isEmpty())return El;n._readOnly||L(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 Mr(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 We,le,zt,Nn,Er,kr,Ge,ye,Lr,Rt,X="",ae="",Ne=null,xe="",Le="",io=!1,Ft=!1,bn=null;function wn(n,e){const t=Ge.get(n);if(e!==null){const r=Or(n);r.parentNode===e&&e.removeChild(r)}if(ye.has(n)||le._keyToDOMMap.delete(n),C(t)){const r=En(t,Ge);jr(r,0,r.length-1,null)}t!==void 0&&xr(Rt,zt,Nn,t,"destroyed")}function jr(n,e,t,r){let i=e;for(;i<=t;++i){const o=n[i];o!==void 0&&wn(o,r)}}function He(n,e){n.setProperty("text-align",e)}const Ll="40px";function oo(n,e){const t=We.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")||Ll;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function so(n,e){const t=n.style;e===0?He(t,""):e===ir?He(t,"left"):e===or?He(t,"center"):e===sr?He(t,"right"):e===lr?He(t,"justify"):e===ar?He(t,"start"):e===cr&&He(t,"end")}function Mn(n,e,t){const r=ye.get(n);r===void 0&&L(60);const i=r.createDOM(We,le);if(function(o,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=o,a.set(o,s)}(n,i,le),j(r)?i.setAttribute("data-lexical-text","true"):Y(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,f,d){const g=ae;ae="",Ir(c,f,0,u,d,null),co(f,d),ae=g})(En(r,ye),a,r,i)}const l=r.__format;l!==0&&so(i,l),r.isInline()||ao(null,r,i),yn(r)&&(X+=Ee,Le+=Ee)}else{const o=r.getTextContent();if(Y(r)){const s=r.decorate(le,We);s!==null&&uo(n,s),i.contentEditable="false"}else j(r)&&(r.isDirectionless()||(ae+=o));X+=o,Le+=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 xr(Rt,zt,Nn,r,"created"),i}function Ir(n,e,t,r,i,o){const s=X;X="";let l=t;for(;l<=r;++l){Mn(n[l],i,o);const a=ye.get(n[l]);a!==null&&j(a)&&(Ne===null&&(Ne=a.getFormat()),xe===""&&(xe=a.getStyle()))}yn(e)&&(X+=Ee),i.__lexicalTextContent=X,X=s+X}function lo(n,e){const t=e.get(n);return Kt(t)||Y(t)&&t.isInline()}function ao(n,e,t){const r=n!==null&&(n.__size===0||lo(n.__last,Ge)),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!==bn){const o=ae==="",s=o?bn:(i=ae,al.test(i)?"rtl":cl.test(i)?"ltr":null);if(s!==r){const l=e.classList,a=We.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 f=hn(c);c=a[r]=f}l.remove(...c)}if(s===null||o&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const f=hn(u);u=a[s]=f}u!==void 0&&l.add(...u)}e.dir=s}Ft||(n.getWritable().__dir=s)}bn=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var i}function jl(n,e,t){const r=ae;var i;ae="",Ne=null,xe="",function(o,s,l){const a=X,c=o.__size,u=s.__size;if(X="",c===1&&u===1){const f=o.__first,d=s.__first;if(f===d)Wt(f,l);else{const h=Or(f),m=Mn(d,null,null);try{l.replaceChild(m,h)}catch(_){if(typeof _=="object"&&_!=null){const v=`${_.toString()} Parent: ${l.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${h.tagName}, key: ${f}}.`;throw new Error(v)}throw _}wn(f,null)}const g=ye.get(d);j(g)&&(Ne===null&&(Ne=g.getFormat()),xe===""&&(xe=g.getStyle()))}else{const f=En(o,Ge),d=En(s,ye);if(c===0)u!==0&&Ir(d,s,0,u-1,l,null);else if(u===0){if(c!==0){const g=l.__lexicalLineBreak==null;jr(f,0,c-1,g?null:l),g&&(l.textContent="")}}else(function(g,h,m,_,v,x){const y=_-1,b=v-1;let T,S,E=(R=x,R.firstChild),N=0,M=0;for(var R;N<=y&&M<=b;){const J=h[N],F=m[M];if(J===F)E=Dr(Wt(F,x)),N++,M++;else{T===void 0&&(T=new Set(h)),S===void 0&&(S=new Set(m));const ce=S.has(J),De=T.has(F);if(ce)if(De){const Ke=xn(le,F);Ke===E?E=Dr(Wt(F,x)):(E!=null?x.insertBefore(Ke,E):x.appendChild(Ke),Wt(F,x)),N++,M++}else Mn(F,x,E),M++;else E=Dr(Or(J)),wn(J,x),N++}const V=ye.get(F);V!==null&&j(V)&&(Ne===null&&(Ne=V.getFormat()),xe===""&&(xe=V.getStyle()))}const B=N>y,ee=M>b;if(B&&!ee){const J=m[b+1];Ir(m,g,M,b,x,J===void 0?null:le.getElementByKey(J))}else ee&&!B&&jr(h,N,y,x)})(s,f,d,c,u,l)}yn(s)&&(X+=Ee),l.__lexicalTextContent=X,X=a+X}(n,e,t),co(e,t),Xr(i=e)&&Ne!=null&&Ne!==i.__textFormat&&!Ft&&(i.setTextFormat(Ne),i.setTextStyle(xe)),function(o){Xr(o)&&xe!==""&&xe!==o.__textStyle&&!Ft&&o.setTextStyle(xe)}(e),ae=r}function En(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&L(101),t.push(r),r=i.__next}return t}function Wt(n,e){const t=Ge.get(n);let r=ye.get(n);t!==void 0&&r!==void 0||L(61);const i=io||kr.has(n)||Er.has(n),o=xn(le,n);if(t===r&&!i){if(C(t)){const s=o.__lexicalTextContent;s!==void 0&&(X+=s,Le+=s);const l=o.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();j(t)&&!t.isDirectionless()&&(ae+=s),Le+=s,X+=s}return o}if(t!==r&&i&&xr(Rt,zt,Nn,r,"updated"),r.updateDOM(t,o,We)){const s=Mn(n,null,null);return e===null&&L(62),e.replaceChild(s,o),wn(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&&(jl(t,r,o),oe(r)||r.isInline()||ao(t,r,o)),yn(r)&&(X+=Ee,Le+=Ee)}else{const s=r.getTextContent();if(Y(r)){const l=r.decorate(le,We);l!==null&&uo(n,l)}else j(r)&&!r.isDirectionless()&&(ae+=s);X+=s,Le+=s}if(!Ft&&oe(r)&&r.__cachedText!==Le){const s=r.getWritable();s.__cachedText=Le,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=$i(le)}t[n]=e}function Dr(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function Il(n,e,t,r,i,o){X="",Le="",ae="",io=r===lt,bn=null,le=t,We=t._config,zt=t._nodes,Nn=le._listeners.mutation,Er=i,kr=o,Ge=n._nodeMap,ye=e._nodeMap,Ft=e._readOnly,Lr=new Map(t._keyToDOMMap);const s=new Map;return Rt=s,Wt("root",null),le=void 0,zt=void 0,Er=void 0,kr=void 0,Ge=void 0,ye=void 0,We=void 0,Lr=void 0,Rt=void 0,s}function Or(n){const e=Lr.get(n);return e===void 0&&L(75,n),e}const je=Object.freeze({}),Ar=30,Pr=[["keydown",function(n,e){if(Bt=n.timeStamp,fo=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=n;D(e,Bs,n)||t!=null&&(function(l,a,c,u){return Gi(l)&&!a&&!u&&!c}(t,i,s,o)?D(e,mi,n):function(l,a,c,u,f){return Gi(l)&&!u&&!c&&(a||f)}(t,i,r,s,o)?D(e,Us,n):function(l,a,c,u){return qi(l)&&!a&&!u&&!c}(t,i,s,o)?D(e,yi,n):function(l,a,c,u,f){return qi(l)&&!u&&!c&&(a||f)}(t,i,r,s,o)?D(e,$s,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,i,o)?D(e,xi,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,i,o)?D(e,vi,n):function(l,a){return Hi(l)&&a}(t,r)?(Ut=!0,D(e,ln,n)):function(l){return l===" "}(t)?D(e,Ys,n):function(l,a){return me&&a&&l.toLowerCase()==="o"}(t,i)?(n.preventDefault(),Ut=!0,D(e,ot,!0)):function(l,a){return Hi(l)&&!a}(t,r)?(Ut=!1,D(e,ln,n)):function(l,a,c,u){return me?!a&&!c&&(Dt(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Dt(l)}(t,s,o,i)?Dt(t)?D(e,Ci,n):(n.preventDefault(),D(e,Ve,!0)):function(l){return l==="Escape"}(t)?D(e,Si,n):function(l,a,c,u,f){return me?!(c||u||f)&&(Ot(l)||l.toLowerCase()==="d"&&a):!(a||u||f)&&Ot(l)}(t,i,r,s,o)?Ot(t)?D(e,Ti,n):(n.preventDefault(),D(e,Ve,!1)):function(l,a,c){return Dt(l)&&(me?a:c)}(t,s,i)?(n.preventDefault(),D(e,bt,!0)):function(l,a,c){return Ot(l)&&(me?a:c)}(t,s,i)?(n.preventDefault(),D(e,bt,!1)):function(l,a){return me&&a&&Dt(l)}(t,o)?(n.preventDefault(),D(e,wt,!0)):function(l,a){return me&&a&&Ot(l)}(t,o)?(n.preventDefault(),D(e,wt,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),D(e,de,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),D(e,de,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),D(e,de,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,i,o)?D(e,Ks,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&It(c,u)}(t,r,o,i)?(n.preventDefault(),D(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(),D(e,sn,void 0)):ve(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(me?c:u)}(t,r,o,i)?(n.preventDefault(),D(e,an,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(me?c:u)}(t,r,o,i)?(n.preventDefault(),D(e,Xn,n)):Xi(t,o,i)&&(n.preventDefault(),D(e,er,n)):!ze&&Xi(t,o,i)&&(n.preventDefault(),D(e,er,n)),function(l,a,c,u){return l||a||c||u}(i,r,s,o)&&D(e,Xs,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&he(e,()=>{Y(qe(t))||(Rr=!0)})}],["compositionstart",function(n,e){he(e,()=>{const t=O();if(k(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();re(r.key),(n.timeStamp<Bt+Ar||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||j(i)&&i.getStyle()!==t.style)&&D(e,st,ll)}})}],["compositionend",function(n,e){ze?$t=!0:he(e,()=>{Fr(e,n.data)})}],["input",function(n,e){n.stopPropagation(),he(e,()=>{const t=O(),r=n.data,i=yo(n);if(r!=null&&k(t)&&po(t,i,r,n.timeStamp,!1)){$t&&(Fr(e,r),$t=!1);const o=t.anchor.getNode(),s=Te(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()&&j(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+c)===Zi(s.anchorNode)||D(e,st,r);const u=r.length;ze&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),tr||un||nr||!e.isComposing()||(Bt=0,re(null))}else mr(!1,e,r!==null?r:void 0),$t&&(Fr(e,r||void 0),$t=!1);ge(),Oi(Z())}),ft=null}],["click",function(n,e){he(e,()=>{const t=O(),r=Te(e._window),i=Jt();if(r){if(k(t)){const o=t.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!oe(s)&&G().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===Lt||s===Re)&&Se(Vr(i,r,e,n))}}}D(e,_i,n)})}],["cut",je],["copy",je],["dragstart",je],["dragover",je],["dragend",je],["paste",je],["focus",je],["blur",je],["drop",je]];cn&&Pr.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,o=yo(t);i==="deleteCompositionText"||ze&&to(r)||i!=="insertCompositionText"&&he(r,()=>{const s=O();if(i==="deleteContentBackward"){if(s===null){const g=Jt();if(!k(g))return;Se(g.clone())}if(k(s)){const g=s.anchor.key===s.focus.key;if(l=t.timeStamp,fo==="MediaLast"&&l<Bt+Ar&&r.isComposing()&&g){if(re(null),Bt=0,setTimeout(()=>{he(r,()=>{re(null)})},Ar),k(s)){const h=s.anchor.getNode();h.markDirty(),s.format=h.getFormat(),j(h)||L(142),s.style=h.getStyle()}}else{re(null),t.preventDefault();const h=s.anchor.getNode().getTextContent(),m=s.anchor.offset===0&&s.focus.offset===h.length;nl&&g&&!m||D(r,Ve,!0)}return}}var l;if(!k(s))return;const a=t.data;ft!==null&&mr(!1,r,ft),s.dirty&&ft===null||!s.isCollapsed()||oe(s.anchor.getNode())||o===null||s.applyDOMRange(o),ft=null;const c=s.anchor,u=s.focus,f=c.getNode(),d=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":D(r,st,t);break;case"insertFromComposition":re(null),D(r,st,t);break;case"insertLineBreak":re(null),D(r,ot,!1);break;case"insertParagraph":re(null),Ut&&!un?(Ut=!1,D(r,ot,!1)):D(r,rn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":D(r,Gn,t);break;case"deleteByComposition":(function(g,h){return g!==h||C(g)||C(h)||!g.isToken()||!h.isToken()})(f,d)&&D(r,Hn,t);break;case"deleteByDrag":case"deleteByCut":D(r,Hn,t);break;case"deleteContent":D(r,Ve,!1);break;case"deleteWordBackward":D(r,bt,!0);break;case"deleteWordForward":D(r,bt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":D(r,wt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":D(r,wt,!1);break;case"formatStrikeThrough":D(r,de,"strikethrough");break;case"formatBold":D(r,de,"bold");break;case"formatItalic":D(r,de,"italic");break;case"formatUnderline":D(r,de,"underline");break;case"historyUndo":D(r,on,void 0);break;case"historyRedo":D(r,sn,void 0)}else{if(a===`
32
- `)t.preventDefault(),D(r,ot,!1);else if(a===Ee)t.preventDefault(),D(r,rn,void 0);else if(a==null&&t.dataTransfer){const g=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(g)}else a!=null&&po(s,o,a,t.timeStamp,!0)?(t.preventDefault(),D(r,st,a)):ft=a;go=t.timeStamp}})}(n,e)]);let Bt=0,fo=null,go=0,ft=null;const kn=new WeakMap;let zr=!1,Rr=!1,Ut=!1,$t=!1,ho=[0,"",0,"root",0];function po(n,e,t,r,i){const o=n.anchor,s=n.focus,l=o.getNode(),a=Z(),c=Te(a._window),u=c!==null?c.anchorNode:null,f=o.key,d=a.getElementByKey(f),g=t.length;return f!==s.key||!j(l)||(!i&&(!cn||go<r+50)||l.isDirty()&&g<2||Vi(t))&&o.offset!==s.offset&&!l.isComposing()||at(l)||l.isDirty()&&g>1||(i||!cn)&&d!==null&&!l.isComposing()&&u!==_n(d)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||Tl(n,l)}function _o(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===Re&&e!==0&&e!==n.nodeValue.length}function mo(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=n;zr&&(zr=!1,_o(r,i)&&_o(o,s))||he(e,()=>{if(!t)return void Se(null);if(!jt(e,r,o))return;const l=O();if(k(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,f=u?u.timeStamp:performance.now(),[d,g,h,m,_]=ho,v=G(),x=e.isComposing()===!1&&v.getTextContent()==="";if(f<_+200&&a.offset===h&&a.key===m)l.format=d,l.style=g;else if(a.type==="text")j(c)||L(141),l.format=c.getFormat(),l.style=c.getStyle();else if(a.type==="element"&&!x){const y=a.getNode();l.style="",y instanceof pt&&y.getChildrenSize()===0?(l.format=y.getTextFormat(),l.style=y.getTextStyle()):l.format=0}}else{const u=a.key,f=l.focus.key,d=l.getNodes(),g=d.length,h=l.isBackward(),m=h?s:i,_=h?i:s,v=h?f:u,x=h?u:f;let y=sl,b=!1;for(let T=0;T<g;T++){const S=d[T],E=S.getTextContentSize();if(j(S)&&E!==0&&!(T===0&&S.__key===v&&m===E||T===g-1&&S.__key===x&&_===0)&&(b=!0,y&=S.getFormat(),y===0))break}l.format=b?y:0}}D(e,nn,void 0)})}function yo(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Fr(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&&j(r)&&yr(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
33
- `){const r=O();if(k(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void D(n,ln,null)}}}mr(!0,n,e)}function xo(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const gt=new Map;function vo(n){const e=n.target,t=Te(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=Bi(t.anchorNode);if(r===null)return;Rr&&(Rr=!1,he(r,()=>{const c=Jt(),u=t.anchorNode;if(u===null)return;const f=u.nodeType;f!==Lt&&f!==Re||Se(Vr(c,t,r,n))}));const i=_r(r),o=i[i.length-1],s=o._key,l=gt.get(s),a=l||o;a!==r&&mo(t,a,!1),mo(t,r,!0),r!==o?gt.set(s,r):l&&gt.delete(s)}function Co(n){n._lexicalHandled=!0}function So(n){return n._lexicalHandled===!0}function Dl(n){const e=n.ownerDocument,t=kn.get(e);t===void 0&&L(162);const r=t-1;r>=0||L(164),kn.set(e,r),r===0&&e.removeEventListener("selectionchange",vo);const i=pn(n);hr(i)?(function(s){if(s._parentEditor!==null){const l=_r(s),a=l[l.length-1]._key;gt.get(a)===s&&gt.delete(a)}else gt.delete(s._key)}(i),n.__lexicalEditor=null):i&&L(198);const o=xo(n);for(let s=0;s<o.length;s++)o[s]();n.__lexicalEventHandles=[]}function Wr(n,e,t){ge();const r=n.__key,i=n.getParent();if(i===null)return;const o=function(l){const a=O();if(!k(a)||!C(l))return a;const{anchor:c,focus:u}=a,f=c.getNode(),d=u.getNode();return vr(f,l)&&c.set(l.__key,0,"element"),vr(d,l)&&u.set(l.__key,0,"element"),a}(n);let s=!1;if(k(o)&&e){const l=o.anchor,a=o.focus;l.key===r&&(An(l,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(An(a,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else ve(o)&&e&&n.isSelected()&&n.selectPrevious();if(k(o)&&e&&!s){const l=n.getIndexWithinParent();Ze(n),On(o,i,l,-1)}else Ze(n);t||ut(i)||i.canBeEmpty()||!i.isEmpty()||Wr(i,e),e&&oe(i)&&i.isEmpty()&&i.selectEnd()}class Ln{static getType(){L(64,this.name)}static clone(e){L(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,Sl(this,e)}getType(){return this.__type}isInline(){L(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||O();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(j(this))return r;if(k(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(Y(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&&L(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(ut(t))return C(e)||e===this&&Y(e)||L(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&L(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,f=c;do{if(f===null&&L(68),u=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||i.has(f.__key)||r.push(f)}while(u===null);o=u}return t||r.reverse(),r}isDirty(){const e=Z()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=se(this.__key);return e===null&&L(113),e}getWritable(){ge();const e=Ie(),t=Z(),r=e._nodeMap,i=this.__key,o=this.getLatest(),s=t._cloneNotNeeded,l=O();if(l!==null&&l.setCachedNodes(null),s.has(i))return mn(o),o;const a=Mr(o);return s.add(i),mn(a),r.set(i,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){L(70)}updateDOM(e,t,r){L(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){L(72)}static importJSON(e){L(18,this.name)}static transform(){return null}remove(e){Wr(this,!0,e)}replace(e,t){ge();let r=O();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;Ze(l);const u=i.getPreviousSibling(),f=i.getNextSibling(),d=i.__prev,g=i.__next,h=i.__parent;if(Wr(i,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=d,f===null?a.__last=s:f.getWritable().__prev=s,l.__next=g,l.__parent=h,a.__size=c,t&&(C(this)&&C(l)||L(139),this.getChildren().forEach(m=>{l.append(m)})),k(r)){Se(r);const m=r.anchor,_=r.focus;m.key===o&&Eo(m,l),_.key===o&&Eo(_,l)}return Fe()===o&&re(s),l}insertAfter(e,t=!0){ge(),Cr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.getParent(),s=O();let l=!1,a=!1;if(o!==null){const g=e.getIndexWithinParent();if(Ze(i),k(s)){const h=o.__key,m=s.anchor,_=s.focus;l=m.type==="element"&&m.key===h&&m.offset===g+1,a=_.type==="element"&&_.key===h&&_.offset===g+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=i.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,i.__next=d,i.__prev=r.__key,i.__parent=r.__parent,t&&k(s)){const g=this.getIndexWithinParent();On(s,u,g+1);const h=u.__key;l&&s.anchor.set(h,g+2,"element"),a&&s.focus.set(h,g+2,"element")}return e}insertBefore(e,t=!0){ge(),Cr(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.__key;Ze(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=O();return t&&k(u)&&On(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return we()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){ge();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(C(r))return r.select();if(!j(r)){const o=r.getIndexWithinParent()+1;return i.select(o,o)}return r.select(e,t)}selectNext(e,t){ge();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(C(r))return r.select(0,0);if(!j(r)){const o=r.getIndexWithinParent();return i.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}}class Yt extends Ln{static getType(){return"linebreak"}static clone(e){return new Yt(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&&Tn(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&jn(i)){const o=r.lastChild;if(o===t||o.previousSibling===t&&jn(o))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&Tn(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&jn(i))return!1;const o=r.lastChild;if(o===t||o.previousSibling===t&&jn(o))return!0}return!1}(e)?null:{conversion:Ol,priority:0}}}static importJSON(e){return Xe()}exportJSON(){return{type:"linebreak",version:1}}}function Ol(n){return{node:Xe()}}function Xe(){return Sn(new Yt)}function Kt(n){return n instanceof Yt}function jn(n){return n.nodeType===Re&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function Br(n,e){return 16&e?"code":e&rr?"mark":32&e?"sub":64&e?"sup":null}function Ur(n,e){return 1&e?"strong":2&e?"em":"span"}function To(n,e,t,r,i){const o=r.classList;let s=At(i,"base");s!==void 0&&o.add(...s),s=At(i,"underlineStrikethrough");let l=!1;const a=e&fn&&e&dn;s!==void 0&&(t&fn&&t&dn?(l=!0,a||o.add(...s)):a&&o.remove(...s));for(const c in ke){const u=ke[c];if(s=At(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 No(n,e,t){const r=e.firstChild,i=t.isComposing(),o=n+(i?gn:"");if(r==null)e.textContent=o;else{const s=r.nodeValue;if(s!==o)if(i||ze){const[l,a,c]=function(u,f){const d=u.length,g=f.length;let h=0,m=0;for(;h<d&&h<g&&u[h]===f[h];)h++;for(;m+h<d&&m+h<g&&u[d-m-1]===f[g-m-1];)m++;return[h,d-h-m,f.slice(h,g-m)]}(s,o);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=o}}function bo(n,e,t,r,i,o){No(i,n,e);const s=o.theme.text;s!==void 0&&To(0,0,r,n,s)}function In(n,e){const t=document.createElement(e);return t.appendChild(n),t}class ht extends Ln{static getType(){return"text"}static clone(e){return new ht(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 gl[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Fe()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=ke[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=Br(0,r),o=Ur(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)),bo(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=Br(0,o),a=Br(0,s),c=Ur(0,o),u=Ur(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const m=t.firstChild;m==null&&L(48);const _=document.createElement(u);return bo(_,this,0,s,i,r),t.replaceChild(_,m),!1}let f=t;a!==null&&l!==null&&(f=t.firstChild,f==null&&L(49)),No(i,f,this);const d=r.theme.text;d!==void 0&&o!==s&&To(0,o,s,f,d);const g=e.__style,h=this.__style;return g!==h&&(t.style.cssText=h),!1}static importDOM(){return{"#text":()=>({conversion:Rl,priority:0}),b:()=>({conversion:Pl,priority:0}),code:()=>({conversion:Be,priority:0}),em:()=>({conversion:Be,priority:0}),i:()=>({conversion:Be,priority:0}),s:()=>({conversion:Be,priority:0}),span:()=>({conversion:Al,priority:0}),strong:()=>({conversion:Be,priority:0}),sub:()=>({conversion:Be,priority:0}),sup:()=>({conversion:Be,priority:0}),u:()=>({conversion:Be,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&&Nr(t)||L(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=In(t,"b")),this.hasFormat("italic")&&(t=In(t,"i")),this.hasFormat("strikethrough")&&(t=In(t,"s")),this.hasFormat("underline")&&(t=In(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"?ke[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=fl[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){ge();let r=e,i=t;const o=O(),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(!k(o))return Ao(l,r,l,i,"text","text");{const a=Fe();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=O();if(i&&k(c)){const f=e+l;c.setTextNodeRange(o,f,o,f)}const u=s.slice(0,a)+r+s.slice(a+t);return o.__text=u,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){ge();const t=this.getLatest(),r=t.getTextContent(),i=t.__key,o=Fe(),s=new Set(e),l=[],a=r.length;let c="";for(let T=0;T<a;T++)c!==""&&s.has(T)&&(l.push(c),c=""),c+=r[T];c!==""&&l.push(c);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const f=l[0],d=t.getParent();let g;const h=t.getFormat(),m=t.getStyle(),_=t.__detail;let v=!1;t.isSegmented()?(g=ie(f),g.__format=h,g.__style=m,g.__detail=_,v=!0):(g=t.getWritable(),g.__text=f);const x=O(),y=[g];let b=f.length;for(let T=1;T<u;T++){const S=l[T],E=S.length,N=ie(S).getWritable();N.__format=h,N.__style=m,N.__detail=_;const M=N.__key,R=b+E;if(k(x)){const B=x.anchor,ee=x.focus;B.key===i&&B.type==="text"&&B.offset>b&&B.offset<=R&&(B.key=M,B.offset-=b,x.dirty=!0),ee.key===i&&ee.type==="text"&&ee.offset>b&&ee.offset<=R&&(ee.key=M,ee.offset-=b,x.dirty=!0)}o===i&&re(M),b=R,y.push(N)}if(d!==null){(function(E){const N=E.getPreviousSibling(),M=E.getNextSibling();N!==null&&mn(N),M!==null&&mn(M)})(this);const T=d.getWritable(),S=this.getIndexWithinParent();v?(T.splice(S,0,y),this.remove()):T.splice(S,1,y),k(x)&&On(x,d,S,u-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||L(50);const r=this.__key,i=e.__key,o=this.__text,s=o.length;Fe()===i&&re(r);const l=O();if(k(l)){const f=l.anchor,d=l.focus;f!==null&&f.key===i&&(Ro(f,t,r,e,s),l.dirty=!0),d!==null&&d.key===i&&(Ro(d,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 Al(n){return{forChild:$r(n.style),node:null}}function Pl(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:$r(e.style,t?void 0:"bold"),node:null}}const wo=new WeakMap;function zl(n){return n.nodeName==="PRE"||n.nodeType===Lt&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function Rl(n){const e=n;n.parentElement===null&&L(129);let t=e.textContent||"";if(function(r){let i,o=r.parentNode;const s=[r];for(;o!==null&&(i=wo.get(o))===void 0&&!zl(o);)s.push(o),o=o.parentNode;const l=i===void 0?o:i;for(let a=0;a<s.length;a++)wo.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===`
31
+ `,gl=ze?" ":_n,Pi="֑-߿יִ-﷽ﹰ-ﻼ",Ri="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",hl=new RegExp("^[^"+Ri+"]*["+Pi+"]"),pl=new RegExp("^[^"+Pi+"]*["+Ri+"]"),Me={bold:1,code:16,highlight:lr,italic:2,strikethrough:pn,subscript:32,superscript:64,underline:mn},ml={directionless:1,unmergeable:2},zi={center:cr,end:gr,justify:dr,left:ar,right:ur,start:fr},_l={[cr]:"center",[gr]:"end",[dr]:"justify",[ar]:"left",[ur]:"right",[fr]:"start"},yl={normal:0,segmented:2,token:1},xl={[cl]:"normal",[dl]:"segmented",[ul]:"token"};function vl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var D=vl(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 yn(...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 Cl=100;let hr=!1,pr=0;function bl(n){pr=n.timeStamp}function mr(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function Sl(n,e,t){const r=Se(t._window);let o=null,i=null;r!==null&&r.anchorNode===n&&(o=r.anchorOffset,i=r.focusOffset);const s=n.nodeValue;s!==null&&br(e,s,o,i,!1)}function Tl(n,e,t){if(k(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===Fe&&t.isAttached()}function Fi(n,e,t){hr=!0;const r=performance.now()-pr>Cl;try{he(n,()=>{const o=A()||function(d){return d.getEditorState().read(()=>{const g=A();return g!==null?g.clone():null})}(n),i=new Map,s=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let d=0;d<e.length;d++){const g=e[d],h=g.type,m=g.target;let _=Ge(m,l);if(!(_===null&&m!==s||Y(_))){if(h==="characterData")r&&I(_)&&Tl(o,m,_)&&Sl(m,_,n);else if(h==="childList"){c=!0;const v=g.addedNodes;for(let b=0;b<v.length;b++){const C=v[b],T=Ji(C),M=C.parentNode;if(M!=null&&C!==a&&T===null&&(C.nodeName!=="BR"||!mr(C,M,n))){if(ze){const w=C.innerText||C.nodeValue;w&&(u+=w)}M.removeChild(C)}}const x=g.removedNodes,y=x.length;if(y>0){let b=0;for(let C=0;C<y;C++){const T=x[C];(T.nodeName==="BR"&&mr(T,m,n)||a===T)&&(m.appendChild(T),b++)}y!==b&&(m===s&&(_=Gi(l)),i.set(m,_))}}}}if(i.size>0)for(const[d,g]of i)if(S(g)){const h=g.getChildrenKeys();let m=d.firstChild;for(let _=0;_<h.length;_++){const v=h[_],x=n.getElementByKey(v);x!==null&&(m==null?(d.appendChild(x),m=x):m!==x&&d.replaceChild(x,m),m=m.nextSibling)}}else I(g)&&g.markDirty();const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const g=f[d],h=g.addedNodes,m=g.target;for(let _=0;_<h.length;_++){const v=h[_],x=v.parentNode;x==null||v.nodeName!=="BR"||mr(v,m,n)||x.removeChild(v)}}t.takeRecords()}o!==null&&(c&&(o.dirty=!0,be(o)),ze&&lo(n)&&o.insertRawText(u))})}finally{hr=!1}}function Wi(n){const e=n._observer;e!==null&&Fi(n,e.takeRecords(),e)}function Bi(n){(function(e){pr===0&&wn(e).addEventListener("textInput",bl,!0)})(n),n._observer=new MutationObserver((e,t)=>{Fi(n,e,t)})}function $i(n,e){const t=n.__mode,r=n.__format,o=n.__style,i=e.__mode,s=e.__format,l=e.__style;return!(t!==null&&t!==i||r!==null&&r!==s||o!==null&&o!==l)}function Ui(n,e){const t=n.mergeWithSibling(e),r=Q()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Yi(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&I(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if($i(e,r)){r=Ui(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&I(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if($i(r,t)){r=Ui(r,t);break}break}t.remove()}}else r.remove()}function Ki(n){return Vi(n.anchor),Vi(n.focus),n}function Vi(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),I(r)){n.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!S(r))break;n.set(r.__key,o?r.getChildrenSize():0,"element")}}let wl=1;const Nl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function _r(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return Y(Ge(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&xn(e)==null)}function At(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!_r(e)&&Zi(e)===n}catch{return!1}}function yr(n){return n instanceof Un}function Zi(n){let e=n;for(;e!=null;){const t=xn(e);if(yr(t))return t;e=Tn(e)}return null}function xn(n){return n?n.__lexicalEditor:null}function Ie(n){return n.isToken()||n.isSegmented()}function El(n){return n.nodeType===Fe}function vn(n){let e=n;for(;e!=null;){if(El(e))return e;e=e.firstChild}return null}function xr(n,e,t){const r=Me[e];if(t!==null&&(n&r)==(t&r))return n;let o=n^r;return e==="subscript"?o&=~Me.superscript:e==="superscript"&&(o&=~Me.subscript),o}function kl(n,e){if(e!=null)return void(n.__key=e);ge(),Vo();const t=Q(),r=Oe(),o=""+wl++;r._nodeMap.set(o,n),S(n)?t._dirtyElements.set(o,!0):t._dirtyLeaves.add(o),t._cloneNotNeeded.add(o),t._dirtyType=Ai,n.__key=o}function He(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),o=n.getPreviousSibling(),i=n.getNextSibling();if(o===null)if(i!==null){const s=i.getWritable();r.__first=i.__key,s.__prev=null}else r.__first=null;else{const s=o.getWritable();if(i!==null){const l=i.getWritable();l.__prev=s.__key,s.__next=l.__key}else s.__next=null;t.__prev=null}if(i===null)if(o!==null){const s=o.getWritable();r.__last=o.__key,s.__next=null}else r.__last=null;else{const s=i.getWritable();if(o!==null){const l=o.getWritable();l.__next=s.__key,s.__prev=l.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function Cn(n){Vo();const e=n.getLatest(),t=e.__parent,r=Oe(),o=Q(),i=r._nodeMap,s=o._dirtyElements;t!==null&&function(a,c,u){let f=a;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}}(t,i,s);const l=e.__key;o._dirtyType=Ai,S(n)?s.set(l,!0):o._dirtyLeaves.add(l)}function re(n){ge();const e=Q(),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 qt()?null:Q()._compositionKey}function se(n,e){const t=(e||Oe())._nodeMap.get(n);return t===void 0?null:t}function Ji(n,e){const t=n[`__lexicalKey_${Q()._key}`];return t!==void 0?se(t,e):null}function Ge(n,e){let t=n;for(;t!=null;){const r=Ji(t,e);if(r!==null)return r;t=Tn(t)}return null}function Qi(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Hi(n){return n.read(()=>G().getTextContent())}function G(){return Gi(Oe())}function Gi(n){return n._nodeMap.get("root")}function be(n){ge();const e=Oe();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function ft(n){const e=Q(),t=function(r,o){let i=r;for(;i!=null;){const s=i[`__lexicalKey_${o._key}`];if(s!==void 0)return s;i=Tn(i)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function Xi(n,e){return e?n.getTextContentSize():0}function qi(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function vr(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function eo(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function to(n){return n.nodeType===Fe?n.nodeValue:null}function Cr(n,e,t){const r=Se(e._window);if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let l=to(o);const a=Ge(o);if(l!==null&&I(a)){if(l===_n&&t){const c=t.length;l=t,i=c,s=c}l!==null&&br(a,l,i,s,n)}}}function br(n,e,t,r,o){let i=n;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let l=e;(s||o)&&e[e.length-1]===_n&&(l=e.slice(0,-1));const a=i.getTextContent();if(o||l!==a){if(l===""){if(re(null),or||hn||sr)i.remove();else{const m=Q();setTimeout(()=>{m.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=Xt(),f=i.getTextContentSize(),d=We(),g=i.getKey();if(i.isToken()||d!==null&&g===d&&!s||k(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===n.__key&&u.focus.offset===f&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const h=A();if(!k(h)||t===null||r===null)return void i.setTextContent(l);if(h.setTextNodeRange(i,t,i,r),i.isSegmented()){const m=ie(i.getTextContent());i.replace(m),i=m}i.setTextContent(l)}}}function Ml(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(i){const s=i.getPreviousSibling();return(I(s)||S(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||o)}function no(n){return n==="ArrowLeft"}function ro(n){return n==="ArrowRight"}function Pt(n,e){return _e?n:e}function io(n){return n==="Enter"}function Rt(n){return n==="Backspace"}function zt(n){return n==="Delete"}function oo(n,e,t){return n.toLowerCase()==="a"&&Pt(e,t)}function Il(){const n=G();be(Ki(n.select(0,n.getChildrenSize())))}function Ft(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 i=yn(o);return t[e]=i,i}return o}function Sr(n,e,t,r,o){if(t.size===0)return;const i=r.__type,s=r.__key,l=e.get(i);l===void 0&&D(33,i);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(s),f=u==="destroyed"&&o==="created";(u===void 0||f)&&c.set(s,f?"updated":o)}function so(n,e,t){const r=n.getParent();let o=t,i=n;return r!==null&&(e&&t===0?(o=i.getIndexWithinParent(),i=r):e||t!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(e?o-1:o)}function Wt(n,e){const t=n.offset;if(n.type==="element")return so(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?so(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):o}}return null}function lo(n){const e=wn(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function O(n,e,t){return Go(n,e,t)}function bn(n){return!oe(n)&&!n.isLastChild()&&!n.isInline()}function Sn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&D(75,e),t}function Tn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function Tr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function wn(n){const e=n._window;return e===null&&D(78),e}function Dl(n){let e=n.getParentOrThrow();for(;e!==null;){if(gt(e))return e;e=e.getParentOrThrow()}return e}function gt(n){return oe(n)||S(n)&&n.isShadowRoot()}function Nn(n){const e=Q(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&D(97);const o=r.replace;if(o!==null){const i=o(n);return i instanceof n.constructor||D(98),i}return n}function wr(n,e){!oe(n.getParent())||S(e)||Y(e)||D(99)}function Nr(n){return(Y(n)||S(n)&&!n.canBeEmpty())&&!n.isInline()}function Er(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Ll(n,e,t){let r=n._blockCursorElement;if(k(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const o=t.anchor,i=o.getNode(),s=o.offset;let l=!1,a=null;if(s===i.getChildrenSize())Nr(i.getChildAtIndex(s-1))&&(l=!0);else{const c=i.getChildAtIndex(s);if(Nr(c)){const u=c.getPreviousSibling();(u===null||Nr(u))&&(l=!0,a=n.getElementByKey(c.__key))}}if(l){const c=n.getElementByKey(i.__key);return r===null&&(n._blockCursorElement=r=function(u){const f=u.theme,d=document.createElement("div");d.contentEditable="false",d.setAttribute("data-lexical-cursor","true");let g=f.blockCursor;if(g!==void 0){if(typeof g=="string"){const h=yn(g);g=f.blockCursor=h}g!==void 0&&d.classList.add(...g)}return d}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&Er(r,n,e)}function Se(n){return me?(n||window).getSelection():null}function kr(n){return n.nodeType===1}function Mr(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 En(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 ht(n){if(oe(n)||Y(n)&&!n.isInline())return!0;if(!S(n)||gt(n))return!1;const e=n.getFirstChild(),t=e===null||Qt(e)||I(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Ir(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function Ol(){return Q()}const ao=new WeakMap,jl=new Map;function Al(n){if(!n._readOnly&&n.isEmpty())return jl;n._readOnly||D(192);let e=ao.get(n);if(!e){e=new Map,ao.set(n,e);for(const[t,r]of n._nodeMap){const o=r.__type;let i=e.get(o);i||(i=new Map,e.set(o,i)),i.set(t,r)}}return e}function Dr(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function co(n,e,t,r,o,i){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(S(s)&&co(s,l,t,r,o,i),t.has(l)||i.delete(l),o.push(l)),s=s.getNextSibling()}}let Be,le,Bt,kn,Lr,Or,Xe,ye,jr,$t,q="",ae="",Te=null,xe="",De="",uo=!1,Ut=!1,Mn=null;function In(n,e){const t=Xe.get(n);if(e!==null){const r=zr(n);r.parentNode===e&&e.removeChild(r)}if(ye.has(n)||le._keyToDOMMap.delete(n),S(t)){const r=Ln(t,Xe);Ar(r,0,r.length-1,null)}t!==void 0&&Sr($t,Bt,kn,t,"destroyed")}function Ar(n,e,t,r){let o=e;for(;o<=t;++o){const i=n[o];i!==void 0&&In(i,r)}}function qe(n,e){n.setProperty("text-align",e)}const Pl="40px";function fo(n,e){const t=Be.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")||Pl;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function go(n,e){const t=n.style;e===0?qe(t,""):e===ar?qe(t,"left"):e===cr?qe(t,"center"):e===ur?qe(t,"right"):e===dr?qe(t,"justify"):e===fr?qe(t,"start"):e===gr&&qe(t,"end")}function Dn(n,e,t){const r=ye.get(n);r===void 0&&D(60);const o=r.createDOM(Be,le);if(function(i,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=i,a.set(i,s)}(n,o,le),I(r)?o.setAttribute("data-lexical-text","true"):Y(r)&&o.setAttribute("data-lexical-decorator","true"),S(r)){const i=r.__indent,s=r.__size;if(i!==0&&fo(o,i),s!==0){const a=s-1;(function(c,u,f,d){const g=ae;ae="",Pr(c,f,0,u,d,null),mo(f,d),ae=g})(Ln(r,ye),a,r,o)}const l=r.__format;l!==0&&go(o,l),r.isInline()||po(null,r,o),bn(r)&&(q+=ke,De+=ke)}else{const i=r.getTextContent();if(Y(r)){const s=r.decorate(le,Be);s!==null&&_o(n,s),o.contentEditable="false"}else I(r)&&(r.isDirectionless()||(ae+=i));q+=i,De+=i}if(e!==null)if(t!=null)e.insertBefore(o,t);else{const i=e.__lexicalLineBreak;i!=null?e.insertBefore(o,i):e.appendChild(o)}return Sr($t,Bt,kn,r,"created"),o}function Pr(n,e,t,r,o,i){const s=q;q="";let l=t;for(;l<=r;++l){Dn(n[l],o,i);const a=ye.get(n[l]);a!==null&&I(a)&&(Te===null&&(Te=a.getFormat()),xe===""&&(xe=a.getStyle()))}bn(e)&&(q+=ke),o.__lexicalTextContent=q,q=s+q}function ho(n,e){const t=e.get(n);return Qt(t)||Y(t)&&t.isInline()}function po(n,e,t){const r=n!==null&&(n.__size===0||ho(n.__last,Xe)),o=e.__size===0||ho(e.__last,ye);if(r){if(!o){const i=t.__lexicalLineBreak;if(i!=null)try{t.removeChild(i)}catch(s){if(typeof s=="object"&&s!=null){const l=`${s.toString()} Parent: ${t.tagName}, child: ${i.tagName}.`;throw new Error(l)}throw s}t.__lexicalLineBreak=null}}else if(o){const i=document.createElement("br");t.__lexicalLineBreak=i,t.appendChild(i)}}function mo(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ae||r!==Mn){const i=ae==="",s=i?Mn:(o=ae,hl.test(o)?"rtl":pl.test(o)?"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 f=yn(c);c=a[r]=f}l.remove(...c)}if(s===null||i&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const f=yn(u);u=a[s]=f}u!==void 0&&l.add(...u)}e.dir=s}Ut||(n.getWritable().__dir=s)}Mn=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var o}function Rl(n,e,t){const r=ae;var o;ae="",Te=null,xe="",function(i,s,l){const a=q,c=i.__size,u=s.__size;if(q="",c===1&&u===1){const f=i.__first,d=s.__first;if(f===d)Yt(f,l);else{const h=zr(f),m=Dn(d,null,null);try{l.replaceChild(m,h)}catch(_){if(typeof _=="object"&&_!=null){const v=`${_.toString()} Parent: ${l.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${h.tagName}, key: ${f}}.`;throw new Error(v)}throw _}In(f,null)}const g=ye.get(d);I(g)&&(Te===null&&(Te=g.getFormat()),xe===""&&(xe=g.getStyle()))}else{const f=Ln(i,Xe),d=Ln(s,ye);if(c===0)u!==0&&Pr(d,s,0,u-1,l,null);else if(u===0){if(c!==0){const g=l.__lexicalLineBreak==null;Ar(f,0,c-1,g?null:l),g&&(l.textContent="")}}else(function(g,h,m,_,v,x){const y=_-1,b=v-1;let C,T,M=(z=x,z.firstChild),w=0,E=0;for(var z;w<=y&&E<=b;){const J=h[w],F=m[E];if(J===F)M=Rr(Yt(F,x)),w++,E++;else{C===void 0&&(C=new Set(h)),T===void 0&&(T=new Set(m));const ce=T.has(J),je=C.has(F);if(ce)if(je){const Ve=Sn(le,F);Ve===M?M=Rr(Yt(F,x)):(M!=null?x.insertBefore(Ve,M):x.appendChild(Ve),Yt(F,x)),w++,E++}else Dn(F,x,M),E++;else M=Rr(zr(J)),In(J,x),w++}const Z=ye.get(F);Z!==null&&I(Z)&&(Te===null&&(Te=Z.getFormat()),xe===""&&(xe=Z.getStyle()))}const B=w>y,ee=E>b;if(B&&!ee){const J=m[b+1];Pr(m,g,E,b,x,J===void 0?null:le.getElementByKey(J))}else ee&&!B&&Ar(h,w,y,x)})(s,f,d,c,u,l)}bn(s)&&(q+=ke),l.__lexicalTextContent=q,q=a+q}(n,e,t),mo(e,t),ri(o=e)&&Te!=null&&Te!==o.__textFormat&&!Ut&&(o.setTextFormat(Te),o.setTextStyle(xe)),function(i){ri(i)&&xe!==""&&xe!==i.__textStyle&&!Ut&&i.setTextStyle(xe)}(e),ae=r}function Ln(n,e){const t=[];let r=n.__first;for(;r!==null;){const o=e.get(r);o===void 0&&D(101),t.push(r),r=o.__next}return t}function Yt(n,e){const t=Xe.get(n);let r=ye.get(n);t!==void 0&&r!==void 0||D(61);const o=uo||Or.has(n)||Lr.has(n),i=Sn(le,n);if(t===r&&!o){if(S(t)){const s=i.__lexicalTextContent;s!==void 0&&(q+=s,De+=s);const l=i.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();I(t)&&!t.isDirectionless()&&(ae+=s),De+=s,q+=s}return i}if(t!==r&&o&&Sr($t,Bt,kn,r,"updated"),r.updateDOM(t,i,Be)){const s=Dn(n,null,null);return e===null&&D(62),e.replaceChild(s,i),In(n,null),s}if(S(t)&&S(r)){const s=r.__indent;s!==t.__indent&&fo(i,s);const l=r.__format;l!==t.__format&&go(i,l),o&&(Rl(t,r,i),oe(r)||r.isInline()||po(t,r,i)),bn(r)&&(q+=ke,De+=ke)}else{const s=r.getTextContent();if(Y(r)){const l=r.decorate(le,Be);l!==null&&_o(n,l)}else I(r)&&!r.isDirectionless()&&(ae+=s);q+=s,De+=s}if(!Ut&&oe(r)&&r.__cachedText!==De){const s=r.getWritable();s.__cachedText=De,r=s}return i}function _o(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=Qi(le)}t[n]=e}function Rr(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function zl(n,e,t,r,o,i){q="",De="",ae="",uo=r===dt,Mn=null,le=t,Be=t._config,Bt=t._nodes,kn=le._listeners.mutation,Lr=o,Or=i,Xe=n._nodeMap,ye=e._nodeMap,Ut=e._readOnly,jr=new Map(t._keyToDOMMap);const s=new Map;return $t=s,Yt("root",null),le=void 0,Bt=void 0,Lr=void 0,Or=void 0,Xe=void 0,ye=void 0,Be=void 0,jr=void 0,$t=void 0,s}function zr(n){const e=jr.get(n);return e===void 0&&D(75,n),e}const Le=Object.freeze({}),Fr=30,Wr=[["keydown",function(n,e){if(Kt=n.timeStamp,yo=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:o,metaKey:i,altKey:s}=n;O(e,Zs,n)||t!=null&&(function(l,a,c,u){return ro(l)&&!a&&!u&&!c}(t,o,s,i)?O(e,Si,n):function(l,a,c,u,f){return ro(l)&&!u&&!c&&(a||f)}(t,o,r,s,i)?O(e,Js,n):function(l,a,c,u){return no(l)&&!a&&!u&&!c}(t,o,s,i)?O(e,Ti,n):function(l,a,c,u,f){return no(l)&&!u&&!c&&(a||f)}(t,o,r,s,i)?O(e,Qs,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,o,i)?O(e,wi,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,o,i)?O(e,Ni,n):function(l,a){return io(l)&&a}(t,r)?(Vt=!0,O(e,dn,n)):function(l){return l===" "}(t)?O(e,Hs,n):function(l,a){return _e&&a&&l.toLowerCase()==="o"}(t,o)?(n.preventDefault(),Vt=!0,O(e,ct,!0)):function(l,a){return io(l)&&!a}(t,r)?(Vt=!1,O(e,dn,n)):function(l,a,c,u){return _e?!a&&!c&&(Rt(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Rt(l)}(t,s,i,o)?Rt(t)?O(e,Ei,n):(n.preventDefault(),O(e,Je,!0)):function(l){return l==="Escape"}(t)?O(e,ki,n):function(l,a,c,u,f){return _e?!(c||u||f)&&(zt(l)||l.toLowerCase()==="d"&&a):!(a||u||f)&&zt(l)}(t,o,r,s,i)?zt(t)?O(e,Mi,n):(n.preventDefault(),O(e,Je,!1)):function(l,a,c){return Rt(l)&&(_e?a:c)}(t,s,o)?(n.preventDefault(),O(e,Mt,!0)):function(l,a,c){return zt(l)&&(_e?a:c)}(t,s,o)?(n.preventDefault(),O(e,Mt,!1)):function(l,a){return _e&&a&&Rt(l)}(t,i)?(n.preventDefault(),O(e,It,!0)):function(l,a){return _e&&a&&zt(l)}(t,i)?(n.preventDefault(),O(e,It,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&Pt(c,u)}(t,s,i,o)?(n.preventDefault(),O(e,de,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&Pt(c,u)}(t,s,i,o)?(n.preventDefault(),O(e,de,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&Pt(c,u)}(t,s,i,o)?(n.preventDefault(),O(e,de,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,o,i)?O(e,Gs,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&Pt(c,u)}(t,r,i,o)?(n.preventDefault(),O(e,cn,void 0)):function(l,a,c,u){return _e?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,i,o)?(n.preventDefault(),O(e,un,void 0)):ve(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(_e?c:u)}(t,r,i,o)?(n.preventDefault(),O(e,fn,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(_e?c:u)}(t,r,i,o)?(n.preventDefault(),O(e,rr,n)):oo(t,i,o)&&(n.preventDefault(),O(e,ir,n)):!ze&&oo(t,i,o)&&(n.preventDefault(),O(e,ir,n)),function(l,a,c,u){return l||a||c||u}(o,r,s,i)&&O(e,ol,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&he(e,()=>{Y(Ge(t))||($r=!0)})}],["compositionstart",function(n,e){he(e,()=>{const t=A();if(k(t)&&!e.isComposing()){const r=t.anchor,o=t.anchor.getNode();re(r.key),(n.timeStamp<Kt+Fr||r.type==="element"||!t.isCollapsed()||o.getFormat()!==t.format||I(o)&&o.getStyle()!==t.style)&&O(e,ut,gl)}})}],["compositionend",function(n,e){ze?Zt=!0:he(e,()=>{Ur(e,n.data)})}],["input",function(n,e){n.stopPropagation(),he(e,()=>{const t=A(),r=n.data,o=To(n);if(r!=null&&k(t)&&Co(t,o,r,n.timeStamp,!1)){Zt&&(Ur(e,r),Zt=!1);const i=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;gn&&!t.isCollapsed()&&I(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+c)===to(s.anchorNode)||O(e,ut,r);const u=r.length;ze&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),or||hn||sr||!e.isComposing()||(Kt=0,re(null))}else Cr(!1,e,r!==null?r:void 0),Zt&&(Ur(e,r||void 0),Zt=!1);ge(),Wi(Q())}),pt=null}],["click",function(n,e){he(e,()=>{const t=A(),r=Se(e._window),o=Xt();if(r){if(k(t)){const i=t.anchor,s=i.getNode();i.type==="element"&&i.offset===0&&t.isCollapsed()&&!oe(s)&&G().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&t.is(o)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(S(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const i=r.anchorNode;if(i!==null){const s=i.nodeType;(s===jt||s===Fe)&&be(Gr(o,r,e,n))}}}O(e,bi,n)})}],["cut",Le],["copy",Le],["dragstart",Le],["dragover",Le],["dragend",Le],["paste",Le],["focus",Le],["blur",Le],["drop",Le]];gn&&Wr.push(["beforeinput",(n,e)=>function(t,r){const o=t.inputType,i=To(t);o==="deleteCompositionText"||ze&&lo(r)||o!=="insertCompositionText"&&he(r,()=>{const s=A();if(o==="deleteContentBackward"){if(s===null){const g=Xt();if(!k(g))return;be(g.clone())}if(k(s)){const g=s.anchor.key===s.focus.key;if(l=t.timeStamp,yo==="MediaLast"&&l<Kt+Fr&&r.isComposing()&&g){if(re(null),Kt=0,setTimeout(()=>{he(r,()=>{re(null)})},Fr),k(s)){const h=s.anchor.getNode();h.markDirty(),s.format=h.getFormat(),I(h)||D(142),s.style=h.getStyle()}}else{re(null),t.preventDefault();const h=s.anchor.getNode().getTextContent(),m=s.anchor.offset===0&&s.focus.offset===h.length;al&&g&&!m||O(r,Je,!0)}return}}var l;if(!k(s))return;const a=t.data;pt!==null&&Cr(!1,r,pt),s.dirty&&pt===null||!s.isCollapsed()||oe(s.anchor.getNode())||i===null||s.applyDOMRange(i),pt=null;const c=s.anchor,u=s.focus,f=c.getNode(),d=u.getNode();if(o!=="insertText"&&o!=="insertTranspose")switch(t.preventDefault(),o){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":O(r,ut,t);break;case"insertFromComposition":re(null),O(r,ut,t);break;case"insertLineBreak":re(null),O(r,ct,!1);break;case"insertParagraph":re(null),Vt&&!hn?(Vt=!1,O(r,ct,!1)):O(r,an,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":O(r,tr,t);break;case"deleteByComposition":(function(g,h){return g!==h||S(g)||S(h)||!g.isToken()||!h.isToken()})(f,d)&&O(r,nr,t);break;case"deleteByDrag":case"deleteByCut":O(r,nr,t);break;case"deleteContent":O(r,Je,!1);break;case"deleteWordBackward":O(r,Mt,!0);break;case"deleteWordForward":O(r,Mt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":O(r,It,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":O(r,It,!1);break;case"formatStrikeThrough":O(r,de,"strikethrough");break;case"formatBold":O(r,de,"bold");break;case"formatItalic":O(r,de,"italic");break;case"formatUnderline":O(r,de,"underline");break;case"historyUndo":O(r,cn,void 0);break;case"historyRedo":O(r,un,void 0)}else{if(a===`
32
+ `)t.preventDefault(),O(r,ct,!1);else if(a===ke)t.preventDefault(),O(r,an,void 0);else if(a==null&&t.dataTransfer){const g=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(g)}else a!=null&&Co(s,i,a,t.timeStamp,!0)?(t.preventDefault(),O(r,ut,a)):pt=a;xo=t.timeStamp}})}(n,e)]);let Kt=0,yo=null,xo=0,pt=null;const On=new WeakMap;let Br=!1,$r=!1,Vt=!1,Zt=!1,vo=[0,"",0,"root",0];function Co(n,e,t,r,o){const i=n.anchor,s=n.focus,l=i.getNode(),a=Q(),c=Se(a._window),u=c!==null?c.anchorNode:null,f=i.key,d=a.getElementByKey(f),g=t.length;return f!==s.key||!I(l)||(!o&&(!gn||xo<r+50)||l.isDirty()&&g<2||qi(t))&&i.offset!==s.offset&&!l.isComposing()||Ie(l)||l.isDirty()&&g>1||(o||!gn)&&d!==null&&!l.isComposing()&&u!==vn(d)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||Ml(n,l)}function bo(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===Fe&&e!==0&&e!==n.nodeValue.length}function So(n,e,t){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=n;Br&&(Br=!1,bo(r,o)&&bo(i,s))||he(e,()=>{if(!t)return void be(null);if(!At(e,r,i))return;const l=A();if(k(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=wn(e).event,f=u?u.timeStamp:performance.now(),[d,g,h,m,_]=vo,v=G(),x=e.isComposing()===!1&&v.getTextContent()==="";if(f<_+200&&a.offset===h&&a.key===m)l.format=d,l.style=g;else if(a.type==="text")I(c)||D(141),l.format=c.getFormat(),l.style=c.getStyle();else if(a.type==="element"&&!x){const y=a.getNode();l.style="",y instanceof yt&&y.getChildrenSize()===0?(l.format=y.getTextFormat(),l.style=y.getTextStyle()):l.format=0}}else{const u=a.key,f=l.focus.key,d=l.getNodes(),g=d.length,h=l.isBackward(),m=h?s:o,_=h?o:s,v=h?f:u,x=h?u:f;let y=fl,b=!1;for(let C=0;C<g;C++){const T=d[C],M=T.getTextContentSize();if(I(T)&&M!==0&&!(C===0&&T.__key===v&&m===M||C===g-1&&T.__key===x&&_===0)&&(b=!0,y&=T.getFormat(),y===0))break}l.format=b?y:0}}O(e,ln,void 0)})}function To(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Ur(n,e){const t=n._compositionKey;if(re(null),t!==null&&e!=null){if(e===""){const r=se(t),o=vn(n.getElementByKey(t));return void(o!==null&&o.nodeValue!==null&&I(r)&&br(r,o.nodeValue,null,null,!0))}if(e[e.length-1]===`
33
+ `){const r=A();if(k(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void O(n,dn,null)}}}Cr(!0,n,e)}function wo(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const mt=new Map;function No(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;$r&&($r=!1,he(r,()=>{const c=Xt(),u=t.anchorNode;if(u===null)return;const f=u.nodeType;f!==jt&&f!==Fe||be(Gr(c,t,r,n))}));const o=vr(r),i=o[o.length-1],s=i._key,l=mt.get(s),a=l||i;a!==r&&So(t,a,!1),So(t,r,!0),r!==i?mt.set(s,r):l&&mt.delete(s)}function Eo(n){n._lexicalHandled=!0}function ko(n){return n._lexicalHandled===!0}function Fl(n){const e=n.ownerDocument,t=On.get(e);t===void 0&&D(162);const r=t-1;r>=0||D(164),On.set(e,r),r===0&&e.removeEventListener("selectionchange",No);const o=xn(n);yr(o)?(function(s){if(s._parentEditor!==null){const l=vr(s),a=l[l.length-1]._key;mt.get(a)===s&&mt.delete(a)}else mt.delete(s._key)}(o),n.__lexicalEditor=null):o&&D(198);const i=wo(n);for(let s=0;s<i.length;s++)i[s]();n.__lexicalEventHandles=[]}function Yr(n,e,t){ge();const r=n.__key,o=n.getParent();if(o===null)return;const i=function(l){const a=A();if(!k(a)||!S(l))return a;const{anchor:c,focus:u}=a,f=c.getNode(),d=u.getNode();return Tr(f,l)&&c.set(l.__key,0,"element"),Tr(d,l)&&u.set(l.__key,0,"element"),a}(n);let s=!1;if(k(i)&&e){const l=i.anchor,a=i.focus;l.key===r&&(Fn(l,n,o,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(Fn(a,n,o,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else ve(i)&&e&&n.isSelected()&&n.selectPrevious();if(k(i)&&e&&!s){const l=n.getIndexWithinParent();He(n),zn(i,o,l,-1)}else He(n);t||gt(o)||o.canBeEmpty()||!o.isEmpty()||Yr(o,e),e&&oe(o)&&o.isEmpty()&&o.selectEnd()}class jn{static getType(){D(64,this.name)}static clone(e){D(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,kl(this,e)}getType(){return this.__type}isInline(){D(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||A();if(t==null)return!1;const r=t.getNodes().some(o=>o.__key===this.__key);if(I(this))return r;if(k(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const o=this.getParent();if(Y(this)&&this.isInline()&&o){const i=t.isBackward()?t.focus:t.anchor,s=i.getNode();if(i.offset===s.getChildrenSize()&&s.is(o)&&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&&D(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(gt(t))return S(e)||e===this&&Y(e)||D(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&D(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();S(this)&&t.unshift(this),S(e)&&r.unshift(e);const o=t.length,i=r.length;if(o===0||i===0||t[o-1]!==r[i-1])return null;const s=new Set(r);for(let l=0;l<o;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,o=0,i=this;for(;;){const s=i.getParentOrThrow();if(s===t){r=i.getIndexWithinParent();break}i=s}for(i=e;;){const s=i.getParentOrThrow();if(s===t){o=i.getIndexWithinParent();break}i=s}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 i=this;for(;i!==null;){const s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===e)break;const l=S(i)?t?i.getFirstChild():i.getLastChild():null;if(l!==null){i=l;continue}const a=t?i.getNextSibling():i.getPreviousSibling();if(a!==null){i=a;continue}const c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===e)break;let u=null,f=c;do{if(f===null&&D(68),u=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||o.has(f.__key)||r.push(f)}while(u===null);i=u}return t||r.reverse(),r}isDirty(){const e=Q()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=se(this.__key);return e===null&&D(113),e}getWritable(){ge();const e=Oe(),t=Q(),r=e._nodeMap,o=this.__key,i=this.getLatest(),s=t._cloneNotNeeded,l=A();if(l!==null&&l.setCachedNodes(null),s.has(o))return Cn(i),i;const a=Dr(i);return s.add(o),Cn(a),r.set(o,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){D(70)}updateDOM(e,t,r){D(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){D(72)}static importJSON(e){D(18,this.name)}static transform(){return null}remove(e){Yr(this,!0,e)}replace(e,t){ge();let r=A();r!==null&&(r=r.clone()),wr(this,e);const o=this.getLatest(),i=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;He(l);const u=o.getPreviousSibling(),f=o.getNextSibling(),d=o.__prev,g=o.__next,h=o.__parent;if(Yr(o,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=d,f===null?a.__last=s:f.getWritable().__prev=s,l.__next=g,l.__parent=h,a.__size=c,t&&(S(this)&&S(l)||D(139),this.getChildren().forEach(m=>{l.append(m)})),k(r)){be(r);const m=r.anchor,_=r.focus;m.key===i&&jo(m,l),_.key===i&&jo(_,l)}return We()===i&&re(s),l}insertAfter(e,t=!0){ge(),wr(this,e);const r=this.getWritable(),o=e.getWritable(),i=o.getParent(),s=A();let l=!1,a=!1;if(i!==null){const g=e.getIndexWithinParent();if(He(o),k(s)){const h=i.__key,m=s.anchor,_=s.focus;l=m.type==="element"&&m.key===h&&m.offset===g+1,a=_.type==="element"&&_.key===h&&_.offset===g+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=o.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,o.__next=d,o.__prev=r.__key,o.__parent=r.__parent,t&&k(s)){const g=this.getIndexWithinParent();zn(s,u,g+1);const h=u.__key;l&&s.anchor.set(h,g+2,"element"),a&&s.focus.set(h,g+2,"element")}return e}insertBefore(e,t=!0){ge(),wr(this,e);const r=this.getWritable(),o=e.getWritable(),i=o.__key;He(o);const s=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();s===null?l.__first=i:s.getWritable().__next=i,l.__size++,r.__prev=i,o.__prev=a,o.__next=r.__key,o.__parent=r.__parent;const u=A();return t&&k(u)&&zn(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Ne()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){ge();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(S(r))return r.select();if(!I(r)){const i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(e,t)}selectNext(e,t){ge();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(S(r))return r.select(0,0);if(!I(r)){const i=r.getIndexWithinParent();return o.select(i,i)}return r.select(e,t)}markDirty(){this.getWritable()}}class Jt extends jn{static getType(){return"linebreak"}static clone(e){return new Jt(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&&En(r)){const o=r.firstChild;if(o===t||o.nextSibling===t&&An(o)){const i=r.lastChild;if(i===t||i.previousSibling===t&&An(i))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&En(r)){const o=r.firstChild;if(o===t||o.nextSibling===t&&An(o))return!1;const i=r.lastChild;if(i===t||i.previousSibling===t&&An(i))return!0}return!1}(e)?null:{conversion:Wl,priority:0}}}static importJSON(e){return et()}exportJSON(){return{type:"linebreak",version:1}}}function Wl(n){return{node:et()}}function et(){return Nn(new Jt)}function Qt(n){return n instanceof Jt}function An(n){return n.nodeType===Fe&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function Kr(n,e){return 16&e?"code":e&lr?"mark":32&e?"sub":64&e?"sup":null}function Vr(n,e){return 1&e?"strong":2&e?"em":"span"}function Mo(n,e,t,r,o){const i=r.classList;let s=Ft(o,"base");s!==void 0&&i.add(...s),s=Ft(o,"underlineStrikethrough");let l=!1;const a=e&mn&&e&pn;s!==void 0&&(t&mn&&t&pn?(l=!0,a||i.add(...s)):a&&i.remove(...s));for(const c in Me){const u=Me[c];if(s=Ft(o,c),s!==void 0)if(t&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&i.remove(...s);continue}e&u&&(!a||c!=="underline")&&c!=="strikethrough"||i.add(...s)}else e&u&&i.remove(...s)}}function Io(n,e,t){const r=e.firstChild,o=t.isComposing(),i=n+(o?_n:"");if(r==null)e.textContent=i;else{const s=r.nodeValue;if(s!==i)if(o||ze){const[l,a,c]=function(u,f){const d=u.length,g=f.length;let h=0,m=0;for(;h<d&&h<g&&u[h]===f[h];)h++;for(;m+h<d&&m+h<g&&u[d-m-1]===f[g-m-1];)m++;return[h,d-h-m,f.slice(h,g-m)]}(s,i);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=i}}function Do(n,e,t,r,o,i){Io(o,n,e);const s=i.theme.text;s!==void 0&&Mo(0,0,r,n,s)}function Pn(n,e){const t=document.createElement(e);return t.appendChild(n),t}class _t extends jn{static getType(){return"text"}static clone(e){return new _t(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 xl[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=Me[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return xr(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,o=Kr(0,r),i=Vr(0,r),s=o===null?i:o,l=document.createElement(s);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),o!==null&&(a=document.createElement(i),l.appendChild(a)),Do(a,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(l.style.cssText=c),l}updateDOM(e,t,r){const o=this.__text,i=e.__format,s=this.__format,l=Kr(0,i),a=Kr(0,s),c=Vr(0,i),u=Vr(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const m=t.firstChild;m==null&&D(48);const _=document.createElement(u);return Do(_,this,0,s,o,r),t.replaceChild(_,m),!1}let f=t;a!==null&&l!==null&&(f=t.firstChild,f==null&&D(49)),Io(o,f,this);const d=r.theme.text;d!==void 0&&i!==s&&Mo(0,i,s,f,d);const g=e.__style,h=this.__style;return g!==h&&(t.style.cssText=h),!1}static importDOM(){return{"#text":()=>({conversion:Yl,priority:0}),b:()=>({conversion:$l,priority:0}),code:()=>({conversion:$e,priority:0}),em:()=>({conversion:$e,priority:0}),i:()=>({conversion:$e,priority:0}),s:()=>({conversion:$e,priority:0}),span:()=>({conversion:Bl,priority:0}),strong:()=>({conversion:$e,priority:0}),sub:()=>({conversion:$e,priority:0}),sup:()=>({conversion:$e,priority:0}),u:()=>({conversion:$e,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&&kr(t)||D(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Pn(t,"b")),this.hasFormat("italic")&&(t=Pn(t,"i")),this.hasFormat("strikethrough")&&(t=Pn(t,"s")),this.hasFormat("underline")&&(t=Pn(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"?Me[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?ml[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=xr(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=yl[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){ge();let r=e,o=t;const i=A(),s=this.getTextContent(),l=this.__key;if(typeof s=="string"){const a=s.length;r===void 0&&(r=a),o===void 0&&(o=a)}else r=0,o=0;if(!k(i))return Bo(l,r,l,o,"text","text");{const a=We();a!==i.anchor.key&&a!==i.focus.key||re(l),i.setTextNodeRange(this,r,this,o)}return i}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,o){const i=this.getWritable(),s=i.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=A();if(o&&k(c)){const f=e+l;c.setTextNodeRange(i,f,i,f)}const u=s.slice(0,a)+r+s.slice(a+t);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){ge();const t=this.getLatest(),r=t.getTextContent(),o=t.__key,i=We(),s=new Set(e),l=[],a=r.length;let c="";for(let C=0;C<a;C++)c!==""&&s.has(C)&&(l.push(c),c=""),c+=r[C];c!==""&&l.push(c);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const f=l[0],d=t.getParent();let g;const h=t.getFormat(),m=t.getStyle(),_=t.__detail;let v=!1;t.isSegmented()?(g=ie(f),g.__format=h,g.__style=m,g.__detail=_,v=!0):(g=t.getWritable(),g.__text=f);const x=A(),y=[g];let b=f.length;for(let C=1;C<u;C++){const T=l[C],M=T.length,w=ie(T).getWritable();w.__format=h,w.__style=m,w.__detail=_;const E=w.__key,z=b+M;if(k(x)){const B=x.anchor,ee=x.focus;B.key===o&&B.type==="text"&&B.offset>b&&B.offset<=z&&(B.key=E,B.offset-=b,x.dirty=!0),ee.key===o&&ee.type==="text"&&ee.offset>b&&ee.offset<=z&&(ee.key=E,ee.offset-=b,x.dirty=!0)}i===o&&re(E),b=z,y.push(w)}if(d!==null){(function(M){const w=M.getPreviousSibling(),E=M.getNextSibling();w!==null&&Cn(w),E!==null&&Cn(E)})(this);const C=d.getWritable(),T=this.getIndexWithinParent();v?(C.splice(T,0,y),this.remove()):C.splice(T,1,y),k(x)&&zn(x,d,T,u-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||D(50);const r=this.__key,o=e.__key,i=this.__text,s=i.length;We()===o&&re(r);const l=A();if(k(l)){const f=l.anchor,d=l.focus;f!==null&&f.key===o&&(Yo(f,t,r,e,s),l.dirty=!0),d!==null&&d.key===o&&(Yo(d,t,r,e,s),l.dirty=!0)}const a=e.__text,c=t?a+i:i+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function Bl(n){return{forChild:Zr(n.style),node:null}}function $l(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:Zr(e.style,t?void 0:"bold"),node:null}}const Lo=new WeakMap;function Ul(n){return n.nodeName==="PRE"||n.nodeType===jt&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function Yl(n){const e=n;n.parentElement===null&&D(129);let t=e.textContent||"";if(function(r){let o,i=r.parentNode;const s=[r];for(;i!==null&&(o=Lo.get(i))===void 0&&!Ul(i);)s.push(i),i=i.parentNode;const l=o===void 0?i:o;for(let a=0;a<s.length;a++)Lo.set(s[a],l);return l}(e)!==null){const r=t.split(/(\r?\n|\t)/),o=[],i=r.length;for(let s=0;s<i;s++){const l=r[s];l===`
35
35
  `||l===`\r
36
- `?i.push(Xe()):l===" "?i.push(Vt()):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=Mo(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=Mo(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 Mo(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===Lt){const o=t.style.display;if(o===""&&!br(t)||o!==""&&!o.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(t.nodeType===Re)return t;if(t.nodeName==="BR")return null}}const Fl={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Be(n){const e=Fl[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:$r(n.style,e),node:null}}function ie(n=""){return Sn(new ht(n))}function j(n){return n instanceof ht}function $r(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=>(j(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 Qt extends ht{static getType(){return"tab"}static clone(e){return new Qt(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=Vt();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){L(126)}setDetail(e){L(127)}setMode(e){L(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Vt(){return Sn(new Qt)}function Wl(n){return n instanceof Qt}class Bl{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&&L(20),e}set(e,t,r){const i=this._selection,o=this.key;this.key=e,this.offset=t,this.type=r,Zt()||(Fe()===o&&re(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0))}}function be(n,e,t){return new Bl(n,e,t)}function Yr(n,e){let t=e.__key,r=n.offset,i="element";if(j(e)){i="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!C(e)){const o=e.getNextSibling();if(j(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 Eo(n,e){if(C(e)){const t=e.getLastDescendant();C(t)||j(t)?Yr(n,t):Yr(n,e)}else Yr(n,e)}function Ue(n,e,t,r){n.key=e,n.offset=t,n.type=r}class Dn{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ve(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 Dn(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(j(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 Zt()||(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 k(n){return n instanceof $e}class $e{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!!k(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 d=l.getDescendantByIndex(c);l=d??l}if(C(a)){let d=a.getDescendantByIndex(u);d!==null&&d!==l&&a.getChildAtIndex(u)===d&&(d=d.getPreviousSibling()),a=d??a}let f;return f=l.is(a)?C(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),Zt()||(this._cachedNodes=f),f}setTextNodeRange(e,t,r,i){Ue(this.anchor,e.__key,t,"text"),Ue(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]=Kr(this);let c="",u=!0;for(let f=0;f<e.length;f++){const d=e[f];if(C(d)&&!d.isInline())u||(c+=`
37
- `),u=!d.isEmpty();else if(u=!1,j(d)){let g=d.getTextContent();d===t?d===r?i.type==="element"&&o.type==="element"&&o.offset!==i.offset||(g=l<a?g.slice(l,a):g.slice(a,l)):g=s?g.slice(l):g.slice(a):d===r&&(g=s?g.slice(0,a):g.slice(0,l)),c+=g}else!Y(d)&&!Kt(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){const t=Z(),r=t.getEditorState()._selection,i=Oo(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[o,s]=i;Ue(this.anchor,o.key,o.offset,o.type),Ue(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new $e(be(e.key,e.offset,e.type),be(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=ke[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===`
36
+ `?o.push(et()):l===" "?o.push(Gt()):l!==""&&o.push(ie(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=Oo(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(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=Oo(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:ie(t)}}function Oo(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const i=t.parentElement;if(i===null)return null;t=i}if(t=r,t.nodeType===jt){const i=t.style.display;if(i===""&&!Mr(t)||i!==""&&!i.startsWith("inline"))return null}let o=t;for(;(o=e?t.firstChild:t.lastChild)!==null;)t=o;if(t.nodeType===Fe)return t;if(t.nodeName==="BR")return null}}const Kl={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function $e(n){const e=Kl[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Zr(n.style,e),node:null}}function ie(n=""){return Nn(new _t(n))}function I(n){return n instanceof _t}function Zr(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),o=t==="700"||t==="bold",i=r.includes("line-through"),s=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return c=>(I(c)&&(o&&!c.hasFormat("bold")&&c.toggleFormat("bold"),i&&!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 Ht extends _t{static getType(){return"tab"}static clone(e){return new Ht(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=Gt();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){D(126)}setDetail(e){D(127)}setMode(e){D(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Gt(){return Nn(new Ht)}function Vl(n){return n instanceof Ht}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 o=this.offset,i=e.offset;if(S(t)){const s=t.getDescendantByIndex(o);t=s??t}if(S(r)){const s=r.getDescendantByIndex(i);r=s??r}return t===r?o<i:t.isBefore(r)}getNode(){const e=se(this.key);return e===null&&D(20),e}set(e,t,r){const o=this._selection,i=this.key;this.key=e,this.offset=t,this.type=r,qt()||(We()===i&&re(e),o!==null&&(o.setCachedNodes(null),o.dirty=!0))}}function we(n,e,t){return new Zl(n,e,t)}function Jr(n,e){let t=e.__key,r=n.offset,o="element";if(I(e)){o="text";const i=e.getTextContentSize();r>i&&(r=i)}else if(!S(e)){const i=e.getNextSibling();if(I(i))t=i.__key,r=0,o="text";else{const s=e.getParent();s&&(t=s.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,o)}function jo(n,e){if(S(e)){const t=e.getLastDescendant();S(t)||I(t)?Jr(n,t):Jr(n,e)}else Jr(n,e)}function Ue(n,e,t,r){n.key=e,n.offset=t,n.type=r}class Rn{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ve(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 Rn(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 i;if(I(o))i=o.select();else{const s=o.getIndexWithinParent()+1;i=o.getParentOrThrow().select(s,s)}i.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 o of t){const i=se(o);i!==null&&r.push(i)}return qt()||(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 k(n){return n instanceof Ye}class Ye{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!!k(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),i=o?t:r,s=o?r:t;let l=i.getNode(),a=s.getNode();const c=i.offset,u=s.offset;if(S(l)){const d=l.getDescendantByIndex(c);l=d??l}if(S(a)){let d=a.getDescendantByIndex(u);d!==null&&d!==l&&a.getChildAtIndex(u)===d&&(d=d.getPreviousSibling()),a=d??a}let f;return f=l.is(a)?S(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),qt()||(this._cachedNodes=f),f}setTextNodeRange(e,t,r,o){Ue(this.anchor,e.__key,t,"text"),Ue(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,i=this.focus,s=o.isBefore(i),[l,a]=Qr(this);let c="",u=!0;for(let f=0;f<e.length;f++){const d=e[f];if(S(d)&&!d.isInline())u||(c+=`
37
+ `),u=!d.isEmpty();else if(u=!1,I(d)){let g=d.getTextContent();d===t?d===r?o.type==="element"&&i.type==="element"&&i.offset!==o.offset||(g=l<a?g.slice(l,a):g.slice(a,l)):g=s?g.slice(l):g.slice(a):d===r&&(g=s?g.slice(0,a):g.slice(0,l)),c+=g}else!Y(d)&&!Qt(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){const t=Q(),r=t.getEditorState()._selection,o=Wo(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(o===null)return;const[i,s]=o;Ue(this.anchor,i.key,i.offset,i.type),Ue(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Ye(we(e.key,e.offset,e.type),we(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=xr(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Me[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],o=t.length;for(let i=0;i<o;i++){const s=t[i];s===`
38
38
  `||s===`\r
39
- `?r.push(Xe()):s===" "?r.push(Vt()):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(_,v,x,y){const b=_.getNode(),T=b.getChildAtIndex(_.offset),S=ie(),E=oe(b)?we().append(S):S;S.setFormat(x),S.setStyle(y),T===null?b.append(E):T.insertBefore(E),_.is(v)&&v.set(S.__key,0,"text"),_.set(S.__key,0,"text")}(s,l,i,o);const a=s.offset;let c=l.offset;const u=this.getNodes(),f=u.length;let d=u[0];j(d)||L(26);const g=d.getTextContent().length,h=d.getParentOrThrow();let m=u[f-1];if(f===1&&l.type==="element"&&(c=g,l.set(s.key,c,"text")),this.isCollapsed()&&a===g&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&d.getNextSibling()===null)){let _=d.getNextSibling();if(j(_)&&_.canInsertTextBefore()&&!at(_)||(_=ie(),_.setFormat(i),_.setStyle(o),h.canInsertTextAfter()?d.insertAfter(_):h.insertAfter(_)),_.select(0,0),d=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&d.getPreviousSibling()===null)){let _=d.getPreviousSibling();if(j(_)&&!at(_)||(_=ie(),_.setFormat(i),h.canInsertTextBefore()?d.insertBefore(_):h.insertBefore(_)),_.select(),d=_,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&a!==g){const _=ie(d.getTextContent());_.setFormat(i),d.replace(_),d=_}else if(!this.isCollapsed()&&e!==""){const _=m.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||C(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),Do(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(d.isToken()){const y=ie(e);return y.select(),void d.replace(y)}const _=d.getFormat(),v=d.getStyle();if(a!==c||_===i&&v===o){if(Wl(d)){const y=ie(e);return y.setFormat(i),y.setStyle(o),y.select(),void d.replace(y)}}else{if(d.getTextContent()!==""){const y=ie(e);if(y.setFormat(i),y.setStyle(o),y.select(),a===0)d.insertBefore(y,!1);else{const[b]=d.splitText(a);b.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(i),d.setStyle(o)}const x=c-a;d=d.spliceText(a,x,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=v))}else{const _=new Set([...d.getParentKeys(),...m.getParentKeys()]),v=C(d)?d:d.getParentOrThrow();let x=C(m)?m:m.getParentOrThrow(),y=m;if(!v.is(x)&&x.isInline())do y=x,x=x.getParentOrThrow();while(x.isInline());if(l.type==="text"&&(c!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<c)if(j(m)&&!m.isToken()&&c!==m.getTextContentSize()){if(m.isSegmented()){const N=ie(m.getTextContent());m.replace(N),m=N}oe(l.getNode())||l.type!=="text"||(m=m.spliceText(0,c,"")),_.add(m.__key)}else{const N=m.getParentOrThrow();N.canBeEmpty()||N.getChildrenSize()!==1?m.remove():N.remove()}else _.add(m.__key);const b=x.getChildren(),T=new Set(u),S=v.is(x),E=v.isInline()&&d.getNextSibling()===null?v:d;for(let N=b.length-1;N>=0;N--){const M=b[N];if(M.is(d)||C(M)&&M.isParentOf(d))break;M.isAttached()&&(!T.has(M)||M.is(y)?S||E.insertAfter(M,!1):M.remove())}if(!S){let N=x,M=null;for(;N!==null;){const R=N.getChildren(),B=R.length;(B===0||R[B-1].is(M))&&(_.delete(N.__key),M=N),N=N.getParent()}}if(d.isToken())if(a===g)d.select();else{const N=ie(e);N.select(),d.replace(N)}else d=d.spliceText(a,g-a,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let N=1;N<f;N++){const M=u[N],R=M.__key;_.has(R)||M.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const x of t)j(x)&&r.push(x);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,f=r[0],d=a.type==="element"?0:a.offset;if(a.type==="text"&&d===f.getTextContentSize()&&(u=1,f=r[1],d=0),f==null)return;const g=f.getFormatFlags(e,null),h=i-1;let m=r[h];const _=c.type==="text"?c.offset:m.getTextContentSize();if(f.is(m)){if(d===_)return;if(at(f)||d===0&&_===f.getTextContentSize())f.setFormat(g);else{const x=f.splitText(d,_),y=d===0?x[0]:x[1];y.setFormat(g),a.type==="text"&&a.set(y.__key,0,"text"),c.type==="text"&&c.set(y.__key,_-d,"text")}return void(this.format=g)}d===0||at(f)||([,f]=f.splitText(d),d=0),f.setFormat(g);const v=m.getFormatFlags(e,g);_>0&&(_===m.getTextContentSize()||at(m)||([m]=m.splitText(_)),m.setFormat(v));for(let x=u+1;x<h;x++){const y=r[x],b=y.getFormatFlags(e,v);y.setFormat(b)}a.type==="text"&&a.set(f.__key,d,"text"),c.type==="text"&&c.set(m.__key,_,"text"),this.format=g|v}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const g=O();return k(g)||L(134),g.insertNodes(e)}const t=wr((this.isBackward()?this.focus:this.anchor).getNode(),dt),r=e[e.length-1];if("__language"in t&&C(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=Jr(this);t.splice(g,0,e),r.selectEnd()}return}if(!e.some(g=>(C(g)||Y(g))&&!g.isInline())){C(t)||L(135);const g=Jr(this);return t.splice(g,0,e),void r.selectEnd()}const i=function(g){const h=we();let m=null;for(let _=0;_<g.length;_++){const v=g[_],x=Kt(v);if(x||Y(v)&&v.isInline()||C(v)&&v.isInline()||j(v)||v.isParentRequired()){if(m===null&&(m=v.createParentElementNode(),h.append(m),x))continue;m!==null&&m.append(v)}else h.append(v),m=null}return h}(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)&&dt(u)&&!u.isEmpty()&&C(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(C(t)||L(135),t.append(...c.getChildren()),c=s[1]),c&&function(g,h,m){const _=h.getParentOrThrow().getLastChild();let v=h;const x=[h];for(;v!==_;)v.getNextSibling()||L(140),v=v.getNextSibling(),x.push(v);let y=g;for(const b of x)y=y.insertAfter(b)}(t,c);const f=wr(o,dt);l&&C(f)&&(l.canMergeWhenEmpty()||dt(a))&&(f.append(...l.getChildren()),l.remove()),C(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const d=C(t)?t.getLastChild():null;Kt(d)&&f!==t&&d.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=we();return G().splice(this.anchor.offset,0,[s]),s.select(),s}const e=Jr(this),t=wr(this.anchor.getNode(),dt);C(t)||L(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=Xe();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]=Kr(this);if(t===0)return[];if(t===1){if(j(s)&&!this.isCollapsed()){const f=a>c?c:a,d=a>c?a:c,g=s.splitText(f,d),h=f===0?g[0]:g[1];return h!=null?[h]:[]}return[s]}const u=i.isBefore(o);if(j(s)){const f=u?a:c;f===s.getTextContentSize()?e.shift():f!==0&&([,s]=s.splitText(f),e[0]=s)}if(j(l)){const f=l.getTextContent().length,d=u?c:a;d===0?e.pop():d!==f&&([l]=l.splitText(d),e[r]=l)}return e}modify(e,t,r){const i=this.focus,o=this.anchor,s=e==="move",l=Pt(i,t);if(Y(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const g=Po();return g.add(l.__key),void Se(g)}const d=t?l.getPreviousSibling():l.getNextSibling();if(j(d)){const g=d.__key,h=t?d.getTextContent().length:0;return i.set(g,h,"text"),void(s&&o.set(g,h,"text"))}{const g=l.getParentOrThrow();let h,m;return C(d)?(m=d.__key,h=t?d.getChildrenSize():0):(h=l.getIndexWithinParent(),m=g.__key,t||h++),i.set(m,h,"element"),void(s&&o.set(m,h,"element"))}}const a=Z(),c=Te(a._window);if(!c)return;const u=a._blockCursorElement,f=a._rootElement;if(f===null||u===null||!C(l)||l.isInline()||l.canBeEmpty()||Tr(u,a,f),function(d,g,h,m){d.modify(g,h,m)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const d=c.getRangeAt(0),g=this.anchor.getNode(),h=oe(g)?g:bl(g);if(this.applyDOMRange(d),this.dirty=!0,!s){const m=this.getNodes(),_=[];let v=!1;for(let x=0;x<m.length;x++){const y=m[x];vr(y,h)?_.push(y):v=!0}if(v&&_.length>0)if(t){const x=_[0];C(x)?x.selectStart():x.getParentOrThrow().selectStart()}else{const x=_[_.length-1];C(x)?x.selectEnd():x.getParentOrThrow().selectEnd()}c.anchorNode===d.startContainer&&c.anchorOffset===d.startOffset||function(x){const y=x.focus,b=x.anchor,T=b.key,S=b.offset,E=b.type;Ue(b,y.key,y.offset,y.type),Ue(y,T,S,E),x._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=Pt(o,e);if(Y(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&C(i)&&i.getChildrenSize()===0){i.remove();const l=Po();l.add(s.__key),Se(l)}else s.remove(),Z().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 Lo(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 Lo(i,e,a)}(function(a,c){const u=a.anchor,f=a.focus,d=u.getNode(),g=f.getNode();if(d===g&&u.type==="text"&&f.type==="text"){const h=u.offset,m=f.offset,_=h<m,v=_?h:m,x=_?m:h,y=x-1;v!==y&&(Vi(d.getTextContent().slice(v,x))||(c?f.offset=y:u.offset=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()&&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 ve(n){return n instanceof Dn}function ko(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Kr(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]:[ko(t),ko(r)]}function Lo(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 jo(n,e,t,r){let i,o=e;if(n.nodeType===Lt){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;o===a&&(s=!0,o=a-1);let u=l[o],f=!1;if(u===c)u=l[o+1],f=!0;else if(c!==null){const d=c.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,c)&&o--}if(i=ct(u),j(i))o=Qi(i,s);else{let d=ct(n);if(d===null)return null;if(C(d)){o=Math.min(d.getChildrenSize(),o);let g=d.getChildAtIndex(o);if(C(g)&&function(h,m,_){const v=h.getParent();return _===null||v===null||!v.canBeEmpty()||v!==_.getNode()}(g,0,t)){const h=s?g.getLastDescendant():g.getFirstDescendant();h===null?d=g:(g=h,d=C(g)?g:g.getParentOrThrow()),o=0}j(g)?(i=g,d=null,o=Qi(g,s)):g!==d&&s&&!f&&o++}else{const g=d.getIndexWithinParent();o=e===0&&Y(d)&&ct(n)===d?g:g+1,d=d.getParentOrThrow()}if(C(d))return be(d.__key,o,"element")}}else i=ct(n);return j(i)?be(i.__key,o,"text"):null}function Io(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();j(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"):j(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();j(l)&&(n.key=l.__key,n.offset=0)}}}function Do(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Io(n,r,i),Io(e,!r,i),i&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const o=Z();if(o.isComposing()&&o._compositionKey!==n.key&&k(t)){const s=t.anchor,l=t.focus;Ue(n,s.key,s.offset,s.type),Ue(e,l.key,l.offset,l.type)}}}function Oo(n,e,t,r,i,o){if(n===null||t===null||!jt(i,n,t))return null;const s=jo(n,e,k(o)?o.anchor:null,i);if(s===null)return null;const l=jo(t,r,k(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(Y(a)&&Y(c))return null}return Do(s,l,o),[s,l]}function Qr(n){return C(n)&&!n.isInline()}function Ao(n,e,t,r,i,o){const s=Ie(),l=new $e(be(n,e,i),be(t,r,o),0,"");return l.dirty=!0,s._selection=l,l}function Ul(){const n=be("root",0,"element"),e=be("root",0,"element");return new $e(n,e,0,"")}function Po(){return new Dn(new Set)}function Vr(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,f,d;if(k(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,f=e.anchorOffset,d=e.focusOffset,l&&k(n)&&!jt(t,c,u))return n.clone();const g=Oo(c,f,u,d,t,n);if(g===null)return null;const[h,m]=g;return new $e(h,m,k(n)?n.format:0,k(n)?n.style:"")}function O(){return Ie()._selection}function Jt(){return Z()._editorState._selection}function On(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"),zo(n)}}else{const c=n.isBackward(),u=c?o:i,f=u.getNode(),d=c?i:o,g=d.getNode();if(e.is(f)){const h=u.offset;(t<=h&&r>0||t<h&&r<0)&&u.set(a,Math.max(0,h+r),"element")}if(e.is(g)){const h=d.offset;(t<=h&&r>0||t<h&&r<0)&&d.set(a,Math.max(0,h+r),"element")}}zo(n)}function zo(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(j(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(j(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(j(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function An(n,e,t,r,i){let o=null,s=0,l=null;r!==null?(o=r.__key,j(r)?(s=r.getTextContentSize(),l="text"):C(r)&&(s=r.getChildrenSize(),l="element")):i!==null&&(o=i.__key,j(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 Ro(n,e,t,r,i){n.type==="text"?(n.key=t,e||(n.offset+=i)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function $l(n,e,t,r,i,o,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(i.has("collaboration")&&f!==o||f!==null&&gr(f))return;if(!k(e))return void(n!==null&&jt(t,l,a)&&r.removeAllRanges());const d=e.anchor,g=e.focus,h=d.key,m=g.key,_=xn(t,h),v=xn(t,m),x=d.offset,y=g.offset,b=e.format,T=e.style,S=e.isCollapsed();let E=_,N=v,M=!1;if(d.type==="text"){E=_n(_);const V=d.getNode();M=V.getFormat()!==b||V.getStyle()!==T}else k(n)&&n.anchor.type==="text"&&(M=!0);var R,B,ee,J,F;if(g.type==="text"&&(N=_n(v)),E!==null&&N!==null&&(S&&(n===null||M||k(n)&&(n.format!==b||n.style!==T))&&(R=b,B=T,ee=x,J=h,F=performance.now(),ho=[R,B,ee,J,F]),c!==x||u!==y||l!==E||a!==N||r.type==="Range"&&S||(f!==null&&o.contains(f)||o.focus({preventScroll:!0}),d.type==="element"))){try{r.setBaseAndExtent(E,x,N,y)}catch{}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const V=e instanceof $e&&e.anchor.type==="element"?E.childNodes[x]||null:r.rangeCount>0?r.getRangeAt(0):null;if(V!==null){let ce;if(V instanceof Text){const De=document.createRange();De.selectNode(V),ce=De.getBoundingClientRect()}else ce=V.getBoundingClientRect();(function(De,Ke,Ht){const Xt=Ht.ownerDocument,en=Xt.defaultView;if(en===null)return;let{top:xt,bottom:vt}=Ke,Ct=0,St=0,pe=Ht;for(;pe!==null;){const nt=pe===Xt.body;if(nt)Ct=0,St=Cn(De).innerHeight;else{const Qe=pe.getBoundingClientRect();Ct=Qe.top,St=Qe.bottom}let Me=0;if(xt<Ct?Me=-(Ct-xt):vt>St&&(Me=vt-St),Me!==0)if(nt)en.scrollBy(0,Me);else{const Qe=pe.scrollTop;pe.scrollTop+=Me;const rt=pe.scrollTop-Qe;xt-=rt,vt-=rt}if(nt)break;pe=vn(pe)}})(t,ce,o)}}zr=!0}}function Yl(n){let e=O()||Jt();e===null&&(e=G().selectEnd()),e.insertNodes(n)}function Jr(n){let e=n;n.isCollapsed()||e.removeText();const t=O();k(t)&&(e=t),k(e)||L(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!dt(i);)[i,o]=Kl(i,o);return o}function Kl(n,e){const t=n.getParent();if(!t){const i=we();return G().append(i),i.select(),[G(),0]}if(j(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 $e(be(n.__key,e,"element"),be(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,Zr=!1,Pn=0;const Fo={characterData:!0,childList:!0,subtree:!0};function Zt(){return fe||te!==null&&te._readOnly}function ge(){fe&&L(13)}function Wo(){Pn>99&&L(14)}function Ie(){return te===null&&L(195,Bo()),te}function Z(){return ne===null&&L(196,Bo()),ne}function Bo(){let n=0;const e=new Set,t=Fn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=pn(i);if(hr(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 Ql(){return ne}function Uo(n,e,t){const r=e.__type,i=function(l,a){const c=l._nodes.get(a);return c===void 0&&L(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 $o(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function Vl(n){return qr(n,Z()._nodes)}function qr(n,e){const t=n.type,r=e.get(t);r===void 0&&L(17,t);const i=r.klass;n.type!==i.getType()&&L(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=qr(s[l],e);o.append(a)}return o}function Yo(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 Ye(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!==Je,c=te,u=fe,f=ne,d=n._updating,g=n._observer;let h=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&g!==null){ne=n,te=t,fe=!1,n._updating=!0;try{const S=n._dirtyType,E=n._dirtyElements,N=n._dirtyLeaves;g.disconnect(),h=Il(o,t,n,S,E,N)}catch(S){if(S instanceof Error&&n._onError(S),Zr)throw S;return qo(n,null,r,t),Ai(n),n._dirtyType=lt,Zr=!0,Ye(n,o),void(Zr=!1)}finally{g.observe(r,Fo),n._updating=d,te=c,fe=u,ne=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,_=n._dirtyElements,v=n._normalizedNodes,x=n._updateTags,y=n._deferred;a&&(n._dirtyType=Je,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(S,E){const N=S._decorators;let M=S._pendingDecorators||N;const R=E._nodeMap;let B;for(B in M)R.has(B)||(M===N&&(M=$i(S)),delete M[B])}(n,t);const b=i?null:Te(n._window);if(n._editable&&b!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(g!==null&&g.disconnect(),a||l===null||l.dirty){const S=n._blockCursorElement;S!==null&&Tr(S,n,r),$l(s,l,n,b,x,r)}wl(n,r,l),g!==null&&g.observe(r,Fo)}finally{ne=f,te=c}}h!==null&&function(S,E,N,M,R){const B=Array.from(S._listeners.mutation),ee=B.length;for(let J=0;J<ee;J++){const[F,V]=B[J],ce=E.get(V);ce!==void 0&&F(ce,{dirtyLeaves:M,prevEditorState:R,updateTags:N})}}(n,h,x,m,o),k(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(nn,void 0);const T=n._pendingDecorators;T!==null&&(n._decorators=T,n._pendingDecorators=null,qt("decorator",n,!0,T)),function(S,E,N){const M=Yi(E),R=Yi(N);M!==R&&qt("textcontent",S,!0,R)}(n,e||o,t),qt("update",n,!0,{dirtyElements:_,dirtyLeaves:m,editorState:t,normalizedNodes:v,prevEditorState:e||o,tags:x}),function(S,E){if(S._deferred=[],E.length!==0){const N=S._updating;S._updating=!0;try{for(let M=0;M<E.length;M++)E[M]()}finally{S._updating=N}}}(n,y),function(S){const E=S._updates;if(E.length!==0){const N=E.shift();if(N){const[M,R]=N;Vo(S,M,R)}}}(n)}function qt(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 Ko(n,e,t){if(n._updating===!1||ne!==n){let i=!1;return n.update(()=>{i=Ko(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 Qo(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&&L(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}o()}}return r}function Vo(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 Rn(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const f=te,d=fe,g=ne,h=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(x){const y=x.getEditorState()._selection,b=Te(x._window);return k(y)||y==null?Vr(y,b,x,null):y.clone()}(n));const _=n._compositionKey;e(),s=Qo(n,s),function(x,y){const b=y.getEditorState()._selection,T=x._selection;if(k(T)){const S=T.anchor,E=T.focus;let N;if(S.type==="text"&&(N=S.getNode(),N.selectionTransform(b,T)),E.type==="text"){const M=E.getNode();N!==M&&M.selectionTransform(b,T)}}}(c,n),n._dirtyType!==Je&&(s?function(x,y){const b=y._dirtyLeaves,T=x._nodeMap;for(const S of b){const E=T.get(S);j(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&Ri(E)}}(c,n):function(x,y){const b=y._dirtyLeaves,T=y._dirtyElements,S=x._nodeMap,E=Fe(),N=new Map;let M=b,R=M.size,B=T,ee=B.size;for(;R>0||ee>0;){if(R>0){y._dirtyLeaves=new Set;for(const J of M){const F=S.get(J);j(F)&&F.isAttached()&&F.isSimpleText()&&!F.isUnmergeable()&&Ri(F),F!==void 0&&$o(F,E)&&Uo(y,F,N),b.add(J)}if(M=y._dirtyLeaves,R=M.size,R>0){Pn++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const J of B){const F=J[0],V=J[1];if(F!=="root"&&!V)continue;const ce=S.get(F);ce!==void 0&&$o(ce,E)&&Uo(y,ce,N),T.set(F,V)}M=y._dirtyLeaves,R=M.size,B=y._dirtyElements,ee=B.size,Pn++}y._dirtyLeaves=b,y._dirtyElements=T}(c,n),Qo(n),function(x,y,b,T){const S=x._nodeMap,E=y._nodeMap,N=[];for(const[M]of T){const R=E.get(M);R!==void 0&&(R.isAttached()||(C(R)&&ro(R,M,S,E,N,T),S.has(M)||T.delete(M),N.push(M)))}for(const M of N)E.delete(M);for(const M of b){const R=E.get(M);R===void 0||R.isAttached()||(S.has(M)||b.delete(M),E.delete(M))}}(a,c,n._dirtyLeaves,n._dirtyElements)),_!==n._compositionKey&&(c._flushSync=!0);const v=c._selection;if(k(v)){const x=c._nodeMap,y=v.anchor.key,b=v.focus.key;x.get(y)!==void 0&&x.get(b)!==void 0||L(19)}else ve(v)&&v._nodes.size===0&&(c._selection=null)}catch(_){return _ instanceof Error&&n._onError(_),n._pendingEditorState=a,n._dirtyType=lt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Ye(n)}finally{te=f,fe=d,ne=g,n._updating=h,Pn=0}n._dirtyType!==Je||function(_,v){const x=v.getEditorState()._selection,y=_._selection;if(y!==null){if(y.dirty||!y.is(x))return!0}else if(x!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,Ye(n)):u&&vl(()=>{Ye(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function he(n,e,t){n._updating?n._updates.push([e,t]):Vo(n,e,t)}class zn extends Ln{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 dl[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=Z()._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),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&&L(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&L(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+=Ee)}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+=Ee.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ii[e];return!!(this.getFormat()&t)}return!1}select(e,t){ge();const r=O();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(j(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(j(a)||C(a))return a.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const l=this.__key;return k(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0,r):Ao(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!==""?Ii[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 f=null,d=o-t+i;if(e!==0)if(e===o)f=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(f=h.getPreviousSibling())}if(t>0){let h=f===null?this.getFirstChild():f.getNextSibling();for(let m=0;m<t;m++){h===null&&L(100);const _=h.getNextSibling(),v=h.__key;Ze(h.getWritable()),c.push(v),h=_}}let g=f;for(let h=0;h<i;h++){const m=r[h];g!==null&&m.is(g)&&(f=g=g.getPreviousSibling());const _=m.getWritable();_.__parent===l&&d--,Ze(_);const v=m.__key;if(g===null)s.__first=v,_.__prev=null;else{const x=g.getWritable();x.__next=v,_.__prev=x.__key}m.__key===l&&L(76),_.__parent=l,a.push(v),g=m}if(e+t===o)g!==null&&(g.getWritable().__next=null,s.__last=g.__key);else if(u!==null){const h=u.getWritable();if(g!==null){const m=g.getWritable();h.__prev=g.__key,m.__next=u.__key}else h.__prev=null}if(s.__size=d,c.length){const h=O();if(k(h)){const m=new Set(c),_=new Set(a),{anchor:v,focus:x}=h;Jo(v,m,_)&&An(v,v.getNode(),this,f,u),Jo(x,m,_)&&An(x,x.getNode(),this,f,u),d!==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 zn}function Jo(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 Jl extends Ln{constructor(e){super(e)}decorate(e,t){L(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Y(n){return n instanceof Jl}class Gt extends zn{static getType(){return"root"}static clone(){return new Gt}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){L(51)}getTextContent(){const e=this.__cachedText;return!Zt()&&Z()._dirtyType!==Je||e===null?super.getTextContent():e}remove(){L(52)}replace(e){L(53)}insertBefore(e){L(54)}insertAfter(e){L(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];C(r)||Y(r)||L(56)}return super.append(...e)}static importJSON(e){const t=G();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 Gt}function Gr(){return new Rn(new Map([["root",new Gt]]))}function Zo(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&L(130,t.name),C(n)){const r=e.children;Array.isArray(r)||L(59,t.name);const i=n.getChildren();for(let o=0;o<i.length;o++){const s=Zo(i[o]);r.push(s)}}return e}class Rn{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 Yo(t&&t.editor||null,this,e)}clone(e){const t=new Rn(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Yo(null,this,()=>({root:Zo(G())}))}}class Hr extends zn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class pt extends zn{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=ke[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=At(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:Zl,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Nr(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=we();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=we();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||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 Zl(n){const e=we();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 we(){return Sn(new pt)}function Xr(n){return n instanceof pt}const $=0,ql=4;function qo(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=Gr(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=Je,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 Gl(n){const e=n||{},t=Ql(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=Gr(),l=e.namespace||(i!==null?i._config.namespace:Ji()),a=e.editorState,c=[Gt,ht,Yt,Qt,pt,Hr,...e.nodes||[]],{onError:u,html:f}=e,d=e.editable===void 0||e.editable;let g;if(n===void 0&&t!==null)g=t._nodes;else{g=new Map;for(let m=0;m<c.length;m++){let _=c[m],v=null,x=null;if(typeof _!="function"){const S=_;_=S.replace,v=S.with,x=S.withKlass||null}const y=_.getType(),b=_.transform(),T=new Set;b!==null&&T.add(b),g.set(y,{exportDOM:f&&f.export?f.export.get(_):void 0,klass:_,replace:v,replaceWithKlass:x,transforms:T})}}const h=new Fn(s,i,g,{disableEvents:o,namespace:l,theme:r},u||console.error,function(m,_){const v=new Map,x=new Set,y=b=>{Object.keys(b).forEach(T=>{let S=v.get(T);S===void 0&&(S=[],v.set(T,S)),S.push(b[T])})};return m.forEach(b=>{const T=b.klass.importDOM;if(T==null||x.has(T))return;x.add(T);const S=T.call(b.klass);S!==null&&y(S)}),_&&y(_),v}(g,f?f.import:void 0),d);return a!==void 0&&(h._pendingEditorState=a,h._dirtyType=lt),h}class Fn{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=Je,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=Ji(),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&&L(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&&L(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&&L(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=kl(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=Ie();if(a.isEmpty())return;if(l==="root")return void G().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 D(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=At(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,qo(this,t,e,i),t!==null&&(this._config.disableEvents||Dl(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,Ai(this),this._updateTags.add("history-merge"),Ye(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=kn.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",vo),kn.set(c,(u||0)+1),l.__lexicalEditor=a;const f=xo(l);for(let d=0;d<Pr.length;d++){const[g,h]=Pr[d],m=typeof h=="function"?_=>{So(_)||(Co(_),(a.isEditable()||g==="click")&&h(_,a))}:_=>{if(So(_))return;Co(_);const v=a.isEditable();switch(g){case"cut":return v&&D(a,Xn,_);case"copy":return D(a,an,_);case"paste":return v&&D(a,Gn,_);case"dragstart":return v&&D(a,wi,_);case"dragover":return v&&D(a,Mi,_);case"dragend":return v&&D(a,Js,_);case"focus":return v&&D(a,Gs,_);case"blur":return v&&D(a,Hs,_);case"drop":return v&&D(a,bi,_)}};l.addEventListener(g,m),f.push(()=>{l.removeEventListener(g,m)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=i,this._pendingEditorState=null,this._window=null;qt("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&L(38),Oi(this);const r=this._pendingEditorState,i=this._updateTags,o=t!==void 0?t.tag:null;r===null||r.isEmpty()||(o!=null&&i.add(o),Ye(this)),this._pendingEditorState=e,this._dirtyType=lt,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),Ye(this)}parseEditorState(e,t){return function(r,i,o){const s=Gr(),l=te,a=fe,c=ne,u=i._dirtyElements,f=i._dirtyLeaves,d=i._cloneNotNeeded,g=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 h=i._nodes;qr(r.root,h),o&&o(),s._readOnly=!0}catch(h){h instanceof Error&&i._onError(h)}finally{i._dirtyElements=u,i._dirtyLeaves=f,i._cloneNotNeeded=d,i._dirtyType=g,te=l,fe=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ye(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=O(),o=G();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=Te(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,qt("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Fn.version="0.17.1+prod.esm";const Lc="";function Hl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xl=Hl(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 Go=P.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=P.useContext(Go);return n==null&&Xl(8),n}const Ho=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ta=Ho?P.useLayoutEffect:P.useEffect,Wn={tag:"history-merge"};function na({initialConfig:n,children:e}){const t=P.useMemo(()=>{const{theme:r,namespace:i,nodes:o,onError:s,editorState:l,html:a}=n,c=ea(null,r),u=Gl({editable:n.editable,html:a,namespace:i,nodes:o,onError:f=>s(f,u),theme:r});return function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const g=G();if(g.isEmpty()){const h=we();g.append(h);const m=Ho?document.activeElement:null;(O()!==null||m!==null&&m===f.getRootElement())&&h.select()}},Wn);else if(d!==null)switch(typeof d){case"string":{const g=f.parseEditorState(d);f.setEditorState(g,Wn);break}case"object":f.setEditorState(d,Wn);break;case"function":f.update(()=>{G().isEmpty()&&d(f)},Wn)}}}(u,l),[u,c]},[]);return ta(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),A.jsx(Go.Provider,{value:t,children:e})}function ra({defaultSelection:n}){const[e]=et();return P.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 G().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=G().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(Y(i))return!1;if(C(i)){if(!Xr(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(!j(a))return!1}}}return!0}function Xo(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,f]=Kr(n),d=s.is(l),g=e.is(o?l:s),h=e.is(o?s:l);let m,_=0;return d?(_=u>f?f:u,m=u>f?u:f):g?(_=o?f:u,m=void 0):h&&(_=0,m=o?u:f),e.__text=e.__text.slice(_,m),e}}return e}function da(n){const e=n.getStyle(),t=ua(e);ca.set(e,t)}function ts(n,e){const t=Pt(n.focus,e);return Y(t)&&!t.isIsolated()||C(t)&&!t.isInline()&&!t.canBeEmpty()}function fa(n,e,t,r){n.modify(e?"extend":"move",t,r)}function ga(n){const e=n.anchor.getNode();return(oe(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function ns(n,e,t){const r=ga(n);fa(n,e,t?!r:r,"character")}function ha(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var pa=ha(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!==G()&&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?P.useLayoutEffect:P.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:f,className:d,id:g,role:h="textbox",spellCheck:m=!0,style:_,tabIndex:v,"data-testid":x,...y},b){const[T,S]=P.useState(n.isEditable()),E=P.useCallback(M=>{M&&M.ownerDocument&&M.ownerDocument.defaultView?n.setRootElement(M):n.setRootElement(null)},[n]),N=P.useMemo(()=>function(...M){return R=>{M.forEach(B=>{typeof B=="function"?B(R):B!=null&&(B.current=R)})}}(b,E),[E,b]);return is(()=>(S(n.isEditable()),n.registerEditableListener(M=>{S(M)})),[n]),A.jsx("div",{...y,"aria-activedescendant":T?e:void 0,"aria-autocomplete":T?t:"none","aria-controls":T?r:void 0,"aria-describedby":i,"aria-expanded":T&&h==="combobox"?!!o:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":T?c:void 0,"aria-readonly":!T||void 0,"aria-required":u,autoCapitalize:f,className:d,contentEditable:T,"data-testid":x,id:g,ref:N,role:T?h:void 0,spellCheck:m,style:_,tabIndex:v})}const xa=P.forwardRef(ya);function os(n){return n.getEditorState().read(Xo(n.isComposing()))}const va=P.forwardRef(Ca);function Ca(n,e){const{placeholder:t,...r}=n,[i]=et();return A.jsxs(A.Fragment,{children:[A.jsx(xa,{editor:i,...r,ref:e}),t!=null&&A.jsx(Sa,{editor:i,content:t})]})}function Sa({content:n,editor:e}){const t=function(s){const[l,a]=P.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]=P.useState(e.isEditable());if(P.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:A.jsx("div",{"aria-hidden":!0,children:o})}const Bn=0,ti=1,ni=2,Ce=0,Ta=1,ss=2,Na=3,ba=4;function wa(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 Ta;if(!(k(o)&&k(s)&&s.isCollapsed()&&o.isCollapsed()))return Ce;const l=function(v,x,y){const b=v._nodeMap,T=[];for(const S of x){const E=b.get(S);E!==void 0&&T.push(E)}for(const[S,E]of y){if(!E)continue;const N=b.get(S);N===void 0||oe(N)||T.push(N)}return T}(e,t,r);if(l.length===0)return Ce;if(l.length>1){const v=e._nodeMap,x=v.get(o.anchor.key),y=v.get(s.anchor.key);return x&&y&&!n._nodeMap.has(x.__key)&&j(x)&&x.__text.length===1&&o.anchor.offset===1?ss:Ce}const a=l[0],c=n._nodeMap.get(a.__key);if(!j(c)||!j(a)||c.__mode!==a.__mode)return Ce;const u=c.__text,f=a.__text;if(u===f)return Ce;const d=o.anchor,g=s.anchor;if(d.key!==g.key||d.type!=="text")return Ce;const h=d.offset,m=g.offset,_=f.length-u.length;return _===1&&m===h-1?ss:_===-1&&m===h+1?Na:_===-1&&m===h?ba:Ce}function Ma(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 f=wa(i,o,l,a,n.isComposing()),d=(()=>{const g=s===null||s.editor===n,h=c.has("history-push");if(!h&&g&&c.has("history-merge"))return Bn;if(i===null)return ti;const m=o._selection;return l.size>0||a.size>0?h===!1&&f!==Ce&&f===r&&u<t+e&&g||l.size===1&&function(_,v,x){const y=v._nodeMap.get(_),b=x._nodeMap.get(_),T=v._selection,S=x._selection;return!(k(T)&&k(S)&&T.anchor.type==="element"&&T.focus.type==="element"&&S.anchor.type==="text"&&S.focus.type==="text"||!j(y)||!j(b)||y.__parent!==b.__parent)&&JSON.stringify(v.read(()=>y.exportJSON()))===JSON.stringify(x.read(()=>b.exportJSON()))}(Array.from(l)[0],i,o)?Bn:ti:m!==null?Bn:ni})();return t=u,r=f,d}}function ls(n){n.undoStack=[],n.redoStack=[],n.current=null}function Ea(n,e,t){const r=Ma(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(Et,!0)),a.length===0&&o.dispatchCommand(kt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),$),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(kt,!0));const u=l.pop();l.length===0&&o.dispatchCommand(Et,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),$),n.registerCommand(Zs,()=>(ls(e),!1),$),n.registerCommand(qs,()=>(ls(e),n.dispatchCommand(Et,!1),n.dispatchCommand(kt,!1),!0),$),n.registerUpdateListener(({editorState:o,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,f=e.redoStack,d=e.undoStack,g=u===null?null:u.editorState;if(u!==null&&o===g)return;const h=r(s,o,u,l,a,c);if(h===ti)f.length!==0&&(e.redoStack=[],n.dispatchCommand(Et,!1)),u!==null&&(d.push({...u}),n.dispatchCommand(kt,!0));else if(h===ni)return;e.current={editor:n,editorState:o}}))}function ka(){return{current:null,redoStack:[],undoStack:[]}}function La({delay:n,externalHistoryState:e}){const[t]=et();return function(r,i,o=1e3){const s=P.useMemo(()=>i||ka(),[i]);P.useEffect(()=>Ea(r,s,o),[o,r,s])}(t,e,n),null}const ja=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function Ia(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function Da(){return function(n){const[e]=et(),t=P.useMemo(()=>n(e),[e,n]),r=P.useRef(t.initialValueFn()),[i,o]=P.useState(r.current);return ja(()=>{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}(Ia)}function Oa(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,f,d,g,h]=a;n.update(()=>{const m=O();if(k(m)){const _=m.anchor;let v=_.getNode(),x=0,y=0;if(j(v)&&c>=0&&u>=0&&(x=c,y=c+u,m.setTextNodeRange(v,x,v,y)),x===y&&f===""||(m.insertRawText(f),v=_.getNode()),j(v)){x=d,y=d+g;const b=v.getTextContentSize();x=x>b?b:x,y=y>b?b:y,m.setTextNodeRange(v,x,v,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function Aa(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 Hr&&s.insertAfter(Xe());for(const s of o){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(i),r}function Pa(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=G().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 g=Mr(e);g=j(g)&&r!==null?es(r,g):g,s=g}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:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let g=0;g<l.length;g++){const h=l[g],m=as(n,h,d,r);!i&&C(e)&&m&&e.extractWithChild(h,r,"html")&&(i=!0)}if(i&&!o){if(Nr(u)&&u.append(d),t.append(u),f){const g=f.call(s,u);g&&u.replaceWith(g)}}else t.append(d);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(h,m){const{nodeName:_}=h,v=m._htmlConversions.get(_.toLowerCase());let x=null;if(v!==void 0)for(const y of v){const b=y(h);b!==null&&(x===null||(x.priority||0)<(b.priority||0))&&(x=b)}return x!==null?x.conversion:null}(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const h=c.node;if(l=Array.isArray(h)?h[h.length-1]:h,l!==null){for(const[,m]of i)if(l=m(l,o),!l)break;l&&s.push(...Array.isArray(h)?h:[l])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const f=n.childNodes;let d=[];const g=(l==null||!ut(l))&&(l!=null&&Qr(l)||r);for(let h=0;h<f.length;h++)d.push(...us(f[h],e,t,g,new Map(i),l));return u!=null&&(d=u(d)),Tn(n)&&(d=za(n,d,g?()=>{const h=new Hr;return t.push(h),h}:we)),l==null?d.length>0?s=s.concat(d):Tn(n)&&function(h){return h.nextSibling==null||h.previousSibling==null?!1:br(h.nextSibling)&&br(h.previousSibling)}(n)&&(s=s.concat(Xe())):C(l)&&l.append(...d),s}function za(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const l=e[s];if(Qr(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(o.push(l),s===e.length-1||s<e.length-1&&Qr(e[s+1])){const a=t();a.setFormat(r),a.append(...o),i.push(a),o=[]}}return i}function Ra(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Un=Ra(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 Fa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ds=n=>Fa?(n||window).getSelection():null;function Wa(n,e=O()){return e==null&&Un(166),k(e)&&e.isCollapsed()||e.getNodes().length===0?"":Pa(n,e)}function Ba(n,e=O()){return e==null&&Un(166),k(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Ua(n,e))}function fs(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 gs(t,$a(s.nodes),e)}catch{}const i=n.getData("text/html");if(i)try{const s=new DOMParser().parseFromString(i,"text/html");return gs(t,Aa(t,s),e)}catch{}const o=n.getData("text/plain")||n.getData("text/uri-list");if(o!=null)if(k(e)){const s=o.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=O();if(k(a)){const c=s[l];c===`
39
+ `?r.push(et()):s===" "?r.push(Gt()):r.push(ie(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,o=this.format,i=this.style;let s=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,l=t),s.type==="element"&&function(_,v,x,y){const b=_.getNode(),C=b.getChildAtIndex(_.offset),T=ie(),M=oe(b)?Ne().append(T):T;T.setFormat(x),T.setStyle(y),C===null?b.append(M):C.insertBefore(M),_.is(v)&&v.set(T.__key,0,"text"),_.set(T.__key,0,"text")}(s,l,o,i);const a=s.offset;let c=l.offset;const u=this.getNodes(),f=u.length;let d=u[0];I(d)||D(26);const g=d.getTextContent().length,h=d.getParentOrThrow();let m=u[f-1];if(f===1&&l.type==="element"&&(c=g,l.set(s.key,c,"text")),this.isCollapsed()&&a===g&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&d.getNextSibling()===null)){let _=d.getNextSibling();if(I(_)&&_.canInsertTextBefore()&&!Ie(_)||(_=ie(),_.setFormat(o),_.setStyle(i),h.canInsertTextAfter()?d.insertAfter(_):h.insertAfter(_)),_.select(0,0),d=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&d.getPreviousSibling()===null)){let _=d.getPreviousSibling();if(I(_)&&!Ie(_)||(_=ie(),_.setFormat(o),h.canInsertTextBefore()?d.insertBefore(_):h.insertBefore(_)),_.select(),d=_,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&a!==g){const _=ie(d.getTextContent());_.setFormat(o),d.replace(_),d=_}else if(!this.isCollapsed()&&e!==""){const _=m.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||S(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),Fo(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(d.isToken()){const y=ie(e);return y.select(),void d.replace(y)}const _=d.getFormat(),v=d.getStyle();if(a!==c||_===o&&v===i){if(Vl(d)){const y=ie(e);return y.setFormat(o),y.setStyle(i),y.select(),void d.replace(y)}}else{if(d.getTextContent()!==""){const y=ie(e);if(y.setFormat(o),y.setStyle(i),y.select(),a===0)d.insertBefore(y,!1);else{const[b]=d.splitText(a);b.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(o),d.setStyle(i)}const x=c-a;d=d.spliceText(a,x,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=v))}else{const _=new Set([...d.getParentKeys(),...m.getParentKeys()]),v=S(d)?d:d.getParentOrThrow();let x=S(m)?m:m.getParentOrThrow(),y=m;if(!v.is(x)&&x.isInline())do y=x,x=x.getParentOrThrow();while(x.isInline());if(l.type==="text"&&(c!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<c)if(I(m)&&!m.isToken()&&c!==m.getTextContentSize()){if(m.isSegmented()){const w=ie(m.getTextContent());m.replace(w),m=w}oe(l.getNode())||l.type!=="text"||(m=m.spliceText(0,c,"")),_.add(m.__key)}else{const w=m.getParentOrThrow();w.canBeEmpty()||w.getChildrenSize()!==1?m.remove():w.remove()}else _.add(m.__key);const b=x.getChildren(),C=new Set(u),T=v.is(x),M=v.isInline()&&d.getNextSibling()===null?v:d;for(let w=b.length-1;w>=0;w--){const E=b[w];if(E.is(d)||S(E)&&E.isParentOf(d))break;E.isAttached()&&(!C.has(E)||E.is(y)?T||M.insertAfter(E,!1):E.remove())}if(!T){let w=x,E=null;for(;w!==null;){const z=w.getChildren(),B=z.length;(B===0||z[B-1].is(E))&&(_.delete(w.__key),E=w),w=w.getParent()}}if(d.isToken())if(a===g)d.select();else{const w=ie(e);w.select(),d.replace(w)}else d=d.spliceText(a,g-a,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let w=1;w<f;w++){const E=u[w],z=E.__key;_.has(z)||E.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const x of t)I(x)&&r.push(x);const o=r.length;if(o===0)return this.toggleFormat(e),void re(null);const i=this.anchor,s=this.focus,l=this.isBackward(),a=l?s:i,c=l?i:s;let u=0,f=r[0],d=a.type==="element"?0:a.offset;if(a.type==="text"&&d===f.getTextContentSize()&&(u=1,f=r[1],d=0),f==null)return;const g=f.getFormatFlags(e,null),h=o-1;let m=r[h];const _=c.type==="text"?c.offset:m.getTextContentSize();if(f.is(m)){if(d===_)return;if(Ie(f)||d===0&&_===f.getTextContentSize())f.setFormat(g);else{const x=f.splitText(d,_),y=d===0?x[0]:x[1];y.setFormat(g),a.type==="text"&&a.set(y.__key,0,"text"),c.type==="text"&&c.set(y.__key,_-d,"text")}return void(this.format=g)}d===0||Ie(f)||([,f]=f.splitText(d),d=0),f.setFormat(g);const v=m.getFormatFlags(e,g);_>0&&(_===m.getTextContentSize()||Ie(m)||([m]=m.splitText(_)),m.setFormat(v));for(let x=u+1;x<h;x++){const y=r[x],b=y.getFormatFlags(e,v);y.setFormat(b)}a.type==="text"&&a.set(f.__key,d,"text"),c.type==="text"&&c.set(m.__key,_,"text"),this.format=g|v}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const g=A();return k(g)||D(134),g.insertNodes(e)}const t=Ir((this.isBackward()?this.focus:this.anchor).getNode(),ht),r=e[e.length-1];if("__language"in t&&S(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=Xr(this);t.splice(g,0,e),r.selectEnd()}return}if(!e.some(g=>(S(g)||Y(g))&&!g.isInline())){S(t)||D(135);const g=Xr(this);return t.splice(g,0,e),void r.selectEnd()}const o=function(g){const h=Ne();let m=null;for(let _=0;_<g.length;_++){const v=g[_],x=Qt(v);if(x||Y(v)&&v.isInline()||S(v)&&v.isInline()||I(v)||v.isParentRequired()){if(m===null&&(m=v.createParentElementNode(),h.append(m),x))continue;m!==null&&m.append(v)}else h.append(v),m=null}return h}(e),i=o.getLastDescendant(),s=o.getChildren(),l=!S(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;S(u=c)&&ht(u)&&!u.isEmpty()&&S(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(S(t)||D(135),t.append(...c.getChildren()),c=s[1]),c&&function(g,h,m){const _=h.getParentOrThrow().getLastChild();let v=h;const x=[h];for(;v!==_;)v.getNextSibling()||D(140),v=v.getNextSibling(),x.push(v);let y=g;for(const b of x)y=y.insertAfter(b)}(t,c);const f=Ir(i,ht);l&&S(f)&&(l.canMergeWhenEmpty()||ht(a))&&(f.append(...l.getChildren()),l.remove()),S(t)&&t.isEmpty()&&t.remove(),i.selectEnd();const d=S(t)?t.getLastChild():null;Qt(d)&&f!==t&&d.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=Ne();return G().splice(this.anchor.offset,0,[s]),s.select(),s}const e=Xr(this),t=Ir(this.anchor.getNode(),ht);S(t)||D(136);const r=t.getChildAtIndex(e),o=r?[r,...r.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(e){const t=et();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,i=this.focus;let s=e[0],l=e[r];const[a,c]=Qr(this);if(t===0)return[];if(t===1){if(I(s)&&!this.isCollapsed()){const f=a>c?c:a,d=a>c?a:c,g=s.splitText(f,d),h=f===0?g[0]:g[1];return h!=null?[h]:[]}return[s]}const u=o.isBefore(i);if(I(s)){const f=u?a:c;f===s.getTextContentSize()?e.shift():f!==0&&([,s]=s.splitText(f),e[0]=s)}if(I(l)){const f=l.getTextContent().length,d=u?c:a;d===0?e.pop():d!==f&&([l]=l.splitText(d),e[r]=l)}return e}modify(e,t,r){const o=this.focus,i=this.anchor,s=e==="move",l=Wt(o,t);if(Y(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const g=$o();return g.add(l.__key),void be(g)}const d=t?l.getPreviousSibling():l.getNextSibling();if(I(d)){const g=d.__key,h=t?d.getTextContent().length:0;return o.set(g,h,"text"),void(s&&i.set(g,h,"text"))}{const g=l.getParentOrThrow();let h,m;return S(d)?(m=d.__key,h=t?d.getChildrenSize():0):(h=l.getIndexWithinParent(),m=g.__key,t||h++),o.set(m,h,"element"),void(s&&i.set(m,h,"element"))}}const a=Q(),c=Se(a._window);if(!c)return;const u=a._blockCursorElement,f=a._rootElement;if(f===null||u===null||!S(l)||l.isInline()||l.canBeEmpty()||Er(u,a,f),function(d,g,h,m){d.modify(g,h,m)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const d=c.getRangeAt(0),g=this.anchor.getNode(),h=oe(g)?g:Dl(g);if(this.applyDOMRange(d),this.dirty=!0,!s){const m=this.getNodes(),_=[];let v=!1;for(let x=0;x<m.length;x++){const y=m[x];Tr(y,h)?_.push(y):v=!0}if(v&&_.length>0)if(t){const x=_[0];S(x)?x.selectStart():x.getParentOrThrow().selectStart()}else{const x=_[_.length-1];S(x)?x.selectEnd():x.getParentOrThrow().selectEnd()}c.anchorNode===d.startContainer&&c.anchorOffset===d.startOffset||function(x){const y=x.focus,b=x.anchor,C=b.key,T=b.offset,M=b.type;Ue(b,y.key,y.offset,y.type),Ue(y,C,T,M),x._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&S(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const o=t.getParent(),i=t.getNextSibling()||(o===null?null:o.getNextSibling());if(S(i)&&i.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 i=this.focus,s=Wt(i,e);if(Y(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&S(o)&&o.getChildrenSize()===0){o.remove();const l=$o();l.add(s.__key),be(l)}else s.remove(),Q().dispatchCommand(ln,void 0);return}if(!e&&S(s)&&S(o)&&o.isEmpty())return o.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=i.type==="text"?i.getNode():null;if(o=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=i.offset,c=l.getTextContentSize();if(l.is(o)||e&&a!==c||!e&&a!==0)return void Po(l,e,a)}else if(o!==null&&o.isSegmented()){const a=r.offset,c=o.getTextContentSize();if(o.is(l)||e&&a!==0||!e&&a!==c)return void Po(o,e,a)}(function(a,c){const u=a.anchor,f=a.focus,d=u.getNode(),g=f.getNode();if(d===g&&u.type==="text"&&f.type==="text"){const h=u.offset,m=f.offset,_=h<m,v=_?h:m,x=_?m:h,y=x-1;v!==y&&(qi(d.getTextContent().slice(v,x))||(c?f.offset=y:u.offset=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()&&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 ve(n){return n instanceof Rn}function Ao(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Qr(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]:[Ao(t),Ao(r)]}function Po(n,e,t){const r=n,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,l=0;for(let c=0;c<i;c++){const u=c===i-1;if(l=s,s+=o[c].length,e&&s===t||s>t||u){o.splice(c,1),u&&(l=void 0);break}}const a=o.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function Ro(n,e,t,r){let o,i=e;if(n.nodeType===jt){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;i===a&&(s=!0,i=a-1);let u=l[i],f=!1;if(u===c)u=l[i+1],f=!0;else if(c!==null){const d=c.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,c)&&i--}if(o=ft(u),I(o))i=Xi(o,s);else{let d=ft(n);if(d===null)return null;if(S(d)){i=Math.min(d.getChildrenSize(),i);let g=d.getChildAtIndex(i);if(S(g)&&function(h,m,_){const v=h.getParent();return _===null||v===null||!v.canBeEmpty()||v!==_.getNode()}(g,0,t)){const h=s?g.getLastDescendant():g.getFirstDescendant();h===null?d=g:(g=h,d=S(g)?g:g.getParentOrThrow()),i=0}I(g)?(o=g,d=null,i=Xi(g,s)):g!==d&&s&&!f&&i++}else{const g=d.getIndexWithinParent();i=e===0&&Y(d)&&ft(n)===d?g:g+1,d=d.getParentOrThrow()}if(S(d))return we(d.__key,i,"element")}}else o=ft(n);return I(o)?we(o.__key,i,"text"):null}function zo(n,e,t){const r=n.offset,o=n.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(e){if((t||!e)&&i===null&&S(s)&&s.isInline()){const l=s.getPreviousSibling();I(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else S(i)&&!t&&i.isInline()?(n.key=i.__key,n.offset=i.getChildrenSize(),n.type="element"):I(i)&&(n.key=i.__key,n.offset=i.getTextContent().length)}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(e&&S(i)&&i.isInline())n.key=i.__key,n.offset=0,n.type="element";else if((t||e)&&i===null&&S(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();I(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),o=n.is(e);zo(n,r,o),zo(e,!r,o),o&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const i=Q();if(i.isComposing()&&i._compositionKey!==n.key&&k(t)){const s=t.anchor,l=t.focus;Ue(n,s.key,s.offset,s.type),Ue(e,l.key,l.offset,l.type)}}}function Wo(n,e,t,r,o,i){if(n===null||t===null||!At(o,n,t))return null;const s=Ro(n,e,k(i)?i.anchor:null,o);if(s===null)return null;const l=Ro(t,r,k(i)?i.focus:null,o);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=ft(n),c=ft(t);if(Y(a)&&Y(c))return null}return Fo(s,l,i),[s,l]}function Hr(n){return S(n)&&!n.isInline()}function Bo(n,e,t,r,o,i){const s=Oe(),l=new Ye(we(n,e,o),we(t,r,i),0,"");return l.dirty=!0,s._selection=l,l}function Jl(){const n=we("root",0,"element"),e=we("root",0,"element");return new Ye(n,e,0,"")}function $o(){return new Rn(new Set)}function Gr(n,e,t,r){const o=t._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,l=s==="selectionchange",a=!hr&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(k(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,f=e.anchorOffset,d=e.focusOffset,l&&k(n)&&!At(t,c,u))return n.clone();const g=Wo(c,f,u,d,t,n);if(g===null)return null;const[h,m]=g;return new Ye(h,m,k(n)?n.format:0,k(n)?n.style:"")}function A(){return Oe()._selection}function Xt(){return Q()._editorState._selection}function zn(n,e,t,r=1){const o=n.anchor,i=n.focus,s=o.getNode(),l=i.getNode();if(!e.is(s)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const c=o.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);o.set(a,u,"element"),i.set(a,u,"element"),Uo(n)}}else{const c=n.isBackward(),u=c?i:o,f=u.getNode(),d=c?o:i,g=d.getNode();if(e.is(f)){const h=u.offset;(t<=h&&r>0||t<h&&r<0)&&u.set(a,Math.max(0,h+r),"element")}if(e.is(g)){const h=d.offset;(t<=h&&r>0||t<h&&r<0)&&d.set(a,Math.max(0,h+r),"element")}}Uo(n)}function Uo(n){const e=n.anchor,t=e.offset,r=n.focus,o=r.offset,i=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!S(i))return;const l=i.getChildrenSize(),a=t>=l,c=a?i.getChildAtIndex(l-1):i.getChildAtIndex(t);if(I(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}}else{if(S(i)){const l=i.getChildrenSize(),a=t>=l,c=a?i.getChildAtIndex(l-1):i.getChildAtIndex(t);if(I(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(S(s)){const l=s.getChildrenSize(),a=o>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(o);if(I(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function Fn(n,e,t,r,o){let i=null,s=0,l=null;r!==null?(i=r.__key,I(r)?(s=r.getTextContentSize(),l="text"):S(r)&&(s=r.getChildrenSize(),l="element")):o!==null&&(i=o.__key,I(o)?l="text":S(o)&&(l="element")),i!==null&&l!==null?n.set(i,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function Yo(n,e,t,r,o){n.type==="text"?(n.key=t,e||(n.offset+=o)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function Ql(n,e,t,r,o,i,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(o.has("collaboration")&&f!==i||f!==null&&_r(f))return;if(!k(e))return void(n!==null&&At(t,l,a)&&r.removeAllRanges());const d=e.anchor,g=e.focus,h=d.key,m=g.key,_=Sn(t,h),v=Sn(t,m),x=d.offset,y=g.offset,b=e.format,C=e.style,T=e.isCollapsed();let M=_,w=v,E=!1;if(d.type==="text"){M=vn(_);const Z=d.getNode();E=Z.getFormat()!==b||Z.getStyle()!==C}else k(n)&&n.anchor.type==="text"&&(E=!0);var z,B,ee,J,F;if(g.type==="text"&&(w=vn(v)),M!==null&&w!==null&&(T&&(n===null||E||k(n)&&(n.format!==b||n.style!==C))&&(z=b,B=C,ee=x,J=h,F=performance.now(),vo=[z,B,ee,J,F]),c!==x||u!==y||l!==M||a!==w||r.type==="Range"&&T||(f!==null&&i.contains(f)||i.focus({preventScroll:!0}),d.type==="element"))){try{r.setBaseAndExtent(M,x,w,y)}catch{}if(!o.has("skip-scroll-into-view")&&e.isCollapsed()&&i!==null&&i===document.activeElement){const Z=e instanceof Ye&&e.anchor.type==="element"?M.childNodes[x]||null:r.rangeCount>0?r.getRangeAt(0):null;if(Z!==null){let ce;if(Z instanceof Text){const je=document.createRange();je.selectNode(Z),ce=je.getBoundingClientRect()}else ce=Z.getBoundingClientRect();(function(je,Ve,nn){const rn=nn.ownerDocument,on=rn.defaultView;if(on===null)return;let{top:St,bottom:Tt}=Ve,wt=0,Nt=0,pe=nn;for(;pe!==null;){const ot=pe===rn.body;if(ot)wt=0,Nt=wn(je).innerHeight;else{const Ze=pe.getBoundingClientRect();wt=Ze.top,Nt=Ze.bottom}let Ee=0;if(St<wt?Ee=-(wt-St):Tt>Nt&&(Ee=Tt-Nt),Ee!==0)if(ot)on.scrollBy(0,Ee);else{const Ze=pe.scrollTop;pe.scrollTop+=Ee;const st=pe.scrollTop-Ze;St-=st,Tt-=st}if(ot)break;pe=Tn(pe)}})(t,ce,i)}}Br=!0}}function Hl(n){let e=A()||Xt();e===null&&(e=G().selectEnd()),e.insertNodes(n)}function Xr(n){let e=n;n.isCollapsed()||e.removeText();const t=A();k(t)&&(e=t),k(e)||D(161);const r=e.anchor;let o=r.getNode(),i=r.offset;for(;!ht(o);)[o,i]=Gl(o,i);return i}function Gl(n,e){const t=n.getParent();if(!t){const o=Ne();return G().append(o),o.select(),[G(),0]}if(I(n)){const o=n.splitText(e);if(o.length===0)return[t,n.getIndexWithinParent()];const i=e===0?0:1;return[t,o[0].getIndexWithinParent()+i]}if(!S(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const o=new Ye(we(n.__key,e,"element"),we(n.__key,e,"element"),0,""),i=n.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let te=null,ne=null,fe=!1,qr=!1,Wn=0;const Ko={characterData:!0,childList:!0,subtree:!0};function qt(){return fe||te!==null&&te._readOnly}function ge(){fe&&D(13)}function Vo(){Wn>99&&D(14)}function Oe(){return te===null&&D(195,Zo()),te}function Q(){return ne===null&&D(196,Zo()),ne}function Zo(){let n=0;const e=new Set,t=Un.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=xn(o);if(yr(i))n++;else if(i){let s=String(i.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 Xl(){return ne}function Jo(n,e,t){const r=e.__type,o=function(l,a){const c=l._nodes.get(a);return c===void 0&&D(30,a),c}(n,r);let i=t.get(r);i===void 0&&(i=Array.from(o.transforms),t.set(r,i));const s=i.length;for(let l=0;l<s&&(i[l](e),e.isAttached());l++);}function Qo(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function ql(n){return ei(n,Q()._nodes)}function ei(n,e){const t=n.type,r=e.get(t);r===void 0&&D(17,t);const o=r.klass;n.type!==o.getType()&&D(18,o.name);const i=o.importJSON(n),s=n.children;if(S(i)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=ei(s[l],e);i.append(a)}return i}function Ho(n,e,t){const r=te,o=fe,i=ne;te=e,fe=!0,ne=n;try{return t()}finally{te=r,fe=o,ne=i}}function Ke(n,e){const t=n._pendingEditorState,r=n._rootElement,o=n._headless||r===null;if(t===null)return;const i=n._editorState,s=i._selection,l=t._selection,a=n._dirtyType!==Qe,c=te,u=fe,f=ne,d=n._updating,g=n._observer;let h=null;if(n._pendingEditorState=null,n._editorState=t,!o&&a&&g!==null){ne=n,te=t,fe=!1,n._updating=!0;try{const T=n._dirtyType,M=n._dirtyElements,w=n._dirtyLeaves;g.disconnect(),h=zl(i,t,n,T,M,w)}catch(T){if(T instanceof Error&&n._onError(T),qr)throw T;return ns(n,null,r,t),Bi(n),n._dirtyType=dt,qr=!0,Ke(n,i),void(qr=!1)}finally{g.observe(r,Ko),n._updating=d,te=c,fe=u,ne=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,_=n._dirtyElements,v=n._normalizedNodes,x=n._updateTags,y=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(T,M){const w=T._decorators;let E=T._pendingDecorators||w;const z=M._nodeMap;let B;for(B in E)z.has(B)||(E===w&&(E=Qi(T)),delete E[B])}(n,t);const b=o?null:Se(n._window);if(n._editable&&b!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(g!==null&&g.disconnect(),a||l===null||l.dirty){const T=n._blockCursorElement;T!==null&&Er(T,n,r),Ql(s,l,n,b,x,r)}Ll(n,r,l),g!==null&&g.observe(r,Ko)}finally{ne=f,te=c}}h!==null&&function(T,M,w,E,z){const B=Array.from(T._listeners.mutation),ee=B.length;for(let J=0;J<ee;J++){const[F,Z]=B[J],ce=M.get(Z);ce!==void 0&&F(ce,{dirtyLeaves:E,prevEditorState:z,updateTags:w})}}(n,h,x,m,i),k(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(ln,void 0);const C=n._pendingDecorators;C!==null&&(n._decorators=C,n._pendingDecorators=null,en("decorator",n,!0,C)),function(T,M,w){const E=Hi(M),z=Hi(w);E!==z&&en("textcontent",T,!0,z)}(n,e||i,t),en("update",n,!0,{dirtyElements:_,dirtyLeaves:m,editorState:t,normalizedNodes:v,prevEditorState:e||i,tags:x}),function(T,M){if(T._deferred=[],M.length!==0){const w=T._updating;T._updating=!0;try{for(let E=0;E<M.length;E++)M[E]()}finally{T._updating=w}}}(n,y),function(T){const M=T._updates;if(M.length!==0){const w=M.shift();if(w){const[E,z]=w;qo(T,E,z)}}}(n)}function en(n,e,t,...r){const o=e._updating;e._updating=t;try{const i=Array.from(e._listeners[n]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{e._updating=o}}function Go(n,e,t){if(n._updating===!1||ne!==n){let o=!1;return n.update(()=>{o=Go(n,e,t)}),o}const r=vr(n);for(let o=4;o>=0;o--)for(let i=0;i<r.length;i++){const s=r[i]._commands.get(e);if(s!==void 0){const l=s[o];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 Xo(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const o=t.shift();if(o){const[i,s]=o;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&&D(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}i()}}return r}function qo(n,e,t){const r=n._updateTags;let o,i,s=!1,l=!1;t!==void 0&&(o=t.onUpdate,i=t.tag,i!=null&&r.add(i),s=t.skipTransforms||!1,l=t.discrete||!1),o&&n._deferred.push(o);const a=n._editorState;let c=n._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=n._pendingEditorState=new $n(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const f=te,d=fe,g=ne,h=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(x){const y=x.getEditorState()._selection,b=Se(x._window);return k(y)||y==null?Gr(y,b,x,null):y.clone()}(n));const _=n._compositionKey;e(),s=Xo(n,s),function(x,y){const b=y.getEditorState()._selection,C=x._selection;if(k(C)){const T=C.anchor,M=C.focus;let w;if(T.type==="text"&&(w=T.getNode(),w.selectionTransform(b,C)),M.type==="text"){const E=M.getNode();w!==E&&E.selectionTransform(b,C)}}}(c,n),n._dirtyType!==Qe&&(s?function(x,y){const b=y._dirtyLeaves,C=x._nodeMap;for(const T of b){const M=C.get(T);I(M)&&M.isAttached()&&M.isSimpleText()&&!M.isUnmergeable()&&Yi(M)}}(c,n):function(x,y){const b=y._dirtyLeaves,C=y._dirtyElements,T=x._nodeMap,M=We(),w=new Map;let E=b,z=E.size,B=C,ee=B.size;for(;z>0||ee>0;){if(z>0){y._dirtyLeaves=new Set;for(const J of E){const F=T.get(J);I(F)&&F.isAttached()&&F.isSimpleText()&&!F.isUnmergeable()&&Yi(F),F!==void 0&&Qo(F,M)&&Jo(y,F,w),b.add(J)}if(E=y._dirtyLeaves,z=E.size,z>0){Wn++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const J of B){const F=J[0],Z=J[1];if(F!=="root"&&!Z)continue;const ce=T.get(F);ce!==void 0&&Qo(ce,M)&&Jo(y,ce,w),C.set(F,Z)}E=y._dirtyLeaves,z=E.size,B=y._dirtyElements,ee=B.size,Wn++}y._dirtyLeaves=b,y._dirtyElements=C}(c,n),Xo(n),function(x,y,b,C){const T=x._nodeMap,M=y._nodeMap,w=[];for(const[E]of C){const z=M.get(E);z!==void 0&&(z.isAttached()||(S(z)&&co(z,E,T,M,w,C),T.has(E)||C.delete(E),w.push(E)))}for(const E of w)M.delete(E);for(const E of b){const z=M.get(E);z===void 0||z.isAttached()||(T.has(E)||b.delete(E),M.delete(E))}}(a,c,n._dirtyLeaves,n._dirtyElements)),_!==n._compositionKey&&(c._flushSync=!0);const v=c._selection;if(k(v)){const x=c._nodeMap,y=v.anchor.key,b=v.focus.key;x.get(y)!==void 0&&x.get(b)!==void 0||D(19)}else ve(v)&&v._nodes.size===0&&(c._selection=null)}catch(_){return _ instanceof Error&&n._onError(_),n._pendingEditorState=a,n._dirtyType=dt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Ke(n)}finally{te=f,fe=d,ne=g,n._updating=h,Wn=0}n._dirtyType!==Qe||function(_,v){const x=v.getEditorState()._selection,y=_._selection;if(y!==null){if(y.dirty||!y.is(x))return!0}else if(x!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,Ke(n)):u&&Nl(()=>{Ke(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function he(n,e,t){n._updating?n._updates.push([e,t]):qo(n,e,t)}class Bn extends jn{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 _l[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=Q()._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(I(t)&&e.push(t),S(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;S(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;S(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 i=t[r-1];return S(i)&&i.getLastDescendant()||i||null}const o=t[e];return S(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:se(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&D(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&D(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 i=t[o];e+=i.getTextContent(),S(i)&&o!==r-1&&!i.isInline()&&(e+=ke)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let o=0;o<r;o++){const i=t[o];e+=i.getTextContentSize(),S(i)&&o!==r-1&&!i.isInline()&&(e+=ke.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=zi[e];return!!(this.getFormat()&t)}return!1}select(e,t){ge();const r=A();let o=e,i=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(I(a)||S(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const a=this.getLastChild();if(I(a)||S(a))return a.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const l=this.__key;return k(r)?(r.anchor.set(l,o,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):Bo(l,o,l,i,"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!==""?zi[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,i=this.getChildrenSize(),s=this.getWritable(),l=s.__key,a=[],c=[],u=this.getChildAtIndex(e+t);let f=null,d=i-t+o;if(e!==0)if(e===i)f=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(f=h.getPreviousSibling())}if(t>0){let h=f===null?this.getFirstChild():f.getNextSibling();for(let m=0;m<t;m++){h===null&&D(100);const _=h.getNextSibling(),v=h.__key;He(h.getWritable()),c.push(v),h=_}}let g=f;for(let h=0;h<o;h++){const m=r[h];g!==null&&m.is(g)&&(f=g=g.getPreviousSibling());const _=m.getWritable();_.__parent===l&&d--,He(_);const v=m.__key;if(g===null)s.__first=v,_.__prev=null;else{const x=g.getWritable();x.__next=v,_.__prev=x.__key}m.__key===l&&D(76),_.__parent=l,a.push(v),g=m}if(e+t===i)g!==null&&(g.getWritable().__next=null,s.__last=g.__key);else if(u!==null){const h=u.getWritable();if(g!==null){const m=g.getWritable();h.__prev=g.__key,m.__next=u.__key}else h.__prev=null}if(s.__size=d,c.length){const h=A();if(k(h)){const m=new Set(c),_=new Set(a),{anchor:v,focus:x}=h;es(v,m,_)&&Fn(v,v.getNode(),this,f,u),es(x,m,_)&&Fn(x,x.getNode(),this,f,u),d!==0||this.canBeEmpty()||gt(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 S(n){return n instanceof Bn}function es(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 ea extends jn{constructor(e){super(e)}decorate(e,t){D(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Y(n){return n instanceof ea}class tn extends Bn{static getType(){return"root"}static clone(){return new tn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){D(51)}getTextContent(){const e=this.__cachedText;return!qt()&&Q()._dirtyType!==Qe||e===null?super.getTextContent():e}remove(){D(52)}replace(e){D(53)}insertBefore(e){D(54)}insertAfter(e){D(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];S(r)||Y(r)||D(56)}return super.append(...e)}static importJSON(e){const t=G();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 tn}function ti(){return new $n(new Map([["root",new tn]]))}function ts(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&D(130,t.name),S(n)){const r=e.children;Array.isArray(r)||D(59,t.name);const o=n.getChildren();for(let i=0;i<o.length;i++){const s=ts(o[i]);r.push(s)}}return e}class $n{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 Ho(t&&t.editor||null,this,e)}clone(e){const t=new $n(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Ho(null,this,()=>({root:ts(G())}))}}class ni extends Bn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class yt extends Bn{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=Me[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 yt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=Ft(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:ta,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&kr(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 i=this.getIndent();i>0&&(t.style.textIndent=20*i+"px")}return{element:t}}static importJSON(e){const t=Ne();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=Ne();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||I(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 ta(n){const e=Ne();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 Ne(){return Nn(new yt)}function ri(n){return n instanceof yt}const U=0,na=4;function ns(n,e,t,r){const o=n._keyToDOMMap;o.clear(),n._editorState=ti(),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 i=n._observer;i!==null&&(i.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",o.set("root",t))}function ra(n){const e=n||{},t=Xl(),r=e.theme||{},o=n===void 0?t:e.parentEditor||null,i=e.disableEvents||!1,s=ti(),l=e.namespace||(o!==null?o._config.namespace:eo()),a=e.editorState,c=[tn,_t,Jt,Ht,yt,ni,...e.nodes||[]],{onError:u,html:f}=e,d=e.editable===void 0||e.editable;let g;if(n===void 0&&t!==null)g=t._nodes;else{g=new Map;for(let m=0;m<c.length;m++){let _=c[m],v=null,x=null;if(typeof _!="function"){const T=_;_=T.replace,v=T.with,x=T.withKlass||null}const y=_.getType(),b=_.transform(),C=new Set;b!==null&&C.add(b),g.set(y,{exportDOM:f&&f.export?f.export.get(_):void 0,klass:_,replace:v,replaceWithKlass:x,transforms:C})}}const h=new Un(s,o,g,{disableEvents:i,namespace:l,theme:r},u||console.error,function(m,_){const v=new Map,x=new Set,y=b=>{Object.keys(b).forEach(C=>{let T=v.get(C);T===void 0&&(T=[],v.set(C,T)),T.push(b[C])})};return m.forEach(b=>{const C=b.klass.importDOM;if(C==null||x.has(C))return;x.add(C);const T=C.call(b.klass);T!==null&&y(T)}),_&&y(_),v}(g,f?f.import:void 0),d);return a!==void 0&&(h._pendingEditorState=a,h._dirtyType=dt),h}class Un{constructor(e,t,r,o,i,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=o,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=eo(),this._onError=i,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&&D(35);const o=this._commands;o.has(e)||o.set(e,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(e);i===void 0&&D(36,String(e));const s=i[r];return s.add(t),()=>{s.delete(t),i.every(l=>l.size===0)&&o.delete(e)}}registerMutationListener(e,t,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation;i.set(t,o);const s=r&&r.skipInitialization;return s===void 0||s||this.initializeMutationListener(t,o),()=>{i.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&D(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,o=Al(r).get(t.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&e(i,{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],i=r.replaceWithKlass;if(i!=null){const a=this.registerNodeTransformToKlass(i,t);o.push(a)}var s,l;return s=this,l=e.getType(),he(s,()=>{const a=Oe();if(a.isEmpty())return;if(l==="root")return void G().markDirty();const c=a._nodeMap;for(const[,u]of c)u.markDirty()},s._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{o.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 O(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=Ft(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=e,ns(this,t,e,o),t!==null&&(this._config.disableEvents||Fl(t),r!=null&&t.classList.remove(...r)),e!==null){const i=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=i,this._dirtyType=dt,Bi(this),this._updateTags.add("history-merge"),Ke(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=On.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",No),On.set(c,(u||0)+1),l.__lexicalEditor=a;const f=wo(l);for(let d=0;d<Wr.length;d++){const[g,h]=Wr[d],m=typeof h=="function"?_=>{ko(_)||(Eo(_),(a.isEditable()||g==="click")&&h(_,a))}:_=>{if(ko(_))return;Eo(_);const v=a.isEditable();switch(g){case"cut":return v&&O(a,rr,_);case"copy":return O(a,fn,_);case"paste":return v&&O(a,tr,_);case"dragstart":return v&&O(a,Li,_);case"dragover":return v&&O(a,Oi,_);case"dragend":return v&&O(a,el,_);case"focus":return v&&O(a,rl,_);case"blur":return v&&O(a,il,_);case"drop":return v&&O(a,Di,_)}};l.addEventListener(g,m),f.push(()=>{l.removeEventListener(g,m)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=o,this._pendingEditorState=null,this._window=null;en("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&D(38),Wi(this);const r=this._pendingEditorState,o=this._updateTags,i=t!==void 0?t.tag:null;r===null||r.isEmpty()||(i!=null&&o.add(i),Ke(this)),this._pendingEditorState=e,this._dirtyType=dt,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&o.add(i),Ke(this)}parseEditorState(e,t){return function(r,o,i){const s=ti(),l=te,a=fe,c=ne,u=o._dirtyElements,f=o._dirtyLeaves,d=o._cloneNotNeeded,g=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,te=s,fe=!1,ne=o;try{const h=o._nodes;ei(r.root,h),i&&i(),s._readOnly=!0}catch(h){h instanceof Error&&o._onError(h)}finally{o._dirtyElements=u,o._dirtyLeaves=f,o._cloneNotNeeded=d,o._dirtyType=g,te=l,fe=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ke(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 o=A(),i=G();o!==null?o.dirty=!0:i.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?i.selectStart():i.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,en("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Un.version="0.17.1+prod.esm";const Bc="";function ia(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var oa=ia(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=P.createContext(null);function sa(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function tt(){const n=P.useContext(rs);return n==null&&oa(8),n}const is=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,la=is?P.useLayoutEffect:P.useEffect,Yn={tag:"history-merge"};function aa({initialConfig:n,children:e}){const t=P.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:l,html:a}=n,c=sa(null,r),u=ra({editable:n.editable,html:a,namespace:o,nodes:i,onError:f=>s(f,u),theme:r});return function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const g=G();if(g.isEmpty()){const h=Ne();g.append(h);const m=is?document.activeElement:null;(A()!==null||m!==null&&m===f.getRootElement())&&h.select()}},Yn);else if(d!==null)switch(typeof d){case"string":{const g=f.parseEditorState(d);f.setEditorState(g,Yn);break}case"object":f.setEditorState(d,Yn);break;case"function":f.update(()=>{G().isEmpty()&&d(f)},Yn)}}}(u,l),[u,c]},[]);return la(()=>{const r=n.editable,[o]=t;o.setEditable(r===void 0||r)},[]),j.jsx(rs.Provider,{value:t,children:e})}function ca({defaultSelection:n}){const[e]=tt();return P.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 ua(){return G().getTextContent()}function da(n,e=!0){if(n)return!1;let t=ua();return e&&(t=t.trim()),t===""}function fa(n){if(!da(n,!1))return!1;const e=G().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const o=e[r];if(Y(o))return!1;if(S(o)){if(!ri(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let l=0;l<s;l++){const a=i[r];if(!I(a))return!1}}}return!0}function os(n){return()=>fa(n)}function ga(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}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.`)});function ha(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}ha(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 Kn=new Map;function ss(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(e[o.trim()]=i.trim())}return e}function ii(n){let e=Kn.get(n);return e===void 0&&(e=ss(n),Kn.set(n,e)),e}function ls(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,o]=t,i=n.isBackward(),s=r.getNode(),l=o.getNode(),a=e.is(s),c=e.is(l);if(a||c){const[u,f]=Qr(n),d=s.is(l),g=e.is(i?l:s),h=e.is(i?s:l);let m,_=0;return d?(_=u>f?f:u,m=u>f?u:f):g?(_=i?f:u,m=void 0):h&&(_=0,m=i?u:f),e.__text=e.__text.slice(_,m),e}}return e}function pa(n){const e=n.getStyle(),t=ss(e);Kn.set(e,t)}function xt(n,e){const t=ii("getStyle"in n?n.getStyle():n.style),r=Object.entries(e).reduce((i,[s,l])=>(typeof l=="function"?i[s]=l(t[s],n):l===null?delete i[s]:i[s]=l,i),{...t}),o=function(i){let s="";for(const l in i)l&&(s+=`${l}: ${i[l]};`);return s}(r);n.setStyle(o),Kn.set(o,r)}function ma(n,e){const t=n.getNodes(),r=t.length,o=n.getStartEndPoints();if(o===null)return;const[i,s]=o,l=r-1;let a=t[0],c=t[l];if(n.isCollapsed()&&k(n))return void xt(n,e);const u=a.getTextContent().length,f=s.offset;let d=i.offset;const g=i.isBefore(s);let h=g?d:f,m=g?f:d;const _=g?i.type:s.type,v=g?s.type:i.type,x=g?s.key:i.key;if(I(a)&&h===u){const y=a.getNextSibling();I(y)&&(d=0,h=0,a=y)}if(t.length===1){if(I(a)&&a.canHaveFormat()){if(h=_==="element"?0:d>f?f:d,m=v==="element"?u:d>f?d:f,h===m)return;if(Ie(a)||h===0&&m===u)xt(a,e),a.select(h,m);else{const y=a.splitText(h,m),b=h===0?y[0]:y[1];xt(b,e),b.select(0,m-h)}}}else{if(I(a)&&h<a.getTextContentSize()&&a.canHaveFormat()&&(h===0||Ie(a)||(a=a.splitText(h)[1],h=0,g?i.set(a.getKey(),h,"text"):s.set(a.getKey(),h,"text")),xt(a,e)),I(c)&&c.canHaveFormat()){const y=c.getTextContent().length;c.__key!==x&&m!==0&&(m=y),m===y||Ie(c)||([c]=c.splitText(m)),m===0&&v!=="element"||xt(c,e)}for(let y=1;y<l;y++){const b=t[y],C=b.getKey();I(b)&&b.canHaveFormat()&&C!==a.getKey()&&C!==c.getKey()&&!b.isToken()&&xt(b,e)}}}function as(n,e){const t=Wt(n.focus,e);return Y(t)&&!t.isIsolated()||S(t)&&!t.isInline()&&!t.canBeEmpty()}function _a(n,e,t,r){n.modify(e?"extend":"move",t,r)}function ya(n){const e=n.anchor.getNode();return(oe(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function cs(n,e,t){const r=ya(n);_a(n,e,t?!r:r,"character")}function xa(n,e,t){const r=ii(n.getStyle());return r!==null&&r[e]||t}function va(n,e,t=""){let r=null;const o=n.getNodes(),i=n.anchor,s=n.focus,l=n.isBackward(),a=l?s.offset:i.offset,c=l?s.getNode():i.getNode();if(k(n)&&n.isCollapsed()&&n.style!==""){const u=ii(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<o.length;u++){const f=o[u];if((u===0||a!==0||!f.is(c))&&I(f)){const d=xa(f,e,t);if(r===null)r=d;else if(r!==d){r="";break}}}return r===null?t:r}function Ca(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ba=Ca(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 us=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Sa=us&&"documentMode"in document?document.documentMode:null;!(!us||!("InputEvent"in window)||Sa)&&"getTargetRanges"in new window.InputEvent("input");function vt(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function Ta(n){const e=oi(n,t=>S(t)&&!t.isInline());return S(e)||ba(4,n.__key),e}const oi=(n,e)=>{let t=n;for(;t!==G()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function nt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const ds=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function wa({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:o,ariaExpanded:i,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:f,className:d,id:g,role:h="textbox",spellCheck:m=!0,style:_,tabIndex:v,"data-testid":x,...y},b){const[C,T]=P.useState(n.isEditable()),M=P.useCallback(E=>{E&&E.ownerDocument&&E.ownerDocument.defaultView?n.setRootElement(E):n.setRootElement(null)},[n]),w=P.useMemo(()=>function(...E){return z=>{E.forEach(B=>{typeof B=="function"?B(z):B!=null&&(B.current=z)})}}(b,M),[M,b]);return ds(()=>(T(n.isEditable()),n.registerEditableListener(E=>{T(E)})),[n]),j.jsx("div",{...y,"aria-activedescendant":C?e:void 0,"aria-autocomplete":C?t:"none","aria-controls":C?r:void 0,"aria-describedby":o,"aria-expanded":C&&h==="combobox"?!!i:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":C?c:void 0,"aria-readonly":!C||void 0,"aria-required":u,autoCapitalize:f,className:d,contentEditable:C,"data-testid":x,id:g,ref:w,role:C?h:void 0,spellCheck:m,style:_,tabIndex:v})}const Na=P.forwardRef(wa);function fs(n){return n.getEditorState().read(os(n.isComposing()))}const Ea=P.forwardRef(ka);function ka(n,e){const{placeholder:t,...r}=n,[o]=tt();return j.jsxs(j.Fragment,{children:[j.jsx(Na,{editor:o,...r,ref:e}),t!=null&&j.jsx(Ma,{editor:o,content:t})]})}function Ma({content:n,editor:e}){const t=function(s){const[l,a]=P.useState(()=>fs(s));return ds(()=>{function c(){const u=fs(s);a(u)}return c(),vt(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,o]=P.useState(e.isEditable());if(P.useLayoutEffect(()=>(o(e.isEditable()),e.registerEditableListener(s=>{o(s)})),[e]),!t)return null;let i=null;return typeof n=="function"?i=n(r):n!==null&&(i=n),i===null?null:j.jsx("div",{"aria-hidden":!0,children:i})}const Vn=0,si=1,li=2,Ce=0,Ia=1,gs=2,Da=3,La=4;function Oa(n,e,t,r,o){if(n===null||t.size===0&&r.size===0&&!o)return Ce;const i=e._selection,s=n._selection;if(o)return Ia;if(!(k(i)&&k(s)&&s.isCollapsed()&&i.isCollapsed()))return Ce;const l=function(v,x,y){const b=v._nodeMap,C=[];for(const T of x){const M=b.get(T);M!==void 0&&C.push(M)}for(const[T,M]of y){if(!M)continue;const w=b.get(T);w===void 0||oe(w)||C.push(w)}return C}(e,t,r);if(l.length===0)return Ce;if(l.length>1){const v=e._nodeMap,x=v.get(i.anchor.key),y=v.get(s.anchor.key);return x&&y&&!n._nodeMap.has(x.__key)&&I(x)&&x.__text.length===1&&i.anchor.offset===1?gs:Ce}const a=l[0],c=n._nodeMap.get(a.__key);if(!I(c)||!I(a)||c.__mode!==a.__mode)return Ce;const u=c.__text,f=a.__text;if(u===f)return Ce;const d=i.anchor,g=s.anchor;if(d.key!==g.key||d.type!=="text")return Ce;const h=d.offset,m=g.offset,_=f.length-u.length;return _===1&&m===h-1?gs:_===-1&&m===h+1?Da:_===-1&&m===h?La:Ce}function ja(n,e){let t=Date.now(),r=Ce;return(o,i,s,l,a,c)=>{const u=Date.now();if(c.has("historic"))return r=Ce,t=u,li;const f=Oa(o,i,l,a,n.isComposing()),d=(()=>{const g=s===null||s.editor===n,h=c.has("history-push");if(!h&&g&&c.has("history-merge"))return Vn;if(o===null)return si;const m=i._selection;return l.size>0||a.size>0?h===!1&&f!==Ce&&f===r&&u<t+e&&g||l.size===1&&function(_,v,x){const y=v._nodeMap.get(_),b=x._nodeMap.get(_),C=v._selection,T=x._selection;return!(k(C)&&k(T)&&C.anchor.type==="element"&&C.focus.type==="element"&&T.anchor.type==="text"&&T.focus.type==="text"||!I(y)||!I(b)||y.__parent!==b.__parent)&&JSON.stringify(v.read(()=>y.exportJSON()))===JSON.stringify(x.read(()=>b.exportJSON()))}(Array.from(l)[0],o,i)?Vn:si:m!==null?Vn:li})();return t=u,r=f,d}}function hs(n){n.undoStack=[],n.redoStack=[],n.current=null}function Aa(n,e,t){const r=ja(n,t);return vt(n.registerCommand(cn,()=>(function(i,s){const l=s.redoStack,a=s.undoStack;if(a.length!==0){const c=s.current,u=a.pop();c!==null&&(l.push(c),i.dispatchCommand(Lt,!0)),a.length===0&&i.dispatchCommand(Ot,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),U),n.registerCommand(un,()=>(function(i,s){const l=s.redoStack,a=s.undoStack;if(l.length!==0){const c=s.current;c!==null&&(a.push(c),i.dispatchCommand(Ot,!0));const u=l.pop();l.length===0&&i.dispatchCommand(Lt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),U),n.registerCommand(tl,()=>(hs(e),!1),U),n.registerCommand(nl,()=>(hs(e),n.dispatchCommand(Lt,!1),n.dispatchCommand(Ot,!1),!0),U),n.registerUpdateListener(({editorState:i,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,f=e.redoStack,d=e.undoStack,g=u===null?null:u.editorState;if(u!==null&&i===g)return;const h=r(s,i,u,l,a,c);if(h===si)f.length!==0&&(e.redoStack=[],n.dispatchCommand(Lt,!1)),u!==null&&(d.push({...u}),n.dispatchCommand(Ot,!0));else if(h===li)return;e.current={editor:n,editorState:i}}))}function Pa(){return{current:null,redoStack:[],undoStack:[]}}function Ra({delay:n,externalHistoryState:e}){const[t]=tt();return function(r,o,i=1e3){const s=P.useMemo(()=>o||Pa(),[o]);P.useEffect(()=>Aa(r,s,i),[i,r,s])}(t,e,n),null}const za=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function Fa(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function Wa(){return function(n){const[e]=tt(),t=P.useMemo(()=>n(e),[e,n]),r=P.useRef(t.initialValueFn()),[o,i]=P.useState(r.current);return za(()=>{const{initialValueFn:s,subscribe:l}=t,a=s();return r.current!==a&&(r.current=a,i(a)),l(c=>{r.current=c,i(c)})},[t,n]),o}(Fa)}function Ba(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const o=n.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}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,f,d,g,h]=a;n.update(()=>{const m=A();if(k(m)){const _=m.anchor;let v=_.getNode(),x=0,y=0;if(I(v)&&c>=0&&u>=0&&(x=c,y=c+u,m.setTextNodeRange(v,x,v,y)),x===y&&f===""||(m.insertRawText(f),v=_.getNode()),I(v)){x=d,y=d+g;const b=v.getTextContentSize();x=x>b?b:x,y=y>b?b:y,m.setTextNodeRange(v,x,v,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function $a(n,e){const t=e.body?e.body.childNodes:[];let r=[];const o=[];for(let i=0;i<t.length;i++){const s=t[i];if(!ms.has(s.nodeName)){const l=_s(s,n,o,!1);l!==null&&(r=r.concat(l))}}return function(i){for(const s of i)s.getNextSibling()instanceof ni&&s.insertAfter(et());for(const s of i){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(o),r}function Ua(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=G().getChildren();for(let o=0;o<r.length;o++)ps(n,r[o],t,e);return t.innerHTML}function ps(n,e,t,r=null){let o=r===null||e.isSelected(r);const i=S(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let g=Dr(e);g=I(g)&&r!==null?ls(r,g):g,s=g}const l=S(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:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let g=0;g<l.length;g++){const h=l[g],m=ps(n,h,d,r);!o&&S(e)&&m&&e.extractWithChild(h,r,"html")&&(o=!0)}if(o&&!i){if(kr(u)&&u.append(d),t.append(u),f){const g=f.call(s,u);g&&u.replaceWith(g)}}else t.append(d);return o}const ms=new Set(["STYLE","SCRIPT"]);function _s(n,e,t,r,o=new Map,i){let s=[];if(ms.has(n.nodeName))return s;let l=null;const a=function(h,m){const{nodeName:_}=h,v=m._htmlConversions.get(_.toLowerCase());let x=null;if(v!==void 0)for(const y of v){const b=y(h);b!==null&&(x===null||(x.priority||0)<(b.priority||0))&&(x=b)}return x!==null?x.conversion:null}(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const h=c.node;if(l=Array.isArray(h)?h[h.length-1]:h,l!==null){for(const[,m]of o)if(l=m(l,i),!l)break;l&&s.push(...Array.isArray(h)?h:[l])}c.forChild!=null&&o.set(n.nodeName,c.forChild)}const f=n.childNodes;let d=[];const g=(l==null||!gt(l))&&(l!=null&&Hr(l)||r);for(let h=0;h<f.length;h++)d.push(..._s(f[h],e,t,g,new Map(o),l));return u!=null&&(d=u(d)),En(n)&&(d=Ya(n,d,g?()=>{const h=new ni;return t.push(h),h}:Ne)),l==null?d.length>0?s=s.concat(d):En(n)&&function(h){return h.nextSibling==null||h.previousSibling==null?!1:Mr(h.nextSibling)&&Mr(h.previousSibling)}(n)&&(s=s.concat(et())):S(l)&&l.append(...d),s}function Ya(n,e,t){const r=n.style.textAlign,o=[];let i=[];for(let s=0;s<e.length;s++){const l=e[s];if(Hr(l))r&&!l.getFormat()&&l.setFormat(r),o.push(l);else if(i.push(l),s===e.length-1||s<e.length-1&&Hr(e[s+1])){const a=t();a.setFormat(r),a.append(...i),o.push(a),i=[]}}return o}function Ka(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Zn=Ka(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 Va=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ys=n=>Va?(n||window).getSelection():null;function Za(n,e=A()){return e==null&&Zn(166),k(e)&&e.isCollapsed()||e.getNodes().length===0?"":Ua(n,e)}function Ja(n,e=A()){return e==null&&Zn(166),k(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Qa(n,e))}function xs(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 vs(t,Ha(s.nodes),e)}catch{}const o=n.getData("text/html");if(o)try{const s=new DOMParser().parseFromString(o,"text/html");return vs(t,$a(t,s),e)}catch{}const i=n.getData("text/plain")||n.getData("text/uri-list");if(i!=null)if(k(e)){const s=i.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=A();if(k(a)){const c=s[l];c===`
40
40
  `||c===`\r
41
- `?a.insertParagraph():c===" "?a.insertNodes([Vt()]):a.insertText(c)}}}else e.insertRawText(o)}function gs(n,e,t){n.dispatchCommand(Ws,{nodes:e,selection:t})||t.insertNodes(e)}function hs(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=Mr(t);c=j(c)&&e!==null?es(e,c):c,s=c}const l=C(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Un(58,f.name),C(c)){const d=u.children;Array.isArray(d)||Un(59,f.name)}return u}(s);if(j(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],f=hs(n,e,u,a.children);!i&&C(t)&&f&&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 Ua(n,e){const t=[],r=G().getChildren();for(let i=0;i<r.length;i++)hs(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function $a(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=Vl(r);j(i)&&da(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=ds(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,f=>(tt(f,ClipboardEvent)&&(u(),mt!==null&&(window.clearTimeout(mt),mt=null),a(_s(n,f,t))),!0),ql);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=ds(n._window);if(!i)return!1;const o=i.anchorNode,s=i.focusNode;if(o!==null&&s!==null&&!jt(n,o,s))return!1;const l=O();if(l===null)return!1;t=Ka(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Qa(r,t),!0)}const Ya=[["text/html",Wa],["application/x-lexical-editor",Ba]];function Ka(n=O()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Ml();for(const[r,i]of Ya){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function Qa(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,Va=yt&&"documentMode"in document?document.documentMode:null,Ja=!(!yt||!("InputEvent"in window)||Va)&&"getTargetRanges"in new window.InputEvent("input"),Za=yt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),qa=yt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ga=yt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ha=yt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ga,ys=Fs();function $n(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 xs(n){const e=O();if(!k(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 Yn(n){const e=qe(n);return Y(e)}function Xa(n){return _t(n.registerCommand(_i,e=>{const t=O();return!!ve(t)&&(t.clear(),!0)},0),n.registerCommand(Ve,e=>{const t=O();return!!k(t)&&(t.deleteCharacter(e),!0)},$),n.registerCommand(bt,e=>{const t=O();return!!k(t)&&(t.deleteWord(e),!0)},$),n.registerCommand(wt,e=>{const t=O();return!!k(t)&&(t.deleteLine(e),!0)},$),n.registerCommand(st,e=>{const t=O();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)fs(r,t,n);else if(k(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},$),n.registerCommand(Hn,()=>{const e=O();return!!k(e)&&(e.removeText(),!0)},$),n.registerCommand(de,e=>{const t=O();return!!k(t)&&(t.formatText(e),!0)},$),n.registerCommand(Mt,e=>{const t=O();if(!k(t)&&!ve(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},$),n.registerCommand(ot,e=>{const t=O();return!!k(t)&&(t.insertLineBreak(e),!0)},$),n.registerCommand(rn,()=>{const e=O();return!!k(e)&&(e.insertParagraph(),!0)},$),n.registerCommand(Qs,()=>(Yl([Vt()]),!0),$),n.registerCommand(Vs,()=>xs(e=>{const t=e.getIndent();e.setIndent(t+1)}),$),n.registerCommand(Ni,()=>xs(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),$),n.registerCommand(xi,e=>{const t=O();if(ve(t)&&!Yn(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(k(t)){const r=Pt(t.focus,!0);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},$),n.registerCommand(vi,e=>{const t=O();if(ve(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(k(t)){if(function(i){const o=i.focus;return o.key==="root"&&o.offset===G().getChildrenSize()}(t))return e.preventDefault(),!0;const r=Pt(t.focus,!1);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},$),n.registerCommand(yi,e=>{const t=O();if(ve(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!k(t))return!1;if(ts(t,!0)){const r=e.shiftKey;return e.preventDefault(),ns(t,r,!0),!0}return!1},$),n.registerCommand(mi,e=>{const t=O();if(ve(t)&&!Yn(e.target)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!k(t))return!1;const r=e.shiftKey;return!!ts(t,!1)&&(e.preventDefault(),ns(t,r,!1),!0)},$),n.registerCommand(Ci,e=>{if(Yn(e.target))return!1;const t=O();if(!k(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(Ni,void 0):n.dispatchCommand(Ve,!0)},$),n.registerCommand(Ti,e=>{if(Yn(e.target))return!1;const t=O();return!!k(t)&&(e.preventDefault(),n.dispatchCommand(Ve,!1))},$),n.registerCommand(ln,e=>{const t=O();if(!k(t))return!1;if(e!==null){if((qa||Za||Ha)&&Ja)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ot,!1)}return n.dispatchCommand(rn,void 0)},$),n.registerCommand(Si,()=>{const e=O();return!!k(e)&&(n.blur(),!0)},$),n.registerCommand(bi,e=>{const[,t]=$n(e);if(t.length>0){const i=ms(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,l=qe(s);if(l!==null){const a=Ul();if(j(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const u=l.getParentOrThrow().getKey(),f=l.getIndexWithinParent()+1;a.anchor.set(u,f,"element"),a.focus.set(u,f,"element")}const c=Fi(a);Se(c)}n.dispatchCommand(ys,t)}return e.preventDefault(),!0}const r=O();return!!k(r)},$),n.registerCommand(wi,e=>{const[t]=$n(e),r=O();return!(t&&!k(r))},$),n.registerCommand(Mi,e=>{const[t]=$n(e),r=O();if(t&&!k(r))return!1;const i=ms(e.clientX,e.clientY);if(i!==null){const o=qe(i.node);Y(o)&&e.preventDefault()}return!0},$),n.registerCommand(er,()=>(Nl(),!0),$),n.registerCommand(an,e=>(ps(n,tt(e,ClipboardEvent)?e:null),!0),$),n.registerCommand(Xn,e=>(async function(t,r){await ps(r,tt(t,ClipboardEvent)?t:null),r.update(()=>{const i=O();k(i)?i.removeText():ve(i)&&i.getNodes().forEach(o=>o.remove())})}(e,n),!0),$),n.registerCommand(Gn,e=>{const[,t,r]=$n(e);return t.length>0&&!r?(n.dispatchCommand(ys,t),!0):gr(e.target)?!1:O()!==null&&(function(i,o){i.preventDefault(),o.update(()=>{const s=O(),l=tt(i,InputEvent)||tt(i,KeyboardEvent)?null:i.clipboardData;l!=null&&s!==null&&fs(l,s,o)},{tag:"paste"})}(e,n),!0)},$))}const ri=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function vs(n){return n.getEditorState().read(Xo(n.isComposing()))}function ec({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=et(),i=function(o,s){const[l,a]=P.useState(()=>o.getDecorators());return ri(()=>o.registerDecoratorListener(c=>{di.flushSync(()=>{a(c)})}),[o]),P.useEffect(()=>{a(o.getDecorators())},[o]),P.useMemo(()=>{const c=[],u=Object.keys(l);for(let f=0;f<u.length;f++){const d=u[f],g=A.jsx(s,{onError:m=>o._onError(m),children:A.jsx(P.Suspense,{fallback:null,children:l[d]})}),h=o.getElementByKey(d);h!==null&&c.push(di.createPortal(g,h,d))}return c},[s,l,o])}(r,t);return function(o){ri(()=>_t(Xa(o),Oa(o)),[o])}(r),A.jsxs(A.Fragment,{children:[n,A.jsx(tc,{content:e}),i]})}function tc({content:n}){const[e]=et(),t=function(i){const[o,s]=P.useState(()=>vs(i));return ri(()=>{function l(){const a=vs(i);s(a)}return l(),_t(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o}(e),r=Da();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,f=new Array(u),d=0;d<u;d++)f[d]=arguments[d];o.props.onReset==null||(c=o.props).onReset.apply(c,f),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,f=this.state.error,d=this.props.resetKeys;f!==null&&s.error!==null&&((c=o.resetKeys)===void 0&&(c=[]),(u=d)===void 0&&(u=[]),c.length!==u.length||c.some(function(g,h){return!Object.is(g,u[h])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,d),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(Vn.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return Vn.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(Vn.Component);function rc({children:n,onError:e}){return A.jsx(nc,{fallback:A.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"}},oc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiBpbWFnZS1yZW5kZXJpbmc9Im9wdGltaXplUXVhbGl0eSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCA1MTIgNDI2Ljg1Ij48cGF0aCBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik0xNzQuMiAxMjUuMyAyNjYuNzQgMGg3Ni42NUwyMTIuODggMTczLjk5bDEzNS45IDE4MC40NUgyNzJsLTk3Ljg0LTEzMS44LTk3LjUyIDEzMS44SDBMMTM1Ljg4IDE3NCA1LjA3IDBoNzcuMDRsOTIuMDkgMTI1LjN6bTMyMi4zOCAzMDEuNTVIMzczLjV2LTI0LjE0bDIuNDMtNi40M2M1LjQ1LTYuMyA2MC4zNC02OS40OCA2MC4zNC02OS42MyAyLjk0LTMuMzggNS40NC02LjM0IDcuNDctOC44NyAyLjI1LTIuNzggNC4zNS01LjUxIDYuMy04LjE3IDEuOTUtMi42NSAzLjY0LTUuMSA1LjA4LTcuMzEgMS40OC0yLjI5IDIuNzctNC40MyAzLjg0LTYuMzkuOTgtMS44MSAxLjg5LTMuNjYgMi42OS01LjUzLjc0LTEuNzMgMS4zNC0zLjQgMS44LTQuOTYuNC0xLjM4LjcyLTIuODMuOTUtNC4zMi4yLTEuMzIuMzEtMi42My4zMS0zLjkxIDAtNC43OS0uNTktOC44Ni0xLjc3LTEyLjIyLTEuMDUtMy0yLjYxLTUuNTUtNC42Ni03LjYzLS45LS44OS0xLjk3LTEuNzMtMy4yMS0yLjQ5di0uMDVjLTEuMjUtLjc3LTIuNjQtMS40Mi00LjEzLTEuOTQtMS43Ny0uNTgtMy43NC0xLjA0LTUuOTItMS4zNi0yLjIyLS4zMy00LjcyLS40OS03LjUtLjQ5LTIuOTcgMC01LjYyLjE5LTcuOTIuNTYtMi4yNy4zNy00LjM3LjkyLTYuMjkgMS42NC0xLjc0LjY2LTMuMzcgMS40OS00Ljg0IDIuNDZoLS4wNGMtMS4zNy45LTIuNjcgMi4wMS0zLjkxIDMuMzFhMjkuMzI4IDI5LjMyOCAwIDAgMC0zLjQ1IDQuNTMgMjguMTQ1IDI4LjE0NSAwIDAgMC0yLjQ3IDUuMWMtLjY3IDEuODktMS4xOSAzLjk1LTEuNTUgNi4xNi0uMzQgMi4xNS0uNTIgNC42Mi0uNTIgNy4zOXYxNS40MmgtMzIuNDRsLTIuNDktOC4zOWMtMS42LTUuNDMtMi4wMi0xMC45Ny0xLjU5LTE2LjM5LjQ2LTUuODEgMS45My0xMS41OSAzLjk0LTE2Ljk4IDEuNS00LjAzIDMuNDMtNy45MiA1Ljc4LTExLjY3di0uMDRjMi4zMS0zLjY4IDUtNy4xNSA4LjA1LTEwLjQgMy4xNi0zLjM4IDYuNjItNi4zNyAxMC4zNi04LjkzIDMuNjctMi41MSA3LjY4LTQuNjQgMTIuMDMtNi4zN2E2Ny4yNiA2Ny4yNiAwIDAgMSAxMy4xNy0zLjczdi0uMDVjNC41Mi0uOCA5LjI1LTEuMjEgMTQuMTgtMS4yMSA0LjM4IDAgOC43NS4zNCAxMy4wNyAxLjAzIDQuMzMuNjkgOC40IDEuNzEgMTIuMTkgMy4wNSAzLjkgMS4zOCA3LjY1IDMuMTggMTEuMjQgNS4zNmguMDVjMy41MSAyLjEzIDYuNzggNC42MyA5Ljc5IDcuNDYgMy4xIDIuOSA1Ljg1IDYuMTQgOC4yMiA5LjY5IDIuNCAzLjU4IDQuMzYgNy4zNyA1Ljg4IDExLjM0IDEuNDYgMy44NiAyLjU4IDguMDIgMy4zMyAxMi40NS43MiA0LjMzIDEuMDkgOC44IDEuMDkgMTMuMzkgMCAzLjExLS4yOCA2LjM5LS44NCA5LjgzLS41MiAzLjIyLTEuMzEgNi41LTIuMzUgOS44LS45NCAzLjA4LTIuMjEgNi4yOC0zLjc0IDkuNTVhOTIuNjQ0IDkyLjY0NCAwIDAgMS01LjEyIDkuNDNsLS4wNS4wOWMtMS45NyAzLjEzLTMuOTEgNi4wOS01LjgyIDguODQtMi4wMiAyLjktNC4yNiA1Ljk4LTYuNyA5LjItMi4xNSAyLjgzLTQuNzEgNi4wOC03LjY3IDkuNzMtMi43NyAzLjQyLTUuNjMgNi44NS04LjU3IDEwLjI2bC0zMC4zMSAzNS40Mkg1MTJ2MzcuNTFoLTE1LjQyeiIvPjwvc3ZnPg==",sc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiBpbWFnZS1yZW5kZXJpbmc9Im9wdGltaXplUXVhbGl0eSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCA1MDQgNTEyLjM2Ij48cGF0aCBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik00OTkuNDMgMjMxLjM2SDM2OC40Yy0yLjUzIDAtNC41OC0yLjA1LTQuNTgtNC41N3YtOC4xMWMwLTEuMjYuNTItMi40IDEuMzQtMy4yMmw3MS41Ny04Mi41M2M2LjczLTcuNzUgMTIuNTctMTQuOTcgMTcuNDgtMjEuNjggNC44OC02LjY0IDguODMtMTIuNzQgMTEuODUtMTguMjggMi45Ny01LjQzIDUuMTgtMTAuNjEgNi42NC0xNS41NSAxLjQyLTQuODUgMi4xMy05LjUzIDIuMTMtMTQgMC0xNC42OC0zLjk4LTI2LjA1LTExLjkyLTM0LjA5LTMuOTItMy45Ni04Ljc1LTYuOTMtMTQuNDktOC45Mi01Ljk1LTIuMDMtMTIuOTEtMy4wNS0yMC44Ny0zLjA1LTguNDUgMC0xNS44OCAxLjIxLTIyLjI5IDMuNjItNi4yNyAyLjM2LTExLjYzIDUuOTItMTYuMDcgMTAuNjNhNDcuODg0IDQ3Ljg4NCAwIDAgMC0xMC4xNCAxNi42Yy0yLjI3IDYuMjktMy40MSAxMy4zOS0zLjQxIDIxLjI2IDAgMi41Mi0yLjA1IDQuNTctNC41NyA0LjU3aC02Ljg5Yy0yLjA1IDAtMy44LTEuMzYtNC4zNy0zLjI0bC0uMjctLjgyYy0uMTgtLjU2LS4yNS0xLjEzLS4yMi0xLjY3LS4yMy05LjMyIDEuMTQtMTcuOTkgNC4xMi0yNS45NyAzLjAyLTguMTMgNy42OC0xNS41NCAxMy45NC0yMi4xOSA2LjI2LTYuNyAxMy42My0xMS43NiAyMi4xLTE1LjEzQzQwNy44NCAxLjY4IDQxNy4yIDAgNDI3LjU1IDBjOS41OSAwIDE4LjI2IDEuMzggMjYuMDMgNC4xMyA3Ljg2IDIuNzkgMTQuNzcgNyAyMC43MiAxMi42MSA2LjAyIDUuNjMgMTAuNTUgMTIuNCAxMy41NSAyMC4yOCAyLjk2IDcuNzUgNC40NSAxNi41NiA0LjQ1IDI2LjQgMCA2LjUtMS4wNyAxMy4wOC0zLjE3IDE5LjY5bC0uMTQuMzhjLTIuMDkgNi40Ni01LjE3IDEyLjk3LTkuMiAxOS40OWwtLjE0LjIxYy00LjA4IDYuNTEtOC45IDEzLjQzLTE0LjQzIDIwLjc0LTUuNTYgNy4zMy0xMS45NiAxNS4yMy0xOS4yMiAyMy42N2wtNTYuOTEgNjYuNTFoMTEwLjM0YzIuNTIgMCA0LjU3IDIuMDUgNC41NyA0LjU3djguMTFjMCAyLjUyLTIuMDUgNC41Ny00LjU3IDQuNTd6bS0zMjcuMjUgNjguNzUgMTM3Ljk2LTE2Ny43NmMuODktMS4wNyAyLjMtMS42NSAzLjc0LTEuNjVsMjAuMTMtLjAyYzIuNTIgMCA0LjU3IDEuNzQgNC41NyAzLjg4IDAgLjkxLS4zNyAxLjc1LS45OCAyLjQxTDE4OC4zMiAzMTcuNjYgMzQ0LjEgNTA2LjI0YzEuNDUgMS43NS45NSA0LjE3LTEuMSA1LjQtLjguNDgtMS43Mi43MS0yLjYzLjcxbC0yMC4xMy4wMWMtMS43IDAtMy4xOC0uNzktMy45Ny0xLjk2bC0xNDQuMS0xNzUuMkwyOC4yMyA1MTAuNjljLS44OCAxLjA3LTIuMyAxLjY0LTMuNzMgMS42NWwtMTkuOTMuMDJjLTIuNTIgMC00LjU3LTEuNzQtNC41Ny0zLjg5IDAtLjkuMzctMS43NC45OC0yLjRsMTU1LjY1LTE4OC40TDYuOSAxMzYuOGMtMS40NS0xLjc1LS45NS00LjE4IDEuMTEtNS40MS43OS0uNDcgMS43MS0uNyAyLjYyLS43bDIwLjQ0LS4wMWMxLjYzIDAgMy4wNi43MiAzLjg3IDEuODFsMTM3LjI0IDE2Ny42MnoiLz48L3N2Zz4=",oi=1;function Ss(){return A.jsx("div",{className:"divider"})}function lc(){const[n]=et(),e=P.useRef(null),[t,r]=P.useState(!1),[i,o]=P.useState(!1),[s,l]=P.useState(!1),[a,c]=P.useState(!1),[u,f]=P.useState(!1),[d,g]=P.useState(!1),[h,m]=P.useState(!1),[_,v]=P.useState(!1),x=P.useCallback(()=>{const y=O();k(y)&&(l(y.hasFormat("bold")),c(y.hasFormat("italic")),f(y.hasFormat("underline")),g(y.hasFormat("strikethrough")),m(y.hasFormat("subscript")),v(y.hasFormat("superscript")))},[]);return P.useEffect(()=>_t(n.registerUpdateListener(({editorState:y})=>{y.read(()=>{x()})}),n.registerCommand(nn,(y,b)=>(x(),!1),oi),n.registerCommand(kt,y=>(r(y),!1),oi),n.registerCommand(Et,y=>(o(y),!1),oi)),[n,x]),A.jsxs("div",{className:"toolbar",ref:e,children:[A.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(on,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:A.jsx("i",{className:"format undo"})}),A.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(sn,void 0)},className:"toolbar-item","aria-label":"Redo",children:A.jsx("i",{className:"format redo"})}),A.jsx(Ss,{}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"bold")},className:"toolbar-item spaced "+(s?"active":""),"aria-label":"Format Bold",children:A.jsx("i",{className:"format bold"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"italic")},className:"toolbar-item spaced "+(a?"active":""),"aria-label":"Format Italics",children:A.jsx("i",{className:"format italic"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"underline")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Underline",children:A.jsx("i",{className:"format underline"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"strikethrough")},className:"toolbar-item spaced "+(d?"active":""),"aria-label":"Format Strikethrough",children:A.jsx("i",{className:"format strikethrough"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"superscript")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format Subscript",children:A.jsx("img",{src:sc,height:16,width:16,style:{marginTop:"1px"}})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(de,"subscript")},className:"toolbar-item spaced "+(_?"active":""),"aria-label":"Format Superscript",children:A.jsx("img",{src:oc,height:16,width:16,style:{marginTop:"5px"}})}),A.jsx(Ss,{}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:A.jsx("i",{className:"format left-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:A.jsx("i",{className:"format center-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:A.jsx("i",{className:"format right-align"})}),A.jsx("button",{onClick:()=>{n.dispatchCommand(Mt,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:A.jsx("i",{className:"format justify-align"})})," "]})}function ac(){return A.jsx("div",{className:"editor-placeholder",style:{padding:"20px"},children:"Enter some rich text..."})}const cc={namespace:"React.js Demo",nodes:[],onError(n){throw n},theme:ic};function uc(){return A.jsx(na,{initialConfig:cc,children:A.jsxs("div",{className:"editor-container",children:[A.jsx(lc,{}),A.jsxs("div",{className:"editor-inner",children:[A.jsx(ec,{contentEditable:A.jsx(va,{className:"editor-input"}),placeholder:A.jsx(ac,{}),ErrorBoundary:rc}),A.jsx(La,{}),A.jsx(ra,{})]})]})})}Pe.Editor=uc,Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"})});
41
+ `?a.insertParagraph():c===" "?a.insertNodes([Gt()]):a.insertText(c)}}}else e.insertRawText(i)}function vs(n,e,t){n.dispatchCommand(Vs,{nodes:e,selection:t})||t.insertNodes(e)}function Cs(n,e,t,r=[]){let o=e===null||t.isSelected(e);const i=S(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=Dr(t);c=I(c)&&e!==null?ls(e,c):c,s=c}const l=S(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Zn(58,f.name),S(c)){const d=u.children;Array.isArray(d)||Zn(59,f.name)}return u}(s);if(I(s)){const c=s.__text;c.length>0?a.text=c:o=!1}for(let c=0;c<l.length;c++){const u=l[c],f=Cs(n,e,u,a.children);!o&&S(t)&&f&&t.extractWithChild(u,e,"clone")&&(o=!0)}if(o&&!i)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 o}function Qa(n,e){const t=[],r=G().getChildren();for(let o=0;o<r.length;o++)Cs(n,e,r[o],t);return{namespace:n._config.namespace,nodes:t}}function Ha(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],o=ql(r);I(o)&&pa(o),e.push(o)}return e}let Ct=null;async function bs(n,e,t){if(Ct!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(Ss(n,e,t))})});const r=n.getRootElement(),o=n._window==null?window.document:n._window.document,i=ys(n._window);if(r===null||i===null)return!1;const s=o.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(o.createTextNode("#")),r.append(s);const l=new Range;return l.setStart(s,0),l.setEnd(s,1),i.removeAllRanges(),i.addRange(l),new Promise((a,c)=>{const u=n.registerCommand(fn,f=>(nt(f,ClipboardEvent)&&(u(),Ct!==null&&(window.clearTimeout(Ct),Ct=null),a(Ss(n,f,t))),!0),na);Ct=window.setTimeout(()=>{u(),Ct=null,a(!1)},50),o.execCommand("copy"),s.remove()})}function Ss(n,e,t){if(t===void 0){const o=ys(n._window);if(!o)return!1;const i=o.anchorNode,s=o.focusNode;if(i!==null&&s!==null&&!At(n,i,s))return!1;const l=A();if(l===null)return!1;t=Xa(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(qa(r,t),!0)}const Ga=[["text/html",Za],["application/x-lexical-editor",Ja]];function Xa(n=A()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Ol();for(const[r,o]of Ga){const i=o(t,n);i!==null&&(e[r]=i)}}return e}function qa(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function Ts(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 bt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ec=bt&&"documentMode"in document?document.documentMode:null,tc=!(!bt||!("InputEvent"in window)||ec)&&"getTargetRanges"in new window.InputEvent("input"),nc=bt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),rc=bt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ic=bt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),oc=bt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!ic,ws=Ks();function Jn(n){let e=null;if(nt(n,DragEvent)?e=n.dataTransfer:nt(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 Ns(n){const e=A();if(!k(e))return!1;const t=new Set,r=e.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(t.has(s))continue;const l=oi(i,c=>S(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 Qn(n){const e=Ge(n);return Y(e)}function sc(n){return vt(n.registerCommand(bi,e=>{const t=A();return!!ve(t)&&(t.clear(),!0)},0),n.registerCommand(Je,e=>{const t=A();return!!k(t)&&(t.deleteCharacter(e),!0)},U),n.registerCommand(Mt,e=>{const t=A();return!!k(t)&&(t.deleteWord(e),!0)},U),n.registerCommand(It,e=>{const t=A();return!!k(t)&&(t.deleteLine(e),!0)},U),n.registerCommand(ut,e=>{const t=A();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)xs(r,t,n);else if(k(t)){const o=e.data;return o&&t.insertText(o),!0}}return!0},U),n.registerCommand(nr,()=>{const e=A();return!!k(e)&&(e.removeText(),!0)},U),n.registerCommand(de,e=>{const t=A();return!!k(t)&&(t.formatText(e),!0)},U),n.registerCommand(Dt,e=>{const t=A();if(!k(t)&&!ve(t))return!1;const r=t.getNodes();for(const o of r){const i=oi(o,s=>S(s)&&!s.isInline());i!==null&&i.setFormat(e)}return!0},U),n.registerCommand(ct,e=>{const t=A();return!!k(t)&&(t.insertLineBreak(e),!0)},U),n.registerCommand(an,()=>{const e=A();return!!k(e)&&(e.insertParagraph(),!0)},U),n.registerCommand(Xs,()=>(Hl([Gt()]),!0),U),n.registerCommand(qs,()=>Ns(e=>{const t=e.getIndent();e.setIndent(t+1)}),U),n.registerCommand(Ii,()=>Ns(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),U),n.registerCommand(wi,e=>{const t=A();if(ve(t)&&!Qn(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(k(t)){const r=Wt(t.focus,!0);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},U),n.registerCommand(Ni,e=>{const t=A();if(ve(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(k(t)){if(function(o){const i=o.focus;return i.key==="root"&&i.offset===G().getChildrenSize()}(t))return e.preventDefault(),!0;const r=Wt(t.focus,!1);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},U),n.registerCommand(Ti,e=>{const t=A();if(ve(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!k(t))return!1;if(as(t,!0)){const r=e.shiftKey;return e.preventDefault(),cs(t,r,!0),!0}return!1},U),n.registerCommand(Si,e=>{const t=A();if(ve(t)&&!Qn(e.target)){const o=t.getNodes();if(o.length>0)return e.preventDefault(),o[0].selectNext(0,0),!0}if(!k(t))return!1;const r=e.shiftKey;return!!as(t,!1)&&(e.preventDefault(),cs(t,r,!1),!0)},U),n.registerCommand(Ei,e=>{if(Qn(e.target))return!1;const t=A();if(!k(t))return!1;e.preventDefault();const{anchor:r}=t,o=r.getNode();return t.isCollapsed()&&r.offset===0&&!oe(o)&&Ta(o).getIndent()>0?n.dispatchCommand(Ii,void 0):n.dispatchCommand(Je,!0)},U),n.registerCommand(Mi,e=>{if(Qn(e.target))return!1;const t=A();return!!k(t)&&(e.preventDefault(),n.dispatchCommand(Je,!1))},U),n.registerCommand(dn,e=>{const t=A();if(!k(t))return!1;if(e!==null){if((rc||nc||oc)&&tc)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ct,!1)}return n.dispatchCommand(an,void 0)},U),n.registerCommand(ki,()=>{const e=A();return!!k(e)&&(n.blur(),!0)},U),n.registerCommand(Di,e=>{const[,t]=Jn(e);if(t.length>0){const o=Ts(e.clientX,e.clientY);if(o!==null){const{offset:i,node:s}=o,l=Ge(s);if(l!==null){const a=Jl();if(I(l))a.anchor.set(l.getKey(),i,"text"),a.focus.set(l.getKey(),i,"text");else{const u=l.getParentOrThrow().getKey(),f=l.getIndexWithinParent()+1;a.anchor.set(u,f,"element"),a.focus.set(u,f,"element")}const c=Ki(a);be(c)}n.dispatchCommand(ws,t)}return e.preventDefault(),!0}const r=A();return!!k(r)},U),n.registerCommand(Li,e=>{const[t]=Jn(e),r=A();return!(t&&!k(r))},U),n.registerCommand(Oi,e=>{const[t]=Jn(e),r=A();if(t&&!k(r))return!1;const o=Ts(e.clientX,e.clientY);if(o!==null){const i=Ge(o.node);Y(i)&&e.preventDefault()}return!0},U),n.registerCommand(ir,()=>(Il(),!0),U),n.registerCommand(fn,e=>(bs(n,nt(e,ClipboardEvent)?e:null),!0),U),n.registerCommand(rr,e=>(async function(t,r){await bs(r,nt(t,ClipboardEvent)?t:null),r.update(()=>{const o=A();k(o)?o.removeText():ve(o)&&o.getNodes().forEach(i=>i.remove())})}(e,n),!0),U),n.registerCommand(tr,e=>{const[,t,r]=Jn(e);return t.length>0&&!r?(n.dispatchCommand(ws,t),!0):_r(e.target)?!1:A()!==null&&(function(o,i){o.preventDefault(),i.update(()=>{const s=A(),l=nt(o,InputEvent)||nt(o,KeyboardEvent)?null:o.clipboardData;l!=null&&s!==null&&xs(l,s,i)},{tag:"paste"})}(e,n),!0)},U))}const ai=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?P.useLayoutEffect:P.useEffect;function Es(n){return n.getEditorState().read(os(n.isComposing()))}function lc({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=tt(),o=function(i,s){const[l,a]=P.useState(()=>i.getDecorators());return ai(()=>i.registerDecoratorListener(c=>{_i.flushSync(()=>{a(c)})}),[i]),P.useEffect(()=>{a(i.getDecorators())},[i]),P.useMemo(()=>{const c=[],u=Object.keys(l);for(let f=0;f<u.length;f++){const d=u[f],g=j.jsx(s,{onError:m=>i._onError(m),children:j.jsx(P.Suspense,{fallback:null,children:l[d]})}),h=i.getElementByKey(d);h!==null&&c.push(_i.createPortal(g,h,d))}return c},[s,l,i])}(r,t);return function(i){ai(()=>vt(sc(i),Ba(i)),[i])}(r),j.jsxs(j.Fragment,{children:[n,j.jsx(ac,{content:e}),o]})}function ac({content:n}){const[e]=tt(),t=function(o){const[i,s]=P.useState(()=>Es(o));return ai(()=>{function l(){const a=Es(o);s(a)}return l(),vt(o.registerUpdateListener(()=>{l()}),o.registerEditableListener(()=>{l()}))},[o]),i}(e),r=Wa();return t?typeof n=="function"?n(r):n:null}function ci(n,e){return ci=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},ci(n,e)}var ks={error:null},cc=function(n){var e,t;function r(){for(var i,s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return(i=n.call.apply(n,[this].concat(l))||this).state=ks,i.resetErrorBoundary=function(){for(var c,u=arguments.length,f=new Array(u),d=0;d<u;d++)f[d]=arguments[d];i.props.onReset==null||(c=i.props).onReset.apply(c,f),i.reset()},i}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,ci(e,t),r.getDerivedStateFromError=function(i){return{error:i}};var o=r.prototype;return o.reset=function(){this.setState(ks)},o.componentDidCatch=function(i,s){var l,a;(l=(a=this.props).onError)==null||l.call(a,i,s)},o.componentDidUpdate=function(i,s){var l,a,c,u,f=this.state.error,d=this.props.resetKeys;f!==null&&s.error!==null&&((c=i.resetKeys)===void 0&&(c=[]),(u=d)===void 0&&(u=[]),c.length!==u.length||c.some(function(g,h){return!Object.is(g,u[h])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,i.resetKeys,d),this.reset())},o.render=function(){var i=this.state.error,s=this.props,l=s.fallbackRender,a=s.FallbackComponent,c=s.fallback;if(i!==null){var u={error:i,resetErrorBoundary:this.resetErrorBoundary};if(lt.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return lt.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(lt.Component);function uc({children:n,onError:e}){return j.jsx(cc,{fallback:j.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}const dc={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"}},fc="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDE1IDE1IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMDAwMDEgOC4zMzMzM0wxLjkwMDAxIDEzLjhMMS4xMDAwMSAxMy4yTDUuMzc1MDEgNy41TDEuMTAwMDEgMS44TDEuOTAwMDEgMS4yTDYuMDAwMDEgNi42NjY2N0wxMC4xIDEuMkwxMC45IDEuOEw2LjYyNTAxIDcuNUwxMC45IDEzLjJMMTAuMSAxMy44TDYuMDAwMDEgOC4zMzMzM1pNMTIgMTIuNUMxMiAxMS42NzE2IDEyLjY3MTYgMTEgMTMuNSAxMUgxMy43OTI5QzE0LjQ1OTYgMTEgMTUgMTEuNTQwNCAxNSAxMi4yMDcxQzE1IDEyLjUyNzMgMTQuODcyOCAxMi44MzQzIDE0LjY0NjUgMTMuMDYwN0wxMy43MDcxIDE0SDE1VjE1SDEyLjVDMTIuMjk3OCAxNSAxMi4xMTU1IDE0Ljg3ODIgMTIuMDM4MSAxNC42OTEzQzExLjk2MDcgMTQuNTA0NSAxMi4wMDM1IDE0LjI4OTQgMTIuMTQ2NSAxNC4xNDY0TDEzLjkzOTMgMTIuMzUzNkMxMy45NzgyIDEyLjMxNDcgMTQgMTIuMjYyIDE0IDEyLjIwNzFDMTQgMTIuMDkyNyAxMy45MDczIDEyIDEzLjc5MjkgMTJIMTMuNUMxMy4yMjM5IDEyIDEzIDEyLjIyMzkgMTMgMTIuNUgxMloiIGZpbGw9IiMwMDAwMDAiLz4KPC9zdmc+",gc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiBpbWFnZS1yZW5kZXJpbmc9Im9wdGltaXplUXVhbGl0eSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCA1MDQgNTEyLjM2Ij48cGF0aCBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik00OTkuNDMgMjMxLjM2SDM2OC40Yy0yLjUzIDAtNC41OC0yLjA1LTQuNTgtNC41N3YtOC4xMWMwLTEuMjYuNTItMi40IDEuMzQtMy4yMmw3MS41Ny04Mi41M2M2LjczLTcuNzUgMTIuNTctMTQuOTcgMTcuNDgtMjEuNjggNC44OC02LjY0IDguODMtMTIuNzQgMTEuODUtMTguMjggMi45Ny01LjQzIDUuMTgtMTAuNjEgNi42NC0xNS41NSAxLjQyLTQuODUgMi4xMy05LjUzIDIuMTMtMTQgMC0xNC42OC0zLjk4LTI2LjA1LTExLjkyLTM0LjA5LTMuOTItMy45Ni04Ljc1LTYuOTMtMTQuNDktOC45Mi01Ljk1LTIuMDMtMTIuOTEtMy4wNS0yMC44Ny0zLjA1LTguNDUgMC0xNS44OCAxLjIxLTIyLjI5IDMuNjItNi4yNyAyLjM2LTExLjYzIDUuOTItMTYuMDcgMTAuNjNhNDcuODg0IDQ3Ljg4NCAwIDAgMC0xMC4xNCAxNi42Yy0yLjI3IDYuMjktMy40MSAxMy4zOS0zLjQxIDIxLjI2IDAgMi41Mi0yLjA1IDQuNTctNC41NyA0LjU3aC02Ljg5Yy0yLjA1IDAtMy44LTEuMzYtNC4zNy0zLjI0bC0uMjctLjgyYy0uMTgtLjU2LS4yNS0xLjEzLS4yMi0xLjY3LS4yMy05LjMyIDEuMTQtMTcuOTkgNC4xMi0yNS45NyAzLjAyLTguMTMgNy42OC0xNS41NCAxMy45NC0yMi4xOSA2LjI2LTYuNyAxMy42My0xMS43NiAyMi4xLTE1LjEzQzQwNy44NCAxLjY4IDQxNy4yIDAgNDI3LjU1IDBjOS41OSAwIDE4LjI2IDEuMzggMjYuMDMgNC4xMyA3Ljg2IDIuNzkgMTQuNzcgNyAyMC43MiAxMi42MSA2LjAyIDUuNjMgMTAuNTUgMTIuNCAxMy41NSAyMC4yOCAyLjk2IDcuNzUgNC40NSAxNi41NiA0LjQ1IDI2LjQgMCA2LjUtMS4wNyAxMy4wOC0zLjE3IDE5LjY5bC0uMTQuMzhjLTIuMDkgNi40Ni01LjE3IDEyLjk3LTkuMiAxOS40OWwtLjE0LjIxYy00LjA4IDYuNTEtOC45IDEzLjQzLTE0LjQzIDIwLjc0LTUuNTYgNy4zMy0xMS45NiAxNS4yMy0xOS4yMiAyMy42N2wtNTYuOTEgNjYuNTFoMTEwLjM0YzIuNTIgMCA0LjU3IDIuMDUgNC41NyA0LjU3djguMTFjMCAyLjUyLTIuMDUgNC41Ny00LjU3IDQuNTd6bS0zMjcuMjUgNjguNzUgMTM3Ljk2LTE2Ny43NmMuODktMS4wNyAyLjMtMS42NSAzLjc0LTEuNjVsMjAuMTMtLjAyYzIuNTIgMCA0LjU3IDEuNzQgNC41NyAzLjg4IDAgLjkxLS4zNyAxLjc1LS45OCAyLjQxTDE4OC4zMiAzMTcuNjYgMzQ0LjEgNTA2LjI0YzEuNDUgMS43NS45NSA0LjE3LTEuMSA1LjQtLjguNDgtMS43Mi43MS0yLjYzLjcxbC0yMC4xMy4wMWMtMS43IDAtMy4xOC0uNzktMy45Ny0xLjk2bC0xNDQuMS0xNzUuMkwyOC4yMyA1MTAuNjljLS44OCAxLjA3LTIuMyAxLjY0LTMuNzMgMS42NWwtMTkuOTMuMDJjLTIuNTIgMC00LjU3LTEuNzQtNC41Ny0zLjg5IDAtLjkuMzctMS43NC45OC0yLjRsMTU1LjY1LTE4OC40TDYuOSAxMzYuOGMtMS40NS0xLjc1LS45NS00LjE4IDEuMTEtNS40MS43OS0uNDcgMS43MS0uNyAyLjYyLS43bDIwLjQ0LS4wMWMxLjYzIDAgMy4wNi43MiAzLjg3IDEuODFsMTM3LjI0IDE2Ny42MnoiLz48L3N2Zz4=",hc="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik00IDEySDIwTTEyIDRWMjAiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4NCjwvc3ZnPg==",pc="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik02IDEyTDE4IDEyIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+DQo8L3N2Zz4=",rt=8,it=60,mc=11;function _c({selectionFontSize:n,editor:e}){const[t,r]=lt.useState(n),o=(a,c)=>{if(!c)return a;let u=a;switch(c){case 2:switch(!0){case a>it:u=it;break;case a>=50:u-=12;break;case a>=24:u-=4;break;case a>=14:u-=2;break;case a>=9:u-=1;break;default:u=rt;break}break;case 1:switch(!0){case a<rt:u=rt;break;case a<12:u+=1;break;case a<20:u+=2;break;case a<36:u+=4;break;case a<=50:u+=12;break;default:u=it;break}break}return u},i=lt.useCallback((a,c)=>{const u=f=>(f||(f=`${mc}px`),f=f.slice(0,-2),`${o(Number(f),c)}px`);e.update(()=>{if(e.isEditable()){const f=A();f!==null&&ma(f,{"font-size":a||u})}})},[e]),s=a=>{const c=Number(t);if(["e","E","+","-"].includes(a.key)||isNaN(c)){a.preventDefault(),r("");return}if(a.key==="Enter"){a.preventDefault();let u=c;c>it?u=it:c<rt&&(u=rt),r(String(u)),i(String(u)+"px",null)}},l=a=>{if(t!==""){const c=o(Number(t),a);i(String(c)+"px",null)}else i(null,a)};return lt.useEffect(()=>{r(n)},[n]),j.jsxs(j.Fragment,{children:[j.jsx("button",{type:"button",disabled:n!==""&&Number(t)<=rt,onClick:()=>l(2),className:"toolbar-item font-decrement",children:j.jsx("img",{src:pc,height:16,width:16,style:{marginTop:"5px"}})}),j.jsx("input",{type:"number",value:t,className:"font-size-input",min:rt,max:it,onChange:a=>r(a.target.value),onKeyDown:s}),j.jsx("button",{type:"button",disabled:n!==""&&Number(t)>=it,onClick:()=>l(1),className:"toolbar-item font-increment",children:j.jsx("img",{src:hc,height:16,width:16,style:{marginTop:"5px"}})})]})}const ui=1;function di(){return j.jsx("div",{className:"divider"})}function yc(){const[n]=tt(),e=P.useRef(null),[t,r]=P.useState(!1),[o,i]=P.useState(!1),[s,l]=P.useState(!1),[a,c]=P.useState(!1),[u,f]=P.useState(!1),[d,g]=P.useState(!1),[h,m]=P.useState(!1),[_,v]=P.useState(!1),[x,y]=P.useState("11px"),b=P.useCallback(()=>{const C=A();k(C)&&(l(C.hasFormat("bold")),c(C.hasFormat("italic")),f(C.hasFormat("underline")),g(C.hasFormat("strikethrough")),m(C.hasFormat("subscript")),v(C.hasFormat("superscript")),y(va(C,"font-size","11px")))},[]);return P.useEffect(()=>vt(n.registerUpdateListener(({editorState:C})=>{C.read(()=>{b()})}),n.registerCommand(ln,(C,T)=>(b(),!1),ui),n.registerCommand(Ot,C=>(r(C),!1),ui),n.registerCommand(Lt,C=>(i(C),!1),ui)),[n,b]),j.jsxs("div",{className:"toolbar",ref:e,children:[j.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(cn,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:j.jsx("i",{className:"format undo"})}),j.jsx("button",{disabled:!o,onClick:()=>{n.dispatchCommand(un,void 0)},className:"toolbar-item","aria-label":"Redo",children:j.jsx("i",{className:"format redo"})}),j.jsx(di,{}),j.jsx(_c,{selectionFontSize:x.slice(0,-2),editor:n}),j.jsx(di,{}),j.jsx("button",{onClick:()=>{n.dispatchCommand(de,"bold")},className:"toolbar-item spaced "+(s?"active":""),"aria-label":"Format Bold",children:j.jsx("i",{className:"format bold"})}),j.jsx("button",{onClick:()=>{n.dispatchCommand(de,"italic")},className:"toolbar-item spaced "+(a?"active":""),"aria-label":"Format Italics",children:j.jsx("i",{className:"format italic"})}),j.jsx("button",{onClick:()=>{n.dispatchCommand(de,"underline")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Underline",children:j.jsx("i",{className:"format underline"})}),j.jsx("button",{onClick:()=>{n.dispatchCommand(de,"strikethrough")},className:"toolbar-item spaced "+(d?"active":""),"aria-label":"Format Strikethrough",children:j.jsx("i",{className:"format strikethrough"})}),j.jsx("button",{onClick:()=>{n.dispatchCommand(de,"superscript")},className:"toolbar-item spaced "+(_?"active":""),"aria-label":"Format SuperScript",children:j.jsx("img",{src:gc,height:16,width:16,style:{marginTop:"1px"}})}),j.jsx("button",{onClick:()=>{n.dispatchCommand(de,"subscript")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format Subscript",children:j.jsx("img",{src:fc,height:16,width:16,style:{marginTop:"5px"}})}),j.jsx(di,{}),j.jsx("button",{onClick:()=>{n.dispatchCommand(Dt,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:j.jsx("i",{className:"format left-align"})}),j.jsx("button",{onClick:()=>{n.dispatchCommand(Dt,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:j.jsx("i",{className:"format center-align"})}),j.jsx("button",{onClick:()=>{n.dispatchCommand(Dt,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:j.jsx("i",{className:"format right-align"})}),j.jsx("button",{onClick:()=>{n.dispatchCommand(Dt,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:j.jsx("i",{className:"format justify-align"})})," "]})}function xc(){return j.jsx("div",{className:"editor-placeholder",children:"Enter some rich text..."})}const vc={namespace:"React.js Demo",nodes:[],onError(n){throw n},theme:dc};function Cc(){return j.jsx(aa,{initialConfig:vc,children:j.jsxs("div",{className:"editor-container",children:[j.jsx(yc,{}),j.jsxs("div",{className:"editor-inner",children:[j.jsx(lc,{contentEditable:j.jsx(Ea,{className:"editor-input"}),placeholder:j.jsx(xc,{}),ErrorBoundary:uc}),j.jsx(Ra,{}),j.jsx(ca,{})]})]})})}Re.Editor=Cc,Object.defineProperty(Re,Symbol.toStringTag,{value:"Module"})});
42
42
  //# sourceMappingURL=index.umd.js.map