UNPKG

@banx9x/react-editor

Version:

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

34 lines (31 loc) 704 kB
(function($,fn){typeof exports=="object"&&typeof module<"u"?module.exports=fn(require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["react","react-dom"],fn):($=typeof globalThis<"u"?globalThis:$||self,$.ReactQuestEditor=fn($.React,$.ReactDOM))})(this,function($,fn){"use strict";function uf(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const C=uf($),Li=uf(fn);var k0={exports:{}},Fi={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var df;function B2(){if(df)return Fi;df=1;var r=$,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,c){var u,d={},f=null,m=null;c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),l.ref!==void 0&&(m=l.ref);for(u in l)n.call(l,u)&&!i.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:e,type:a,key:f,ref:m,props:d,_owner:s.current}}return Fi.Fragment=t,Fi.jsx=o,Fi.jsxs=o,Fi}var Bi={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ff;function j2(){return ff||(ff=1,process.env.NODE_ENV!=="production"&&function(){var r=$,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),p=Symbol.iterator,v="@@iterator";function y(z){if(z===null||typeof z!="object")return null;var X=p&&z[p]||z[v];return typeof X=="function"?X:null}var _=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(z){{for(var X=arguments.length,me=new Array(X>1?X-1:0),Ne=1;Ne<X;Ne++)me[Ne-1]=arguments[Ne];k("error",z,me)}}function k(z,X,me){{var Ne=_.ReactDebugCurrentFrame,Ye=Ne.getStackAddendum();Ye!==""&&(X+="%s",me=me.concat([Ye]));var it=me.map(function(We){return String(We)});it.unshift("Warning: "+X),Function.prototype.apply.call(console[z],console,it)}}var T=!1,E=!1,D=!1,O=!1,L=!1,R;R=Symbol.for("react.module.reference");function H(z){return!!(typeof z=="string"||typeof z=="function"||z===n||z===i||L||z===s||z===c||z===u||O||z===m||T||E||D||typeof z=="object"&&z!==null&&(z.$$typeof===f||z.$$typeof===d||z.$$typeof===o||z.$$typeof===a||z.$$typeof===l||z.$$typeof===R||z.getModuleId!==void 0))}function ne(z,X,me){var Ne=z.displayName;if(Ne)return Ne;var Ye=X.displayName||X.name||"";return Ye!==""?me+"("+Ye+")":me}function I(z){return z.displayName||"Context"}function V(z){if(z==null)return null;if(typeof z.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof z=="function")return z.displayName||z.name||null;if(typeof z=="string")return z;switch(z){case n:return"Fragment";case t:return"Portal";case i:return"Profiler";case s:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof z=="object")switch(z.$$typeof){case a:var X=z;return I(X)+".Consumer";case o:var me=z;return I(me._context)+".Provider";case l:return ne(z,z.render,"ForwardRef");case d:var Ne=z.displayName||null;return Ne!==null?Ne:V(z.type)||"Memo";case f:{var Ye=z,it=Ye._payload,We=Ye._init;try{return V(We(it))}catch{return null}}}return null}var j=Object.assign,U=0,Z,G,ae,le,ke,Fe,ze;function ut(){}ut.__reactDisabledLog=!0;function Xe(){{if(U===0){Z=console.log,G=console.info,ae=console.warn,le=console.error,ke=console.group,Fe=console.groupCollapsed,ze=console.groupEnd;var z={configurable:!0,enumerable:!0,value:ut,writable:!0};Object.defineProperties(console,{info:z,log:z,warn:z,error:z,group:z,groupCollapsed:z,groupEnd:z})}U++}}function Qe(){{if(U--,U===0){var z={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},z,{value:Z}),info:j({},z,{value:G}),warn:j({},z,{value:ae}),error:j({},z,{value:le}),group:j({},z,{value:ke}),groupCollapsed:j({},z,{value:Fe}),groupEnd:j({},z,{value:ze})})}U<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ge=_.ReactCurrentDispatcher,ye;function Ae(z,X,me){{if(ye===void 0)try{throw Error()}catch(Ye){var Ne=Ye.stack.trim().match(/\n( *(at )?)/);ye=Ne&&Ne[1]||""}return` `+ye+z}}var He=!1,Pe;{var Ue=typeof WeakMap=="function"?WeakMap:Map;Pe=new Ue}function Je(z,X){if(!z||He)return"";{var me=Pe.get(z);if(me!==void 0)return me}var Ne;He=!0;var Ye=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var it;it=Ge.current,Ge.current=null,Xe();try{if(X){var We=function(){throw Error()};if(Object.defineProperty(We.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(We,[])}catch(cr){Ne=cr}Reflect.construct(z,[],We)}else{try{We.call()}catch(cr){Ne=cr}z.call(We.prototype)}}else{try{throw Error()}catch(cr){Ne=cr}z()}}catch(cr){if(cr&&Ne&&typeof cr.stack=="string"){for(var Be=cr.stack.split(` `),er=Ne.stack.split(` `),kt=Be.length-1,Et=er.length-1;kt>=1&&Et>=0&&Be[kt]!==er[Et];)Et--;for(;kt>=1&&Et>=0;kt--,Et--)if(Be[kt]!==er[Et]){if(kt!==1||Et!==1)do if(kt--,Et--,Et<0||Be[kt]!==er[Et]){var Ar=` `+Be[kt].replace(" at new "," at ");return z.displayName&&Ar.includes("<anonymous>")&&(Ar=Ar.replace("<anonymous>",z.displayName)),typeof z=="function"&&Pe.set(z,Ar),Ar}while(kt>=1&&Et>=0);break}}}finally{He=!1,Ge.current=it,Qe(),Error.prepareStackTrace=Ye}var Ii=z?z.displayName||z.name:"",$s=Ii?Ae(Ii):"";return typeof z=="function"&&Pe.set(z,$s),$s}function St(z,X,me){return Je(z,!1)}function It(z){var X=z.prototype;return!!(X&&X.isReactComponent)}function lr(z,X,me){if(z==null)return"";if(typeof z=="function")return Je(z,It(z));if(typeof z=="string")return Ae(z);switch(z){case c:return Ae("Suspense");case u:return Ae("SuspenseList")}if(typeof z=="object")switch(z.$$typeof){case l:return St(z.render);case d:return lr(z.type,X,me);case f:{var Ne=z,Ye=Ne._payload,it=Ne._init;try{return lr(it(Ye),X,me)}catch{}}}return""}var Me=Object.prototype.hasOwnProperty,Lt={},M=_.ReactDebugCurrentFrame;function F(z){if(z){var X=z._owner,me=lr(z.type,z._source,X?X.type:null);M.setExtraStackFrame(me)}else M.setExtraStackFrame(null)}function W(z,X,me,Ne,Ye){{var it=Function.call.bind(Me);for(var We in z)if(it(z,We)){var Be=void 0;try{if(typeof z[We]!="function"){var er=Error((Ne||"React class")+": "+me+" type `"+We+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof z[We]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw er.name="Invariant Violation",er}Be=z[We](X,We,Ne,me,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(kt){Be=kt}Be&&!(Be instanceof Error)&&(F(Ye),x("%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).",Ne||"React class",me,We,typeof Be),F(null)),Be instanceof Error&&!(Be.message in Lt)&&(Lt[Be.message]=!0,F(Ye),x("Failed %s type: %s",me,Be.message),F(null))}}}var ue=Array.isArray;function se(z){return ue(z)}function re(z){{var X=typeof Symbol=="function"&&Symbol.toStringTag,me=X&&z[Symbol.toStringTag]||z.constructor.name||"Object";return me}}function be(z){try{return Oe(z),!1}catch{return!0}}function Oe(z){return""+z}function et(z){if(be(z))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",re(z)),Oe(z)}var Dt=_.ReactCurrentOwner,ys={key:!0,ref:!0,__self:!0,__source:!0},w0,Pi,js;js={};function nf(z){if(Me.call(z,"ref")){var X=Object.getOwnPropertyDescriptor(z,"ref").get;if(X&&X.isReactWarning)return!1}return z.ref!==void 0}function _0(z){if(Me.call(z,"key")){var X=Object.getOwnPropertyDescriptor(z,"key").get;if(X&&X.isReactWarning)return!1}return z.key!==void 0}function sf(z,X){if(typeof z.ref=="string"&&Dt.current&&X&&Dt.current.stateNode!==X){var me=V(Dt.current.type);js[me]||(x('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',V(Dt.current.type),z.ref),js[me]=!0)}}function S0(z,X){{var me=function(){w0||(w0=!0,x("%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)",X))};me.isReactWarning=!0,Object.defineProperty(z,"key",{get:me,configurable:!0})}}function jS(z,X){{var me=function(){Pi||(Pi=!0,x("%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)",X))};me.isReactWarning=!0,Object.defineProperty(z,"ref",{get:me,configurable:!0})}}var $S=function(z,X,me,Ne,Ye,it,We){var Be={$$typeof:e,type:z,key:X,ref:me,props:We,_owner:it};return Be._store={},Object.defineProperty(Be._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Be,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ne}),Object.defineProperty(Be,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ye}),Object.freeze&&(Object.freeze(Be.props),Object.freeze(Be)),Be};function VS(z,X,me,Ne,Ye){{var it,We={},Be=null,er=null;me!==void 0&&(et(me),Be=""+me),_0(X)&&(et(X.key),Be=""+X.key),nf(X)&&(er=X.ref,sf(X,Ye));for(it in X)Me.call(X,it)&&!ys.hasOwnProperty(it)&&(We[it]=X[it]);if(z&&z.defaultProps){var kt=z.defaultProps;for(it in kt)We[it]===void 0&&(We[it]=kt[it])}if(Be||er){var Et=typeof z=="function"?z.displayName||z.name||"Unknown":z;Be&&S0(We,Et),er&&jS(We,Et)}return $S(z,Be,er,Ye,Ne,Dt.current,We)}}var of=_.ReactCurrentOwner,N2=_.ReactDebugCurrentFrame;function Ri(z){if(z){var X=z._owner,me=lr(z.type,z._source,X?X.type:null);N2.setExtraStackFrame(me)}else N2.setExtraStackFrame(null)}var af;af=!1;function lf(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function M2(){{if(of.current){var z=V(of.current.type);if(z)return` Check the render method of \``+z+"`."}return""}}function HS(z){return""}var z2={};function WS(z){{var X=M2();if(!X){var me=typeof z=="string"?z:z.displayName||z.name;me&&(X=` Check the top-level render call using <`+me+">.")}return X}}function O2(z,X){{if(!z._store||z._store.validated||z.key!=null)return;z._store.validated=!0;var me=WS(X);if(z2[me])return;z2[me]=!0;var Ne="";z&&z._owner&&z._owner!==of.current&&(Ne=" It was passed a child from "+V(z._owner.type)+"."),Ri(z),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',me,Ne),Ri(null)}}function D2(z,X){{if(typeof z!="object")return;if(se(z))for(var me=0;me<z.length;me++){var Ne=z[me];lf(Ne)&&O2(Ne,X)}else if(lf(z))z._store&&(z._store.validated=!0);else if(z){var Ye=y(z);if(typeof Ye=="function"&&Ye!==z.entries)for(var it=Ye.call(z),We;!(We=it.next()).done;)lf(We.value)&&O2(We.value,X)}}}function qS(z){{var X=z.type;if(X==null||typeof X=="string")return;var me;if(typeof X=="function")me=X.propTypes;else if(typeof X=="object"&&(X.$$typeof===l||X.$$typeof===d))me=X.propTypes;else return;if(me){var Ne=V(X);W(me,z.props,"prop",Ne,z)}else if(X.PropTypes!==void 0&&!af){af=!0;var Ye=V(X);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ye||"Unknown")}typeof X.getDefaultProps=="function"&&!X.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function US(z){{for(var X=Object.keys(z.props),me=0;me<X.length;me++){var Ne=X[me];if(Ne!=="children"&&Ne!=="key"){Ri(z),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ne),Ri(null);break}}z.ref!==null&&(Ri(z),x("Invalid attribute `ref` supplied to `React.Fragment`."),Ri(null))}}var P2={};function R2(z,X,me,Ne,Ye,it){{var We=H(z);if(!We){var Be="";(z===void 0||typeof z=="object"&&z!==null&&Object.keys(z).length===0)&&(Be+=" 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 er=HS();er?Be+=er:Be+=M2();var kt;z===null?kt="null":se(z)?kt="array":z!==void 0&&z.$$typeof===e?(kt="<"+(V(z.type)||"Unknown")+" />",Be=" Did you accidentally export a JSX literal instead of a component?"):kt=typeof z,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",kt,Be)}var Et=VS(z,X,me,Ye,it);if(Et==null)return Et;if(We){var Ar=X.children;if(Ar!==void 0)if(Ne)if(se(Ar)){for(var Ii=0;Ii<Ar.length;Ii++)D2(Ar[Ii],z);Object.freeze&&Object.freeze(Ar)}else x("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 D2(Ar,z)}if(Me.call(X,"key")){var $s=V(z),cr=Object.keys(X).filter(function(JS){return JS!=="key"}),cf=cr.length>0?"{key: someKey, "+cr.join(": ..., ")+": ...}":"{key: someKey}";if(!P2[$s+cf]){var XS=cr.length>0?"{"+cr.join(": ..., ")+": ...}":"{}";x(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,cf,$s,XS,$s),P2[$s+cf]=!0}}return z===n?US(Et):qS(Et),Et}}function ZS(z,X,me){return R2(z,X,me,!0)}function GS(z,X,me){return R2(z,X,me,!1)}var KS=GS,YS=ZS;Bi.Fragment=n,Bi.jsx=KS,Bi.jsxs=YS}()),Bi}process.env.NODE_ENV==="production"?k0.exports=B2():k0.exports=j2();var b=k0.exports;function Vs(r){return{}}const ia={},$2={},C0={},bs={},Hs={},ji={},Ws={},T0={},E0={},$i={},Vi={},Ut={},oa={},aa={},V2={},hf={},H2={},mf={},W2={},pf={},gf={},Hi={},q2={},A0={},vf={},N0={},yf={},bf={},M0={},z0={},xf={},Wi={},wf={},_f={},U2={},la={},O0={},D0={},Z2={},G2={},qi={},Ui={},K2={},Y2={},X2={};function J2(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var he=J2(function(r){const e=new URLSearchParams;e.append("code",r);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${r}; 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 Nr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Q2=Nr&&"documentMode"in document?document.documentMode:null,Mr=Nr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),jn=Nr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ca=!(!Nr||!("InputEvent"in window)||Q2)&&"getTargetRanges"in new window.InputEvent("input"),P0=Nr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ua=Nr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ev=Nr&&/Android/.test(navigator.userAgent),Sf=Nr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),tv=Nr&&ev&&Sf,R0=Nr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Sf,Zi=1,$n=3,xs=0,kf=1,qs=2,rv=0,nv=1,sv=2,da=4,fa=8,iv=240|(3|da|fa),I0=1,L0=2,F0=3,B0=4,j0=5,$0=6,ha=P0||ua||R0?" ":"​",hn=` `,ov=jn?" ":ha,Cf="֑-߿יִ-﷽ﹰ-ﻼ",Tf="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",av=new RegExp("^[^"+Tf+"]*["+Cf+"]"),lv=new RegExp("^[^"+Cf+"]*["+Tf+"]"),mn={bold:1,code:16,highlight:128,italic:2,strikethrough:da,subscript:32,superscript:64,underline:fa},cv={directionless:1,unmergeable:2},Ef={center:L0,end:$0,justify:B0,left:I0,right:F0,start:j0},uv={[L0]:"center",[$0]:"end",[B0]:"justify",[I0]:"left",[F0]:"right",[j0]:"start"},dv={normal:0,segmented:2,token:1},fv={[rv]:"normal",[sv]:"segmented",[nv]:"token"};function ma(...r){const e=[];for(const t of r)if(t&&typeof t=="string")for(const[n]of t.matchAll(/\S+/g))e.push(n);return e}const hv=100;let V0=!1,H0=0;function mv(r){H0=r.timeStamp}function W0(r,e,t){return e.__lexicalLineBreak===r||r[`__lexicalKey_${t._key}`]!==void 0}function pv(r,e,t){const n=Wr(t._window);let s=null,i=null;n!==null&&n.anchorNode===r&&(s=n.anchorOffset,i=n.focusOffset);const o=r.nodeValue;o!==null&&Y0(e,o,s,i,!1)}function gv(r,e,t){if(Q(r)){const n=r.anchor.getNode();if(n.is(t)&&r.format!==n.getFormat())return!1}return e.nodeType===$n&&t.isAttached()}function Af(r,e,t){V0=!0;const n=performance.now()-H0>hv;try{ur(r,()=>{const s=de()||function(f){return f.getEditorState().read(()=>{const m=de();return m!==null?m.clone():null})}(r),i=new Map,o=r.getRootElement(),a=r._editorState,l=r._blockCursorElement;let c=!1,u="";for(let f=0;f<e.length;f++){const m=e[f],p=m.type,v=m.target;let y=pn(v,a);if(!(y===null&&v!==o||tt(y))){if(p==="characterData")n&&J(y)&&gv(s,v,y)&&pv(v,y,r);else if(p==="childList"){c=!0;const _=m.addedNodes;for(let T=0;T<_.length;T++){const E=_[T],D=Lf(E),O=E.parentNode;if(O!=null&&E!==l&&D===null&&(E.nodeName!=="BR"||!W0(E,O,r))){if(jn){const L=E.innerText||E.nodeValue;L&&(u+=L)}O.removeChild(E)}}const x=m.removedNodes,k=x.length;if(k>0){let T=0;for(let E=0;E<k;E++){const D=x[E];(D.nodeName==="BR"&&W0(D,v,r)||l===D)&&(v.appendChild(D),T++)}k!==T&&(v===o&&(y=jf(a)),i.set(v,y))}}}}if(i.size>0)for(const[f,m]of i)if(q(m)){const p=m.getChildrenKeys();let v=f.firstChild;for(let y=0;y<p.length;y++){const _=p[y],x=r.getElementByKey(_);x!==null&&(v==null?(f.appendChild(x),v=x):v!==x&&f.replaceChild(x,v),v=v.nextSibling)}}else J(m)&&m.markDirty();const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const m=d[f],p=m.addedNodes,v=m.target;for(let y=0;y<p.length;y++){const _=p[y],x=_.parentNode;x==null||_.nodeName!=="BR"||W0(_,v,r)||x.removeChild(_)}}t.takeRecords()}s!==null&&(c&&(s.dirty=!0,xr(s)),jn&&Yf(r)&&s.insertRawText(u))})}finally{V0=!1}}function Nf(r){const e=r._observer;e!==null&&Af(r,e.takeRecords(),e)}function Mf(r){(function(e){H0===0&&xa(e).addEventListener("textInput",mv,!0)})(r),r._observer=new MutationObserver((e,t)=>{Af(r,e,t)})}function zf(r,e){const t=r.__mode,n=r.__format,s=r.__style,i=e.__mode,o=e.__format,a=e.__style;return!(t!==null&&t!==i||n!==null&&n!==o||s!==null&&s!==a)}function Of(r,e){const t=r.mergeWithSibling(e),n=bt()._normalizedNodes;return n.add(r.__key),n.add(e.__key),t}function Df(r){let e,t,n=r;if(n.__text!==""||!n.isSimpleText()||n.isUnmergeable()){for(;(e=n.getPreviousSibling())!==null&&J(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(zf(e,n)){n=Of(e,n);break}break}e.remove()}for(;(t=n.getNextSibling())!==null&&J(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(zf(n,t)){n=Of(n,t);break}break}t.remove()}}else n.remove()}function q0(r){return Pf(r.anchor),Pf(r.focus),r}function Pf(r){for(;r.type==="element";){const e=r.getNode(),t=r.offset;let n,s;if(t===e.getChildrenSize()?(n=e.getChildAtIndex(t-1),s=!0):(n=e.getChildAtIndex(t),s=!1),J(n)){r.set(n.__key,s?n.getTextContentSize():0,"text");break}if(!q(n))break;r.set(n.__key,s?n.getChildrenSize():0,"element")}}let vv=1;const yv=typeof queueMicrotask=="function"?queueMicrotask:r=>{Promise.resolve().then(r)};function U0(r){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return tt(pn(r))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&e.__lexicalEditor==null)}function Gi(r,e,t){const n=r.getRootElement();try{return n!==null&&n.contains(e)&&n.contains(t)&&e!==null&&!U0(e)&&Rf(e)===r}catch{return!1}}function Rf(r){let e=r;for(;e!=null;){const t=e.__lexicalEditor;if(t!=null)return t;e=ba(e)}return null}function Us(r){return r.isToken()||r.isSegmented()}function bv(r){return r.nodeType===$n}function pa(r){let e=r;for(;e!=null;){if(bv(e))return e;e=e.firstChild}return null}function Z0(r,e,t){const n=mn[e];if(t!==null&&(r&n)==(t&n))return r;let s=r^n;return e==="subscript"?s&=~mn.superscript:e==="superscript"&&(s&=~mn.subscript),s}function If(r){return J(r)||qr(r)||tt(r)}function xv(r,e){if(e!=null)return void(r.__key=e);rr(),Ph();const t=bt(),n=bn(),s=""+vv++;n._nodeMap.set(s,r),q(r)?t._dirtyElements.set(s,!0):t._dirtyLeaves.add(s),t._cloneNotNeeded.add(s),t._dirtyType=kf,r.__key=s}function ws(r){const e=r.getParent();if(e!==null){const t=r.getWritable(),n=e.getWritable(),s=r.getPreviousSibling(),i=r.getNextSibling();if(s===null)if(i!==null){const o=i.getWritable();n.__first=i.__key,o.__prev=null}else n.__first=null;else{const o=s.getWritable();if(i!==null){const a=i.getWritable();a.__prev=o.__key,o.__next=a.__key}else o.__next=null;t.__prev=null}if(i===null)if(s!==null){const o=s.getWritable();n.__last=s.__key,o.__next=null}else n.__last=null;else{const o=i.getWritable();if(s!==null){const a=s.getWritable();a.__next=o.__key,o.__prev=a.__key}else o.__prev=null;t.__next=null}n.__size--,t.__parent=null}}function ga(r){Ph();const e=r.getLatest(),t=e.__parent,n=bn(),s=bt(),i=n._nodeMap,o=s._dirtyElements;t!==null&&function(l,c,u){let d=l;for(;d!==null;){if(u.has(d))return;const f=c.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}}(t,i,o);const a=e.__key;s._dirtyType=kf,q(r)?o.set(a,!0):s._dirtyLeaves.add(a)}function Ft(r){rr();const e=bt(),t=e._compositionKey;if(r!==t){if(e._compositionKey=r,t!==null){const n=At(t);n!==null&&n.getWritable()}if(r!==null){const n=At(r);n!==null&&n.getWritable()}}}function Vn(){return co()?null:bt()._compositionKey}function At(r,e){const t=(e||bn())._nodeMap.get(r);return t===void 0?null:t}function Lf(r,e){const t=r[`__lexicalKey_${bt()._key}`];return t!==void 0?At(t,e):null}function pn(r,e){let t=r;for(;t!=null;){const n=Lf(t,e);if(n!==null)return n;t=ba(t)}return null}function Ff(r){const e=r._decorators,t=Object.assign({},e);return r._pendingDecorators=t,t}function Bf(r){return r.read(()=>pt().getTextContent())}function pt(){return jf(bn())}function jf(r){return r._nodeMap.get("root")}function xr(r){rr();const e=bn();r!==null&&(r.dirty=!0,r.setCachedNodes(null)),e._selection=r}function Zs(r){const e=bt(),t=function(n,s){let i=n;for(;i!=null;){const o=i[`__lexicalKey_${s._key}`];if(o!==void 0)return o;i=ba(i)}return null}(r,e);return t===null?r===e.getRootElement()?At("root"):null:At(t)}function $f(r,e){return e?r.getTextContentSize():0}function Vf(r){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(r)}function G0(r){const e=[];let t=r;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Hf(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Wf(r){return r.nodeType===$n?r.nodeValue:null}function K0(r,e,t){const n=Wr(e._window);if(n===null)return;const s=n.anchorNode;let{anchorOffset:i,focusOffset:o}=n;if(s!==null){let a=Wf(s);const l=pn(s);if(a!==null&&J(l)){if(a===ha&&t){const c=t.length;a=t,i=c,o=c}a!==null&&Y0(l,a,i,o,r)}}}function Y0(r,e,t,n,s){let i=r;if(i.isAttached()&&(s||!i.isDirty())){const o=i.isComposing();let a=e;(o||s)&&e[e.length-1]===ha&&(a=e.slice(0,-1));const l=i.getTextContent();if(s||a!==l){if(a===""){if(Ft(null),P0||ua||R0)i.remove();else{const v=bt();setTimeout(()=>{v.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=Js(),d=i.getTextContentSize(),f=Vn(),m=i.getKey();if(i.isToken()||f!==null&&m===f&&!o||Q(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===r.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!o||u.focus.key===r.__key&&u.focus.offset===d&&!i.canInsertTextAfter()&&!o))return void i.markDirty();const p=de();if(!Q(p)||t===null||n===null)return void i.setTextContent(a);if(p.setTextNodeRange(i,t,i,n),i.isSegmented()){const v=yt(i.getTextContent());i.replace(v),i=v}i.setTextContent(a)}}}function wv(r,e){if(e.isSegmented())return!0;if(!r.isCollapsed())return!1;const t=r.anchor.offset,n=e.getParentOrThrow(),s=e.isToken();return t===0?!e.canInsertTextBefore()||!n.canInsertTextBefore()&&!e.isComposing()||s||function(i){const o=i.getPreviousSibling();return(J(o)||q(o)&&o.isInline())&&!o.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!n.canInsertTextAfter()&&!e.isComposing()||s)}function qf(r){return r==="ArrowLeft"}function Uf(r){return r==="ArrowRight"}function Ki(r,e){return Mr?r:e}function Zf(r){return r==="Enter"}function Yi(r){return r==="Backspace"}function Xi(r){return r==="Delete"}function Gf(r,e,t){return r.toLowerCase()==="a"&&Ki(e,t)}function _v(){const r=pt();xr(q0(r.select(0,r.getChildrenSize())))}function Ji(r,e){r.__lexicalClassNameCache===void 0&&(r.__lexicalClassNameCache={});const t=r.__lexicalClassNameCache,n=t[e];if(n!==void 0)return n;const s=r[e];if(typeof s=="string"){const i=ma(s);return t[e]=i,i}return s}function X0(r,e,t,n,s){if(t.size===0)return;const i=n.__type,o=n.__key,a=e.get(i);a===void 0&&he(33,i);const l=a.klass;let c=r.get(l);c===void 0&&(c=new Map,r.set(l,c));const u=c.get(o),d=u==="destroyed"&&s==="created";(u===void 0||d)&&c.set(o,d?"updated":s)}function Kf(r,e,t){const n=r.getParent();let s=t,i=r;return n!==null&&(e&&t===0?(s=i.getIndexWithinParent(),i=n):e||t!==i.getChildrenSize()||(s=i.getIndexWithinParent()+1,i=n)),i.getChildAtIndex(e?s-1:s)}function Qi(r,e){const t=r.offset;if(r.type==="element")return Kf(r.getNode(),e,t);{const n=r.getNode();if(e&&t===0||!e&&t===n.getTextContentSize()){const s=e?n.getPreviousSibling():n.getNextSibling();return s===null?Kf(n.getParentOrThrow(),e,n.getIndexWithinParent()+(e?0:1)):s}}return null}function Yf(r){const e=xa(r).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function pe(r,e,t){return Fh(r,e,t)}function va(r){return!jt(r)&&!r.isLastChild()&&!r.isInline()}function ya(r,e){const t=r._keyToDOMMap.get(e);return t===void 0&&he(75,e),t}function ba(r){const e=r.assignedSlot||r.parentElement;return e!==null&&e.nodeType===11?e.host:e}function J0(r,e){let t=r.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function xa(r){const e=r._window;return e===null&&he(78),e}function Sv(r){let e=r.getParentOrThrow();for(;e!==null;){if(zr(e))return e;e=e.getParentOrThrow()}return e}function zr(r){return jt(r)||q(r)&&r.isShadowRoot()}function $t(r){const e=bt(),t=r.constructor.getType(),n=e._nodes.get(t);n===void 0&&he(97);const s=n.replace;if(s!==null){const i=s(r);return i instanceof r.constructor||he(98),i}return r}function Q0(r,e){!jt(r.getParent())||q(e)||tt(e)||he(99)}function ec(r){return(tt(r)||q(r)&&!r.canBeEmpty())&&!r.isInline()}function tc(r,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const n=r.parentElement;n!==null&&n.removeChild(r)}function kv(r,e,t){let n=r._blockCursorElement;if(Q(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const s=t.anchor,i=s.getNode(),o=s.offset;let a=!1,l=null;if(o===i.getChildrenSize())ec(i.getChildAtIndex(o-1))&&(a=!0);else{const c=i.getChildAtIndex(o);if(ec(c)){const u=c.getPreviousSibling();(u===null||ec(u))&&(a=!0,l=r.getElementByKey(c.__key))}}if(a){const c=r.getElementByKey(i.__key);return n===null&&(r._blockCursorElement=n=function(u){const d=u.theme,f=document.createElement("div");f.contentEditable="false",f.setAttribute("data-lexical-cursor","true");let m=d.blockCursor;if(m!==void 0){if(typeof m=="string"){const p=ma(m);m=d.blockCursor=p}m!==void 0&&f.classList.add(...m)}return f}(r._config)),e.style.caretColor="transparent",void(l===null?c.appendChild(n):c.insertBefore(n,l))}}n!==null&&tc(n,r,e)}function Wr(r){return Nr?(r||window).getSelection():null}function Cv(r){return gn(r)&&r.tagName==="A"}function gn(r){return r.nodeType===1}function Tv(r){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 r.nodeName.match(e)!==null}function Ev(r){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 r.nodeName.match(e)!==null}function Gs(r){if(jt(r)||tt(r)&&!r.isInline())return!0;if(!q(r)||zr(r))return!1;const e=r.getFirstChild(),t=e===null||qr(e)||J(e)||e.isInline();return!r.isInline()&&r.canBeEmpty()!==!1&&t}function rc(r,e){let t=r;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function Xf(r,e,t,n,s,i){let o=r.getFirstChild();for(;o!==null;){const a=o.__key;o.__parent===e&&(q(o)&&Xf(o,a,t,n,s,i),t.has(a)||i.delete(a),s.push(a)),o=o.getNextSibling()}}let Hn,Zt,eo,wa,nc,sc,_s,Or,ic,to,Nt="",Gt="",Dr=null,vn="",Jf=!1,oc=!1,_a=null;function Sa(r,e){const t=_s.get(r);if(e!==null){const n=uc(r);n.parentNode===e&&e.removeChild(n)}if(Or.has(r)||Zt._keyToDOMMap.delete(r),q(t)){const n=Ca(t,_s);ac(n,0,n.length-1,null)}t!==void 0&&X0(to,eo,wa,t,"destroyed")}function ac(r,e,t,n){let s=e;for(;s<=t;++s){const i=r[s];i!==void 0&&Sa(i,n)}}function Ss(r,e){r.setProperty("text-align",e)}const Av="40px";function Qf(r,e){const t=Hn.theme.indent;if(typeof t=="string"){const s=r.classList.contains(t);e>0&&!s?r.classList.add(t):e<1&&s&&r.classList.remove(t)}const n=getComputedStyle(r).getPropertyValue("--lexical-indent-base-value")||Av;r.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${n})`)}function eh(r,e){const t=r.style;e===0?Ss(t,""):e===I0?Ss(t,"left"):e===L0?Ss(t,"center"):e===F0?Ss(t,"right"):e===B0?Ss(t,"justify"):e===j0?Ss(t,"start"):e===$0&&Ss(t,"end")}function ka(r,e,t){const n=Or.get(r);n===void 0&&he(60);const s=n.createDOM(Hn,Zt);if(function(i,o,a){const l=a._keyToDOMMap;o["__lexicalKey_"+a._key]=i,l.set(i,o)}(r,s,Zt),J(n)?s.setAttribute("data-lexical-text","true"):tt(n)&&s.setAttribute("data-lexical-decorator","true"),q(n)){const i=n.__indent,o=n.__size;if(i!==0&&Qf(s,i),o!==0){const l=o-1;(function(c,u,d,f){const m=Gt;Gt="",lc(c,d,0,u,f,null),nh(d,f),Gt=m})(Ca(n,Or),l,n,s)}const a=n.__format;a!==0&&eh(s,a),n.isInline()||rh(null,n,s),va(n)&&(Nt+=hn,vn+=hn)}else{const i=n.getTextContent();if(tt(n)){const o=n.decorate(Zt,Hn);o!==null&&sh(r,o),s.contentEditable="false"}else J(n)&&(n.isDirectionless()||(Gt+=i));Nt+=i,vn+=i}if(e!==null)if(t!=null)e.insertBefore(s,t);else{const i=e.__lexicalLineBreak;i!=null?e.insertBefore(s,i):e.appendChild(s)}return X0(to,eo,wa,n,"created"),s}function lc(r,e,t,n,s,i){const o=Nt;Nt="";let a=t;for(;a<=n;++a){ka(r[a],s,i);const l=Or.get(r[a]);l!==null&&Dr===null&&J(l)&&(Dr=l.getFormat())}va(e)&&(Nt+=hn),s.__lexicalTextContent=Nt,Nt=o+Nt}function th(r,e){const t=e.get(r);return qr(t)||tt(t)&&t.isInline()}function rh(r,e,t){const n=r!==null&&(r.__size===0||th(r.__last,_s)),s=e.__size===0||th(e.__last,Or);if(n){if(!s){const i=t.__lexicalLineBreak;i!=null&&t.removeChild(i),t.__lexicalLineBreak=null}}else if(s){const i=document.createElement("br");t.__lexicalLineBreak=i,t.appendChild(i)}}function nh(r,e){const t=e.__lexicalDirTextContent,n=e.__lexicalDir;if(t!==Gt||n!==_a){const i=Gt==="",o=i?_a:(s=Gt,av.test(s)?"rtl":lv.test(s)?"ltr":null);if(o!==n){const a=e.classList,l=Hn.theme;let c=n!==null?l[n]:void 0,u=o!==null?l[o]:void 0;if(c!==void 0){if(typeof c=="string"){const d=ma(c);c=l[n]=d}a.remove(...c)}if(o===null||i&&o==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const d=ma(u);u=l[o]=d}u!==void 0&&a.add(...u)}e.dir=o}oc||(r.getWritable().__dir=o)}_a=o,e.__lexicalDirTextContent=Gt,e.__lexicalDir=o}var s}function Nv(r,e,t){const n=Gt;var s;Gt="",Dr=null,function(i,o,a){const l=Nt,c=i.__size,u=o.__size;if(Nt="",c===1&&u===1){const d=i.__first,f=o.__first;if(d===f)ro(d,a);else{const p=uc(d),v=ka(f,null,null);a.replaceChild(v,p),Sa(d,null)}const m=Or.get(f);Dr===null&&J(m)&&(Dr=m.getFormat())}else{const d=Ca(i,_s),f=Ca(o,Or);if(c===0)u!==0&&lc(f,o,0,u-1,a,null);else if(u===0){if(c!==0){const m=a.__lexicalLineBreak==null;ac(d,0,c-1,m?null:a),m&&(a.textContent="")}}else(function(m,p,v,y,_,x){const k=y-1,T=_-1;let E,D,O=(H=x,H.firstChild),L=0,R=0;for(var H;L<=k&&R<=T;){const V=p[L],j=v[R];if(V===j)O=cc(ro(j,x)),L++,R++;else{E===void 0&&(E=new Set(p)),D===void 0&&(D=new Set(v));const Z=D.has(V),G=E.has(j);if(Z)if(G){const ae=ya(Zt,j);ae===O?O=cc(ro(j,x)):(O!=null?x.insertBefore(ae,O):x.appendChild(ae),ro(j,x)),L++,R++}else ka(j,x,O),R++;else O=cc(uc(V)),Sa(V,x),L++}const U=Or.get(j);U!==null&&Dr===null&&J(U)&&(Dr=U.getFormat())}const ne=L>k,I=R>T;if(ne&&!I){const V=v[T+1];lc(v,m,R,T,x,V===void 0?null:Zt.getElementByKey(V))}else I&&!ne&&ac(p,L,k,x)})(o,d,f,c,u,a)}va(o)&&(Nt+=hn),a.__lexicalTextContent=Nt,Nt=l+Nt}(r,e,t),nh(e,t),Zn(s=e)&&Dr!=null&&Dr!==s.__textFormat&&s.setTextFormat(Dr),Gt=n,Dr=null}function Ca(r,e){const t=[];let n=r.__first;for(;n!==null;){const s=e.get(n);s===void 0&&he(101),t.push(n),n=s.__next}return t}function ro(r,e){const t=_s.get(r);let n=Or.get(r);t!==void 0&&n!==void 0||he(61);const s=Jf||sc.has(r)||nc.has(r),i=ya(Zt,r);if(t===n&&!s){if(q(t)){const o=i.__lexicalTextContent;o!==void 0&&(Nt+=o,vn+=o);const a=i.__lexicalDirTextContent;a!==void 0&&(Gt+=a)}else{const o=t.getTextContent();J(t)&&!t.isDirectionless()&&(Gt+=o),vn+=o,Nt+=o}return i}if(t!==n&&s&&X0(to,eo,wa,n,"updated"),n.updateDOM(t,i,Hn)){const o=ka(r,null,null);return e===null&&he(62),e.replaceChild(o,i),Sa(r,null),o}if(q(t)&&q(n)){const o=n.__indent;o!==t.__indent&&Qf(i,o);const a=n.__format;a!==t.__format&&eh(i,a),s&&(Nv(t,n,i),jt(n)||n.isInline()||rh(t,n,i)),va(n)&&(Nt+=hn,vn+=hn)}else{const o=n.getTextContent();if(tt(n)){const a=n.decorate(Zt,Hn);a!==null&&sh(r,a)}else J(n)&&!n.isDirectionless()&&(Gt+=o);Nt+=o,vn+=o}if(!oc&&jt(n)&&n.__cachedText!==vn){const o=n.getWritable();o.__cachedText=vn,n=o}return i}function sh(r,e){let t=Zt._pendingDecorators;const n=Zt._decorators;if(t===null){if(n[r]===e)return;t=Ff(Zt)}t[r]=e}function cc(r){let e=r.nextSibling;return e!==null&&e===Zt._blockCursorElement&&(e=e.nextSibling),e}function Mv(r,e,t,n,s,i){Nt="",vn="",Gt="",Jf=n===qs,_a=null,Zt=t,Hn=t._config,eo=t._nodes,wa=Zt._listeners.mutation,nc=s,sc=i,_s=r._nodeMap,Or=e._nodeMap,oc=e._readOnly,ic=new Map(t._keyToDOMMap);const o=new Map;return to=o,ro("root",null),Zt=void 0,eo=void 0,nc=void 0,sc=void 0,_s=void 0,Or=void 0,Hn=void 0,ic=void 0,to=void 0,o}function uc(r){const e=ic.get(r);return e===void 0&&he(75,r),e}const yn=Object.freeze({}),dc=30,fc=[["keydown",function(r,e){if(no=r.timeStamp,ih=r.key,e.isComposing())return;const{key:t,shiftKey:n,ctrlKey:s,metaKey:i,altKey:o}=r;pe(e,V2,r)||t!=null&&(function(a,l,c,u){return Uf(a)&&!l&&!u&&!c}(t,s,o,i)?pe(e,hf,r):function(a,l,c,u,d){return Uf(a)&&!u&&!c&&(l||d)}(t,s,n,o,i)?pe(e,H2,r):function(a,l,c,u){return qf(a)&&!l&&!u&&!c}(t,s,o,i)?pe(e,mf,r):function(a,l,c,u,d){return qf(a)&&!u&&!c&&(l||d)}(t,s,n,o,i)?pe(e,W2,r):function(a,l,c){return function(u){return u==="ArrowUp"}(a)&&!l&&!c}(t,s,i)?pe(e,pf,r):function(a,l,c){return function(u){return u==="ArrowDown"}(a)&&!l&&!c}(t,s,i)?pe(e,gf,r):function(a,l){return Zf(a)&&l}(t,n)?(so=!0,pe(e,Hi,r)):function(a){return a===" "}(t)?pe(e,q2,r):function(a,l){return Mr&&l&&a.toLowerCase()==="o"}(t,s)?(r.preventDefault(),so=!0,pe(e,Hs,!0)):function(a,l){return Zf(a)&&!l}(t,n)?(so=!1,pe(e,Hi,r)):function(a,l,c,u){return Mr?!l&&!c&&(Yi(a)||a.toLowerCase()==="h"&&u):!(u||l||c)&&Yi(a)}(t,o,i,s)?Yi(t)?pe(e,A0,r):(r.preventDefault(),pe(e,bs,!0)):function(a){return a==="Escape"}(t)?pe(e,vf,r):function(a,l,c,u,d){return Mr?!(c||u||d)&&(Xi(a)||a.toLowerCase()==="d"&&l):!(l||u||d)&&Xi(a)}(t,s,n,o,i)?Xi(t)?pe(e,N0,r):(r.preventDefault(),pe(e,bs,!1)):function(a,l,c){return Yi(a)&&(Mr?l:c)}(t,o,s)?(r.preventDefault(),pe(e,$i,!0)):function(a,l,c){return Xi(a)&&(Mr?l:c)}(t,o,s)?(r.preventDefault(),pe(e,$i,!1)):function(a,l){return Mr&&l&&Yi(a)}(t,i)?(r.preventDefault(),pe(e,Vi,!0)):function(a,l){return Mr&&l&&Xi(a)}(t,i)?(r.preventDefault(),pe(e,Vi,!1)):function(a,l,c,u){return a.toLowerCase()==="b"&&!l&&Ki(c,u)}(t,o,i,s)?(r.preventDefault(),pe(e,Ut,"bold")):function(a,l,c,u){return a.toLowerCase()==="u"&&!l&&Ki(c,u)}(t,o,i,s)?(r.preventDefault(),pe(e,Ut,"underline")):function(a,l,c,u){return a.toLowerCase()==="i"&&!l&&Ki(c,u)}(t,o,i,s)?(r.preventDefault(),pe(e,Ut,"italic")):function(a,l,c,u){return a==="Tab"&&!l&&!c&&!u}(t,o,s,i)?pe(e,yf,r):function(a,l,c,u){return a.toLowerCase()==="z"&&!l&&Ki(c,u)}(t,n,i,s)?(r.preventDefault(),pe(e,oa,void 0)):function(a,l,c,u){return Mr?a.toLowerCase()==="z"&&c&&l:a.toLowerCase()==="y"&&u||a.toLowerCase()==="z"&&u&&l}(t,n,i,s)?(r.preventDefault(),pe(e,aa,void 0)):Bt(e._editorState._selection)?function(a,l,c,u){return!l&&a.toLowerCase()==="c"&&(Mr?c:u)}(t,n,i,s)?(r.preventDefault(),pe(e,la,r)):function(a,l,c,u){return!l&&a.toLowerCase()==="x"&&(Mr?c:u)}(t,n,i,s)?(r.preventDefault(),pe(e,O0,r)):Gf(t,i,s)&&(r.preventDefault(),pe(e,D0,r)):!jn&&Gf(t,i,s)&&(r.preventDefault(),pe(e,D0,r)),function(a,l,c,u){return a||l||c||u}(s,n,o,i)&&pe(e,X2,r))}],["pointerdown",function(r,e){const t=r.target,n=r.pointerType;t instanceof Node&&n!=="touch"&&ur(e,()=>{tt(pn(t))||(mc=!0)})}],["compositionstart",function(r,e){ur(e,()=>{const t=de();if(Q(t)&&!e.isComposing()){const n=t.anchor,s=t.anchor.getNode();Ft(n.key),(r.timeStamp<no+dc||n.type==="element"||!t.isCollapsed()||s.getFormat()!==t.format||J(s)&&s.getStyle()!==t.style)&&pe(e,Ws,ov)}})}],["compositionend",function(r,e){jn?io=!0:ur(e,()=>{pc(e,r.data)})}],["input",function(r,e){r.stopPropagation(),ur(e,()=>{const t=de(),n=r.data,s=dh(r);if(n!=null&&Q(t)&&lh(t,s,n,r.timeStamp,!1)){io&&(pc(e,n),io=!1);const i=t.anchor.getNode(),o=Wr(e._window);if(o===null)return;const a=t.isBackward(),l=a?t.anchor.offset:t.focus.offset,c=a?t.focus.offset:t.anchor.offset;ca&&!t.isCollapsed()&&J(i)&&o.anchorNode!==null&&i.getTextContent().slice(0,l)+n+i.getTextContent().slice(l+c)===Wf(o.anchorNode)||pe(e,Ws,n);const u=n.length;jn&&u>1&&r.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),P0||ua||R0||!e.isComposing()||(no=0,Ft(null))}else K0(!1,e,n!==null?n:void 0),io&&(pc(e,n||void 0),io=!1);rr(),Nf(bt())}),Ks=null}],["click",function(r,e){ur(e,()=>{const t=de(),n=Wr(e._window),s=Js();if(n){if(Q(t)){const i=t.anchor,o=i.getNode();i.type==="element"&&i.offset===0&&t.isCollapsed()&&!jt(o)&&pt().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&s!==null&&t.is(s)?(n.removeAllRanges(),t.dirty=!0):r.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()&&(q(o)?o.select(0):o.getParentOrThrow().select(0))}else if(r.pointerType==="touch"){const i=n.anchorNode;if(i!==null){const o=i.nodeType;(o===Zi||o===$n)&&xr(Sc(s,n,e,r))}}}pe(e,C0,r)})}],["cut",yn],["copy",yn],["dragstart",yn],["dragover",yn],["dragend",yn],["paste",yn],["focus",yn],["blur",yn],["drop",yn]];ca&&fc.push(["beforeinput",(r,e)=>function(t,n){const s=t.inputType,i=dh(t);s==="deleteCompositionText"||jn&&Yf(n)||s!=="insertCompositionText"&&ur(n,()=>{const o=de();if(s==="deleteContentBackward"){if(o===null){const m=Js();if(!Q(m))return;xr(m.clone())}if(Q(o)){const m=o.anchor.key===o.focus.key;if(a=t.timeStamp,ih==="MediaLast"&&a<no+dc&&n.isComposing()&&m){if(Ft(null),no=0,setTimeout(()=>{ur(n,()=>{Ft(null)})},dc),Q(o)){const p=o.anchor.getNode();p.markDirty(),o.format=p.getFormat(),J(p)||he(142),o.style=p.getStyle()}}else{Ft(null),t.preventDefault();const p=o.anchor.getNode().getTextContent(),v=o.anchor.offset===0&&o.focus.offset===p.length;tv&&m&&!v||pe(n,bs,!0)}return}}var a;if(!Q(o))return;const l=t.data;Ks!==null&&K0(!1,n,Ks),o.dirty&&Ks===null||!o.isCollapsed()||jt(o.anchor.getNode())||i===null||o.applyDOMRange(i),Ks=null;const c=o.anchor,u=o.focus,d=c.getNode(),f=u.getNode();if(s!=="insertText"&&s!=="insertTranspose")switch(t.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":pe(n,Ws,t);break;case"insertFromComposition":Ft(null),pe(n,Ws,t);break;case"insertLineBreak":Ft(null),pe(n,Hs,!1);break;case"insertParagraph":Ft(null),so&&!ua?(so=!1,pe(n,Hs,!1)):pe(n,ji,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":pe(n,T0,t);break;case"deleteByComposition":(function(m,p){return m!==p||q(m)||q(p)||!m.isToken()||!p.isToken()})(d,f)&&pe(n,E0,t);break;case"deleteByDrag":case"deleteByCut":pe(n,E0,t);break;case"deleteContent":pe(n,bs,!1);break;case"deleteWordBackward":pe(n,$i,!0);break;case"deleteWordForward":pe(n,$i,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":pe(n,Vi,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":pe(n,Vi,!1);break;case"formatStrikeThrough":pe(n,Ut,"strikethrough");break;case"formatBold":pe(n,Ut,"bold");break;case"formatItalic":pe(n,Ut,"italic");break;case"formatUnderline":pe(n,Ut,"underline");break;case"historyUndo":pe(n,oa,void 0);break;case"historyRedo":pe(n,aa,void 0)}else{if(l===` `)t.preventDefault(),pe(n,Hs,!1);else if(l===hn)t.preventDefault(),pe(n,ji,void 0);else if(l==null&&t.dataTransfer){const m=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(m)}else l!=null&&lh(o,i,l,t.timeStamp,!0)?(t.preventDefault(),pe(n,Ws,l)):Ks=l;oh=t.timeStamp}})}(r,e)]);let no=0,ih=null,oh=0,Ks=null;const Ta=new WeakMap;let hc=!1,mc=!1,so=!1,io=!1,ah=[0,"",0,"root",0];function lh(r,e,t,n,s){const i=r.anchor,o=r.focus,a=i.getNode(),l=bt(),c=Wr(l._window),u=c!==null?c.anchorNode:null,d=i.key,f=l.getElementByKey(d),m=t.length;return d!==o.key||!J(a)||(!s&&(!ca||oh<n+50)||a.isDirty()&&m<2||Vf(t))&&i.offset!==o.offset&&!a.isComposing()||Us(a)||a.isDirty()&&m>1||(s||!ca)&&f!==null&&!a.isComposing()&&u!==pa(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||a.getFormat()!==r.format||a.getStyle()!==r.style||wv(r,a)}function ch(r,e){return r!==null&&r.nodeValue!==null&&r.nodeType===$n&&e!==0&&e!==r.nodeValue.length}function uh(r,e,t){const{anchorNode:n,anchorOffset:s,focusNode:i,focusOffset:o}=r;hc&&(hc=!1,ch(n,s)&&ch(i,o))||ur(e,()=>{if(!t)return void xr(null);if(!Gi(e,n,i))return;const a=de();if(Q(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){r.type==="Range"&&r.anchorNode===r.focusNode&&(a.dirty=!0);const u=xa(e).event,d=u?u.timeStamp:performance.now(),[f,m,p,v,y]=ah,_=pt(),x=e.isComposing()===!1&&_.getTextContent()==="";if(d<y+200&&l.offset===p&&l.key===v)a.format=f,a.style=m;else if(l.type==="text")J(c)||he(141),a.format=c.getFormat(),a.style=c.getStyle();else if(l.type==="element"&&!x){const k=l.getNode();k instanceof ei&&k.getChildrenSize()===0?a.format=k.getTextFormat():a.format=0,a.style=""}}else{const u=l.key,d=a.focus.key,f=a.getNodes(),m=f.length,p=a.isBackward(),v=p?o:s,y=p?s:o,_=p?d:u,x=p?u:d;let k=iv,T=!1;for(let E=0;E<m;E++){const D=f[E],O=D.getTextContentSize();if(J(D)&&O!==0&&!(E===0&&D.__key===_&&v===O||E===m-1&&D.__key===x&&y===0)&&(T=!0,k&=D.getFormat(),k===0))break}a.format=T?k:0}}pe(e,ia,void 0)})}function dh(r){if(!r.getTargetRanges)return null;const e=r.getTargetRanges();return e.length===0?null:e[0]}function pc(r,e){const t=r._compositionKey;if(Ft(null),t!==null&&e!=null){if(e===""){const n=At(t),s=pa(r.getElementByKey(t));return void(s!==null&&s.nodeValue!==null&&J(n)&&Y0(n,s.nodeValue,null,null,!0))}if(e[e.length-1]===` `){const n=de();if(Q(n)){const s=n.focus;return n.anchor.set(s.key,s.offset,s.type),void pe(r,Hi,null)}}}K0(!0,r,e)}function fh(r){let e=r.__lexicalEventHandles;return e===void 0&&(e=[],r.__lexicalEventHandles=e),e}const Ys=new Map;function hh(r){const e=r.target,t=Wr(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const n=Rf(t.anchorNode);if(n===null)return;mc&&(mc=!1,ur(n,()=>{const c=Js(),u=t.anchorNode;if(u===null)return;const d=u.nodeType;d!==Zi&&d!==$n||xr(Sc(c,t,n,r))}));const s=G0(n),i=s[s.length-1],o=i._key,a=Ys.get(o),l=a||i;l!==n&&uh(t,l,!1),uh(t,n,!0),n!==i?Ys.set(o,n):a&&Ys.delete(o)}function mh(r){r._lexicalHandled=!0}function ph(r){return r._lexicalHandled===!0}function zv(r){const e=r.ownerDocument,t=Ta.get(e);t===void 0&&he(162);const n=t-1;n>=0||he(164),Ta.set(e,n),n===0&&e.removeEventListener("selectionchange",hh);const s=r.__lexicalEditor;s!=null&&(function(o){if(o._parentEditor!==null){const a=G0(o),l=a[a.length-1]._key;Ys.get(l)===o&&Ys.delete(l)}else Ys.delete(o._key)}(s),r.__lexicalEditor=null);const i=fh(r);for(let o=0;o<i.length;o++)i[o]();r.__lexicalEventHandles=[]}function gc(r,e,t){rr();const n=r.__key,s=r.getParent();if(s===null)return;const i=function(a){const l=de();if(!Q(l)||!q(a))return l;const{anchor:c,focus:u}=l,d=c.getNode(),f=u.getNode();return J0(d,a)&&c.set(a.__key,0,"element"),J0(f,a)&&u.set(a.__key,0,"element"),l}(r);let o=!1;if(Q(i)&&e){const a=i.anchor,l=i.focus;a.key===n&&(Oa(a,r,s,r.getPreviousSibling(),r.getNextSibling()),o=!0),l.key===n&&(Oa(l,r,s,r.getPreviousSibling(),r.getNextSibling()),o=!0)}else Bt(i)&&e&&r.isSelected()&&r.selectPrevious();if(Q(i)&&e&&!o){const a=r.getIndexWithinParent();ws(r),za(i,s,a,-1)}else ws(r);t||zr(s)||s.canBeEmpty()||!s.isEmpty()||gc(s,e),e&&jt(s)&&s.isEmpty()&&s.selectEnd()}class Ea{static getType(){he(64,this.name)}static clone(e){he(65,this.name)}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,xv(this,e)}getType(){return this.__type}isInline(){he(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=At(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||de();if(t==null)return!1;const n=t.getNodes().some(s=>s.__key===this.__key);return(J(this)||!Q(t)||t.anchor.type!=="element"||t.focus.type!=="element"||t.anchor.key!==t.focus.key||t.anchor.offset!==t.focus.offset)&&n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:At(e)}getParentOrThrow(){const e=this.getParent();return e===null&&he(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(zr(t))return q(e)||he(138),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&he(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:At(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:At(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(),n=e.getParents();q(this)&&t.unshift(this),q(e)&&n.unshift(e);const s=t.length,i=n.length;if(s===0||i===0||t[s-1]!==n[i-1])return null;const o=new Set(n);for(let a=0;a<s;a++){const l=t[a];if(o.has(l))return l}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 n=0,s=0,i=this;for(;;){const o=i.getParentOrThrow();if(o===t){n=i.getIndexWithinParent();break}i=o}for(i=e;;){const o=i.getParentOrThrow();if(o===t){s=i.getIndexWithinParent();break}i=o}return n<s}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let n=e;for(;n!==null;){if(n.__key===t)return!0;n=n.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),n=[],s=new Set;let i=this;for(;i!==null;){const o=i.__key;if(s.has(o)||(s.add(o),n.push(i)),i===e)break;const a=q(i)?t?i.getFirstChild():i.getLastChild():null;if(a!==null){i=a;continue}const l=t?i.getNextSibling():i.getPreviousSibling();if(l!==null){i=l;continue}const c=i.getParentOrThrow();if(s.has(c.__key)||n.push(c),c===e)break;let u=null,d=c;do{if(d===null&&he(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||s.has(d.__key)||n.push(d)}while(u===null);i=u}return t||n.reverse(),n}isDirty(){const e=bt()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=At(this.__key);return e===null&&he(113),e}getWritable(){rr();const e=bn(),t=bt(),n=e._nodeMap,s=this.__key,i=this.getLatest(),o=i.__parent,a=t._cloneNotNeeded,l=de();if(l!==null&&l.setCachedNodes(null),a.has(s))return ga(i),i;const c=i.constructor.clone(i);return c.__parent=o,c.__next=i.__next,c.__prev=i.__prev,q(i)&&q(c)?(Zn(i)&&Zn(c)&&(c.__textFormat=i.__textFormat),c.__first=i.__first,c.__last=i.__last,c.__size=i.__size,c.__indent=i.__indent,c.__format=i.__format,c.__dir=i.__dir):J(i)&&J(c)&&(c.__format=i.__format,c.__style=i.__style,c.__mode=i.__mode,c.__detail=i.__detail),a.add(s),c.__key=s,ga(c),n.set(s,c),c}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){he(70)}updateDOM(e,t,n){he(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){he(72)}static importJSON(e){he(18,this.name)}static transform(){return null}remove(e){