kempo 4.2.23 → 4.2.25
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/README.md +14 -0
- package/dist/admin/init.js +1 -1
- package/dist/admin/init.js.map +1 -1
- package/dist/kempo/vendor/lexical/chunks/chunk-3XOIGVQI.js +3 -0
- package/dist/kempo/vendor/lexical/chunks/chunk-ERAFEOAX.js +2 -0
- package/dist/kempo/vendor/lexical/chunks/chunk-FYATIV3K.js +3 -0
- package/dist/kempo/vendor/lexical/chunks/chunk-LMH5Y7M4.js +1 -0
- package/dist/kempo/vendor/lexical/chunks/chunk-PZQA5MC4.js +1 -0
- package/dist/kempo/vendor/lexical/chunks/chunk-ZMJQPFLE.js +11 -0
- package/dist/kempo/vendor/lexical/lexical.js +1 -0
- package/dist/kempo/vendor/lexical/lexical__code.js +12 -0
- package/dist/kempo/vendor/lexical/lexical__history.js +1 -0
- package/dist/kempo/vendor/lexical/lexical__html.js +1 -0
- package/dist/kempo/vendor/lexical/lexical__link.js +1 -0
- package/dist/kempo/vendor/lexical/lexical__list.js +1 -0
- package/dist/kempo/vendor/lexical/lexical__rich-text.js +1 -0
- package/dist/kempo/vendor/lexical/lexical__selection.js +1 -0
- package/dist/kempo/vendor/lexical/lexical__table.js +2 -0
- package/dist/kempo/vendor/lexical/manifest.json +14 -0
- package/middleware/kempo.js +77 -0
- package/package.json +11 -8
- package/server/utils/lexical/packages.js +28 -0
package/README.md
CHANGED
|
@@ -360,6 +360,20 @@ Kempo uses [kempo-css](https://github.com/dustinpoissant/kempo-css) for styling
|
|
|
360
360
|
|
|
361
361
|
Refer to the [kempo-css docs](https://github.com/dustinpoissant/kempo-css) and [kempo-ui docs](https://github.com/dustinpoissant/kempo-ui) for available utility classes and components.
|
|
362
362
|
|
|
363
|
+
## The Rich Text Editor
|
|
364
|
+
|
|
365
|
+
The admin's WYSIWYG is kempo-ui's `<k-html-editor>`, which is built on [Lexical](https://lexical.dev). Kempo ships Lexical itself rather than letting the editor fetch it from a CDN, so the editor keeps working offline, behind a strict Content-Security-Policy, on an air-gapped install, and during a CDN outage — and no third party sees a request every time an administrator opens a page.
|
|
366
|
+
|
|
367
|
+
Nothing is required to set this up. `npm run build` bundles Lexical into `dist/kempo/vendor/lexical/`, kempo's middleware serves it, and `window.kempo.lexicalUrl` points the editor at it:
|
|
368
|
+
|
|
369
|
+
```js
|
|
370
|
+
window.kempo = { ..., lexicalUrl: '/kempo/vendor/lexical' };
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
To use a CDN instead — or a copy you host elsewhere — change that value, or set `lexical-src` on an individual editor. Removing it falls back to `https://esm.sh`.
|
|
374
|
+
|
|
375
|
+
Lexical cannot be served straight from `node_modules`: its published entry reads `process.env.NODE_ENV`, which does not exist in a browser, and its builds import bare specifiers that a browser cannot resolve. The build therefore bundles each package with esbuild, with code splitting so all nine share a single copy of Lexical's core — Lexical relies on class identity, and duplicate copies produce an editor that loads but stays empty.
|
|
376
|
+
|
|
363
377
|
## Development
|
|
364
378
|
|
|
365
379
|
### Running the framework
|
package/dist/admin/init.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
window.kempo={pathsToIcons:["/admin/icons","/kempo/icons","/kempo-ui/icons"],monacoUrl:"/monaco-editor"},window.litDisableBundleWarning=!0,import("/kempo-ui/components/Import.js"),import("/kempo-ui/components/Aside.js"),import("/kempo-ui/components/Main.js");
|
|
1
|
+
window.kempo={pathsToIcons:["/admin/icons","/kempo/icons","/kempo-ui/icons"],monacoUrl:"/monaco-editor",lexicalUrl:"/kempo/vendor/lexical"},window.litDisableBundleWarning=!0,import("/kempo-ui/components/Import.js"),import("/kempo-ui/components/Aside.js"),import("/kempo-ui/components/Main.js");
|
|
2
2
|
//# sourceMappingURL=C:\Users\dusti\dev\kempo\dist\admin\init.js.map
|
package/dist/admin/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"src\\admin\\init.js","names":["window","kempo","pathsToIcons","monacoUrl","litDisableBundleWarning"],"sources":["0"],"sourcesContent":["window.kempo = { pathsToIcons: ['/admin/icons', '/kempo/icons', '/kempo-ui/icons'], monacoUrl: '/monaco-editor' };\
|
|
1
|
+
{"version":3,"file":"src\\admin\\init.js","names":["window","kempo","pathsToIcons","monacoUrl","lexicalUrl","litDisableBundleWarning"],"sources":["0"],"sourcesContent":["window.kempo = { pathsToIcons: ['/admin/icons', '/kempo/icons', '/kempo-ui/icons'], monacoUrl: '/monaco-editor', lexicalUrl: '/kempo/vendor/lexical' };\nwindow.litDisableBundleWarning = true;\n\n/*\n Dynamic imports are required here becasue static imports are hoisted and resolved before any code runs,\n meaning window.kempo would not yet be set when these components initialize.\n Dynamic import() is called at runtime, after the synchronous assignments above,\n guaranteeing window.kempo.pathsToIcons is available when the components load.\n*/\nimport('/kempo-ui/components/Import.js');\nimport('/kempo-ui/components/Aside.js');\nimport('/kempo-ui/components/Main.js');\n"],"mappings":"AAAAA,OAAOC,MAAQ,CAAEC,aAAc,CAAC,eAAgB,eAAgB,mBAAoBC,UAAW,iBAAkBC,WAAY,yBAC7HJ,OAAOK,yBAA0B,SAQ1B,yCACA,wCACA","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as J,b as H}from"/kempo/vendor/lexical/chunks/chunk-LMH5Y7M4.js";import{q as I}from"/kempo/vendor/lexical/chunks/chunk-PZQA5MC4.js";import{a as M,r as _}from"/kempo/vendor/lexical/chunks/chunk-FYATIV3K.js";import{A as F,Ba as P,Bc as $,D as R,J as O,Q as T,R as u,Wa as b,Zc as A,b as K,eb as E,f as y,fa as g,gc as L,na as m,s as w,sa as x,ta as v}from"/kempo/vendor/lexical/chunks/chunk-ZMJQPFLE.js";var S={};K(S,{$generateJSONFromSelectedNodes:()=>W,$generateNodesFromSerializedNodes:()=>Y,$getClipboardDataFromSelection:()=>q,$getHtmlContent:()=>G,$getLexicalContent:()=>k,$insertDataTransferForPlainText:()=>V,$insertDataTransferForRichText:()=>Q,$insertGeneratedNodes:()=>D,copyToClipboard:()=>X,setLexicalClipboardDataTransfer:()=>B});function N(o,...e){let t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",o);for(let s of e)n.append("v",s);throw t.search=n.toString(),Error(`Minified Lexical error #${o}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function G(o,e=u()){return e==null&&N(166),m(e)&&e.isCollapsed()||e.getNodes().length===0?"":J(o,e)}function k(o,e=u()){return e==null&&N(166),m(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(W(o,e))}function V(o,e){let t=o.getData("text/plain")||o.getData("text/uri-list");t!=null&&e.insertRawText(t)}function Q(o,e,t){let n=o.getData("application/x-lexical-editor");if(n)try{let r=JSON.parse(n);if(r.namespace===t._config.namespace&&Array.isArray(r.nodes))return D(t,Y(r.nodes),e)}catch(r){console.error(r)}let s=o.getData("text/html"),c=o.getData("text/plain");if(s&&c!==s)try{let r=new DOMParser().parseFromString((function(i){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:l=>l}).createHTML(i):i})(s),"text/html");return D(t,H(t,r),e)}catch(r){console.error(r)}let a=c||o.getData("text/uri-list");if(a!=null)if(m(e)){let r=a.split(/(\r?\n|\t)/);r[r.length-1]===""&&r.pop();for(let i=0;i<r.length;i++){let l=u();if(m(l)){let d=r[i];d===`
|
|
2
|
+
`||d===`\r
|
|
3
|
+
`?l.insertParagraph():d===" "?l.insertNodes([w()]):l.insertText(d)}}}else e.insertRawText(a)}function D(o,e,t){o.dispatchCommand(L,{nodes:e,selection:t})||(t.insertNodes(e),(function(n){if(m(n)&&n.isCollapsed()){let s=n.anchor,c=null,a=y(s,"previous");if(a)if(v(a))c=a.origin;else{let r=F(a,R(T(),"next").getFlipped());for(let i of r){if(x(i.origin)){c=i.origin;break}if(g(i.origin)&&!i.origin.isInline())break}}if(c&&x(c)){let r=c.getFormat(),i=c.getStyle();n.format===r&&n.style===i||(n.format=r,n.style=i,n.dirty=!0)}}})(t))}function U(o,e,t,n=[]){let s=e===null||t.isSelected(e),c=g(t)&&t.excludeFromCopy("html"),a=t;e!==null&&x(a)&&(a=_(e,a,"clone"));let r=g(a)?a.getChildren():[],i=(function(l){let d=l.exportJSON(),f=l.constructor;if(d.type!==f.getType()&&N(58,f.name),g(l)){let C=d.children;Array.isArray(C)||N(59,f.name)}return d})(a);x(a)&&a.getTextContentSize()===0&&(s=!1);for(let l=0;l<r.length;l++){let d=r[l],f=U(o,e,d,i.children);!s&&g(t)&&f&&t.extractWithChild(d,e,"clone")&&(s=!0)}if(s&&!c)n.push(i);else if(Array.isArray(i.children))for(let l=0;l<i.children.length;l++){let d=i.children[l];n.push(d)}return s}function W(o,e){let t=[],n=T().getChildren();for(let s=0;s<n.length;s++)U(o,e,n[s],t);return{namespace:o._config.namespace,nodes:t}}function Y(o){let e=[];for(let t=0;t<o.length;t++){let n=o[t],s=P(n);x(s)&&M(s),e.push(s)}return e}var h=null;async function X(o,e,t){if(h!==null)return!1;if(e!==null)return new Promise((l,d)=>{o.update(()=>{l(z(o,e,t))})});let n=o.getRootElement(),s=o._window||window,c=s.document,a=$(s);if(n===null||a===null)return!1;let r=c.createElement("span");r.style.cssText="position: fixed; top: -1000px;",r.append(c.createTextNode("#")),n.append(r);let i=new Range;return i.setStart(r,0),i.setEnd(r,1),a.removeAllRanges(),a.addRange(i),new Promise((l,d)=>{let f=o.registerCommand(E,C=>(I(C,ClipboardEvent)&&(f(),h!==null&&(s.clearTimeout(h),h=null),l(z(o,C,t))),!0),b);h=s.setTimeout(()=>{f(),h=null,l(!1)},50),c.execCommand("copy"),r.remove()})}function z(o,e,t){if(t===void 0){let s=$(o._window),c=u();if(!c||c.isCollapsed()||!s)return!1;let a=s.anchorNode,r=s.focusNode;if(a!==null&&r!==null&&!A(o,a,r))return!1;t=q(c)}e.preventDefault();let n=e.clipboardData;return n!==null&&(B(n,t),!0)}var j=[["text/html",G],["application/x-lexical-editor",k]];function q(o=u()){let e={"text/plain":o?o.getTextContent():""};if(o){let t=O();for(let[n,s]of j){let c=s(t,o);c!==null&&(e[n]=c)}}return e}function B(o,e){for(let[t]of j)e[t]===void 0&&o.setData(t,"");for(let t in e){let n=e[t];n!==void 0&&o.setData(t,n)}}var p=S,ne=p.$generateJSONFromSelectedNodes,re=p.$generateNodesFromSerializedNodes,se=p.$getClipboardDataFromSelection,ae=p.$getHtmlContent,ie=p.$getLexicalContent,le=p.$insertDataTransferForPlainText,ce=p.$insertDataTransferForRichText,de=p.$insertGeneratedNodes,pe=p.copyToClipboard,fe=p.setLexicalClipboardDataTransfer;export{se as a,ce as b,pe as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as Gt,f as Wt,h as Yt,s as Vt}from"/kempo/vendor/lexical/chunks/chunk-PZQA5MC4.js";import{$c as w,Ha as bt,J as mt,Ja as Ot,M as Et,O as xt,Oc as Ut,Q as W,R as N,Sa as Dt,T as yt,Ua as Rt,Vb as Ft,Wa as wt,Wb as _t,Xa as $,Za as V,_b as It,b as ye,ba as vt,bc as At,bd as Zt,ea as St,ec as $t,ed as v,hd as L,id as q,l as ht,la as Y,mc as Pt,n as gt,na as R,nb as P,nc as Lt,o as G,oc as kt,q as pt,qc as X,rb as Ct,sc as zt,tb as Tt,tc as Kt,uc as jt,vb as J,wc as Ht,xc as Bt,yc as x,za as Nt,zb as Mt}from"/kempo/vendor/lexical/chunks/chunk-ZMJQPFLE.js";var ft={};ye(ft,{$createHorizontalRuleNode:()=>Z,$isDecoratorTextNode:()=>de,$isHorizontalRuleNode:()=>me,AutoFocusExtension:()=>be,ClearEditorExtension:()=>Oe,DecoratorTextExtension:()=>Me,DecoratorTextNode:()=>A,EditorStateExtension:()=>B,HorizontalRuleExtension:()=>Ke,HorizontalRuleNode:()=>D,INSERT_HORIZONTAL_RULE_COMMAND:()=>pe,InitialStateExtension:()=>he,LexicalBuilder:()=>O,NestedEditorExtension:()=>je,NodeSelectionExtension:()=>ct,SelectionAlwaysOnDisplayExtension:()=>He,TabIndentationExtension:()=>Be,applyFormatFromStyle:()=>Re,applyFormatToDom:()=>we,batch:()=>ee,buildEditorFromExtensions:()=>Ae,computed:()=>oe,configExtension:()=>zt,declarePeerDependency:()=>Bt,defineExtension:()=>x,effect:()=>y,getExtensionDependencyFromEditor:()=>Pe,getKnownTypesAndNodes:()=>De,getPeerDependencyFromEditor:()=>ge,getPeerDependencyFromEditorOrThrow:()=>Le,namedSignals:()=>F,registerClearEditor:()=>ae,registerTabIndentation:()=>xe,safeCast:()=>v,shallowMergeConfig:()=>L,signal:()=>M,untracked:()=>ot,watchedSignal:()=>lt});var ve=Symbol.for("preact-signals");function U(){if(S>1)return void S--;let e,t=!1;for(!(function(){let n=j;for(j=void 0;n!==void 0;)n.S.v===n.v&&(n.S.i=n.i),n=n.o})();I!==void 0;){let n=I;for(I=void 0,H++;n!==void 0;){let i=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&ne(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=i}}if(H=0,S--,t)throw e}function ee(e){if(S>0)return e();st=++Se,S++;try{return e()}finally{U()}}var f,I;function ot(e){let t=f;f=void 0;try{return e()}finally{f=t}}var j,S=0,H=0,Se=0,st=0,K=0;function Jt(e){if(f===void 0)return;let t=e.n;return t===void 0||t.t!==f?(t={i:0,S:e,p:f.s,n:void 0,t:f,e:void 0,x:void 0,r:t},f.s!==void 0&&(f.s.n=t),f.s=t,e.n=t,32&f.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=f.s,t.n=void 0,f.s.n=t,f.s=t),t):void 0}function E(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function M(e,t){return new E(e,t)}function ne(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Xt(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function ie(e){let t,n=e.s;for(;n!==void 0;){let i=n.p;n.i===-1?(n.S.U(n),i!==void 0&&(i.n=n.n),n.n!==void 0&&(n.n.p=i)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=i}e.s=t}function b(e,t){E.call(this,void 0),this.x=e,this.s=void 0,this.g=K-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function oe(e,t){return new b(e,t)}function se(e){let t=e.m;if(e.m=void 0,typeof t=="function"){S++;let n=f;f=void 0;try{t()}catch(i){throw e.f&=-2,e.f|=8,dt(e),i}finally{f=n,U()}}}function dt(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,se(e)}function Ne(e){if(f!==this)throw new Error("Out-of-order effect");ie(this),f=e,this.f&=-2,8&this.f&&dt(this),U()}function T(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name}function y(e,t){let n=new T(e,t);try{n.c()}catch(o){throw n.d(),o}let i=n.d.bind(n);return i[Symbol.dispose]=i,i}function F(e,t={}){let n={};for(let i in e){let o=t[i],s=M(o===void 0?e[i]:o);n[i]=s}return n}E.prototype.brand=ve,E.prototype.h=function(){return!0},E.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:ot(()=>{var n;(n=this.W)==null||n.call(this)}))},E.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&ot(()=>{var i;(i=this.Z)==null||i.call(this)}))}},E.prototype.subscribe=function(e){return y(()=>{let t=this.value,n=f;f=void 0;try{e(t)}finally{f=n}},{name:"sub"})},E.prototype.valueOf=function(){return this.value},E.prototype.toString=function(){return this.value+""},E.prototype.toJSON=function(){return this.value},E.prototype.peek=function(){let e=f;f=void 0;try{return this.value}finally{f=e}},Object.defineProperty(E.prototype,"value",{get(){let e=Jt(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(H>100)throw new Error("Cycle detected");(function(t){S!==0&&H===0&&t.l!==st&&(t.l=st,j={S:t,v:t.v,i:t.i,o:j})})(this),this.v=e,this.i++,K++,S++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{U()}}}}),b.prototype=new E,b.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===K))return!0;if(this.g=K,this.f|=1,this.i>0&&!ne(this))return this.f&=-2,!0;let e=f;try{Xt(this),f=this;let t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return f=e,ie(this),this.f&=-2,!0},b.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}E.prototype.S.call(this,e)},b.prototype.U=function(e){if(this.t!==void 0&&(E.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},b.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(b.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");let e=Jt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),T.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}},T.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,se(this),Xt(this),S++;let e=f;return f=this,Ne.bind(this,e)},T.prototype.N=function(){2&this.f||(this.f|=2,this.u=I,I=this)},T.prototype.d=function(){this.f|=8,1&this.f||dt(this)},T.prototype.dispose=function(){this.d()};var be=x({build:(e,t,n)=>F(t),config:v({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,t,n){let i=n.getOutput();return y(()=>i.disabled.value?void 0:e.registerRootListener(o=>{e.focus(()=>{let s=document.activeElement;o===null||s!==null&&o.contains(s)||o.focus({preventScroll:!0})},{defaultSelection:i.defaultSelection.peek()})}))}});function re(){let e=W(),t=N(),n=G();e.clear(),e.append(n),t!==null&&n.select(),R(t)&&(t.format=0)}function ae(e,t=re){return e.registerCommand(Dt,n=>(e.update(t),!0),$)}var Oe=x({build:(e,t,n)=>F(t),config:v({$onClear:re}),name:"@lexical/extension/ClearEditor",register(e,t,n){let{$onClear:i}=n.getOutput();return y(()=>ae(e,i.value))}});function De(e){let t=new Set,n=new Set;for(let i of ce(e)){let o=typeof i=="function"?i:i.replace;t.add(o.getType()),n.add(o)}return{nodes:n,types:t}}function ce(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}var Q=Ht("format",{parse:e=>typeof e=="number"?e:0}),A=class extends P{$config(){return this.config("decorator-text",{extends:P,stateConfigs:[{flat:!0,stateConfig:Q}]})}getFormat(){return yt(this,Q)}getFormatFlags(t,n){return q(this.getFormat(),t,n)}hasFormat(t){let n=Pt[t];return(this.getFormat()&n)!==0}setFormat(t){return Ot(this,Q,t)}toggleFormat(t){let n=this.getFormat(),i=q(n,t,null);return this.setFormat(i)}isInline(){return!0}createDOM(){return document.createElement("span")}updateDOM(){return!1}};function de(e){return e instanceof A}function Re(e,t,n){let i=t.fontWeight,o=t.textDecoration.split(" "),s=i==="700"||i==="bold",r=o.includes("line-through"),a=t.fontStyle==="italic",d=o.includes("underline"),l=t.verticalAlign;return s&&!e.hasFormat("bold")&&e.toggleFormat("bold"),r&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),a&&!e.hasFormat("italic")&&e.toggleFormat("italic"),d&&!e.hasFormat("underline")&&e.toggleFormat("underline"),l!=="sub"||e.hasFormat("subscript")||e.toggleFormat("subscript"),l!=="super"||e.hasFormat("superscript")||e.toggleFormat("superscript"),n&&!e.hasFormat(n)&&e.toggleFormat(n),e}function we(e,t,n=Te){for(let[i,o]of Object.entries(n))e.hasFormat(o)&&(t=Ce(t,i));return t}function Ce(e,t){let n=document.createElement(t);return n.appendChild(e),n}var Te={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},Me=x({name:"@lexical/extension/DecoratorText",nodes:()=>[A],register:(e,t,n)=>e.registerCommand(Ct,i=>{let o=N();if(Y(o)||R(o))for(let s of o.getNodes())de(s)&&s.toggleFormat(i);return!1},V)});function lt(e,t){let n;return M(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}var B=x({build:e=>lt(()=>e.getEditorState(),t=>e.registerUpdateListener(n=>{t.value=n.editorState})),name:"@lexical/extension/EditorState"});function h(e,...t){let n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",e);for(let o of t)i.append("v",o);throw n.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function le(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){let n=e,i=t;for(let o in i)n[o]=le(n[o],i[o]);return e}return t}var ut=0,rt=1,ue=2,tt=3,k=4,C=5,et=6,_=7;function nt(e){return e.id===ut}function fe(e){return e.id===ue}function Fe(e){return(function(t){return t.id===rt})(e)||h(305,String(e.id),String(rt)),Object.assign(e,{id:ue})}var _e=new Set,at=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:ut}}mergeConfigs(){let t=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):L;for(let i of this.configs)t=n(t,i);return t}init(t){let n=this.state;fe(n)||h(306,String(n.id));let i={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...i,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},s=(function(a,d,l){return Object.assign(a,{config:d,id:tt,registerState:l})})(n,this.mergeConfigs(),i),r;this.state=s,this.extension.init&&(r=this.extension.init(t,s.config,i)),this.state=(function(a,d,l){return Object.assign(a,{id:k,initResult:d,registerState:l})})(s,r,o)}build(t){let n=this.state,i;n.id!==k&&h(307,String(n.id),String(C)),this.extension.build&&(i=this.extension.build(t,n.config,n.registerState));let o={...n.registerState,getOutput:()=>i,getSignal:this.getSignal.bind(this)};this.state=(function(s,r,a){return Object.assign(s,{id:C,output:r,registerState:a})})(n,i,o)}register(t,n){this._signal=n;let i=this.state;i.id!==C&&h(308,String(i.id),String(C));let o=this.extension.register&&this.extension.register(t,i.config,i.registerState);return this.state=(function(s){return Object.assign(s,{id:et})})(i),()=>{let s=this.state;s.id!==_&&h(309,String(i.id),String(_)),this.state=(function(r){return Object.assign(r,{id:C})})(s),o&&o()}}afterRegistration(t){let n=this.state,i;return n.id!==et&&h(310,String(n.id),String(et)),this.extension.afterRegistration&&(i=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(o){return Object.assign(o,{id:_})})(n),i}getSignal(){return this._signal===void 0&&h(311),this._signal}getInitResult(){this.extension.init===void 0&&h(312,this.extension.name);let t=this.state;return(function(n){return n.id>=k})(t)||h(313,String(t.id),String(k)),t.initResult}getInitPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){let t=this.state;return(function(n){return n.id>=tt})(t)||h(314,String(t.id),String(tt)),{config:t.config}}getPeer(t){let n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&h(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){let n=this.builder.getExtensionRep(t);return n===void 0&&h(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){let t=this.state;return(function(n){return n.id>=_})(t)||h(316,String(t.id),String(_)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||_e}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){let t=this.state;(function(n){return n.id>=C})(t)||h(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}},qt={tag:Tt};function Ie(){let e=W();e.isEmpty()&&e.append(G())}var he=x({config:v({setOptions:qt,updateOptions:qt}),init:({$initialEditorState:e=Ie})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},i){let o=i.getInitResult();if(!o.initialized){o.initialized=!0;let{$initialEditorState:s}=o;if(St(s))e.setEditorState(s,n);else if(typeof s=="function")e.update(()=>{s(e)},t);else if(s&&(typeof s=="string"||typeof s=="object")){let r=e.parseEditorState(s);e.setEditorState(r,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[$t,kt,_t,Lt,At]}),Qt=Symbol.for("@lexical/extension/LexicalBuilder");function Ae(...e){return O.fromExtensions(e).buildEditor()}function te(){}function $e(e){throw e}function z(e){return Array.isArray(e)?e:[e]}var it="0.43.0+prod.esm",O=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=it,this.roots=t;for(let n of t)this.addExtension(n)}static fromExtensions(t){let n=[z(he)];for(let i of t)n.push(z(i));return new e(n)}static maybeFromEditor(t){let n=t[Qt];return n&&(n.PACKAGE_VERSION!==it&&h(292,n.PACKAGE_VERSION,it),n instanceof e||h(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&h(294),n}constructEditor(){let{$initialEditorState:t,onError:n,...i}=this.buildCreateEditorArgs(),o=Object.assign(jt({...i,...n?{onError:s=>{n(s,o)}}:{}}),{[Qt]:this});for(let s of this.sortedExtensionReps())s.build(o);return o}buildEditor(){let t=te;function n(){try{t()}finally{t=te}}let i=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=w(this.registerEditor(i),()=>i.setRootElement(null)),i}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){let n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&h(295,t.name),n}addEdge(t,n,i){let o=this.outgoingConfigEdges.get(t);o?o.set(n,i):this.outgoingConfigEdges.set(t,new Map([[n,i]]));let s=this.incomingEdges.get(n);s?s.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&h(296);let n=z(t),[i]=n;typeof i.name!="string"&&h(297,typeof i.name);let o=this.extensionNameMap.get(i.name);if(o!==void 0&&o.extension!==i&&h(298,i.name),!o){o=new at(this,i),this.extensionNameMap.set(i.name,o);let s=this.conflicts.get(i.name);typeof s=="string"&&h(299,i.name,s);for(let r of i.conflictsWith||[])this.extensionNameMap.has(r)&&h(299,i.name,r),this.conflicts.set(r,i.name);for(let r of i.dependencies||[]){let a=z(r);this.addEdge(i.name,a[0].name,a.slice(1)),this.addExtension(a)}for(let[r,a]of i.peerDependencies||[])this.addEdge(i.name,r,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let t=[],n=(i,o)=>{let s=i.state;if(fe(s))return;let r=i.extension.name;var a;nt(s)||h(300,r,o||"[unknown]"),nt(a=s)||h(304,String(a.id),String(ut)),s=Object.assign(a,{id:rt}),i.state=s;let d=this.outgoingConfigEdges.get(r);if(d)for(let l of d.keys()){let g=this.extensionNameMap.get(l);g&&n(g,r)}s=Fe(s),i.state=s,t.push(i)};for(let i of this.extensionNameMap.values())nt(i.state)&&n(i);for(let i of t)for(let[o,s]of this.outgoingConfigEdges.get(i.extension.name)||[])if(s.length>0){let r=this.extensionNameMap.get(o);if(r)for(let a of s)r.configs.add(a)}for(let[i,...o]of this.roots)if(o.length>0){let s=this.extensionNameMap.get(i.name);s===void 0&&h(301,i.name);for(let r of o)s.configs.add(r)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){let n=this.sortedExtensionReps(),i=new AbortController,o=[()=>i.abort()],s=i.signal;for(let r of n){let a=r.register(t,s);a&&o.push(a)}for(let r of n){let a=r.afterRegistration(t);a&&o.push(a)}return w(...o)}buildCreateEditorArgs(){let t={},n=new Set,i=new Map,o=new Map,s={},r={},a=this.sortedExtensionReps();for(let g of a){let{extension:u}=g;if(u.onError!==void 0&&(t.onError=u.onError),u.disableEvents!==void 0&&(t.disableEvents=u.disableEvents),u.parentEditor!==void 0&&(t.parentEditor=u.parentEditor),u.editable!==void 0&&(t.editable=u.editable),u.namespace!==void 0&&(t.namespace=u.namespace),u.$initialEditorState!==void 0&&(t.$initialEditorState=u.$initialEditorState),u.nodes)for(let p of ce(u)){if(typeof p!="function"){let m=i.get(p.replace);m&&h(302,u.name,p.replace.name,m.extension.name),i.set(p.replace,g)}n.add(p)}if(u.html){if(u.html.export)for(let[p,m]of u.html.export.entries())o.set(p,m);u.html.import&&Object.assign(s,u.html.import)}u.theme&&le(r,u.theme)}Object.keys(r).length>0&&(t.theme=r),n.size&&(t.nodes=[...n]);let d=Object.keys(s).length>0,l=o.size>0;(d||l)&&(t.html={},d&&(t.html.import=s),l&&(t.html.export=o));for(let g of a)g.init(t);return t.onError||(t.onError=$e),t}};function Pe(e,t){let n=O.fromEditor(e).getExtensionRep(t);return n===void 0&&h(303,t.name),n.getExtensionDependency()}function ge(e,t){let n=O.fromEditor(e).extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}function Le(e,t){let n=ge(e,t);return n===void 0&&h(291,t),n}var ke=new Set,ct=x({build(e,t,n){let i=n.getDependency(B).output,o=M({watchedNodeKeys:new Map}),s=lt(()=>{},()=>y(()=>{let r=s.peek(),{watchedNodeKeys:a}=o.value,d,l=!1;i.value.read(()=>{if(N())for(let[g,u]of a.entries()){if(u.size===0){a.delete(g);continue}let p=Et(g),m=p&&p.isSelected()||!1;l=l||m!==(!!r&&r.has(g)),m&&(d=d||new Set,d.add(g))}}),!l&&d&&r&&d.size===r.size||(s.value=d)}));return{watchNodeKey:function(r){let a=oe(()=>(s.value||ke).has(r)),{watchedNodeKeys:d}=o.peek(),l=d.get(r),g=l!==void 0;return l=l||new Set,l.add(a),g||(d.set(r,l),o.value={watchedNodeKeys:d}),a}}},dependencies:[B],name:"@lexical/extension/NodeSelection"}),pe=Kt("INSERT_HORIZONTAL_RULE_COMMAND"),D=class e extends P{static getType(){return"horizontalrule"}static clone(t){return new e(t.__key)}static importJSON(t){return Z().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:ze,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){let n=document.createElement("hr");return X(n,t.theme.hr),n}getTextContent(){return`
|
|
2
|
+
`}isInline(){return!1}updateDOM(){return!1}};function ze(){return{node:Z()}}function Z(){return ht(D)}function me(e){return e instanceof D}var Ke=x({dependencies:[B,ct],name:"@lexical/extension/HorizontalRule",nodes:()=>[D],register(e,t,n){let{watchNodeKey:i}=n.getDependency(ct).output,o=M({nodeSelections:new Map}),s=e._config.theme.hrSelected??"selected";return w(e.registerCommand(pe,r=>{let a=N();if(!R(a))return!1;if(a.focus.getNode()!==null){let d=Z();Yt(d)}return!0},$),e.registerCommand(Rt,r=>{if(Ut(r.target)){let a=xt(r.target);if(me(a))return(function(d,l=!1){let g=N(),u=d.isSelected(),p=d.getKey(),m;l&&Y(g)?m=g:(m=gt(),bt(m)),u?m.delete(p):m.add(p)})(a,r.shiftKey),!0}return!1},V),e.registerMutationListener(D,(r,a)=>{ee(()=>{let d=!1,{nodeSelections:l}=o.peek();for(let[g,u]of r.entries())if(u==="destroyed")l.delete(g),d=!0;else{let p=l.get(g),m=e.getElementByKey(g);p?p.domNode.value=m:(d=!0,l.set(g,{domNode:M(m),selectedSignal:i(g)}))}d&&(o.value={nodeSelections:l})})}),y(()=>{let r=[];for(let{domNode:a,selectedSignal:d}of o.value.nodeSelections.values())r.push(y(()=>{let l=a.value;l&&(d.value?X(l,s):Zt(l,s))}));return w(...r)}))}}),je=x({build:(e,t)=>F({inheritEditableFromParent:t.inheritEditableFromParent}),config:v({$getParentEditor:function(){let e=mt();return O.fromEditor(e),e},inheritEditableFromParent:!1}),init:(e,t,n)=>{let i=t.$getParentEditor();e.parentEditor=i,e.theme=e.theme||i._config.theme},name:"@lexical/extension/NestedEditor",register:(e,t,n)=>y(()=>{let i=e._parentEditor;if(i&&n.getOutput().inheritEditableFromParent.value)return e.setEditable(i.isEditable()),i.registerEditableListener(e.setEditable.bind(e))})}),He=x({build:(e,t,n)=>F(t),config:v({disabled:!1,onReposition:void 0}),name:"@lexical/utils/SelectionAlwaysOnDisplay",register:(e,t,n)=>{let i=n.getOutput();return y(()=>{if(!i.disabled.value)return Vt(e,i.onReposition.value)})}});function Ee(e){return e.canBeEmpty()}function xe(e,t,n=Ee){return w(e.registerCommand(Ft,i=>{let o=N();if(!R(o))return!1;i.preventDefault();let s=(function(r){if(r.getNodes().filter(p=>vt(p)&&p.canIndent()).length>0)return!0;let a=r.anchor,d=r.focus,l=d.isBefore(a)?d:a,g=l.getNode(),u=Gt(g);if(u.canIndent()){let p=u.getKey(),m=pt();if(m.anchor.set(p,0,"element"),m.focus.set(p,0,"element"),m=Nt(m),m.anchor.is(l))return!0}return!1})(o)?i.shiftKey?It:J:Mt;return e.dispatchCommand(s,void 0)},$),e.registerCommand(J,()=>{let i=typeof t=="number"?t:t?t.peek():null,o=N();if(!R(o))return!1;let s=typeof n=="function"?n:n.peek();return Wt(r=>{if(s(r)){let a=r.getIndent()+1;(!i||a<i)&&r.setIndent(a)}})},wt))}var Be=x({build:(e,t,n)=>F(t),config:v({$canIndent:Ee,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,t,n){let{disabled:i,maxIndent:o,$canIndent:s}=n.getOutput();return y(()=>{if(!i.value)return xe(e,o,s)})}});var c=ft,We=c.$createHorizontalRuleNode,Ye=c.$isDecoratorTextNode,Ve=c.$isHorizontalRuleNode,Je=c.AutoFocusExtension,Xe=c.ClearEditorExtension,qe=c.DecoratorTextExtension,Qe=c.DecoratorTextNode,tn=c.EditorStateExtension,en=c.HorizontalRuleExtension,nn=c.HorizontalRuleNode,on=c.INSERT_HORIZONTAL_RULE_COMMAND,sn=c.InitialStateExtension,rn=c.LexicalBuilder,an=c.NestedEditorExtension,cn=c.NodeSelectionExtension,dn=c.SelectionAlwaysOnDisplayExtension,ln=c.TabIndentationExtension,un=c.applyFormatFromStyle,fn=c.applyFormatToDom,hn=c.batch,gn=c.buildEditorFromExtensions,pn=c.computed,mn=c.configExtension,En=c.declarePeerDependency,xn=c.defineExtension,yn=c.effect,vn=c.getExtensionDependencyFromEditor,Sn=c.getKnownTypesAndNodes,Nn=c.getPeerDependencyFromEditor,bn=c.getPeerDependencyFromEditorOrThrow,On=c.namedSignals,Dn=c.registerClearEditor,Rn=c.registerTabIndentation,wn=c.safeCast,Cn=c.shallowMergeConfig,Tn=c.signal,Mn=c.untracked,Fn=c.watchedSignal;export{hn as a,yn as b,Nn as c,On as d,Tn as e};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Ab as F,C as q,Ea as ne,Ha as I,J as G,M as J,P as k,R as K,_ as Q,b as ye,ca as Y,da as Z,f as j,fa as S,g as V,ga as ee,h as W,i as U,ia as te,na as C,oa as B,pa as N,q as H,sa as x,t as O,u as X,v,va as A}from"/kempo/vendor/lexical/chunks/chunk-ZMJQPFLE.js";var _={};ye(_,{$addNodeStyle:()=>Te,$cloneWithProperties:()=>W,$copyBlockFormatIndent:()=>de,$ensureForwardRangeSelection:()=>fe,$forEachSelectedTextNode:()=>ae,$getComputedStyleForElement:()=>L,$getComputedStyleForParent:()=>M,$getSelectionStyleValueForProperty:()=>Oe,$isAtNodeEnd:()=>Ce,$isParentElementRTL:()=>z,$isParentRTL:()=>$e,$moveCaretSelection:()=>pe,$moveCharacter:()=>Re,$patchStyleText:()=>Ne,$selectAll:()=>ne,$setBlocksType:()=>Fe,$shouldOverrideDefaultCharacterSelection:()=>Ee,$sliceSelectedTextNodeContent:()=>xe,$trimTextContentFromAnchor:()=>ce,$wrapNodes:()=>ve,createDOMRange:()=>me,createRectsFromDOMRange:()=>Se,getCSSFromStyleObject:()=>ie,getStyleObjectFromCSS:()=>w,trimTextContentFromAnchor:()=>ke});function D(t,...e){let l=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",t);for(let s of e)n.append("v",s);throw l.search=n.toString(),Error(`Minified Lexical error #${t}; visit ${l.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var R=new Map;function oe(t){let e=t;for(;e!=null;){if(e.nodeType===Node.TEXT_NODE)return e;e=e.firstChild}return null}function re(t){let e=t.parentNode;if(e==null)throw new Error("Should never happen");return[e,Array.from(e.childNodes).indexOf(t)]}function me(t,e,l,n,s){let o=e.getKey(),a=n.getKey(),r=document.createRange(),i=t.getElementByKey(o),c=t.getElementByKey(a),u=l,g=s;if(x(e)&&(i=oe(i)),x(n)&&(c=oe(c)),e===void 0||n===void 0||i===null||c===null)return null;i.nodeName==="BR"&&([i,u]=re(i)),c.nodeName==="BR"&&([c,g]=re(c));let p=i.firstChild;i===c&&p!=null&&p.nodeName==="BR"&&u===0&&g===0&&(g=1);try{r.setStart(i,u),r.setEnd(c,g)}catch{return null}return!r.collapsed||u===g&&o===a||(r.setStart(c,g),r.setEnd(i,u)),r}function Se(t,e){let l=t.getRootElement();if(l===null)return[];let n=l.getBoundingClientRect(),s=getComputedStyle(l),o=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight),a=Array.from(e.getClientRects()),r,i=a.length;a.sort((c,u)=>{let g=c.top-u.top;return Math.abs(g)<=3?c.left-u.left:g});for(let c=0;c<i;c++){let u=a[c],g=r&&r.top<=u.top&&r.top+r.height>u.top&&r.left+r.width>u.left,p=u.width+o===n.width;g||p?(a.splice(c--,1),i--):r=u}return a}function le(t){let e={};if(!t)return e;let l=t.split(";");for(let n of l)if(n!==""){let[s,o]=n.split(/:([^]+)/);s&&o&&(e[s.trim()]=o.trim())}return e}function w(t){let e=R.get(t);return e===void 0&&(e=le(t),R.set(t,e)),e}function ie(t){let e="";for(let l in t)l&&(e+=`${l}: ${t[l]};`);return e}function L(t){let e=G().getElementByKey(t.getKey());if(e===null)return null;let l=e.ownerDocument.defaultView;return l===null?null:l.getComputedStyle(e)}function M(t){return L(B(t)?t:t.getParentOrThrow())}function $e(t){let e=M(t);return e!==null&&e.direction==="rtl"}function xe(t,e,l="self"){let n=t.getStartEndPoints();if(e.isSelected(t)&&!A(e)&&n!==null){let[s,o]=n,a=t.isBackward(),r=s.getNode(),i=o.getNode(),c=e.is(r),u=e.is(i);if(c||u){let[g,p]=q(t),h=r.is(i),f=e.is(a?i:r),d=e.is(a?r:i),m,$=0;h?($=g>p?p:g,m=g>p?g:p):f?($=a?p:g,m=void 0):d&&($=0,m=a?g:p);let T=e.__text.slice($,m);T!==e.__text&&(l==="clone"&&(e=U(e)),e.__text=T)}}return e}function Ce(t){if(t.type==="text")return t.offset===t.getNode().getTextContentSize();let e=t.getNode();return S(e)||D(177),t.offset===e.getChildrenSize()}function ce(t,e,l){let n=e.getNode(),s=l;if(S(n)){let o=n.getDescendantByIndex(e.offset);o!==null&&(n=o)}for(;s>0&&n!==null;){if(S(n)){let c=n.getLastDescendant();c!==null&&(n=c)}let o=n.getPreviousSibling(),a=0;if(o===null){let c=n.getParentOrThrow(),u=c.getPreviousSibling();for(;u===null;){if(c=c.getParent(),c===null){o=null;break}u=c.getPreviousSibling()}c!==null&&(a=c.isInline()?0:2,o=u)}let r=n.getTextContent();r===""&&S(n)&&!n.isInline()&&(r=`
|
|
2
|
+
|
|
3
|
+
`);let i=r.length;if(!x(n)||s>=i){let c=n.getParent();n.remove(),c==null||c.getChildrenSize()!==0||B(c)||c.remove(),s-=i+a,n=o}else{let c=n.getKey(),u=t.getEditorState().read(()=>{let h=J(c);return x(h)&&h.isSimpleText()?h.getTextContent():null}),g=i-s,p=r.slice(0,g);if(u!==null&&u!==r){let h=k(),f=n;if(n.isSimpleText())n.setTextContent(u);else{let d=O(u);n.replace(d),f=d}if(C(h)&&h.isCollapsed()){let d=h.anchor.offset;f.select(d,d)}}else if(n.isSimpleText()){let h=e.key===c,f=e.offset;f<s&&(f=i);let d=h?f-s:0,m=h?f:g;if(h&&d===0){let[$]=n.splitText(d,m);$.remove()}else{let[,$]=n.splitText(d,m);$.remove()}}else{let h=O(p);n.replace(h)}s=0}}}function Te(t){let e=t.getStyle(),l=le(e);R.set(e,l)}function E(t,e){(C(t)?t.isCollapsed():x(t)||S(t))||D(280);let l=w(C(t)?t.style:x(t)?t.getStyle():t.getTextStyle()),n=Object.entries(e).reduce((o,[a,r])=>(typeof r=="function"?o[a]=r(l[a],t):r===null?delete o[a]:o[a]=r,o),{...l}),s=ie(n);C(t)||x(t)?t.setStyle(s):t.setTextStyle(s),R.set(s,n)}function Ne(t,e){if(C(t)&&t.isCollapsed()){E(t,e);let n=t.anchor.getNode();S(n)&&n.isEmpty()&&E(n,e)}ae(n=>{E(n,e)});let l=t.getNodes();if(l.length>0){let n=new Set;for(let s of l){if(!S(s)||!s.canBeEmpty()||s.getChildrenSize()!==0)continue;let o=s.getKey();n.has(o)||(n.add(o),E(s,e))}}}function ae(t){let e=K();if(!e)return;let l=new Map,n=o=>l.get(o.getKey())||[0,o.getTextContentSize()];if(C(e))for(let o of V(e).getTextSlices())o&&l.set(o.caret.origin.getKey(),o.getSliceIndices());let s=e.getNodes();for(let o of s){if(!x(o)||!o.canHaveFormat())continue;let[a,r]=n(o);r!==a&&(A(o)||a===0&&r===o.getTextContentSize()?t(o):t(o.splitText(a,r)[a===0?0:1]))}C(e)&&e.anchor.type==="text"&&e.focus.type==="text"&&e.anchor.key===e.focus.key&&fe(e)}function fe(t){if(t.isBackward()){let{anchor:e,focus:l}=t,{key:n,offset:s,type:o}=e;e.set(l.key,l.offset,l.type),l.set(n,s,o)}}function de(t,e){let l=t.getFormatType(),n=t.getIndent();l!==e.getFormatType()&&e.setFormat(l),n!==e.getIndent()&&e.setIndent(n)}function Fe(t,e,l=de){if(t===null)return;let n=t.getStartEndPoints(),s=new Map,o=null;if(n){let[a,r]=n;o=H(),o.anchor.set(a.key,a.offset,a.type),o.focus.set(r.key,r.offset,r.type);let i=v(a.getNode(),F),c=v(r.getNode(),F);S(i)&&s.set(i.getKey(),i),S(c)&&s.set(c.getKey(),c)}for(let a of t.getNodes())if(S(a)&&F(a))s.set(a.getKey(),a);else if(n===null){let r=v(a,F);S(r)&&s.set(r.getKey(),r)}for(let[a,r]of s){let i=e();l(r,i),r.replace(i,!0),o&&(a===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,o.anchor.type),a===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,o.focus.type))}o&&t.is(K())&&I(o)}function se(t){return t.getNode().isAttached()}function Pe(t){let e=t;for(;e!==null&&!N(e);){let l=e.getLatest(),n=e.getParent();l.getChildrenSize()===0&&e.remove(!0),e=n}}function ve(t,e,l=null){let n=t.getStartEndPoints(),s=n?n[0]:null,o=t.getNodes(),a=o.length;if(s!==null&&(a===0||a===1&&s.type==="element"&&s.getNode().getChildrenSize()===0)){let c=s.type==="text"?s.getNode().getParentOrThrow():s.getNode(),u=c.getChildren(),g=e();return g.setFormat(c.getFormatType()),g.setIndent(c.getIndent()),u.forEach(p=>g.append(p)),l&&(g=l.append(g)),void c.replace(g)}let r=null,i=[];for(let c=0;c<a;c++){let u=o[c];N(u)?(b(t,i,i.length,e,l),i=[],r=u):r===null||r!==null&&Q(u,r)?i.push(u):(b(t,i,i.length,e,l),i=[u])}b(t,i,i.length,e,l)}function b(t,e,l,n,s=null){if(e.length===0)return;let o=e[0],a=new Map,r=[],i=S(o)?o:o.getParentOrThrow();i.isInline()&&(i=i.getParentOrThrow());let c=!1;for(;i!==null;){let f=i.getPreviousSibling();if(f!==null){i=f,c=!0;break}if(i=i.getParentOrThrow(),N(i))break}let u=new Set;for(let f=0;f<l;f++){let d=e[f];S(d)&&d.getChildrenSize()===0&&u.add(d.getKey())}let g=new Set;for(let f=0;f<l;f++){let d=e[f],m=d.getParent();if(m!==null&&m.isInline()&&(m=m.getParent()),m!==null&&te(d)&&!g.has(d.getKey())){let $=m.getKey();if(a.get($)===void 0){let T=n();T.setFormat(m.getFormatType()),T.setIndent(m.getIndent()),r.push(T),a.set($,T),m.getChildren().forEach(P=>{T.append(P),g.add(P.getKey()),S(P)&&P.getChildrenKeys().forEach(he=>g.add(he))}),Pe(m)}}else if(u.has(d.getKey())){S(d)||D(179);let $=n();$.setFormat(d.getFormatType()),$.setIndent(d.getIndent()),r.push($),d.remove(!0)}}if(s!==null)for(let f=0;f<r.length;f++){let d=r[f];s.append(d)}let p=null;if(N(i))if(c)if(s!==null)i.insertAfter(s);else for(let f=r.length-1;f>=0;f--){let d=r[f];i.insertAfter(d)}else{let f=i.getFirstChild();if(S(f)&&(i=f),f===null)if(s)i.append(s);else for(let d=0;d<r.length;d++){let m=r[d];i.append(m),p=m}else if(s!==null)f.insertBefore(s);else for(let d=0;d<r.length;d++){let m=r[d];f.insertBefore(m),p=m}}else if(s)i.insertAfter(s);else for(let f=r.length-1;f>=0;f--){let d=r[f];i.insertAfter(d),p=d}let h=k();C(h)&&se(h.anchor)&&se(h.focus)?I(h.clone()):p!==null?p.selectEnd():t.dirty=!0}function ue(t){let e=ge(t);return e!==null&&e.writingMode==="vertical-rl"}function ge(t){let e=t.anchor.getNode();return S(e)?L(e):M(e)}function Ee(t,e){let l=ue(t)?!e:e;z(t)&&(l=!l);let n=j(t.focus,l?"previous":"next");if(ee(n))return!1;for(let s of X(n)){if(Y(s))return!s.origin.isInline();if(!S(s.origin)){if(Z(s.origin))return!0;break}}return!1}function pe(t,e,l,n){t.modify(e?"extend":"move",l,n)}function z(t){let e=ge(t);return e!==null&&e.direction==="rtl"}function Re(t,e,l){let n=z(t),s;s=ue(t)||n?!l:l,pe(t,e,s,"character")}function we(t,e,l){let n=w(t.getStyle());return n!==null&&n[e]||l}function Oe(t,e,l=""){let n=null,s=t.getNodes(),o=t.anchor,a=t.focus,r=t.isBackward(),i=r?a.getNode():o.getNode(),c=r?o.getNode():a.getNode(),u=r?a.offset:o.offset,g=r?o.offset:a.offset;if(C(t)&&t.isCollapsed()&&t.style!==""){let p=w(t.style);if(p!==null&&e in p)return p[e]}for(let p=0;p<s.length;p++){let h=s[p];if((p!==0||!h.is(i)||!x(h)||u!==h.getTextContentSize())&&(p===0||!h.is(c)||g!==0)&&x(h)){let f=we(h,e,l);if(n===null)n=f;else if(n!==f){n="";break}}}return n===null?l:n}var ke=ce;var y=_,Ae=y.$addNodeStyle,Ie=y.$cloneWithProperties,be=y.$copyBlockFormatIndent,De=y.$ensureForwardRangeSelection,Le=y.$forEachSelectedTextNode,Me=y.$getComputedStyleForElement,ze=y.$getComputedStyleForParent,_e=y.$getSelectionStyleValueForProperty,je=y.$isAtNodeEnd,Ve=y.$isParentElementRTL,We=y.$isParentRTL,Ue=y.$moveCaretSelection,He=y.$moveCharacter,Xe=y.$patchStyleText,qe=y.$selectAll,Ge=y.$setBlocksType,Je=y.$shouldOverrideDefaultCharacterSelection,Qe=y.$sliceSelectedTextNodeContent,Ye=y.$trimTextContentFromAnchor,Ze=y.$wrapNodes,et=y.createDOMRange,tt=y.createRectsFromDOMRange,nt=y.getCSSFromStyleObject,ot=y.getStyleObjectFromCSS,rt=y.trimTextContentFromAnchor;export{Ae as a,Ie as b,be as c,De as d,Le as e,Me as f,ze as g,_e as h,je as i,Ve as j,We as k,Ue as l,He as m,Xe as n,qe as o,Ge as p,Je as q,Qe as r,Ye as s,Ze as t,et as u,tt as v,nt as w,ot as x,rt as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as v,o as _}from"/kempo/vendor/lexical/chunks/chunk-PZQA5MC4.js";import{r as H}from"/kempo/vendor/lexical/chunks/chunk-FYATIV3K.js";import{Gc as T,Na as $,Nc as A,Q as M,Rc as y,Vc as S,b as W,ba as D,fa as N,m as w,o as b,pa as O,sa as E}from"/kempo/vendor/lexical/chunks/chunk-ZMJQPFLE.js";var C={};W(C,{$generateHtmlFromNodes:()=>J,$generateNodesFromDOM:()=>z});function z(r,o){let c=A(o)?o.body.childNodes:o.childNodes,l=[],s=[];for(let i of c)if(!R.has(i.nodeName)){let e=k(i,r,s,!1);e!==null&&(l=l.concat(e))}return(function(i){for(let e of i)e.getNextSibling()instanceof $&&e.insertAfter(w());for(let e of i){let t=e.getChildren();for(let d of t)e.insertBefore(d);e.remove()}})(s),l}function J(r,o){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.");let c=document.createElement("div"),l=M().getChildren();for(let s=0;s<l.length;s++)L(r,l[s],c,o);return c.innerHTML}function L(r,o,c,l=null){let s=l===null||o.isSelected(l),i=N(o)&&o.excludeFromCopy("html"),e=o;l!==null&&E(o)&&(e=H(l,o,"clone"));let t=N(e)?e.getChildren():[],d=T(r,e.getType()),u;u=d&&d.exportDOM!==void 0?d.exportDOM(r,e):e.exportDOM(r);let{element:a,after:p}=u;if(!a)return!1;let m=document.createDocumentFragment();for(let f=0;f<t.length;f++){let n=t[f],h=L(r,n,m,l);!s&&N(o)&&h&&o.extractWithChild(n,l,"html")&&(s=!0)}if(s&&!i){if((_(a)||y(a))&&a.append(m),c.append(a),p){let f=p.call(e,a);f&&(y(a)?a.replaceChildren(f):a.replaceWith(f))}}else c.append(m);return s}var R=new Set(["STYLE","SCRIPT"]);function k(r,o,c,l,s=new Map,i){let e=[];if(R.has(r.nodeName))return e;let t=null,d=(function(n,h){let{nodeName:P}=n,F=h._htmlConversions.get(P.toLowerCase()),g=null;if(F!==void 0)for(let I of F){let x=I(n);x!==null&&(g===null||(g.priority||0)<=(x.priority||0))&&(g=x)}return g!==null?g.conversion:null})(r,o),u=d?d(r):null,a=null;if(u!==null){a=u.after;let n=u.node;if(t=Array.isArray(n)?n[n.length-1]:n,t!==null){for(let[,h]of s)if(t=h(t,i),!t)break;t&&e.push(...Array.isArray(n)?n:[t])}u.forChild!=null&&s.set(r.nodeName,u.forChild)}let p=r.childNodes,m=[],f=(t==null||!O(t))&&(t!=null&&D(t)||l);for(let n=0;n<p.length;n++)m.push(...k(p[n],o,c,f,new Map(s),t));return a!=null&&(m=a(m)),v(r)&&(m=U(r,m,f?()=>{let n=new $;return c.push(n),n}:b)),t==null?m.length>0?e=e.concat(m):v(r)&&(function(n){return n.nextSibling==null||n.previousSibling==null?!1:S(n.nextSibling)&&S(n.previousSibling)})(r)&&(e=e.concat(w())):N(t)&&t.append(...m),e}function U(r,o,c){let l=r.style.textAlign,s=[],i=[];for(let e=0;e<o.length;e++){let t=o[e];if(D(t))l&&!t.getFormat()&&t.setFormat(l),s.push(t);else if(i.push(t),e===o.length-1||e<o.length-1&&D(o[e+1])){let d=c();d.setFormat(l),d.append(...i),s.push(d),i=[]}}return s}var B=C,q=B.$generateHtmlFromNodes,G=B.$generateNodesFromDOM;export{q as a,G as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as Ie}from"/kempo/vendor/lexical/chunks/chunk-FYATIV3K.js";import{$c as b,A as re,B as se,Ca as ue,D as y,Da as ge,Dc as Ne,F as U,G as ie,Ha as fe,Ia as V,Ja as pe,Ka as X,La as me,Lc as he,P as ae,Q as W,R as T,S as I,T as le,Tc as Se,Uc as L,Vc as Ee,_c as Z,b as We,bd as xe,ca as z,f as te,fa as C,g as ne,h as oe,na as D,o as H,qa as ce,qc as $e,ta as q,v as P,w as j,y as O,ya as de,z as K}from"/kempo/vendor/lexical/chunks/chunk-ZMJQPFLE.js";var ee={};We(ee,{$descendantsMatching:()=>wt,$dfs:()=>dt,$dfsIterator:()=>Pe,$filter:()=>At,$findMatchingParent:()=>P,$firstToLastIterator:()=>yt,$getAdjacentCaret:()=>ut,$getAdjacentSiblingOrParentSiblingCaret:()=>O,$getDepth:()=>De,$getNearestBlockElementAncestorOrThrow:()=>$t,$getNearestNodeOfType:()=>mt,$getNextRightPreorderNode:()=>pt,$getNextSiblingOrParentSibling:()=>ft,$handleIndentAndOutdent:()=>Ct,$insertFirst:()=>Rt,$insertNodeIntoLeaf:()=>Et,$insertNodeToNearestRoot:()=>St,$insertNodeToNearestRootAtCaret:()=>Fe,$isEditorIsNestedEditor:()=>_t,$lastToFirstIterator:()=>Y,$restoreEditorState:()=>ht,$reverseDfs:()=>gt,$reverseDfsIterator:()=>Me,$splitNode:()=>me,$unwrapAndFilterDescendants:()=>Ot,$unwrapNode:()=>Pt,$wrapNodeInElement:()=>xt,CAN_USE_BEFORE_INPUT:()=>tt,CAN_USE_DOM:()=>Oe,IS_ANDROID:()=>nt,IS_ANDROID_CHROME:()=>ot,IS_APPLE:()=>rt,IS_APPLE_WEBKIT:()=>st,IS_CHROME:()=>it,IS_FIREFOX:()=>we,IS_IOS:()=>at,IS_SAFARI:()=>lt,addClassNamesToElement:()=>$e,calculateZoomLevel:()=>vt,isBlockDomNode:()=>he,isHTMLAnchorElement:()=>Se,isHTMLElement:()=>L,isInlineDomNode:()=>Ee,isMimeType:()=>ye,makeStateWrapper:()=>Tt,markSelection:()=>_e,mediaFileReader:()=>ct,mergeRegister:()=>b,objectKlassEquals:()=>It,positionNodeOnRange:()=>ve,registerNestedElementResolver:()=>Nt,removeClassNamesFromElement:()=>xe,selectionAlwaysOnDisplay:()=>et});function B(e,...n){let t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(let o of n)r.append("v",o);throw t.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var h=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ze=h&&"documentMode"in document?document.documentMode:null,Re=h&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),qe=h&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ve=!(!h||!("InputEvent"in window)||ze)&&"getTargetRanges"in new window.InputEvent("input"),Xe=h&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,J=h&&/Android/.test(navigator.userAgent),Ze=h&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!J,Q=h&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ge=h&&J&&Q,Je=h&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Re&&!Q;function E(e){return`${e}px`}var Qe={attributes:!0,characterData:!0,childList:!0,subtree:!0};function ve(e,n,t){let r=null,o=null,i=null,c=[],a=document.createElement("div");function d(){r===null&&B(182),o===null&&B(183);let{left:g,top:f}=o.getBoundingClientRect(),$=Ie(e,n);var A,x;a.isConnected||(x=a,(A=o).insertBefore(x,A.firstChild));let p=!1;for(let N=0;N<$.length;N++){let R=$[N],S=c[N]||document.createElement("div"),m=S.style;m.position!=="absolute"&&(m.position="absolute",p=!0);let v=E(R.left-g);m.left!==v&&(m.left=v,p=!0);let M=E(R.top-f);m.top!==M&&(S.style.top=M,p=!0);let F=E(R.width);m.width!==F&&(S.style.width=F,p=!0);let _=E(R.height);m.height!==_&&(S.style.height=_,p=!0),S.parentNode!==a&&(a.append(S),p=!0),c[N]=S}for(;c.length>$.length;)c.pop();p&&t(c)}function l(){o=null,r=null,i!==null&&i.disconnect(),i=null,a.remove();for(let g of c)g.remove();c=[]}a.style.position="relative";let u=e.registerRootListener(function g(){let f=e.getRootElement();if(f===null)return l();let $=f.parentElement;if(!L($))return l();l(),r=f,o=$,i=new MutationObserver(A=>{let x=e.getRootElement(),p=x&&x.parentElement;if(x!==r||p!==o)return g();for(let N of A)if(!a.contains(N.target))return d()}),i.observe($,Qe),d()});return()=>{u(),l()}}function Ae(e,n,t){if(e.type!=="text"&&C(n)){let r=n.getDOMSlot(t);return[r.element,r.getFirstChildOffset()+e.offset]}return[Ne(t)||t,e.offset]}function Ye(e){for(let n of e){let t=n.style;t.background!=="Highlight"&&(t.background="Highlight"),t.color!=="HighlightText"&&(t.color="HighlightText"),t.marginTop!==E(-1.5)&&(t.marginTop=E(-1.5)),t.paddingTop!==E(4)&&(t.paddingTop=E(4)),t.paddingBottom!==E(0)&&(t.paddingBottom=E(0))}}function _e(e,n=Ye){let t=null,r=null,o=null,i=null,c=null,a=null,d=()=>{};function l(u){u.read(()=>{let g=T();if(!D(g))return t=null,o=null,i=null,a=null,d(),void(d=()=>{});let[f,$]=(function(_){let w=_.getStartEndPoints();return _.isBackward()?[w[1],w[0]]:w})(g),A=f.getNode(),x=A.getKey(),p=f.offset,N=$.getNode(),R=N.getKey(),S=$.offset,m=e.getElementByKey(x),v=e.getElementByKey(R),M=t===null||m!==r||p!==o||x!==t.getKey(),F=i===null||v!==c||S!==a||R!==i.getKey();if((M||F)&&m!==null&&v!==null){let _=(function(w,Be,ke,He,je,Ke,Ue){let k=(w._window?w._window.document:document).createRange();return k.setStart(...Ae(Be,ke,He)),k.setEnd(...Ae(je,Ke,Ue)),k})(e,f,A,m,$,N,v);d(),d=ve(e,_,n)}t=A,r=m,o=p,i=N,c=v,a=S})}return l(e.getEditorState()),b(e.registerUpdateListener(({editorState:u})=>l(u)),()=>{d()})}function et(e,n){let t=null,r=()=>{let o=getSelection(),i=o&&o.anchorNode,c=e.getRootElement();i!==null&&c!==null&&c.contains(i)?t!==null&&(t(),t=null):t===null&&(t=_e(e,n))};return e.registerRootListener(o=>{if(o){let i=o.ownerDocument;return i.addEventListener("selectionchange",r),r(),()=>{t!==null&&t(),i.removeEventListener("selectionchange",r)}}})}var tt=Ve,Oe=h,nt=J,ot=Ge,rt=Re,st=Je,it=Q,we=qe,at=Xe,lt=Ze;function ye(e,n){for(let t of n)if(e.type.startsWith(t))return!0;return!1}function ct(e,n){let t=e[Symbol.iterator]();return new Promise((r,o)=>{let i=[],c=()=>{let{done:a,value:d}=t.next();if(a)return r(i);let l=new FileReader;l.addEventListener("error",o),l.addEventListener("load",()=>{let u=l.result;typeof u=="string"&&i.push({file:d,result:u}),c()}),ye(d,n)?l.readAsDataURL(d):c()};c()})}function dt(e,n){return Array.from(Pe(e,n))}function ut(e){return e?e.getAdjacentCaret():null}function gt(e,n){return Array.from(Me(e,n))}function Pe(e,n){return Te("next",e,n)}function Ce(e,n){let t=O(I(e,n));return t&&t[0]}function Te(e,n,t){let r=W(),o=n||r,i=C(o)?y(o,e):I(o,e),c=De(o),a=t?j(U(I(t,e)))||Ce(t,e):Ce(o,e),d=c;return Z({hasNext:l=>l!==null,initial:i,map:l=>({depth:d,node:l.origin}),step:l=>{if(l.isSameNodeCaret(a))return null;z(l)&&d++;let u=O(l);return!u||u[0].isSameNodeCaret(a)?null:(d+=u[1],u[0])}})}function ft(e){let n=O(I(e,"next"));return n&&[n[0].origin,n[1]]}function De(e){let n=-1;for(let t=e;t!==null;t=t.getParent())n++;return n}function pt(e){let n=U(I(e,"previous")),t=O(n,"root");return t&&t[0].origin}function Me(e,n){return Te("previous",e,n)}function mt(e,n){let t=e;for(;t!=null;){if(t instanceof n)return t;t=t.getParent()}return null}function $t(e){let n=P(e,t=>C(t)&&!t.isInline());return C(n)||B(4,e.__key),n}function Nt(e,n,t,r){let o=i=>i instanceof n;return e.registerNodeTransform(n,i=>{let c=(a=>{let d=a.getChildren();for(let g=0;g<d.length;g++){let f=d[g];if(o(f))return null}let l=a,u=a;for(;l!==null;)if(u=l,l=l.getParent(),o(l))return{child:u,parent:l};return null})(i);if(c!==null){let{child:a,parent:d}=c;if(a.is(i)){r(d,i);let l=a.getNextSiblings(),u=l.length;if(d.insertAfter(a),u!==0){let g=t(d);a.insertAfter(g);for(let f=0;f<u;f++)g.append(l[f])}d.canBeEmpty()||d.getChildrenSize()!==0||d.remove()}}})}function ht(e,n){let t=new Map,r=e._pendingEditorState;for(let[i,c]of n._nodeMap)t.set(i,oe(c));r&&(r._nodeMap=t),e._dirtyType=2;let o=n._selection;fe(o===null?null:o.clone())}function St(e){let n=T()||ae(),t;if(D(n))t=te(n.focus,"next");else{if(n!=null){let c=n.getNodes(),a=c[c.length-1];a&&(t=I(a,"next"))}t=t||y(W(),"previous").getFlipped().insert(H())}let r=Fe(e,t),o=j(r),i=z(o)?de(o):r;return V(ie(i)),e.getLatest()}function Fe(e,n,t){let r=K(n,"next");for(let o=r;o;o=X(o,t))r=o;return q(r)&&B(283),r.insert(e.isInline()?H().append(e):e),K(I(e.getLatest(),"next"),n.direction)}function Et(e){let n=T();if(!D(n))return void(n&&n.insertNodes([e]));let t=ne(n),r=se(ue(t),"next").anchor;if(q(r)){let i=X(r);if(!i)return;r=i}let o=r.getFlipped();o.insert(e),V(re(o,o))}function xt(e,n){let t=n();return e.replace(t),t.append(e),t}function It(e,n){return e!==null&&Object.getPrototypeOf(e).constructor.name===n.name}function At(e,n){let t=[];for(let r=0;r<e.length;r++){let o=n(e[r]);o!==null&&t.push(o)}return t}function Ct(e){let n=T();if(!D(n))return!1;let t=new Set,r=n.getNodes();for(let o=0;o<r.length;o++){let i=r[o],c=i.getKey();if(t.has(c))continue;let a=P(i,l=>C(l)&&!l.isInline());if(a===null)continue;let d=a.getKey();a.canIndent()&&!t.has(d)&&(t.add(d),e(a))}return t.size>0}function Rt(e,n){y(e,"next").insert(n)}var G=!(we||!Oe)&&void 0;function vt(e,n=!1){let t=1;if((function(){if(G===void 0){let r=document.createElement("div");r.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(r);let o=r.getBoundingClientRect();r.style.setProperty("zoom","2"),G=r.getBoundingClientRect().width===o.width,document.body.removeChild(r)}return G})()||n)for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return t}function _t(e){return e._parentEditor!==null}function Ot(e,n){return Le(e,n,null)}function Le(e,n,t){let r=!1;for(let o of Y(e))n(o)?t!==null&&t(o):(r=!0,C(o)&&Le(o,n,t||(i=>o.insertAfter(i))),o.remove());return r}function wt(e,n){let t=[],r=Array.from(e).reverse();for(let o=r.pop();o!==void 0;o=r.pop())if(n(o))t.push(o);else if(C(o))for(let i of Y(o))r.push(i);return t}function yt(e){return be(y(e,"next"))}function Y(e){return be(y(e,"previous"))}function be(e){return Z({hasNext:ce,initial:e.getAdjacentCaret(),map:n=>n.origin.getLatest(),step:n=>n.getAdjacentCaret()})}function Pt(e){ge(I(e,"next")).splice(1,e.getChildren())}function Tt(e){let n=r=>le(r,e),t=(r,o)=>pe(r,e,o);return{$get:n,$set:t,accessors:[n,t],makeGetterMethod:()=>function(){return n(this)},makeSetterMethod:()=>function(r){return t(this,r)},stateConfig:e}}var s=ee,Lt=s.$descendantsMatching,bt=s.$dfs,Bt=s.$dfsIterator,kt=s.$filter,Ht=s.$findMatchingParent,jt=s.$firstToLastIterator,Kt=s.$getAdjacentCaret,Ut=s.$getAdjacentSiblingOrParentSiblingCaret,Wt=s.$getDepth,zt=s.$getNearestBlockElementAncestorOrThrow,qt=s.$getNearestNodeOfType,Vt=s.$getNextRightPreorderNode,Xt=s.$getNextSiblingOrParentSibling,Zt=s.$handleIndentAndOutdent,Gt=s.$insertFirst,Jt=s.$insertNodeIntoLeaf,Qt=s.$insertNodeToNearestRoot,Yt=s.$insertNodeToNearestRootAtCaret,en=s.$isEditorIsNestedEditor,tn=s.$lastToFirstIterator,nn=s.$restoreEditorState,on=s.$reverseDfs,rn=s.$reverseDfsIterator,sn=s.$splitNode,an=s.$unwrapAndFilterDescendants,ln=s.$unwrapNode,cn=s.$wrapNodeInElement,dn=s.CAN_USE_BEFORE_INPUT,un=s.CAN_USE_DOM,gn=s.IS_ANDROID,fn=s.IS_ANDROID_CHROME,pn=s.IS_APPLE,mn=s.IS_APPLE_WEBKIT,$n=s.IS_CHROME,Nn=s.IS_FIREFOX,hn=s.IS_IOS,Sn=s.IS_SAFARI,En=s.addClassNamesToElement,xn=s.calculateZoomLevel,In=s.isBlockDomNode,An=s.isHTMLAnchorElement,Cn=s.isHTMLElement,Rn=s.isInlineDomNode,vn=s.isMimeType,_n=s.makeStateWrapper,On=s.markSelection,wn=s.mediaFileReader,yn=s.mergeRegister,Pn=s.objectKlassEquals,Tn=s.positionNodeOnRange,Dn=s.registerNestedElementResolver,Mn=s.removeClassNamesFromElement,Fn=s.selectionAlwaysOnDisplay;export{Lt as a,bt as b,Ht as c,zt as d,qt as e,Zt as f,Gt as g,Qt as h,Yt as i,an as j,En as k,xn as l,In as m,An as n,Cn as o,yn as p,Pn as q,Mn as r,Fn as s};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var Zs=Object.create;var Vn=Object.defineProperty;var el=Object.getOwnPropertyDescriptor;var tl=Object.getOwnPropertyNames;var nl=Object.getPrototypeOf,rl=Object.prototype.hasOwnProperty;var cc=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},ol=(t,e)=>{for(var n in e)Vn(t,n,{get:e[n],enumerable:!0})},il=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of tl(e))!rl.call(t,o)&&o!==n&&Vn(t,o,{get:()=>e[o],enumerable:!(r=el(e,o))||r.enumerable});return t};var uc=(t,e,n)=>(n=t!=null?Zs(nl(t)):{},il(e||!t||!t.__esModule?Vn(n,"default",{value:t,enumerable:!0}):n,t));var So={};ol(So,{$addUpdateTag:()=>zn,$applyNodeReplacement:()=>en,$caretFromPoint:()=>We,$caretRangeFromSelection:()=>Pr,$cloneWithProperties:()=>po,$cloneWithPropertiesEphemeral:()=>za,$comparePointCaretNext:()=>No,$copyNode:()=>ho,$create:()=>Ya,$createLineBreakNode:()=>ft,$createNodeSelection:()=>Qr,$createParagraphNode:()=>Ae,$createPoint:()=>ge,$createRangeSelection:()=>_s,$createRangeSelectionFromDom:()=>pa,$createTabNode:()=>Ln,$createTextNode:()=>G,$extendCaretToRange:()=>yo,$findMatchingParent:()=>wt,$getAdjacentChildCaret:()=>Nt,$getAdjacentNode:()=>Ls,$getAdjacentSiblingOrParentSiblingCaret:()=>Qa,$getCaretInDirection:()=>ze,$getCaretRange:()=>Be,$getCaretRangeInDirection:()=>To,$getCharacterOffsets:()=>Er,$getChildCaret:()=>ve,$getChildCaretAtIndex:()=>qs,$getChildCaretOrSelf:()=>Hs,$getCollapsedCaretRange:()=>Vs,$getCommonAncestor:()=>Lt,$getCommonAncestorResultBranchOrder:()=>xo,$getEditor:()=>_o,$getNearestNodeFromDOMNode:()=>Wn,$getNearestRootOrShadowRoot:()=>Ks,$getNodeByKey:()=>Y,$getNodeByKeyOrThrow:()=>Bs,$getNodeFromDOMNode:()=>so,$getPreviousSelection:()=>tt,$getRoot:()=>oe,$getSelection:()=>w,$getSiblingCaret:()=>X,$getState:()=>_n,$getStateChange:()=>Ll,$getTextContent:()=>Ca,$getTextNodeOffset:()=>fe,$getTextPointCaret:()=>Ke,$getTextPointCaretSlice:()=>Ir,$getWritableNodeState:()=>Fr,$hasAncestor:()=>kn,$hasUpdateTag:()=>$a,$insertNodes:()=>ya,$isBlockElementNode:()=>_a,$isChildCaret:()=>de,$isDecoratorNode:()=>W,$isEditorState:()=>Sa,$isElementNode:()=>x,$isExtendableTextPointCaret:()=>Xs,$isInlineElementOrDecoratorNode:()=>Fa,$isLeafNode:()=>Pa,$isLineBreakNode:()=>je,$isNodeCaret:()=>Va,$isNodeSelection:()=>Xt,$isParagraphNode:()=>Ss,$isRangeSelection:()=>I,$isRootNode:()=>q,$isRootOrShadowRoot:()=>le,$isSiblingCaret:()=>et,$isTabNode:()=>qr,$isTextNode:()=>k,$isTextPointCaret:()=>De,$isTextPointCaretSlice:()=>qa,$isTokenOrSegmented:()=>Oe,$isTokenOrTab:()=>Pe,$nodesOfType:()=>La,$normalizeCaret:()=>ce,$normalizeSelection__EXPERIMENTAL:()=>pn,$onUpdate:()=>Fs,$parseSerializedNode:()=>Ta,$removeTextFromCaretRange:()=>Js,$rewindSiblingCaret:()=>Ot,$selectAll:()=>wa,$setCompositionKey:()=>V,$setPointFromCaret:()=>xt,$setSelection:()=>re,$setSelectionFromCaretRange:()=>js,$setState:()=>$l,$splitAtPointCaretNext:()=>tc,$splitNode:()=>Ka,$updateRangeSelectionFromCaretRange:()=>$t,ArtificialNode__DO_NOT_USE:()=>Dn,BEFORE_INPUT_COMMAND:()=>Br,BLUR_COMMAND:()=>ji,CAN_REDO_COMMAND:()=>Jl,CAN_UNDO_COMMAND:()=>Xl,CLEAR_EDITOR_COMMAND:()=>Vl,CLEAR_HISTORY_COMMAND:()=>jl,CLICK_COMMAND:()=>bi,COLLABORATION_TAG:()=>is,COMMAND_PRIORITY_CRITICAL:()=>Da,COMMAND_PRIORITY_EDITOR:()=>st,COMMAND_PRIORITY_HIGH:()=>Aa,COMMAND_PRIORITY_LOW:()=>Ma,COMMAND_PRIORITY_NORMAL:()=>Ea,COMPOSITION_END_COMMAND:()=>Ur,COMPOSITION_END_TAG:()=>cs,COMPOSITION_START_COMMAND:()=>zr,COMPOSITION_START_TAG:()=>as,CONTROLLED_TEXT_INSERTION_COMMAND:()=>at,COPY_COMMAND:()=>jr,CUT_COMMAND:()=>Jr,DELETE_CHARACTER_COMMAND:()=>Wt,DELETE_LINE_COMMAND:()=>Ut,DELETE_WORD_COMMAND:()=>zt,DRAGEND_COMMAND:()=>Hi,DRAGOVER_COMMAND:()=>Gi,DRAGSTART_COMMAND:()=>Yi,DROP_COMMAND:()=>Ui,DecoratorNode:()=>Gt,ElementNode:()=>$e,FOCUS_COMMAND:()=>Vi,FORMAT_ELEMENT_COMMAND:()=>Hl,FORMAT_TEXT_COMMAND:()=>Ie,HISTORIC_TAG:()=>oa,HISTORY_MERGE_TAG:()=>fn,HISTORY_PUSH_TAG:()=>ia,INDENT_CONTENT_COMMAND:()=>Yl,INPUT_COMMAND:()=>Wr,INSERT_LINE_BREAK_COMMAND:()=>It,INSERT_PARAGRAPH_COMMAND:()=>pr,INSERT_TAB_COMMAND:()=>Ul,INTERNAL_$isBlock:()=>Ee,IS_ALL_FORMATTING:()=>ml,IS_BOLD:()=>ul,IS_CODE:()=>hl,IS_HIGHLIGHT:()=>wr,IS_ITALIC:()=>dl,IS_STRIKETHROUGH:()=>fl,IS_SUBSCRIPT:()=>_l,IS_SUPERSCRIPT:()=>pl,IS_UNDERLINE:()=>gl,KEY_ARROW_DOWN_COMMAND:()=>$i,KEY_ARROW_LEFT_COMMAND:()=>Pi,KEY_ARROW_RIGHT_COMMAND:()=>Ii,KEY_ARROW_UP_COMMAND:()=>Li,KEY_BACKSPACE_COMMAND:()=>Ki,KEY_DELETE_COMMAND:()=>Wi,KEY_DOWN_COMMAND:()=>Vr,KEY_ENTER_COMMAND:()=>xn,KEY_ESCAPE_COMMAND:()=>Bi,KEY_MODIFIER_COMMAND:()=>Ji,KEY_SPACE_COMMAND:()=>Fi,KEY_TAB_COMMAND:()=>zi,LineBreakNode:()=>dt,MOVE_TO_END:()=>Ri,MOVE_TO_START:()=>wi,NODE_STATE_KEY:()=>kl,OUTDENT_CONTENT_COMMAND:()=>Gl,PASTE_COMMAND:()=>Yr,PASTE_TAG:()=>sa,ParagraphNode:()=>_t,REDO_COMMAND:()=>Hr,REMOVE_TEXT_COMMAND:()=>mr,RootNode:()=>ht,SELECTION_CHANGE_COMMAND:()=>Kr,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>zl,SELECT_ALL_COMMAND:()=>yr,SKIP_COLLAB_TAG:()=>la,SKIP_DOM_SELECTION_TAG:()=>ls,SKIP_SCROLL_INTO_VIEW_TAG:()=>ss,SKIP_SELECTION_FOCUS_TAG:()=>Or,TEXT_TYPE_TO_FORMAT:()=>Z,TabNode:()=>gt,TextNode:()=>qe,UNDO_COMMAND:()=>Gr,addClassNamesToElement:()=>lc,buildImportMap:()=>ra,configExtension:()=>rc,createCommand:()=>R,createEditor:()=>va,createSharedNodeState:()=>Mi,createState:()=>wl,declarePeerDependency:()=>oc,defineExtension:()=>nc,flipDirection:()=>Ue,getDOMOwnerDocument:()=>fo,getDOMSelection:()=>_e,getDOMSelectionFromTarget:()=>Ws,getDOMTextNode:()=>Ze,getEditorPropertyFromDOMNode:()=>Qt,getNearestEditorFromDOMNode:()=>io,getRegisteredNode:()=>ro,getRegisteredNodeOrThrow:()=>no,getStaticNodeConfig:()=>tn,getTextDirection:()=>Ra,getTransformSetFromKlass:()=>Ms,isBlockDomNode:()=>kr,isCurrentlyReadOnlyMode:()=>Tt,isDOMDocumentNode:()=>Ds,isDOMNode:()=>St,isDOMTextNode:()=>Ce,isDOMUnmanaged:()=>Gs,isDocumentFragment:()=>zs,isExactShortcutMatch:()=>F,isHTMLAnchorElement:()=>Ba,isHTMLElement:()=>ee,isInlineDomNode:()=>Us,isLexicalEditor:()=>Kn,isModifierMatch:()=>ws,isSelectionCapturedInDecoratorInput:()=>oo,isSelectionWithinEditor:()=>qt,makeStepwiseIterator:()=>Co,mergeRegister:()=>Qs,normalizeClassNames:()=>nn,removeClassNamesFromElement:()=>ac,removeFromParent:()=>we,resetRandomKey:()=>ba,safeCast:()=>ic,setDOMUnmanaged:()=>Ua,setNodeIndentFromDOM:()=>Ys,shallowMergeConfig:()=>sc,toggleTextFormatType:()=>Vt});function O(t,...e){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(let o of e)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function pi(t,...e){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(let o of e)r.append("v",o);n.search=r.toString(),console.warn(`Minified Lexical warning #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var he=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,sl=he&&"documentMode"in document?document.documentMode:null,ae=he&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Le=he&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),hn=!(!he||!("InputEvent"in window)||sl)&&"getTargetRanges"in new window.InputEvent("input"),Jt=he&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,mi=he&&/Android/.test(navigator.userAgent),In=he&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!mi,yi=he&&/^(?=.*Chrome).*/i.test(navigator.userAgent),or=he&&mi&&yi,Rn=he&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&ae&&!yi,ll=0,al=1,cl=2,ul=1,dl=2,fl=4,gl=8,hl=16,_l=32,pl=64,wr=128,ml=2047,yl=1,Cl=2,Nl=3,xl=4,Tl=5,Sl=6,Ft=In||Jt||Rn?"\xA0":"\u200B",Pn=`
|
|
2
|
+
|
|
3
|
+
`,Lr=Le?"\xA0":Ft,Ci="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Ni="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Ol=new RegExp("^[^"+Ni+"]*["+Ci+"]"),Ml=new RegExp("^[^"+Ci+"]*["+Ni+"]"),Z={bold:1,capitalize:1024,code:16,highlight:wr,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},El={directionless:1,unmergeable:2},ir={center:2,end:6,justify:4,left:1,right:3,start:5},Al={[Cl]:"center",[Sl]:"end",[xl]:"justify",[yl]:"left",[Nl]:"right",[Tl]:"start"},Dl={normal:0,segmented:2,token:1},vl={[ll]:"normal",[cl]:"segmented",[al]:"token"},kl="$",Mo="$config";function xi(t,e,n,r,o,i){let s=t.getFirstChild();for(;s!==null;){let l=s.__key;s.__parent===e&&(x(s)&&xi(s,l,n,r,o,i),n.has(l)||i.delete(l),o.push(l)),s=s.getNextSibling()}}var sr=!1,$r=0;function bl(t){$r=t.timeStamp}function jn(t,e,n){let r=t.nodeName==="BR",o=e.__lexicalLineBreak;return o&&(t===o||r&&t.previousSibling===o)||r&&Bn(t,n)!==void 0}function Il(t,e,n){let r=_e(ie(n)),o=null,i=null;r!==null&&r.anchorNode===t&&(o=r.anchorOffset,i=r.focusOffset);let s=t.nodeValue;s!==null&&co(e,s,o,i,!1)}function Rl(t,e,n){if(I(t)){let r=t.anchor.getNode();if(r.is(n)&&t.format!==r.getFormat())return!1}return Ce(e)&&n.isAttached()}function Pl(t,e,n,r){for(let o=t;o&&!Gs(o);o=Zt(o)){let i=Bn(o,e);if(i!==void 0){let s=Y(i,n);if(s)return W(s)||!ee(o)?void 0:[o,s]}else if(o===r)return[r,bs(n)]}}function Ti(t,e,n){sr=!0;let r=performance.now()-$r>100;try{ye(t,()=>{let o=w()||(function(d){return d.getEditorState().read(()=>{let p=w();return p!==null?p.clone():null})})(t),i=new Map,s=t.getRootElement(),l=t._editorState,a=t._blockCursorElement,c=!1,u="";for(let d=0;d<e.length;d++){let p=e[d],h=p.type,m=p.target,_=Pl(m,t,l,s);if(!_)continue;let[y,C]=_;if(h==="characterData")r&&k(C)&&Ce(m)&&Rl(o,m,C)&&Il(m,C,t);else if(h==="childList"){c=!0;let N=p.addedNodes;for(let S=0;S<N.length;S++){let D=N[S],M=so(D),T=D.parentNode;if(T!=null&&D!==a&&M===null&&!jn(D,T,t)){if(Le){let b=(ee(D)?D.innerText:null)||D.nodeValue;b&&(u+=b)}T.removeChild(D)}}let E=p.removedNodes,A=E.length;if(A>0){let S=0;for(let D=0;D<A;D++){let M=E[D];(jn(M,m,t)||a===M)&&(m.appendChild(M),S++)}A!==S&&i.set(y,C)}}}if(i.size>0)for(let[d,p]of i)p.reconcileObservedMutation(d,t);let g=n.takeRecords();if(g.length>0){for(let d=0;d<g.length;d++){let p=g[d],h=p.addedNodes,m=p.target;for(let _=0;_<h.length;_++){let y=h[_],C=y.parentNode;C==null||y.nodeName!=="BR"||jn(y,m,t)||C.removeChild(y)}}n.takeRecords()}o!==null&&(c&&re(o),Le&&$s(t)&&o.insertRawText(u))})}finally{sr=!1}}function Si(t){let e=t._observer;e!==null&&Ti(t,e.takeRecords(),e)}function Oi(t){(function(e){$r===0&&ie(e).addEventListener("textInput",bl,!0)})(t),t._observer=new MutationObserver((e,n)=>{Ti(t,e,n)})}var lr=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,n){this.key=e,this.parse=n.parse.bind(n),this.unparse=(n.unparse||Fl).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=n.resetOnCopyNode||!1}};function wl(t,e){return new lr(t,e)}function _n(t,e,n="latest"){let r=(n==="latest"?t.getLatest():t).__state;return r?r.getValue(e):e.defaultValue}function Ll(t,e,n){let r=_n(t,n,"direct"),o=_n(e,n,"direct");return n.isEqual(r,o)?null:[r,o]}function $l(t,e,n){let r;if(H(),typeof n=="function"){let i=t.getLatest(),s=_n(i,e);if(r=n(s),e.isEqual(s,r))return i}else r=n;let o=t.getWritable();return Fr(o).updateFromKnown(e,r),o}function Mi(t){let e=new Map,n=new Set;for(let r=typeof t=="function"?t:t.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:o}=tn(r);if(o&&o.stateConfigs)for(let i of o.stateConfigs){let s;"stateConfig"in i?(s=i.stateConfig,i.flat&&n.add(s.key)):s=i,e.set(s.key,s)}}return{flatKeys:n,sharedConfigMap:e}}var ar=class t{node;knownState;unknownState;sharedNodeState;size;constructor(e,n,r=void 0,o=new Map,i=void 0){this.node=e,this.sharedNodeState=n,this.unknownState=r,this.knownState=o;let{sharedConfigMap:s}=this.sharedNodeState,l=i!==void 0?i:(function(a,c,u){let g=u.size;if(c)for(let d in c){let p=a.get(d);p&&u.has(p)||g++}return g})(s,r,o);this.size=l}getValue(e){let n=this.knownState.get(e);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let o=this.unknownState[e.key];o!==void 0&&(r=e.parse(o)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},n={};for(let[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(o);for(let r of this.sharedNodeState.flatKeys)r in e&&(n[r]=e[r],delete e[r]);return Eo(e)&&(n.$=e),n}getWritable(e){if(this.node===e)return this;let{sharedNodeState:n,unknownState:r}=this,o=new Map(this.knownState);return new t(e,n,(function(i,s,l){let a;if(l)for(let[c,u]of Object.entries(l)){let g=i.get(c);g?s.has(g)||s.set(g,g.parse(u)):(a=a||{},a[c]=u)}return a})(n.sharedConfigMap,o,r),o,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,n){let r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);let{knownState:o,unknownState:i}=this;o.has(e)||i&&r in i||(i&&(delete i[r],this.unknownState=Eo(i)),this.size++),o.set(e,n)}updateFromUnknown(e,n){let r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=n)}updateFromJSON(e){let{knownState:n}=this;for(let r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,e)for(let[r,o]of Object.entries(e))this.updateFromUnknown(r,o)}};function Fr(t){let e=t.getWritable(),n=e.__state?e.__state.getWritable(e):new ar(e,Ei(e));return e.__state=n,n}function Ei(t){return t.__state?t.__state.sharedNodeState:no(_o(),t.getType()).sharedNodeState}function Eo(t){if(t)for(let e in t)return t}function Fl(t){return t}function Ao(t,e,n){for(let[r,o]of e.knownState){if(t.has(r.key))continue;t.add(r.key);let i=n?n.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function Do(t,e,n){let{unknownState:r}=e,o=n?n.unknownState:void 0;if(r){for(let[i,s]of Object.entries(r))if(!t.has(i)&&(t.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function vo(t,e){let n=t.__state;return n&&n.node===t?n.getWritable(e):n}function ko(t,e){let n=t.__mode,r=t.__format,o=t.__style,i=e.__mode,s=e.__format,l=e.__style,a=t.__state,c=e.__state;return(n===null||n===i)&&(r===null||r===s)&&(o===null||o===l)&&(t.__state===null||a===c||(function(u,g){if(u===g)return!0;let d=new Set;return!(u&&Ao(d,u,g)||g&&Ao(d,g,u)||u&&Do(d,u,g)||g&&Do(d,g,u))})(a,c))}function bo(t,e){let n=t.mergeWithSibling(e),r=B()._normalizedNodes;return r.add(t.__key),r.add(e.__key),n}function Io(t){let e,n,r=t;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&k(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(ko(e,r)){r=bo(e,r);break}break}e.remove()}for(;(n=r.getNextSibling())!==null&&k(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(ko(r,n)){r=bo(r,n);break}break}n.remove()}}else r.remove()}function pn(t){return Ro(t.anchor),Ro(t.focus),t}function Ro(t){for(;t.type==="element";){let e=t.getNode(),n=t.offset,r,o;if(n===e.getChildrenSize()?(r=e.getChildAtIndex(n-1),o=!0):(r=e.getChildAtIndex(n),o=!1),k(r)){t.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!x(r))break;t.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}var Je,Q,Kt,wn,cr,ur,Xe,ue,dr,Bt,U="",me=null,He=null,ot=!1,mn=!1;function yn(t,e){let n=Xe.get(t);if(e!==null){let r=_r(t);r.parentNode===e&&e.removeChild(r)}if(ue.has(t)||Q._keyToDOMMap.delete(t),x(n)){let r=Nn(n,Xe);fr(r,0,r.length-1,null)}n!==void 0&&uo(Bt,Kt,wn,n,"destroyed")}function fr(t,e,n,r){for(let o=e;o<=n;++o){let i=t[o];i!==void 0&&yn(i,r)}}function Ge(t,e){t.setProperty("text-align",e)}var Kl="40px";function Ai(t,e){let n=Je.theme.indent;if(typeof n=="string"){let o=t.classList.contains(n);e>0&&!o?t.classList.add(n):e<1&&o&&t.classList.remove(n)}if(e===0)return void t.style.setProperty("padding-inline-start","");let r=getComputedStyle(Q._rootElement||t).getPropertyValue("--lexical-indent-base-value")||Kl;t.style.setProperty("padding-inline-start",`calc(${e} * ${r})`)}function Di(t,e){let n=t.style;e===0?Ge(n,""):e===1?Ge(n,"left"):e===2?Ge(n,"center"):e===3?Ge(n,"right"):e===4?Ge(n,"justify"):e===5?Ge(n,"start"):e===6&&Ge(n,"end")}function gr(t,e){let n=(function(r){let o=r.__dir;if(o!==null)return o;if(q(r))return null;let i=r.getParentOrThrow();return q(i)&&i.__dir===null?"auto":null})(e);n!==null?t.dir=n:t.removeAttribute("dir")}function Cn(t,e){let n=ue.get(t);n===void 0&&O(60);let r=n.createDOM(Je,Q);if((function(o,i,s){let l=s._keyToDOMMap;(function(a,c,u){let g=`__lexicalKey_${c._key}`;a[g]=u})(i,s,o),l.set(o,i)})(t,r,Q),k(n)?r.setAttribute("data-lexical-text","true"):W(n)&&r.setAttribute("data-lexical-decorator","true"),x(n)){let o=n.__indent,i=n.__size;if(gr(r,n),o!==0&&Ai(r,o),i!==0){let l=i-1;hr(Nn(n,ue),n,0,l,n.getDOMSlot(r))}let s=n.__format;s!==0&&Di(r,s),n.isInline()||vi(null,n,r)}else{let o=n.getTextContent();if(W(n)){let i=n.decorate(Q,Je);i!==null&&ki(t,i),r.contentEditable="false"}U+=o}return e!==null&&e.insertChild(r),uo(Bt,Kt,wn,n,"created"),r}function hr(t,e,n,r,o){let i=U;U="";let s=n;for(;s<=r;++s){Cn(t[s],o);let l=ue.get(t[s]);l!==null&&k(l)?me===null&&(me=l.getFormat(),He=l.getStyle()):x(l)&&s<r&&!l.isInline()&&(U+=Pn)}o.element.__lexicalTextContent=U,U=i+U}function Po(t,e){if(t){let n=t.__last;if(n){let r=e.get(n);if(r)return je(r)?"line-break":W(r)&&r.isInline()?"decorator":null}return"empty"}return null}function vi(t,e,n){let r=Po(t,Xe),o=Po(e,ue);r!==o&&e.getDOMSlot(n).setManagedLineBreak(o)}function Bl(t,e,n){var r;me=null,He=null,(function(o,i,s){let l=U,a=o.__size,c=i.__size;U="";let u=s.element;if(a===1&&c===1){let g=o.__first,d=i.__first;if(g===d)an(g,u);else{let h=_r(g),m=Cn(d,null);try{u.replaceChild(m,h)}catch(_){if(typeof _=="object"&&_!=null){let y=`${_.toString()} Parent: ${u.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${h.tagName}, key: ${g}}.`;throw new Error(y)}throw _}yn(g,null)}let p=ue.get(d);k(p)&&me===null&&(me=p.getFormat(),He=p.getStyle())}else{let g=Nn(o,Xe),d=Nn(i,ue);if(g.length!==a&&O(227),d.length!==c&&O(228),a===0)c!==0&&hr(d,0,0,c-1,s);else if(c===0){if(a!==0){let p=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;fr(g,0,a-1,p?null:u),p&&(u.textContent="")}}else(function(p,h,m,_,y,C){let N=_-1,E=y-1,A,S,D=C.getFirstChild(),M=0,T=0;for(;M<=N&&T<=E;){let K=h[M],$=m[T];if(K===$)D=Jn(an($,C.element)),M++,T++;else{if(S===void 0&&(S=wo(m,T)),A===void 0)A=wo(h,M);else if(!A.has(K)){M++;continue}if(!S.has(K)){D=Jn(_r(K)),yn(K,C.element),M++,A.delete(K);continue}if(A.has($)){let z=pt(Q,$);z!==D&&C.withBefore(D).insertChild(z),D=Jn(an($,C.element)),M++,T++}else Cn($,C.withBefore(D)),T++}let L=ue.get($);L!==null&&k(L)?me===null&&(me=L.getFormat(),He=L.getStyle()):x(L)&&T<=E&&!L.isInline()&&(U+=Pn)}let b=M>N,P=T>E;if(b&&!P){let K=m[E+1],$=K===void 0?null:Q.getElementByKey(K);hr(m,0,T,E,C.withBefore($))}else P&&!b&&fr(h,M,N,C.element)})(0,g,d,a,c,s)}u.__lexicalTextContent=U,U=l+U})(t,e,e.getDOMSlot(n)),r=e,me==null||me===r.__textFormat||mn||r.setTextFormat(me),(function(o){He==null||He===o.__textStyle||mn||o.setTextStyle(He)})(e)}function Nn(t,e){let n=[],r=t.__first;for(;r!==null;){let o=e.get(r);o===void 0&&O(101),n.push(r),r=o.__next}return n}function an(t,e){let n=Xe.get(t),r=ue.get(t);n!==void 0&&r!==void 0||O(61);let o=ot||ur.has(t)||cr.has(t),i=pt(Q,t);if(n===r&&!o){let s;if(x(n)){let l=i.__lexicalTextContent;typeof l=="string"?s=l:(s=n.getTextContent(),i.__lexicalTextContent=s)}else s=n.getTextContent();return U+=s,i}if(n!==r&&o&&uo(Bt,Kt,wn,r,"updated"),r.updateDOM(n,i,Je)){let s=Cn(t,null);return e===null&&O(62),e.replaceChild(s,i),yn(t,null),s}if(x(n)){x(r)||O(334,t);let s=r.__indent;(ot||s!==n.__indent)&&Ai(i,s);let l=r.__format;if((ot||l!==n.__format)&&Di(i,l),o)Bl(n,r,i),q(r)||r.isInline()||vi(n,r,i);else{let a=i.__lexicalTextContent,c;typeof a=="string"?c=a:(c=n.getTextContent(),i.__lexicalTextContent=c),U+=c}if((ot||r.__dir!==n.__dir)&&(gr(i,r),q(r)&&!ot))for(let a of r.getChildren())x(a)&&gr(pt(Q,a.getKey()),a)}else{let s=r.getTextContent();if(W(r)){let l=r.decorate(Q,Je);l!==null&&ki(t,l)}U+=s}if(!mn&&q(r)&&r.__cachedText!==U){let s=r.getWritable();s.__cachedText=U,r=s}return i}function ki(t,e){let n=Q._pendingDecorators,r=Q._decorators;if(n===null){if(r[t]===e)return;n=ks(Q)}n[t]=e}function Jn(t){let e=t.nextSibling;return e!==null&&e===Q._blockCursorElement&&(e=e.nextSibling),e}function wo(t,e){let n=new Set;for(let r=e;r<t.length;r++)n.add(t[r]);return n}function Wl(t,e,n,r,o,i){U="",ot=r===2,Q=n,Je=n._config,Kt=n._nodes,wn=Q._listeners.mutation,cr=o,ur=i,Xe=t._nodeMap,ue=e._nodeMap,mn=e._readOnly,dr=new Map(n._keyToDOMMap);let s=new Map;return Bt=s,an("root",null),Q=void 0,Kt=void 0,cr=void 0,ur=void 0,Xe=void 0,ue=void 0,Je=void 0,dr=void 0,Bt=void 0,s}function _r(t){let e=dr.get(t);return e===void 0&&O(75,t),e}function R(t){return{type:t}}var Kr=R("SELECTION_CHANGE_COMMAND"),zl=R("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),bi=R("CLICK_COMMAND"),Br=R("BEFORE_INPUT_COMMAND"),Wr=R("INPUT_COMMAND"),zr=R("COMPOSITION_START_COMMAND"),Ur=R("COMPOSITION_END_COMMAND"),Wt=R("DELETE_CHARACTER_COMMAND"),It=R("INSERT_LINE_BREAK_COMMAND"),pr=R("INSERT_PARAGRAPH_COMMAND"),at=R("CONTROLLED_TEXT_INSERTION_COMMAND"),Yr=R("PASTE_COMMAND"),mr=R("REMOVE_TEXT_COMMAND"),zt=R("DELETE_WORD_COMMAND"),Ut=R("DELETE_LINE_COMMAND"),Ie=R("FORMAT_TEXT_COMMAND"),Gr=R("UNDO_COMMAND"),Hr=R("REDO_COMMAND"),Vr=R("KEYDOWN_COMMAND"),Ii=R("KEY_ARROW_RIGHT_COMMAND"),Ri=R("MOVE_TO_END"),Pi=R("KEY_ARROW_LEFT_COMMAND"),wi=R("MOVE_TO_START"),Li=R("KEY_ARROW_UP_COMMAND"),$i=R("KEY_ARROW_DOWN_COMMAND"),xn=R("KEY_ENTER_COMMAND"),Fi=R("KEY_SPACE_COMMAND"),Ki=R("KEY_BACKSPACE_COMMAND"),Bi=R("KEY_ESCAPE_COMMAND"),Wi=R("KEY_DELETE_COMMAND"),zi=R("KEY_TAB_COMMAND"),Ul=R("INSERT_TAB_COMMAND"),Yl=R("INDENT_CONTENT_COMMAND"),Gl=R("OUTDENT_CONTENT_COMMAND"),Ui=R("DROP_COMMAND"),Hl=R("FORMAT_ELEMENT_COMMAND"),Yi=R("DRAGSTART_COMMAND"),Gi=R("DRAGOVER_COMMAND"),Hi=R("DRAGEND_COMMAND"),jr=R("COPY_COMMAND"),Jr=R("CUT_COMMAND"),yr=R("SELECT_ALL_COMMAND"),Vl=R("CLEAR_EDITOR_COMMAND"),jl=R("CLEAR_HISTORY_COMMAND"),Jl=R("CAN_REDO_COMMAND"),Xl=R("CAN_UNDO_COMMAND"),Vi=R("FOCUS_COMMAND"),ji=R("BLUR_COMMAND"),Ji=R("KEY_MODIFIER_COMMAND"),xe=Object.freeze({}),Cr=[["keydown",function(t,e){Yt=t.timeStamp,Xi=t.key,!e.isComposing()&&v(e,Vr,t)}],["pointerdown",function(t,e){let n=t.target,r=t.pointerType;St(n)&&r!=="touch"&&r!=="pen"&&t.button===0&&ye(e,()=>{As(n)||(Tr=!0)})}],["compositionstart",function(t,e){v(e,zr,t)}],["compositionend",function(t,e){Le?bt=!0:Jt||!In&&!Rn?v(e,Ur,t):(cn=!0,un=t.data)}],["input",function(t,e){t.stopPropagation(),ye(e,()=>{e.dispatchCommand(Wr,t)},{event:t}),it=null}],["click",function(t,e){ye(e,()=>{let n=w(),r=_e(ie(e)),o=tt();if(r){if(I(n)){let i=n.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&n.isCollapsed()&&!q(s)&&oe().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&n.is(o))r.removeAllRanges(),n.dirty=!0;else if(t.detail===3&&!n.isCollapsed()&&s!==n.focus.getNode()){let l=wt(s,a=>x(a)&&!a.isInline());x(l)&&l.select(0)}}else if(t.pointerType==="touch"||t.pointerType==="pen"){let i=r.anchorNode;(ee(i)||Ce(i))&&re($n(o,r,e,t))}}v(e,bi,t)})}],["cut",xe],["copy",xe],["dragstart",xe],["dragover",xe],["dragend",xe],["paste",xe],["focus",xe],["blur",xe],["drop",xe]];hn&&Cr.push(["beforeinput",(t,e)=>(function(n,r){let o=n.inputType;o==="deleteCompositionText"||Le&&$s(r)||o!=="insertCompositionText"&&v(r,Br,n)})(t,e)]);var Yt=0,Xi=null,qi=0,it=null,Nr=new WeakMap,Tn=new WeakMap,xr=!1,Tr=!1,Rt=!1,bt=!1,cn=!1,un="",Ve=null,Qi=[0,"",0,"root",0];function Zi(t,e,n,r,o){let i=t.anchor,s=t.focus,l=i.getNode(),a=B(),c=_e(ie(a)),u=c!==null?c.anchorNode:null,g=i.key,d=a.getElementByKey(g),p=n.length;return g!==s.key||!k(l)||(!o&&(!hn||qi<r+50)||l.isDirty()&&p<2||Is(n))&&i.offset!==s.offset&&!l.isComposing()||Oe(l)||l.isDirty()&&p>1||(o||!hn)&&d!==null&&!l.isComposing()&&u!==Ze(d)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||!l.isComposing()&&(l.getFormat()!==t.format||l.getStyle()!==t.style)||(function(h,m){if(m.isSegmented())return!0;if(!h.isCollapsed())return!1;let _=h.anchor.offset,y=m.getParentOrThrow(),C=Pe(m);return _===0?!m.canInsertTextBefore()||!y.canInsertTextBefore()&&!m.isComposing()||C||(function(N){let E=N.getPreviousSibling();return(k(E)||x(E)&&E.isInline())&&!E.canInsertTextAfter()})(m):_===m.getTextContentSize()&&(!m.canInsertTextAfter()||!y.canInsertTextAfter()&&!m.isComposing()||C)})(t,l)}function Lo(t,e){return Ce(t)&&t.nodeValue!==null&&e!==0&&e!==t.nodeValue.length}function $o(t,e,n){let{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=t;xr&&(xr=!1,Lo(r,o)&&Lo(i,s)&&!Ve)||ye(e,()=>{if(!n)return void re(null);if(!qt(e,r,i))return;let l=w();if(Ve&&I(l)&&l.isCollapsed()){let a=l.anchor,c=Ve.anchor;(a.key===c.key&&a.offset===c.offset+1||a.offset===1&&c.getNode().is(a.getNode().getPreviousSibling()))&&(l=Ve.clone(),re(l))}if(Ve=null,I(l)){let a=l.anchor,c=a.getNode();if(l.isCollapsed()){t.type==="Range"&&t.anchorNode===t.focusNode&&(l.dirty=!0);let u=ie(e).event,g=u?u.timeStamp:performance.now(),[d,p,h,m,_]=Qi,y=oe(),C=e.isComposing()===!1&&y.getTextContent()==="";if(g<_+200&&a.offset===h&&a.key===m)dn(l,d,p);else if(a.type==="text")k(c)||O(141),es(l,c);else if(a.type==="element"&&!C){x(c)||O(259);let N=a.getNode();N.isEmpty()?(function(E,A){let S=A.getTextFormat(),D=A.getTextStyle();dn(E,S,D)})(l,N):dn(l,l.format,"")}}else{let u=a.key,g=l.focus.key,d=l.getNodes(),p=d.length,h=l.isBackward(),m=h?s:o,_=h?o:s,y=h?g:u,C=h?u:g,N=2047,E=!1;for(let A=0;A<p;A++){let S=d[A],D=S.getTextContentSize();if(k(S)&&D!==0&&!(A===0&&S.__key===y&&m===D||A===p-1&&S.__key===C&&_===0)&&(E=!0,N&=S.getFormat(),N===0))break}l.format=E?N:0}}v(e,Kr,void 0)})}function dn(t,e,n){t.format===e&&t.style===n||(t.format=e,t.style=n,t.dirty=!0)}function es(t,e){dn(t,e.getFormat(),e.getStyle())}function ts(t){if(!t.getTargetRanges)return null;let e=t.getTargetRanges();return e.length===0?null:e[0]}function ql(t){let e=t.inputType,n=ts(t),r=B(),o=w();if(e==="deleteContentBackward"){if(o===null){let g=tt();if(!I(g))return!0;re(g.clone())}if(I(o)){let g=o.anchor.key===o.focus.key;if(i=t.timeStamp,Xi==="MediaLast"&&i<Yt+30&&r.isComposing()&&g){if(V(null),Yt=0,setTimeout(()=>{ye(r,()=>{V(null)})},30),I(o)){let d=o.anchor.getNode();d.markDirty(),k(d)||O(142),es(o,d)}}else{V(null),t.preventDefault();let d=o.anchor.getNode(),p=d.getTextContent(),h=d.canInsertTextAfter(),m=o.anchor.offset===0&&o.focus.offset===p.length,_=or&&g&&!m&&h;if(_&&o.isCollapsed()&&(_=!W(Ls(o.anchor,!0))),!_){v(r,Wt,!0);let y=w();or&&I(y)&&y.isCollapsed()&&(Ve=y,setTimeout(()=>Ve=null))}}return!0}}var i;if(!I(o))return!0;let s=t.data;it!==null&&ao(!1,r,it),o.dirty&&it===null||!o.isCollapsed()||q(o.anchor.getNode())||n===null||o.applyDOMRange(n),it=null;let l=o.anchor,a=o.focus,c=l.getNode(),u=a.getNode();if(e==="insertText"||e==="insertTranspose"){if(s===`
|
|
4
|
+
`)t.preventDefault(),v(r,It,!1);else if(s===Pn)t.preventDefault(),v(r,pr,void 0);else if(s==null&&t.dataTransfer){let g=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(g)}else s!=null&&Zi(o,n,s,t.timeStamp,!0)?(t.preventDefault(),v(r,at,s)):it=s;return qi=t.timeStamp,!0}switch(t.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":v(r,at,t);break;case"insertFromComposition":V(null),v(r,at,t);break;case"insertLineBreak":V(null),v(r,It,!1);break;case"insertParagraph":V(null),Rt&&!Jt?(Rt=!1,v(r,It,!1)):v(r,pr,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":v(r,Yr,t);break;case"deleteByComposition":(function(g,d){return g!==d||x(g)||x(d)||!Pe(g)||!Pe(d)})(c,u)&&v(r,mr,t);break;case"deleteByDrag":case"deleteByCut":v(r,mr,t);break;case"deleteContent":v(r,Wt,!1);break;case"deleteWordBackward":v(r,zt,!0);break;case"deleteWordForward":v(r,zt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":v(r,Ut,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":v(r,Ut,!1);break;case"formatStrikeThrough":v(r,Ie,"strikethrough");break;case"formatBold":v(r,Ie,"bold");break;case"formatItalic":v(r,Ie,"italic");break;case"formatUnderline":v(r,Ie,"underline");break;case"historyUndo":v(r,Gr,void 0);break;case"historyRedo":v(r,Hr,void 0)}return!0}function Ql(t){if(ee(t.target)&&As(t.target))return!0;let e=B(),n=w(),r=t.data,o=ts(t);if(r!=null&&I(n)&&Zi(n,o,r,t.timeStamp,!1)){bt&&(Sn(e,r),bt=!1);let i=n.anchor.getNode(),s=_e(ie(e));if(s===null)return!0;let l=n.isBackward(),a=l?n.anchor.offset:n.focus.offset,c=l?n.focus.offset:n.anchor.offset;hn&&!n.isCollapsed()&&k(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+c)===Ps(s.anchorNode)||v(e,at,r);let u=r.length;Le&&u>1&&t.inputType==="insertCompositionText"&&!e.isComposing()&&(n.anchor.offset-=u),or&&e.isComposing()&&(Yt=0,V(null))}else ao(!1,e,r!==null?r:void 0),bt&&(Sn(e,r||void 0),bt=!1);return(function(){H();let i=B();Si(i)})(),!0}function Zl(t){let e=B(),n=w();if(I(n)&&!e.isComposing()){let r=n.anchor,o=n.anchor.getNode();V(r.key),zn(as),(t.timeStamp<Yt+30||r.type==="element"||!n.isCollapsed()||o.getFormat()!==n.format||k(o)&&o.getStyle()!==n.style)&&v(e,at,Lr)}return!0}function ea(t){return Sn(B(),t.data),zn(cs),!0}function Sn(t,e){let n=t._compositionKey;if(V(null),n!==null&&e!=null){if(e===""){let r=Y(n),o=Ze(t.getElementByKey(n));if(o!==null&&o.nodeValue!==null&&k(r)){let i=_e(ie(t)),s=null,l=null;i!==null&&i.anchorNode===o&&(s=i.anchorOffset,l=i.focusOffset),co(r,o.nodeValue,s,l,!0)}return}if(e[e.length-1]===`
|
|
5
|
+
`){let r=w();if(I(r)||Xt(r)){if(I(r)){let o=r.focus;r.anchor.set(o.key,o.offset,o.type)}return void v(t,xn,null)}}}ao(!0,t,e)}function ta(t){let e=B();if(t.key==null)return!0;if(cn){if(ui(t))return ye(e,()=>{Sn(e,un)}),cn=!1,un="",!0;cn=!1,un=""}if((function(n){return F(n,"ArrowRight",{shiftKey:"any"})})(t))v(e,Ii,t);else if((function(n){return F(n,"ArrowRight",Se)})(t))v(e,Ri,t);else if((function(n){return F(n,"ArrowLeft",{shiftKey:"any"})})(t))v(e,Pi,t);else if((function(n){return F(n,"ArrowLeft",Se)})(t))v(e,wi,t);else if((function(n){return F(n,"ArrowUp",{altKey:"any",shiftKey:"any"})})(t))v(e,Li,t);else if((function(n){return F(n,"ArrowDown",{altKey:"any",shiftKey:"any"})})(t))v(e,$i,t);else if((function(n){return F(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(t))Rt=!0,v(e,xn,t);else if((function(n){return n.key===" "})(t))v(e,Fi,t);else if((function(n){return ae&&F(n,"o",{ctrlKey:!0})})(t))t.preventDefault(),Rt=!0,v(e,It,!0);else if((function(n){return F(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(t))Rt=!1,v(e,xn,t);else if((function(n){return F(n,"Backspace",{shiftKey:"any"})||ae&&F(n,"h",{ctrlKey:!0})})(t))ui(t)?v(e,Ki,t):(t.preventDefault(),v(e,Wt,!0));else if((function(n){return n.key==="Escape"})(t))v(e,Bi,t);else if((function(n){return F(n,"Delete",{})||ae&&F(n,"d",{ctrlKey:!0})})(t))(function(n){return n.key==="Delete"})(t)?v(e,Wi,t):(t.preventDefault(),v(e,Wt,!1));else if((function(n){return F(n,"Backspace",ci)})(t))t.preventDefault(),v(e,zt,!0);else if((function(n){return F(n,"Delete",ci)})(t))t.preventDefault(),v(e,zt,!1);else if((function(n){return ae&&F(n,"Backspace",{metaKey:!0})})(t))t.preventDefault(),v(e,Ut,!0);else if((function(n){return ae&&(F(n,"Delete",{metaKey:!0})||F(n,"k",{ctrlKey:!0}))})(t))t.preventDefault(),v(e,Ut,!1);else if((function(n){return F(n,"b",Se)})(t))t.preventDefault(),v(e,Ie,"bold");else if((function(n){return F(n,"u",Se)})(t))t.preventDefault(),v(e,Ie,"underline");else if((function(n){return F(n,"i",Se)})(t))t.preventDefault(),v(e,Ie,"italic");else if((function(n){return F(n,"Tab",{shiftKey:"any"})})(t))v(e,zi,t);else if((function(n){return F(n,"z",Se)})(t))t.preventDefault(),v(e,Gr,void 0);else if((function(n){return ae?F(n,"z",{metaKey:!0,shiftKey:!0}):F(n,"y",{ctrlKey:!0})||F(n,"z",{ctrlKey:!0,shiftKey:!0})})(t))t.preventDefault(),v(e,Hr,void 0);else{let n=e._editorState._selection;n===null||I(n)?di(t)&&(t.preventDefault(),v(e,yr,t)):(function(r){return F(r,"c",Se)})(t)?(t.preventDefault(),v(e,jr,t)):(function(r){return F(r,"x",Se)})(t)?(t.preventDefault(),v(e,Jr,t)):di(t)&&(t.preventDefault(),v(e,yr,t))}return(function(n){return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey})(t)&&e.dispatchCommand(Ji,t),!0}function ns(t){let e=t.__lexicalEventHandles;return e===void 0&&(e=[],t.__lexicalEventHandles=e),e}var ct=new Map;function rs(t){let e=Ws(t.target);if(e===null)return;let n=io(e.anchorNode);if(n===null)return;Tr&&(Tr=!1,ye(n,()=>{let a=tt(),c=e.anchorNode;(ee(c)||Ce(c))&&re($n(a,e,n,t))}));let r=lo(n),o=r[r.length-1],i=o._key,s=ct.get(i),l=s||o;l!==n&&$o(e,l,!1),$o(e,n,!0),n!==o?ct.set(i,n):s&&ct.delete(i)}function Fo(t){t._lexicalHandled=!0}function Ko(t){return t._lexicalHandled===!0}var Bo=()=>{};function na(t){let e=Nr.get(t);if(e===void 0)return void Bo();let n=Tn.get(e);if(n===void 0)return void Bo();let r=n-1;r>=0||O(164),Nr.delete(t),Tn.set(e,r),r===0&&e.removeEventListener("selectionchange",rs);let o=Qt(t);Kn(o)?((function(s){if(s._parentEditor!==null){let l=lo(s),a=l[l.length-1]._key;ct.get(a)===s&&ct.delete(a)}else ct.delete(s._key)})(o),t.__lexicalEditor=null):o&&O(198);let i=ns(t);for(let s=0;s<i.length;s++)i[s]();t.__lexicalEventHandles=[]}function Sr(t,e,n){H();let r=t.__key,o=t.getParent();if(o===null)return;let i=(function(l){let a=w();if(!I(a)||!x(l))return a;let{anchor:c,focus:u}=a,g=c.getNode(),d=u.getNode();return kn(g,l)&&c.set(l.__key,0,"element"),kn(d,l)&&u.set(l.__key,0,"element"),a})(t),s=!1;if(I(i)&&e){let l=i.anchor,a=i.focus;l.key===r&&(An(l,t,o,t.getPreviousSibling(),t.getNextSibling()),s=!0),a.key===r&&(An(a,t,o,t.getPreviousSibling(),t.getNextSibling()),s=!0)}else Xt(i)&&e&&t.isSelected()&&t.selectPrevious();if(I(i)&&e&&!s){let l=t.getIndexWithinParent();we(t),En(i,o,l,-1)}else we(t);n||le(o)||o.canBeEmpty()||!o.isEmpty()||Sr(o,e),e&&i&&q(o)&&o.isEmpty()&&o.selectEnd()}function ra(t){return t}var os=Symbol.for("ephemeral");function On(t){return t[os]||!1}var se=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=tn(this);return e===void 0&&O(64,this.name),e}static clone(e){O(65,this.name)}$config(){return{}}config(e,n){let r=n.extends||Object.getPrototypeOf(this.constructor);return Object.assign(n,{extends:r,type:e}),{[e]:n}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),vs(this,e)}getType(){return this.__type}isInline(){O(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;let n=Y(e);if(n===null)break;e=n.__parent}return!1}isSelected(e){let n=e||w();if(n==null)return!1;let r=n.getNodes().some(o=>o.__key===this.__key);if(k(this))return r;if(I(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;let o=this.getParent();if(W(this)&&this.isInline()&&o){let i=n.isBackward()?n.focus:n.anchor;if(o.is(i.getNode())&&i.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let n=e.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:Y(e)}getParentOrThrow(){let e=this.getParent();return e===null&&O(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let n=e.getParent();if(le(n))return x(e)||e===this&&W(e)||O(194),e;e=n}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&O(67,this.__key),e}getParents(){let e=[],n=this.getParent();for(;n!==null;)e.push(n),n=n.getParent();return e}getParentKeys(){let e=[],n=this.getParent();for(;n!==null;)e.push(n.__key),n=n.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:Y(e)}getPreviousSiblings(){let e=[],n=this.getParent();if(n===null)return e;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:Y(e)}getNextSiblings(){let e=[],n=this.getNextSibling();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getCommonAncestor(e){let n=x(this)?this:this.getParent(),r=x(e)?e:e.getParent(),o=n&&r?Lt(n,r):null;return o?o.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let n=Lt(this,e);return n!==null&&(n.type==="descendant"||(n.type==="branch"?xo(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&O(279),!1)))}isParentOf(e){let n=Lt(this,e);return n!==null&&n.type==="ancestor"}getNodesBetween(e){let n=this.isBefore(e),r=[],o=new Set,i=this;for(;i!==null;){let s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===e)break;let l=x(i)?n?i.getFirstChild():i.getLastChild():null;if(l!==null){i=l;continue}let a=n?i.getNextSibling():i.getPreviousSibling();if(a!==null){i=a;continue}let c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===e)break;let u=null,g=c;do{if(g===null&&O(68),u=n?g.getNextSibling():g.getPreviousSibling(),g=g.getParent(),g===null)break;u!==null||o.has(g.__key)||r.push(g)}while(u===null);i=u}return n||r.reverse(),r}isDirty(){let e=B()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(On(this))return this;let e=Y(this.__key);return e===null&&O(113),e}getWritable(){if(On(this))return this;H();let e=ke(),n=B(),r=e._nodeMap,o=this.__key,i=this.getLatest(),s=n._cloneNotNeeded,l=w();if(l!==null&&l.setCachedNodes(null),s.has(o))return vn(i),i;let a=po(i);return s.add(o),vn(a),r.set(o,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,n){O(70)}updateDOM(e,n,r){O(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){O(18,this.name)}updateFromJSON(e){return(function(n,r){let o=n.getWritable(),i=r.$,s=i;for(let l of Ei(o).flatKeys)l in r&&(s!==void 0&&s!==i||(s={...i}),s[l]=r[l]);return(o.__state||s)&&Fr(n).updateFromJSON(s),o})(this,e)}static transform(){return null}remove(e){Sr(this,!0,e)}replace(e,n){H();let r=w();r!==null&&(r=r.clone()),tr(this,e);let o=this.getLatest(),i=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;we(l);let u=o.getPreviousSibling(),g=o.getNextSibling(),d=o.__prev,p=o.__next,h=o.__parent;if(Sr(o,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=d,g===null?a.__last=s:g.getWritable().__prev=s,l.__next=p,l.__parent=h,a.__size=c,n&&(x(this)&&x(l)||O(139),this.getChildren().forEach(m=>{l.append(m)})),I(r)){re(r);let m=r.anchor,_=r.focus;m.key===i&&Yo(m,l),_.key===i&&Yo(_,l)}return Re()===i&&V(s),l}insertAfter(e,n=!0){H(),tr(this,e);let r=this.getWritable(),o=e.getWritable(),i=o.getParent(),s=w(),l=!1,a=!1;if(i!==null){let p=e.getIndexWithinParent();if(we(o),I(s)){let h=i.__key,m=s.anchor,_=s.focus;l=m.type==="element"&&m.key===h&&m.offset===p+1,a=_.type==="element"&&_.key===h&&_.offset===p+1}}let c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),g=o.__key,d=r.__next;if(c===null?u.__last=g:c.getWritable().__prev=g,u.__size++,r.__next=g,o.__next=d,o.__prev=r.__key,o.__parent=r.__parent,n&&I(s)){let p=this.getIndexWithinParent();En(s,u,p+1);let h=u.__key;l&&s.anchor.set(h,p+2,"element"),a&&s.focus.set(h,p+2,"element")}return e}insertBefore(e,n=!0){H(),tr(this,e);let r=this.getWritable(),o=e.getWritable(),i=o.__key;we(o);let 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;let u=w();return n&&I(u)&&En(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Ae()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,n){H();let r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(x(r))return r.select();if(!k(r)){let i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(e,n)}selectNext(e,n){H();let r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(x(r))return r.select(0,0);if(!k(r)){let i=r.getIndexWithinParent();return o.select(i,i)}return r.select(e,n)}markDirty(){this.getWritable()}reconcileObservedMutation(e,n){this.markDirty()}},oa="historic",ia="history-push",fn="history-merge",sa="paste",is="collaboration",la="skip-collab",ss="skip-scroll-into-view",ls="skip-dom-selection",Or="skip-selection-focus",as="composition-start",cs="composition-end",dt=class t extends se{static getType(){return"linebreak"}static clone(e){return new t(e.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
6
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(n){let r=n.parentElement;if(r!==null&&kr(r)){let o=r.firstChild;if(o===n||o.nextSibling===n&&rn(o)){let i=r.lastChild;if(i===n||i.previousSibling===n&&rn(i))return!0}}return!1})(e)||(function(n){let r=n.parentElement;if(r!==null&&kr(r)){let o=r.firstChild;if(o===n||o.nextSibling===n&&rn(o))return!1;let i=r.lastChild;if(i===n||i.previousSibling===n&&rn(i))return!0}return!1})(e)?null:{conversion:aa,priority:0}}}static importJSON(e){return ft().updateFromJSON(e)}};function aa(t){return{node:ft()}}function ft(){return en(new dt)}function je(t){return t instanceof dt}function rn(t){return Ce(t)&&/^( |\t|\r?\n)+$/.test(t.textContent||"")}function Xn(t,e){return 16&e?"code":e&wr?"mark":32&e?"sub":64&e?"sup":null}function qn(t,e){return 1&e?"strong":2&e?"em":"span"}function us(t,e,n,r,o){let i=r.classList,s=ut(o,"base");s!==void 0&&i.add(...s),s=ut(o,"underlineStrikethrough");let l=!1,a=8&e&&4&e;s!==void 0&&(8&n&&4&n?(l=!0,a||i.add(...s)):a&&i.remove(...s));for(let c in Z){let u=Z[c];if(s=ut(o,c),s!==void 0)if(n&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&i.remove(...s);continue}((e&u)===0||a&&c==="underline"||c==="strikethrough")&&i.add(...s)}else e&u&&i.remove(...s)}}function ds(t,e,n){let r=e.firstChild,o=n.isComposing(),i=t+(o?Ft:"");if(r==null)e.textContent=i;else{let s=r.nodeValue;if(s!==i)if(o||Le){let[l,a,c]=(function(u,g){let d=u.length,p=g.length,h=0,m=0;for(;h<d&&h<p&&u[h]===g[h];)h++;for(;m+h<d&&m+h<p&&u[d-m-1]===g[p-m-1];)m++;return[h,d-h-m,g.slice(h,p-m)]})(s,i);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=i}}function Wo(t,e,n,r,o,i){ds(o,t,e);let s=i.theme.text;s!==void 0&&us(0,0,r,t,s)}function on(t,e){let n=document.createElement(e);return n.appendChild(t),n}var qe=class t extends se{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new t(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",n){super(n),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let e=this.getLatest();return vl[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Re()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let n=Z[e];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,n){return Vt(this.getLatest().__format,e,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,n){let r=this.__format,o=Xn(0,r),i=qn(0,r),s=o===null?i:o,l=document.createElement(s),a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),o!==null&&(a=document.createElement(i),l.appendChild(a)),Wo(a,this,0,r,this.__text,e);let c=this.__style;return c!==""&&(l.style.cssText=c),l}updateDOM(e,n,r){let o=this.__text,i=e.__format,s=this.__format,l=Xn(0,i),a=Xn(0,s),c=qn(0,i),u=qn(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){let m=n.firstChild;m==null&&O(48);let _=document.createElement(u);return Wo(_,this,0,s,o,r),n.replaceChild(_,m),!1}let g=n;a!==null&&l!==null&&(g=n.firstChild,g==null&&O(49)),ds(o,g,this);let d=r.theme.text;d!==void 0&&i!==s&&us(0,i,s,g,d);let p=e.__style,h=this.__style;return p!==h&&(n.style.cssText=h),!1}static importDOM(){return{"#text":()=>({conversion:fa,priority:0}),b:()=>({conversion:ua,priority:0}),code:()=>({conversion:Te,priority:0}),em:()=>({conversion:Te,priority:0}),i:()=>({conversion:Te,priority:0}),mark:()=>({conversion:Te,priority:0}),s:()=>({conversion:Te,priority:0}),span:()=>({conversion:ca,priority:0}),strong:()=>({conversion:Te,priority:0}),sub:()=>({conversion:Te,priority:0}),sup:()=>({conversion:Te,priority:0}),u:()=>({conversion:Te,priority:0})}}static importJSON(e){return G().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:n}=super.exportDOM(e);return ee(n)||O(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=on(n,"b")),this.hasFormat("italic")&&(n=on(n,"i")),this.hasFormat("strikethrough")&&(n=on(n,"s")),this.hasFormat("underline")&&(n=on(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,n){}setFormat(e){let n=this.getWritable();return n.__format=typeof e=="string"?Z[e]:e,n}setDetail(e){let n=this.getWritable();return n.__detail=typeof e=="string"?El[e]:e,n}setStyle(e){let n=this.getWritable();return n.__style=e,n}toggleFormat(e){let n=Vt(this.getFormat(),e,null);return this.setFormat(n)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let n=Dl[e];if(this.__mode===n)return this;let r=this.getWritable();return r.__mode=n,r}setTextContent(e){if(this.__text===e)return this;let n=this.getWritable();return n.__text=e,n}select(e,n){H();let r=e,o=n,i=w(),s=this.getTextContent(),l=this.__key;if(typeof s=="string"){let a=s.length;r===void 0&&(r=a),o===void 0&&(o=a)}else r=0,o=0;if(!I(i))return hs(l,r,l,o,"text","text");{let a=Re();a!==i.anchor.key&&a!==i.focus.key||V(l),i.setTextNodeRange(this,r,this,o)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,n,r,o){let i=this.getWritable(),s=i.__text,l=r.length,a=e;a<0&&(a=l+a,a<0&&(a=0));let c=w();if(o&&I(c)){let g=e+l;c.setTextNodeRange(i,g,i,g)}let u=s.slice(0,a)+r+s.slice(a+n);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){H();let n=this.getLatest(),r=n.getTextContent();if(r==="")return[];let o=n.__key,i=Re(),s=r.length;e.sort((M,T)=>M-T),e.push(s);let l=[],a=e.length;for(let M=0,T=0;M<s&&T<=a;T++){let b=e[T];b>M&&(l.push(r.slice(M,b)),M=b)}let c=l.length;if(c===1)return[n];let u=l[0],g=n.getParent(),d,p=n.getFormat(),h=n.getStyle(),m=n.__detail,_=!1,y=null,C=null,N=w();if(I(N)){let[M,T]=N.isBackward()?[N.focus,N.anchor]:[N.anchor,N.focus];M.type==="text"&&M.key===o&&(y=M),T.type==="text"&&T.key===o&&(C=T)}n.isSegmented()?(d=G(u),d.__format=p,d.__style=h,d.__detail=m,d.__state=vo(n,d),_=!0):d=n.setTextContent(u);let E=[d];for(let M=1;M<c;M++){let T=G(l[M]);T.__format=p,T.__style=h,T.__detail=m,T.__state=vo(n,T);let b=T.__key;i===o&&V(b),E.push(T)}let A=y?y.offset:null,S=C?C.offset:null,D=0;for(let M of E){if(!y&&!C)break;let T=D+M.getTextContentSize();if(y!==null&&A!==null&&A<=T&&A>=D&&(y.set(M.getKey(),A-D,"text"),A<T&&(y=null)),C!==null&&S!==null&&S<=T&&S>=D){C.set(M.getKey(),S-D,"text");break}D=T}if(g!==null){(function(b){let P=b.getPreviousSibling(),K=b.getNextSibling();P!==null&&vn(P),K!==null&&vn(K)})(this);let M=g.getWritable(),T=this.getIndexWithinParent();_?(M.splice(T,0,E),this.remove()):M.splice(T,1,E),I(N)&&En(N,g,T,c-1)}return E}mergeWithSibling(e){let n=e===this.getPreviousSibling();n||e===this.getNextSibling()||O(50);let r=this.__key,o=e.__key,i=this.__text,s=i.length;Re()===o&&V(r);let l=w();if(I(l)){let g=l.anchor,d=l.focus;g!==null&&g.key===o&&qo(g,n,r,e,s),d!==null&&d.key===o&&qo(d,n,r,e,s)}let a=e.__text,c=n?a+i:i+a;this.setTextContent(c);let u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}};function ca(t){return{forChild:Xr(t.style),node:null}}function ua(t){let e=t,n=e.style.fontWeight==="normal";return{forChild:Xr(e.style,n?void 0:"bold"),node:null}}var zo=new WeakMap;function da(t){if(!ee(t))return!1;if(t.nodeName==="PRE")return!0;let e=t.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function fa(t){let e=t;t.parentElement===null&&O(129);let n=e.textContent||"";if((function(r){let o,i=r.parentNode,s=[r];for(;i!==null&&(o=zo.get(i))===void 0&&!da(i);)s.push(i),i=i.parentNode;let l=o===void 0?i:o;for(let a=0;a<s.length;a++)zo.set(s[a],l);return l})(e)!==null){let r=n.split(/(\r?\n|\t)/),o=[],i=r.length;for(let s=0;s<i;s++){let l=r[s];l===`
|
|
7
|
+
`||l===`\r
|
|
8
|
+
`?o.push(ft()):l===" "?o.push(Ln()):l!==""&&o.push(G(l))}return{node:o}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let r=e,o=!0;for(;r!==null&&(r=Uo(r,!1))!==null;){let i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(n=n.slice(1)),o=!1;break}}o&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=e,o=!0;for(;r!==null&&(r=Uo(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:G(n)}}function Uo(t,e){let n=t;for(;;){let r;for(;(r=e?n.nextSibling:n.previousSibling)===null;){let i=n.parentElement;if(i===null)return null;n=i}if(n=r,ee(n)){let i=n.style.display;if(i===""&&!Us(n)||i!==""&&!i.startsWith("inline"))return null}let o=n;for(;(o=e?n.firstChild:n.lastChild)!==null;)n=o;if(Ce(n))return n;if(n.nodeName==="BR")return null}}var ga={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Te(t){let e=ga[t.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Xr(t.style,e),node:null}}function G(t=""){return en(new qe(t))}function k(t){return t instanceof qe}function Xr(t,e){let n=t.fontWeight,r=t.textDecoration.split(" "),o=n==="700"||n==="bold",i=r.includes("line-through"),s=t.fontStyle==="italic",l=r.includes("underline"),a=t.verticalAlign;return c=>(k(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)}var gt=class t extends qe{static getType(){return"tab"}static clone(e){return new t(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){let n=super.createDOM(e),r=ut(e.theme,"tab");return r!==void 0&&n.classList.add(...r),n}static importJSON(e){return Ln().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&pi(126),super.setTextContent(" ")}spliceText(e,n,r,o){return r===""&&n===0||r===" "&&n===1||O(286),this}setDetail(e){return e!==2&&O(127),this}setMode(e){return e!=="normal"&&O(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function Ln(){return en(new gt)}function qr(t){return t instanceof gt}var Mr=class{key;offset;type;_selection;constructor(e,n,r){this._selection=null,this.key=e,this.offset=n,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:No(ce(We(this,"next")),ce(We(e,"next")))<0}getNode(){let e=Y(this.key);return e===null&&O(20),e}set(e,n,r,o){let i=this._selection,s=this.key;o&&this.key===e&&this.offset===n&&this.type===r||(this.key=e,this.offset=n,this.type=r,Tt()||(Re()===s&&V(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}};function ge(t,e,n){return new Mr(t,e,n)}function Qn(t,e){let n=e.__key,r=t.offset,o="element";if(k(e)){o="text";let i=e.getTextContentSize();r>i&&(r=i)}else if(!x(e)){let i=e.getNextSibling();if(k(i))n=i.__key,r=0,o="text";else{let s=e.getParent();s&&(n=s.__key,r=e.getIndexWithinParent()+1)}}t.set(n,r,o)}function Yo(t,e){if(x(e)){let n=e.getLastDescendant();x(n)||k(n)?Qn(t,n):Qn(t,e)}else Qn(t,e)}var Mn=class t{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Xt(e))return!1;let n=this._nodes,r=e._nodes;return n.size===r.size&&Array.from(n).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 t(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let n=this.getNodes(),r=n.length,o=n[r-1],i;if(k(o))i=o.select();else{let s=o.getIndexWithinParent()+1;i=o.getParentOrThrow().select(s,s)}i.insertNodes(e);for(let s=0;s<r;s++)n[s].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let n=this._nodes,r=[];for(let o of n){let i=Y(o);i!==null&&r.push(i)}return Tt()||(this._cachedNodes=r),r}getTextContent(){let e=this.getNodes(),n="";for(let r=0;r<e.length;r++)n+=e[r].getTextContent();return n}deleteNodes(){let e=this.getNodes();if((w()||tt())===this&&e[0]){let n=X(e[0],"next");js(Be(n,n))}for(let n of e)n.remove()}};function I(t){return t instanceof Qe}var Qe=class t{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,n,r,o){this.anchor=e,this.focus=n,e._selection=this,n._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!!I(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let n=(function(r){let o=[],[i,s]=r.getTextSlices();i&&o.push(i.caret.origin);let l=new Set,a=new Set;for(let c of r)if(de(c)){let{origin:u}=c;o.length===0?l.add(u):(a.add(u),o.push(u))}else{let{origin:u}=c;x(u)&&a.has(u)||o.push(u)}if(s&&o.push(s.caret.origin),et(r.focus)&&x(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=ve(r.focus.origin,"previous");de(c)&&l.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(o[o.length-1]);c=Nt(c))l.delete(c.origin),o.pop();for(;o.length>1;){let c=o[o.length-1];if(!x(c)||a.has(c)||c.isEmpty()||l.has(c))break;o.pop()}if(o.length===0&&r.isCollapsed()){let c=ce(r.anchor),u=ce(r.anchor.getFlipped()),g=p=>De(p)?p.origin:p.getNodeAtCaret(),d=g(c)||g(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);o.push(d)}return o})(To(Pr(this),"next"));return Tt()||(this._cachedNodes=n),n}setTextNodeRange(e,n,r,o){this.anchor.set(e.__key,n,"text"),this.focus.set(r.__key,o,"text")}getTextContent(){let e=this.getNodes();if(e.length===0)return"";let n=e[0],r=e[e.length-1],o=this.anchor,i=this.focus,s=o.isBefore(i),[l,a]=Er(this),c="",u=!0;for(let g=0;g<e.length;g++){let d=e[g];if(x(d)&&!d.isInline())u||(c+=`
|
|
9
|
+
`),u=!d.isEmpty();else if(u=!1,k(d)){let p=d.getTextContent();d===n?d===r?o.type==="element"&&i.type==="element"&&i.offset!==o.offset||(p=l<a?p.slice(l,a):p.slice(a,l)):p=s?p.slice(l):p.slice(a):d===r&&(p=s?p.slice(0,a):p.slice(0,l)),c+=p}else!W(d)&&!je(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let n=B(),r=n.getEditorState()._selection,o=gs(e.startContainer,e.startOffset,e.endContainer,e.endOffset,n,r);if(o===null)return;let[i,s]=o;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(s.key,s.offset,s.type,!0),pn(this)}clone(){let e=this.anchor,n=this.focus;return new t(ge(e.key,e.offset,e.type),ge(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Vt(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let n=Z[e];return(this.format&n)!==0}insertRawText(e){let n=e.split(/(\r?\n|\t)/),r=[],o=n.length;for(let i=0;i<o;i++){let s=n[i];s===`
|
|
10
|
+
`||s===`\r
|
|
11
|
+
`?r.push(ft()):s===" "?r.push(Ln()):r.push(G(s))}this.insertNodes(r)}insertText(e){let n=this.anchor,r=this.focus,o=this.format,i=this.style,s=n,l=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,l=n),s.type==="element"&&(function(_,y,C,N){let E=_.getNode(),A=E.getChildAtIndex(_.offset),S=G();if(S.setFormat(C),S.setStyle(N),Ss(A))A.splice(0,0,[S]);else{let D=q(E)?Ae().append(S):S;A===null?E.append(D):A.insertBefore(D)}_.is(y)&&y.set(S.__key,0,"text"),_.set(S.__key,0,"text")})(s,l,o,i),l.type==="element"&&xt(l,ce(We(l,"next")));let a=s.offset,c=l.offset,u=this.getNodes(),g=u.length,d=u[0];k(d)||O(26);let p=d.getTextContent().length,h=d.getParentOrThrow(),m=u[g-1];if(g===1&&l.type==="element"&&(c=p,l.set(s.key,c,"text")),this.isCollapsed()&&a===p&&(Oe(d)||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&d.getNextSibling()===null)){let _=d.getNextSibling();if(k(_)&&_.canInsertTextBefore()&&!Oe(_)||(_=G(),_.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&&(Oe(d)||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&d.getPreviousSibling()===null)){let _=d.getPreviousSibling();if(k(_)&&!Oe(_)||(_=G(),_.setFormat(o),h.canInsertTextBefore()?d.insertBefore(_):h.insertBefore(_)),_.select(),d=_,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&a!==p){let _=G(d.getTextContent());_.setFormat(o),d.replace(_),d=_}else if(!this.isCollapsed()&&e!==""){let _=m.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||x(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),fs(this.anchor,this.focus),void this.insertText(e)}if(g===1){if(Pe(d)){let N=G(e);return N.select(),void d.replace(N)}let _=d.getFormat(),y=d.getStyle();if(a!==c||_===o&&y===i){if(qr(d)){let N=G(e);return N.setFormat(o),N.setStyle(i),N.select(),void d.replace(N)}}else{if(d.getTextContent()!==""){let N=G(e);if(N.setFormat(o),N.setStyle(i),N.select(),a===0)d.insertBefore(N,!1);else{let[E]=d.splitText(a);E.insertAfter(N,!1)}return void(N.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(o),d.setStyle(i)}let C=c-a;d=d.spliceText(a,C,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(this.format=_,this.style=y,d.isComposing()&&(this.anchor.offset-=e.length))}else{let _=new Set([...d.getParentKeys(),...m.getParentKeys()]),y=x(d)?d:d.getParentOrThrow(),C=x(m)?m:m.getParentOrThrow(),N=m;if(!y.is(C)&&C.isInline())do N=C,C=C.getParentOrThrow();while(C.isInline());if(l.type==="text"&&(c!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<c)if(k(m)&&!Pe(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let M=G(m.getTextContent());m.replace(M),m=M}q(l.getNode())||l.type!=="text"||(m=m.spliceText(0,c,"")),_.add(m.__key)}else{let M=m.getParentOrThrow();M.canBeEmpty()||M.getChildrenSize()!==1?m.remove():M.remove()}else _.add(m.__key);let E=C.getChildren(),A=new Set(u),S=y.is(C),D=y.isInline()&&d.getNextSibling()===null?y:d;for(let M=E.length-1;M>=0;M--){let T=E[M];if(T.is(d)||x(T)&&T.isParentOf(d))break;T.isAttached()&&(!A.has(T)||T.is(N)?S||D.insertAfter(T,!1):T.remove())}if(!S){let M=C,T=null;for(;M!==null;){let b=M.getChildren(),P=b.length;(P===0||b[P-1].is(T))&&(_.delete(M.__key),T=M),M=M.getParent()}}if(Pe(d))if(a===p)d.select();else{let M=G(e);M.select(),d.replace(M)}else d=d.spliceText(a,p-a,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length));for(let M=1;M<g;M++){let T=u[M],b=T.__key;_.has(b)||T.remove()}}}removeText(){let e=w()===this;$t(this,Js(Pr(this))),e&&w()!==this&&re(this)}formatText(e,n=null){if(this.isCollapsed())return this.toggleFormat(e),void V(null);let r=this.getNodes(),o=[];for(let E of r)k(E)&&o.push(E);let i=E=>{r.forEach(A=>{if(x(A)){let S=A.getFormatFlags(e,E);A.setTextFormat(S)}})},s=o.length;if(s===0)return this.toggleFormat(e),V(null),void i(n);let l=this.anchor,a=this.focus,c=this.isBackward(),u=c?a:l,g=c?l:a,d=0,p=o[0],h=u.type==="element"?0:u.offset;if(u.type==="text"&&h===p.getTextContentSize()&&(d=1,p=o[1],h=0),p==null)return;let m=p.getFormatFlags(e,n);i(m);let _=s-1,y=o[_],C=g.type==="text"?g.offset:y.getTextContentSize();if(p.is(y)){if(h===C)return;if(Oe(p)||h===0&&C===p.getTextContentSize())p.setFormat(m);else{let E=p.splitText(h,C),A=h===0?E[0]:E[1];A.setFormat(m),u.type==="text"&&u.set(A.__key,0,"text"),g.type==="text"&&g.set(A.__key,C-h,"text")}return void(this.format=m)}h===0||Oe(p)||([,p]=p.splitText(h),h=0),p.setFormat(m);let N=y.getFormatFlags(e,m);C>0&&(C===y.getTextContentSize()||Oe(y)||([y]=y.splitText(C)),y.setFormat(N));for(let E=d+1;E<_;E++){let A=o[E],S=A.getFormatFlags(e,N);A.setFormat(S)}u.type==="text"&&u.set(p.__key,h,"text"),g.type==="text"&&g.set(y.__key,C,"text"),this.format=m|N}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();let h=w();return I(h)||O(134),h.insertNodes(e)}let n=(this.isBackward()?this.focus:this.anchor).getNode(),r=wt(n,Ee),o=e[e.length-1];if(x(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let h=Zn(this);r.splice(h,0,e),o.selectEnd()}return}if(!e.some(h=>(x(h)||W(h))&&!h.isInline())){x(r)||O(211,n.constructor.name,n.getType());let h=Zn(this);return r.splice(h,0,e),void o.selectEnd()}let i=(function(h){let m=Ae(),_=null;for(let y=0;y<h.length;y++){let C=h[y],N=je(C);if(N||W(C)&&C.isInline()||x(C)&&C.isInline()||k(C)||C.isParentRequired()){if(_===null&&(_=C.createParentElementNode(),m.append(_),N))continue;_!==null&&_.append(C)}else m.append(C),_=null}return m})(e),s=i.getLastDescendant(),l=i.getChildren(),a=!x(r)||!r.isEmpty()?this.insertParagraph():null,c=l[l.length-1],u=l[0];var g;x(g=u)&&Ee(g)&&!g.isEmpty()&&x(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(x(r)||O(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=l[1]),u&&(r===null&&O(212,n.constructor.name,n.getType()),(function(h,m){let _=m.getParentOrThrow().getLastChild(),y=m,C=[m];for(;y!==_;)y.getNextSibling()||O(140),y=y.getNextSibling(),C.push(y);let N=h;for(let E of C)N=N.insertAfter(E)})(r,u));let d=wt(s,Ee);a&&x(d)&&(a.canMergeWhenEmpty()||Ee(c))&&(d.append(...a.getChildren()),a.remove()),x(r)&&r.isEmpty()&&r.remove(),s.selectEnd();let p=x(r)?r.getLastChild():null;je(p)&&d!==r&&p.remove()}insertParagraph(){if(this.anchor.key==="root"){let s=Ae();return oe().splice(this.anchor.offset,0,[s]),s.select(),s}let e=Zn(this),n=wt(this.anchor.getNode(),Ee);x(n)||O(213);let r=n.getChildAtIndex(e),o=r?[r,...r.getNextSiblings()]:[],i=n.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(e){let n=ft();if(this.insertNodes([n]),e){let r=n.getParentOrThrow(),o=n.getIndexWithinParent();r.select(o,o)}}extract(){let e=[...this.getNodes()],n=e.length,r=e[0],o=e[n-1],[i,s]=Er(this),l=this.isBackward(),[a,c]=l?[this.focus,this.anchor]:[this.anchor,this.focus],[u,g]=l?[s,i]:[i,s];if(n===0)return[];if(n===1){if(k(r)&&!this.isCollapsed()){let d=r.splitText(u,g),p=u===0?d[0]:d[1];return p?(a.set(p.getKey(),0,"text"),c.set(p.getKey(),p.getTextContentSize(),"text"),[p]):[]}return[r]}if(k(r)&&(u===r.getTextContentSize()?e.shift():u!==0&&([,r]=r.splitText(u),e[0]=r,a.set(r.getKey(),0,"text"))),k(o)){let d=o.getTextContent().length;g===0?e.pop():g!==d&&([o]=o.splitText(g),e[e.length-1]=o,c.set(o.getKey(),o.getTextContentSize(),"text"))}return e}modify(e,n,r){if(Zo(this,e,n,r))return;let o=e==="move",i=B(),s=_e(ie(i));if(!s)return;let l=i._blockCursorElement,a=i._rootElement,c=this.focus.getNode();if(a===null||l===null||!x(c)||c.isInline()||c.canBeEmpty()||vr(l,i,a),this.dirty){let u=pt(i,this.anchor.key),g=pt(i,this.focus.key);this.anchor.type==="text"&&(u=Ze(u)),this.focus.type==="text"&&(g=Ze(g)),u&&g&&ps(s,u,this.anchor.offset,g,this.focus.offset)}if((function(u,g,d,p){u.modify(g,d,p)})(s,e,n?"backward":"forward",r),s.rangeCount>0){let u=s.getRangeAt(0),g=this.anchor.getNode(),d=q(g)?g:Ks(g);if(this.applyDOMRange(u),this.dirty=!0,!o){let p=this.getNodes(),h=[],m=!1;for(let _=0;_<p.length;_++){let y=p[_];kn(y,d)?h.push(y):m=!0}if(m&&h.length>0)if(n){let _=h[0];x(_)?_.selectStart():_.getParentOrThrow().selectStart()}else{let _=h[h.length-1];x(_)?_.selectEnd():_.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(_){let y=_.focus,C=_.anchor,N=C.key,E=C.offset,A=C.type;C.set(y.key,y.offset,y.type,!0),y.set(N,E,A,!0)})(this)}}r==="lineboundary"&&Zo(this,e,n,r,"decorators")}forwardDeletion(e,n,r){if(!r&&(e.type==="element"&&x(n)&&e.offset===n.getChildrenSize()||e.type==="text"&&e.offset===n.getTextContentSize())){let o=n.getParent(),i=n.getNextSibling()||(o===null?null:o.getNextSibling());if(x(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(e){let n=this.isCollapsed();if(this.isCollapsed()){let r=this.anchor,o=r.getNode();if(this.forwardDeletion(r,o,e))return;let i=yo(We(r,e?"previous":"next"));if(i.getTextSlices().every(l=>l===null||l.distance===0)){let l={type:"initial"};for(let a of i.iterNodeCarets("shadowRoot"))if(de(a)){if(!a.origin.isInline()){if(a.origin.isShadowRoot()){if(l.type==="merge-block")break;if(x(i.anchor.origin)&&i.anchor.origin.isEmpty()){let c=ce(a);$t(this,Be(c,c)),i.anchor.origin.remove()}return}l.type!=="merge-next-block"&&l.type!=="merge-block"||(l={block:l.block,caret:a,type:"merge-block"})}}else{if(l.type==="merge-block")break;if(et(a)){if(x(a.origin)){if(a.origin.isInline()){if(!a.origin.isParentOf(i.anchor.origin))break}else l={block:a.origin,type:"merge-next-block"};continue}if(W(a.origin)){if(!a.origin.isIsolated())if(l.type==="merge-next-block"&&(a.origin.isKeyboardSelectable()||!a.origin.isInline())&&x(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let c=Qr();c.add(a.origin.getKey()),re(c)}else a.origin.remove();return}break}}if(l.type==="merge-block"){let{caret:a,block:c}=l;return $t(this,Be(!a.origin.isEmpty()&&c.isEmpty()?Ot(X(c,a.direction)):i.anchor,a)),this.removeText()}}let s=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&Ho(this,r.getNode()))return}else{let l=s.type==="text"?s.getNode():null;if(o=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){let a=s.offset,c=l.getTextContentSize();if(l.is(o)||e&&a!==c||!e&&a!==0)return void Vo(l,e,a)}else if(o!==null&&o.isSegmented()){let a=r.offset,c=o.getTextContentSize();if(o.is(l)||e&&a!==0||!e&&a!==c)return void Vo(o,e,a)}(function(a,c){let u=a.anchor,g=a.focus,d=u.getNode(),p=g.getNode();if(d===p&&u.type==="text"&&g.type==="text"){let h=u.offset,m=g.offset,_=h<m,y=_?h:m,C=_?m:h,N=C-1;y!==N&&(function(E){return!(Is(E)||ha(E))})(d.getTextContent().slice(y,C))&&(c?g.set(g.key,N,g.type):u.set(u.key,N,u.type))}})(this,e)}}if(this.removeText(),e&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let r=this.anchor.getNode();r.isEmpty()&&q(r.getParent())&&r.getPreviousSibling()===null&&Ho(this,r)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,e))return;this.modify("extend",e,"word")}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function Xt(t){return t instanceof Mn}function Go(t){let e=t.offset;if(t.type==="text")return e;let n=t.getNode();return e===n.getChildrenSize()?n.getTextContent().length:0}function Er(t){let e=t.getStartEndPoints();if(e===null)return[0,0];let[n,r]=e;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[Go(n),Go(r)]}function Ho(t,e){for(let n=e;n;n=n.getParent()){if(x(n)){if(n.collapseAtStart(t))return!0;if(le(n))break}if(n.getPreviousSibling())break}return!1}var ha=(()=>{try{let t=new RegExp("\\p{Emoji}","u"),e=t.test.bind(t);if(e("\u2764\uFE0F")&&e("#\uFE0F\u20E3")&&e("\u{1F44D}"))return e}catch{}return()=>!1})();function Vo(t,e,n){let r=t,o=r.getTextContent().split(/(?=\s)/g),i=o.length,s=0,l=0;for(let c=0;c<i;c++){let u=c===i-1;if(l=s,s+=o[c].length,e&&s===n||s>n||u){o.splice(c,1),u&&(l=void 0);break}}let a=o.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function jo(t,e,n,r){let o,i=e;if(ee(t)){let s=!1,l=t.childNodes,a=l.length,c=r._blockCursorElement;i===a&&(s=!0,i=a-1);let u=l[i],g=!1;if(u===c)u=l[i+1],g=!0;else if(c!==null){let d=c.parentNode;t===d&&e>Array.prototype.indexOf.call(d.children,c)&&i--}if(o=lt(u),k(o))i=fe(o,s?"next":"previous");else{let d=lt(t);if(d===null)return null;if(x(d)){let p=r.getElementByKey(d.getKey());p===null&&O(214),[d,i]=d.getDOMSlot(p).resolveChildIndex(d,p,t,e),x(d)||O(215),s&&i>=d.getChildrenSize()&&(i=Math.max(0,d.getChildrenSize()-1));let m=d.getChildAtIndex(i);if(x(m)&&(function(_,y,C){let N=_.getParent();return C===null||N===null||!N.canBeEmpty()||N!==C.getNode()})(m,0,n)){let _=s?m.getLastDescendant():m.getFirstDescendant();_===null?d=m:(m=_,d=x(m)?m:m.getParentOrThrow()),i=0}k(m)?(o=m,d=null,i=fe(m,s?"next":"previous")):m!==d&&s&&!g&&(x(d)||O(216),i=Math.min(d.getChildrenSize(),i+1))}else{let p=d.getIndexWithinParent();i=e===0&&W(d)&<(t)===d?p:p+1,d=d.getParentOrThrow()}if(x(d))return ge(d.__key,i,"element")}}else o=lt(t);return k(o)?ge(o.__key,fe(o,i,"clamp"),"text"):null}function Jo(t,e,n){let r=t.offset,o=t.getNode();if(r===0){let i=o.getPreviousSibling(),s=o.getParent();if(e){if((n||!e)&&i===null&&x(s)&&s.isInline()){let l=s.getPreviousSibling();k(l)&&t.set(l.__key,l.getTextContent().length,"text")}}else x(i)&&!n&&i.isInline()?t.set(i.__key,i.getChildrenSize(),"element"):k(i)&&t.set(i.__key,i.getTextContent().length,"text")}else if(r===o.getTextContent().length){let i=o.getNextSibling(),s=o.getParent();if(e&&x(i)&&i.isInline())t.set(i.__key,0,"element");else if((n||e)&&i===null&&x(s)&&s.isInline()&&!s.canInsertTextAfter()){let l=s.getNextSibling();k(l)&&t.set(l.__key,0,"text")}}}function fs(t,e,n){if(t.type==="text"&&e.type==="text"){let r=t.isBefore(e),o=t.is(e);Jo(t,r,o),Jo(e,!r,o),o&&e.set(t.key,t.offset,t.type)}}function gs(t,e,n,r,o,i){if(t===null||n===null||!qt(o,t,n))return null;let s=jo(t,e,I(i)?i.anchor:null,o);if(s===null)return null;let l=jo(n,r,I(i)?i.focus:null,o);if(l===null)return null;if(s.type==="element"&&l.type==="element"){let a=lt(t),c=lt(n);if(W(a)&&W(c))return null}return fs(s,l),[s,l]}function _a(t){return x(t)&&!t.isInline()}function hs(t,e,n,r,o,i){let s=ke(),l=new Qe(ge(t,e,o),ge(n,r,i),0,"");return l.dirty=!0,s._selection=l,l}function _s(){let t=ge("root",0,"element"),e=ge("root",0,"element");return new Qe(t,e,0,"")}function Qr(){return new Mn(new Set)}function pa(t,e){return $n(null,t,e,null)}function $n(t,e,n,r){let o=n._window;if(o===null)return null;let i=r||o.event,s=i?i.type:void 0,l=s==="selectionchange",a=!sr&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0),c,u,g,d;if(I(t)&&!a)return t.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,g=e.anchorOffset,d=e.focusOffset,(l||s===void 0)&&I(t)&&!qt(n,c,u))return t.clone();let p=gs(c,g,u,d,n,t);if(p===null)return null;let[h,m]=p,_=0,y="";if(I(t)){let C=t.anchor;if(h.key===C.key)_=t.format,y=t.style;else{let N=h.getNode();k(N)?(_=N.getFormat(),y=N.getStyle()):x(N)&&(_=N.getTextFormat(),y=N.getTextStyle())}}return new Qe(h,m,_,y)}function w(){return ke()._selection}function tt(){return B()._editorState._selection}function En(t,e,n,r=1){let o=t.anchor,i=t.focus,s=o.getNode(),l=i.getNode();if(!e.is(s)&&!e.is(l))return;let a=e.__key;if(t.isCollapsed()){let c=o.offset;if(n<=c&&r>0||n<c&&r<0){let u=Math.max(0,c+r);o.set(a,u,"element"),i.set(a,u,"element"),Xo(t)}}else{let c=t.isBackward(),u=c?i:o,g=u.getNode(),d=c?o:i,p=d.getNode();if(e.is(g)){let h=u.offset;(n<=h&&r>0||n<h&&r<0)&&u.set(a,Math.max(0,h+r),"element")}if(e.is(p)){let h=d.offset;(n<=h&&r>0||n<h&&r<0)&&d.set(a,Math.max(0,h+r),"element")}}Xo(t)}function Xo(t){let e=t.anchor,n=e.offset,r=t.focus,o=r.offset,i=e.getNode(),s=r.getNode();if(t.isCollapsed()){if(!x(i))return;let l=i.getChildrenSize(),a=n>=l,c=a?i.getChildAtIndex(l-1):i.getChildAtIndex(n);if(k(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(x(i)){let l=i.getChildrenSize(),a=n>=l,c=a?i.getChildAtIndex(l-1):i.getChildAtIndex(n);if(k(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(x(s)){let l=s.getChildrenSize(),a=o>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(o);if(k(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function An(t,e,n,r,o){let i=null,s=0,l=null;r!==null?(i=r.__key,k(r)?(s=r.getTextContentSize(),l="text"):x(r)&&(s=r.getChildrenSize(),l="element")):o!==null&&(i=o.__key,k(o)?l="text":x(o)&&(l="element")),i!==null&&l!==null?t.set(i,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),t.set(n.__key,s,"element"))}function qo(t,e,n,r,o){t.type==="text"?t.set(n,t.offset+(e?0:o),"text"):t.offset>r.getIndexWithinParent()&&t.set(t.key,t.offset-1,"element")}function ps(t,e,n,r,o){try{t.setBaseAndExtent(e,n,r,o)}catch{}}function Qo(t,e,n){let r=pt(t,e.getKey());if(x(e)){let o=e.getDOMSlot(r);return[o.element,n+o.getFirstChildOffset()]}return[r,n]}function ma(t,e,n,r,o,i,s){let l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,g=document.activeElement;if(o.has(is)&&g!==i||g!==null&&oo(g))return;if(!I(e))return void(t!==null&&qt(n,l,a)&&r.removeAllRanges());let d=e.anchor,p=e.focus,h=d.getNode(),m=p.getNode(),[_,y]=Qo(n,h,d.offset),[C,N]=Qo(n,m,p.offset),E=e.format,A=e.style,S=e.isCollapsed(),D=_,M=C,T=!1;var b,P,K,$,L;if(d.type==="text"?(D=Ze(_),T=h.getFormat()!==E||h.getStyle()!==A):I(t)&&t.anchor.type==="text"&&(T=!0),p.type==="text"&&(M=Ze(C)),D!==null&&M!==null&&(S&&(t===null||T||I(t)&&(t.format!==E||t.style!==A))&&(b=E,P=A,K=y,$=d.key,L=performance.now(),Qi=[b,P,K,$,L]),c!==y||u!==N||l!==D||a!==M||r.type==="Range"&&S||(g!==null&&i.contains(g)||o.has(Or)||i.focus({preventScroll:!0}),d.type==="element"))){if(ps(r,D,y,M,N),!Le||!e.isCollapsed()||i===null||o.has(Or)||document.activeElement!==null&&i.contains(document.activeElement)||i.focus({preventScroll:!0}),!o.has(ss)&&e.isCollapsed()&&i!==null&&i===document.activeElement){let z=I(e)&&e.anchor.type==="element"?D.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(z!==null){let te;if(z instanceof Text){let pe=document.createRange();pe.selectNode(z),te=pe.getBoundingClientRect()}else te=z.getBoundingClientRect();(function(pe,nt,Ne){let rt=fo(Ne),Un=go(rt);if(rt===null||Un===null)return;let{top:Yn,bottom:Gn}=nt,Mt=0,Et=0,be=Ne;for(;be!==null;){let Hn=be===rt.body;if(Hn){Mt=0,Et=ie(pe).innerHeight;let Ye=Un.getComputedStyle(rt.documentElement),Dt=parseFloat(Ye.scrollPaddingTop),Oo=parseFloat(Ye.scrollPaddingBottom);isFinite(Dt)&&(Mt+=Dt),isFinite(Oo)&&(Et-=Oo)}else{let Ye=be.getBoundingClientRect();Mt=Ye.top,Et=Ye.bottom}let At=0;if(Yn<Mt?At=-(Mt-Yn):Gn>Et&&(At=Gn-Et),At!==0)if(Hn)Un.scrollBy(0,At);else{let Ye=be.scrollTop;be.scrollTop+=At;let Dt=be.scrollTop-Ye;Yn-=Dt,Gn-=Dt}if(Hn)break;be=Zt(be)}})(n,te,i)}}xr=!0}}function ya(t){let e=w()||tt();e===null&&(e=oe().selectEnd()),e.insertNodes(t)}function Ca(){let t=w();return t===null?"":t.getTextContent()}function Zn(t){let e=t;t.isCollapsed()||e.removeText();let n=w();I(n)&&(e=n),I(e)||O(161);let r=e.anchor,o=r.getNode(),i=r.offset;for(;!Ee(o);){let s=o;if([o,i]=Na(o,i),s.is(o))break}return i}function Na(t,e){let n=t.getParent();if(!n){let o=Ae();return oe().append(o),o.select(),[oe(),0]}if(k(t)){let o=t.splitText(e);if(o.length===0)return[n,t.getIndexWithinParent()];let i=e===0?0:1;return[n,o[0].getIndexWithinParent()+i]}if(!x(t)||e===0)return[n,t.getIndexWithinParent()];let r=t.getChildAtIndex(e);if(r){let o=new Qe(ge(t.__key,e,"element"),ge(t.__key,e,"element"),0,""),i=t.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[n,t.getIndexWithinParent()+1]}function Zo(t,e,n,r,o="decorators-and-blocks"){if(e==="move"&&r==="character"&&!t.isCollapsed()){let[u,g]=n===t.isBackward()?[t.focus,t.anchor]:[t.anchor,t.focus];return g.set(u.key,u.offset,u.type),!0}let i=We(t.focus,n?"previous":"next"),s=r==="lineboundary",l=e==="move",a=i,c=o==="decorators-and-blocks";if(!Xs(a)){for(let u of a){c=!1;let{origin:g}=u;if(!W(g)||g.isIsolated()||(a=u,!s||!g.isInline()))break}if(c)for(let u of yo(i).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(de(u))u.origin.isInline()||(a=u);else{if(x(u.origin))continue;W(u.origin)&&!u.origin.isInline()&&(a=u)}break}}if(a===i)return!1;if(l&&!s&&W(a.origin)&&a.origin.isKeyboardSelectable()){let u=Qr();return u.add(a.origin.getKey()),re(u),!0}return a=ce(a),l&&xt(t.anchor,a),xt(t.focus,a),c||!s}var j=null,J=null,ne=!1,er=!1,gn=0,ei={characterData:!0,childList:!0,subtree:!0};function Tt(){return ne||j!==null&&j._readOnly}function H(){ne&&O(13)}function ms(){gn>99&&O(14)}function ke(){return j===null&&O(195,ys()),j}function B(){return J===null&&O(196,ys()),J}function ys(){let t=0,e=new Set,n=Fe.version;if(typeof window<"u")for(let o of document.querySelectorAll("[contenteditable]")){let i=Qt(o);if(Kn(i))t++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${t} compatible editor(s) with version ${n}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function xa(){return J}function ti(t,e,n){let r=e.__type,o=no(t,r),i=n.get(r);i===void 0&&(i=Array.from(o.transforms),n.set(r,i));let s=i.length;for(let l=0;l<s&&(i[l](e),e.isAttached());l++);}function ni(t,e){return t!==void 0&&t.__key!==e&&t.isAttached()}function Cs(t,e){if(!e)return;let n=t._updateTags,r=e;Array.isArray(e)||(r=[e]);for(let o of r)n.add(o)}function Ta(t){return Zr(t,B()._nodes)}function Zr(t,e){let n=t.type,r=e.get(n);r===void 0&&O(17,n);let o=r.klass;t.type!==o.getType()&&O(18,o.name);let i=o.importJSON(t),s=t.children;if(x(i)&&Array.isArray(s))for(let l=0;l<s.length;l++){let a=Zr(s[l],e);i.append(a)}return i}function ri(t,e,n){let r=j,o=ne,i=J;j=e,ne=!0,J=t;try{return n()}finally{j=r,ne=o,J=i}}function Me(t,e){let n=t._pendingEditorState,r=t._rootElement,o=t._headless||r===null;if(n===null)return;let i=t._editorState,s=i._selection,l=n._selection,a=t._dirtyType!==0,c=j,u=ne,g=J,d=t._updating,p=t._observer,h=null;if(t._pendingEditorState=null,t._editorState=n,!o&&a&&p!==null){J=t,j=n,ne=!1,t._updating=!0;try{let S=t._dirtyType,D=t._dirtyElements,M=t._dirtyLeaves;p.disconnect(),h=Wl(i,n,t,S,D,M)}catch(S){if(S instanceof Error&&t._onError(S),er)throw S;return Os(t,null,r,n),Oi(t),t._dirtyType=2,er=!0,Me(t,i),void(er=!1)}finally{p.observe(r,ei),t._updating=d,j=c,ne=u,J=g}}n._readOnly||(n._readOnly=!0);let m=t._dirtyLeaves,_=t._dirtyElements,y=t._normalizedNodes,C=t._updateTags,N=t._deferred;a&&(t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements=new Map,t._normalizedNodes=new Set,t._updateTags=new Set),(function(S,D){let M=S._decorators,T=S._pendingDecorators||M,b=D._nodeMap,P;for(P in T)b.has(P)||(T===M&&(T=ks(S)),delete T[P])})(t,n);let E=o?null:_e(ie(t));if(t._editable&&E!==null&&(a||l===null||l.dirty||!l.is(s))&&r!==null&&!C.has(ls)){J=t,j=n;try{if(p!==null&&p.disconnect(),a||l===null||l.dirty){let S=t._blockCursorElement;S!==null&&vr(S,t,r),ma(s,l,t,E,C,r)}(function(S,D,M){let T=S._blockCursorElement;if(I(M)&&M.isCollapsed()&&M.anchor.type==="element"&&D.contains(document.activeElement)){let b=M.anchor,P=b.getNode(),K=b.offset,$=!1,L=null;if(K===P.getChildrenSize())nr(P.getChildAtIndex(K-1))&&($=!0);else{let z=P.getChildAtIndex(K);if(z!==null&&nr(z)){let te=z.getPreviousSibling();(te===null||nr(te))&&($=!0,L=S.getElementByKey(z.__key))}}if($){let z=S.getElementByKey(P.__key);return T===null&&(S._blockCursorElement=T=(function(te){let pe=te.theme,nt=document.createElement("div");nt.contentEditable="false",nt.setAttribute("data-lexical-cursor","true");let Ne=pe.blockCursor;if(Ne!==void 0){if(typeof Ne=="string"){let rt=nn(Ne);Ne=pe.blockCursor=rt}Ne!==void 0&&nt.classList.add(...Ne)}return nt})(S._config)),D.style.caretColor="transparent",void(L===null?z.appendChild(T):z.insertBefore(T,L))}}T!==null&&vr(T,S,D)})(t,r,l)}finally{p!==null&&p.observe(r,ei),J=g,j=c}}h!==null&&(function(S,D,M,T,b){let P=Array.from(S._listeners.mutation),K=P.length;for(let $=0;$<K;$++){let[L,z]=P[$];for(let te of z){let pe=D.get(te);pe!==void 0&&L(pe,{dirtyLeaves:T,prevEditorState:b,updateTags:M})}}})(t,h,C,m,i),I(l)||l===null||s!==null&&s.is(l)||t.dispatchCommand(Kr,void 0);let A=t._pendingDecorators;A!==null&&(t._decorators=A,t._pendingDecorators=null,Pt("decorator",t,!0,A)),(function(S,D,M){let T=li(D),b=li(M);T!==b&&Pt("textcontent",S,!0,b)})(t,e||i,n),Pt("update",t,!0,{dirtyElements:_,dirtyLeaves:m,editorState:n,mutatedNodes:h,normalizedNodes:y,prevEditorState:e||i,tags:C}),(function(S,D){if(S._deferred=[],D.length!==0){let M=S._updating;S._updating=!0;try{for(let T=0;T<D.length;T++)D[T]()}finally{S._updating=M}}})(t,N),(function(S){let D=S._updates;if(D.length!==0){let M=D.shift();if(M){let[T,b]=M;Fn(S,T,b)}}})(t)}function Pt(t,e,n,...r){let o=e._updating;e._updating=n;try{let i=e._listeners[t],s=Array.from(i);for(let[l,a]of s){a&&a();let c=l(...r);i.has(l)?i.set(l,c):c&&c()}}finally{e._updating=o}}function Ns(t,e,n,r){let o=lo(t),i;for(let s=4;s>=0;s--)for(let l=0;l<o.length;l++){let a=o[l];if(l>0&&a._updating){i=a;break}let c=a._commands.get(e);if(c!==void 0){let u=c[s];if(u!==void 0){let g=Array.from(u),d=g.length,p=!1;if(ye(a,()=>{for(let h=0;h<d;h++)if(g[h](n,r))return void(p=!0)}),p)return p}}}return i&&i.update(()=>{Ns(i,e,n,r)}),!1}function oi(t,e){let n=t._updates,r=e||!1;for(;n.length!==0;){let o=n.shift();if(o){let[i,s]=o,l=t._pendingEditorState,a;s!==void 0&&(a=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(l===null&&O(191),l._flushSync=!0),a&&t._deferred.push(a),Cs(t,s.tag)),l==null?Fn(t,i,s):i()}}return r}function Fn(t,e,n){let r=t._updateTags,o,i=!1,s=!1;n!==void 0&&(o=n.onUpdate,Cs(t,n.tag),i=n.skipTransforms||!1,s=n.discrete||!1),o&&t._deferred.push(o);let l=t._editorState,a=t._pendingEditorState,c=!1;(a===null||a._readOnly)&&(a=t._pendingEditorState=xs(a||l),c=!0),a._flushSync=s;let u=j,g=ne,d=J,p=t._updating;j=a,ne=!1,t._updating=!0,J=t;let h=t._headless||t.getRootElement()===null;to(null);try{c&&(h?l._selection!==null&&(a._selection=l._selection.clone()):a._selection=(function(C,N){let E=C.getEditorState()._selection,A=_e(ie(C));return I(E)||E==null?$n(E,A,C,N):E.clone()})(t,n&&n.event||null));let _=t._compositionKey;e(),i=oi(t,i),(function(C,N){let E=N.getEditorState()._selection,A=C._selection;if(I(A)){let S=A.anchor,D=A.focus,M;if(S.type==="text"&&(M=S.getNode(),M.selectionTransform(E,A)),D.type==="text"){let T=D.getNode();M!==T&&T.selectionTransform(E,A)}}})(a,t),t._dirtyType!==0&&(i?(function(C,N){let E=N._dirtyLeaves,A=C._nodeMap;for(let S of E){let D=A.get(S);k(D)&&D.isAttached()&&D.isSimpleText()&&!D.isUnmergeable()&&Io(D)}})(a,t):(function(C,N){let E=N._dirtyLeaves,A=N._dirtyElements,S=C._nodeMap,D=Re(),M=new Map,T=E,b=T.size,P=A,K=P.size;for(;b>0||K>0;){if(b>0){N._dirtyLeaves=new Set;for(let $ of T){let L=S.get($);k(L)&&L.isAttached()&&L.isSimpleText()&&!L.isUnmergeable()&&Io(L),L!==void 0&&ni(L,D)&&ti(N,L,M),E.add($)}if(T=N._dirtyLeaves,b=T.size,b>0){gn++;continue}}N._dirtyLeaves=new Set,N._dirtyElements=new Map,P.delete("root")&&P.set("root",!0);for(let $ of P){let L=$[0],z=$[1];if(A.set(L,z),!z)continue;let te=S.get(L);te!==void 0&&ni(te,D)&&ti(N,te,M)}T=N._dirtyLeaves,b=T.size,P=N._dirtyElements,K=P.size,gn++}N._dirtyLeaves=E,N._dirtyElements=A})(a,t),oi(t),(function(C,N,E,A){let S=C._nodeMap,D=N._nodeMap,M=[];for(let[T]of A){let b=D.get(T);b!==void 0&&(b.isAttached()||(x(b)&&xi(b,T,S,D,M,A),S.has(T)||A.delete(T),M.push(T)))}for(let T of M)D.delete(T);for(let T of E){let b=D.get(T);b===void 0||b.isAttached()||(S.has(T)||E.delete(T),D.delete(T))}})(l,a,t._dirtyLeaves,t._dirtyElements)),_!==t._compositionKey&&(a._flushSync=!0);let y=a._selection;if(I(y)){let C=a._nodeMap,N=y.anchor.key,E=y.focus.key;C.get(N)!==void 0&&C.get(E)!==void 0||O(19)}else Xt(y)&&y._nodes.size===0&&(a._selection=null)}catch(_){return _ instanceof Error&&t._onError(_),t._pendingEditorState=l,t._dirtyType=2,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),void Me(t)}finally{j=u,ne=g,J=d,t._updating=p,gn=0}t._dirtyType!==0||t._deferred.length>0||(function(_,y){let C=y.getEditorState()._selection,N=_._selection;if(N!==null){if(N.dirty||!N.is(C))return!0}else if(C!==null)return!0;return!1})(a,t)?a._flushSync?(a._flushSync=!1,Me(t)):c&&Ia(()=>{Me(t)}):(a._flushSync=!1,c&&(r.clear(),t._deferred=[],t._pendingEditorState=null))}function ye(t,e,n){J===t&&n===void 0?e():Fn(t,e,n)}var Ar=class t{element;before;after;constructor(e,n,r){this.element=e,this.before=n||null,this.after=r||null}withBefore(e){return new t(this.element,e,this.after)}withAfter(e){return new t(this.element,this.before,e)}withElement(e){return this.element===e?this:new t(e,this.before,this.after)}insertChild(e){let n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&O(222),this.element.insertBefore(e,n),this}removeChild(e){return e.parentElement!==this.element&&O(223),this.element.removeChild(e),this}replaceChild(e,n){return n.parentElement!==this.element&&O(224),this.element.replaceChild(e,n),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{let n=e==="decorator"&&(Rn||Jt||In);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let n=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&n.removeChild(r),n.removeChild(e),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let n=this.getManagedLineBreak();if(n){if(e===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}let r=this.element,o=this.before,i=document.createElement("br");if(r.insertBefore(i,o),e){let s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let n=this.after;n!==null;n=n.previousSibling)e++;return e}resolveChildIndex(e,n,r,o){if(r===this.element){let a=this.getFirstChildOffset();return[e,Math.min(a+e.getChildrenSize(),Math.max(a,o))]}let i=ii(n,r);i.push(o);let s=ii(n,this.element),l=e.getIndexWithinParent();for(let a=0;a<s.length;a++){let c=i[a],u=s[a];if(c===void 0||c<u)break;if(c>u){l+=1;break}}return[e.getParentOrThrow(),l]}};function ii(t,e){let n=[],r=e;for(;r!==t&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;n.push(o)}return r!==t&&O(225),n.reverse()}var $e=class extends se{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(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,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){let e=this.getFormat();return Al[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getChildrenKeys(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n.__key),n=n.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=B()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(e)}getAllTextNodes(){let e=[],n=this.getFirstChild();for(;n!==null;){if(k(n)&&e.push(n),x(n)){let r=n.getAllTextNodes();e.push(...r)}n=n.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;x(e);){let n=e.getFirstChild();if(n===null)break;e=n}return e}getLastDescendant(){let e=this.getLastChild();for(;x(e);){let n=e.getLastChild();if(n===null)break;e=n}return e}getDescendantByIndex(e){let n=this.getChildren(),r=n.length;if(e>=r){let i=n[r-1];return x(i)&&i.getLastDescendant()||i||null}let o=n[e];return x(o)&&o.getFirstDescendant()||o||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:Y(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&O(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:Y(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&O(96,this.__key),e}getChildAtIndex(e){let n=this.getChildrenSize(),r,o;if(e<n/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=n-1;r!==null&&o>=e;){if(o===e)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let e="",n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){let i=n[o];e+=i.getTextContent(),x(i)&&o!==r-1&&!i.isInline()&&(e+=Pn)}return e}getTextContentSize(){let e=0,n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){let i=n[o];e+=i.getTextContentSize(),x(i)&&o!==r-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){let n=ir[e];return(this.getFormat()&n)!==0}return!1}hasTextFormat(e){let n=Z[e];return(this.getTextFormat()&n)!==0}getFormatFlags(e,n){return Vt(this.getLatest().__textFormat,e,n)}getTextStyle(){return this.getLatest().__textStyle}select(e,n){H();let r=w(),o=e,i=n,s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&n===0){let a=this.getFirstChild();if(k(a)||x(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||n!==void 0&&n!==s)){let a=this.getLastChild();if(k(a)||x(a))return a.select()}}o===void 0&&(o=s),i===void 0&&(i=s);let l=this.__key;return I(r)?(r.anchor.set(l,o,"element"),r.focus.set(l,i,"element"),r.dirty=!0,r):hs(l,o,l,i,"element","element")}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(n=>n.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let n=this.getWritable();return n.__dir=e,n}setFormat(e){return this.getWritable().__format=e!==""?ir[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let n=this.getWritable();return n.__textFormat=e,n}setTextStyle(e){let n=this.getWritable();return n.__textStyle=e,n}setIndent(e){return this.getWritable().__indent=e,this}splice(e,n,r){On(this)&&O(324,this.__key,this.__type);let o=this.getChildrenSize(),i=this.getWritable();e+n<=o||O(226,String(e),String(n),String(o));let s=i.__key,l=[],a=[],c=this.getChildAtIndex(e+n),u=null,g=o-n+r.length;if(e!==0)if(e===o)u=this.getLastChild();else{let p=this.getChildAtIndex(e);p!==null&&(u=p.getPreviousSibling())}if(n>0){let p=u===null?this.getFirstChild():u.getNextSibling();for(let h=0;h<n;h++){p===null&&O(100);let m=p.getNextSibling(),_=p.__key;we(p.getWritable()),a.push(_),p=m}}let d=u;for(let p of r){d!==null&&p.is(d)&&(u=d=d.getPreviousSibling());let h=p.getWritable();h.__parent===s&&g--,we(h);let m=p.__key;if(d===null)i.__first=m,h.__prev=null;else{let _=d.getWritable();_.__next=m,h.__prev=_.__key}p.__key===s&&O(76),h.__parent=s,l.push(m),d=p}if(e+n===o)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){let p=c.getWritable();if(d!==null){let h=d.getWritable();p.__prev=d.__key,h.__next=c.__key}else p.__prev=null}if(i.__size=g,a.length){let p=w();if(I(p)){let h=new Set(a),m=new Set(l),{anchor:_,focus:y}=p;si(_,h,m)&&An(_,_.getNode(),this,u,c),si(y,h,m)&&An(y,y.getNode(),this,u,c),g!==0||this.canBeEmpty()||le(this)||this.remove()}}return i}getDOMSlot(e){return new Ar(e)}exportDOM(e){let{element:n}=super.exportDOM(e);if(ee(n)){let r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px");let o=this.getDirection();o&&(n.dir=o)}return{element:n}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||le(this)||this.getChildren().some(k)||(n!==0&&(e.textFormat=n),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,n){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,n){let r=this.getDOMSlot(e),o=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){let s=n.getElementByKey(i.getKey());s!==null&&(o==null?(r.insertChild(s),o=s):o!==s&&r.replaceChild(s,o),o=o.nextSibling)}}};function x(t){return t instanceof $e}function si(t,e,n){let r=t.getNode();for(;r;){let o=r.__key;if(e.has(o)&&!n.has(o))return!0;r=r.getParent()}return!1}var Gt=class extends se{decorate(e,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function W(t){return t instanceof Gt}var ht=class t extends $e{__cachedText;static getType(){return"root"}static clone(){return new t}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){O(51)}getTextContent(){let e=this.__cachedText;return!Tt()&&B()._dirtyType!==0||e===null?super.getTextContent():e}remove(){O(52)}replace(e){O(53)}insertBefore(e){O(54)}insertAfter(e){O(55)}updateDOM(e,n){return!1}splice(e,n,r){for(let o of r)x(o)||W(o)||O(282);return super.splice(e,n,r)}static importJSON(e){return oe().updateFromJSON(e)}collapseAtStart(){return!0}};function q(t){return t instanceof ht}function xs(t){return new Ht(new Map(t._nodeMap))}function eo(){return new Ht(new Map([["root",new ht]]))}function Ts(t){let e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&O(130,n.name),x(t)){let r=e.children;Array.isArray(r)||O(59,n.name);let o=t.getChildren();for(let i=0;i<o.length;i++){let s=Ts(o[i]);r.push(s)}}return e}function Sa(t){return t instanceof Ht}var Ht=class t{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,n){this._nodeMap=e,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,n){return ri(n&&n.editor||null,this,e)}clone(e){let n=new t(this._nodeMap,e===void 0?this._selection:e);return n._readOnly=!0,n}toJSON(){return ri(null,this,()=>({root:Ts(oe())}))}},Dn=class extends $e{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}},_t=class t extends $e{static getType(){return"paragraph"}static clone(e){return new t(e.__key)}createDOM(e){let n=document.createElement("p"),r=ut(e.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(e,n,r){return!1}static importDOM(){return{p:e=>({conversion:Oa,priority:0})}}exportDOM(e){let{element:n}=super.exportDOM(e);if(ee(n)){this.isEmpty()&&n.append(document.createElement("br"));let r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}static importJSON(e){return Ae().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let n=this.getChildren().find(k);n?(e.textFormat=n.getFormat(),e.textStyle=n.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,n){let r=Ae();r.setTextFormat(e.format),r.setTextStyle(e.style);let o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){let e=this.getChildren();if(e.length===0||k(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 Oa(t){let e=Ae();if(t.style&&(e.setFormat(t.style.textAlign),Ys(t,e)),e.getFormatType()===""){let n=t.getAttribute("align");n&&n&&n in ir&&e.setFormat(n)}return{node:e}}function Ae(){return en(new _t)}function Ss(t){return t instanceof _t}var st=0,Ma=1,Ea=2,Aa=3,Da=4;function Os(t,e,n,r){let o=t._keyToDOMMap;o.clear(),t._editorState=eo(),t._pendingEditorState=r,t._compositionKey=null,t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),t._normalizedNodes=new Set,t._updateTags=new Set,t._updates=[],t._blockCursorElement=null;let i=t._observer;i!==null&&(i.disconnect(),t._observer=null),e!==null&&(e.textContent=""),n!==null&&(n.textContent="",o.set("root",n))}function Ms(t){let e=new Set,n=new Set,r=t;for(;r;){let{ownNodeConfig:o}=tn(r),i=r.transform;if(!n.has(i)){n.add(i);let s=r.transform();s&&e.add(s)}if(o){let s=o.$transform;s&&e.add(s),r=o.extends}else{let s=Object.getPrototypeOf(r);r=s.prototype instanceof se&&s!==se?s:void 0}}return e}function va(t){let e=t||{},n=xa(),r=e.theme||{},o=t===void 0?n:e.parentEditor||null,i=e.disableEvents||!1,s=eo(),l=e.namespace||(o!==null?o._config.namespace:Rs()),a=e.editorState,c=[ht,qe,dt,gt,_t,Dn,...e.nodes||[]],{onError:u,html:g}=e,d=e.editable===void 0||e.editable,p;if(t===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let m=0;m<c.length;m++){let _=c[m],y=null,C=null;if(typeof _!="function"){let A=_;_=A.replace,y=A.with,C=A.withKlass||null}tn(_);let N=_.getType(),E=Ms(_);p.set(N,{exportDOM:g&&g.export?g.export.get(_):void 0,klass:_,replace:y,replaceWithKlass:C,sharedNodeState:Mi(c[m]),transforms:E})}}let h=new Fe(s,o,p,{disableEvents:i,namespace:l,theme:r},u||console.error,(function(m,_){let y=new Map,C=new Set,N=E=>{Object.keys(E).forEach(A=>{let S=y.get(A);S===void 0&&(S=[],y.set(A,S)),S.push(E[A])})};return m.forEach(E=>{let A=E.klass.importDOM;if(A==null||C.has(A))return;C.add(A);let S=A.call(E.klass);S!==null&&N(S)}),_&&N(_),y})(p,g?g.import:void 0),d,t);return a!==void 0&&(h._pendingEditorState=a,h._dirtyType=2),(function(m){m.registerCommand(Br,ql,st),m.registerCommand(Wr,Ql,st),m.registerCommand(zr,Zl,st),m.registerCommand(Ur,ea,st),m.registerCommand(Vr,ta,st)})(h),h}function ka(t,e){let n=t.get(e);t.delete(e),n&&n()}function vt(t,e,n){return t.set(e,n),ka.bind(null,t,e)}var Fe=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,n,r,o,i,s,l,a){this._createEditorArgs=a,this._parentEditor=n,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 Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Rs(),this._onError=i,this._htmlConversions=s,this._editable=l,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return vt(this._listeners.update,e)}registerEditableListener(e){return vt(this._listeners.editable,e)}registerDecoratorListener(e){return vt(this._listeners.decorator,e)}registerTextContentListener(e){return vt(this._listeners.textcontent,e)}registerRootListener(e){let n=this._listeners.root;return Qs(vt(n,e,e(this._rootElement,null)||void 0),()=>(function(r,o,i){let s=r.get(o);s&&s(),r.set(o,o(...i)||void 0)})(n,e,[null,this._rootElement]))}registerCommand(e,n,r){r===void 0&&O(35);let o=this._commands;o.has(e)||o.set(e,[new Set,new Set,new Set,new Set,new Set]);let i=o.get(e);i===void 0&&O(36,String(e));let s=i[r];return s.add(n),()=>{s.delete(n),i.every(l=>l.size===0)&&o.delete(e)}}registerMutationListener(e,n,r){let o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,s=i.get(n);s===void 0&&(s=new Set,i.set(n,s)),s.add(o);let l=r&&r.skipInitialization;return l!==void 0&&l||this.initializeMutationListener(n,o),()=>{s.delete(o),s.size===0&&i.delete(n)}}getRegisteredNode(e){let n=this._nodes.get(e.getType());return n===void 0&&O(37,e.name),n}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,n){let r=this._editorState,o=br(r).get(n.getType());if(!o)return;let i=new Map;for(let s of o.keys())i.set(s,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,n){let r=this.getRegisteredNode(e);return r.transforms.add(n),r}registerNodeTransform(e,n){let r=this.registerNodeTransformToKlass(e,n),o=[r],i=r.replaceWithKlass;if(i!=null){let s=this.registerNodeTransformToKlass(i,n);o.push(s)}return(function(s,l){let a=br(s.getEditorState()),c=[];for(let u of l){let g=a.get(u);g&&c.push(g)}c.length!==0&&s.update(()=>{for(let u of c)for(let g of u.keys()){let d=Y(g);d&&d.markDirty()}},s._pendingEditorState===null?{tag:fn}:void 0)})(this,o.map(s=>s.klass.getType())),()=>{o.forEach(s=>s.transforms.delete(n))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,n){return v(this,e,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let n=this._rootElement;if(e!==n){let r=ut(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=e,Os(this,n,e,o),n!==null&&(this._config.disableEvents||na(n),r!=null&&n.classList.remove(...r)),e!==null){let i=go(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=2,Oi(this),this._updateTags.add(fn),Me(this),this._config.disableEvents||(function(l,a){let c=l.ownerDocument;Nr.set(l,c);let u=Tn.get(c)??0;u<1&&c.addEventListener("selectionchange",rs),Tn.set(c,u+1),l.__lexicalEditor=a;let g=ns(l);for(let d=0;d<Cr.length;d++){let[p,h]=Cr[d],m=typeof h=="function"?_=>{Ko(_)||(Fo(_),(a.isEditable()||p==="click")&&h(_,a))}:_=>{if(Ko(_))return;Fo(_);let y=a.isEditable();switch(p){case"cut":return y&&v(a,Jr,_);case"copy":return v(a,jr,_);case"paste":return y&&v(a,Yr,_);case"dragstart":return y&&v(a,Yi,_);case"dragover":return y&&v(a,Gi,_);case"dragend":return y&&v(a,Hi,_);case"focus":return y&&v(a,Vi,_);case"blur":return y&&v(a,ji,_);case"drop":return y&&v(a,Ui,_)}};l.addEventListener(p,m),g.push(()=>{l.removeEventListener(p,m)})}})(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(fn),Me(this);Pt("root",this,!1,e,n)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&O(38);let r=e;r._readOnly&&(r=xs(e),r._selection=e._selection?e._selection.clone():null),Si(this);let o=this._pendingEditorState,i=this._updateTags,s=n!==void 0?n.tag:null;o===null||o.isEmpty()||(s!=null&&i.add(s),Me(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&i.add(s),this._updating||Me(this)}parseEditorState(e,n){return(function(r,o,i){let s=eo(),l=j,a=ne,c=J,u=o._dirtyElements,g=o._dirtyLeaves,d=o._cloneNotNeeded,p=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,j=s,ne=!1,J=o,to(null);try{let h=o._nodes;Zr(r.root,h),i&&i(),s._readOnly=!0}catch(h){h instanceof Error&&o._onError(h)}finally{o._dirtyElements=u,o._dirtyLeaves=g,o._cloneNotNeeded=d,o._dirtyType=p,j=l,ne=a,J=c}return s})(typeof e=="string"?JSON.parse(e):e,this,n)}read(e){return Me(this),this.getEditorState().read(e,{editor:this})}update(e,n){(function(r,o,i){r._updating?r._updates.push([o,i]):Fn(r,o,i)})(this,e,n)}focus(e,n={}){let r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),ye(this,()=>{let o=w(),i=oe();o!==null?o.dirty||re(o.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),zn("focus"),Fs(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;e!==null&&e.blur();let n=_e(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Pt("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};Fe.version="0.43.0+prod.esm";var Dr=null;function to(t){Dr=t}var Es=1;function ba(){Es=1}function no(t,e){let n=ro(t,e);return n===void 0&&O(30,e),n}function ro(t,e){return t._nodes.get(e)}var Ia=typeof queueMicrotask=="function"?queueMicrotask:t=>{Promise.resolve().then(t)};function As(t){return W(Wn(t))}function oo(t){let e=document.activeElement;if(!ee(e))return!1;let n=e.nodeName;return W(Wn(t))&&(n==="INPUT"||n==="TEXTAREA"||e.contentEditable==="true"&&Qt(e)==null)}function qt(t,e,n){let r=t.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(n)&&e!==null&&!oo(e)&&io(e)===t}catch{return!1}}function Kn(t){return t instanceof Fe}function io(t){let e=t;for(;e!=null;){let n=Qt(e);if(Kn(n))return n;e=Zt(e)}return null}function Qt(t){return t?t.__lexicalEditor:null}function Ra(t){return Ol.test(t)?"rtl":Ml.test(t)?"ltr":null}function Pe(t){return qr(t)||t.isToken()}function Oe(t){return Pe(t)||t.isSegmented()}function Ce(t){return St(t)&&t.nodeType===3}function Ds(t){return St(t)&&t.nodeType===9}function Ze(t){let e=t;for(;e!=null;){if(Ce(e))return e;e=e.firstChild}return null}function Vt(t,e,n){let r=Z[e];if(n!==null&&(t&r)===(n&r))return t;let o=t^r;return e==="subscript"?o&=~Z.superscript:e==="superscript"?o&=~Z.subscript:e==="lowercase"?(o&=~Z.uppercase,o&=~Z.capitalize):e==="uppercase"?(o&=~Z.lowercase,o&=~Z.capitalize):e==="capitalize"&&(o&=~Z.lowercase,o&=~Z.uppercase),o}function Pa(t){return k(t)||je(t)||W(t)}function vs(t,e){let n=(function(){let s=Dr;return Dr=null,s})();if((e=e||n&&n.__key)!=null)return void(t.__key=e);H(),ms();let r=B(),o=ke(),i=""+Es++;o._nodeMap.set(i,t),x(t)?r._dirtyElements.set(i,!0):r._dirtyLeaves.add(i),r._cloneNotNeeded.add(i),r._dirtyType=1,t.__key=i}function we(t){let e=t.getParent();if(e!==null){let n=t.getWritable(),r=e.getWritable(),o=t.getPreviousSibling(),i=t.getNextSibling(),s=i!==null?i.__key:null,l=o!==null?o.__key:null,a=o!==null?o.getWritable():null,c=i!==null?i.getWritable():null;o===null&&(r.__first=s),i===null&&(r.__last=l),a!==null&&(a.__next=s),c!==null&&(c.__prev=l),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function vn(t){ms(),On(t)&&O(323,t.__key,t.__type);let e=t.getLatest(),n=e.__parent,r=ke(),o=B(),i=r._nodeMap,s=o._dirtyElements;n!==null&&(function(a,c,u){let g=a;for(;g!==null;){if(u.has(g))return;let d=c.get(g);if(d===void 0)break;u.set(g,!1),g=d.__parent}})(n,i,s);let l=e.__key;o._dirtyType=1,x(t)?s.set(l,!0):o._dirtyLeaves.add(l)}function V(t){H();let e=B(),n=e._compositionKey;if(t!==n){if(e._compositionKey=t,n!==null){let r=Y(n);r!==null&&r.getWritable()}if(t!==null){let r=Y(t);r!==null&&r.getWritable()}}}function Re(){return Tt()?null:B()._compositionKey}function Y(t,e){let n=(e||ke())._nodeMap.get(t);return n===void 0?null:n}function so(t,e){let n=Bn(t,B());return n!==void 0?Y(n,e):null}function Bn(t,e){return t[`__lexicalKey_${e._key}`]}function Wn(t,e){let n=t;for(;n!=null;){let r=so(n,e);if(r!==null)return r;n=Zt(n)}return null}function ks(t){let e=t._decorators,n=Object.assign({},e);return t._pendingDecorators=n,n}function li(t){return t.read(()=>oe().getTextContent())}function oe(){return bs(ke())}function bs(t){return t._nodeMap.get("root")}function re(t){H();let e=ke();t!==null&&(t.dirty=!0,t.setCachedNodes(null)),e._selection=t}function lt(t){let e=B(),n=(function(r,o){let i=r;for(;i!=null;){let s=Bn(i,o);if(s!==void 0)return s;i=Zt(i)}return null})(t,e);return n===null?t===e.getRootElement()?Y("root"):null:Y(n)}function Is(t){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t)}function lo(t){let e=[];for(let n=t;n!==null;n=n._parentEditor)e.push(n);return e}function Rs(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Ps(t){return Ce(t)?t.nodeValue:null}function ao(t,e,n){let r=_e(ie(e));if(r===null)return;let o=r.anchorNode,{anchorOffset:i,focusOffset:s}=r;if(o!==null){let l=Ps(o),a=Wn(o);if(l!==null&&k(a)){if((l===Ft||l===Lr)&&n){let c=n.length;l=n,i=c,s=c}l!==null&&co(a,l,i,s,t)}}}function co(t,e,n,r,o){let i=t;if(i.isAttached()&&(o||!i.isDirty())){let s=i.isComposing(),l=e;if((s||o)&&(e.endsWith(Ft)&&(l=e.slice(0,-Ft.length)),o)){let c=Lr,u;for(;(u=l.indexOf(c))!==-1;)l=l.slice(0,u)+l.slice(u+c.length),n!==null&&n>u&&(n=Math.max(u,n-c.length)),r!==null&&r>u&&(r=Math.max(u,r-c.length))}let a=i.getTextContent();if(o||l!==a){if(l===""){if(V(null),In||Jt||Rn)i.remove();else{let m=B();setTimeout(()=>{m.update(()=>{i.isAttached()&&i.remove()})},20)}return}let c=i.getParent(),u=tt(),g=i.getTextContentSize(),d=Re(),p=i.getKey();if(i.isToken()||d!==null&&p===d&&!s||I(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===t.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===t.__key&&u.focus.offset===g&&!i.canInsertTextAfter()&&!s))return void i.markDirty();let h=w();if(!I(h)||n===null||r===null)return void ai(i,l,h);if(h.setTextNodeRange(i,n,i,r),i.isSegmented()){let m=G(i.getTextContent());i.replace(m),i=m}ai(i,l,h)}}}function ai(t,e,n){if(t.setTextContent(e),I(n)){let r=t.getKey();for(let o of["anchor","focus"]){let i=n[o];i.type==="text"&&i.key===r&&(i.offset=fe(t,i.offset,"clamp"))}}}function sn(t,e,n){let r=e[n]||!1;return r==="any"||r===t[n]}function ws(t,e){return sn(t,e,"altKey")&&sn(t,e,"ctrlKey")&&sn(t,e,"shiftKey")&&sn(t,e,"metaKey")}function F(t,e,n){if(!ws(t,n))return!1;if(t.key.toLowerCase()===e.toLowerCase())return!0;if(e.length>1||t.key.length===1&&t.key.charCodeAt(0)<=127)return!1;let r="Key"+e.toUpperCase();return t.code===r}var Se={ctrlKey:!ae,metaKey:ae},ci={altKey:ae,ctrlKey:!ae};function ui(t){return t.key==="Backspace"}function di(t){return F(t,"a",Se)}function wa(t){let e=oe();if(I(t)){let n=t.anchor,r=t.focus,o=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),pn(t),t}{let n=e.select(0,e.getChildrenSize());return re(pn(n)),n}}function ut(t,e){t.__lexicalClassNameCache===void 0&&(t.__lexicalClassNameCache={});let n=t.__lexicalClassNameCache,r=n[e];if(r!==void 0)return r;let o=t[e];if(typeof o=="string"){let i=nn(o);return n[e]=i,i}return o}function uo(t,e,n,r,o){if(n.size===0)return;let i=r.__type,s=r.__key,l=e.get(i);l===void 0&&O(33,i);let a=l.klass,c=t.get(a);c===void 0&&(c=new Map,t.set(a,c));let u=c.get(s),g=u==="destroyed"&&o==="created";(u===void 0||g)&&c.set(s,g?"updated":o)}function La(t){let e=t.getType(),n=ke();if(n._readOnly){let i=br(n).get(e);return i?Array.from(i.values()):[]}let r=n._nodeMap,o=[];for(let[,i]of r)i instanceof t&&i.__type===e&&i.isAttached()&&o.push(i);return o}function fi(t,e,n){let r=t.getParent(),o=n,i=t;return r!==null&&(e&&n===0?(o=i.getIndexWithinParent(),i=r):e||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(e?o-1:o)}function Ls(t,e){let n=t.offset;if(t.type==="element")return fi(t.getNode(),e,n);{let r=t.getNode();if(e&&n===0||!e&&n===r.getTextContentSize()){let o=e?r.getPreviousSibling():r.getNextSibling();return o===null?fi(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):o}}return null}function $s(t){let e=ie(t).event,n=e&&e.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function v(t,e,n){return Ns(t,e,n,t)}function pt(t,e){let n=t._keyToDOMMap.get(e);return n===void 0&&O(75,e),n}function Zt(t){let e=t.assignedSlot||t.parentElement;return zs(e)?e.host:e}function fo(t){return Ds(t)?t:ee(t)?t.ownerDocument:null}function $a(t){return B()._updateTags.has(t)}function zn(t){H(),B()._updateTags.add(t)}function Fs(t){H(),B()._deferred.push(t)}function kn(t,e){let n=t.getParent();for(;n!==null;){if(n.is(e))return!0;n=n.getParent()}return!1}function go(t){let e=fo(t);return e?e.defaultView:null}function ie(t){let e=t._window;return e===null&&O(78),e}function Fa(t){return x(t)&&t.isInline()||W(t)&&t.isInline()}function Ks(t){let e=t.getParentOrThrow();for(;e!==null;){if(le(e))return e;e=e.getParentOrThrow()}return e}function le(t){return q(t)||x(t)&&t.isShadowRoot()}function ho(t,e=!1){let n=t.constructor.clone(t);return vs(n,null),n.afterCloneFrom(t),e||n.resetOnCopyNodeFrom(t),n}function en(t){let e=B(),n=t.getType(),r=ro(e,n);r===void 0&&O(200,t.constructor.name,n);let{replace:o,replaceWithKlass:i}=r;if(o!==null){let s=o(t),l=s.constructor;return i!==null?s instanceof i||O(201,i.name,i.getType(),l.name,l.getType(),t.constructor.name,n):s instanceof t.constructor&&l!==t.constructor||O(202,l.name,l.getType(),t.constructor.name,n),s.__key===t.__key&&O(203,t.constructor.name,n,l.name,l.getType()),s}return t}function tr(t,e){!q(t.getParent())||x(e)||W(e)||O(99)}function Bs(t){let e=Y(t);return e===null&&O(63,t),e}function nr(t){return(W(t)||x(t)&&!t.canBeEmpty())&&!t.isInline()}function vr(t,e,n){n.style.removeProperty("caret-color"),e._blockCursorElement=null;let r=t.parentElement;r!==null&&r.removeChild(t)}function _e(t){return he?(t||window).getSelection():null}function Ws(t){let e=go(t);return e?e.getSelection():null}function Ka(t,e){let n=t.getChildAtIndex(e);n==null&&(n=t),le(t)&&O(102);let r=s=>{let l=s.getParentOrThrow(),a=le(l),c=s!==n||a?ho(s):s;if(a)return x(s)&&x(c)||O(133),s.insertAfter(c),[s,c,c];{let[u,g,d]=r(l),p=s.getNextSiblings();return d.append(c,...p),[u,g,c]}},[o,i]=r(n);return[o,i]}function Ba(t){return ee(t)&&t.tagName==="A"}function ee(t){return St(t)&&t.nodeType===1}function St(t){return typeof t=="object"&&t!==null&&"nodeType"in t&&typeof t.nodeType=="number"}function zs(t){return St(t)&&t.nodeType===11}function Us(t){let e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return t.nodeName.match(e)!==null}function kr(t){let 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 t.nodeName.match(e)!==null}function Ee(t){if(W(t)&&!t.isInline())return!0;if(!x(t)||le(t))return!1;let e=t.getFirstChild(),n=e===null||je(e)||k(e)||e.isInline();return!t.isInline()&&t.canBeEmpty()!==!1&&n}function _o(){return B()}var gi=new WeakMap,Wa=new Map;function br(t){if(!t._readOnly&&t.isEmpty())return Wa;t._readOnly||O(192);let e=gi.get(t);return e||(e=(function(n){let r=new Map;for(let[o,i]of n._nodeMap){let s=i.__type,l=r.get(s);l||(l=new Map,r.set(s,l)),l.set(o,i)}return r})(t),gi.set(t,e)),e}function po(t){let e=t.constructor.clone(t);return e.afterCloneFrom(t),e}function za(t){return(e=po(t))[os]=!0,e;var e}function Ys(t,e){let n=parseInt(t.style.paddingInlineStart,10)||0,r=Math.round(n/40);e.setIndent(r)}function Ua(t){t.__lexicalUnmanaged=!0}function Gs(t){return t.__lexicalUnmanaged===!0}function kt(t,e){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(t,e)&&t[e]!==se[e]}function tn(t){let e=Mo in t.prototype?t.prototype[Mo]():void 0,n=(function(s){if(!(s===se||s.prototype instanceof se)){let l="<unknown>",a="<unknown>";try{l=s.getType()}catch{}try{Fe.version&&(a=JSON.parse(Fe.version))}catch{}O(290,s.name,l,a)}return s===Gt||s===$e||s===se})(t),r=!n&&kt(t,"getType")?t.getType():void 0,o,i=r;if(e)if(r)o=e[r];else for(let[s,l]of Object.entries(e))i=s,o=l;if(!n&&i&&(kt(t,"getType")||(t.getType=()=>i),kt(t,"clone")||(t.clone=s=>(to(s),new t)),kt(t,"importJSON")||(t.importJSON=o&&o.$importJSON||(s=>new t().updateFromJSON(s))),!kt(t,"importDOM")&&o)){let{importDOM:s}=o;s&&(t.importDOM=()=>s)}return{ownNodeConfig:o,ownNodeType:i}}function Ya(t){let e=_o();return H(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(t))).klass}var wt=(t,e)=>{let n=t;for(;n!=null&&!q(n);){if(e(n))return n;n=n.getParent()}return null},Ga={next:"previous",previous:"next"},mt=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Co({hasNext:et,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return X(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return X(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,n){let r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,n)),this}splice(e,n,r="next"){let o=r===this.direction?n:Array.from(n).reverse(),i=this,s=this.getParentAtCaret(),l=new Map;for(let a=i.getAdjacentCaret();a!==null&&l.size<e;a=a.getAdjacentCaret()){let c=a.origin.getWritable();l.set(c.getKey(),c)}for(let a of o){if(l.size>0){let c=i.getNodeAtCaret();if(c){if(l.delete(c.getKey()),l.delete(a.getKey()),!(c.is(a)||i.origin.is(a))){let u=a.getParent();u&&u.is(s)&&a.remove(),c.replace(a)}}else c===null&&O(263,Array.from(l).join(" "))}else i.insert(a);i=X(a,this.direction)}for(let a of l.values())a.remove();return this}},jt=class t extends mt{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:ve(e,this.direction)}getParentCaret(e="root"){return X(mo(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Ue(this.direction);return X(this.getNodeAtCaret(),e)||ve(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof t&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},Ha={root:q,shadowRoot:le};function Ue(t){return Ga[t]}function mo(t,e="root"){return Ha[e](t)?null:t}var yt=class t extends mt{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:X(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return x(this.origin)?ve(this.origin,this.direction):null}getParentCaret(e="root"){return X(mo(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Ue(this.direction);return X(this.getNodeAtCaret(),e)||ve(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof t&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof t||e instanceof Ct)&&this.direction===e.direction&&this.origin.is(e.origin)}},Ct=class t extends mt{type="text";offset;constructor(e,n){super(e),this.offset=n}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Ke(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return X(mo(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Ke(this.origin,Ue(this.direction),this.offset)}isSamePointCaret(e){return e instanceof t&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof yt||e instanceof t)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return X(this.origin,this.direction)}};function De(t){return t instanceof Ct}function Va(t){return t instanceof mt}function et(t){return t instanceof yt}function de(t){return t instanceof jt}var ja={next:class extends Ct{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Ct{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},Ja={next:class extends yt{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends yt{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},Xa={next:class extends jt{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends jt{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function X(t,e){return t?new Ja[e](t):null}function Ke(t,e,n){return t?new ja[e](t,fe(t,n)):null}function fe(t,e,n="error"){let r=t.getTextContentSize(),o=e==="next"?r:e==="previous"?0:e;return(o<0||o>r)&&(n!=="clamp"&&pi(284,String(e),String(r),t.getKey()),o=o<0?0:r),o}function Ir(t,e){return new bn(t,e)}function ve(t,e){return x(t)?new Xa[e](t):null}function Hs(t){return t&&t.getChildCaret()||t}function Nt(t){return t&&Hs(t.getAdjacentCaret())}var Rr=class t{type="node-caret-range";direction;anchor;focus;constructor(e,n,r){this.anchor=e,this.focus=n,this.direction=r}getLatest(){let e=this.anchor.getLatest(),n=this.focus.getLatest();return e===this.anchor&&n===this.focus?this:new t(e,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=o=>{let i=this[o].getLatest();return De(i)?(function(s,l){let{direction:a,origin:c}=s,u=fe(c,l==="focus"?Ue(a):a);return Ir(s,u-s.offset)})(i,o):null},n=e("anchor"),r=e("focus");if(n&&r){let{caret:o}=n,{caret:i}=r;if(o.isSameNodeCaret(i))return[Ir(o,i.offset-o.offset),null]}return[n,r]}iterNodeCarets(e="root"){let n=De(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),o=De(r),i=s=>s.isSameNodeCaret(r)?null:Nt(s)||s.getParentCaret(e);return Co({hasNext:s=>s!==null&&!(o&&r.isSameNodeCaret(s)),initial:n.isSameNodeCaret(r)?null:i(n),map:s=>s,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}},bn=class{type="slice";caret;distance;constructor(e,n){this.caret=e,this.distance=n}getSliceIndices(){let{distance:e,caret:{offset:n}}=this,r=n+e;return r<n?[r,n]:[n,r]}getTextContent(){let[e,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:n}}=this,[r,o]=this.getSliceIndices(),i=e.getTextContent();return Ke(e.setTextContent(i.slice(0,r)+i.slice(o)),n,r)}};function qa(t){return t instanceof bn}function yo(t){return Be(t,X(oe(),t.direction))}function Vs(t){return Be(t,t)}function Be(t,e){return t.direction!==e.direction&&O(265),new Rr(t,e,t.direction)}function Co(t){let{initial:e,hasNext:n,step:r,map:o}=t,i=e;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};let s={done:!1,value:o(i)};return i=r(i),s}}}function No(t,e){let n=Lt(t.origin,e.origin);switch(n===null&&O(275,t.origin.getKey(),e.origin.getKey()),n.type){case"same":{let r=t.type==="text",o=e.type==="text";return r&&o?(function(i,s){return Math.sign(i-s)})(t.offset,e.offset):t.type===e.type?0:r?-1:o?1:t.type==="child"?-1:1}case"ancestor":return t.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return xo(n)}}function xo(t){let{a:e,b:n}=t,r=e.__key,o=n.__key,i=e,s=n;for(;i&&s;i=i.getNextSibling(),s=s.getNextSibling()){if(i.__key===o)return-1;if(s.__key===r)return 1}return i===null?1:-1}function ln(t,e){return e.is(t)}function hi(t){return x(t)?[t.getLatest(),null]:[t.getParent(),t.getLatest()]}function Lt(t,e){if(t.is(e))return{commonAncestor:t,type:"same"};let n=new Map;for(let[r,o]=hi(t);r;o=r,r=r.getParent())n.set(r,o);for(let[r,o]=hi(e);r;o=r,r=r.getParent()){let i=n.get(r);if(i!==void 0)return i===null?(ln(t,r)||O(276),{commonAncestor:r,type:"ancestor"}):o===null?(ln(e,r)||O(277),{commonAncestor:r,type:"descendant"}):((x(i)||ln(t,i))&&(x(o)||ln(e,o))&&r.is(i.getParent())&&r.is(o.getParent())||O(278),{a:i,b:o,commonAncestor:r,type:"branch"})}return null}function We(t,e){let{type:n,key:r,offset:o}=t,i=Bs(t.key);return n==="text"?(k(i)||O(266,i.getType(),r),Ke(i,e,o)):(x(i)||O(267,i.getType(),r),qs(i,t.offset,e))}function xt(t,e){let{origin:n,direction:r}=e,o=r==="next";De(e)?t.set(n.getKey(),e.offset,"text"):et(e)?k(n)?t.set(n.getKey(),fe(n,r),"text"):t.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(de(e)&&x(n)||O(268),t.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function js(t){let e=w(),n=I(e)?e:_s();return $t(n,t),re(n),n}function $t(t,e){xt(t.anchor,e.anchor),xt(t.focus,e.focus)}function Pr(t){let{anchor:e,focus:n}=t,r=We(e,"next"),o=We(n,"next"),i=No(r,o)<=0?"next":"previous";return Be(ze(r,i),ze(o,i))}function Ot(t){let{direction:e,origin:n}=t,r=X(n,Ue(e)).getNodeAtCaret();return r?X(r,e):ve(n.getParentOrThrow(),e)}function _i(t,e="root"){let n=[t];for(let r=de(t)?t.getParentCaret(e):t.getSiblingCaret();r!==null;r=r.getParentCaret(e))n.push(Ot(r));return n}function rr(t){return!!t&&t.origin.isAttached()}function Js(t,e="removeEmptySlices"){if(t.isCollapsed())return t;let n="root",r="next",o=e,i=To(t,r),s=_i(i.anchor,n),l=_i(i.focus.getFlipped(),n),a=new Set,c=[];for(let h of i.iterNodeCarets(n))if(de(h))a.add(h.origin.getKey());else if(et(h)){let{origin:m}=h;x(m)&&!a.has(m.getKey())||c.push(m)}for(let h of c)h.remove();for(let h of i.getTextSlices()){if(!h)continue;let{origin:m}=h.caret,_=m.getTextContentSize(),y=Ot(X(m,r)),C=m.getMode();if(Math.abs(h.distance)===_&&o==="removeEmptySlices"||C==="token"&&h.distance!==0)y.remove();else if(h.distance!==0){o="removeEmptySlices";let N=h.removeTextSlice(),E=h.caret.origin;if(C==="segmented"){let A=N.origin,S=G(A.getTextContent()).setStyle(A.getStyle()).setFormat(A.getFormat());y.replaceOrInsert(S),N=Ke(S,r,N.offset)}E.is(s[0].origin)&&(s[0]=N),E.is(l[0].origin)&&(l[0]=N.getFlipped())}}let u,g;for(let h of s)if(rr(h)){u=ce(h);break}for(let h of l)if(rr(h)){g=ce(h);break}let d=(function(h,m,_){if(!h||!m)return null;let y=h.getParentAtCaret(),C=m.getParentAtCaret();if(!y||!C)return null;let N=y.getParents().reverse();N.push(y);let E=C.getParents().reverse();E.push(C);let A=Math.min(N.length,E.length),S;for(S=0;S<A&&N[S]===E[S];S++);let D=(b,P)=>{let K;for(let $=S;$<b.length;$++){let L=b[$];if(le(L))return;!K&&P(L)&&(K=L)}return K},M=D(N,Ee),T=M&&D(E,b=>_.has(b.getKey())&&Ee(b));return M&&T?[M,T]:null})(u,g,a);if(d){let[h,m]=d;ve(h,"previous").splice(0,m.getChildren());let _=m.getParent();for(m.remove(!0);_&&_.isEmpty();){let y=_;_=_.getParent(),y.remove(!0)}}let p=[u,g,...s,...l].find(rr);if(p)return Vs(ze(ce(p),t.direction));O(269,JSON.stringify(s.map(h=>h.origin.__key)))}function ce(t){let e=(function(o){let i=o;for(;de(i);){let s=Nt(i);if(!de(s))break;i=s}return i})(t.getLatest()),{direction:n}=e;if(k(e.origin))return De(e)?e:Ke(e.origin,n,n);let r=e.getAdjacentCaret();return et(r)&&k(r.origin)?Ke(r.origin,n,Ue(n)):e}function Xs(t){return De(t)&&t.offset!==fe(t.origin,t.direction)}function ze(t,e){return t.direction===e?t:t.getFlipped()}function To(t,e){return t.direction===e?t:Be(ze(t.focus,e),ze(t.anchor,e))}function qs(t,e,n){let r=ve(t,"next");for(let o=0;o<e;o++){let i=r.getAdjacentCaret();if(i===null)break;r=i}return ze(r,n)}function Qa(t,e="root"){let n=0,r=t,o=Nt(r);for(;o===null;){if(n--,o=r.getParentCaret(e),!o)return null;r=o,o=Nt(r)}return o&&[o,n]}function Za(t){let{origin:e,offset:n,direction:r}=t;if(n===fe(e,r))return t.getSiblingCaret();if(n===fe(e,Ue(r)))return Ot(t.getSiblingCaret());let[o]=e.splitText(n);return k(o)||O(281),ze(X(o,"next"),r)}function ec(t,e){return!0}function tc(t,{$copyElementNode:e=ho,$splitTextPointCaretNext:n=Za,rootMode:r="shadowRoot",$shouldSplit:o=ec}={}){if(De(t))return n(t);let i=t.getParentCaret(r);if(i){let{origin:s}=i;if(de(t)&&(!s.canBeEmpty()||!o(s,"first")))return Ot(i);let l=(function(a){let c=[];for(let u=a.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(t);(l.length>0||s.canBeEmpty()&&o(s,"last"))&&i.insert(e(s).splice(0,0,l))}return i}function nc(t){return t}function rc(...t){return t}function oc(t,e){return[t,e]}function ic(t){return t}function sc(t,e){if(!e||t===e)return t;for(let n in e)if(t[n]!==e[n])return{...t,...e};return t}function nn(...t){let e=[];for(let n of t)if(n&&typeof n=="string")for(let[r]of n.matchAll(/\S+/g))e.push(r);return e}function lc(t,...e){let n=nn(...e);n.length>0&&t.classList.add(...n)}function ac(t,...e){let n=nn(...e);n.length>0&&t.classList.remove(...n)}function Qs(...t){return()=>{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0}}var f=So,yc=f.$addUpdateTag,Cc=f.$applyNodeReplacement,Nc=f.$caretFromPoint,xc=f.$caretRangeFromSelection,Tc=f.$cloneWithProperties,Sc=f.$cloneWithPropertiesEphemeral,Oc=f.$comparePointCaretNext,Mc=f.$copyNode,Ec=f.$create,Ac=f.$createLineBreakNode,Dc=f.$createNodeSelection,vc=f.$createParagraphNode,kc=f.$createPoint,bc=f.$createRangeSelection,Ic=f.$createRangeSelectionFromDom,Rc=f.$createTabNode,Pc=f.$createTextNode,wc=f.$extendCaretToRange,Lc=f.$findMatchingParent,$c=f.$getAdjacentChildCaret,Fc=f.$getAdjacentNode,Kc=f.$getAdjacentSiblingOrParentSiblingCaret,Bc=f.$getCaretInDirection,Wc=f.$getCaretRange,zc=f.$getCaretRangeInDirection,Uc=f.$getCharacterOffsets,Yc=f.$getChildCaret,Gc=f.$getChildCaretAtIndex,Hc=f.$getChildCaretOrSelf,Vc=f.$getCollapsedCaretRange,jc=f.$getCommonAncestor,Jc=f.$getCommonAncestorResultBranchOrder,Xc=f.$getEditor,qc=f.$getNearestNodeFromDOMNode,Qc=f.$getNearestRootOrShadowRoot,Zc=f.$getNodeByKey,eu=f.$getNodeByKeyOrThrow,tu=f.$getNodeFromDOMNode,nu=f.$getPreviousSelection,ru=f.$getRoot,ou=f.$getSelection,iu=f.$getSiblingCaret,su=f.$getState,lu=f.$getStateChange,au=f.$getTextContent,cu=f.$getTextNodeOffset,uu=f.$getTextPointCaret,du=f.$getTextPointCaretSlice,fu=f.$getWritableNodeState,gu=f.$hasAncestor,hu=f.$hasUpdateTag,_u=f.$insertNodes,pu=f.$isBlockElementNode,mu=f.$isChildCaret,yu=f.$isDecoratorNode,Cu=f.$isEditorState,Nu=f.$isElementNode,xu=f.$isExtendableTextPointCaret,Tu=f.$isInlineElementOrDecoratorNode,Su=f.$isLeafNode,Ou=f.$isLineBreakNode,Mu=f.$isNodeCaret,Eu=f.$isNodeSelection,Au=f.$isParagraphNode,Du=f.$isRangeSelection,vu=f.$isRootNode,ku=f.$isRootOrShadowRoot,bu=f.$isSiblingCaret,Iu=f.$isTabNode,Ru=f.$isTextNode,Pu=f.$isTextPointCaret,wu=f.$isTextPointCaretSlice,Lu=f.$isTokenOrSegmented,$u=f.$isTokenOrTab,Fu=f.$nodesOfType,Ku=f.$normalizeCaret,Bu=f.$normalizeSelection__EXPERIMENTAL,Wu=f.$onUpdate,zu=f.$parseSerializedNode,Uu=f.$removeTextFromCaretRange,Yu=f.$rewindSiblingCaret,Gu=f.$selectAll,Hu=f.$setCompositionKey,Vu=f.$setPointFromCaret,ju=f.$setSelection,Ju=f.$setSelectionFromCaretRange,Xu=f.$setState,qu=f.$splitAtPointCaretNext,Qu=f.$splitNode,Zu=f.$updateRangeSelectionFromCaretRange,ed=f.ArtificialNode__DO_NOT_USE,td=f.BEFORE_INPUT_COMMAND,nd=f.BLUR_COMMAND,rd=f.CAN_REDO_COMMAND,od=f.CAN_UNDO_COMMAND,id=f.CLEAR_EDITOR_COMMAND,sd=f.CLEAR_HISTORY_COMMAND,ld=f.CLICK_COMMAND,ad=f.COLLABORATION_TAG,cd=f.COMMAND_PRIORITY_CRITICAL,ud=f.COMMAND_PRIORITY_EDITOR,dd=f.COMMAND_PRIORITY_HIGH,fd=f.COMMAND_PRIORITY_LOW,gd=f.COMMAND_PRIORITY_NORMAL,hd=f.COMPOSITION_END_COMMAND,_d=f.COMPOSITION_END_TAG,pd=f.COMPOSITION_START_COMMAND,md=f.COMPOSITION_START_TAG,yd=f.CONTROLLED_TEXT_INSERTION_COMMAND,Cd=f.COPY_COMMAND,Nd=f.CUT_COMMAND,xd=f.DELETE_CHARACTER_COMMAND,Td=f.DELETE_LINE_COMMAND,Sd=f.DELETE_WORD_COMMAND,Od=f.DRAGEND_COMMAND,Md=f.DRAGOVER_COMMAND,Ed=f.DRAGSTART_COMMAND,Ad=f.DROP_COMMAND,Dd=f.DecoratorNode,vd=f.ElementNode,kd=f.FOCUS_COMMAND,bd=f.FORMAT_ELEMENT_COMMAND,Id=f.FORMAT_TEXT_COMMAND,Rd=f.HISTORIC_TAG,Pd=f.HISTORY_MERGE_TAG,wd=f.HISTORY_PUSH_TAG,Ld=f.INDENT_CONTENT_COMMAND,$d=f.INPUT_COMMAND,Fd=f.INSERT_LINE_BREAK_COMMAND,Kd=f.INSERT_PARAGRAPH_COMMAND,Bd=f.INSERT_TAB_COMMAND,Wd=f.INTERNAL_$isBlock,zd=f.IS_ALL_FORMATTING,Ud=f.IS_BOLD,Yd=f.IS_CODE,Gd=f.IS_HIGHLIGHT,Hd=f.IS_ITALIC,Vd=f.IS_STRIKETHROUGH,jd=f.IS_SUBSCRIPT,Jd=f.IS_SUPERSCRIPT,Xd=f.IS_UNDERLINE,qd=f.KEY_ARROW_DOWN_COMMAND,Qd=f.KEY_ARROW_LEFT_COMMAND,Zd=f.KEY_ARROW_RIGHT_COMMAND,ef=f.KEY_ARROW_UP_COMMAND,tf=f.KEY_BACKSPACE_COMMAND,nf=f.KEY_DELETE_COMMAND,rf=f.KEY_DOWN_COMMAND,of=f.KEY_ENTER_COMMAND,sf=f.KEY_ESCAPE_COMMAND,lf=f.KEY_MODIFIER_COMMAND,af=f.KEY_SPACE_COMMAND,cf=f.KEY_TAB_COMMAND,uf=f.LineBreakNode,df=f.MOVE_TO_END,ff=f.MOVE_TO_START,gf=f.NODE_STATE_KEY,hf=f.OUTDENT_CONTENT_COMMAND,_f=f.PASTE_COMMAND,pf=f.PASTE_TAG,mf=f.ParagraphNode,yf=f.REDO_COMMAND,Cf=f.REMOVE_TEXT_COMMAND,Nf=f.RootNode,xf=f.SELECTION_CHANGE_COMMAND,Tf=f.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Sf=f.SELECT_ALL_COMMAND,Of=f.SKIP_COLLAB_TAG,Mf=f.SKIP_DOM_SELECTION_TAG,Ef=f.SKIP_SCROLL_INTO_VIEW_TAG,Af=f.SKIP_SELECTION_FOCUS_TAG,Df=f.TEXT_TYPE_TO_FORMAT,vf=f.TabNode,kf=f.TextNode,bf=f.UNDO_COMMAND,If=f.addClassNamesToElement,Rf=f.buildImportMap,Pf=f.configExtension,wf=f.createCommand,Lf=f.createEditor,$f=f.createSharedNodeState,Ff=f.createState,Kf=f.declarePeerDependency,Bf=f.defineExtension,Wf=f.flipDirection,zf=f.getDOMOwnerDocument,Uf=f.getDOMSelection,Yf=f.getDOMSelectionFromTarget,Gf=f.getDOMTextNode,Hf=f.getEditorPropertyFromDOMNode,Vf=f.getNearestEditorFromDOMNode,jf=f.getRegisteredNode,Jf=f.getRegisteredNodeOrThrow,Xf=f.getStaticNodeConfig,qf=f.getTextDirection,Qf=f.getTransformSetFromKlass,Zf=f.isBlockDomNode,eg=f.isCurrentlyReadOnlyMode,tg=f.isDOMDocumentNode,ng=f.isDOMNode,rg=f.isDOMTextNode,og=f.isDOMUnmanaged,ig=f.isDocumentFragment,sg=f.isExactShortcutMatch,lg=f.isHTMLAnchorElement,ag=f.isHTMLElement,cg=f.isInlineDomNode,ug=f.isLexicalEditor,dg=f.isModifierMatch,fg=f.isSelectionCapturedInDecoratorInput,gg=f.isSelectionWithinEditor,hg=f.makeStepwiseIterator,_g=f.mergeRegister,pg=f.normalizeClassNames,mg=f.removeClassNamesFromElement,yg=f.removeFromParent,Cg=f.resetRandomKey,Ng=f.safeCast,xg=f.setDOMUnmanaged,Tg=f.setNodeIndentFromDOM,Sg=f.shallowMergeConfig,Og=f.toggleTextFormatType;export{cc as a,ol as b,uc as c,yc as d,Cc as e,Nc as f,xc as g,Tc as h,Sc as i,Oc as j,Mc as k,Ec as l,Ac as m,Dc as n,vc as o,kc as p,bc as q,Ic as r,Rc as s,Pc as t,wc as u,Lc as v,$c as w,Fc as x,Kc as y,Bc as z,Wc as A,zc as B,Uc as C,Yc as D,Gc as E,Hc as F,Vc as G,jc as H,Jc as I,Xc as J,qc as K,Qc as L,Zc as M,eu as N,tu as O,nu as P,ru as Q,ou as R,iu as S,su as T,lu as U,au as V,cu as W,uu as X,du as Y,fu as Z,gu as _,hu as $,_u as aa,pu as ba,mu as ca,yu as da,Cu as ea,Nu as fa,xu as ga,Tu as ha,Su as ia,Ou as ja,Mu as ka,Eu as la,Au as ma,Du as na,vu as oa,ku as pa,bu as qa,Iu as ra,Ru as sa,Pu as ta,wu as ua,Lu as va,$u as wa,Fu as xa,Ku as ya,Bu as za,Wu as Aa,zu as Ba,Uu as Ca,Yu as Da,Gu as Ea,Hu as Fa,Vu as Ga,ju as Ha,Ju as Ia,Xu as Ja,qu as Ka,Qu as La,Zu as Ma,ed as Na,td as Oa,nd as Pa,rd as Qa,od as Ra,id as Sa,sd as Ta,ld as Ua,ad as Va,cd as Wa,ud as Xa,dd as Ya,fd as Za,gd as _a,hd as $a,_d as ab,pd as bb,md as cb,yd as db,Cd as eb,Nd as fb,xd as gb,Td as hb,Sd as ib,Od as jb,Md as kb,Ed as lb,Ad as mb,Dd as nb,vd as ob,kd as pb,bd as qb,Id as rb,Rd as sb,Pd as tb,wd as ub,Ld as vb,$d as wb,Fd as xb,Kd as yb,Bd as zb,Wd as Ab,zd as Bb,Ud as Cb,Yd as Db,Gd as Eb,Hd as Fb,Vd as Gb,jd as Hb,Jd as Ib,Xd as Jb,qd as Kb,Qd as Lb,Zd as Mb,ef as Nb,tf as Ob,nf as Pb,rf as Qb,of as Rb,sf as Sb,lf as Tb,af as Ub,cf as Vb,uf as Wb,df as Xb,ff as Yb,gf as Zb,hf as _b,_f as $b,pf as ac,mf as bc,yf as cc,Cf as dc,Nf as ec,xf as fc,Tf as gc,Sf as hc,Of as ic,Mf as jc,Ef as kc,Af as lc,Df as mc,vf as nc,kf as oc,bf as pc,If as qc,Rf as rc,Pf as sc,wf as tc,Lf as uc,$f as vc,Ff as wc,Kf as xc,Bf as yc,Wf as zc,zf as Ac,Uf as Bc,Yf as Cc,Gf as Dc,Hf as Ec,Vf as Fc,jf as Gc,Jf as Hc,Xf as Ic,qf as Jc,Qf as Kc,Zf as Lc,eg as Mc,tg as Nc,ng as Oc,rg as Pc,og as Qc,ig as Rc,sg as Sc,lg as Tc,ag as Uc,cg as Vc,ug as Wc,dg as Xc,fg as Yc,gg as Zc,hg as _c,_g as $c,pg as ad,mg as bd,yg as cd,Cg as dd,Ng as ed,xg as fd,Tg as gd,Sg as hd,Og as id};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as Y,$a as Ya,$b as Yb,$c as Yc,A as x,Aa as xa,Ab as xb,Ac as xc,B as y,Ba as ya,Bb as yb,Bc as yc,C as z,Ca as za,Cb as zb,Cc as zc,D as A,Da as Aa,Db as Ab,Dc as Ac,E as B,Ea as Ba,Eb as Bb,Ec as Bc,F as C,Fa as Ca,Fb as Cb,Fc as Cc,G as D,Ga as Da,Gb as Db,Gc as Dc,H as E,Ha as Ea,Hb as Eb,Hc as Ec,I as F,Ia as Fa,Ib as Fb,Ic as Fc,J as G,Ja as Ga,Jb as Gb,Jc as Gc,K as H,Ka as Ha,Kb as Hb,Kc as Hc,L as I,La as Ia,Lb as Ib,Lc as Ic,M as J,Ma as Ja,Mb as Jb,Mc as Jc,N as K,Na as Ka,Nb as Kb,Nc as Kc,O as L,Oa as La,Ob as Lb,Oc as Lc,P as M,Pa as Ma,Pb as Mb,Pc as Mc,Q as N,Qa as Na,Qb as Nb,Qc as Nc,R as O,Ra as Oa,Rb as Ob,Rc as Oc,S as P,Sa as Pa,Sb as Pb,Sc as Pc,T as Q,Ta as Qa,Tb as Qb,Tc as Qc,U as R,Ua as Ra,Ub as Rb,Uc as Rc,V as S,Va as Sa,Vb as Sb,Vc as Sc,W as T,Wa as Ta,Wb as Tb,Wc as Tc,X as U,Xa as Ua,Xb as Ub,Xc as Uc,Y as V,Ya as Va,Yb as Vb,Yc as Vc,Z as W,Za as Wa,Zb as Wb,Zc as Wc,_ as X,_a as Xa,_b as Xb,_c as Xc,aa as Z,ab as Za,ac as Zb,ad as Zc,ba as _,bb as _a,bc as _b,bd as _c,ca as $,cb as $a,cc as $b,cd as $c,d as a,da as aa,db as ab,dc as ac,dd as ad,e as b,ea as ba,eb as bb,ec as bc,ed as bd,f as c,fa as ca,fb as cb,fc as cc,fd as cd,g as d,ga as da,gb as db,gc as dc,gd as dd,h as e,ha as ea,hb as eb,hc as ec,hd as ed,i as f,ia as fa,ib as fb,ic as fc,id as fd,j as g,ja as ga,jb as gb,jc as gc,k as h,ka as ha,kb as hb,kc as hc,l as i,la as ia,lb as ib,lc as ic,m as j,ma as ja,mb as jb,mc as jc,n as k,na as ka,nb as kb,nc as kc,o as l,oa as la,ob as lb,oc as lc,p as m,pa as ma,pb as mb,pc as mc,q as n,qa as na,qb as nb,qc as nc,r as o,ra as oa,rb as ob,rc as oc,s as p,sa as pa,sb as pb,sc as pc,t as q,ta as qa,tb as qb,tc as qc,u as r,ua as ra,ub as rb,uc as rc,v as s,va as sa,vb as sb,vc as sc,w as t,wa as ta,wb as tb,wc as tc,x as u,xa as ua,xb as ub,xc as uc,y as v,ya as va,yb as vb,yc as vc,z as w,za as wa,zb as wb,zc as wc}from"/kempo/vendor/lexical/chunks/chunk-ZMJQPFLE.js";export{a as $addUpdateTag,b as $applyNodeReplacement,c as $caretFromPoint,d as $caretRangeFromSelection,e as $cloneWithProperties,f as $cloneWithPropertiesEphemeral,g as $comparePointCaretNext,h as $copyNode,i as $create,j as $createLineBreakNode,k as $createNodeSelection,l as $createParagraphNode,m as $createPoint,n as $createRangeSelection,o as $createRangeSelectionFromDom,p as $createTabNode,q as $createTextNode,r as $extendCaretToRange,s as $findMatchingParent,t as $getAdjacentChildCaret,u as $getAdjacentNode,v as $getAdjacentSiblingOrParentSiblingCaret,w as $getCaretInDirection,x as $getCaretRange,y as $getCaretRangeInDirection,z as $getCharacterOffsets,A as $getChildCaret,B as $getChildCaretAtIndex,C as $getChildCaretOrSelf,D as $getCollapsedCaretRange,E as $getCommonAncestor,F as $getCommonAncestorResultBranchOrder,G as $getEditor,H as $getNearestNodeFromDOMNode,I as $getNearestRootOrShadowRoot,J as $getNodeByKey,K as $getNodeByKeyOrThrow,L as $getNodeFromDOMNode,M as $getPreviousSelection,N as $getRoot,O as $getSelection,P as $getSiblingCaret,Q as $getState,R as $getStateChange,S as $getTextContent,T as $getTextNodeOffset,U as $getTextPointCaret,V as $getTextPointCaretSlice,W as $getWritableNodeState,X as $hasAncestor,Y as $hasUpdateTag,Z as $insertNodes,_ as $isBlockElementNode,$ as $isChildCaret,aa as $isDecoratorNode,ba as $isEditorState,ca as $isElementNode,da as $isExtendableTextPointCaret,ea as $isInlineElementOrDecoratorNode,fa as $isLeafNode,ga as $isLineBreakNode,ha as $isNodeCaret,ia as $isNodeSelection,ja as $isParagraphNode,ka as $isRangeSelection,la as $isRootNode,ma as $isRootOrShadowRoot,na as $isSiblingCaret,oa as $isTabNode,pa as $isTextNode,qa as $isTextPointCaret,ra as $isTextPointCaretSlice,sa as $isTokenOrSegmented,ta as $isTokenOrTab,ua as $nodesOfType,va as $normalizeCaret,wa as $normalizeSelection__EXPERIMENTAL,xa as $onUpdate,ya as $parseSerializedNode,za as $removeTextFromCaretRange,Aa as $rewindSiblingCaret,Ba as $selectAll,Ca as $setCompositionKey,Da as $setPointFromCaret,Ea as $setSelection,Fa as $setSelectionFromCaretRange,Ga as $setState,Ha as $splitAtPointCaretNext,Ia as $splitNode,Ja as $updateRangeSelectionFromCaretRange,Ka as ArtificialNode__DO_NOT_USE,La as BEFORE_INPUT_COMMAND,Ma as BLUR_COMMAND,Na as CAN_REDO_COMMAND,Oa as CAN_UNDO_COMMAND,Pa as CLEAR_EDITOR_COMMAND,Qa as CLEAR_HISTORY_COMMAND,Ra as CLICK_COMMAND,Sa as COLLABORATION_TAG,Ta as COMMAND_PRIORITY_CRITICAL,Ua as COMMAND_PRIORITY_EDITOR,Va as COMMAND_PRIORITY_HIGH,Wa as COMMAND_PRIORITY_LOW,Xa as COMMAND_PRIORITY_NORMAL,Ya as COMPOSITION_END_COMMAND,Za as COMPOSITION_END_TAG,_a as COMPOSITION_START_COMMAND,$a as COMPOSITION_START_TAG,ab as CONTROLLED_TEXT_INSERTION_COMMAND,bb as COPY_COMMAND,cb as CUT_COMMAND,db as DELETE_CHARACTER_COMMAND,eb as DELETE_LINE_COMMAND,fb as DELETE_WORD_COMMAND,gb as DRAGEND_COMMAND,hb as DRAGOVER_COMMAND,ib as DRAGSTART_COMMAND,jb as DROP_COMMAND,kb as DecoratorNode,lb as ElementNode,mb as FOCUS_COMMAND,nb as FORMAT_ELEMENT_COMMAND,ob as FORMAT_TEXT_COMMAND,pb as HISTORIC_TAG,qb as HISTORY_MERGE_TAG,rb as HISTORY_PUSH_TAG,sb as INDENT_CONTENT_COMMAND,tb as INPUT_COMMAND,ub as INSERT_LINE_BREAK_COMMAND,vb as INSERT_PARAGRAPH_COMMAND,wb as INSERT_TAB_COMMAND,xb as INTERNAL_$isBlock,yb as IS_ALL_FORMATTING,zb as IS_BOLD,Ab as IS_CODE,Bb as IS_HIGHLIGHT,Cb as IS_ITALIC,Db as IS_STRIKETHROUGH,Eb as IS_SUBSCRIPT,Fb as IS_SUPERSCRIPT,Gb as IS_UNDERLINE,Hb as KEY_ARROW_DOWN_COMMAND,Ib as KEY_ARROW_LEFT_COMMAND,Jb as KEY_ARROW_RIGHT_COMMAND,Kb as KEY_ARROW_UP_COMMAND,Lb as KEY_BACKSPACE_COMMAND,Mb as KEY_DELETE_COMMAND,Nb as KEY_DOWN_COMMAND,Ob as KEY_ENTER_COMMAND,Pb as KEY_ESCAPE_COMMAND,Qb as KEY_MODIFIER_COMMAND,Rb as KEY_SPACE_COMMAND,Sb as KEY_TAB_COMMAND,Tb as LineBreakNode,Ub as MOVE_TO_END,Vb as MOVE_TO_START,Wb as NODE_STATE_KEY,Xb as OUTDENT_CONTENT_COMMAND,Yb as PASTE_COMMAND,Zb as PASTE_TAG,_b as ParagraphNode,$b as REDO_COMMAND,ac as REMOVE_TEXT_COMMAND,bc as RootNode,cc as SELECTION_CHANGE_COMMAND,dc as SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,ec as SELECT_ALL_COMMAND,fc as SKIP_COLLAB_TAG,gc as SKIP_DOM_SELECTION_TAG,hc as SKIP_SCROLL_INTO_VIEW_TAG,ic as SKIP_SELECTION_FOCUS_TAG,jc as TEXT_TYPE_TO_FORMAT,kc as TabNode,lc as TextNode,mc as UNDO_COMMAND,nc as addClassNamesToElement,oc as buildImportMap,pc as configExtension,qc as createCommand,rc as createEditor,sc as createSharedNodeState,tc as createState,uc as declarePeerDependency,vc as defineExtension,wc as flipDirection,xc as getDOMOwnerDocument,yc as getDOMSelection,zc as getDOMSelectionFromTarget,Ac as getDOMTextNode,Bc as getEditorPropertyFromDOMNode,Cc as getNearestEditorFromDOMNode,Dc as getRegisteredNode,Ec as getRegisteredNodeOrThrow,Fc as getStaticNodeConfig,Gc as getTextDirection,Hc as getTransformSetFromKlass,Ic as isBlockDomNode,Jc as isCurrentlyReadOnlyMode,Kc as isDOMDocumentNode,Lc as isDOMNode,Mc as isDOMTextNode,Nc as isDOMUnmanaged,Oc as isDocumentFragment,Pc as isExactShortcutMatch,Qc as isHTMLAnchorElement,Rc as isHTMLElement,Sc as isInlineDomNode,Tc as isLexicalEditor,Uc as isModifierMatch,Vc as isSelectionCapturedInDecoratorInput,Wc as isSelectionWithinEditor,Xc as makeStepwiseIterator,Yc as mergeRegister,Zc as normalizeClassNames,_c as removeClassNamesFromElement,$c as removeFromParent,ad as resetRandomKey,bd as safeCast,cd as setDOMUnmanaged,dd as setNodeIndentFromDOM,ed as shallowMergeConfig,fd as toggleTextFormatType};
|