PageSourceSearch

https://carnegieindia.org/_next/static/chunks/30cvmm6k4iq_u.js

js carnegieindia.org collected 2026-10-01 08:08:52 UTC 172,317 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,513236,e=>{"use strict";var t=e.i(398040);let n=(0,t.createContext)(null);e.s(["LexicalComposerContext",0,n,"createLexicalComposerContext",0,function(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}},"useLexicalComposerContext",0,function(){let e=(0,t.useContext)(n);return null==e&&function(...e){let t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;for(let t of(n.append("code",8),e))n.append("v",t);throw t.search=n.toString(),Error(`Minified Lexical error #8; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(),e}])},320754,e=>{"use strict";let t;function n(e,...t){let r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let n of(i.append("code",e),t))i.append("v",n);throw r.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(e,...t){let n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let n of(i.append("code",e),t))i.append("v",n);n.search=i.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let i="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,l=i&&"documentMode"in document?document.documentMode:null,o=i&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),s=i&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),a=!(!i||!("InputEvent"in window)||l)&&"getTargetRanges"in new window.InputEvent("input"),u=i&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1),f=i&&/Android/.test(navigator.userAgent),d=i&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!f,c=i&&/^(?=.*Chrome).*/i.test(navigator.userAgent),h=i&&f&&c,g=i&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&o&&!c,_=d||u||g?" ":"​",p=s?" ":_,m="֑-߿יִ-﷽ﹰ-ﻼ",y="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",C=(RegExp("^[^"+y+"]*["+m+"]"),RegExp("^[^"+m+"]*["+y+"]"),{bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512}),x={directionless:1,unmergeable:2},S={center:2,end:6,justify:4,left:1,right:3,start:5},T={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},N={normal:0,segmented:2,token:1},v={0:"normal",2:"segmented",1:"token"},k=Symbol.for("@lexical/ctrlOrOtherKey"),b="$config";function E(){return oy()._blockCursorElement}function O(e){return null!==e&&1===e.nodeType&&e.hasAttribute("data-lexical-slot")}let M=g||u||d;function A(){let e=or().createElement("img");for(let[t,n]of(e.setAttribute("data-lexical-decorator-boundary","true"),e.alt="",[["position","absolute"],["width","0px"],["height","0px"],["border","0px"],["margin","0px"],["padding","0px"]]))e.style.setProperty(t,n,"important");return e}function w(e){return null!==e&&1===e.nodeType&&e.hasAttribute("data-lexical-decorator-boundary")}class D{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new D(this.element,e,this.after)}withAfter(e){return new D(this.element,this.before,e)}withElement(e){return this.element===e?this:new D(e,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return null!==t&&t.parentElement!==this.element&&n(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&n(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&n(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&0===n?"before":"after";let r=I(e,this.element);if(null===r)return"after";let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return"after";if(t===e)return n<=i?"before":"after";let l=I(e,t);if(null===l)return"after";let o=Array.prototype.indexOf.call(e.childNodes,l);return o>=0&&o<=i?"before":"after"}getInsertionAnchor(){return this.before}}function I(e,t){let n=t;for(;null!==n&&n.parentNode!==e;)n=n.parentNode;return n}class P extends D{withBefore(e){return new P(this.element,e,this.after)}withAfter(e){return new P(this.element,this.before,e)}withElement(e){return this.element===e?this:new P(e,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor("trailing")}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;O(t);)e=t,t=t.nextSibling;w(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return null!==n&&n===E()?n:e}getDecoratorBoundaryAnchor(e){let t;if("leading"===e){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;O(t);
1)t=t.nextSibling}else null!==(t=this.before?this.before.previousSibling:this.element.lastChild)&&t===E()&&(t=t.previousSibling);return w(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(null!==n))if(null!==n)this.element.removeChild(n);else if("leading"===e){let e=this.getFirstChildAnchor();this.element.insertBefore(A(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(A(),this.before)}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=null===this.after?t.firstChild:this.after.nextSibling,r="empty"===e&&O(n)?null:e;t.__lexicalLastChildKind!==r&&((t.__lexicalLastChildKind=r,null===r)?this.removeManagedLineBreak():this.insertManagedLineBreak("decorator"===r&&M))}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n="IMG"===e.nodeName?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===("IMG"===t.nodeName))return;this.removeManagedLineBreak()}let n=this.element,r=this.before||this.getDecoratorBoundaryAnchor("trailing"),i=or().createElement("br");if(i.setAttribute("data-lexical-managed-linebreak","true"),n.insertBefore(i,r),e){let e=or().createElement("img");e.setAttribute("data-lexical-managed-linebreak","true"),e.style.setProperty("display","inline","important"),e.style.setProperty("border","0px","important"),e.style.setProperty("margin","0px","important"),e.alt="",n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;null!==r&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=E(),i=this.element.childNodes,l=Math.min(r,i.length),o=0;for(let e=t;e<l;e++)i[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let i=F(t,n);i.push(r);let l=F(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<l.length;e++){let t=i[e],n=l[e];if(void 0===t||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}}function F(e,t){let r=[],i=t;for(;i!==e&&null!==i;i=i.parentNode){let e=0;for(let t=i.previousSibling;null!==t;t=t.previousSibling)e++;r.push(e)}return i!==e&&n(225),r.reverse()}try{t="0.50.0+prod.esm"}catch(e){}let R=t??'"<unknown>+source"';class L{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}}function K(e,t=1e3){return e instanceof B?e.clone():e.size<t?new Map(e):(new B).init(new Map(e),void 0,e.size)}class B{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,(new B).init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return void 0!==this.get(e)}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return void 0!==t?t:this._old&&this._old.get(e)}get(e){let t=this.getWithTombstone(e);return null===t?void 0:t}shouldCompact(){return void 0!==this._nursery&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)null!==n?e.set(t,n):e.delete(t);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return null!=n||(this._size++,null===n&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,null),this._size--),t}getOrInsert(e,t){let n=this.get(e);return void 0!==n?n:(this.set(e,t),t)}getOrInsertComputed(e,t){let n=this.get(e);if(void 0!==n)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}
1*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(t)for(let n of t){let t=n[0],r=e?e.get(t):void 0;null!==r&&(void 0!==r&&(n[1]=r),yield n)}if(e)for(let n of e)null===n[1]||t&&t.has(n[0])||(yield n)}forEach(e,t){for(let[n,r]of(void 0!==t&&(e=e.bind(t)),this.entries()))e(r,n,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}}function z(e,t,n,r,i,l){if(ic(e)){let o=e.getFirstChild();for(;null!==o;){let e=o.__key;o.__parent===t&&((ic(o)||oW(o)&&null!==o.__slots)&&z(o,e,n,r,i,l),n.has(e)||l.delete(e),i.push(e)),o=o.getNextSibling()}}for(let o of oW(e)&&null!==e.__slots?e.__slots.values():[]){let e=r.get(o);void 0!==e&&oU(e)&&e.__slotHost===t&&((ic(e)||oW(e)&&null!==e.__slots)&&z(e,o,n,r,i,l),n.has(o)||l.delete(o),i.push(o))}}let $=!1,W=0;function U(e){W=e.timeStamp}function H(e,t,n){let r="BR"===e.nodeName,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&void 0!==ly(e,n)}function j(e,t,n){$=!0;let r=performance.now()-W>100;try{ia(e,()=>{let i=rM()||e.read("latest",()=>{let e=rM();return null!==e?e.clone():null}),l=new Map,o=e._editorState,a=e._blockCursorElement,u=!1,f="";for(let n=0;n<t.length;n++){let d=t[n],c=d.type,h=d.target,g=function(e,t,n){for(let r=e;r&&!oA(r);r=lH(r)){let e=ly(r,t);if(void 0!==e){let t=l_(e,n);if(t)return i_(t)||!of(r)?void 0:[r,t]}}}(h,e,o);if(!g)continue;let[_,p]=g;if("characterData"===c)r&&n0(p)&&lo(h)&&function(e,t,n){if(rr(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return lo(t)&&n.isAttached()}(i,h,p)&&function(e,t,n){let r=l5(lV(n)),i=r&&oo(r,n._rootElement),l=null,o=null;null!==i&&i.anchorNode===e&&(l=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;null!==s&&lD(t,s,l,o,!1)}(h,p,e);else if("childList"===c){u=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=lp(r),l=r.parentNode;if(!(null==l||r===a||null!==i||H(r,l,e)||w(r)||e._slotsUsed&&of(r)&&r.hasAttribute("data-lexical-slot")||oA(r))){if(s){let e=(of(r)?r.innerText:null)||r.nodeValue;e&&(f+=e)}l.removeChild(r)}}let n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];H(r,h,e)||a===r?(h.appendChild(r),t++):w(r)&&t++}r!==t&&l.set(_,p)}}}if(l.size>0)for(let[t,n]of l)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],l=n.parentNode;null==l||"BR"!==n.nodeName||H(n,i,e)||l.removeChild(n)}}n.takeRecords()}null!==i&&(u&&lv(i),s&&l$(e)&&i.insertRawText(f))})}finally{$=!1}}function Y(e){let t=e._observer;null!==t&&j(e,t.takeRecords(),t)}function G(e){0===W&&lV(e).addEventListener("textInput",U,!0),e._observer=new MutationObserver((t,n)=>{j(e,t,n)})}let J="latest";class V{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||en).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}}function q(e,t,n=J){let r=(n===J?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}let X=new Set(["__proto__","constructor","prototype"]);class Q{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n,r=new Map,i){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;const{sharedConfigMap:l}=this.sharedNodeState,o=void 0!==i?i:function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(l,n,r);this.size=o}getValue(e){let t=this.knownState.get(e);if(void 0!==t)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];void 0!==t&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return et(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;let{sharedNodeState:t,unknownState:n}=this,r=new Map(this.knownState);return new Q(e,t,function(e,t,n){let r;if(n)for(let[i,l]of Object.entries(n)){if(X.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(l)):(r=r||{})[i]=l}return r}(t.sharedConfigMap,r,n),r,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=et(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){if(X.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}}function Z(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Q(t,ee(t));return t.__state=n,n}function ee(e){return e.__state?e.__state.sharedNodeState:i5(oy(),e.getType()).sharedNodeState}function et(e){if(e)for(let t in e)return e}function en(e){return e}function er(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;
1if(t!==i&&!r.isEqual(t,i))return!0}return!1}function ei(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function el(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function eo(e,t){let n=e.__mode,r=e.__format,i=e.__style,l=t.__mode,o=t.__format,s=t.__style,a=e.__state,u=t.__state;return(null===n||n===l)&&(null===r||r===o)&&(null===i||i===s)&&(null===e.__state||a===u||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&er(n,e,t)||t&&er(n,t,e)||e&&ei(n,e,t)||t&&ei(n,t,e))}(a,u))}function es(e,t){let n=e.mergeWithSibling(t),r=r4()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function ea(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&n0(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){eo(t,r)&&(r=es(t,r));break}t.remove()}for(;null!==(n=r.getNextSibling())&&n0(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){eo(r,n)&&(r=es(r,n));break}n.remove()}}else r.remove()}function eu(e){return ef(e.anchor),ef(e.focus),e}function ef(e){for(;"element"===e.type;){let t,n,r=e.getNode(),i=e.offset;if(i===r.getChildrenSize()?(t=r.getChildAtIndex(i-1),n=!0):(t=r.getChildAtIndex(i),n=!1),n0(t)){e.set(t.__key,n?t.getTextContentSize():0,"text",!0);break}if(!ic(t))break;e.set(t.__key,n?t.getChildrenSize():0,"element",!0)}}let ed=Symbol.for("@lexical/CachedTextSize");function ec(e,t){return eO.read(()=>{let r=0,i=e;for(let e=0;e<t&&null!==i;e++){let l=eE.get(i);if(void 0===l&&n(345,i),ic(l)){let o=eM.get(i);if(void 0!==o&&ic(o)&&o.__parent!==l.__parent)r+=l.getTextContentSize();else{let e=eA.get(i),t=e&&e.__lexicalTextContent;"string"!=typeof t&&n(346,l.getType()),r+=t.length}e<t-1&&!l.isInline()&&(r+=2)}else{let e=l[ed];void 0===e&&n(347,l.getType(),i),r+=e}i=l.__next}return r},{editor:e_})}function eh(e){ic(e)||void 0===e[ed]&&(e[ed]=n0(e)?e.__text.length:e.getTextContentSize())}let eg,e_,ep,em="",ey=null,eC=null,ex=null;function eS(){return{firstTextKey:ex,format:ey,style:eC}}function eT(e){null!==e.firstTextKey&&(ey=e.format,eC=e.style,ex=e.firstTextKey)}function eN(e){if(null!==ex)return;let t=e.__lexicalFirstTextKey;if(void 0===t&&n(348),null===t)return;let r=eM.get(t);n0(r)&&(ey=r.getFormat(),eC=r.getStyle(),ex=t)}let ev,ek,eb,eE,eO,eM,eA,ew,eD,eI,eP=!1,eF=!1;function eR(e,t){let n=eE.get(e),r=eM.has(e);if(null!==t){let n=e6(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(e_._keyToDOMMap.delete(e),ic(n)){let e=oB(n,eE);eL(e,0,e.length-1,null)}if(void 0!==n){for(let e of ej(n).values()){let t=eG(e);eR(e,null),null!==t&&t.remove()}lB(eD,ep,ev,n,"destroyed")}}}function eL(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];void 0!==t&&eR(t,r)}}function eK(e,t){e.setProperty("text-align",t)}function eB(e,t){let n=eg.theme.indent;if("string"==typeof n){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * var(--lexical-indent-base-value, 40px))`),lL(e,"class"),lL(e,"style")}function ez(e,t){let n=e.style;0===t?eK(n,""):1===t?eK(n,"left"):2===t?eK(n,"center"):3===t?eK(n,"right"):4===t?eK(n,"justify"):5===t?eK(n,"start"):6===t&&eK(n,"end"),lL(e,"style")}function e$(e,t){let n=function(e){let t=e.__dir;if(null!==t)return t;if(im(e))return null;let n=e.getParent();return null===n||lZ(n)&&null===n.__dir?"auto":null}(t);null!==n?e.dir=n:e.removeAttribute("dir")}function eW(e){let t=or().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}function eU(e,t,n){t||"false"===e.contentEditable?function(e,t=oy()){let n=t.isEditable();e.contentEditable=n?"true":"false",n?e.__lexicalEditor=t:delete e.__lexicalEditor}(n,e_):n.removeAttribute("contenteditable")}function eH(e,t,n){let r=em,i=eS();em="";let l="",o=i_(e);for(let[r,i]of n){let n=eW(r);eU(t,o,n),t.appendChild(n),em="";let s=eS();eV(i,ox(e,n,e_)),eT(s),eY(e,r,t,n),l+=em}return eT(i),em=r,l}function ej(e){return oW(e)&&null!==e.__slots?e.__slots:o$}function eY(e,t,n,r){let i=eI.$getSlotTargetElement(e,t,n,e_);null!==i&&(r.parentElement!==i&&i.appendChild(r),r.style.display="")}function eG(e){let t=eA.get(e);return void 0!==t?t.parentElement:null}function eJ(e,t,n){let r=ej(e),i=ej(t);for(let[e,t]of r)if(!i.has(e)){let e=eG(t);eR(t,null),null!==e&&e.remove()}let l=em,o=eS(),s="",a=null,u=i_(t);for(let[e,l]of i){let i=r.get(e),o=void 0!==i?eG(i):null;em="";let f=eS();if(null===o){o=eW(e);let r=null;for(let e of n.children)if(!e.hasAttribute("data-lexical-slot")){r=e;break}n.insertBefore(o,r),eV(l,ox(t,o,e_))}else i===l?e1(l,o):(void 0!==i&&eR(i,o),eV(l,ox(t,o,e_)));if(eT(f),eU(n,u,o),eY(t,e,n,o),s+=em,o.parentElement===n){let e=null===a?n.firstChild:a.nextSibling;e!==o&&n.insertBefore(o,e),a=o}}return eT(o),em=l,s}function eV(e,t){var r;let i,l=eM.get(e);if(void 0===l&&n(60),null!==t){let n=eE.get(e);if(void 0!==n){let r=eA.get(e);if(void 0!==r){let i=oU(n)?n.__slotHost:null,o=oU(l)?l.__slotHost:null,s=n.__parent!==l.__parent||i!==o,a=null!==o&&r.parentElement!==t.element;if(s||a)return t.insertChild(r),e1(e,t.element)}}}let o=eI.$createDOM(l,e_);if(i=(r=e_)._keyToDOMMap,lm(o,r,e),i.set(e,o),n0(l)?o.setAttribute("data-lexical-text","true"):i_(l)&&(o.setAttribute("data-lexical-decorator","true"),oM(o,{captureSelection:!0}
1)),ic(l)){let e=l.__indent,t=l.__size;e$(o,l),0!==e&&eB(o,e);let n=ej(l),r=n.size>0?eH(l,o,n):"";if(0===t)o.__lexicalTextContent=r,o.__lexicalFirstTextKey=null,em+=r,n.size>0&&(o.__lexicalSlotTextLength=r.length);else{let e=em;if(eq(oB(l,eM),l,0,t-1,ox(l,o,e_)),""!==r){let t=o.__lexicalTextContent||"";o.__lexicalTextContent=r+t,em=e+r+t}n.size>0&&(o.__lexicalSlotTextLength=r.length)}let i=l.__format;0!==i&&ez(o,i),l.isInline()||(eZ(null,l,o),eQ(l,o))}else{let t=l.getTextContent();if(i_(l)){let t=l.decorate(e_,eg);null!==t&&e2(e,t),o.contentEditable="false";let n=ej(l);n.size>0&&eH(l,o,n)}em+=t}return null!==t&&t.insertChild(o),eI.$decorateDOM(l,null,o,e_),eh(l),lB(eD,ep,ev,l,"created"),o}function eq(e,t,r,i,l){let o=em,s=eS();em="",ey=null,eC=null,ex=null;let a=r;for(;a<=i;++a){let t=eS();eV(e[a],l);let n=eM.get(e[a]);null!==n&&n0(n)?null===ey&&(ey=n.getFormat(),eC=n.getStyle(),ex=n.__key):ic(n)&&a<i&&!n.isInline()&&(em+="\n\n"),eT(t)}let u=e_._keyToDOMMap.get(t.__key);void 0===u&&n(349,t.__key),u.__lexicalTextContent=em,u.__lexicalFirstTextKey=ex,em=o+em,eT(s)}function eX(e,t){if(!e)return!1;let n=t.get(e);return i_(n)&&!n.isInline()}function eQ(e,t){let n=ox(e,t,e_);n.setDecoratorBoundaryAnchor("leading",eX(e.__first,eM)),n.setDecoratorBoundaryAnchor("trailing",eX(e.__last,eM))}function eZ(e,t,n){let r=ox(t,n,e_),i=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return ik(e)?"line-break":i_(e)&&e.isInline()?"decorator":null}return"empty"}return null}(t,eM);r.setManagedLineBreak(i)}function e0(e,t,n){let r=t.__lexicalFirstTextKey;if(null!=r){let t=e.__key,i=r;for(;null!==i;){let e=eM.get(i);if(void 0===e){i=null;break}if(e.__parent===t)break;i=e.__parent}if(null!==i&&!n.has(i)){let e=eM.get(r);if(n0(e))return ey=e.getFormat(),void(eC=e.getStyle())}}t.__lexicalFirstTextKey=ex}function e1(e,t){let r=eE.get(e),i=eM.get(e);void 0!==r&&void 0!==i||n(61);let l=eP||eb.has(e)||ek.has(e),o=lU(e_,e);if(r===i&&!l){let e;if(ic(r)){let t=o.__lexicalTextContent;"string"!=typeof t&&n(355,r.getType()),e=t,eN(o)}else e=r.getTextContent();return em+=e,o}if(r!==i&&l&&lB(eD,ep,ev,i,"updated"),eI.$updateDOM(i,r,o,e_)){let r=eV(e,null);return null===t&&n(62),t.replaceChild(r,o),eR(e,null),r}if(ic(r)){ic(i)||n(334,e);let t=i.__indent;(eP||t!==r.__indent)&&eB(o,t);let s=i.__format;(eP||s!==r.__format)&&ez(o,s);let a=l&&(ej(i).size>0||ej(r).size>0)?eJ(r,i,o):"";if(l){let e=em;if(function(e,t,r){ey=null,eC=null,ex=null,function(e,t,r){let i=em,l=e.__size,o=t.__size;em="";let s=r.element,a=e_._keyToDOMMap.get(t.__key);void 0===a&&n(351,t.__key);let u=o-l;if(!eP&&1>=Math.abs(u)&&l>=4&&e.__first===t.__first&&(0!==u||!e_._cloneNotNeeded.has(e.__key))){let l=a.__lexicalTextContent,f=ew.get(e.__key);if(!eP&&"string"==typeof l&&void 0!==f){let o=function(e,t){let n=t.size;if(0===n||n>=e.__size)return null;let r=e.__last,i=null,l=0;for(;null!==r&&l<n;){if(!t.has(r))return null;i=r;let e=eM.get(r);if(void 0===e)return null;r=e.__prev,l++}return l!==n||null!==r&&t.has(r)?null:i}(t,f);if(null!==o){let d=f.size;if(0===u){let e=ec(o,d),r=o,u=0;for(;null!==r&&u<d;){let e=eM.get(r);if(void 0===e)break;let t=eS();e1(r,s),n0(e)&&null===ey&&(ey=e.getFormat(),eC=e.getStyle(),ex=e.__key),eT(t),r=e.__next,u++}let c="";for(r=o,u=0;null!==r&&u<d;){let e,t=eM.get(r);if(void 0===t)break;if(ic(t)){let i=e_._keyToDOMMap.get(r),l=i&&i.__lexicalTextContent;"string"!=typeof l&&n(352,t.getType()),e=l}else e=t.getTextContent();c+=e,u<d-1&&ic(t)&&!t.isInline()&&(c+="\n\n"),r=t.__next,u++}let h=a.__lexicalSlotTextLength||0,g=h>0?l.slice(h):l,_=g.slice(0,g.length-e)+c;return a.__lexicalTextContent=_,em=i+_,e0(t,a,f)}if(function(e,t,r,i,l,o,s){if(1!==s&&-1!==s||o!==(1===s?2:1))return!1;let a=o-s,u=e.__last;for(let e=0;e<a-1;e++){if(null===u)return!1;let e=eE.get(u);if(void 0===e)return!1;u=e.__prev}if(null===u)return!1;let f=eM.get(l),d=eE.get(u);if(void 0===f||void 0===d||f.__prev!==d.__prev)return!1;let c=[],h=l;for(let e=0;e<o;e++){if(null===h)return!1;c.push(h);let e=eM.get(h);h=e?e.__next:null}let g=[];h=u;for(let e=0;e<a;e++){if(null===h)return!1;g.push(h);let e=eE.get(h);h=e?e.__next:null}let _=new Set(g),p=new Set(c),m=[],y=0,C=0;for(;y<a&&C<o;
1)if(c[C]===g[y])m.push({key:c[C],kind:"reconcile"}),y++,C++;else if(p.has(g[y])){if(_.has(c[C]))return!1;m.push({key:c[C],kind:"create",nextIndex:C}),C++}else m.push({key:g[y],kind:"destroy"}),y++;for(;y<a;)m.push({key:g[y++],kind:"destroy"});for(;C<o;)m.push({key:c[C],kind:"create",nextIndex:C}),C++;let x=ec(u,a);for(let e of m){let n=eS();if("reconcile"===e.kind)e1(e.key,t.element);else if("destroy"===e.kind)eR(e.key,t.element);else{let n=null;for(let t=e.nextIndex+1;t<o;t++){let e=e_._keyToDOMMap.get(c[t]);if(void 0!==e){n=e;break}}eV(e.key,t.withBefore(n??t.before))}if("destroy"!==e.kind){let t=eM.get(e.key);t&&n0(t)&&null===ey&&(ey=t.getFormat(),eC=t.getStyle(),ex=t.__key)}eT(n)}let S="";for(let e=0;e<o;e++){let t,r=eM.get(c[e]);if(void 0===r)return!1;if(ic(r)){let i=e_._keyToDOMMap.get(c[e]),l=i&&i.__lexicalTextContent;"string"!=typeof l&&n(350,r.getType()),t=l}else t=r.getTextContent();S+=t,e<o-1&&ic(r)&&!r.isInline()&&(S+="\n\n")}let T=r.__lexicalSlotTextLength||0,N=T>0?i.slice(T):i;return r.__lexicalTextContent=N.slice(0,N.length-x)+S,!0}(e,r,a,l,o,d,u)){let e=a.__lexicalTextContent;return"string"!=typeof e&&n(353),em=i+e,e0(t,a,f)}}}if(0===u){let t=e.__first,r=0;for(;null!==t;){let e=eM.get(t);if(void 0===e)break;
1let i=eP||eb.has(t)||ek.has(t),l=eS();if(i)e1(t,s);else{let r,i;if(ic(e)){let l=(i=eA.get(t))&&i.__lexicalTextContent;"string"!=typeof l&&n(354,e.getType()),r=l}else r=e.getTextContent();em+=r,void 0!==i&&eN(i)}n0(e)?null===ey&&(ey=e.getFormat(),eC=e.getStyle(),ex=e.__key):ic(e)&&r<o-1&&!e.isInline()&&(em+="\n\n"),eT(l),t=e.__next,r++}return a.__lexicalTextContent=em,a.__lexicalFirstTextKey=ex,em=i+em}}if(1===l&&1===o){let n=e.__first,i=t.__first;if(n===i)e1(n,s);else{let e=e6(n),t=eV(i,null);try{e.parentNode===s?s.replaceChild(t,e):r.insertChild(t)}catch(r){if("object"==typeof r&&null!=r)throw Error(`${r.toString()} Parent: ${s.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${n}}.`);throw r}eR(n,null)}let l=eM.get(i);n0(l)&&null===ey&&(ey=l.getFormat(),eC=l.getStyle(),ex=l.__key)}else{let i=oB(e,eE),a=oB(t,eM);if(i.length!==l&&n(227),a.length!==o&&n(228),0===l)0!==o&&eq(a,t,0,o-1,r);else if(0===o){if(0!==l){let e=null==r.after&&null==r.before&&0===ej(t).size&&null==r.element.__lexicalLineBreak;eL(i,0,l-1,e?null:s),e&&(s.textContent="")}}else!function(e,t,n,r,i,l){let o=r-1,s=i-1,a,u,f=l.getFirstChild(),d=0,c=0;for(;d<=o&&c<=s;){let e=t[d],r=n[c],i=eS();if(e===r)f=e3(e1(r,l.element)),d++,c++;else{if(void 0===u&&(u=e4(n,c)),void 0===a)a=e4(t,d);else if(!a.has(e)){d++,eT(i);continue}if(!u.has(e)){f=e3(e6(e)),eR(e,l.element),d++,a.delete(e),eT(i);continue}if(a.has(r)){let e=lU(e_,r);e!==f&&l.withBefore(f??l.before).insertChild(e),f=e3(e1(r,l.element)),d++,c++}else eV(r,l.withBefore(f??l.before)),c++}let o=eM.get(r);null!==o&&n0(o)?null===ey&&(ey=o.getFormat(),eC=o.getStyle(),ex=o.__key):ic(o)&&c<=s&&!o.isInline()&&(em+="\n\n"),eT(i)}let h=d>o,g=c>s;if(h&&!g){let t=n[s+1],r=void 0===t?null:e_.getElementByKey(t);eq(n,e,c,s,l.withBefore(r??l.before))}else g&&!h&&eL(t,d,o,l.element)}(t,i,a,l,o,r)}a.__lexicalTextContent=em,a.__lexicalFirstTextKey=ex,em=i+em}(e,t,ox(t,r,e_)),lZ(t)||(null==ey||ey===t.__textFormat||eF||t.setTextFormat(ey),null==eC||eC===t.__textStyle||eF||t.setTextStyle(eC))}(r,i,o),i.isInline()||(im(i)||eZ(0,i,o),eQ(i,o)),""!==a){let t=o.__lexicalTextContent||"";o.__lexicalTextContent=a+t,em=e+a+t,o.__lexicalSlotTextLength=a.length}else(ej(i).size>0||ej(r).size>0)&&(o.__lexicalSlotTextLength=0)}else{let e=o.__lexicalTextContent;"string"!=typeof e&&n(356,r.getType()),em+=e,eN(o)}if((eP||i.__dir!==r.__dir||i.__parent!==r.__parent)&&(e$(o,i),im(i)&&!eP))for(let e of i.getChildren())ic(e)&&e$(lU(e_,e.getKey()),e)}else{let t=i.getTextContent();if(i_(i)){let t=i.decorate(e_,eg);null!==t&&e2(e,t),l&&(ej(i).size>0||ej(r).size>0)&&eJ(r,i,o)}em+=t}if(!eF&&im(i)){let e=i.getLatest();if(e.__cachedText!==em){let t=e.getWritable();t.__cachedText=em,i=t}}return eI.$decorateDOM(i,r,o,e_),eh(i),o}function e2(e,t){let n=e_._pendingDecorators,r=e_._decorators;if(null===n){if(r[e]===t)return;n=lx(e_)}n[e]=t}function e3(e){let t=e.nextSibling;return null!==t&&t===e_._blockCursorElement&&(t=t.nextSibling),t}function e4(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function e6(e){let t=eA.get(e);return void 0===t&&n(75,e),t}function e5(e){return{type:e}}let e7=e5("SELECTION_CHANGE_COMMAND"),e8=e5("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),e9=e5("CLICK_COMMAND"),te=e5("BEFORE_INPUT_COMMAND"),tt=e5("INPUT_COMMAND"),tn=e5("COMPOSITION_START_COMMAND"),tr=e5("COMPOSITION_END_COMMAND"),ti=e5("DELETE_CHARACTER_COMMAND"),tl=e5("INSERT_LINE_BREAK_COMMAND"),to=e5("INSERT_PARAGRAPH_COMMAND"),ts=e5("CONTROLLED_TEXT_INSERTION_COMMAND"),ta=e5("PASTE_COMMAND"),tu=e5("REMOVE_TEXT_COMMAND"),tf=e5("DELETE_WORD_COMMAND"),td=e5("DELETE_LINE_COMMAND"),tc=e5("FORMAT_TEXT_COMMAND"),th=e5("SET_TEXT_FORMAT_COMMAND"),tg=e5("UNDO_COMMAND"),t_=e5("REDO_COMMAND"),tp=e5("KEYDOWN_COMMAND"),tm=e5("KEY_ARROW_RIGHT_COMMAND"),ty=e5("MOVE_TO_END"),tC=e5("KEY_ARROW_LEFT_COMMAND"),tx=e5("MOVE_TO_START"),tS=e5("KEY_ARROW_UP_COMMAND"),tT=e5("KEY_ARROW_DOWN_COMMAND"),tN=e5("KEY_ENTER_COMMAND"),tv=e5("KEY_SPACE_COMMAND"),tk=e5("KEY_BACKSPACE_COMMAND"),tb=e5("KEY_ESCAPE_COMMAND"),tE=e5("KEY_DELETE_COMMAND"),tO=e5("KEY_TAB_COMMAND"),tM=e5("INSERT_TAB_COMMAND"),tA=e5("INDENT_CONTENT_COMMAND"),tw=e5("OUTDENT_CONTENT_COMMAND"),tD=e5("DROP_COMMAND"),tI=e5("FORMAT_ELEMENT_COMMAND"),tP=e5("DRAGSTART_COMMAND"),tF=e5("DRAGOVER_COMMAND"),tR=e5("DRAGEND_COMMAND"),tL=e5("COPY_COMMAND"),tK=e5("CUT_COMMAND"),tB=e5("SELECT_ALL_COMMAND"),tz=e5("CLEAR_EDITOR_COMMAND"),t$
1=e5("CLEAR_HISTORY_COMMAND"),tW=e5("CAN_REDO_COMMAND"),tU=e5("CAN_UNDO_COMMAND"),tH=e5("FOCUS_COMMAND"),tj=e5("BLUR_COMMAND"),tY=e5("KEY_MODIFIER_COMMAND"),tG={[k]:"metaKey",ctrlKey:!o,metaKey:o},tJ={[k]:"altKey",altKey:o,ctrlKey:!o},tV=[["altKey",1],["ctrlKey",2],["metaKey",4],["shiftKey",8]];function tq(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}class tX{byKey=new Map;byCode=new Map;add(e){let{key:t,modifiers:r={}}=e;t.length>0||n(399);let i=t.toLowerCase();for(let n of function(e){let t=[0];for(let[n,r]of tV){let i=e[n]||!1;"any"===i?t=t.concat(t.map(e=>e|r)):i&&(t=t.map(e=>e|r))}return t}(r))tq(this.byKey,`${n}:${i}`,e),1===t.length&&(/[0-9]/.test(t)?tq(this.byCode,`${n}:Digit${t}`,e):/[a-z]/.test(i)&&tq(this.byCode,`${n}:Key${i.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,r]of tV)e[n]&&(t|=r);return t}(e),r=this.byKey.get(`${n}:${t.toLowerCase()}`),i=r?r.slice():[];if(this.byCode.size>0&&!(1===t.length&&127>=t.charCodeAt(0))){let t=this.byCode.get(`${n}:${e.code}`);t&&i.push(...t)}return i}match(e){return this.matches(e)[0]}}function tQ(e){let t=new tX;for(let n of e)t.add(n);return t}function tZ(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);void 0===i&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let l=()=>{let e=t.get(n);e&&e.holders.delete(l)&&0===e.holders.size&&(t.delete(n),e.dispose())};return i.holders.add(l),l}}}function t0(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}let t1=Object.freeze({}),t2=[["keydown",function(e,t){let n=t._inputState;n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,"Backspace"!==e.key&&nr(n),t.isComposing()||lW(t,tp,e)}],["pointerdown",function(e,t){let n=ou(e),r=e.pointerType;od(n)&&"touch"!==r&&"pen"!==r&&0===e.button&&ia(t,()=>{ow(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,t){lW(t,tn,e)}],["compositionend",function(e,t){let n=t._inputState;s?n.compositionPhase="ending-firefox":!u&&(d||g)?(n.compositionPhase="ending-safari",n.compositionEndData=e.data):lW(t,tr,e)}],["input",function(e,t){e.stopPropagation();let n=t._inputState;nr(n),ia(t,()=>{nl(e,t)||t.dispatchCommand(tt,e)},{event:e}),n.unprocessedBeforeInputData=null}],["click",function(e,t){ia(t,()=>{let n=rM(),r=l5(lV(t)),i=rA();if(r){if(rr(n)){let e=n.anchor,t=e.getNode();"element"===e.type&&0===e.offset&&n.isCollapsed()&&!im(t)&&1===lT().getChildrenSize()&&t.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if("touch"===e.pointerType||"pen"===e.pointerType){let n=oo(r,t._rootElement).anchorNode;(of(n)||lo(n))&&lv(rO(i,r,t,e))}}if(s&&null!==r&&0===r.rangeCount){let n=t._rootElement;if(null!==n&&e.target===n){let l=e.clientY,o=n.childNodes.length;for(let e=0;e<n.childNodes.length;e++){let t=n.childNodes[e];if(of(t)){let n=t.getBoundingClientRect();if(l<=(n.top+n.bottom)/2){o=e;break}}}r.setBaseAndExtent(n,o,n,o);let s=rO(i,r,t,e);null!==s?lv(s):r.removeAllRanges()}}lW(t,e9,e)})}],["cut",t1],["copy",t1],["dragstart",t1],["dragover",t1],["dragend",t1],["paste",t1],["focus",t1],["blur",t1],["drop",t1]];a&&t2.push(["beforeinput",(e,t)=>{let n;"deleteCompositionText"===(n=e.inputType)||s&&l$(t)||"insertCompositionText"!==n&&ia(t,()=>{nl(e,t)||lW(t,te,e)},{event:e})}]);let t3=new WeakMap,t4=new WeakMap,t6=tZ(e=>(e.addEventListener("selectionchange",nx),()=>e.removeEventListener("selectionchange",nx)));function t5(e,t,n,r,i,l){let o,s=e.anchor,u=e.focus,f=s.getNode(),d=r4();if(void 0!==l)o=l;else{let e=l5(lV(d));o=null!==e?oo(e,d._rootElement):null}let c=null!==o?o.anchorNode:null,h=s.key,g=d.getElementByKey(h),_=n.length;return h!==u.key||!n0(f)||(!i&&(!a||d._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||f.isDirty()&&_<2||lE(n))&&s.offset!==u.offset&&!f.isComposing()||ll(f)||f.isDirty()&&_>1||(i||!a)&&null!==g&&!f.isComposing()&&c!==oS(f,g,d)||null!==o&&null!==t&&(!t.collapsed||t.startContainer!==o.anchorNode||t.startOffset!==o.anchorOffset)||!f.isComposing()&&(f.getFormat()!==e.format||f.getStyle()!==e.style)||function(e,t){let n;if(t.isSegmented())return!0;
1if(!e.isCollapsed())return!1;let r=e.anchor.offset,i=t.getParentOrThrow(),l=li(t);return 0===r?!t.canInsertTextBefore()||!i.canInsertTextBefore()&&!t.isComposing()||l||(n0(n=t.getPreviousSibling())||ic(n)&&n.isInline())&&!n.canInsertTextAfter():r===t.getTextContentSize()&&(!t.canInsertTextAfter()||!i.canInsertTextAfter()&&!t.isComposing()||l)}(e,f)}function t7(e,t){return lo(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function t8(e,t,r){let{anchorNode:i,anchorOffset:l,focusNode:o,focusOffset:s}=oo(e,t._rootElement),a=t._inputState;if(a.isSelectionChangeFromDOMUpdate){a.isSelectionChangeFromDOMUpdate=!1;let e=a.selectionChangeFromDOMUpdatePoints;if(a.selectionChangeFromDOMUpdatePoints=null,t7(i,l)&&t7(o,s)&&!a.postDeleteSelectionToRestore&&(null===e||e.anchorNode===i&&e.anchorOffset===l&&e.focusNode===o&&e.focusOffset===s))return}ia(t,()=>{if(!r)return void lv(null);if(!le(t,i,o))return;let u=rM();if(a.postDeleteSelectionToRestore&&rr(u)&&u.isCollapsed()){let e=u.anchor,t=a.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&lv(u=a.postDeleteSelectionToRestore.clone())}if(a.postDeleteSelectionToRestore=null,rr(u)){let r=u.anchor,f=r.getNode();if(u.isCollapsed()){"Range"===e.type&&i===o&&(u.dirty=!0);let l=lV(t).event,s=l?l.timeStamp:performance.now(),{format:d,style:c,offset:h,key:g,timeStamp:_}=a.collapsedSelectionFormat,p=lT(),m=!1===t.isComposing()&&""===p.getTextContent();if(s<_+200&&r.offset===h&&r.key===g)t9(u,d,c);else if("text"===r.type)n0(f)||n(141),ne(u,f);else if("element"===r.type&&!m){ic(f)||n(259);let e=r.getNode();e.isEmpty()?t9(u,e.getTextFormat(),e.getTextStyle()):t9(u,u.format,"")}}else{let e=r.key,t=u.focus.key,n=u.getNodes(),i=n.length,o=u.isBackward(),a=o?s:l,f=o?l:s,d=o?t:e,c=o?e:t,h=2047,g=!1;for(let e=0;e<i;e++){let t=n[e],r=t.getTextContentSize();if(n0(t)&&0!==r&&(0!==e||t.__key!==d||a!==r)&&(e!==i-1||t.__key!==c||0!==f)&&(g=!0,0==(h&=t.getFormat())))break}u.format=g?h:0}}lW(t,e7)})}function t9(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function ne(e,t){t9(e,t.getFormat(),t.getStyle())}function nt(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return 0===t.length?null:t[0]}function nn(e){let{lastKeyCode:t}=r4()._inputState;if(null==e||e.length<=1||null==t)return;let n=1===t.length?t:"Enter"===t?"\n":"Tab"===t?"	":null;if(!n)return;let r=rM();if(!rr(r)||!r.isCollapsed())return;let i=r.anchor.getNode();if(!n0(i))return;let{offset:l}=r.anchor;if(i.getTextContentSize()===l){let e=i.getNextSibling();if("\n"===n){if(u)return;if(ik(e))e.selectEnd();else if(!e){let e=oK(i,rv),t=e&&e.getNextSibling();ic(t)&&t.selectStart()}}else"	"===n?n4(e)&&e.selectEnd():n0(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[l]===n&&i.select(l+1,l+1)}function nr(e){e.isInsertTextAfterHandledSelectionCommand=!1,null!==e.handledSelectionCommandTimeoutId&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function ni(e){nr(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>nr(e),0)}function nl(e,t){let n=ou(e);if(of(n)&&ow(n,t))return!0;let r=t.getRootElement();if(null===r)return!1;let i=oa(r.ownerDocument);return null!==i&&r.contains(i)&&ow(i,t)}function no(e){var t;let r=e.inputType,i=nt(e),l=r4(),o=l._inputState,s=rM();if("insertText"===r&&e.data&&o.isInsertTextAfterHandledSelectionCommand){if(nr(o),e.preventDefault(),rr(s)&&!s.isCollapsed()){let e=s.isBackward()?s.anchor:s.focus;s.anchor.set(e.key,e.offset,e.type),s.focus.set(e.key,e.offset,e.type)}return!0}if("deleteContentBackward"===r){if(null===s){let e=rA();if(!rr(e))return!0;lv(e.clone())}if(rr(s)){let r=s.anchor.key===s.focus.key;if(t=e.timeStamp,"MediaLast"===o.lastKeyCode&&t<o.lastKeyDownTimeStamp+30&&l.isComposing()&&r){if(lh(null),o.lastKeyDownTimeStamp=0,setTimeout(()=>{ia(l,()=>{lh(null)})},30),rr(s)){let e=s.anchor.getNode();e.markDirty(),n0(e)||n(142),ne(s,e)}}else{if(lh(null),u&&null!==i&&!i.collapsed&&(s.applyDOMRange(i),!s.isCollapsed()))return e.preventDefault(),s.removeText(),!0;e.preventDefault();let t=s.anchor.getNode(),n=t.getTextContent(),a=t.canInsertTextAfter(),f=0===s.anchor.offset&&s.focus.offset===n.length,d=h&&r&&!f&&a;if(d&&s.isCollapsed()&&(d=!i_(function(e,t){let n=e.offset;if("element"===e.type)return lz(e.getNode(),t,n);{let r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return null===e?lz(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}(s.anchor,!0))),!d){lW(l,ti,!0);let e=rM();h&&rr(e)&&e.isCollapsed()&&(o.postDeleteSelectionToRestore=e,setTimeout(()=>
1o.postDeleteSelectionToRestore=null))}}return!0}}if(!rr(s))return"historyUndo"!==r&&"historyRedo"!==r||(e.preventDefault(),lW(l,"historyUndo"===r?tg:t_)),!0;let a=e.data;null!==o.unprocessedBeforeInputData&&lw(!1,l,o.unprocessedBeforeInputData),s.dirty&&null===o.unprocessedBeforeInputData||!s.isCollapsed()||im(s.anchor.getNode())||null===i||s.applyDOMRange(i),o.unprocessedBeforeInputData=null;let f=s.anchor,d=s.focus,c=f.getNode(),g=d.getNode();if("insertText"===r||"insertTranspose"===r){if("\n"===a)e.preventDefault(),lW(l,tl,!1);else if("\n\n"===a)e.preventDefault(),lW(l,to);else if(null==a&&e.dataTransfer){let t=e.dataTransfer.getData("text/plain");e.preventDefault(),s.insertRawText(t)}else null!=a&&t5(s,i,a,e.timeStamp,!0)?(e.preventDefault(),lW(l,ts,a),nn(a)):o.unprocessedBeforeInputData=a;return o.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),r){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":lW(l,ts,e),nn((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{let t=o.hadOrphanedCompositionEvents;o.hadOrphanedCompositionEvents=!1;let n=l._compositionKey;lh(null),t||lW(l,ts,e),nf(n);break}case"insertLineBreak":lh(null),lW(l,tl,!1);break;case"insertParagraph":lh(null),o.isInsertLineBreak&&!u?(o.isInsertLineBreak=!1,lW(l,tl,!1)):lW(l,to);break;case"insertFromPaste":case"insertFromPasteAsQuotation":lW(l,ta,e);break;case"deleteByComposition":(c!==g||ic(c)||ic(g)||!li(c)||!li(g))&&lW(l,tu,e);break;case"deleteByDrag":lY(nI),lW(l,tu,e);break;case"deleteByCut":lW(l,tu,e);break;case"deleteContent":lW(l,ti,!1);break;case"deleteWordBackward":lW(l,tf,!0);break;
1case"deleteWordForward":lW(l,tf,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":lW(l,td,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":lW(l,td,!1);break;case"formatStrikeThrough":lW(l,tc,"strikethrough");break;case"formatBold":lW(l,tc,"bold");break;case"formatItalic":lW(l,tc,"italic");break;case"formatUnderline":lW(l,tc,"underline");break;case"historyUndo":lW(l,tg);break;case"historyRedo":lW(l,t_)}return!0}function ns(e){let t=r4(),n=t._inputState,r=rM(),i=e.data,l=nt(e),o=!1;if(null!=i&&rr(r)){let u=l5(lV(t)),f=null!==u?oo(u,t._rootElement):null,d="insertCompositionText"===e.inputType&&"ending-firefox"!==n.compositionPhase&&!t.isComposing();d&&(n.hadOrphanedCompositionEvents=!0);let c=r.anchor.getNode(),g="insertCompositionText"===e.inputType&&"ending-firefox"!==n.compositionPhase&&t.isComposing()&&n0(c)&&ll(c);if(!d&&!g&&t5(r,l,i,e.timeStamp,!1,f)){if(o=!0,"ending-firefox"===n.compositionPhase){let e=nd(t,i);if(n.compositionPhase="idle",e)return lY(nF),lk(),!0}let l=r.anchor.getNode();if(null===u||null===f)return!0;let d=r.isBackward(),c=d?r.anchor.offset:r.focus.offset,g=d?r.focu
1s.offset:r.anchor.offset;a&&!r.isCollapsed()&&n0(l)&&null!==f.anchorNode&&l.getTextContent().slice(0,c)+i+l.getTextContent().slice(c+g)===lA(f.anchorNode)||lW(t,ts,i);let _=i.length;s&&_>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(r.anchor.offset-=_,r._cachedNodes=null,r._cachedIsBackward=null),h&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,lh(null))}}return o||(lw(!1,t,null!==i?i:void 0),"ending-firefox"===n.compositionPhase&&(nd(t,i||void 0),lY(nF),n.compositionPhase="idle")),lk(),!0}function na(e){let t=r4(),n=t._inputState,r=rM();if(rr(r)&&!t.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;let i=r.anchor,l=r.anchor.getNode();if(lh(i.key),lY(nP),e.timeStamp<n.lastKeyDownTimeStamp+30||"element"===i.type||!r.isCollapsed()||!h&&(l.getFormat()!==r.format||n0(l)&&l.getStyle()!==r.style)||n0(l)&&(ll(l)||0===i.offset&&!l.canInsertTextBefore()||i.offset===l.getTextContentSize()&&!l.canInsertTextAfter())){lW(t,ts,p);let e=rM();rr(e)&&lh(e.anchor.key)}}return!0}function nu(e){let t=r4();return t._inputState.compositionPhase="idle",nd(t,e.data),lY(nF),!0}function nf(e){if(null===e)return;let t=l_(e);if(!n0(t)||"text"===t.getType()||ll(t)||!t.isAttached())return;let n=rM(),r=rr(n)&&n.anchor.key===e?n.anchor.offset:null,i=nZ(t.getTextContent());if(i.setFormat(t.getFormat()),i.setStyle(t.getStyle()),t.replace(i),null!==r){let e=Math.min(r,i.getTextContentSize());i.select(e,e)}}function nd(e,t){let n=e._compositionKey;if(lh(null),null!==n&&null!=t){if(""===t){let t=l_(n),r=e.getElementByKey(n),i=null!==r&&n0(t)?oS(t,r,e):null;if(null!==i&&null!==i.nodeValue&&n0(t)){let n=l5(lV(e)),r=n&&oo(n,e._rootElement),l=null,o=null;null!==r&&r.anchorNode===i&&(l=r.anchorOffset,o=r.focusOffset),lD(t,i.nodeValue,l,o,!0)}return nf(n),!1}if("\n"===t[t.length-1]){let t=rM();if(rr(t)||rl(t)){if(rr(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return lW(e,tN,null),nf(n),!1}}let r=l_(n);if(null!==r&&n0(r)&&ll(r)){r.markDirty();let e=rM(),i=r.getTextContentSize(),l=rr(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(l,l).insertText(t),!0}}return lw(!0,e,t),nf(n),!1}let nc={altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:"any"},nh={ctrlKey:!0},ng={metaKey:!0},n_={shiftKey:"any"},np={...n_,altKey:"any"};function nm(e){let t,n,r,i,l=r4(),s=l._inputState;if(null==e.key)return!0;if("ending-safari"===s.compositionPhase){let t="Backspace"===e.key;if(t&&ia(l,()=>{nd(l,s.compositionEndData)}),s.compositionPhase="idle",s.compositionEndData="",t)return!0}let a=l._keyDownShortcuts;null===a&&(l._keyDownShortcuts=a=tQ((t=(e,t,n)=>({key:e,modifiers:t,onMatch:(e,t)=>{lW(t,n,e)}}),n=(e,t,n,r)=>({key:e,modifiers:t,onMatch:(e,t)=>{e.preventDefault(),lW(t,n,r)}}),r=(e,t)=>({key:"Enter",modifiers:e,onMatch:(e,n)=>{n._inputState.isInsertLineBreak=t,lW(n,tN,e)}}),i=(e,t)=>({key:e,modifiers:tG,onMatch:(e,n)=>{let r=n._editorState._selection;null===r||rr(r)||(e.preventDefault(),lW(n,t,e))}}),[t("ArrowRight",n_,tm),t("ArrowLeft",n_,tC),t("ArrowUp",np,tS),t("ArrowDown",np,tT),r({...nc,shiftKey:!0},!0),r({...nc,shiftKey:!1},!1),t(" ",nc,tv),{key:"Backspace",modifiers:n_,onMatch:(e,t)=>{lW(t,tk,e)&&ni(t._inputState)}},t("Escape",nc,tb),t("Delete",{},tE),n("Backspace",tJ,tf,!0),n("Delete",tJ,tf,!1),n("b",tG,tc,"bold"),n("u",tG,tc,"underline"),n("i",tG,tc,"italic"),t("Tab",n_,tO),n("z",tG,tg,void 0),n("z",{...tG,shiftKey:!0},t_,void 0),...o?[{key:"o",modifiers:nh,onMatch:(e,t)=>{e.preventDefault(),t._inputState.isInsertLineBreak=!0,lW(t,tl,!0)}},t("ArrowLeft",{metaKey:!0,...n_},tx),t("ArrowRight",{metaKey:!0,...n_},ty),n("h",nh,ti,!0),n("d",nh,ti,!1),n("Backspace",ng,td,!0),n("Delete",ng,td,!1),n("k",nh,td,!1)]:[t("Home",n_,tx),t("End",n_,ty),n("y",nh,t_,void 0)],{key:"a",modifiers:tG,onMatch:(e,t)=>{e.preventDefault(),lW(t,tB,e)&&ni(t._inputState)}},i("c",tL),i("x",tK)])));let u=a.match(e);return u&&u.onMatch(e,l),(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)&&l.dispatchCommand(tY,e),!0}function ny(e){let t=e.__lexicalEventHandles;return void 0===t&&(e.__lexicalEventHandles=t=[]),t}let nC=new Map;function nx(e){let t=l7(e.target);if(null===t)return;let n=lj(e.target),r=null,i=null,l=null!==n?t4.get(n):void 0;
1if(null!==n){if(void 0!==l){let e=l.editors,n=l.hasShadowEditor;if(void 0===n){for(let t of(n=!1,e))if(null!==t._rootElement&&l8(t._rootElement.getRootNode())){n=!0;break}l.hasShadowEditor=n}if(n){let n=null,l=null;for(let o of e){let e=o._rootElement;if(null===e)continue;let s=oo(t,e).anchorNode;if(null!==s&&ln(s)===o){if(l8(e.getRootNode())){r=o,i=s;break}null===n&&(n=o,l=s)}}null===r&&null!==n&&(r=n,i=l)}else{let e=t.anchorNode;null===e||of(e)&&null!==e.shadowRoot||null!==(r=ln(e))&&(i=e)}}if(null===r){let e=oa(n);r=null!==e?ln(e):null}}if(null===r)return;if(r._inputState.isSelectionChangeFromMouseDown){if(void 0!==l)for(let e of l.editors)e._inputState.isSelectionChangeFromMouseDown=!1;ia(r,()=>{let n=rA(),l=i??oo(t,r._rootElement).anchorNode;(of(l)||lo(l))&&lv(rO(n,t,r,e))})}let o=lO(r),s=o[o.length-1],a=s._key,u=nC.get(a),f=u||s;f!==r&&t8(t,f,!1),t8(t,r,!0),r!==s?nC.set(a,r):u&&nC.delete(a)}function nS(e){e._lexicalHandled=!0}function nT(e){return!0===e._lexicalHandled}let nN=()=>{};function nv(e,t,r){r1();let i=e.__key,l=e.getParent();if(null===l)return void(null!==oH(e)&&n(367,i,String(oH(e))));let o=function(e){let t=rM();if(!rr(t)||!ic(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),l=r.getNode();return lG(i,e)&&n.set(e.__key,0,"element"),lG(l,e)&&r.set(e.__key,0,"element"),t}(e),s=!1;if(rr(o)&&t){let t=o.anchor,n=o.focus;t.key===i&&(rP(t,e,l,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===i&&(rP(n,e,l,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else rl(o)&&t&&e.isSelected()&&e.selectPrevious();if(rr(o)&&t&&!s&&rw(o,l)){let t=e.getIndexWithinParent();ld(e),rD(o,l,t,-1)}else ld(e);r||lZ(l)||l.canBeEmpty()||!l.isEmpty()||nv(l,t),t&&o&&im(l)&&l.isEmpty()&&l.selectEnd()}let nk=Symbol.for("ephemeral");function nb(e){return e[nk]||!1}let nE={configurable:!0,enumerable:!1,value:void 0,writable:!0};class nO{__type;__key;__parent;__prev;__next;__state;[ed];static getType(){let{ownNodeType:e}=oF(this);return void 0===e&&n(64,this.name),e}static clone(e){n(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||oz(this.constructor);return Object.assign(t,{extends:n}),"string"==typeof e&&Object.assign(t,{type:e}),{[e]:t}}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",nE),Object.defineProperty(this,ed,nE),lf(this,e)}getType(){return this.__type}isInline(){n(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;let t=l_(e);if(null===t)break;e=null!==t.__parent?t.__parent:oH(t)}return!1}isSelected(e){let t=e||rM();if(null==t)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(n0(this))return n;if(rr(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;let e=this.getParent();if(i_(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(null===e)return -1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return -1}getParent(){let e=this.getLatest().__parent;return null===e?null:l_(e)}getParentOrThrow(){let e=this.getParent();return null===e&&n(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){let t=e.getParent();if(lZ(t)||null!==oH(e))return ic(e)||e===this&&i_(e)||n(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return null===e&&n(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return null===e?null:l_(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return null===e?null:l_(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=ic(this)?this:this.getParent(),n=ic(e)?e:e.getParent(),r=t&&n?sk(t,n):null;return r?r.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){let t=sk(this,e);return null!==t&&("descendant"===t.type||("branch"===t.type?-1===sN(t):("same"!==t.type&&"ancestor"!==t.type&&n(279),!1)))}isParentOf(e){return lG(e,this)}getNodesBetween(e){let t=this.isBefore(e),r=[],i=new Set,l=this;for(;null!==l;){let o=l.__key;
1if(i.has(o)||(i.add(o),r.push(l)),l===e)break;let s=ic(l)?t?l.getFirstChild():l.getLastChild():null;if(null!==s){l=s;continue}let a=t?l.getNextSibling():l.getPreviousSibling();if(null!==a){l=a;continue}let u=l.getParentOrThrow();if(i.has(u.__key)||r.push(u),u===e)break;let f=null,d=u;do{if(null===d&&n(68),f=t?d.getNextSibling():d.getPreviousSibling(),null===(d=d.getParent()))break;null!==f||i.has(d.__key)||r.push(d)}while(null===f)l=f}return t||r.reverse(),r}isDirty(){let e=r4()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){if(nb(this))return this;let e=l_(this.__key);return null===e&&n(113),e}getWritable(){if(nb(this))return this;r1();let e=r3(),t=r4(),n=e._nodeMap,r=this.__key,i=this.getLatest(),l=t._cloneNotNeeded,o=rM();if(null!==o&&o.setCachedNodes(null),l.has(r))return lc(i),i;let s=ok(i);return l.add(r),lc(s),n.set(r,s),s}getTextContent(){return o2(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){n(70)}updateDOM(e,t,r){n(71)}getDOMSlot(e){return new D(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){n(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of ee(n).flatKeys)e in t&&(void 0!==i&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&Z(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){nv(this,!0,e)}replace(e,t){r1();let r=rM();null!==r&&(r=r.clone()),l2(this,e);let i=this.getLatest(),l=this.__key,o=oj(i);null!==o&&n(400,l,i.getType(),o.getKey(),o.getType());let s=e.__key,a=e.getWritable(),u=this.getParentOrThrow().getWritable(),f=u.__size,d=a.getParent(),c=null!==d&&rr(r)&&rw(r,d),h=c?a.getIndexWithinParent():-1;ld(a),c&&null!==d&&rr(r)&&rD(r,d,h,-1);let g=i.getPreviousSibling(),_=i.getNextSibling(),p=i.__prev,m=i.__next,y=i.__parent;(nv(i,!1,!0),null===g)?u.__first=s:g.getWritable().__next=s,(a.__prev=p,null===_)?u.__last=s:_.getWritable().__prev=s,a.__next=m,a.__parent=y,u.__size=null!==d&&d.is(u)?f-1:f;let C=0;if(t&&(ic(this)&&ic(a)||n(139),C=a.getChildrenSize(),a.splice(C,0,this.getChildren())),rr(r)){lv(r);let e=r.anchor,n=r.focus;e.key===l&&(t&&"element"===e.type?e.set(a.__key,C+e.offset,"element"):n8(e,a)),n.key===l&&(t&&"element"===n.type?n.set(a.__key,C+n.offset,"element"):n8(n,a))}return lg()===l&&lh(s),a}insertAfter(e,t=!0){r1(),l2(this,e);let n=this.getWritable(),r=e.getWritable();o4(this.getParentOrThrow());let i=r.getParent(),l=rM(),o=!1,s=!1,a=-1;if(null!==i&&t&&rr(l)&&rw(l,i)){let t=i.__key,n=l.anchor,r=l.focus;a=e.getIndexWithinParent(),o="element"===n.type&&n.key===t&&n.offset===a+1,s="element"===r.type&&r.key===t&&r.offset===a+1}ld(r),-1!==a&&null!==i&&rr(l)&&rD(l,i,a,-1);let u=this.getNextSibling(),f=this.getParentOrThrow().getWritable(),d=r.__key,c=n.__next;if(null===u?f.__last=d:u.getWritable().__prev=d,f.__size++,n.__next=d,r.__next=c,r.__prev=n.__key,r.__parent=n.__parent,t&&rr(l)){let e=f.__key;if(o||s||rw(l,f)){let t=this.getIndexWithinParent();rD(l,f,t+1),o&&l.anchor.set(e,t+2,"element"),s&&l.focus.set(e,t+2,"element")}}return e}insertBefore(e,t=!0){r1(),l2(this,e);let n=this.getWritable(),r=e.getWritable();o4(this.getParentOrThrow());let i=r.__key,l=rM(),o=r.getParent(),s=null!==o&&t&&rr(l)&&rw(l,o),a=s?r.getIndexWithinParent():-1;ld(r),s&&null!==o&&rr(l)&&rD(l,o,a,-1);let u=this.getPreviousSibling(),f=this.getParentOrThrow().getWritable(),d=n.__prev,c=t&&rr(l)&&rw(l,f),h=c?this.getIndexWithinParent():-1;return null===u?f.__first=i:u.getWritable().__next=i,f.__size++,n.__prev=i,r.__prev=d,r.__next=n.__key,r.__parent=n.__parent,c&&rr(l)&&rD(l,f,h),e}isParentRequired(){return!1}createParentElementNode(){return iV()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){r1();let n=oj(this);if(null!==n)return n.selectPrevious(e,t);let r=this.getPreviousSibling(),i=this.getParentOrThrow();if(null===r)return i.select(0,0);if(ic(r))return r.select();if(!n0(r)){let e=r.getIndexWithinParent()+1;return i.select(e,e)}return r.select(e,t)}selectNext(e,t){r1();let n=oj(this);if(null!==n)return n.selectNext(e,t);let r=this.getNextSibling(),i=this.getParentOrThrow();if(null===r)return i.select();if(ic(r))return r.select(0,0);if(!n0(r)){let e=r.getIndexWithinParent();return i.select(e,e)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}function nM(e){return e instanceof nO}let nA="history-merge",nw="skip-scroll-into-view",nD="skip-dom-selection",nI="skip-selection-focus",nP="composition-start",nF="composition-end";function nR(e){let t={};if(!e)return t;let n="",r="",i=null,l=!1,o=!1,s=!1,a=0,u=e.length,f=-1;for(let d=0;d<u;d++){let u=e[d];if(l)"*"===u&&"/"===e[d+1]&&(l=!1,d++);else if(o)-1===f&&(f=d),o=!1;else if(null===i)if("/"!==u||"*"!==e[d+1])if('"'!==u&&"'"!==u)if("("!==u)if(")"!==u)if(s||":"
1!==u||0!==a){if(";"===u&&0===a){-1!==f&&(s?r+=e.slice(f,d):n+=e.slice(f,d),f=-1);let i=n.trim(),l=r.trim();""!==i&&""!==l&&(t[i]=l),n="",r="",s=!1;continue}-1===f&&(f=d)}else -1!==f&&(n+=e.slice(f,d),f=-1),s=!0;else -1===f&&(f=d),a=Math.max(0,a-1);else -1===f&&(f=d),a++;else -1===f&&(f=d),i=u;else -1!==f&&(s?r+=e.slice(f,d):n+=e.slice(f,d),f=-1),l=!0,d++;else -1===f&&(f=d),"\\"===u?o=!0:u===i&&(i=null)}-1!==f&&(s?r+=e.slice(f,u):n+=e.slice(f,u));let d=n.trim(),c=r.trim();return""!==d&&""!==c&&(t[d]=c),t}function nL(e,t,n=""){if(t===n)return;let r=nR(n),i=nR(t);for(let t in i)delete r[t],function(e,t,n){let r=n.trimEnd(),i=r.length-10;i>=0&&"!important"===r.slice(i).toLowerCase()?e.setProperty(t,r.slice(0,i).trim(),"important"):e.setProperty(t,n,"")}(e,t,i[t]);for(let t in r)e.removeProperty(t)}function nK(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function nB(e,t){return 1&t?"strong":2&t?"em":"span"}function nz(e,t,n,r,i){let l=r.classList,o=lK(i,"base");void 0!==o&&l.add(...o);let s=!1,a=8&t&&4&t;for(let e in void 0!==(o=lK(i,"underlineStrikethrough"))&&(8&n&&4&n?(s=!0,a||l.add(...o)):a&&l.remove(...o)),C){let r=C[e];if(void 0!==(o=lK(i,e)))if(n&r){if(s&&("underline"===e||"strikethrough"===e)){t&r&&l.remove(...o);continue}(0==(t&r)||a&&"underline"===e||"strikethrough"===e)&&l.add(...o)}else t&r&&l.remove(...o)}lL(r,"class")}function n$(e,t,n){let r=n.isComposing(),i=e+(r?_:""),l=oy(),o=oC(l).$getDOMSlot(n,t,l),a=o.getFirstChild();if(null===a||a.nodeType!==Node.TEXT_NODE)return void o.insertChild(or().createTextNode(i));let u=a.nodeValue;if(u!==i)if(r||s){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,l=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;l+i<n&&l+i<r&&e[n-l-1]===t[r-l-1];)l++;return[i,n-i-l,t.slice(i,r-l)]}(u,i);0!==t&&a.deleteData(e,t),a.insertData(e,n)}else a.nodeValue=i}function nW(e,t,n,r,i,l){n$(i,e,t);let o=l.theme.text;void 0!==o&&nz(0,0,r,e,o)}function nU(e,t){let n=or().createElement(t);return n.appendChild(e),n}function nH(e){return null!=e&&!0===e.__isInlineFormattable}class nj extends nO{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config("text",{importDOM:{"#text":()=>({conversion:nV,priority:0}),b:()=>({conversion:nG,priority:0}),code:()=>({conversion:nQ,priority:0}),em:()=>({conversion:nQ,priority:0}),i:()=>({conversion:nQ,priority:0}),mark:()=>({conversion:nQ,priority:0}),s:()=>({conversion:nQ,priority:0}),span:()=>({conversion:nY,priority:0}),strong:()=>({conversion:nQ,priority:0}),sub:()=>({conversion:nQ,priority:0}),sup:()=>({conversion:nQ,priority:0}),u:()=>({conversion:nQ,priority:0})}})}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return v[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===lg()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=C[e];return 0!=(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return lu(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=nK(0,n),i=nB(0,n),l=null===r?i:r,o=or().createElement(l),s=o;this.hasFormat("code")&&o.setAttribute("spellcheck","false"),null!==r&&(s=or().createElement(i),o.appendChild(s)),nW(s,this,0,n,this.__text,e);let a=this.__style;return""!==a&&nL(o.style,a),o}updateDOM(e,t,r){let i=this.__text,l=e.__format,o=this.__format,s=nK(0,l),a=nK(0,o),u=nB(0,l),f=nB(0,o);if((null===s?u:s)!==(null===a?f:a))return!0;if(s===a&&u!==f){let e=t.firstChild;null==e&&n(48);let l=or().createElement(f);return nW(l,this,0,o,i,r),t.replaceChild(l,e),!1}let d=t;null!==a&&null!==s&&null==(d=t.firstChild)&&n(49),n$(i,d,this);let c=r.theme.text;void 0!==c&&l!==o&&nz(0,l,o,d,c);let h=e.__style,g=this.__style;return h!==g&&(nL(t.style,g,h),lL(t,"style")),!1}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}
1exportDOM(e){let{element:t}=super.exportDOM(e);return of(t)||n(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=nU(t,"b")),this.hasFormat("italic")&&(t=nU(t,"i")),this.hasFormat("strikethrough")&&(t=nU(t,"s")),this.hasFormat("underline")&&(t=nU(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format="string"==typeof e?C[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail="string"==typeof e?x[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=lu(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=N[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){r1();let n=e,r=t,i=rM(),l=this.getTextContent(),o=this.__key;if("string"==typeof l){let e=l.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!rr(i))return rk(o,n,o,r,"text","text");{let e=lg();e!==i.anchor.key&&e!==i.focus.key||lh(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),l=i.__text,o=n.length,s=e;s<0&&(s=o+s)<0&&(s=0);let a=rM();if(r&&rr(a)){let t=e+o;a.setTextNodeRange(i,t,i,t)}return i.__text=l.slice(0,s)+n+l.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){let t;r1();let n=this.getLatest(),r=n.getTextContent();if(""===r)return[];let i=n.__key,l=lg(),o=r.length;e.sort((e,t)=>e-t),e.push(o);let s=[],a=e.length;for(let t=0,n=0;t<o&&n<=a;n++){let i=e[n];i>t&&(s.push(r.slice(t,i)),t=i)}let u=s.length;if(1===u)return[n];let f=s[0],d=n.getParent(),c=n.getFormat(),h=n.getStyle(),g=n.__detail,_=!1,p=null,m=null,y=rM();if(rr(y)){let[e,t]=y.isBackward()?[y.focus,y.anchor]:[y.anchor,y.focus];"text"===e.type&&e.key===i&&(p=e),"text"===t.type&&t.key===i&&(m=t)}n.isSegmented()?((t=nZ(f)).__format=c,t.__style=h,t.__detail=g,t.__state=el(n,t),_=!0):t=n.setTextContent(f);let C=[t];for(let e=1;e<u;e++){let t=nZ(s[e]);t.__format=c,t.__style=h,t.__detail=g,t.__state=el(n,t);let r=t.__key;l===i&&lh(r),C.push(t)}let x=p?p.offset:null,S=m?m.offset:null,T=0;for(let e of C){if(!p&&!m)break;let t=T+e.getTextContentSize();if(null!==p&&null!==x&&x<=t&&x>=T&&(p.set(e.getKey(),x-T,"text"),x<t&&(p=null)),null!==m&&null!==S&&S<=t&&S>=T){m.set(e.getKey(),S-T,"text");break}T=t}if(null!==d){let e,t;e=this.getPreviousSibling(),t=this.getNextSibling(),null!==e&&lc(e),null!==t&&lc(t);let n=d.getWritable(),r=this.getIndexWithinParent();_?(n.splice(r,0,C),this.remove()):n.splice(r,1,C),rr(y)&&rD(y,d,r,u-1)}return C}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||n(50);let r=this.__key,i=e.__key,l=this.__text,o=l.length;lg()===i&&lh(r);let s=rM();if(rr(s)){let n=s.anchor,l=s.focus;null!==n&&n.key===i&&rF(n,t,r,e,o),null!==l&&l.key===i&&rF(l,t,r,e,o)}let a=e.__text,u=t?a+l:l+a;this.setTextContent(u);let f=this.getWritable();return e.remove(),f}isTextEntity(){return!1}}function nY(e){return{forChild:n1(e.style),node:null}}function nG(e){let t="normal"===e.style.fontWeight;return{forChild:n1(e.style,t?void 0:"bold"),node:null}}let nJ=new WeakMap;function nV(e){null===e.parentElement&&n(129);let t=e.textContent||"";if(null!==function(e){let t,n=e.parentNode,r=[e];for(;null!==n&&void 0===(t=nJ.get(n))&&!function(e){if(!of(e))return!1;if("PRE"===e.nodeName)return!0;let t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}(n);)r.push(n),n=n.parentNode;let i=void 0===t?n:t;for(let e=0;e<r.length;e++)nJ.set(r[e],i);return i}(e))return{node:rz(t)};if(""===(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," ")))return{node:null};if(" "===t[0]){let n=e,r=!0;for(;null!==n&&null!==(n=nq(n,!1));){let e=n.textContent||"";if(e.length>
10){/[ \t\n]$/.test(e)&&(t=t.slice(1)),r=!1;break}}r&&(t=t.slice(1))}if(" "===t[t.length-1]){let n=e,r=!0;for(;null!==n&&null!==(n=nq(n,!0));)if((n.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(t=t.slice(0,t.length-1))}return""===t?{node:null}:{node:nZ(t)}}function nq(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){let e=n.parentElement;if(null===e)return null;n=e}if(of(n=e)){let e=n.style.display;if(""===e&&!og(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(lo(n))return n;if("BR"===n.nodeName)return null}}let nX={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function nQ(e){let t=nX[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:n1(e.style,t),node:null}}function nZ(e=""){return l1(new nj(e))}function n0(e){return e instanceof nj}function n1(e,t){let n=e.fontWeight,r=e.textDecoration.split(" "),i="700"===n||"bold"===n,l=r.includes("line-through"),o="italic"===e.fontStyle,s=r.includes("underline"),a=e.verticalAlign,u=e.textTransform;return e=>((n0(e)||nH(e))&&(i&&!e.hasFormat("bold")&&e.toggleFormat("bold"),l&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),o&&!e.hasFormat("italic")&&e.toggleFormat("italic"),s&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==a||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==a||e.hasFormat("superscript")||e.toggleFormat("superscript"),"lowercase"!==u&&"uppercase"!==u&&"capitalize"!==u||e.hasFormat(u)||e.toggleFormat(u),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}class n2 extends nj{$config(){return this.config("tab",{extends:nj})}constructor(e){super("	",e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=lK(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent("	")}spliceText(e,t,r,i){return""===r&&0===t||"	"===r&&1===t||n(286),this}setDetail(e){return 2!==e&&n(127),this}setMode(e){return"normal"!==e&&n(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function n3(){return l1(new n2)}function n4(e){return e instanceof n2}class n6{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}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:0>sT(iK(iM(this,"next")),iK(iM(e,"next")))}getNode(){let e=l_(this.key);return null===e&&n(20),e}set(e,t,n,r){let i=this._selection,l=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,r0()||(lg()===l&&lh(e),null!==i&&(i.setCachedNodes(null),rr(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}}function n5(e,t,n){return new n6(e,t,n)}function n7(e,t){let n=t.__key,r=e.offset,i="element";if(n0(t)){i="text";let e=t.getTextContentSize();r>e&&(r=e)}else if(!ic(t)){let e=t.getNextSibling();if(n0(e))n=e.__key,r=0,i="text";else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function n8(e,t){if(ic(t)){let n=t.getLastDescendant();ic(n)||n0(n)?n7(e,n):n7(e,t)}else n7(e,t)}function n9(e,t,n,r){let i=e.getNode(),l=i.getChildAtIndex(e.offset),o=nZ();if(o.setFormat(n),o.setStyle(r),iq(l))l.splice(0,0,[o]);else if(null!==l){let e=lZ(i)?iV().append(o):o;l.insertBefore(e)}else if(lZ(i)){let e=i.getLastChild();ic(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(iV().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,"text"),e.set(o.__key,0,"text")}function re(e,t,r,i){let l=e.anchor.getNode();n0(l)||n(398);let o=e.anchor.offset,s=nZ(t);s.setFormat(r),s.setStyle(i);let a=l.getParentOrThrow();if(0===o)a.isInline()&&!l.__prev?a.insertBefore(s):l.insertBefore(s,!1);else if(o===l.getTextContentSize())a.isInline()&&!l.__next?a.insertAfter(s):l.insertAfter(s,!1);else{let[e]=l.splitText(o);e.insertAfter(s,!1)}""===l.getTextContent()&&l.isAttached()&&l.remove(),s.selectEnd(),s.isComposing()&&"text"===e.anchor.type&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}class rt{_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(!rl(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}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 rt(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t,n=this.getNodes().filter(e=>null===oH(e)),r=n.length;if(0===r)return;let i=n[r-1];if(n0(i))t=i.select();else{let e=i.getIndexWithinParent()+1;t=i.getParentOrThrow().select(e,e)}
1t.insertNodes(e);for(let e=0;e<r;e++)n[e].remove()}getNodes(){let e=this._cachedNodes;if(null!==e)return e;let t=this._nodes,n=[];for(let e of t){let t=l_(e);null!==t&&n.push(t)}return r0()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter(e=>null===oH(e));if((rM()||rA())===this&&e[0]){let t=su(e[0],"next");iw(sx(t,t))}for(let t of e)t.remove();rn()}}function rn(){let e=lT();if(e.isEmpty()){let t=iV();e.append(t),t.select()}}function rr(e){return e instanceof ri}class ri{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!rr(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(null!==e)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,l=new Set;for(let n of e)if(sl(n)){let{origin:e}=n;0===t.length?i.add(e):(l.add(e),t.push(e))}else{let{origin:e}=n;ic(e)&&l.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),si(e.focus)&&ic(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let n=sc(e.focus.origin,"previous");sl(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=sg(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!ic(e)||l.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(0===t.length&&e.isCollapsed()){let n=iK(e.anchor),r=iK(e.anchor.getFlipped()),i=e=>sr(e)?e.origin:e.getNodeAtCaret(),l=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(l)}return t}(iz(iI(this),"next"));return r0()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,r,"text"),this}getTextContent(){let e=this.getNodes();if(0===e.length)return"";let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,l=r.isBefore(i),[o,s]=ru(this),a="",u=!0;for(let f=0;f<e.length;f++){let d=e[f];if(ic(d)&&!d.isInline()){u||(a+="\n");let e="";for(let t of oV(d)){let n=oq(d,t);null!==n&&(e+=n.getTextContent())}""!==e?(a+=e,u=!1):u=!d.isEmpty()}else if(u=!1,n0(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===i.type&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=l?e.slice(o):e.slice(s):d===n&&(e=l?e.slice(0,s):e.slice(0,o)),a+=e}else!i_(d)&&!ik(d)||d===n&&this.isCollapsed()||(a+=d.getTextContent())}return a}applyDOMRange(e){let t=r4(),n=t.getEditorState()._selection,r=rN(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;let[i,l,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(l.key,l.offset,l.type,!0),o&&(this.dirty=!0),eu(this)}clone(){let e=this.anchor,t=this.focus;return new ri(n5(e.key,e.offset,e.type),n5(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=lu(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 t=C[e];return 0!=(this.format&t)}insertRawText(e){this.insertNodes(rz(e))}insertText(e){let t=this.format,r=this.style;if(!this.isCollapsed()){let n=(this.focus.isBefore(this.anchor)?this.focus:this.anchor).getNode();if(n0(n)&&(t=n.getFormat(),r=n.getStyle()),this.removeText(),this.format=t,this.style=r,""===e)return;if(null===lg())return"element"===this.anchor.type&&n9(this.anchor,this.focus,t,r),void re(this,e,t,r)}"element"===this.anchor.type&&n9(this.anchor,this.focus,t,r);let i=this.anchor.getNode();n0(i)||n(398);let l=this.anchor.offset,o=i.getParentOrThrow(),s=i.getTextContentSize();if(ll(i)||0===l&&(!i.canInsertTextBefore()||!o.canInsertTextBefore()&&!i.__prev)||l===s&&(!i.canInsertTextAfter()||!o.canInsertTextAfter()&&!i.__next)){if(i.isSegmented()&&0!==l&&l!==s){if(null!==lg())i.setMode("normal").setFormat(t).setStyle(r);else{let e=nZ(i.getTextContent());e.setFormat(t),e.setStyle(r);let n=rM()===this;i.replace(e),this.setTextNodeRange(e,l,e,l),n&&rM()!==this&&lv(this)}return void(""!==e&&this.insertText(e))}if(""===e)return;if(0===l){let n=i.getPreviousSibling();if(n0(n)&&n.canInsertTextAfter()&&!ll(n))n.select();else{let e=nZ();e.setFormat(t),e.setStyle(r),o.canInsertTextBefore()?i.insertBefore(e):o.insertBefore(e),e.select()}return void this.insertText(e)}if(l===s){let n=i.getNextSibling();if(n0(n)&&n.canInsertTextBefore()&&!ll(n))n.select(0,0);else{let e=nZ();e.setFormat(t),e.setStyle(r),o.canInsertTextAfter()?i.insertAfter(e):o.insertAfter(e),e.select(0,0)}return void this.insertText(e)}let n=nZ(e);return n.setFormat(t),n.setStyle(r),i.replace(n),void n.select()}if(""===e)return;let a=o.isInline()&&0===l&&!i.__prev,u=o.isInline()&&l===s&&!i.__next,f=i.getFormat()!==t||i.getStyle()!==r;if(a||u||f){if(""!==i.getTextContent()||a||u)return void re(this,e,t,r);i.setFormat(t),i.setStyle(r)}i.spliceText(l,0,e,!0),i.isComposing()&&"text"===this.anchor.type&&this.anchor.set(this.anchor.key,this.anchor.offset-e.length,this.anchor.type)}removeText(){let e=rM()===this,t=this.anchor.key;iD(this,iL(iI(this))),this.isCollapsed()&&function(e,t){let n=e.anchor;if(n.key===t)return;let r=n.getNode(),i=0,l="";n0(r)?(i=r.getFormat(),l=r.getStyle()):ic(r)&&(i=r.getTextFormat(),l=r.getTextStyle()),e.format===i&&e.style===l||(e.format=i,e.style=l,e.dirty=!0)}(this,t),e&&rM()!==this&&lv(this)}formatText(e,t=null){rs(this,e,t)}insertNodes(e){var t;let r;if(0===e.length)return;this.isCollapsed()||this.removeText();let i=this.anchor.getNode();if("element"===this.anchor.type&&ic(i)&&i.isShadowRoot()&&null!==oH(i)){let t=i.getFirstChild()??i.append(iV()).getFirstChild();if(null!==t&&!ic(t)){let e=iV();t.insertBefore(e),t=e}if(null!==t){t.selectStart();let r=rM();
1return rr(r)||n(369),r.insertNodes(e)}}if("element"===this.anchor.type&&lZ(i)){let t=rH(e),n=t.getLastDescendant();return i.splice(this.anchor.offset,0,t.getChildren()),void(null!==n&&n.selectEnd())}let l=this.isBackward()?this.focus:this.anchor,o=l.getNode(),s=oK(o,om),a=e[e.length-1];if(ic(s)&&"__language"in s){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let[,t]=rW(this);s.splice(t,0,e),a.selectEnd()}return}if(!e.some(e=>(ic(e)||i_(e))&&!e.isInline())){ic(s)||n(211,o.constructor.name,o.getType());let[t,r]=rW(this,!0);return(ic(t)?t:s).splice(r,0,e),void a.selectEnd()}if(ic(s)&&null!==oH(s)){let[,t]=rW(this),n=r$(e);s.splice(t,0,n);let r=n[n.length-1];return void(void 0!==r?r.selectEnd():s.select(t,t))}if(null===s){let t=rH(e),n=t.getLastDescendant(),r=iM(this.anchor,"next");for(let e of t.getChildren())r=ij(e,r);return void(null!==n&&n.selectEnd())}if(ic(s)&&!s.isParentRequired()&&!lZ(s.getParentOrThrow())){let[,t]=rW(this),n=r$(e);s.splice(t,0,n);let r=n[n.length-1];return void(void 0!==r?r.selectEnd():s.select(t,t))}let u=rH(e),f=u.getLastDescendant(),d=u.getChildren(),c=ik(r=function(e){let t=e.getNode();if(e.offset>0)return"element"===e.type&&ic(t)?t.getChildAtIndex(e.offset-1):null;for(let e=t;null!==e&&!om(e)&&!lZ(e);e=e.getParent()){let t=e.getPreviousSibling();if(null!==t)return t}return null}(l))&&ik(r.getPreviousSibling()),h=ic(s)&&s.isEmpty()?null:this.insertParagraph();h&&!s.isAttached()&&(s=oK(o=this.anchor.getNode(),om));let g=d[d.length-1],_=d[0];t=_,c||!ic(t)||!om(t)||t.isEmpty()||!ic(s)||s.isEmpty()&&!s.canMergeWhenEmpty()||(ic(s)||n(211,o.constructor.name,o.getType()),s.append(..._.getChildren()),_=d[1]),_&&(null===s&&n(212,o.constructor.name,o.getType()),function(e,t){let r=t.getParentOrThrow().getLastChild(),i=t,l=[t];for(;i!==r;)i.getNextSibling()||n(140),l.push(i=i.getNextSibling());let o=e;for(let e of l)o=o.insertAfter(e)}(s,_));let p=oK(f,om),m=f.selectEnd();h&&(ic(p)&&(h.canMergeWhenEmpty()||om(g))?(p.append(...h.getChildren()),h.remove()):h.isEmpty()&&h.remove()),ic(s)&&s.isEmpty()&&s.remove();let y=ic(s)?s.getLastChild():null;ik(y)&&p!==s&&y.remove();let C=iK(iM(m.anchor,"next"));iA(m.anchor,C),iA(m.focus,C)}insertParagraph(){this.isCollapsed()||this.removeText();let e=this.anchor.getNode();if("element"===this.anchor.type&&lZ(e)){let t=iV();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let[,t]=rW(this),r=oK(this.anchor.getNode(),om);if(null!==r&&null!==oH(r))return null;ic(r)||n(213);let i=r.getChildAtIndex(t),l=i?[i,...i.getNextSiblings()]:[],o=r.insertNewAfter(this,!1);return o?(o.append(...l),o.selectStart(),o):null}insertLineBreak(e){let t=iv();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,l]=ru(this),o=this.isBackward(),[s,a]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[u,f]=o?[l,i]:[i,l];if(0===t)return[];if(1===t){if(n0(n)&&!this.isCollapsed()){let e=n.splitText(u,f),t=0===u?e[0]:e[1];return t?(s.set(t.getKey(),0,"text"),a.set(t.getKey(),t.getTextContentSize(),"text"),[t]):[]}return[n]}if(n0(n)&&(u===n.getTextContentSize()?e.shift():0!==u&&([,n]=n.splitText(u),e[0]=n,s.set(n.getKey(),0,"text"))),n0(r)){let t=r.getTextContent().length;0===f?e.pop():f!==t&&([r]=r.splitText(f),e[e.length-1]=r,a.set(r.getKey(),r.getTextContentSize(),"text"))}return e}modify(e,t,n){if(rj(this,e,t,n))return;let r="move"===e,i=r4(),l=l5(lV(i));if(!l)return;let o=i._blockCursorElement,s=i._rootElement,a=this.focus.getNode();null===s||null===o||!ic(a)||a.isInline()||a.canBeEmpty()||l6(o,i,s);let u=lU(i,this.focus.key),f=u;if("text"===this.focus.type&&(f=n0(a)?oS(a,u,i):null),this.dirty){let e=lU(i,this.anchor.key),t=e;if("text"===this.anchor.type){let n=this.anchor.getNode();t=n0(n)?oS(n,e,i):null}t&&f&&rR(l,t,this.anchor.offset,f,this.focus.offset)}if("character"===n&&n0(a)&&a.isUnmergeable()&&(t?0===this.focus.offset:this.focus.offset===a.getTextContentSize())){let e=su(a,t?"previous":"next").getNodeAtCaret();if(n0(e)){if(!r){let n=e.getTextContentSize();return t?this.focus.set(e.__key,n-1,"text"):this.focus.set(e.__key,1,"text"),void(this.dirty=!0)}{let n=i.getElementByKey(e.getKey()),r=n?oS(e,n,i):null;if(r){let e=t?r.length:0;rR(l,r,e,r,e)}}}}if(rh(l,e,t?"backward":"forward",n,s),l.rangeCount>0){let e=oi(l,i._rootElement),n=e||l.getRangeAt(0),o=this.anchor.getNode(),s=im(o)?o:lX(o);this.applyDOMRange(n),this.dirty=!0,r||(rg(this,t,s),(e?"backward"!==l.direction:l.anchorNode===n.startContainer&&l.anchorOffset===n.startOffset)||rc(this))}"lineboundary"===n&&rj(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&ic(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(ic(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();
1if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e)){let e=ic(n)?n.getNextSibling():null;if(!(ic(n)&&n.isEmpty()&&ic(e)&&e.isShadowRoot()))return}let r=iM(t,e?"previous":"next"),i=sy(r);if(i.getTextSlices().every(e=>null===e||0===e.distance)){if("element"===t.type){let e=r.getNodeAtCaret();if(ic(e)&&l4(e)){let t=e.getParent();e.remove();let n=lN(t,e);return void(null!==n&&n.selectStart())}}let e={type:"initial"};for(let t of i.iterNodeCarets("shadowRoot"))if(sl(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(ic(i.anchor.origin)&&i.anchor.origin.isEmpty()){let e=iK(t);iD(this,sx(e,e)),i.anchor.origin.remove()}return}"merge-next-block"!==e.type&&"merge-block"!==e.type||(e={block:e.block,caret:t,type:"merge-block"})}else{if("merge-block"===e.type)break;if(si(t)){if(ic(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(i.anchor.origin))break}else e={block:t.origin,type:"merge-next-block"};continue}if(i_(t.origin)){if(t.origin.isIsolated());else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&ic(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let e=rE();e.add(t.origin.getKey()),lv(e)}else{let e=t.origin,n=e.getParent();e.remove();let r=lN(n,e);null!==r&&r.selectStart()}return}if(ik(t.origin))return void t.origin.remove();break}}if("merge-block"===e.type){let{caret:t,block:n}=e;if(oV(n).length>0)return;return t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(iD(this,sx(!t.origin.isEmpty()&&n.isEmpty()?iP(su(n,t.direction)):i.anchor,t)),this.removeText())}for(let e=t.getNode();null!==e;){if(null!==oH(e))return;if(ic(e)&&e.isShadowRoot())break;e=e.getParent()}}let l=this.focus;if(r_(this,e,"character"),this.isCollapsed()){if(e&&0===t.offset&&rf(this,t.getNode()))return}else{let r="text"===l.type?l.getNode():null;if(n="text"===t.type?t.getNode():null,null!==r&&r.isSegmented()){let t=l.offset,i=r.getTextContentSize();if(r.is(n)||e&&t!==i||!e&&0!==t)return void rm(r,e,t)}else if(null!==n&&n.isSegmented()){let i=t.offset,l=n.getTextContentSize();if(n.is(r)||e&&0!==i||!e&&i!==l)return void rm(n,e,i)}!function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){var l;let e=n.offset,o=r.offset,s=e<o,a=s?e:o,u=s?o:e,f=u-1;a===f||lE(l=i.getTextContent().slice(a,u))||rp(l)||(t?r.set(r.key,f,r.type):n.set(n.key,f,n.type))}}(this,e)}}if(t||rd(this),this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){let e=this.anchor.getNode();e.isEmpty()&&im(e.getParent())&&null===e.getPreviousSibling()&&rf(this,e),rn()}}deleteLine(e){let t=this.isCollapsed(),n=rx(this.anchor);null!==n&&i_(oj(n))?(this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):(this.isCollapsed()&&r_(this,e,"lineboundary"),this.isCollapsed())?this.deleteCharacter(e):oK(this.anchor.getNode(),om)!==oK(this.focus.getNode(),om)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e)):(t||rd(this),this.removeText())}deleteWord(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;r_(this,e,"word")}this.isCollapsed()?this.deleteCharacter(e):(t||rd(this),this.removeText())}isBackward(){let e=this._cachedIsBackward;if(null!==e)return e;let t=this.focus.isBefore(this.anchor);return r0()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}}function rl(e){return e instanceof rt}function ro(e,t){if(rl(e)){for(let n of e.getNodes())nH(n)&&n.setFormat(t(n.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void lh(null);let n=[];for(let r of e.getNodes())n0(r)?n.push(r):ic(r)?r.setTextFormat(t(r.getTextFormat())):nH(r)&&r.setFormat(t(r.getFormat()));let r=n.length;if(0===r)return e.setFormat(t(e.format)),void lh(null);let i=e.anchor,l=e.focus,o=e.isBackward(),s=o?l:i,a=o?i:l,u=0,f=n[0],d="element"===s.type?0:s.offset;if("text"===s.type&&d===f.getTextContentSize()&&(u=1,f=n[1],d=0),null==f)return;let c=r-1,h=n[c],g="text"===a.type?a.offset:h.getTextContentSize();if(f.is(h)){if(d===g)return;let n=t(f.getFormat());if(ll(f)||0===d&&g===f.getTextContentSize())f.setFormat(n);else{let e=f.splitText(d,g),t=0===d?e[0]:e[1];t.setFormat(n),"text"===s.type&&s.set(t.__key,0,"text"),"text"===a.type&&a.set(t.__key,g-d,"text")}return void(e.format=n)}0===d||ll(f)||([,f]=f.splitText(d),d=0);let _=t(f.getFormat());f.setFormat(_);let p=t(h.getFormat());g>
10&&(g===h.getTextContentSize()||ll(h)||([h]=h.splitText(g)),h.setFormat(p));for(let e=u+1;e<c;e++){let r=n[e];r.setFormat(t(r.getFormat()))}"text"===s.type&&s.set(f.__key,d,"text"),"text"===a.type&&a.set(h.__key,g,"text"),e.format=_|p}function rs(e,t,n=null){let r=null===n&&rr(e)?lu(e.format,t,null):n;ro(e,e=>lu(e,t,r))}function ra(e){let t=e.offset;if("text"===e.type)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function ru(e){let t=e.getStartEndPoints();if(null===t)return[0,0];let[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[ra(n),ra(r)]}function rf(e,t){for(let n=t;n;n=n.getParent()){if(ic(n)){if(n.collapseAtStart(e))return!0;if(lZ(n))break}if(n.getPreviousSibling())break}return!1}function rd(e){let t=lT();!t.isEmpty()&&iY(t,e)&&(e.anchor.set(t.getKey(),0,"element"),e.focus.set(t.getKey(),t.getChildrenSize(),"element"))}function rc(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,l=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,l,!0)}function rh(e,t,n,r,i){let l="character"===r?oo(e,i):null,o=l&&l.focusNode,s=l?l.focusOffset:0;if(e.modify(t,n,r),null===l||null===o||3!==o.nodeType||("backward"===n?!(s>0):"forward"!==n||!(s<o.length)))return;let a=oo(e,i);a.focusNode===o&&a.focusOffset===s&&e.modify(t,n,r)}function rg(e,t,n){let r=e.getNodes(),i=r.filter(e=>lG(e,n));if(0===i.length||i.length===r.length)return!1;let l=t?i[0]:i[i.length-1],o=ic(l)?l:l.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function r_(e,t,n){if(rj(e,"extend",t,n))return;let r=r4(),i=l5(lV(r));if(!i||"function"!=typeof i.modify)return;let l=r._blockCursorElement,o=r._rootElement,s=e.anchor,a=e.focus.getNode();null===o||null===l||!ic(a)||a.isInline()||a.canBeEmpty()||l6(l,r,o);let u=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return null!==n&&"text"===e.type&&n0(t)?oS(t,n,r):n},f=s.getNode(),d=u(s);if(null===d)return;let c=s.offset,h=e.isCollapsed(),g=e.focus,_=h?d:u(g);if(null===_)return;let p=g.offset;if(rR(i,_,p,_,p),rh(i,"move",t?"backward":"forward",n,o),0===i.rangeCount)return;let m=oi(i,o)||i.getRangeAt(0),y=m.startContainer,C=m.startOffset;if(h&&"character"===n&&"text"===s.type&&n0(f)&&f.isUnmergeable()&&c===(t?0:f.getTextContentSize())){let n=su(f,t?"previous":"next").getNodeAtCaret();if(n0(n)){let r=t?n.getTextContentSize()-1:1;return e.focus.set(n.__key,r,"text"),void(e.dirty=!0)}}if(h&&"character"===n&&"text"===s.type){let n=t?0:f.getTextContentSize(),r=y===d?C:c!==n?n:-1;if(r>=0)return void(r!==c&&(e.focus.set(s.key,r,"text"),e.dirty=!0))}let[x,S,T,N]=t?[y,C,d,c]:[d,c,y,C],v=im(f)?f:lX(f);e.applyDOMRange({collapsed:!1,endContainer:T,endOffset:N,startContainer:x,startOffset:S}),e.dirty=!0,!rg(e,t,v)&&t&&rc(e),"lineboundary"===n&&rj(e,"extend",t,n,"decorators")}let rp=(()=>{try{let e=RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch(e){}return()=>!1})();function rm(e,t,n){let r=e.getTextContent().split(/(?=\s)/g),i=r.length,l=0,o=0;for(let e=0;e<i;e++){let s=e===i-1;if(o=l,l+=r[e].length,t&&l===n||l>n||s){r.splice(e,1),s&&(o=void 0);break}}let s=r.join("").trim();""===s?e.remove():(e.setTextContent(s),e.select(o,o))}function ry(e,t,r,i){let l,o=t,s=!1;if(of(e)){let a=!1,u=e.childNodes,f=u.length,d=i._blockCursorElement;o===f&&f>0&&(a=!0,o=f-1),void 0!==ly(e,i)||ow(e,i)||(s=!0);let c=u[o],h=!1;if(c===d)c=u[o+1],h=!0;else if(null!==d){let n=d.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,d)&&o--}if(n0(l=lb(c)))o=sd(l,a?"next":"previous");else{let u=lb(e);if(null===u)return null;if(ic(u)){let s,f=i.getElementByKey(u.getKey());null===f&&n(214);let d=ox(u,f,i);[u,o]=d.resolveChildIndex(u,f,e,t),ic(u)||n(215),a&&o>=u.getChildrenSize()&&(o=Math.max(0,u.getChildrenSize()-1));let c=u.getChildAtIndex(o);if(ic(c)&&(s=c.getParent(),null===r||null===s||!s.canBeEmpty()||s!==r.getNode())){let e=a?c.getLastDescendant():c.getFirstDescendant();u=null===e||ic(c=e)?c:c.getParentOrThrow(),o=0}n0(c)?(l=c,u=null,o=sd(c,a?"next":"previous")):c!==u&&a&&!h&&(ic(u)||n(216),o=Math.min(u.getChildrenSize(),o+1))}else{let n=oj(u),r=null!==n?n:u,l=r.getIndexWithinParent(),s=i.getElementByKey(u.getKey()),a="after";if(null!==s&&lb(e)===u){let n=ox(u,s,i);n.element!==s?a=n.resolveLeafPosition(s,e,t):0===t&&i_(u)&&(a="before")}o="before"===a?l:l+1,u=r.getParentOrThrow()}if(ic(u))return[n5(u.__key,o,"element"),s]}}else l=lb(e);return n0(l)?[n5(l.__key,sd(l,o,"clamp"),"text"),s]:null}
1function rC(e,t,n){let r=e.offset,i=e.getNode();if(0===r){let r=i.getPreviousSibling(),l=i.getParent();if(t){if((n||!t)&&null===r&&ic(l)&&l.isInline()){let t=l.getPreviousSibling();n0(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else ic(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):n0(r)&&!i.isUnmergeable()&&e.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){let r=i.getNextSibling(),l=i.getParent();if(t&&ic(r)&&r.isInline())e.set(r.__key,0,"element");else if((n||t)&&null===r&&ic(l)&&l.isInline()&&!l.canInsertTextAfter()&&l.getTextContentSize()>1){let t=l.getNextSibling();n0(t)&&e.set(t.__key,0,"text")}}}function rx(e){let t=l_(e.key);return null===t?null:oG(t)}function rS(e,t,n){let r=rx(e),i=rx(t);if(r===i||null!==r&&null!==i&&r.is(i))return!1;let l=n(r,i);if(null!==r)return ic(r)?t.set(r.getKey(),l?r.getChildrenSize():0,"element"):t.set(r.getKey(),l?r.getTextContentSize():0,"text"),!0;let o=oj(i);if(null===o)return!1;let s=o.getParent();if(null===s)return!1;let a=o.getIndexWithinParent();return t.set(s.getKey(),l?a+1:a,"element"),!0}function rT(e){let t=rS(e.anchor,e.focus,(t,n)=>(function(e,t,n,r){if(null!==n&&null!==r){let e=oj(n),t=oj(r);if(null!==e&&e.is(t)){for(let t of oJ(e).values()){if(t===n.getKey())break;if(t===r.getKey())return!1}return!0}return null===e||null===t||e.isBefore(t)}if(null!==n){let e=oj(n),r=l_(t.key);return null===e||null===r||!(!e.is(r)&&!e.isParentOf(r))||e.isBefore(r)}let i=oj(r),l=l_(e.key);return null!==i&&null!==l&&!i.is(l)&&!i.isParentOf(l)&&l.isBefore(i)})(e.anchor,e.focus,t,n));return t&&(e.dirty=!0),t}function rN(e,t,n,r,i,l){if(null===e||null===n||!le(i,e,n))return null;let o=ry(e,t,rr(l)?l.anchor:null,i);if(null===o)return null;let s=ry(n,r,rr(l)?l.focus:null,i);if(null===s)return null;let[a,u]=o,[f,d]=s;if("element"===a.type&&"element"===f.type){let t=lb(e),r=lb(n);if(i_(t)&&i_(r))return null}let c=i._slotsUsed&&rS(a,f,()=>0!=(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING));return function(e,t){if("text"===e.type&&"text"===t.type){let n=e.isBefore(t),r=e.is(t);rC(e,n,r),rC(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}(a,f),[a,f,u||d||c]}function rv(e){return ic(e)&&!e.isInline()}function rk(e,t,n,r,i,l){let o=r3(),s=new ri(n5(e,t,i),n5(n,r,l),0,"");return s.dirty=!0,o._selection=s,s}function rb(){return new ri(n5("root",0,"element"),n5("root",0,"element"),0,"")}function rE(){return new rt(new Set)}function rO(e,t,n,r){let i,l,o,s,a=n._window;if(null===a)return null;let u=r||a.event,f=u?u.type:void 0,d="selectionchange"===f,c=!$&&(d||"beforeinput"===f||"compositionstart"===f||"compositionend"===f||"click"===f&&u&&3===u.detail||"drop"===f||void 0===f);if(rr(e)&&!c)return e.clone();{if(null===t)return null;let r=oo(t,n._rootElement);if(i=r.anchorNode,l=r.focusNode,o=r.anchorOffset,s=r.focusOffset,(d||void 0===f)&&rr(e)&&!le(n,i,l))return e.clone()}let h=rN(i,o,l,s,n,e);if(null===h)return null;let[g,_,p]=h,m=0,y="";if(rr(e)){let t=e.anchor;if(g.key===t.key)m=e.format,y=e.style;else{let e=g.getNode();n0(e)?(m=e.getFormat(),y=e.getStyle()):ic(e)&&(m=e.getTextFormat(),y=e.getTextStyle())}}let C=new ri(g,_,m,y);return p&&(C.dirty=!0),C}function rM(){return r3()._selection}function rA(){return r4()._editorState._selection}function rw(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function rD(e,t,n,r=1){if(!rw(e,t))return;let i=e.anchor,l=e.focus,o=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(o,n,"element"),l.set(o,n,"element"),rI(e)}}else{let s=e.isBackward(),a=s?l:i,u=a.getNode(),f=s?i:l,d=f.getNode();if(t.is(u)){let e=a.offset;(n<=e&&r>0||n<e&&r<0)&&a.set(o,Math.max(0,e+r),"element")}if(t.is(d)){let e=f.offset;(n<=e&&r>0||n<e&&r<0)&&f.set(o,Math.max(0,e+r),"element")}}rI(e)}function rI(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,l=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!ic(l))return;let e=l.getChildrenSize(),i=n>=e,o=i?l.getChildAtIndex(e-1):l.getChildAtIndex(n);if(n0(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,"text"),r.set(o.__key,e,"text")}return}if(ic(l)){let e=l.getChildrenSize(),r=n>=e,i=r?l.getChildAtIndex(e-1):l.getChildAtIndex(n);if(n0(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if(ic(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(n0(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}function rP(e,t,n,r,i){let l=null,o=0,s=null;null!==r?(l=r.__key,n0(r)?(o=r.getTextContentSize(),s="text"):ic(r)&&(o=r.getChildrenSize(),s="element")):null!==i&&(l=i.__key,n0(i)?s="text":ic(i)&&(s="element")),null!==l&&null!==s?e.set(l,o,s):(-1===(o=t.getIndexWithinParent())&&(o=n.getChildrenSize()),e.set(n.__key,o,"element"))}function rF(e,t,n,r,i){"text"===e.type?e.set(n,e.offset+(t?0:i),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function rR(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch(e){}}function rL(e,t,n){let r=lU(e,t.getKey());if(ic(t)){let i=ox(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function rK(e,t,n,r,i,l){let o,a=l.getRootNode(),u=ls(a)||l8(a)?oa(a):null;if(i.has("collaboration")&&u!==l||null!==u&&i9(u,u))return;let f=oo(r,l);if(!rr(t))return void(null!==e&&le(n,f.anchorNode,f.focusNode)&&r.removeAllRanges());let d=t.anchor,c=t.focus,h=d.getNode(),g=c.getNode(),[_,p]=rL(n,h,d.offset),[m,y]=rL(n,g,c.offset),C=t.format,x=t.style,S=t.isCollapsed(),T=_,N=m,v=!1;if("text"===d.type?(T=n0(h)?oS(h,_,n):null,v=h.getFormat()!==C||h.getStyle()!==x):rr(e)&&"text"===e.anchor.type&&(v=!0),"text"===c.type&&(N=n0(g)?oS(g,m,n):null),null!==T&&null!==N){var k,b,E,O;let a;if(S&&(null===e||v||rr(e)&&(e.format!==C||e.style!==x))&&(k=d.key,b=performance.now(),n._inputState.collapsedSelectionFormat={format:C,key:k,offset:p,style:x,timeStamp:b}),("Range"!==r.type||!S)&&f.anchorOffset===p&&f.focusOffset===y&&f.anchorNode===T&&f.focu
1sNode===N){if(null===u||!l.contains(u)){let e=null!==u?ln(u):null;null!==e&&e!==n||i.has(nI)||l.focus({preventScroll:!0})}if("element"!==d.type)return}if(rR(r,T,p,N,y),s&&t.isCollapsed()&&null!==l&&!i.has(nI)){let e=os(l);if(null===e||!l.contains(e)){let e=oa(l.ownerDocument),t=null!==e?ln(e):null;null!==t&&t!==n||l.focus({preventScroll:!0})}}if(!i.has(nw)&&t.isCollapsed()&&null!==l&&l===os(l)){let e=rr(t)&&"element"===t.anchor.type?T.childNodes[p]||null:(void 0===o&&(o=ol(r,l)),o);if(null!==e){let t;if(lo(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){let r=lj(n),i=lJ(r);if(null===r||null===i)return;let l=n.getBoundingClientRect();if(t.bottom<l.top)return;let{top:o,bottom:s}=t,a=0,u=0,f=n;for(;null!==f;){let t=f===r.body;if(t){let t=i.visualViewport;if(t){let e=t.offsetTop;a=e,u=e+t.height}else a=0,u=lV(e).innerHeight;let n=i.getComputedStyle(r.documentElement),l=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(l)&&(a+=l),isFinite(o)&&(u-=o)}else{let e=f===n?l:f.getBoundingClientRect();a=e.top,u=e.bottom}let d=0;if(o<a?d=-(a-o):s>u&&(d=s-u),0!==d)if(t)i.scrollBy(0,d);else{let e=f.scrollTop;f.scrollTop+=d;let t=f.scrollTop-e;o-=t,s-=t}if(t)break;f=lH(f)}}(n,t,l)}}E=T,O=N,(a=n._inputState).isSelectionChangeFromDOMUpdate=!0,a.selectionChangeFromDOMUpdatePoints=void 0!==E&&void 0!==p&&void 0!==O&&void 0!==y?{anchorNode:E,anchorOffset:p,focusNode:O,focusOffset:y}:null}}function rB(e,t){for(let n of e.split(/(\r?\n|\t)/))"\n"===n||"\r\n"===n?t.linebreak():"	"===n?t.tab():""!==n&&t.text(n)}function rz(e){let t=[];return rB(e,{linebreak:()=>t.push(iv()),tab:()=>t.push(n3()),text:e=>t.push(nZ(e))}),t}function r$(e){let t=[];for(let n of e)ik(n)||(!ic(n)&&!i_(n)||n.isInline()?t.push(n):ic(n)&&t.push(...r$(n.getChildren())));return t}function rW(e,t=!1){let r=e;e.isCollapsed()||r.removeText();let i=rM();rr(i)&&(r=i),rr(r)||n(161);let l=r.anchor,o=l.getNode(),s=l.offset;for(;!om(o)&&null===oH(o);){let e=o;if([o,s]=function(e,t,n=!1){let r=e.getParent();if(!r){let e=iV();return lT().append(e),e.select(),[lT(),0]}if(n0(e)){let n=e.splitText(t);if(0===n.length)return[r,e.getIndexWithinParent()];let i=+(0!==t);return[r,n[0].getIndexWithinParent()+i]}if(!ic(e)||0===t)return[r,e.getIndexWithinParent()];let i=e.getChildAtIndex(t);if(i){let r=new ri(n5(e.__key,t,"element"),n5(e.__key,t,"element"),0,""),l=e.insertNewAfter(r);if(l)l.append(i,...i.getNextSiblings());else if(n)return[e,t]}return[r,e.getIndexWithinParent()+1]}(o,s,t),e.is(o))break}return[o,s]}function rU(e){return ik(e)||lq(e)||n0(e)||e.isParentRequired()}function rH(e){let t=iV(),n=null;for(let r=0;r<e.length;r++){let i=e[r];if(rU(i)){if(null===n){n=i.createParentElementNode(),t.append(n);let l=e[r+1];if(ik(i)&&(void 0===l||!rU(l)))continue}n.append(i)}else t.append(i),n=null}return t}function rj(e,t,n,r,i="decorators-and-blocks"){if("move"===t&&"character"===r&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let l=iM(e.focus,n?"previous":"next"),o="lineboundary"===r,s="move"===t,a=l,u="decorators-and-blocks"===i,f=!1;if(!iB(a)){for(let e of a){u=!1;let{origin:t}=e;if(i_(t)){if(t.isIsolated()){f=!0;break}if(a=e,o&&t.isInline())continue}break}if(f)return!0;if(u)for(let e of sy(l).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(sl(e))e.origin.isInline()||(a=e);else{if(ic(e.origin))continue;i_(e.origin)&&!e.origin.isInline()&&(a=e)}break}}if(a===l)return!1;if(s&&!o&&i_(a.origin)&&a.origin.isKeyboardSelectable()){let e=rE();return e.add(a.origin.getKey()),lv(e),!0}return a=iK(a),s&&iA(e.anchor,a),iA(e.focus,a),u||!o}let rY=null,rG=null,rJ=!1,rV=!1,rq=!1,rX=new Set,rQ=0,rZ={characterData:!0,childList:!0,subtree:!0};function r0(){return rJ||null!==rY&&rY._readOnly}function r1(){rJ&&n(13)}function r2(){rQ>99&&n(14)}function r3(){return null===rY&&n(195,r5()),rY}function r4(){return null===rG&&n(337,r5()),rG}function r6(){r4()._dirtyType=2}function r5(){let e=0,t=new Set,n=i2.version;if("u">typeof window)for(let r of ot(document)){let i=lr(r);if(lt(i))e++;else if(i){let e=String(i.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function r7(e,t,n){let r=t.__type,i=i5(e,r),l=n.get(r);void 0===l&&(l=Array.from(i.transforms),n.set(r,l));let o=l.length;for(let e=0;e<o&&(l[e](t),t.isAttached());e++);}function r8(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function r9(e,t){if(!t)return;let n=e._updateTags,r=t;for(let e of(Array.isArray(t)||(r=[t]),r))n.add(e)}function ie(e,t){let r=e.type,i=t.get(r);void 0===i&&n(17,r);let l=i.klass;e.type!==l.getType()&&n(18,l.name);let o=l.importJSON(e),s=e.children;if(ic(o)&&Array.isArray(s))for(let e=0;e<s.length;e++){let n=ie(s[e],t);o.append(n)}
1let a=e.$slots;if(a)for(let e in oW(o)||n(379,l.name),a)!function(e,t,r){"__proto__"!==t&&"constructor"!==t&&"prototype"!==t||n(373,t);let i=e.getLatest();if(null!==i.__slots&&i.__slots.get(t)===r.getLatest().__key)return;(!ic(r)&&!i_(r)||r.isInline())&&n(374,r.__key);let l=e.getWritable(),o=oZ(l),s=o.get(t);void 0!==s&&function(e){let t=l_(e);if(null===t)return;let r=t.getWritable();oU(r)||n(377,e),r.__slotHost=null,r.remove()}(s);let a=r.getWritable(),u=oj(a);if(null!==u){let e=oY(a);null!==e&&oZ(u.getWritable()).delete(e),a.__slotHost=null}ld(a),a.__slotHost=l.__key,o.set(t,a.__key),function(e){let t=e.__slots;if(null===t||t.size<2)return;let r=function(e){let t=o0.get(e);if(void 0===t){let r=function(e){for(let{ownNodeConfig:t}of oR(e)){let e=t&&t.slots;if(e)return e}return o1}(e),i=new Map;for(let t of r)oX.includes(t)&&n(371,e.name,t),i.has(t)&&n(372,e.name,t),i.set(t,i.size);t=i,o0.set(e,t)}return t}(e.constructor),i=null,l=!0;for(let e of t.keys()){if(null!==i&&o3(i,e,r)>0){l=!1;break}i=e}if(l)return;let o=Array.from(t).sort(([e],[t])=>o3(e,t,r));for(let[e,n]of(t.clear(),o))t.set(e,n)}(l),r4()._slotsUsed=!0,r3()._slotsUsed=!0}(o,e,ie(a[e],t));return o}function it(e,t,n){let r=rY,i=rJ,l=rG;rY=t,rJ=!0,rG=e;try{return n()}finally{rY=r,rJ=i,rG=l}}function ir(e,t){let n=rq;rq=!0;try{!function(e,t){var n;let r,i,l=e._pendingEditorState,o=e._rootElement,s=e._headless||null===o;if(null===l)return!e._updating&&e._deferred.length>0&&il(e,e._deferred);let a=e._editorState,u=a._selection,f=l._selection,d=0!==e._dirtyType,c=rY,h=rJ,g=rG,_=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=l,!s&&d&&null!==p){rG=e,rY=l,rJ=!1,e._updating=!0;try{let t,n,r,i=e._dirtyType,o=e._dirtyElements,s=e._dirtyLeaves;p.disconnect(),em="",ey=null,eC=null,ex=null,eP=2===i,e_=e,eg=e._config,eI=e._config.dom||iZ,ep=e._nodes,ev=e_._listeners.mutation,ek=o,eb=s,eE=a._nodeMap,eO=a,eM=l._nodeMap,eF=l._readOnly,eA=K(e._keyToDOMMap),t=new Map,(n=e=>{for(let n of e){let e=eM.get(n);if(void 0===e)continue;let r=e.__parent;if(null===r)continue;let i=t.get(r);void 0===i&&(i=new Set,t.set(r,i)),i.add(n)}})(ek.keys()),n(eb),ew=t,eD=r=new Map,e1("root",null),e_=void 0,ep=void 0,ek=void 0,eb=void 0,eE=void 0,eO=void 0,eM=void 0,eg=void 0,eA=void 0,ew=void 0,eD=void 0,eI=iZ,m=r}catch(t){if(t instanceof Error&&e._onError(t),rV)throw t;return iQ(e,null,o,l),G(e),e._dirtyType=2,rV=!0,ir(e,a),void(rV=!1)}finally{p.observe(o,rZ),e._updating=_,rY=c,rJ=h,rG=g}}l._readOnly||(l._readOnly=!0);let y=e._dirtyLeaves,C=e._dirtyElements,x=e._normalizedNodes,S=e._updateTags;d&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set,function(e,t){let n,r=e._decorators,i=e._pendingDecorators||r,l=t._nodeMap;for(n in i)l.has(n)||(i===r&&(i=lx(e)),delete i[n])}(e,l);let T=s?null:l5(lV(e));if(e._editable&&null!==T&&(d||null===f||f.dirty||!f.is(u))&&null!==o&&!S.has(nD)){rG=e,rY=l;try{if(null!==p&&p.disconnect(),d||null===f||f.dirty){let t=e._blockCursorElement;null!==t&&l6(t,e,o),rK(u,f,e,T,S,o)}!function(e,t,n){let r=e._blockCursorElement;if(rr(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(os(t))){let i=n.anchor,l=i.getNode(),o=i.offset,s=!1,a=null;if(o===l.getChildrenSize())l4(l.getChildAtIndex(o-1))&&(s=!0);else{let t=l.getChildAtIndex(o);null!==t&&l4(t)&&(s=!0,a=e.getElementByKey(t.__key))}if(s){let n,i,o,s=ox(l,e.getElementByKey(l.__key),e).element;return null===r&&(n=e._config.theme,(i=or().createElement("div")).contentEditable="false",i.setAttribute("data-lexical-cursor","true"),o=n.blockCursor,void 0!==o&&("string"==typeof o&&(o=n.blockCursor=sb(o)),void 0!==o&&i.classList.add(...o)),e._blockCursorElement=r=i),t.style.caretColor="transparent",null===a?s.appendChild(r):s.insertBefore(r,a)}}null!==r&&l6(r,e,t)}(e,o,f)}finally{null!==p&&p.observe(o,rZ),rG=g,rY=c}}null!==m&&function(e,t,n,r,i){let l=Array.from(e._listeners.mutation),o=l.length;for(let e=0;e<o;e++){let[o,s]=l[e];for(let e of s){let l=t.get(e);void 0!==l&&o(l,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,S,y,a),rr(f)||null===f||null!==u&&u.is(f)||e.dispatchCommand(e7);let N=e._pendingDecorators;null!==N&&(e._decorators=N,e._pendingDecorators=null,ii("decorator",e,!0,N)),n=t||a,r=lS(n),i=lS(l),r!==i&&ii("textcontent",e,!0,i),ii("update",e,!0,{dirtyElements:C,dirtyLeaves:y,editorState:l,mutatedNodes:m,normalizedNodes:x,prevEditorState:t||a,tags:S}),_||il(e,e._deferred),function(e){let t=e._updates;if(0===t.length)return e._cascadeCount=0;
1if(rX.has(e)||(rX.add(e),setTimeout(()=>{rX.delete(e),e._cascadeCount=0},0)),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,e._onWarn(Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${e._config.namespace}`));let n=t.shift();if(n){let[t,r]=n;is(e,t,r)}}(e)}(e,t)}finally{rq=n}}function ii(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e];for(let[e,t]of Array.from(n)){t&&t();let i=e(...r),l="function"==typeof i?i:void 0;n.has(e)?n.set(e,l):l&&l()}}finally{t._updating=i}}function il(e,t){if(e._deferred=[],0!==t.length){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function io(e,t){let r=e._updates,i=t||!1;for(;0!==r.length;){let t=r.shift();if(t){let r,[l,o]=t,s=e._pendingEditorState;void 0!==o&&(r=o.onUpdate,o.skipTransforms&&(i=!0),o.discrete&&(null===s&&n(191),s._flushSync=!0),r&&e._deferred.push(r),r9(e,o.tag)),null==s?is(e,l,o):l()}}return i}function is(e,t,r){let i=e._updateTags,l,o=!1,s=!1;void 0!==r&&(l=r.onUpdate,r9(e,r.tag),o=r.skipTransforms||!1,s=r.discrete||!1),l&&e._deferred.push(l);let a=e._editorState,u=e._pendingEditorState,f=!1;(null===u||u._readOnly)&&(u=e._pendingEditorState=iy(u||a),f=!0),u._flushSync=s;let d=rY,c=rJ,h=rG,g=e._updating;rY=u,rJ=!1,e._updating=!0,rG=e;let _=e._headless||null===e.getRootElement();i3=null;try{var p;let i,l;f&&(_?null!==a._selection&&(u._selection=a._selection.clone()):u._selection=(p=r&&r.event||null,i=e.getEditorState()._selection,l=l5(lV(e)),rr(i)||null==i?rO(i,l,e,p):i.clone()));let s=e._compositionKey;t(),o=io(e,o),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(rr(r)){let e,t=r.anchor,i=r.focus;if("text"===t.type&&(e=t.getNode()).selectionTransform(n,r),"text"===i.type){let t=i.getNode();e!==t&&t.selectionTransform(n,r)}}}(u,e),0!==e._dirtyType&&(o?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);n0(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&ea(t)}}(u,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,l=lg(),o=new Map,s=n,a=s.size,u=r,f=u.size;for(;a>0||f>0;){if(a>0){for(let e of(t._dirtyLeaves=new Set,s)){let r=i.get(e);n0(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&ea(r),void 0!==r&&r8(r,l)&&r7(t,r,o),n.add(e)}if((a=(s=t._dirtyLeaves).size)>0){rQ++;continue}}for(let e of(t._dirtyLeaves=new Set,t._dirtyElements=new Map,u.delete("root")&&u.set("root",!0),u)){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let a=i.get(n);void 0!==a&&r8(a,l)&&r7(t,a,o)}a=(s=t._dirtyLeaves).size,f=(u=t._dirtyElements).size,rQ++}t._dirtyLeaves=n,t._dirtyElements=r}(u,e),io(e),function(e,t,n,r){let i=e._nodeMap,l=t._nodeMap,o=[];for(let[e]of r){let t=l.get(e);void 0!==t&&(t.isAttached()||(ic(t)&&z(t,e,i,l,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=l.get(e);
1void 0===t||t.isAttached()||(oW(t)&&null!==t.__slots&&z(t,e,i,l,o,n),i.has(e)||n.delete(e),o.push(e))}for(let e of o)l.delete(e);let s=r4(),a=s._compositionKey;null===a||l.has(a)||(s._compositionKey=null)}(a,u,e._dirtyLeaves,e._dirtyElements)),s!==e._compositionKey&&(u._flushSync=!0);let d=u._selection;if(rr(d)){e._slotsUsed&&rT(d);let t=u._nodeMap,r=d.anchor.key,i=d.focus.key;void 0!==t.get(r)&&void 0!==t.get(i)||n(19)}else rl(d)&&0===d._nodes.size&&(u._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void ir(e)}finally{rY=d,rJ=c,rG=h,e._updating=g,rQ=0}0!==e._dirtyType||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(u,e)?u._flushSync?(u._flushSync=!1,ir(e)):f&&i8(()=>{ir(e)}):(u._flushSync=!1,f&&(i.clear(),e._deferred=[],e._pendingEditorState=null))}function ia(e,t,n){rG===e&&void 0===n?r0()?is(e,t,n):t():is(e,t,n)}function iu(e){if(lZ(e)){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}
1class id extends nO{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:iu,extends:nO})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle="",this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,null!==this.__slotHost&&null!==this.__parent&&n(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return T[this.getFormat()]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()&&0===oV(this).length}isDirty(){let e=r4()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){let e=[];for(let t of oV(this)){let n=oq(this,t);if(ic(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;null!==t;){if(n0(t)&&e.push(t),ic(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;ic(e);){let t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;ic(e);){let t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return ic(e)&&e.getLastDescendant()||e||null}let r=t[e];return ic(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return null===e?null:l_(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return null===e&&n(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return null===e?null:l_(e)}getLastChildOrThrow(){let e=this.getLastChild();return null===e&&n(96,this.__key),e}getChildAtIndex(e){let t,n,r=this.getChildrenSize();if(e<r/2){for(t=this.getFirstChild(),n=0;null!==t&&n<=e;){if(n===e)return t;t=t.getNextSibling(),n++}return null}for(t=this.getLastChild(),n=r-1;null!==t&&n>=e;){if(n===e)return t;t=t.getPreviousSibling(),n--}return null}getTextContent(){let e=o2(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),ic(i)&&r!==n-1&&!i.isInline()&&(e+="\n\n")}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of oV(e)){let r=oq(e,n);null!==r&&(t+=r.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),ic(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(""!==e){let t=S[e];return 0!=(this.getFormat()&t)}return!1}hasTextFormat(e){let t=C[e];return 0!=(this.getTextFormat()&t)}getFormatFlags(e,t){return lu(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){r1();let n=rM(),r=e,i=t,l=this.getChildrenSize();if(!this.canBeEmpty()){if(0===e&&0===t){let e=this.getFirstChild();if(n0(e)||ic(e))return e.select(0,0)}else if((void 0===e||e===l)&&(void 0===t||t===l)){let e=this.getLastChild();if(n0(e)||ic(e))return e.select()}}void 0===r&&(r=l),void 0===i&&(i=l);let o=this.__key;return rr(n)?(n.anchor.set(o,r,"element"),n.focus.set(o,i,"element"),n.dirty=!0,n):rk(o,r,o,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();
1return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e&&S[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){nb(this)&&n(324,this.__key,this.__type);let i=this.getChildrenSize(),l=this.getWritable();for(let l of(e+t<=i||n(226,String(e),String(t),String(i)),r));let o=l.__key,s=[],a=[],u=this.getChildAtIndex(e+t),f=null,d=i-t+r.length;if(0!==e)if(e===i)f=this.getLastChild();else{let t=this.getChildAtIndex(e);null!==t&&(f=t.getPreviousSibling())}if(t>0){let e=null===f?this.getFirstChild():f.getNextSibling();for(let r=0;r<t;r++){null===e&&n(100);let t=e.getNextSibling(),r=e.__key;ld(e.getWritable()),a.push(r),e=t}}let c=f;for(let e of r){null!==c&&e.is(c)&&(f=c=c.getPreviousSibling()),null!==u&&e.is(u)&&(u=u.getNextSibling());let t=e.getWritable();t.__parent===o&&d--,ld(t);let r=e.__key;if(null===c)l.__first=r,t.__prev=null;else{let e=c.getWritable();e.__next=r,t.__prev=e.__key}e.__key===o&&n(76),t.__parent=o,s.push(r),c=e}if(null===u)null!==c&&(c.getWritable().__next=null,l.__last=c.__key);else{let e=u.getWritable();if(null!==c){let t=c.getWritable();e.__prev=c.__key,t.__next=u.__key}else e.__prev=null}if(l.__size=d,a.length){let e=rM();if(rr(e)){let t=new Set(a),n=new Set(s),{anchor:r,focus:i}=e;ih(r,t,n)&&rP(r,r.getNode(),this,f,u),ih(i,t,n)&&rP(i,i.getNode(),this,f,u),0!==d||this.canBeEmpty()||lZ(this)||this.remove()}}return l}getDOMSlot(e){return new P(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(of(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+"px",t.setAttribute("data-lexical-indent",String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return 0===t&&""===n||lZ(this)||this.getChildren().some(n0)||(0!==t&&(e.textFormat=t),""!==n&&(e.textStyle=n)),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,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=ox(this,e,t),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());null!==i&&(null==r?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}}function ic(e){return e instanceof id}function ih(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class ig extends nO{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,null!==this.__slotHost&&null!==this.__parent&&n(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function i_(e){return e instanceof ig}class ip extends id{__cachedText;$config(){return this.config("root",{extends:id})}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){n(51)}getTextContent(){let e=this.__cachedText;return null!==e&&(r0()||0===r4()._dirtyType)?e:super.getTextContent()}remove(){n(52)}replace(e){n(53)}insertBefore(e){n(54)}insertAfter(e){n(55)}updateDOM(e,t){return!1}splice(e,t,r){for(let e of r)ic(e)||i_(e)||n(282);return super.splice(e,t,r)}static importJSON(e){return lT().updateFromJSON(e)}collapseAtStart(){return!0}}function im(e){return e instanceof ip}function iy(e){return new ix(K(e._nodeMap),null,e._slotsUsed)}function iC(){return new ix(new Map([["root",new ip]]),null,!1)}class ix{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&null===this._selection}read(e,t){return it(t&&t.editor||null,this,e)}clone(e){let t=new ix(this._nodeMap,void 0===e?this._selection:e,this._slotsUsed);return t._readOnly=!0,t._parsed=this._parsed,t}toJSON(){return it(null,this,()=>({root:function e(t){let r=t.exportJSON(),i=t.constructor;if(r.type!==i.getType()&&n(130,i.name),ic(t)){let l=r.children;Array.isArray(l)||n(59,i.name);let o=t.getChildren();for(let t=0;t<o.length;t++){let n=e(o[t]);l.push(n)}}let l=oV(t);if(l.length>0){let o={};for(let r of l){let l=oq(t,r);null===l&&n(366,i.name,r),o[r]=e(l)}r.$slots=o}return r}(lT())}))}}class iS extends id{$config(){return this.config("artificial",{extends:id})}createDOM(e){return or().createElement("div")}}class iT extends nO{$config(){return this.config("linebreak",{importDOM:{br:e=>ib(e)||iE(e)?null:{conversion:iN,priority:0}}})}getTextContent(){return"\n"}createDOM(){return or().createElement("br")}updateDOM(){return!1}isInline(){return!0}}function iN(e){return{node:iv()}}function iv(){return l1(new iT)}function ik(e){return e instanceof iT}function ib(e){let t=e.parentElement;if(null!==t&&op(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&iO(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&iO(n))return!0}}return!1}function iE(e){let t=e.parentElement;if(null!==t&&op(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&iO(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&iO(r))return!0}return!1}function iO(e){return lo(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function iM(e,t){let{type:r,key:i,offset:l}=e,o=l3(e.key);return"text"===r?(n0(o)||n(266,o.getType(),i),sf(o,t,l)):(ic(o)||n(267,o.getType(),i),i$(o,e.offset,t))}function iA(e,t){let{origin:r,direction:i}=t,l="next"===i;sr(t)?e.set(r.getKey(),t.offset,"text"):si(t)?n0(r)?e.set(r.getKey(),sd(r,i),"text"):e.set(r.getParentOrThrow().getKey(),r.getIndexWithinParent()+ +!!l,"element"):(sl(t)&&ic(r)||n(268),e.set(r.getKey(),l?0:r.getChildrenSize(),"element"))}function iw(e){let t=rM(),n=rr(t)?t:rb();return iD(n,e),lv(n),n}
1function iD(e,t){iA(e.anchor,t.anchor),iA(e.focus,t.focus)}function iI(e){let{anchor:t,focus:n}=e,r=iM(t,"next"),i=iM(n,"next"),l=0>=sT(r,i)?"next":"previous";return sx(sm(r,l),sm(i,l))}function iP(e){let{direction:t,origin:n}=e,r=su(n,o9(t)).getNodeAtCaret();return r?su(r,t):sc(n.getParentOrThrow(),t)}function iF(e,t="root"){let n=[e];for(let r=sl(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;r=r.getParentCaret(t))n.push(iP(r));return n}function iR(e){return!!e&&e.origin.isAttached()}function iL(e,t="removeEmptySlices"){let r,i;if(e.isCollapsed())return e;let l="root",o="next",s=t,a=iz(e,o),u=a.anchor.origin;for(;null!==u&&!lZ(u);)u=u.getParent();let f=ic(u)?u.getFirstChild():null,d=iF(a.anchor,l),c=iF(a.focus.getFlipped(),l),h=new Set,g=[];for(let e of a.iterNodeCarets(l))if(sl(e))h.add(e.origin.getKey());else if(si(e)){let{origin:t}=e;ic(t)&&!h.has(t.getKey())||g.push(t)}let _=new Set;for(let e of g){let t=e.getParent();null===t||h.has(t.getKey())||_.add(t),ld(e)}for(let e of _)!e.canBeEmpty()&&!lZ(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),r=iP(su(t,o)),i=t.getMode();if(Math.abs(e.distance)===n&&"removeEmptySlices"===s||"token"===i&&0!==e.distance)r.remove();else if(0!==e.distance){s="removeEmptySlices";let t=e.removeTextSlice(),n=e.caret.origin;if("segmented"===i){let e=t.origin,n=nZ(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());r.replaceOrInsert(n),t=sf(n,o,t.offset)}n.is(d[0].origin)&&(d[0]=t),n.is(c[0].origin)&&(c[0]=t.getFlipped())}}for(let e of d)if(iR(e)){r=iK(e);break}for(let e of c)if(iR(e)){i=iK(e);break}let p=function(e,t,n){let r;if(!e||!t)return null;let i=e.getParentAtCaret(),l=t.getParentAtCaret();if(!i||!l)return null;let o=i.getParents().reverse();o.push(i);let s=l.getParents().reverse();s.push(l);let a=Math.min(o.length,s.length);for(r=0;r<a&&o[r]===s[r];r++);let u=(e,t)=>{let n;for(let i=r;i<e.length;i++){let r=e[i];if(lZ(r))return;!n&&t(r)&&(n=r)}return n},f=u(o,om),d=f&&u(s,e=>n.has(e.getKey())&&om(e));return d&&oV(d).length>0?null:f&&d?[f,d]:null}(r,i,h);if(p){let[e,t]=p;sc(e,"previous").splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(i){let e=function(e){if(sl(e)){let t=e.origin;if(om(t))return t}else{let t=e.getParentAtCaret();if(t&&om(t))return t}return null}(i),t=e&&e.getParent(),n=e&&e.getParents().findLast(lQ);if(e&&t&&!im(t)&&e.isEmpty()&&h.has(e.getKey())&&0===oV(e).length&&(!n||h.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!im(n)&&n.isEmpty();){let e=n.getParent();if(e&&im(e)&&1>=e.getChildrenSize())break;let t=n;n=e,t.remove(!0)}}}null===lN(u,f)&&lN(lT(),null);let m=[r,i,...d,...c].find(iR);if(m)return sC(sm(iK(m),e.direction));n(269,JSON.stringify(d.map(e=>e.origin.__key)))}function iK(e){let t=function(e){let t=e;for(;sl(t);){let e=sg(t);if(!sl(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(n0(t.origin))return sr(t)?t:sf(t.origin,n,n);let r=t.getAdjacentCaret();return si(r)&&n0(r.origin)?sf(r.origin,n,o9(n)):t}function iB(e){return sr(e)&&e.offset!==sd(e.origin,e.direction)}function iz(e,t){return e.direction===t?e:sx(sm(e.focus,t),sm(e.anchor,t))}function i$(e,t,n){let r=sc(e,"next");for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(null===e)break;r=e}return sm(r,n)}function iW(e){let{origin:t,offset:r,direction:i}=e;if(r===sd(t,i))return e.getSiblingCaret();if(r===sd(t,o9(i)))return iP(e.getSiblingCaret());let[l]=t.splitText(r);return n0(l)||n(281),sm(su(l,"next"),i)}function iU(e,t){return!0}function iH(e,{$copyElementNode:t=l0,$splitTextPointCaretNext:n=iW,rootMode:r="shadowRoot",$shouldSplit:i=iU,removeEmptyDestination:l=!1}={}){if(sr(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(sl(e)){let e=iP(o);if(l&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,"first"))return e}let r=function(e){let t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(r.length>0||!l&&n.canBeEmpty()&&i(n,"last"))&&o.insert(t(n).splice(0,0,r))}return o}function ij(e,t,r){let i=sm(t,"next");sr(i)&&(0===i.offset?i=su(i.origin,"previous").getFlipped():i.offset===i.origin.getTextContentSize()&&(i=su(i.origin,"next"))),i.origin.is(e)&&(si(i)||n(342,e.getKey(),e.getType()),i=iP(i)),(e.is(i.getNodeAtCaret())||e.is(i.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=i;e;e=iH(e,r))i=e;return sr(i)&&n(283),i.insert(e.isInline()?iV().append(e):e),sm(su(e.getLatest(),"next"),t.direction)}function iY(e,t){let n=iz(rr(t)?iI(t):t,"next"),r=oG(n.anchor.origin),i=oG(e.getLatest());if(null===r?null!==i:!r.is(i))return!1;let l=iK(sc(e,"next")),o=sm(iK(sc(e,"previous")),"next");return 0>
1=sT(n.anchor,l)&&sT(n.focus,o)>=0}class iG extends id{$config(){return this.config("paragraph",{extends:id,importDOM:{p:()=>({conversion:iJ,priority:0})}})}createDOM(e){let t=or().createElement("p"),n=lK(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(of(t)){this.isEmpty()&&t.append(or().createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(){let e=super.exportJSON();if(void 0===e.textFormat||void 0===e.textStyle){let t=this.getChildren().find(n0);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}extractWithChild(e,t,n){if(!rr(t)||""===this.getFormatType()&&0===this.getIndent()&&""===this.getStyle())return!1;if(iY(this,t)){let e=this.getTextContent();return""!==e&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=iV();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>n0(e)&&!/\S/.test(e.getTextContent()))){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function iJ(e){let t=iV();if(oO(t,e),ob(e,t),""===t.getFormatType()){let n=e.getAttribute("align");n&&n&&n in S&&t.setFormat(n)}return oE(t,e),{node:t}}function iV(){return l1(new iG)}function iq(e){return e instanceof iG}function iX(e){console.warn(e)}function iQ(e,t,n,r,i){let l,o=e._keyToDOMMap;o.clear(),e._editorState=iC(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,null!==e._inputState.handledSelectionCommandTimeoutId&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let s=e._observer;null!==s&&(s.disconnect(),e._observer=null),null!==t&&(t.textContent="",l=`__lexicalKey_${e._key}`,delete t[l]),null!==n&&(n.textContent="",o.set("root",n),lm(n,e,"root"))}let iZ={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=i7(t,e.getType());return n&&void 0!==n.exportDOM?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>ic(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>ic(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function i0(e,t){let n=e.get(t);e.delete(t),n&&n()}function i1(e,t,n){return e.set(t,n),i0.bind(null,e,t)}class i2{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_createEditorArgs;constructor(e,t,n,r,i,l,o,s,a){this._createEditorArgs=a,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new B,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,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=lM(),this._onError=i,this._onWarn=l,this._htmlConversions=o,this._editable=s,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null}}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){return i1(this._listeners.update,e)}
1registerEditableListener(e){return i1(this._listeners.editable,e)}registerDecoratorListener(e){return i1(this._listeners.decorator,e)}registerTextContentListener(e){return i1(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return sE(i1(t,e,e(this._rootElement,null)||void 0),()=>{var n;let r;return n=[null,this._rootElement],void((r=t.get(e))&&r(),t.set(e,e(...n)||void 0))})}registerCommand(e,t,r){void 0===r&&n(35);let i=this._commands;i.has(e)||i.set(e,[new L,new L,new L,new L,new L]);let l=i.get(e);void 0===l&&n(36,String(e));let o=7&r,s=l[o];return o!==r?s.addFront(t):s.addBack(t),()=>{s.delete(t),l.every(e=>0===e.size)&&i.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,l=i.get(t);void 0===l&&(l=new Set,i.set(t,l)),l.add(r);let o=n&&n.skipInitialization;return void 0!==o&&o||this.initializeMutationListener(t,r),()=>{l.delete(r),0===l.size&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return void 0===t&&n(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=ov(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(null!=i){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=ov(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}0!==r.length&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=l_(t);e&&e.markDirty()}},null===e._pendingEditorState?{tag:nA}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return lW(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let r=lK(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,iQ(this,t,e,i,{preserveUpdateQueue:!0}),null!==t&&(this._config.disableEvents||function(e){let t=t3.get(e);if(void 0===t)return nN();let r=t4.get(t);if(void 0===r)return nN();t3.delete(e);let i=lr(e);lt(i)?(!function(e){if(null!==e._parentEditor){let t=lO(e),n=t[t.length-1]._key;nC.get(n)===e&&nC.delete(n)}else nC.delete(e._key)}(i),r.editors.delete(i),r.hasShadowEditor=void 0,e.__lexicalEditor=null):i&&n(198);let l=ny(e);for(let e=0;e<l.length;e++)l[e]();e.__lexicalEventHandles=[]}(t),null!=r&&t.classList.remove(...r)),null!==e){let t=lJ(e),n=e.style;n.userSelect="text",n.whiteSpace="pre-wrap",n.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,G(this),this._updateTags.add(nA),ir(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;t3.set(e,n);let r=t4.get(n);void 0===r&&(r={editors:new Set,hasShadowEditor:void 0},t4.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;let i=ny(e);i.push(t6.register(n));for(let n=0;n<t2.length;n++){let[r,l]=t2[n],o="function"==typeof l?e=>{nT(e)||(nS(e),(t.isEditable()||"click"===r)&&l(e,t))}:e=>{if(nT(e))return;nS(e);let n=t.isEditable();switch(r){case"cut":return n&&lW(t,tK,e);case"copy":return lW(t,tL,e);case"paste":return n&&lW(t,ta,e);case"dragstart":return n&&lW(t,tP,e);case"dragover":return n&&lW(t,tF,e);case"dragend":return n&&lW(t,tR,e);case"focus":return n&&lW(t,tH,e);case"blur":return n&&lW(t,tj,e);case"drop":return n&&lW(t,tD,e)}};i.push(t0(e,r,o))}}(e,this),null!=r&&e.classList.add(...r)}else this._window=null,this._updateTags.add(nA),ir(this);ii("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&n(38);let r=e;r._readOnly&&((r=iy(e))._selection=e._selection?e._selection.clone():null),Y(this);
1let i=this._pendingEditorState,l=void 0!==t?t.tag:null;null===i||i.isEmpty()||(null!=l&&this._updateTags.add(l),ir(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,ia(this,()=>{if(l&&this._updateTags.add(l),e._parsed)for(let[e,t]of r._nodeMap.entries())ic(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=iC(),i=rY,l=rJ,o=rG,s=t._dirtyElements,a=t._dirtyLeaves,u=t._cloneNotNeeded,f=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,rY=r,rJ=!1,rG=t,i3=null;try{let i=t._nodes;ie(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=a,t._cloneNotNeeded=u,t._dirtyType=f,rY=i,rJ=l,rG=o}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(...e){let[t,n]=1===e.length?["force-commit",e[0]]:e;return"force-commit"===t&&ir(this),("pending"===t?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){this._updating?this._updates.push([e,t]):is(this,e,t)}focus(e,t={}){let n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),ia(this,()=>{var r;let i=rM(),l=lT();null!==i?i.dirty||lv(i.clone()):0!==l.getChildrenSize()&&("rootStart"===t.defaultSelection?l.selectStart():l.selectEnd()),lY("focus"),r=()=>{n.removeAttribute("autocapitalize"),e&&e()},r1(),r4()._deferred.push(r)}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;null!==e&&e.blur();let t=l5(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,ii("editable",this,!0,e),this._slotsUsed&&this.update(()=>r6()))}toJSON(){return{editorState:this._editorState.toJSON()}}}i2.version=R;let i3=null,i4=Symbol("INTERNAL_SKIP_AFTER_CLONE_FROM"),i6=1;function i5(e,t){let r=i7(e,t);return void 0===r&&n(30,t),r}function i7(e,t){return e._nodes.get(t)}let i8="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function i9(e,t){let n,r=void 0!==t?t:ls(n=e.getRootNode())||l8(n)?oa(n):null;if(!of(r)||r.hasAttribute("data-lexical-slot"))return!1;let i=lC(r),l=r.nodeName;return nM(i)&&("INPUT"===l||"TEXTAREA"===l||"true"===r.contentEditable&&null==lr(r))}function le(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch(e){return!1}return ln(t)===e&&e.read("latest",()=>!i9(t))}function lt(e){return e instanceof i2}function ln(e){let t=e;for(;null!=t;){let e=lr(t);if(lt(e))return e;t=lH(t)}return null}function lr(e){return e?e.__lexicalEditor:null}function li(e){return n4(e)||e.isToken()}function ll(e){return li(e)||e.isSegmented()}function lo(e){return od(e)&&3===e.nodeType}function ls(e){return od(e)&&9===e.nodeType}function la(e){let t=e;for(;null!=t;){if(lo(t))return t;t=t.firstChild}return null}function lu(e,t,n){let r=C[t];if(null!==n&&(e&r)==(n&r))return e;let i=e^r;return"subscript"===t?i&=~C.superscript:"superscript"===t?i&=~C.subscript:"lowercase"===t?(i&=~C.uppercase,i&=~C.capitalize):"uppercase"===t?(i&=~C.lowercase,i&=~C.capitalize):"capitalize"===t&&(i&=~C.lowercase,i&=~C.uppercase),i}function lf(e,t){let n,r=(n=i3,i3=null,n);if(null!=(t=t||r&&r.__key))return void(e.__key=t);r1(),r2();let i=r4(),l=r3(),o=""+i6++;l._nodeMap.set(o,e),ic(e)?i._dirtyElements.set(o,!0):i._dirtyLeaves.add(o),i._cloneNotNeeded.add(o),0===i._dirtyType&&(i._dirtyType=1),e.__key=o}function ld(e){null!==oH(e)&&n(380,e.__key,String(oH(e)));let t=e.getParent();if(null!==t){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),l=e.getNextSibling(),o=null!==l?l.__key:null,s=null!==i?i.__key:null,a=null!==i?i.getWritable():null,u=null!==l?l.getWritable():null;null===i&&(r.__first=o),null===l&&(r.__last=s),null!==a&&(a.__next=o),null!==u&&(u.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function lc(e){r2(),nb(e)&&n(323,e.__key,e.__type);let t=e.getLatest(),r=null!==t.__parent?t.__parent:oU(t)?t.__slotHost:null,i=r3(),l=r4(),o=i._nodeMap,s=l._dirtyElements;null!==r&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;let e=t.get(r);if(void 0===e)break;n.set(r,!1),r=null!==e.__parent?e.__parent:oU(e)?e.__slotHost:null}}(r,o,s);let a=t.__key;0===l._dirtyType&&(l._dirtyType=1),ic(e)?s.set(a,!0):l._dirtyLeaves.add(a)}function lh(e){r1();let t=r4(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){let e=l_(n);null!==e&&e.getWritable()}if(null!==e){let t=l_(e);null!==t&&t.getWritable()}}}function lg(){return r0()?null:r4()._compositionKey}
1function l_(e,t){let n=(t||r3())._nodeMap.get(e);return void 0===n?null:n}function lp(e,t){let n=ly(e,r4());return void 0!==n?l_(n,t):null}function lm(e,t,n){e[`__lexicalKey_${t._key}`]=n}function ly(e,t){return e[`__lexicalKey_${t._key}`]}function lC(e,t){let n=e;for(;null!=n;){let e=lp(n,t);if(null!==e)return e;n=lH(n)}return null}function lx(e){let t=Object.assign({},e._decorators);return e._pendingDecorators=t,t}function lS(e){return e.read(()=>lT().getTextContent())}function lT(){return r3()._nodeMap.get("root")}function lN(e,t){if(!(lZ(e)&&e.isAttached()&&e.isEmpty()&&(im(e)||null!==t&&om(t))))return null;let n=iV();return e.append(n),n}function lv(e){r1();let t=r3();null!==e&&(e.dirty=!0,e.setCachedNodes(null),rr(e)&&r4()._slotsUsed&&rT(e)),t._selection=e}function lk(){r1(),Y(r4())}function lb(e){let t=function(e,t){let n=e;for(;null!=n;){let e=ly(n,t);if(void 0!==e)return e;n=lH(n)}return null}(e,r4());return null===t?null:l_(t)}function lE(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function lO(e){let t=[];for(let n=e;null!==n;n=n._parentEditor)t.push(n);return t}function lM(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function lA(e){return lo(e)?e.nodeValue:null}function lw(e,t,n){let r=l5(lV(t));if(null===r)return;let i=oo(r,t._rootElement),l=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(null!==l){let t=lA(l),r=lC(l);if(null!==t&&n0(r)){if((t===_||t===p)&&n){let e=n.length;t=n,o=e,s=e}null!==t&&lD(r,t,o,s,e)}}}function lD(e,t,n,r,i){let l=e;if(l.isAttached()&&(i||!l.isDirty())){let o=l.isComposing();if(l.isToken()&&o)return;let s=t;if((o||i)&&(t.endsWith(_)&&(s=t.slice(0,-_.length)),i)){let e;for(;-1!==(e=s.indexOf(p));)s=s.slice(0,e)+s.slice(e+p.length),null!==n&&n>e&&(n=Math.max(e,n-p.length)),null!==r&&r>e&&(r=Math.max(e,r-p.length))}let a=l.getTextContent();if(i||s!==a){let t=rM();if(""===s){if(lh(null),d||u||g)l.remove();else{let e=r4();lI(l,"",t),setTimeout(()=>{e.update(()=>{l.isAttached()&&""===l.getTextContent()&&l.remove()})},20)}return}let i=l.getParent(),a=rA(),f=l.getTextContentSize(),c=lg(),h=l.getKey();if(l.isToken()&&!o||null!==c&&h===c&&!o||rr(a)&&(null!==i&&!i.canInsertTextBefore()&&0===a.anchor.offset||a.anchor.key===e.__key&&0===a.anchor.offset&&!l.canInsertTextBefore()&&!o||a.focus.key===e.__key&&a.focus.offset===f&&!l.canInsertTextAfter()&&!o))return void l.markDirty();if(!rr(t)||null===n||null===r)return void lI(l,s,t);if(t.setTextNodeRange(l,n,l,r),l.isSegmented()){let e=nZ(l.getTextContent());l.replace(e),l=e}lI(l,s,t)}}}function lI(e,t,n){if(e.setTextContent(t),rr(n)){let t=e.getKey(),r=!1;for(let i of["anchor","focus"]){let l=n[i];"text"===l.type&&l.key===t&&(l.offset=sd(e,l.offset,"clamp"),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function lP(e,t,n){let r=t[n]||!1;return"any"===r||r===e[n]}function lF(e){let t=e;for(;null!==t;){let e=t.getParent();if(null===e)break;if(im(e))return t;t=e}return null}function lR(e,t){let{anchor:n,focus:r}=e,i=n.key,l=n.offset,o=n.type,s=r.key,a=r.offset,u=r.type;if(eu(e),!im(t))return e;let f=lF(n.getNode());return ic(f)&&f.isShadowRoot()&&f.is(lF(r.getNode()))&&(n.set(i,l,o),r.set(s,a,u)),e}function lL(e,t){""===e.getAttribute(t)&&e.removeAttribute(t)}function lK(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;let i=e[t];if("string"==typeof i){let e=sb(i);return n[t]=e,e}return i}function lB(e,t,r,i,l){if(0===r.size)return;let o=i.__type,s=i.__key,a=t.get(o);void 0===a&&n(33,o);let u=a.klass,f=e.get(u);void 0===f&&(f=new Map,e.set(u,f));let d=f.get(s),c="destroyed"===d&&"created"===l;(void 0===d||c)&&f.set(s,c?"updated":l)}function lz(e,t,n){let r=e.getParent(),i=n,l=e;return null!==r&&(t&&0===n?(i=l.getIndexWithinParent(),l=r):t||n!==l.getChildrenSize()||(i=l.getIndexWithinParent()+1,l=r)),l.getChildAtIndex(t?i-1:i)}function l$(e){let t=lV(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function lW(e,t,...n){return function e(t,n,r,i){let l,o=lO(t);if(!rq)for(let e=0;e<o.length;e++)o[e]._updating||(o[e]._cascadeCount=0);for(let e=4;e>=0;e--)for(let t=0;t<o.length;t++){let s=o[t];if(t>0&&s._updating){l=s;break}let a=s._commands.get(n);if(void 0!==a){let t=a[e];if(t.size>0){let e=!1;if(ia(s,()=>{for(let n of t)if(n(r,i))return void(e=!0)}),e)return e}}}return l&&l.update(()=>{e(l,n,r,i)}),!1}(e,t,n[0],e)}function lU(e,t){let r=e._keyToDOMMap.get(t);return void 0===r&&n(75,t),r}function lH(e){let t=e.assignedSlot||e.parentElement;if(null!==t)return t;let n=e.parentNode;return l8(n)?n.host:null}function lj(e){return ls(e)?e:of(e)?e.ownerDocument:null}function lY(e){r1(),r4()._updateTags.add(e)}function lG(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function lJ(e){let t=lj(e);return t?t.defaultView:null}function lV(e){let t=e._window;return null===t&&n(78),t}function lq(e){return ic(e)&&e.isInline()||i_(e)&&e.isInline()}function lX(e){let t=e.getLatest();for(;null!==t&&!(null!==oH(t)&&ic(t));){let e=t.getParentOrThrow();if(lZ(e))return e;t=e}return t}function lQ(e){return ic(e)&&e.isShadowRoot()}function lZ(e){return im(e)||lQ(e)}function l0(e,t=!1){let n=e.constructor.clone(e,i4);return lf(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function l1(e){let t=r4(),r=e.getType(),i=i7(t,r);void 0===i&&n(200,e.constructor.name,r);let{replace:l,replaceWithKlass:o}=i;if(null!==l){let t=l(e),i=t.constructor;return null!==o?t instanceof o||n(201,o.name,o.getType(),i.name,i.getType(),e.constructor.name,r):t instanceof e.constructor&&i!==e.constructor||n(202,i.name,i.getType(),e.constructor.name,r),t.__key===e.__key&&n(203,e.constructor.name,r,i.name,i.getType()),t}return e}function l2(e,t){!im(e.getParent())||ic(t)||i_(t)||n(99)}function l3(e){let t=l_(e);return null===t&&n(63,e),t}function l4(e){if(!e||e.isInline())return!1;if(i_(e))return!0;
1if(ic(e)){if(e.isShadowRoot()){let t=e.getParent();return!(ic(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function l6(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let r=e.parentElement;null!==r&&r.removeChild(e)}function l5(e){return i?(e||window).getSelection():null}function l7(e){let t=lJ(e);return t?t.getSelection():null}function l8(e){return oc(e)&&"host"in e}let l9=[];function oe(e){let t=e.getRootNode();if(t===e||!l8(t))return l9;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!l8(e))break;n.push(e),r=e.host}return n}function*ot(e){let t,n=[e];for(;t=n.pop();){let e;yield*t.querySelectorAll('[data-lexical-editor="true"]');let r=(ls(t)?t:t.ownerDocument).createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;e=r.nextNode();)e.shadowRoot&&n.push(e.shadowRoot)}}function on(e){return null!==e?e.ownerDocument:document}function or(){let e=rG;return on(null!==e?e._rootElement:null)}function oi(e,t){if(null===t||"function"!=typeof e.getComposedRanges)return null;let n=oe(t);if(0===n.length)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(void 0!==t)return t}catch(e){}try{let t=r.apply(e,n)[0];if(void 0!==t)return t}catch(e){}return null}function ol(e,t){let n=oi(e,t);if(null!==n){let e=function(e){let t=e.startContainer.ownerDocument;if(null===t)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch(e){return null}}(n);if(null!==e)return e}return e.rangeCount>0?e.getRangeAt(0):null}function oo(e,t){let n=oi(e,t);return null===n?e:function(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:l}=e;return"backward"===t?{anchorNode:i,anchorOffset:l,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:l}}(n,e.direction)}function os(e){let t=e.getRootNode();return ls(t)||l8(t)?t.activeElement:null}function oa(e){let t=e.activeElement;for(;null!==t&&null!==t.shadowRoot;){let e=t.shadowRoot.activeElement;if(null===e)break;t=e}return t}function ou(e){let t=e.target;if(null!==t&&of(t)&&null!==t.shadowRoot&&"function"==typeof e.composedPath){let t=e.composedPath();if(t.length>0)return t[0]}return t}function of(e){return od(e)&&1===e.nodeType}function od(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function oc(e){return od(e)&&11===e.nodeType}let oh=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function og(e){return!(!of(e)||!e.style.display.startsWith("inline"))||oh.test(e.nodeName)}let o_=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function op(e){return(!of(e)||!e.style.display.startsWith("inline"))&&o_.test(e.nodeName)}function om(e){if(i_(e)&&!e.isInline())return!0;if(!ic(e)||lZ(e))return!1;let t=e.getFirstChild(),n=null===t||ik(t)||n0(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function oy(){return r4()}function oC(e=oy()){return e._config.dom||iZ}function ox(e,t,r=oy()){let i=oC(r).$getDOMSlot(e,t,r);return ic(e)&&(i instanceof P||n(344,e.getKey(),e.getType())),i}function oS(e,t,n=oy()){return la(ox(e,t,n).element)}let oT=new WeakMap,oN=new Map;function ov(e){if(!e._readOnly&&e.isEmpty())return oN;e._readOnly||n(192);let t=oT.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),oT.set(e,t)),t}function ok(e){let t=e.constructor.clone(e,i4);return t.afterCloneFrom(e),t}function ob(e,t){let n=e.getAttribute("data-lexical-indent");if(null!==n){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=Math.round((parseInt(e.style.paddingInlineStart,10)||0)/40);t.setIndent(r)}function oE(e,t){let n=t.getAttribute("dir");return"ltr"===n||"rtl"===n?e.setDirection(n):e}function oO(e,t){let n=t.style.textAlign;return n&&n in S?e.setFormat(n):e}function oM(e,t){e.__lexicalUnmanaged=!0,t&&void 0!==t.captureSelection&&(e.__lexicalCapturedSelection=t.captureSelection)}function oA(e){return!0===e.__lexicalUnmanaged}function ow(e,t){let n=e;for(;null!=n;){if(!0===n.__lexicalCapturedSelection)return!0;
1if(of(n)&&n.hasAttribute("data-lexical-slot")||void 0!==ly(n,t))break;n=lH(n)}return!1}function oD(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==nO[t]}let oI=new WeakMap,oP=Symbol("lexical.synthesizedGetType");function oF(e){let t=oI.get(e);if(t)return t;let r=null!=e.prototype&&b in e.prototype?e.prototype[b]():void 0,i=function(e){if(!(e===nO||e.prototype instanceof nO)){let t="<unknown>",r="<unknown>";try{t=e.getType()}catch(e){}try{i2.version&&(r=JSON.parse(i2.version))}catch(e){}n(290,e.name,t,r)}return e===ig||e===id||e===nO}(e),l=!i&&oD(e,"getType")?e.getType:void 0,o=!l||oP in l?void 0:l.call(e),s,a=o;if(r)if(o)s=r[o];else{for(let[e,t]of Object.entries(r))a=e,s=t;if(!s)for(let e of Object.getOwnPropertySymbols(r)){let t=r[e];if(t){s=t;break}}}if(!i&&a){if(!oD(e,"getType")){let t=function(){return this!==e?nO.getType.call(this):a};t[oP]=!0,e.getType=t}if(oD(e,"clone")||(e.clone=(t,n)=>{i3=t;let r=new e;return n!==i4&&r.afterCloneFrom(t),r}),oD(e,"importJSON")||(e.importJSON=s&&s.$importJSON||(t=>oL(e).updateFromJSON(t))),!oD(e,"importDOM")&&s){let{importDOM:t}=s;t&&(e.importDOM=()=>t)}}let u={klass:e,ownNodeConfig:s,ownNodeType:a};return oI.set(e,u),u}function*oR(e){for(let t=e;t&&(t===nO||nM(t.prototype));){let e=oF(t);yield e,t=e.ownNodeConfig&&e.ownNodeConfig.extends||oz(t)}}function oL(e){let t=oy();r1();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),r=new n.klass;return null===n.replace?r:l1(r)}let oK=(e,t)=>{let n=e;for(;null!=n&&!im(n);){if(t(n))return n;n=n.getParent()}return null};function oB(e,t){let r=[],i=e.__first;for(;null!==i;){let e=null===t?l_(i):t.get(i);null==e&&n(174),r.push(i),i=e.__next}return r}function oz(e){let t=Object.getPrototypeOf(e);if("function"==typeof t&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}let o$=new Map;function oW(e){return ic(e)||i_(e)}function oU(e){return ic(e)||i_(e)}function oH(e){let t=e.getLatest();return oU(t)?t.__slotHost:null}function oj(e){let t=oH(e);if(null===t)return null;let r=l_(t);return ic(r)||i_(r)||n(370),r}function oY(e){let t=oj(e);if(null===t)return null;let n=e.getLatest().__key;for(let[e,r]of oJ(t))if(r===n)return e;return null}function oG(e){let t=e.getLatest();for(;null!==t;){if(null!==oH(t))return t;t=t.getParent()}return null}function oJ(e){let t=e.getLatest();return oW(t)&&null!==t.__slots?t.__slots:o$}function oV(e){return Array.from(oJ(e).keys())}function oq(e,t){let n=oJ(e).get(t);return void 0===n?null:l_(n)}let oX=["__proto__","constructor","prototype"],oQ=Symbol("slotMapOwner");function oZ(e){let t=e.__slots;return null!==t&&t[oQ]===e||((t=new Map(t))[oQ]=e,e.__slots=t),t}let o0=new WeakMap,o1=[];function o2(e){let t="";for(let n of oV(e)){let r=oq(e,n);null!==r&&(t+=r.getTextContent())}return t}function o3(e,t,n){let r=n.get(e),i=n.get(t);return void 0!==r?void 0!==i?r-i:-1:void 0!==i?1:e<t?-1:+(e>t)}function o4(e,t){}let o6={next:"previous",previous:"next"};class o5{origin;constructor(e){this.origin=e}[Symbol.iterator](){return sS({hasNext:si,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return su(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return su(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(null===n?this.insert(e):n.replace(e,t)),this}splice(e,t,r="next"){let i=r===this.direction?t:Array.from(t).reverse(),l=this,o=this.getParentAtCaret(),s=new Map;for(let t=l.getAdjacentCaret();null!==t&&s.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();s.set(e.getKey(),e)}for(let e of i){if(s.size>0){let t=l.getNodeAtCaret();if(t)if(s.delete(t.getKey()),s.delete(e.getKey()),t.is(e)||l.origin.is(e));else{let n=e.getParent();n&&n.is(o)&&e.remove(),t.replace(e)}else null===t&&n(263,Array.from(s).join(" "))}else l.insert(e);l=su(e,this.direction)}for(let e of s.values())e.remove();return this}}class o7 extends o5{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:sc(e,this.direction)}getParentCaret(e="root"){return su(se(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=o9(this.direction);return su(this.getNodeAtCaret(),e)||sc(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof o7&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}let o8={root:im,shadowRoot:lZ};function o9(e){return o6[e]}function se(e,t="root"){return null===e||o8[t](e)?null:null===oH(e)?e:null}class st extends o5{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:su(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return ic(this.origin)?sc(this.origin,this.direction):null}getParentCaret(e="root"){return su(se(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=o9(this.direction);return su(this.getNodeAtCaret(),e)||sc(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof st&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof st||e instanceof sn)&&this.direction===e.direction&&this.origin.is(e.origin)}}class sn extends o5{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:sf(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return su(se(this.getParentAtCaret(),e),this.direction)}getFlipped(){return sf(this.origin,o9(this.direction),this.offset)}isSamePointCaret(e){return e instanceof sn&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof st||e instanceof sn)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return su(this.origin,this.direction)}}function sr(e){return e instanceof sn}function si(e){return e instanceof st}function sl(e){return e instanceof o7}let so={next:class extends sn{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends sn{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},ss={next:class extends st{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends st{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},sa={next:class extends o7{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends o7{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function su(e,t){return e?new ss[t](e):null}function sf(e,t,n){return e?new so[t](e,sd(e,n)):null}function sd(e,t,n="error"){let i=e.getTextContentSize(),l="next"===t?i:"previous"===t?0:t;return(l<0||l>
1i)&&("clamp"!==n&&r(284,String(t),String(i),e.getKey()),l=l<0?0:i),l}function sc(e,t){return ic(e)?new sa[t](e):null}function sh(e){return e&&e.getChildCaret()||e}function sg(e){return e&&sh(e.getAdjacentCaret())}class s_{type="node-caret-range";direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new s_(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return sr(t)?function(e,t){let{direction:n,origin:r}=e;return new sp(e,sd(r,"focus"===t?o9(n):n)-e.offset)}(t,e):null},t=e("anchor"),n=e("focus");if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[new sp(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){let t=sr(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=sr(n),i=t=>t.isSameNodeCaret(n)?null:sg(t)||t.getParentCaret(e);return sS({hasNext:e=>null!==e&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class sp{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return sf(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}}function sm(e,t){return e.direction===t?e:e.getFlipped()}function sy(e){return sx(e,sm(sc(lT(),o9(e.direction)),e.direction))}function sC(e){return sx(e,e)}function sx(e,t){return e.direction!==t.direction&&n(265),new s_(e,t,e.direction)}function sS(e){let{initial:t,hasNext:n,step:r,map:i}=e,l=t;return{[Symbol.iterator](){return this},next(){if(!n(l))return{done:!0,value:void 0};let e={done:!1,value:i(l)};return l=r(l),e}}}function sT(e,t){let r=sk(e.origin,t.origin);switch(null===r&&n(275,e.origin.getKey(),t.origin.getKey()),r.type){case"same":{let n="text"===e.type,r="text"===t.type;return n&&r?Math.sign(e.offset-t.offset):e.type===t.type?0:n?-1:r?1:"child"===e.type?-1:1}case"ancestor":return"child"===e.type?-1:1;case"descendant":return"child"===t.type?1:-1;case"branch":return sN(r)}}function sN(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,l=t,o=n;for(;l&&o;l=l.getNextSibling(),o=o.getNextSibling()){if(l.__key===i)return -1;if(o.__key===r)return 1}return null===l?1:-1}function sv(e){return ic(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function sk(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let r=new Map;for(let[t,n]=sv(e);t;n=t,t=t.getParent())r.set(t,n);for(let[i,l]=sv(t);i;l=i,i=i.getParent()){let o=r.get(i);if(void 0!==o)return null===o?(i.is(e)||n(276),{commonAncestor:i,type:"ancestor"}):null===l?(i.is(t)||n(277),{commonAncestor:i,type:"descendant"}):((ic(o)||o.is(e))&&(ic(l)||l.is(t))&&i.is(o.getParent())&&i.is(l.getParent())||n(278),{a:o,b:l,commonAncestor:i,type:"branch"})}return null}function sb(...e){let t=[];for(let n of e)if(n&&"string"==typeof n)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function sE(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}e.s(["$addUpdateTag",0,lY,"$applyNodeReplacement",0,l1,"$assumeActiveEditor",0,function(e){null!==r3()&&null===rG&&(rG=e),rG!==e&&r(378)},"$caretFromPoint",0,iM,"$caretRangeFromSelection",0,iI,"$cloneWithProperties",0,ok,"$cloneWithPropertiesEphemeral",0,function(e){var t;return(t=ok(e))[nk]=!0,t},"$comparePointCaretNext",0,sT,"$copyNode",0,l0,"$create",0,oL,"$createLineBreakNode",0,iv,"$createNodeSelection",0,rE,"$createParagraphNode",0,iV,"$createPoint",0,n5,"$createRangeSelection",0,rb,"$createRangeSelectionFromDom",0,function(e,t){return rO(null,e,t,null)},"$createTabNode",0,n3,"$createTextNode",0,nZ,"$extendCaretToRange",0,sy,"$findMatchingParent",0,oK,"$flushSyncAfterUpdate",0,function(){let e=r3();r1(),e._flushSync=!0},"$formatText",0,rs,"$fullReconcile",0,r6,"$generateNodesFromRawText",0,rz,"$getAdjacentChildCaret",0,sg,"$getAdjacentSiblingOrParentSiblingCaret",0,function(e,t="root"){let n=0,r=e,i=sg(r);for(;null===i;){if(n--,!(i=r.getParentCaret(t)))return null;i=sg(r=i)}return i&&[i,n]},"$getCaretRange",0,sx,"$getCaretRangeInDirection",0,iz,"$getCharacterOffsets",0,ru,"$getChildCaret",0,sc,"$getChildCaretAtIndex",0,i$,"$getChildCaretOrSelf",0,sh,"$getCollapsedCaretRange",0,sC,"$getCommonAncestor",0,sk,"$getDOMSlot",0,ox,"$getDOMTextNode",0,oS,"$getDocument",0,or,"$getEditor",0,oy,"$getEditorDOMRenderConfig",0,oC,"$getNearestNodeFromDOMNode",0,lC,"$getNodeByKey",0,l_,"$getNodeByKeyOrThrow",0,l3,"$getNodeFromDOMNode",0,lp,"$getPreviousSelection",0,rA,"$getRoot",0,lT,"$getSelection",0,rM,"$getSelectionSlotFrame",0,function(e){if(null===e)return null;let t=rr(e)?e.anchor.getNode():e.getNodes()[0]??null;return null===t?null:oG(t)},"$getSiblingCaret",0,su,"$getSlot",0,oq,"$getSlotFrame",0,oG,"$getSlotHost",0,oj,"$getSlotNameWithinHost",0,oY,"$getSlotNames",0,oV,"$getState",0,q,"$getTextPointCaret",0,sf,"$hasAncestor",0,lG,"$insertN
1odeToNearestRootAtCaret",0,ij,"$insertNodes",0,function(e){let t=rM()||rA();null===t&&(t=lT().selectEnd()),t.insertNodes(e)},"$isBlockElementNode",0,rv,"$isBlockFullySelected",0,iY,"$isChildCaret",0,sl,"$isDecoratorNode",0,i_,"$isEditorState",0,function(e){return e instanceof ix},"$isElementNode",0,ic,"$isExtendableTextPointCaret",0,iB,"$isInlineElementOrDecoratorNode",0,lq,"$isLeafNode",0,function(e){return n0(e)||ik(e)||i_(e)},"$isLexicalNode",0,nM,"$isLineBreakNode",0,ik,"$isNodeSelection",0,rl,"$isParagraphNode",0,iq,"$isRangeSelection",0,rr,"$isRootNode",0,im,"$isRootOrShadowRoot",0,lZ,"$isSelectionCapturedInDecoratorInput",0,i9,"$isShadowRootNode",0,lQ,"$isSiblingCaret",0,si,"$isSlotHost",0,oW,"$isTabNode",0,n4,"$isTextNode",0,n0,"$isTextPointCaret",0,sr,"$isTokenOrSegmented",0,ll,"$needsBlockCursorBeside",0,l4,"$normalizeCaret",0,iK,"$normalizeSelection__EXPERIMENTAL",0,eu,"$parseSerializedNode",0,function(e){return ie(e,r4()._nodes)},"$removeTextFromCaretRange",0,iL,"$rewindSiblingCaret",0,iP,"$selectAll",0,function(e){let t=lT();if(rr(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(im(r))return t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),lR(e,r),e;let i=r.getTopLevelElementOrThrow(),l=i.getParent();return null===l?ic(i)&&(t.set(i.getKey(),0,"element"),n.set(i.getKey(),i.getChildrenSize(),"element"),lR(e,i)):(t.set(l.getKey(),0,"element"),n.set(l.getKey(),l.getChildrenSize(),"element"),lR(e,l)),e}{let e=t.select(0,t.getChildrenSize());return lv(lR(e,t)),e}},"$setDirectionFromDOM",0,oE,"$setFormatFromDOM",0,oO,"$setPointFromCaret",0,iA,"$setSelection",0,lv,"$setSelectionFromCaretRange",0,iw,"$setState",0,function(e,t,n){let r;if(r1(),"function"==typeof n){let i=e.getLatest(),l=q(i,t);if(r=n(l),t.isEqual(l,r))return i}else r=n;let i=e.getWritable();return Z(i).updateFromKnown(t,r),i},"$setTextFormat",0,function(e,t){let n=[];for(let[e,r]of Object.entries(t))"boolean"==typeof r&&n.push([e,r]);0!==n.length&&ro(e,e=>{for(let[t,r]of n)e=lu(e,t,r?C[t]:0);return e})},"$splitAtPointCaretNext",0,iH,"$updateDOMSelection",0,rK,"ArtificialNode__DO_NOT_USE",0,iS,"BLUR_COMMAND",0,tj,"CAN_REDO_COMMAND",0,tW,"CAN_UNDO_COMMAND",0,tU,"CAN_USE_BEFORE_INPUT",0,a,"CAN_USE_DOM",0,i,"CLEAR_EDITOR_COMMAND",0,tz,"CLEAR_HISTORY_COMMAND",0,t$,"CLICK_COMMAND",0,e9,"COMMAND_PRIORITY_BEFORE_CRITICAL",0,-4,"COMMAND_PRIORITY_BEFORE_EDITOR",0,-8,"COMMAND_PRIORITY_CRITICAL",0,4,"COMMAND_PRIORITY_EDITOR",0,0,"COMMAND_PRIORITY_HIGH",0,3,"COMMAND_PRIORITY_LOW",0,1,"COMMAND_PRIORITY_NORMAL",0,2,"COMPOSITION_END_TAG",0,nF,"COMPOSITION_START_COMMAND",0,tn,"COMPOSITION_START_TAG",0,nP,"CONTROLLED_TEXT_INSERTION_COMMAND",0,ts,"CONTROL_OR_META",0,tG,"COPY_COMMAND",0,tL,"CUT_COMMAND",0,tK,"CUT_TAG",0,"cut","DEFAULT_EDITOR_DOM_CONFIG",0,iZ,"DELETE_CHARACTER_COMMAND",0,ti,"DELET
1E_LINE_COMMAND",0,td,"DELETE_WORD_COMMAND",0,tf,"DRAGOVER_COMMAND",0,tF,"DRAGSTART_COMMAND",0,tP,"DROP_COMMAND",0,tD,"DecoratorNode",0,ig,"ElementNode",0,id,"FOCUS_COMMAND",0,tH,"FORMAT_ELEMENT_COMMAND",0,tI,"FORMAT_TEXT_COMMAND",0,tc,"HISTORIC_TAG",0,"historic","HISTORY_MERGE_TAG",0,nA,"HISTORY_PUSH_TAG",0,"history-push","INDENT_CONTENT_COMMAND",0,tA,"INSERT_LINE_BREAK_COMMAND",0,tl,"INSERT_PARAGRAPH_COMMAND",0,to,"INSERT_TAB_COMMAND",0,tM,"INTERNAL_$expandSelectionToWholeDocument",0,rd,"INTERNAL_$isBlock",0,om,"IS_APPLE",0,o,"IS_APPLE_WEBKIT",0,g,"IS_BOLD",0,1,"IS_CODE",0,16,"IS_FIREFOX",0,s,"IS_HIGHLIGHT",0,128,"IS_IOS",0,u,"IS_ITALIC",0,2,"IS_SAFARI",0,d,"IS_STRIKETHROUGH",0,4,"IS_SUBSCRIPT",0,32,"IS_SUPERSCRIPT",0,64,"IS_UNDERLINE",0,8,"KEY_ARROW_DOWN_COMMAND",0,tT,"KEY_ARROW_LEFT_COMMAND",0,tC,"KEY_ARROW_RIGHT_COMMAND",0,tm,"KEY_ARROW_UP_COMMAND",0,tS,"KEY_BACKSPACE_COMMAND",0,tk,"KEY_DELETE_COMMAND",0,tE,"KEY_DOWN_COMMAND",0,tp,"KEY_ENTER_COMMAND",0,tN,"KEY_ESCAPE_COMMAND",0,tb,"KEY_SPACE_COMMAND",0,tv,"KEY_TAB_COMMAND",0,tO,"LineBreakNode",0,iT,"MOVE_TO_END",0,ty,"MOVE_TO_START",0,tx,"OUTDENT_CONTENT_COMMAND",0,tw,"PASTE_COMMAND",0,ta,"PASTE_TAG",0,"paste","ParagraphNode",0,iG,"REDO_COMMAND",0,t_,"REMOVE_TEXT_COMMAND",0,tu,"RootNode",0,ip,"SELECTION_CHANGE_COMMAND",0,e7,"SELECTION_INSERT_CLIPBOARD_NODES_COMMAND",0,e8,"SELECT_ALL_COMMAND",0,tB,"SET_TEXT_FORMAT_COMMAND",0,th,"SKIP_DOM_SELECTION_TAG",0,nD,"SKIP_SCROLL_INTO_VIEW_TAG",0,nw,"SKIP_SELECTION_FOCUS_TAG",0,nI,"TEXT_TYPE_TO_FORMAT",0,C,"TabNode",0,n2,"TextNode",0,nj,"UNDO_COMMAND",0,tg,"addClassNamesToElement",0,function(e,...t){let n=sb(...t);n.length>0&&e.classList.add(...n)},"buildImportMap",0,function(e){return e},"compileKeyboardShortcuts",0,tQ,"createCommand",0,e5,"createEditor",0,function(e){var t,r;let i,l,o,s,a=e||{},u=rG,f=a.theme||{},d=void 0===e?u:a.parentEditor||null,c=a.disableEvents||!1,h=iC(),g=a.namespace||(null!==d?d._config.namespace:lM()),_=a.editorState,p=[ip,nj,iT,n2,iG,iS,...a.nodes||[]],{onError:m,onWarn:y,html:C}=a,x=void 0===a.editable||a.editable;if(void 0===e&&null!==u)i=u._nodes;else{i=new Map;for(let e=0;e<p.length;e++){let t=p[e],r=null,l=null;if(t&&"object"==typeof t){let e=t;t=e.replace,r=e.with,l=e.withKlass||null}if("function"!=typeof t||!t.prototype||!(t===nO||t.prototype instanceof nO)){let r="<unknown>";try{r=JSON.parse(R)}catch(e){}n(365,String(e-p.length+(a.nodes?a.nodes.length:0)),"function"==typeof t?`${t.name}${"function"==typeof t.getType?` (type ${String(t.getType())})`:""}`:String(t),String(r))}oF(t);let o=t.getType(),s=function(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of oR(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}(t);i.set(o,{exportDOM:C&&C.export?C.export.get(t):void 0,klass:t,replace:r,replaceWithKlass:l,sharedNodeState:function(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of oR("function"==typeof e?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;"stateConfig"in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}(p[e]),transforms:s})}}let S=new i2(h,d,i,{disableEvents:c,dom:{...iZ,...e&&e.dom},namespace:g,theme:f},m||console.error,y||iX,(t=i,r=C?C.import:void 0,l=new Map,o=new Set,s=e=>{Object.keys(e).forEach(t=>{let n=l.get(t);void 0===n&&(n=[],l.set(t,n)),n.push(e[t])})},t.forEach(e=>{let t=e.klass.importDOM;if(null==t||o.has(t))return;o.add(t);let n=t.call(e.klass);null!==n&&s(n)}),r&&s(r),l),x,e);return void 0!==_&&(S._pendingEditorState=_,S._dirtyType=2),S.registerCommand(te,no,0),S.registerCommand(tt,ns,0),S.registerCommand(tn,na,0),S.registerCommand(tr,nu,0),S.registerCommand(tp,nm,0),S},"createRefCountedRegistry",0,tZ,"createState",0,function(e,t){return new V(e,t)},"findAllLexicalElementsDeep",0,ot,"flipDirection",0,o9,"getActiveElement",0,os,"getActiveElementDeep",0,oa,"getComposedEventTarget",0,ou,"getDOMSelection",0,l5,"getDOMSelectionFromTarget",0,l7,"getDOMSelectionPoints",0,oo,"getDOMSelectionRange",0,ol,"getDOMShadowRoots",0,oe,"getDOMTextNode",0,la,"getEditorPropertyFromDOMNode",0,lr,"getNearestEditorFromDOMNode",0,ln,"getParentElement",0,lH,"getRegisteredSubtypeMap",0,function(e){let t=new Map,n=new Map;for(let r of e){let{ownNodeType:e}=oF(r);e&&(n.set(e,r),t.set(e,new Set))}for(let[e,r]of n)for(let{ownNodeType:n}of oR(r)){let r=n&&t.get(n);r&&r.add(e)}return t},"getRootOwnerDocument",0,on,"getStaticNodeConfig",0,oF,"getStyleObjectFromCSS",0,nR,"isBlockDomNode",0,op,"isCurrentlyReadOnlyMode",0,r0,"isDOMDocumentNode",0,ls,"isDOMNode",0,od,"isDOMShadowRoot",0,l8,"isDOMTextNode",0,lo,"isDocumentFragment",0,oc,"isExactShortcutMatch",0,function(e,t,n){if(!(lP(e,n,"altKey")&&lP(e,n,"ctrlKey")&&lP(e,n,"shiftKey")&&lP(e,n,"metaKey")))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;
1if(t.length>1||1===e.key.length&&127>=e.key.charCodeAt(0))return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(t))return e.code===`Digit${t}`;let r="Key"+t.toUpperCase();return e.code===r},"isHTMLAnchorElement",0,function(e){return of(e)&&"A"===e.tagName},"isHTMLElement",0,of,"isHTMLTableRowElement",0,function(e){return of(e)&&"TR"===e.tagName},"isInlineDomNode",0,og,"isLastChildInBlockNode",0,iE,"isLexicalEditor",0,lt,"isOnlyChildInBlockNode",0,ib,"isSelectionWithinEditor",0,le,"iterStaticNodeConfigChain",0,oR,"keyboardEventMaskForPlatform",0,function(e,t){let n=e[k];return n&&t!==o?{...e,ctrlKey:e[n],[n]:e.ctrlKey}:e},"makeStepwiseIterator",0,sS,"mergeRegister",0,sE,"normalizeClassNames",0,sb,"registerEventListener",0,t0,"registerEventListeners",0,function(e,t,n){return sE(...Object.entries(t).map(([t,r])=>t0(e,t,r,n)))},"removeClassNamesFromElement",0,function(e,...t){let n=sb(...t);n.length>0&&e.classList.remove(...n)},"setDOMStyleFromCSS",0,nL,"setDOMUnmanaged",0,oM,"setNodeIndentFromDOM",0,ob,"shallowMergeConfig",0,function(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e},"stopLexicalPropagation",0,nS,"toggleTextFormatType",0,lu,"tokenizeRawText",0,rB])}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.