PageSourceSearch

https://www.aipub.io/_next/static/chunks/0a.y50totvedd.js

js aipub.io collected 2026-10-02 01:57:36 UTC 227,622 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,615227,e=>{"use strict";let t=(0,e.i(456420).default)("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]);e.s(["MessageCircle",0,t],615227)},980885,e=>{"use strict";let t,n,r;var i=e.i(843476),l=e.i(271645);function o(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let n of(r.append("code",e),t))r.append("v",n);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function s(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let n of(r.append("code",e),t))r.append("v",n);n.search=r.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 a="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,u=a&&"documentMode"in document?document.documentMode:null,d=a&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),f=a&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),c=!(!a||!("InputEvent"in window)||u)&&"getTargetRanges"in new window.InputEvent("input"),h=a&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,g=a&&/Android/.test(navigator.userAgent),p=a&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!g,m=a&&/^(?=.*Chrome).*/i.test(navigator.userAgent),_=a&&g&&m,y=a&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&d&&!m,x=p||h||y?" ":"​",v=f?" ":x,S="֑-߿יִ-﷽ﹰ-ﻼ",C="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",b=(RegExp("^[^"+C+"]*["+S+"]"),RegExp("^[^"+S+"]*["+C+"]"),{bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512}),N={directionless:1,unmergeable:2},k={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"},E={normal:0,segmented:2,token:1},w={0:"normal",2:"segmented",1:"token"},O="$config";class M{_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]()}}let A=!1,D=0;function P(e){D=e.timeStamp}function F(e,t,n){let r="BR"===e.nodeName,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&void 0!==ir(e,n)}function L(e,t,n){A=!0;let r=performance.now()-D>100;try{rx(e,()=>{let i=nG()||e.getEditorState().read(()=>{let e=nG();return null!==e?e.clone():null}),l=new Map,o=e.getRootElement(),s=e._editorState,a=e._blockCursorElement,u=!1,d="";for(let n=0;n<t.length;n++){let c=t[n],h=c.type,g=c.target,p=function(e,t,n,r){var i;for(let l=e;l&&(i=l,!0!==i.__lexicalUnmanaged);l=iA(l)){let e=ir(l,t);if(void 0!==e){let t=ie(e,n);if(t)return rT(t)||!iJ(l)?void 0:[l,t]}else if(l===r)return[r,ia(n)]}}(g,e,s,o);if(!p)continue;let[m,_]=p;if("characterData"===h)r&&nb(_)&&r0(g)&&function(e,t,n){if(nP(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return r0(t)&&n.isAttached()}(i,g,_)&&function(e,t,n){let r=ij(iI(n)),i=null,l=null;null!==r&&r.anchorNode===e&&(i=r.anchorOffset,l=r.focusOffset);let o=e.nodeValue;null!==o&&i_(t,o,i,l,!1)}(g,_,e);else if("childList"===h){u=!0;let t=c.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=it(r),l=r.parentNode;if(null!=l&&r!==a&&null===i&&!F(r,l,e)){if(f){let e=(iJ(r)?r.innerText:null)||r.nodeValue;e&&(d+=e)}l.removeChild(r)}}let n=c.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(F(r,g,e)||a===r)&&(g.appendChild(r),t++)}r!==t&&l.set(m,_)}}}if(l.size>0)for(let[t,n]of l)n.reconcileObservedMutation(t,e);let c=n.takeRecords();if(c.length>0){for(let t=0;t<c.length;t++){let n=c[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||F(n,i,e)||l.removeChild(n)}}n.takeRecords()}null!==i&&(u&&iu(i),f&&iw(e)&&i.insertRawText(d))})}finally{A=!1}}function I(e){let t=e._observer;null!==t&&L(e,t.takeRecords(),t)}function R(e){0===D&&iI(e).addEventListener("textInput",P,!0),e._observer=new MutationObserver((t,n)=>{L(e,t,n)})}class z{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||H).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}}function K(e,t){return new z(e,t)}function B(e,t,n="latest"){let r=("latest"===n?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function W(e,t,n){let r;if(ri(),"function"==typeof n){let i=e.getLatest(),l=B(i,t);if(r=n(l),t.isEqual(l,r))return i}else r=n;let i=e.getWritable();return j(i).updateFromKnown(t,r),i}class ${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 J(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 $(e,t,function(e,t,n){let r;if(n)for(let[i,l]of Object.entries(n)){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=J(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){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 j(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new $(t,U(t));return t.__state=n,n}function U(e){return e.__state?e.__state.sharedNodeState:rU(iX(),e.getType()).sharedNodeState}function J(e){if(e)for(let t in e)return e}function H(e){return e}
1function V(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;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function q(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 Y(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function G(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&&V(n,e,t)||t&&V(n,t,e)||e&&q(n,e,t)||t&&q(n,t,e))}(a,u))}function X(e,t){let n=e.mergeWithSibling(t),r=rs()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Q(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&nb(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){G(t,r)&&(r=X(t,r));break}t.remove()}for(;null!==(n=r.getNextSibling())&&nb(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){G(r,n)&&(r=X(r,n));break}n.remove()}}else r.remove()}function Z(e){return ee(e.anchor),ee(e.focus),e}function ee(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),nb(t)){e.set(t.__key,n?t.getTextContentSize():0,"text",!0);break}if(!rb(t))break;e.set(t.__key,n?t.getChildrenSize():0,"element",!0)}}let et,en,er,ei,el,eo,es,ea,eu,ed,ef,ec="",eh=null,eg=null,ep=!1,em=!1;function e_(e,t){let n=es.get(e);if(null!==t){let n=eM(e);n.parentNode===t&&t.removeChild(n)}if(ea.has(e)||en._keyToDOMMap.delete(e),rb(n)){let e=i7(n,es);ey(e,0,e.length-1,null)}void 0!==n&&ik(ed,er,ei,n,"destroyed")}function ey(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];void 0!==t&&e_(t,r)}}function ex(e,t){e.setProperty("text-align",t)}function ev(e,t){let n=et.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)}if(0===t)return void e.style.setProperty("padding-inline-start","");let r=getComputedStyle(en._rootElement||e).getPropertyValue("--lexical-indent-base-value")||"40px";e.style.setProperty("padding-inline-start",`calc(${t} * ${r})`)}function eS(e,t){let n=e.style;0===t?ex(n,""):1===t?ex(n,"left"):2===t?ex(n,"center"):3===t?ex(n,"right"):4===t?ex(n,"justify"):5===t?ex(n,"start"):6===t&&ex(n,"end")}function eC(e,t){let n=function(e){let t=e.__dir;if(null!==t)return t;if(rw(e))return null;let n=e.getParentOrThrow();return rw(n)&&null===n.__dir?"auto":null}(t);null!==n?e.dir=n:e.removeAttribute("dir")}function eb(e,t){var n;let r,i=ea.get(e);void 0===i&&o(60);let l=ef.$createDOM(i,en);if(r=(n=en)._keyToDOMMap,l[`__lexicalKey_${n._key}`]=e,r.set(e,l),nb(i)?l.setAttribute("data-lexical-text","true"):rT(i)&&l.setAttribute("data-lexical-decorator","true"),rb(i)){let e=i.__indent,t=i.__size;eC(l,i),0!==e&&ev(l,e),0!==t&&eN(i7(i,ea),i,0,t-1,ef.$getDOMSlot(i,l,en));let n=i.__format;0!==n&&eS(l,n),i.isInline()||eT(null,i,l)}else{let t=i.getTextContent();if(rT(i)){let t=i.decorate(en,et);null!==t&&eE(e,t),l.contentEditable="false"}ec+=t}return null!==t&&t.insertChild(l),ef.$decorateDOM(i,null,l,en),ik(ed,er,ei,i,"created"),l}function eN(e,t,n,r,i){let l=ec;ec="";let o=n;for(;o<=r;++o){eb(e[o],i);let t=ea.get(e[o]);null!==t&&nb(t)?null===eh&&(eh=t.getFormat(),eg=t.getStyle()):rb(t)&&o<r&&!t.isInline()&&(ec+="\n\n")}i.element.__lexicalTextContent=ec,ec=l+ec}function ek(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return no(e)?"line-break":rT(e)&&e.isInline()?"decorator":null}return"empty"}return null}function eT(e,t,n){let r=ek(e,es),i=ek(t,ea);r!==i&&ef.$getDOMSlot(t,n,en).setManagedLineBreak(i)}function eE(e,t){let n=en._pendingDecorators,r=en._decorators;if(null===n){if(r[e]===t)return;n=il(en)}n[e]=t}function ew(e){let t=e.nextSibling;return null!==t&&t===en._blockCursorElement&&(t=t.nextSibling),t}function eO(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function eM(e){let t=eu.get(e);return void 0===t&&o(75,e),t}function eA(e){return{type:e}}let eD=eA("SELECTION_CHANGE_COMMAND"),eP=eA("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),eF=eA("CLICK_COMMAND"),eL=eA("BEFORE_INPUT_COMMAND"),eI=eA("INPUT_COMMAND"),eR=eA("COMPOSITION_START_COMMAND"),ez=eA("COMPOSITION_END_COMMAND"),eK=eA("DELETE_CHARACTER_COMMAND"),eB=eA("INSERT_LINE_BREAK_COMMAND"),eW=eA("INSERT_PARAGRAPH_COMMAND"),e$=eA("CONTROLLED_TEXT_INSERTION_COMMAND"),ej=eA("PASTE_COMMAND"),eU=eA("REMOVE_TEXT_COMMAND"),eJ=eA("DELETE_WORD_COMMAND"),eH=eA("DELETE_LINE_COMMAND"),eV=eA("FORMAT_TEXT_COMMAND"),eq=eA("UNDO_COMMAND"),eY=eA("REDO_COMMAND"),eG=eA("KEYDOWN_COMMAND"),eX=eA("KEY_ARROW_RIGHT_COMMAND"),eQ=eA("MOVE_TO_END"),eZ=eA("KEY_ARROW_LEFT_COMMAND"),e0=eA("MOVE_TO_START"),e1=eA("KEY_ARROW_UP_COMMAND"),e2=eA("KEY_ARROW_DOWN_COMMAND"),e3=eA("KEY_ENTER_COMMAND"),e5=eA("KEY_SPACE_COMMAND"),e6=eA("KEY_BACKSPACE_COMMAND"),e4=eA("KEY_ESCAPE_COMMAND"),e9=eA("KEY_DELETE_COMMAND"),e7=eA("KEY_TAB_COMMAND"),e8=eA("INSERT_TAB_COMMAND"),te=eA("INDENT_CONTENT_COMMAND"),tt=eA("OUTDENT_CONTENT_COMMAND"),tn=eA("DROP_COMMAND"),tr=eA("FORMAT_ELEMENT_COMMAND"),ti=eA("DRAGSTART_COMMAND"),tl=eA("DRAGOVER_COMMAND"),to=eA("DRAGEND_COMMAND"),ts=eA("COPY_COMMAND"),ta=eA("CUT_COMMAND"),tu=eA("SELECT_ALL_COMMAND"),td=eA("CLEAR_EDITOR_COMMAND"),tf=eA("CLEAR_HISTORY_COMMAND"),tc=eA("CAN_REDO_COMMAND"),th=eA("CAN_UNDO_COMMAND"),tg=eA("FOCUS_COMMAND"),tp=eA("BLUR_COMMAND"),tm=eA
1("KEY_MODIFIER_COMMAND"),t_=Object.freeze({}),ty=[["keydown",function(e,t){tx=e.timeStamp,tv=e.key,t.isComposing()||iO(t,eG,e)}],["pointerdown",function(e,t){let n=e.target,r=e.pointerType;iH(n)&&"touch"!==r&&"pen"!==r&&0===e.button&&rx(t,()=>{rT(ii(n))||(tT=!0)})}],["compositionstart",function(e,t){iO(t,eR,e)}],["compositionend",function(e,t){f?tw=!0:!h&&(p||y)?(tO=!0,tM=e.data):iO(t,ez,e)}],["input",function(e,t){e.stopPropagation(),rx(t,()=>{t.dispatchCommand(eI,e)},{event:e}),tC=null}],["click",function(e,t){rx(t,()=>{let n=nG(),r=ij(iI(t)),i=nX();if(r){if(nP(n)){let t=n.anchor,l=t.getNode();if("element"===t.type&&0===t.offset&&n.isCollapsed()&&!rw(l)&&1===is().getChildrenSize()&&l.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(3===e.detail&&!n.isCollapsed()&&l!==n.focus.getNode()){let e=i9(l,e=>rb(e)&&!e.isInline());rb(e)&&e.select(0)}}else if("touch"===e.pointerType||"pen"===e.pointerType){let n=r.anchorNode;(iJ(n)||r0(n))&&iu(nY(i,r,t,e))}}iO(t,eF,e)})}],["cut",t_],["copy",t_],["dragstart",t_],["dragover",t_],["dragend",t_],["paste",t_],["focus",t_],["blur",t_],["drop",t_]];c&&ty.push(["beforeinput",(e,t)=>{let n;"deleteCompositionText"===(n=e.inputType)||f&&iw(t)||"insertCompositionText"!==n&&iO(t,eL,e)}]);let tx=0,tv=null,tS=0,tC=null,tb=new WeakMap,tN=new WeakMap,tk=!1,tT=!1,tE=!1,tw=!1,tO=!1,tM="",tA=null,tD=[0,"",0,"root",0];function tP(e,t,n,r,i){let l=e.anchor,o=e.focus,s=l.getNode(),a=rs(),u=ij(iI(a)),d=null!==u?u.anchorNode:null,f=l.key,h=a.getElementByKey(f),g=n.length;return f!==o.key||!nb(s)||(!i&&(!c||tS<r+50)||s.isDirty()&&g<2||ic(n))&&l.offset!==o.offset&&!s.isComposing()||rZ(s)||s.isDirty()&&g>1||(i||!c)&&null!==h&&!s.isComposing()&&d!==r2(h)||null!==u&&null!==t&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!s.isComposing()&&(s.getFormat()!==e.format||s.getStyle()!==e.style)||function(e,t){let n;if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let r=e.anchor.offset,i=t.getParentOrThrow(),l=rQ(t);return 0===r?!t.canInsertTextBefore()||!i.canInsertTextBefore()&&!t.isComposing()||l||(nb(n=t.getPreviousSibling())||rb(n)&&n.isInline())&&!n.canInsertTextAfter():r===t.getTextContentSize()&&(!t.canInsertTextAfter()||!i.canInsertTextAfter()&&!t.isComposing()||l)}(e,s)}function tF(e,t){return r0(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function tL(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:l,focusOffset:s}=e;tk&&(tk=!1,tF(r,i)&&tF(l,s)&&!tA)||rx(t,()=>{if(!n)return void iu(null);if(!rq(t,r,l))return;let a=nG();if(tA&&nP(a)&&a.isCollapsed()){let e=a.anchor,t=tA.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&iu(a=tA.clone())}if(tA=null,nP(a)){let n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);let i=iI(t).event,l=i?i.timeStamp:performance.now(),[s,u,d,f,c]=tD,h=is(),g=!1===t.isComposing()&&""===h.getTextContent();if(l<c+200&&n.offset===d&&n.key===f)tI(a,s,u);else if("text"===n.type)nb(r)||o(141),tR(a,r);else if("element"===n.type&&!g){rb(r)||o(259);let e=n.getNode();e.isEmpty()?tI(a,e.getTextFormat(),e.getTextStyle()):tI(a,a.format,"")}}else{let e=n.key,t=a.focus.key,r=a.getNodes(),l=r.length,o=a.isBackward(),u=o?s:i,d=o?i:s,f=o?t:e,c=o?e:t,h=2047,g=!1;for(let e=0;e<l;e++){let t=r[e],n=t.getTextContentSize();if(nb(t)&&0!==n&&(0!==e||t.__key!==f||u!==n)&&(e!==l-1||t.__key!==c||0!==d)&&(g=!0,0==(h&=t.getFormat())))break}a.format=g?h:0}}iO(t,eD,void 0)})}function tI(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function tR(e,t){tI(e,t.getFormat(),t.getStyle())}function tz(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return 0===t.length?null:t[0]}function tK(e){var t;let n=e.inputType,r=tz(e),i=rs(),l=nG();if("deleteContentBackward"===n){if(null===l){let e=nX();if(!nP(e))return!0;iu(e.clone())}if(nP(l)){let n=l.anchor.key===l.focus.key;if(t=e.timeStamp,"MediaLast"===tv&&t<tx+30&&i.isComposing()&&n){if(r7(null),tx=0,setTimeout(()=>{rx(i,()=>{r7(null)})},30),nP(l)){let e=l.anchor.getNode();e.markDirty(),nb(e)||o(142),tR(l,e)}}else{r7(null),e.preventDefault();let t=l.anchor.getNode(),r=t.getTextContent(),o=t.canInsertTextAfter(),s=0===l.anchor.offset&&l.focus.offset===r.length,a=_&&n&&!s&&o;if(a&&l.isCollapsed()&&(a=!rT(iE(l.anchor,!0))),!a){iO(i,eK,!0);let e=nG();_&&nP(e)&&e.isCollapsed()&&(tA=e,setTimeout(()=>tA=null))}}return!0}}if(!nP(l))return!0;let s=e.data;null!==tC&&im(!1,i,tC),l.dirty&&null===tC||!l.isCollapsed()||rw(l.anchor.getNode())||null===r||l.applyDOMRange(r),tC=null;
1let a=l.anchor,u=l.focus,d=a.getNode(),f=u.getNode();if("insertText"===n||"insertTranspose"===n){if("\n"===s)e.preventDefault(),iO(i,eB,!1);else if("\n\n"===s)e.preventDefault(),iO(i,eW,void 0);else if(null==s&&e.dataTransfer){let t=e.dataTransfer.getData("text/plain");e.preventDefault(),l.insertRawText(t)}else null!=s&&tP(l,r,s,e.timeStamp,!0)?(e.preventDefault(),iO(i,e$,s)):tC=s;return tS=e.timeStamp,!0}switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":iO(i,e$,e);break;case"insertFromComposition":r7(null),iO(i,e$,e);break;case"insertLineBreak":r7(null),iO(i,eB,!1);break;case"insertParagraph":r7(null),tE&&!h?(tE=!1,iO(i,eB,!1)):iO(i,eW,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":iO(i,ej,e);break;case"deleteByComposition":(d!==f||rb(d)||rb(f)||!rQ(d)||!rQ(f))&&iO(i,eU,e);break;case"deleteByDrag":iP(t9),iO(i,eU,e);break;case"deleteByCut":iO(i,eU,e);break;case"deleteContent":iO(i,eK,!1);break;case"deleteWordBackward":iO(i,eJ,!0);break;case"deleteWord
1Forward":iO(i,eJ,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":iO(i,eH,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":iO(i,eH,!1);break;case"formatStrikeThrough":iO(i,eV,"strikethrough");break;case"formatBold":iO(i,eV,"bold");break;case"formatItalic":iO(i,eV,"italic");break;case"formatUnderline":iO(i,eV,"underline");break;case"historyUndo":iO(i,eq,void 0);break;case"historyRedo":iO(i,eY,void 0)}return!0}function tB(e){if(iJ(e.target)&&rT(ii(e.target)))return!0;let t=rs(),n=nG(),r=e.data,i=tz(e);if(null!=r&&nP(n)&&tP(n,i,r,e.timeStamp,!1)){tw&&(tj(t,r),tw=!1);let i=n.anchor.getNode(),l=ij(iI(t));if(null===l)return!0;let o=n.isBackward(),s=o?n.anchor.offset:n.focus.offset,a=o?n.focus.offset:n.anchor.offset;c&&!n.isCollapsed()&&nb(i)&&null!==l.anchorNode&&i.getTextContent().slice(0,s)+r+i.getTextContent().slice(s+a)===ip(l.anchorNode)||iO(t,e$,r);let u=r.length;f&&u>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=u),_&&t.isComposing()&&(tx=0,r7(null))}else im(!1,t,null!==r?r:void 0),tw&&(tj(t,r||void 0),tw=!1);return ri(),I(rs()),!0}function tW(e){let t=rs(),n=nG();if(nP(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();r7(r.key),iP(t7),(e.timeStamp<tx+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||nb(i)&&i.getStyle()!==n.style)&&iO(t,e$,v)}return!0}function t$(e){return tj(rs(),e.data),iP(t8),!0}function tj(e,t){let n=e._compositionKey;if(r7(null),null!==n&&null!=t){if(""===t){let t=ie(n),r=r2(e.getElementByKey(n));if(null!==r&&null!==r.nodeValue&&nb(t)){let n=ij(iI(e)),i=null,l=null;null!==n&&n.anchorNode===r&&(i=n.anchorOffset,l=n.focusOffset),i_(t,r.nodeValue,i,l,!0)}return}if("\n"===t[t.length-1]){let t=nG();if(nP(t)||nL(t)){if(nP(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return void iO(e,e3,null)}}}im(!0,e,t)}function tU(e){let t=rs();if(null==e.key)return!0;if(tO){if(ib(e))return rx(t,()=>{tj(t,tM)}),tO=!1,tM="",!0;tO=!1,tM=""}if(iv(e,"ArrowRight",{shiftKey:"any"}))iO(t,eX,e);else if(iv(e,"ArrowRight",iS))iO(t,eQ,e);else if(iv(e,"ArrowLeft",{shiftKey:"any"}))iO(t,eZ,e);else if(iv(e,"ArrowLeft",iS))iO(t,e0,e);else if(iv(e,"ArrowUp",{altKey:"any",shiftKey:"any"}))iO(t,e1,e);else if(iv(e,"ArrowDown",{altKey:"any",shiftKey:"any"}))iO(t,e2,e);else if(iv(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0}))tE=!0,iO(t,e3,e);else if(" "===e.key)iO(t,e5,e);else if(d&&iv(e,"o",{ctrlKey:!0}))e.preventDefault(),tE=!0,iO(t,eB,!0);else if(iv(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"}))tE=!1,iO(t,e3,e);else if(iv(e,"Backspace",{shiftKey:"any"})||d&&iv(e,"h",{ctrlKey:!0}))ib(e)?iO(t,e6,e):(e.preventDefault(),iO(t,eK,!0));else if("Escape"===e.key)iO(t,e4,e);else if(iv(e,"Delete",{})||d&&iv(e,"d",{ctrlKey:!0}))"Delete"!==e.key?(e.preventDefault(),iO(t,eK,!1)):iO(t,e9,e);else if(iv(e,"Backspace",iC))e.preventDefault(),iO(t,eJ,!0);else if(iv(e,"Delete",iC))e.preventDefault(),iO(t,eJ,!1);else if(d&&iv(e,"Backspace",{metaKey:!0}))e.preventDefault(),iO(t,eH,!0);else if(d&&(iv(e,"Delete",{metaKey:!0})||iv(e,"k",{ctrlKey:!0})))e.preventDefault(),iO(t,eH,!1);else if(iv(e,"b",iS))e.preventDefault(),iO(t,eV,"bold");else if(iv(e,"u",iS))e.preventDefault(),iO(t,eV,"underline");else if(iv(e,"i",iS))e.preventDefault(),iO(t,eV,"italic");else if(iv(e,"Tab",{shiftKey:"any"}))iO(t,e7,e);else if(iv(e,"z",iS))e.preventDefault(),iO(t,eq,void 0);else if(d?iv(e,"z",{metaKey:!0,shiftKey:!0}):iv(e,"y",{ctrlKey:!0})||iv(e,"z",{ctrlKey:!0,shiftKey:!0}))e.preventDefault(),iO(t,eY,void 0);else{let n=t._editorState._selection;null===n||nP(n)?iv(e,"a",iS)&&(e.preventDefault(),iO(t,tu,e)):iv(e,"c",iS)?(e.preventDefault(),iO(t,ts,e)):iv(e,"x",iS)?(e.preventDefault(),iO(t,ta,e)):iv(e,"a",iS)&&(e.preventDefault(),iO(t,tu,e))}return(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)&&t.dispatchCommand(tm,e),!0}function tJ(e){let t=e.__lexicalEventHandles;return void 0===t&&(e.__lexicalEventHandles=t=[]),t}let tH=new Map;function tV(e){let t,n=(t=iL(e.target))?t.getSelection():null;if(null===n)return;let r=rG(n.anchorNode);
1if(null===r)return;tT&&(tT=!1,rx(r,()=>{let t=nX(),i=n.anchorNode;(iJ(i)||r0(i))&&iu(nY(t,n,r,e))}));let i=ih(r),l=i[i.length-1],o=l._key,s=tH.get(o),a=s||l;a!==r&&tL(n,a,!1),tL(n,r,!0),r!==l?tH.set(o,r):s&&tH.delete(o)}function tq(e){e._lexicalHandled=!0}function tY(e){return!0===e._lexicalHandled}let tG=()=>{};function tX(e,t,n){ri();let r=e.__key,i=e.getParent();if(null===i)return;let l=function(e){let t=nG();if(!nP(t)||!rb(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),l=r.getNode();return iF(i,e)&&n.set(e.__key,0,"element"),iF(l,e)&&r.set(e.__key,0,"element"),t}(e),o=!1;if(nP(l)&&t){let t=l.anchor,n=l.focus;t.key===r&&(n0(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(n0(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else nL(l)&&t&&e.isSelected()&&e.selectPrevious();if(nP(l)&&t&&!o){let t=e.getIndexWithinParent();r4(e),nQ(l,i,t,-1)}else r4(e);n||iR(i)||i.canBeEmpty()||!i.isEmpty()||tX(i,t),t&&l&&rw(i)&&i.isEmpty()&&i.selectEnd()}let tQ=Symbol.for("ephemeral");function tZ(e){return e[tQ]||!1}class t0{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=i6(this);return void 0===e&&o(64,this.name),e}static clone(e){o(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,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",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),r6(this,e)}getType(){return this.__type}isInline(){o(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;let t=ie(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){let t=e||nG();if(null==t)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(nb(this))return n;if(nP(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;let e=this.getParent();if(rT(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:ie(e)}getParentOrThrow(){let e=this.getParent();return null===e&&o(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){let t=e.getParent();if(iR(t))return rb(e)||e===this&&rT(e)||o(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return null===e&&o(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:ie(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:ie(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=rb(this)?this:this.getParent(),n=rb(e)?e:e.getParent(),r=t&&n?lk(t,n):null;return r?r.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){let t=lk(this,e);return null!==t&&("descendant"===t.type||("branch"===t.type?-1===lb(t):("same"!==t.type&&"ancestor"!==t.type&&o(279),!1)))}isParentOf(e){let t=lk(this,e);return null!==t&&"ancestor"===t.type}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;null!==i;){let l=i.__key;if(r.has(l)||(r.add(l),n.push(i)),i===e)break;let s=rb(i)?t?i.getFirstChild():i.getLastChild():null;if(null!==s){i=s;continue}let a=t?i.getNextSibling():i.getPreviousSibling();if(null!==a){i=a;continue}let u=i.getParentOrThrow();if(r.has(u.__key)||n.push(u),u===e)break;let d=null,f=u;do{if(null===f&&o(68),d=t?f.getNextSibling():f.getPreviousSibling(),null===(f=f.getParent()))break;null!==d||r.has(f.__key)||n.push(f)}while(null===d)i=d}return t||n.reverse(),n}isDirty(){let e=rs()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){if(tZ(this))return this;let e=ie(this.__key);return null===e&&o(113),e}getWritable(){if(tZ(this))return this;ri();let e=ro(),t=rs(),n=e._nodeMap,r=this.__key,i=this.getLatest(),l=t._cloneNotNeeded,o=nG();if(null!==o&&o.setCachedNodes(null),l.has(r))return r9(i),i;let s=i2(i);return l.add(r),r9(s),n.set(r,s),s}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){o(70)}updateDOM(e,t,n){o(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){o(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of U(n).flatKeys)e in t&&(void 0!==i&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&j(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){tX(this,!0,e)}replace(e,t){ri();let n=nG();null!==n&&(n=n.clone()),iB(this,e);let r=this.getLatest(),i=this.__key,l=e.__key,s=e.getWritable(),a=this.getParentOrThrow().getWritable(),u=a.__size;r4(s);let d=r.getPreviousSibling(),f=r.getNextSibling(),c=r.__prev,h=r.__next,g=r.__parent;if((tX(r,!1,!0),null===d)?a.__first=l:d.getWritable().__next=l,(s.__prev=c,null===f)?a.__last=l:f.getWritable().__prev=l,s.__next=h,s.__parent=g,a.__size=u,t&&(rb(this)&&rb(s)||o(139),this.getChildren().forEac
1h(e=>{s.append(e)})),nP(n)){iu(n);let e=n.anchor,t=n.focus;e.key===i&&nA(e,s),t.key===i&&nA(t,s)}return r8()===i&&r7(l),s}insertAfter(e,t=!0){ri(),iB(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.getParent(),l=nG(),o=!1,s=!1;if(null!==i){let t=e.getIndexWithinParent();if(r4(r),nP(l)){let e=i.__key,n=l.anchor,r=l.focus;o="element"===n.type&&n.key===e&&n.offset===t+1,s="element"===r.type&&r.key===e&&r.offset===t+1}}let a=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=r.__key,f=n.__next;if(null===a?u.__last=d:a.getWritable().__prev=d,u.__size++,n.__next=d,r.__next=f,r.__prev=n.__key,r.__parent=n.__parent,t&&nP(l)){let e=this.getIndexWithinParent();nQ(l,u,e+1);let t=u.__key;o&&l.anchor.set(t,e+2,"element"),s&&l.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){ri(),iB(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.__key;r4(r);let l=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),s=n.__prev,a=this.getIndexWithinParent();null===l?o.__first=i:l.getWritable().__next=i,o.__size++,n.__prev=i,r.__prev=s,r.__next=n.__key,r.__parent=n.__parent;let u=nG();return t&&nP(u)&&nQ(u,this.getParentOrThrow(),a),e}isParentRequired(){return!1}createParentElementNode(){return rL()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){ri();let n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(rb(n))return n.select();if(!nb(n)){let e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){ri();let n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(rb(n))return n.select(0,0);if(!nb(n)){let e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}function t1(e){return e instanceof t0}let t2="historic",t3="history-push",t5="history-merge",t6="collaboration",t4="skip-dom-selection",t9="skip-selection-focus",t7="composition-start",t8="composition-end",ne=/\s*!important\s*$/i;function nt(e){let t={};if(!e)return t;let n="",r="",i=null,l=!1,o=!1,s=!1,a=0;for(let u=0;u<e.length;u++){let d=e[u];if(l)"*"===d&&"/"===e[u+1]&&(l=!1,u++);else if(o)s?r+=d:n+=d,o=!1;else if(null===i)if("/"!==d||"*"!==e[u+1])if('"'!==d&&"'"!==d)if("("!==d)if(")"!==d)if(s||":"!==d||0!==a){if(";"===d&&0===a){let e=n.trim(),i=r.trim();""!==e&&""!==i&&(t[e]=i),n="",r="",s=!1;continue}s?r+=d:n+=d}else s=!0;else a=Math.max(0,a-1),s?r+=d:n+=d;else a++,s?r+=d:n+=d;else i=d,s?r+=d:n+=d;else l=!0,u++;else s?r+=d:n+=d,"\\"===d?o=!0:d===i&&(i=null)}let u=n.trim(),d=r.trim();return""!==u&&""!==d&&(t[u]=d),t}function nn(e,t,n=""){if(t===n)return;let r=nt(n),i=nt(t);for(let t in i)delete r[t],function(e,t,n){let r=ne.test(n)?"important":"",i=""===r?n:n.replace(ne,"").trim();e.setProperty(t,i,r)}(e,t,i[t]);for(let t in r)e.removeProperty(t)}class nr extends t0{static getType(){return"linebreak"}static clone(e){return new nr(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(e){let t=e.parentElement;if(null!==t&&iY(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&ns(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&ns(n))return!0}}return!1})(e)||function(e){let t=e.parentElement;if(null!==t&&iY(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&ns(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&ns(r))return!0}return!1}(e)?null:{conversion:ni,priority:0}}}static importJSON(e){return nl().updateFromJSON(e)}}function ni(e){return{node:nl()}}function nl(){return iK(new nr)}function no(e){return e instanceof nr}function ns(e){return r0(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function na(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function nu(e,t){return 1&t?"strong":2&t?"em":"span"}function nd(e,t,n,r,i){let l=r.classList,o=iN(i,"base");void 0!==o&&l.add(...o);let s=!1,a=8&t&&4&t;for(let e in void 0!==(o=iN(i,"underlineStrikethrough"))&&(8&n&&4&n?(s=!0,a||l.add(...o)):a&&l.remove(...o)),b){let r=b[e];if(void 0!==(o=iN(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)}}function nf(e,t,n){let r=t.firstChild,i=n.isComposing(),l=e+(i?x:"");if(null==r)t.textContent=l;else{let e=r.nodeValue;if(e!==l)if(i||f){let[t,n,i]=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)]}(e,l);0!==n&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=l}}function nc(e,t,n,r,i,l){nf(i,e,t);let o=l.theme.text;void 0!==o&&nd(0,0,r,e,o)}function nh(e,t){let n=document.createElement(t);return n.appendChild(e),n}class ng extends t0{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new ng(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",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 w[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===r8()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=b[e];return 0!=(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return r3(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=na(0,n),i=nu(0,n),l=null===r?i:r,o=document.createElement(l),s=o;
1this.hasFormat("code")&&o.setAttribute("spellcheck","false"),null!==r&&(s=document.createElement(i),o.appendChild(s)),nc(s,this,0,n,this.__text,e);let a=this.__style;return""!==a&&nn(o.style,a),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,l=this.__format,s=na(0,i),a=na(0,l),u=nu(0,i),d=nu(0,l);if((null===s?u:s)!==(null===a?d:a))return!0;if(s===a&&u!==d){let e=t.firstChild;null==e&&o(48);let i=document.createElement(d);return nc(i,this,0,l,r,n),t.replaceChild(i,e),!1}let f=t;null!==a&&null!==s&&null==(f=t.firstChild)&&o(49),nf(r,f,this);let c=n.theme.text;void 0!==c&&i!==l&&nd(0,i,l,f,c);let h=e.__style,g=this.__style;return h!==g&&nn(t.style,g,h),!1}static importDOM(){return{"#text":()=>({conversion:ny,priority:0}),b:()=>({conversion:nm,priority:0}),code:()=>({conversion:nS,priority:0}),em:()=>({conversion:nS,priority:0}),i:()=>({conversion:nS,priority:0}),mark:()=>({conversion:nS,priority:0}),s:()=>({conversion:nS,priority:0}),span:()=>({conversion:np,priority:0}),strong:()=>({conversion:nS,priority:0}),sub:()=>({conversion:nS,priority:0}),sup:()=>({conversion:nS,priority:0}),u:()=>({conversion:nS,priority:0})}}static importJSON(e){return nC().updateFromJSON(e)}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 iJ(t)||o(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=nh(t,"b")),this.hasFormat("italic")&&(t=nh(t,"i")),this.hasFormat("strikethrough")&&(t=nh(t,"s")),this.hasFormat("underline")&&(t=nh(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?b[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail="string"==typeof e?N[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=r3(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=E[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){ri();let n=e,r=t,i=nG(),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(!nP(i))return nH(o,n,o,r,"text","text");{let e=r8();e!==i.anchor.key&&e!==i.focus.key||r7(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=nG();if(r&&nP(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;ri();let n=this.getLatest(),r=n.getTextContent();if(""===r)return[];let i=n.__key,l=r8(),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 d=s[0],f=n.getParent(),c=n.getFormat(),h=n.getStyle(),g=n.__detail,p=!1,m=null,_=null,y=nG();if(nP(y)){let[e,t]=y.isBackward()?[y.focus,y.anchor]:[y.anchor,y.focus];"text"===e.type&&e.key===i&&(m=e),"text"===t.type&&t.key===i&&(_=t)}n.isSegmented()?((t=nC(d)).__format=c,t.__style=h,t.__detail=g,t.__state=Y(n,t),p=!0):t=n.setTextContent(d);let x=[t];for(let e=1;e<u;e++){let t=nC(s[e]);t.__format=c,t.__style=h,t.__detail=g,t.__state=Y(n,t);let r=t.__key;l===i&&r7(r),x.push(t)}let v=m?m.offset:null,S=_?_.offset:null,C=0;for(let e of x){if(!m&&!_)break;let t=C+e.getTextContentSize();if(null!==m&&null!==v&&v<=t&&v>=C&&(m.set(e.getKey(),v-C,"text"),v<t&&(m=null)),null!==_&&null!==S&&S<=t&&S>=C){_.set(e.getKey(),S-C,"text");break}C=t}if(null!==f){let e,t;e=this.getPreviousSibling(),t=this.getNextSibling(),null!==e&&r9(e),null!==t&&r9(t);let n=f.getWritable(),r=this.getIndexWithinParent();p?(n.splice(r,0,x),this.remove()):n.splice(r,1,x),nP(y)&&nQ(y,f,r,u-1)}return x}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||o(50);let n=this.__key,r=e.__key,i=this.__text,l=i.length;r8()===r&&r7(n);let s=nG();if(nP(s)){let i=s.anchor,o=s.focus;null!==i&&i.key===r&&n1(i,t,n,e,l),null!==o&&o.key===r&&n1(o,t,n,e,l)}let a=e.__text,u=t?a+i:i+a;this.setTextContent(u);let d=this.getWritable();return e.remove(),d}isTextEntity(){return!1}}function np(e){return{forChild:nN(e.style),node:null}}function nm(e){let t="normal"===e.style.fontWeight;return{forChild:nN(e.style,t?void 0:"bold"),node:null}}let n_=new WeakMap;function ny(e){null===e.parentElement&&o(129);let t=e.textContent||"";if(null!==function(e){let t,n=e.parentNode,r=[e];for(;null!==n&&void 0===(t=n_.get(n))&&!function(e){if(!iJ(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++)n_.set(r[e],i);return i}(e)){let e=t.split(/(\r?\n|\t)/),n=[],r=e.length;for(let t=0;t<r;t++){let r=e[t];"\n"===r||"\r\n"===r?n.push(nl()):"	"===r?n.push(nT()):""!==r&&n.push(nC(r))}return{node:n}}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=nx(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=nx(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:nC(t)}}function nx(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(iJ(n=e)){let e=n.style.display;if(""===e&&!iq(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(r0(n))return n;if("BR"===n.nodeName)return null}}let nv={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function nS(e){let t=nv[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:nN(e.style,t),node:null}}function nC(e=""){return iK(new ng(e))}function nb(e){return e instanceof ng}function nN(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;return e=>(nb(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"),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}class nk extends ng{static getType(){return"tab"}static clone(e){return new nk(e.__key)}constructor(e){super("	",e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=iN(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return nT().updateFromJSON(e)}setTextContent(e){return"	"!==e&&""!==e&&s(126),super.setTextContent("	")}spliceText(e,t,n,r){return""===n&&0===t||"	"===n&&1===t||o(286),this}setDetail(e){return 2!==e&&o(127),this}setMode(e){return"normal"!==e&&o(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function nT(){return iK(new nk)}function nE(e){return e instanceof nk}class nw{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>lC(lF(lT(this,"next")),lF(lT(e,"next")))}getNode(){let e=ie(this.key);return null===e&&o(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,rr()||(r8()===l&&r7(e),null!==i&&(i.setCachedNodes(null),i.dirty=!0)))}}function nO(e,t,n){return new nw(e,t,n)}function nM(e,t){let n=t.__key,r=e.offset,i="element";if(nb(t)){i="text";let e=t.getTextContentSize();r>e&&(r=e)}else if(!rb(t)){let e=t.getNextSibling();if(nb(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 nA(e,t){if(rb(t)){let n=t.getLastDescendant();rb(n)||nb(n)?nM(e,n):nM(e,t)}else nM(e,t)}class nD{_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(!nL(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 nD(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t,n=this.getNodes(),r=n.length,i=n[r-1];if(nb(i))t=i.select();else{let e=i.getIndexWithinParent()+1;t=i.getParentOrThrow().select(e,e)}t.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=ie(e);null!==t&&n.push(t)}return rr()||(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();if((nG()||nX())===this&&e[0]){let t=lc(e[0],"next");lw(lv(t,t))}for(let t of e)t.remove()}}function nP(e){return e instanceof nF}class nF{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!nP(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();
1n&&t.push(n.caret.origin);let i=new Set,l=new Set;for(let n of e)if(la(n)){let{origin:e}=n;0===t.length?i.add(e):(l.add(e),t.push(e))}else{let{origin:e}=n;rb(e)&&l.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),ls(e.focus)&&rb(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let n=lp(e.focus.origin,"previous");la(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=lm(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!rb(e)||l.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(0===t.length&&e.isCollapsed()){let n=lF(e.anchor),r=lF(e.anchor.getFlipped()),i=e=>lo(e)?e.origin:e.getNodeAtCaret(),l=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(l)}return t}(lR(lM(this),"next"));return rr()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,r,"text")}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]=nR(this),a="",u=!0;for(let d=0;d<e.length;d++){let f=e[d];if(rb(f)&&!f.isInline())u||(a+="\n"),u=!f.isEmpty();else if(u=!1,nb(f)){let e=f.getTextContent();f===t?f===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):f===n&&(e=l?e.slice(0,s):e.slice(0,o)),a+=e}else!rT(f)&&!no(f)||f===n&&this.isCollapsed()||(a+=f.getTextContent())}return a}applyDOMRange(e){let t=rs(),n=t.getEditorState()._selection,r=nU(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;let[i,l]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(l.key,l.offset,l.type,!0),Z(this)}clone(){let e=this.anchor,t=this.focus;return new nF(nO(e.key,e.offset,e.type),nO(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=r3(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=b[e];return 0!=(this.format&t)}insertRawText(e){let t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){let r=t[e];"\n"===r||"\r\n"===r?n.push(nl()):"	"===r?n.push(nT()):n.push(nC(r))}this.insertNodes(n)}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,l=t,s=n;!this.isCollapsed()&&n.isBefore(t)&&(l=n,s=t),"element"===l.type&&function(e,t,n,r){let i=e.getNode(),l=i.getChildAtIndex(e.offset),o=nC();if(o.setFormat(n),o.setStyle(r),rI(l))l.splice(0,0,[o]);else{let e=rw(i)?rL().append(o):o;null===l?i.append(e):l.insertBefore(e)}e.is(t)&&t.set(o.__key,0,"text"),e.set(o.__key,0,"text")}(l,s,r,i),"element"===s.type&&lE(s,lF(lT(s,"next")));let a=l.offset,u=s.offset,d=this.getNodes(),f=d.length,c=d[0];nb(c)||o(26);let h=c.getTextContent().length,g=c.getParentOrThrow(),p=d[f-1];if(1===f&&"element"===s.type&&(u=h,s.set(l.key,u,"text")),this.isCollapsed()&&a===h&&(rZ(c)||!c.canInsertTextAfter()||!g.canInsertTextAfter()&&null===c.getNextSibling())){let t=c.getNextSibling();if(nb(t)&&t.canInsertTextBefore()&&!rZ(t)||((t=nC()).setFormat(r),t.setStyle(i),g.canInsertTextAfter()?c.insertAfter(t):g.insertAfter(t)),t.select(0,0),c=t,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===a&&(rZ(c)||!c.canInsertTextBefore()||!g.canInsertTextBefore()&&null===c.getPreviousSibling())){let t=c.getPreviousSibling();if(nb(t)&&!rZ(t)||((t=nC()).setFormat(r),g.canInsertTextBefore()?c.insertBefore(t):g.insertBefore(t)),t.select(),c=t,""!==e)return void this.insertText(e)}else if(c.isSegmented()&&a!==h){let e=nC(c.getTextContent());e.setFormat(r),c.replace(e),c=e}else if(!this.isCollapsed()&&""!==e){let t=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||rb(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),nj(this.anchor,this.focus),void this.insertText(e)}if(1===f){if(rQ(c)){let t=nC(e);return t.select(),void c.replace(t)}let t=c.getFormat(),n=c.getStyle();if(a!==u||t===r&&n===i){if(nE(c)){let t=nC(e);return t.setFormat(r),t.setStyle(i),t.select(),void c.replace(t)}}else{if(""!==c.getTextContent()){let t=nC(e);if(t.setFormat(r),t.setStyle(i),t.select(),0===a)c.insertBefore(t,!1);else{let[e]=c.splitText(a);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length))}c.setFormat(r),c.setStyle(i)}let l=u-a;""===(c=c.spliceText(a,l,e,!0)).getTextContent()?c.remove():"text"===this.anchor.type&&(this.format=t,this.style=n,c.isComposing()&&(this.anchor.offset-=e.length))}else{let t=new Set([...c.getParentKeys(),...p.getParentKeys()]),n=rb(c)?c:c.getParentOrThrow(),r=rb(p)?p:p.getParentOrThrow(),i=p;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline())if("text"===s.type&&(0!==u||""===p.getTextContent())||"element"===s.type&&p.getIndexWithinParent()<u)if(nb(p)&&!rQ(p)&&u!==p.getTextContentSize()){if(p.isSegmented()){let e=nC(p.getTextContent());p.replace(e),p=e}rw(s.getNode())||"text"!==s.type||(p=p.spliceText(0,u,"")),t.add(p.__key)}else{let e=p.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?p.remove():e.remove()}else t.add(p.__key);let l=r.getChildren(),o=new Set(d),g=n.is(r),m=n.isInline()&&null===c.getNextSibling()?n:c;for(let e=l.length-1;e>=0;e--){let t=l[e];if(t.is(c)||rb(t)&&t.isParentOf(c))break;t.isAttached()&&(!o.has(t)||t.is(i)?g||m.insertAfter(t,!1):t.remove())}if(!g){let e=r,n=null;for(;null!==e;){let r=e.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(rQ(c))if(a===h)c.select();else{let t=nC(e);t.select(),c.replace(t)}else""===(c=c.spliceText(a,h-a,e,!0)).getTextContent()?c.remove():"text"===this.anchor.type&&(this.format=c.getFormat(),this.style=c.getStyle(),c.isComposing()&&(this.anchor.offset-=e.length));for(let e=1;e<f;e++){let n=d[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=nG()===this;lO(this,function(e,t="removeEmptySlices"){let n,r;if(e.isCollapsed())return e;let i="root",l="next",s=t,a=lR(e,l),u=lD(a.anchor,i),d=lD(a.focus.getFlipped(),i),f=new Set,c=[];for(let e of a.iterNodeCarets(i))if(la(e))f.add(e.origin.getKey());else if(ls(e)){let{origin:t}=e;rb(t)&&!f.has(t.getKey())||c.push(t)}for(let e of c)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),r=lA(lc(t,l)),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=nC(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());r.replaceOrInsert(n),t=lh(n,l,t.offset)}n.is(u[0].origin)&&(u[0]=t),n.is(d[0].origin)&&(d[0]=t.getFlipped())}}for(let e of u)if(lP(e)){n=lF(e);break}for(let e of d)if(lP(e)){r=lF(e);break}let h=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)=>
1{let n;for(let i=r;i<e.length;i++){let r=e[i];if(iR(r))return;!n&&t(r)&&(n=r)}return n},d=u(o,iG),f=d&&u(s,e=>n.has(e.getKey())&&iG(e));return d&&f?[d,f]:null}(n,r,f);if(h){let[e,t]=h;lp(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)}}let g=[n,r,...u,...d].find(lP);if(g){var p;return lv(p=lI(lF(g),e.direction),p)}o(269,JSON.stringify(u.map(e=>e.origin.__key)))}(lM(this))),e&&nG()!==this&&iu(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void r7(null);let n=this.getNodes(),r=[];for(let e of n)nb(e)&&r.push(e);let i=t=>{n.forEach(n=>{if(rb(n)){let r=n.getFormatFlags(e,t);n.setTextFormat(r)}})},l=r.length;if(0===l)return this.toggleFormat(e),r7(null),void i(t);let o=this.anchor,s=this.focus,a=this.isBackward(),u=a?s:o,d=a?o:s,f=0,c=r[0],h="element"===u.type?0:u.offset;if("text"===u.type&&h===c.getTextContentSize()&&(f=1,c=r[1],h=0),null==c)return;let g=c.getFormatFlags(e,t);i(g);let p=l-1,m=r[p],_="text"===d.type?d.offset:m.getTextContentSize();if(c.is(m)){if(h===_)return;if(rZ(c)||0===h&&_===c.getTextContentSize())c.setFormat(g);else{let e=c.splitText(h,_),t=0===h?e[0]:e[1];t.setFormat(g),"text"===u.type&&u.set(t.__key,0,"text"),"text"===d.type&&d.set(t.__key,_-h,"text")}return void(this.format=g)}0===h||rZ(c)||([,c]=c.splitText(h),h=0),c.setFormat(g);let y=m.getFormatFlags(e,g);_>0&&(_===m.getTextContentSize()||rZ(m)||([m]=m.splitText(_)),m.setFormat(y));for(let t=f+1;t<p;t++){let n=r[t],i=n.getFormatFlags(e,y);n.setFormat(i)}"text"===u.type&&u.set(c.__key,h,"text"),"text"===d.type&&d.set(m.__key,_,"text"),this.format=g|y}insertNodes(e){var t;if(0===e.length)return;if(this.isCollapsed()||this.removeText(),"root"===this.anchor.key){this.insertParagraph();let t=nG();return nP(t)||o(134),t.insertNodes(e)}let n=(this.isBackward()?this.focus:this.anchor).getNode(),r=i9(n,iG),i=e[e.length-1];if(rb(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let t=n6(this);r.splice(t,0,e),i.selectEnd()}return}if(!e.some(e=>(rb(e)||rT(e))&&!e.isInline())){rb(r)||o(211,n.constructor.name,n.getType());let t=n6(this);return r.splice(t,0,e),void i.selectEnd()}let l=function(e){let t=rL(),n=null;for(let r=0;r<e.length;r++){let i=e[r],l=no(i);if(l||rT(i)&&i.isInline()||rb(i)&&i.isInline()||nb(i)||i.isParentRequired()){if(null===n&&(n=i.createParentElementNode(),t.append(n),l))continue;null!==n&&n.append(i)}else t.append(i),n=null}return t}(e),s=l.getLastDescendant(),a=l.getChildren(),u=rb(r)&&r.isEmpty()?null:this.insertParagraph(),d=a[a.length-1],f=a[0];rb(t=f)&&iG(t)&&!t.isEmpty()&&rb(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(rb(r)||o(211,n.constructor.name,n.getType()),r.append(...f.getChildren()),f=a[1]),f&&(null===r&&o(212,n.constructor.name,n.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||o(140),i.push(r=r.getNextSibling());let l=e;for(let e of i)l=l.insertAfter(e)}(r,f));let c=i9(s,iG);u&&rb(c)&&(u.canMergeWhenEmpty()||iG(d))&&(c.append(...u.getChildren()),u.remove()),rb(r)&&r.isEmpty()&&r.remove(),s.selectEnd();let h=rb(r)?r.getLastChild():null;no(h)&&c!==r&&h.remove()}insertParagraph(){if("root"===this.anchor.key){let e=rL();return is().splice(this.anchor.offset,0,[e]),e.select(),e}let e=n6(this),t=i9(this.anchor.getNode(),iG);rb(t)||o(213);let n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){let t=nl();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]=nR(this),o=this.isBackward(),[s,a]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[u,d]=o?[l,i]:[i,l];if(0===t)return[];if(1===t){if(nb(n)&&!this.isCollapsed()){let e=n.splitText(u,d),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(nb(n)&&(u===n.getTextContentSize()?e.shift():0!==u&&([,n]=n.splitText(u),e[0]=n,s.set(n.getKey(),0,"text"))),nb(r)){let t=r.getTextContent().length;0===d?e.pop():d!==t&&([r]=r.splitText(d),e[e.length-1]=r,a.set(r.getKey(),r.getTextContentSize(),"text"))}return e}
1modify(e,t,n){var r;if(n4(this,e,t,n))return;let i="move"===e,l=rs(),o=ij(iI(l));if(!o)return;let s=l._blockCursorElement,a=l._rootElement,u=this.focus.getNode();if(null===a||null===s||!rb(u)||u.isInline()||u.canBeEmpty()||i$(s,l,a),this.dirty){let e=iM(l,this.anchor.key),t=iM(l,this.focus.key);"text"===this.anchor.type&&(e=r2(e)),"text"===this.focus.type&&(t=r2(t)),e&&t&&n2(o,e,this.anchor.offset,t,this.focus.offset)}if(r=t?"backward":"forward",o.modify(e,r,n),o.rangeCount>0){let e=o.getRangeAt(0),n=this.anchor.getNode(),r=rw(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t&&!iR(t);)t=t.getParentOrThrow();return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!i){let n,i,l,s,a,u=this.getNodes(),d=[],f=!1;for(let e=0;e<u.length;e++){let t=u[e];iF(t,r)?d.push(t):f=!0}if(f&&d.length>0)if(t){let e=d[0];rb(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{let e=d[d.length-1];rb(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}o.anchorNode===e.startContainer&&o.anchorOffset===e.startOffset||(n=this.focus,l=(i=this.anchor).key,s=i.offset,a=i.type,i.set(n.key,n.offset,n.type,!0),n.set(l,s,a,!0))}}"lineboundary"===n&&n4(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&rb(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(rb(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=lx(lT(t,e?"previous":"next"));if(r.getTextSlices().every(e=>null===e||0===e.distance)){let e={type:"initial"};for(let t of r.iterNodeCarets("shadowRoot"))if(la(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(rb(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=lF(t);lO(this,lv(e,e)),r.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(ls(t)){if(rb(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:"merge-next-block"};continue}if(rT(t.origin)){if(t.origin.isIsolated());else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&rb(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=nq();e.add(t.origin.getKey()),iu(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){let{caret:t,block:n}=e;return lO(this,lv(!t.origin.isEmpty()&&n.isEmpty()?lA(lc(n,t.direction)):r.anchor,t)),this.removeText()}}let i=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&nz(this,t.getNode()))return}else{let r="text"===i.type?i.getNode():null;if(n="text"===t.type?t.getNode():null,null!==r&&r.isSegmented()){let t=i.offset,l=r.getTextContentSize();if(r.is(n)||e&&t!==l||!e&&0!==t)return void nB(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 nB(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,d=u-1;a===d||ic(l=i.getTextContent().slice(a,u))||nK(l)||(t?r.set(r.key,d,r.type):n.set(n.key,d,n.type))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){let e=this.anchor.getNode();e.isEmpty()&&rw(e.getParent())&&null===e.getPreviousSibling()&&nz(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function nL(e){return e instanceof nD}function nI(e){let t=e.offset;if("text"===e.type)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function nR(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]:[nI(n),nI(r)]}function nz(e,t){for(let n=t;n;n=n.getParent()){if(rb(n)){if(n.collapseAtStart(e))return!0;
1if(iR(n))break}if(n.getPreviousSibling())break}return!1}let nK=(()=>{try{let e=RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch(e){}return()=>!1})();function nB(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 nW(e,t,n,r){let i,l=t;if(iJ(e)){let s=!1,a=e.childNodes,u=a.length,d=r._blockCursorElement;l===u&&(s=!0,l=u-1);let f=a[l],c=!1;if(f===d)f=a[l+1],c=!0;else if(null!==d){let n=d.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,d)&&l--}if(nb(i=id(f)))l=lg(i,s?"next":"previous");else{let a=id(e);if(null===a)return null;if(rb(a)){let u,d=r.getElementByKey(a.getKey());null===d&&o(214);let f=iQ(r).$getDOMSlot(a,d,r);[a,l]=f.resolveChildIndex(a,d,e,t),rb(a)||o(215),s&&l>=a.getChildrenSize()&&(l=Math.max(0,a.getChildrenSize()-1));let h=a.getChildAtIndex(l);if(rb(h)&&(u=h.getParent(),null===n||null===u||!u.canBeEmpty()||u!==n.getNode())){let e=s?h.getLastDescendant():h.getFirstDescendant();a=null===e||rb(h=e)?h:h.getParentOrThrow(),l=0}nb(h)?(i=h,a=null,l=lg(h,s?"next":"previous")):h!==a&&s&&!c&&(rb(a)||o(216),l=Math.min(a.getChildrenSize(),l+1))}else{let n=a.getIndexWithinParent();l=0===t&&rT(a)&&id(e)===a?n:n+1,a=a.getParentOrThrow()}if(rb(a))return nO(a.__key,l,"element")}}else i=id(e);return nb(i)?nO(i.__key,lg(i,l,"clamp"),"text"):null}function n$(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&&rb(l)&&l.isInline()){let t=l.getPreviousSibling();nb(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else rb(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):nb(r)&&e.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){let r=i.getNextSibling(),l=i.getParent();if(t&&rb(r)&&r.isInline())e.set(r.__key,0,"element");else if((n||t)&&null===r&&rb(l)&&l.isInline()&&!l.canInsertTextAfter()){let t=l.getNextSibling();nb(t)&&e.set(t.__key,0,"text")}}}function nj(e,t,n){if("text"===e.type&&"text"===t.type){let n=e.isBefore(t),r=e.is(t);n$(e,n,r),n$(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function nU(e,t,n,r,i,l){if(null===e||null===n||!rq(i,e,n))return null;let o=nW(e,t,nP(l)?l.anchor:null,i);if(null===o)return null;let s=nW(n,r,nP(l)?l.focus:null,i);if(null===s)return null;if("element"===o.type&&"element"===s.type){let t=id(e),r=id(n);if(rT(t)&&rT(r))return null}return nj(o,s),[o,s]}function nJ(e){return rb(e)&&!e.isInline()}function nH(e,t,n,r,i,l){let o=ro(),s=new nF(nO(e,t,i),nO(n,r,l),0,"");return s.dirty=!0,o._selection=s,s}function nV(){return new nF(nO("root",0,"element"),nO("root",0,"element"),0,"")}function nq(){return new nD(new Set)}function nY(e,t,n,r){let i,l,o,s,a=n._window;if(null===a)return null;let u=r||a.event,d=u?u.type:void 0,f="selectionchange"===d,c=!A&&(f||"beforeinput"===d||"compositionstart"===d||"compositionend"===d||"click"===d&&u&&3===u.detail||"drop"===d||void 0===d);if(nP(e)&&!c)return e.clone();if(null===t)return null;if(i=t.anchorNode,l=t.focusNode,o=t.anchorOffset,s=t.focusOffset,(f||void 0===d)&&nP(e)&&!rq(n,i,l))return e.clone();let h=nU(i,o,l,s,n,e);if(null===h)return null;let[g,p]=h,m=0,_="";if(nP(e)){let t=e.anchor;if(g.key===t.key)m=e.format,_=e.style;else{let e=g.getNode();nb(e)?(m=e.getFormat(),_=e.getStyle()):rb(e)&&(m=e.getTextFormat(),_=e.getTextStyle())}}return new nF(g,p,m,_)}function nG(){return ro()._selection}function nX(){return rs()._editorState._selection}function nQ(e,t,n,r=1){let i=e.anchor,l=e.focus,o=i.getNode(),s=l.getNode();if(!t.is(o)&&!t.is(s))return;let a=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(a,n,"element"),l.set(a,n,"element"),nZ(e)}}else{let o=e.isBackward(),s=o?l:i,u=s.getNode(),d=o?i:l,f=d.getNode();if(t.is(u)){let e=s.offset;(n<=e&&r>0||n<e&&r<0)&&s.set(a,Math.max(0,e+r),"element")}if(t.is(f)){let e=d.offset;(n<=e&&r>0||n<e&&r<0)&&d.set(a,Math.max(0,e+r),"element")}}nZ(e)}function nZ(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,l=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!rb(l))return;let e=l.getChildrenSize(),i=n>=e,o=i?l.getChildAtIndex(e-1):l.getChildAtIndex(n);if(nb(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,"text"),r.set(o.__key,e,"text")}return}if(rb(l)){let e=l.getChildrenSize(),r=n>=e,i=r?l.getChildAtIndex(e-1):l.getChildAtIndex(n);if(nb(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if(rb(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(nb(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}function n0(e,t,n,r,i){let l=null,o=0,s=null;null!==r?(l=r.__key,nb(r)?(o=r.getTextContentSize(),s="text"):rb(r)&&(o=r.getChildrenSize(),s="element")):null!==i&&(l=i.__key,nb(i)?s="text":rb(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 n1(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 n2(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch(e){}}function n3(e,t,n){let r=iM(e,t.getKey());if(rb(t)){let i=iQ(e).$getDOMSlot(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function n5(e){let t=nG()||nX();
1null===t&&(t=is().selectEnd()),t.insertNodes(e)}function n6(e){let t=e;e.isCollapsed()||t.removeText();let n=nG();nP(n)&&(t=n),nP(t)||o(161);let r=t.anchor,i=r.getNode(),l=r.offset;for(;!iG(i);){let e=i;if([i,l]=function(e,t){let n=e.getParent();if(!n){let e=rL();return is().append(e),e.select(),[is(),0]}if(nb(e)){let r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];let i=+(0!==t);return[n,r[0].getIndexWithinParent()+i]}if(!rb(e)||0===t)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new nF(nO(e.__key,t,"element"),nO(e.__key,t,"element"),0,""),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}(i,l),e.is(i))break}return l}function n4(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=lT(e.focus,n?"previous":"next"),o="lineboundary"===r,s="move"===t,a=l,u="decorators-and-blocks"===i;if(!lL(a)){for(let e of a){u=!1;let{origin:t}=e;if(!rT(t)||t.isIsolated()||(a=e,!o||!t.isInline()))break}if(u)for(let e of lx(l).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(la(e))e.origin.isInline()||(a=e);else{if(rb(e.origin))continue;rT(e.origin)&&!e.origin.isInline()&&(a=e)}break}}if(a===l)return!1;if(s&&!o&&rT(a.origin)&&a.origin.isKeyboardSelectable()){let e=nq();return e.add(a.origin.getKey()),iu(e),!0}return a=lF(a),s&&lE(e.anchor,a),lE(e.focus,a),u||!o}let n9=null,n7=null,n8=!1,re=!1,rt=0,rn={characterData:!0,childList:!0,subtree:!0};function rr(){return n8||null!==n9&&n9._readOnly}function ri(){n8&&o(13)}function rl(){rt>99&&o(14)}function ro(){return null===n9&&o(195,ra()),n9}function rs(){return null===n7&&o(337,ra()),n7}function ra(){let e=0,t=new Set,n=rW.version;if("u">typeof window)for(let r of document.querySelectorAll("[contenteditable]")){let i=rX(r);if(rY(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 ru(e,t,n){let r=t.__type,i=rU(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 rd(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function rf(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 rc(e,t){let n=e.type,r=t.get(n);void 0===r&&o(17,n);let i=r.klass;e.type!==i.getType()&&o(18,i.name);let l=i.importJSON(e),s=e.children;if(rb(l)&&Array.isArray(s))for(let e=0;e<s.length;e++){let n=rc(s[e],t);l.append(n)}return l}function rh(e,t,n){let r=n9,i=n8,l=n7;n9=t,n8=!0,n7=e;try{return n()}finally{n9=r,n8=i,n7=l}}function rg(e,t){let n,r,i=e._pendingEditorState,l=e._rootElement,s=e._headless||null===l;if(null===i)return void(e._deferred.length>0&&rm(e,e._deferred));let a=e._editorState,u=a._selection,d=i._selection,c=0!==e._dirtyType,h=n9,g=n8,p=n7,m=e._updating,_=e._observer,y=null;if(e._pendingEditorState=null,e._editorState=i,!s&&c&&null!==_){n7=e,n9=i,n8=!1,e._updating=!0;try{let t,n=e._dirtyType,r=e._dirtyElements,l=e._dirtyLeaves;_.disconnect(),ec="",ep=2===n,en=e,et=e._config,ef=e._config.dom||rz,er=e._nodes,ei=en._listeners.mutation,el=r,eo=l,es=a._nodeMap,ea=i._nodeMap,em=i._readOnly,eu=new Map(e._keyToDOMMap),ed=t=new Map,function e(t,n){let r=es.get(t),i=ea.get(t);void 0!==r&&void 0!==i||o(61);let l=ep||eo.has(t)||el.has(t),s=iM(en,t);if(r===i&&!l){let e;if(rb(r)){let t=s.__lexicalTextContent;"string"==typeof t?e=t:s.__lexicalTextContent=e=r.getTextContent()}else e=r.getTextContent();return ec+=e,s}if(r!==i&&l&&ik(ed,er,ei,i,"updated"),ef.$updateDOM(i,r,s,en)){let e=eb(t,null);return null===n&&o(62),n.replaceChild(e,s),e_(t,null),e}if(rb(r)){rb(i)||o(334,t);let n=i.__indent;(ep||n!==r.__indent)&&ev(s,n);let a=i.__format;if((ep||a!==r.__format)&&eS(s,a),l)(function(t,n,r){eh=null,eg=null,function(t,n,r){let i=ec,l=t.__size,s=n.__size;ec="";let a=r.element;
1if(1===l&&1===s){let r=t.__first,i=n.__first;if(r===i)e(r,a);else{let e=eM(r),t=eb(i,null);try{a.replaceChild(t,e)}catch(n){if("object"==typeof n&&null!=n)throw Error(`${n.toString()} Parent: ${a.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`);throw n}e_(r,null)}let l=ea.get(i);nb(l)&&null===eh&&(eh=l.getFormat(),eg=l.getStyle())}else{let i=i7(t,es),u=i7(n,ea);if(i.length!==l&&o(227),u.length!==s&&o(228),0===l)0!==s&&eN(u,0,0,s-1,r);else if(0===s){if(0!==l){let e=null==r.after&&null==r.before&&null==r.element.__lexicalLineBreak;ey(i,0,l-1,e?null:a),e&&(a.textContent="")}}else!function(t,n,r,i,l){let o=r-1,s=i-1,a,u,d=l.getFirstChild(),f=0,c=0;for(;f<=o&&c<=s;){let r=t[f],i=n[c];if(r===i)d=ew(e(i,l.element)),f++,c++;else{if(void 0===u&&(u=eO(n,c)),void 0===a)a=eO(t,f);else if(!a.has(r)){f++;continue}if(!u.has(r)){d=ew(eM(r)),e_(r,l.element),f++,a.delete(r);continue}if(a.has(i)){let t=iM(en,i);t!==d&&l.withBefore(d).insertChild(t),d=ew(e(i,l.element)),f++,c++}else eb(i,l.withBefore(d)),c++}let o=ea.get(i);
1null!==o&&nb(o)?null===eh&&(eh=o.getFormat(),eg=o.getStyle()):rb(o)&&c<=s&&!o.isInline()&&(ec+="\n\n")}let h=f>o,g=c>s;if(h&&!g){let e=n[s+1],t=void 0===e?null:en.getElementByKey(e);eN(n,0,c,s,l.withBefore(t))}else g&&!h&&ey(t,f,o,l.element)}(i,u,l,s,r)}a.__lexicalTextContent=ec,ec=i+ec}(t,n,ef.$getDOMSlot(n,r,en)),null==eh||eh===n.__textFormat||em||n.setTextFormat(eh),null==eg||eg===n.__textStyle||em||n.setTextStyle(eg)})(r,i,s),rw(i)||i.isInline()||eT(r,i,s);else{let e,t=s.__lexicalTextContent;"string"==typeof t?e=t:s.__lexicalTextContent=e=r.getTextContent(),ec+=e}if((ep||i.__dir!==r.__dir)&&(eC(s,i),rw(i)&&!ep))for(let e of i.getChildren())rb(e)&&eC(iM(en,e.getKey()),e)}else{let e=i.getTextContent();if(rT(i)){let e=i.decorate(en,et);null!==e&&eE(t,e)}ec+=e}if(!em&&rw(i)&&i.__cachedText!==ec){let e=i.getWritable();e.__cachedText=ec,i=e}return ef.$decorateDOM(i,r,s,en),s}("root",null),en=void 0,er=void 0,el=void 0,eo=void 0,es=void 0,ea=void 0,et=void 0,eu=void 0,ed=void 0,ef=rz,y=t}catch(t){if(t instanceof Error&&e._onError(t),re)throw t;return rR(e,null,l,i),R(e),e._dirtyType=2,re=!0,rg(e,a),void(re=!1)}finally{_.observe(l,rn),e._updating=m,n9=h,n8=g,n7=p}}i._readOnly||(i._readOnly=!0);let x=e._dirtyLeaves,v=e._dirtyElements,S=e._normalizedNodes,C=e._updateTags,b=e._deferred;c&&(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=il(e)),delete i[n])}(e,i);let N=s?null:ij(iI(e));if(e._editable&&null!==N&&(c||null===d||d.dirty||!d.is(u))&&null!==l&&!C.has(t4)){n7=e,n9=i;try{if(null!==_&&_.disconnect(),c||null===d||d.dirty){let t=e._blockCursorElement;null!==t&&i$(t,e,l),function(e,t,n,r,i,l){var o;let s=r.anchorNode,a=r.focusNode,u=r.anchorOffset,d=r.focusOffset,c=document.activeElement;if(i.has(t6)&&c!==l||null!==c&&rV(c))return;if(!nP(t))return null!==e&&rq(n,s,a)&&r.removeAllRanges();let h=t.anchor,g=t.focus,p=h.getNode(),m=g.getNode(),[_,y]=n3(n,p,h.offset),[x,v]=n3(n,m,g.offset),S=t.format,C=t.style,b=t.isCollapsed(),N=_,k=x,T=!1;if("text"===h.type?(N=r2(_),T=p.getFormat()!==S||p.getStyle()!==C):nP(e)&&"text"===e.anchor.type&&(T=!0),"text"===g.type&&(k=r2(x)),null!==N&&null!==k&&(b&&(null===e||T||nP(e)&&(e.format!==S||e.style!==C))&&(o=h.key,tD=[S,C,y,o,performance.now()]),u!==y||d!==v||s!==N||a!==k||"Range"===r.type&&b||(null!==c&&l.contains(c)||i.has(t9)||l.focus({preventScroll:!0}),"element"===h.type))){if(n2(r,N,y,k,v),!f||!t.isCollapsed()||null===l||i.has(t9)||null!==document.activeElement&&l.contains(document.activeElement)||l.focus({preventScroll:!0}),!i.has("skip-scroll-into-view")&&t.isCollapsed()&&null!==l&&l===document.activeElement){let e=nP(t)&&"element"===t.anchor.type?N.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){let n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){let r=iD(n),i=iL(r);if(null===r||null===i)return;let{top:l,bottom:o}=t,s=0,a=0,u=n;for(;null!==u;){let t=u===r.body;if(t){s=0,a=iI(e).innerHeight;let t=i.getComputedStyle(r.documentElement),n=parseFloat(t.scrollPaddingTop),l=parseFloat(t.scrollPaddingBottom);isFinite(n)&&(s+=n),isFinite(l)&&(a-=l)}else{let e=u.getBoundingClientRect();s=e.top,a=e.bottom}let n=0;if(l<s?n=-(s-l):o>a&&(n=o-a),0!==n)if(t)i.scrollBy(0,n);else{let e=u.scrollTop;u.scrollTop+=n;let t=u.scrollTop-e;l-=t,o-=t}if(t)break;u=iA(u)}}(n,t,l)}}tk=!0}}(u,d,e,N,C,l)}!function(e,t,n){let r=e._blockCursorElement;if(nP(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){let i=n.anchor,l=i.getNode(),o=i.offset,s=!1,a=null;if(o===l.getChildrenSize())iW(l.getChildAtIndex(o-1))&&(s=!0);else{let t=l.getChildAtIndex(o);if(null!==t&&iW(t)){let n=t.getPreviousSibling();(null===n||iW(n))&&(s=!0,a=e.getElementByKey(t.__key))}}if(s){let n,i,o,s=e.getElementByKey(l.__key);return null===r&&(n=e._config.theme,(i=document.createElement("div")).contentEditable="false",i.setAttribute("data-lexical-cursor","true"),o=n.blockCursor,void 0!==o&&("string"==typeof o&&(o=n.blockCursor=lU(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&&i$(r,e,t)}(e,l,d)}finally{null!==_&&_.observe(l,rn),n7=p,n9=h}}null!==y&&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,y,C,x,a),nP(d)||null===d||null!==u&&u.is(d)||e.dispatchCommand(eD,void 0);let k=e._pendingDecorators;null!==k&&(e._decorators=k,e._pendingDecorators=null,rp("decorator",e,!0,k
1)),n=io(t||a),n!==(r=io(i))&&rp("textcontent",e,!0,r),rp("update",e,!0,{dirtyElements:v,dirtyLeaves:x,editorState:i,mutatedNodes:y,normalizedNodes:S,prevEditorState:t||a,tags:C}),rm(e,b),function(e){let t=e._updates;if(0!==t.length){let n=t.shift();if(n){let[t,r]=n;ry(e,t,r)}}}(e)}function rp(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);n.has(e)?n.set(e,i):i&&i()}}finally{t._updating=i}}function rm(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 r_(e,t){let n=e._updates,r=t||!1;for(;0!==n.length;){let t=n.shift();if(t){let n,[i,l]=t,s=e._pendingEditorState;void 0!==l&&(n=l.onUpdate,l.skipTransforms&&(r=!0),l.discrete&&(null===s&&o(191),s._flushSync=!0),n&&e._deferred.push(n),rf(e,l.tag)),null==s?ry(e,i,l):i()}}return r}function ry(e,t,n){let r=e._updateTags,i,l=!1,s=!1;void 0!==n&&(i=n.onUpdate,rf(e,n.tag),l=n.skipTransforms||!1,s=n.discrete||!1),i&&e._deferred.push(i);let a=e._editorState,u=e._pendingEditorState,d=!1;(null===u||u._readOnly)&&(u=e._pendingEditorState=rO(u||a),d=!0),u._flushSync=s;let f=n9,c=n8,h=n7,g=e._updating;n9=u,n8=!1,e._updating=!0,n7=e;let p=e._headless||null===e.getRootElement();r$=null;try{var m;let r,i;d&&(p?null!==a._selection&&(u._selection=a._selection.clone()):u._selection=(m=n&&n.event||null,r=e.getEditorState()._selection,i=ij(iI(e)),nP(r)||null==r?nY(r,i,e,m):r.clone()));let s=e._compositionKey;t(),l=r_(e,l),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(nP(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&&(l?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);nb(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&Q(t)}}(u,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,l=r8(),o=new Map,s=n,a=s.size,u=r,d=u.size;for(;a>0||d>0;){if(a>0){for(let e of(t._dirtyLeaves=new Set,s)){let r=i.get(e);nb(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Q(r),void 0!==r&&rd(r,l)&&ru(t,r,o),n.add(e)}if((a=(s=t._dirtyLeaves).size)>0){rt++;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&&rd(a,l)&&ru(t,a,o)}a=(s=t._dirtyLeaves).size,d=(u=t._dirtyElements).size,rt++}t._dirtyLeaves=n,t._dirtyElements=r}(u,e),r_(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()||(rb(t)&&function e(t,n,r,i,l,o){let s=t.getFirstChild();for(;null!==s;){let t=s.__key;s.__parent===n&&(rb(s)&&e(s,t,r,i,l,o),r.has(t)||o.delete(t),l.push(t)),s=s.getNextSibling()}}(t,e,i,l,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of o)l.delete(e);for(let e of n){let t=l.get(e);void 0===t||t.isAttached()||(i.has(e)||n.delete(e),l.delete(e))}}(a,u,e._dirtyLeaves,e._dirtyElements)),s!==e._compositionKey&&(u._flushSync=!0);let f=u._selection;if(nP(f)){let e=u._nodeMap,t=f.anchor.key,n=f.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||o(19)}else nL(f)&&0===f._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 rg(e)}finally{n9=f,n8=c,n7=h,e._updating=g,rt=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,rg(e)):d&&rH(()=>{rg(e)}):(u._flushSync=!1,d&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function rx(e,t,n){n7===e&&void 0===n?t():ry(e,t,n)}class rv{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new rv(this.element,e,this.after)}withAfter(e){return new rv(this.element,this.before,e)}withElement(e){return this.element===e?this:new rv(e,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return null!==t&&t.parentElement!==this.element&&o(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&o(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&o(224),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){null===e?this.removeManagedLineBreak():this.insertManagedLineBreak("decorator"===e&&(y||h||p))}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,i=document.createElement("br");if(n.insertBefore(i,r),e){let e=document.createElement("img");e.setAttribute("data-lexical-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=0;for(let t=this.after;null!==t;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}let i=rS(t,n);i.push(r);let l=rS(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<l.length;e++){let t=i[e],n=l[e];
1if(void 0===t||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}}function rS(e,t){let n=[],r=t;for(;r!==e&&null!==r;r=r.parentNode){let e=0;for(let t=r.previousSibling;null!==t;t=t.previousSibling)e++;n.push(e)}return r!==e&&o(225),n.reverse()}class rC extends t0{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){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()}isDirty(){let e=rs()._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=[],t=this.getFirstChild();for(;null!==t;){if(nb(t)&&e.push(t),rb(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;rb(e);){let t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;rb(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 rb(e)&&e.getLastDescendant()||e||null}let r=t[e];return rb(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return null===e?null:ie(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return null===e&&o(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return null===e?null:ie(e)}getLastChildOrThrow(){let e=this.getLastChild();return null===e&&o(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="",t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),rb(i)&&r!==n-1&&!i.isInline()&&(e+="\n\n")}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),rb(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=k[e];return 0!=(this.getFormat()&t)}return!1}hasTextFormat(e){let t=b[e];return 0!=(this.getTextFormat()&t)}getFormatFlags(e,t){return r3(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){ri();let n=nG(),r=e,i=t,l=this.getChildrenSize();if(!this.canBeEmpty()){if(0===e&&0===t){let e=this.getFirstChild();if(nb(e)||rb(e))return e.select(0,0)}else if((void 0===e||e===l)&&(void 0===t||t===l)){let e=this.getLastChild();if(nb(e)||rb(e))return e.select()}}void 0===r&&(r=l),void 0===i&&(i=l);let o=this.__key;return nP(n)?(n.anchor.set(o,r,"element"),n.focus.set(o,i,"element"),n.dirty=!0,n):nH(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&&k[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,n){tZ(this)&&o(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||o(226,String(e),String(t),String(r));let l=i.__key,s=[],a=[],u=this.getChildAtIndex(e+t),d=null,f=r-t+n.length;if(0!==e)if(e===r)d=this.getLastChild();else{let t=this.getChildAtIndex(e);null!==t&&(d=t.getPreviousSibling())}if(t>0){let e=null===d?this.getFirstChild():d.getNextSibling();for(let n=0;n<t;n++){null===e&&o(100);let t=e.getNextSibling(),n=e.__key;r4(e.getWritable()),a.push(n),e=t}}let c=d;for(let e of n){null!==c&&e.is(c)&&(d=c=c.getPreviousSibling());let t=e.getWritable();t.__parent===l&&f--,r4(t);let n=e.__key;if(null===c)i.__first=n,t.__prev=null;else{let e=c.getWritable();e.__next=n,t.__prev=e.__key}e.__key===l&&o(76),t.__parent=l,s.push(n),c=e}if(e+t===r)null!==c&&(c.getWritable().__next=null,i.__last=c.__key);else if(null!==u){let e=u.getWritable();if(null!==c){let t=c.getWritable();e.__prev=c.__key,t.__next=u.__key}else e.__prev=null}if(i.__size=f,a.length){let e=nG();if(nP(e)){let t=new Set(a),n=new Set(s),{anchor:r,focus:i}=e;rN(r,t,n)&&n0(r,r.getNode(),this,d,u),rN(i,t,n)&&n0(i,i.getNode(),this,d,u),0!==f||this.canBeEmpty()||iR(this)||this.remove()}}return i}getDOMSlot(e){return new rv(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(iJ(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+"px");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||iR(this)||this.getChildren().some(nb)||(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=iQ(t).$getDOMSlot(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 rb(e){return e instanceof rC}function rN(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 rk extends t0{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function rT(e){return e instanceof rk}class rE extends rC{__cachedText;static getType(){return"root"}static clone(){return new rE}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){o(51)}getTextContent(){let e=this.__cachedText;return(rr()||0===rs()._dirtyType)&&null!==e?e:super.getTextContent()}remove(){o(52)}replace(e){o(53)}insertBefore(e){o(54)}insertAfter(e){o(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)rb(e)||rT(e)||o(282);return super.splice(e,t,n)}static importJSON(e){return is().updateFromJSON(e)}collapseAtStart(){return!0}}function rw(e){return e instanceof rE}function rO(e){return new rA(new Map(e._nodeMap))}function rM(){return new rA(new Map([["root",new rE]]))}class rA{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e,t){return rh(t&&t.editor||null,this,e)}clone(e){let t=new rA(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return rh(null,this,()=>({root:function e(t){let n=t.exportJSON(),r=t.constructor;if(n.type!==r.getType()&&o(130,r.name),rb(t)){let i=n.children;Array.isArray(i)||o(59,r.name);let l=t.getChildren();for(let t=0;t<l.length;t++){let n=e(l[t]);i.push(n)}}return n}(is())}))}}class rD extends rC{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class rP extends rC{static getType(){return"paragraph"}static clone(e){return new rP(e.__key)}createDOM(e){let t=document.createElement("p"),n=iN(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:rF,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(iJ(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return rL().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(void 0===e.textFormat||void 0===e.textStyle){let t=this.getChildren().find(nb);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=rL();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(){let e=this.getChildren();if(0===e.length||nb(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function rF(e){let t=rL();if(e.style&&(t.setFormat(e.style.textAlign),i3(e,t)),""===t.getFormatType()){let n=e.getAttribute("align");n&&n&&n in k&&t.setFormat(n)}return{node:t}}function rL(){return iK(new rP)}function rI(e){return e instanceof rP}function rR(e,t,n,r){let i=e._keyToDOMMap;i.clear(),e._editorState=rM(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let l=e._observer;null!==l&&(l.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",i.set("root",n))}let rz={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=rJ(t,e.getType());return n&&void 0!==n.exportDOM?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>
1rb(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>(rb(e)||o(336,e.getKey(),e.getType()),e.getDOMSlot(t)),$shouldExclude:(e,t,n)=>rb(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function rK(e,t){let n=e.get(t);e.delete(t),n&&n()}function rB(e,t,n){return e.set(t,n),rK.bind(null,e,t)}class rW{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,n,r,i,l,o,s){this._createEditorArgs=s,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new 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=ig(),this._onError=i,this._htmlConversions=l,this._editable=o,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){return rB(this._listeners.update,e)}registerEditableListener(e){return rB(this._listeners.editable,e)}registerDecoratorListener(e){return rB(this._listeners.decorator,e)}registerTextContentListener(e){return rB(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return lV(rB(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,n){void 0===n&&o(35);let r=this._commands;r.has(e)||r.set(e,[new M,new M,new M,new M,new M]);let i=r.get(e);void 0===i&&o(36,String(e));let l=7&n,s=i[l];return l!==n?s.addFront(t):s.addBack(t),()=>{s.delete(t),i.every(e=>0===e.size)&&r.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&&o(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=i1(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=i1(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=ie(t);e&&e.markDirty()}},null===e._pendingEditorState?{tag:t5}: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 iO(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 n=iN(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,rR(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){let t=tb.get(e);if(void 0===t)return tG();let n=tN.get(t);if(void 0===n)return tG();let r=n-1;r>=0||o(164),tb.delete(e),tN.set(t,r),0===r&&t.removeEventListener("selectionchange",tV);let i=rX(e);rY(i)?(!function(e){if(null!==e._parentEditor){let t=ih(e),n=t[t.length-1]._key;tH.get(n)===e&&tH.delete(n)}else tH.delete(e._key)}(i),e.__lexicalEditor=null):i&&o(198);let l=tJ(e);for(let e=0;e<l.length;e++)l[e]();e.__lexicalEventHandles=[]}(t),null!=n&&t.classList.remove(...n)),null!==e){let t=iL(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,R(this),this._updateTags.add(t5),rg(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;tb.set(e,n);
1let r=tN.get(n)??0;r<1&&n.addEventListener("selectionchange",tV),tN.set(n,r+1),e.__lexicalEditor=t;let i=tJ(e);for(let n=0;n<ty.length;n++){let[r,l]=ty[n],o="function"==typeof l?e=>{tY(e)||(tq(e),(t.isEditable()||"click"===r)&&l(e,t))}:e=>{if(tY(e))return;tq(e);let n=t.isEditable();switch(r){case"cut":return n&&iO(t,ta,e);case"copy":return iO(t,ts,e);case"paste":return n&&iO(t,ej,e);case"dragstart":return n&&iO(t,ti,e);case"dragover":return n&&iO(t,tl,e);case"dragend":return n&&iO(t,to,e);case"focus":return n&&iO(t,tg,e);case"blur":return n&&iO(t,tp,e);case"drop":return n&&iO(t,tn,e)}};e.addEventListener(r,o),i.push(()=>{e.removeEventListener(r,o)})}}(e,this),null!=n&&e.classList.add(...n)}else this._window=null,this._updateTags.add(t5),rg(this);rp("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&o(38);let n=e;n._readOnly&&((n=rO(e))._selection=e._selection?e._selection.clone():null),I(this);let r=this._pendingEditorState,i=this._updateTags,l=void 0!==t?t.tag:null;null===r||r.isEmpty()||(null!=l&&i.add(l),rg(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=l&&i.add(l),this._updating||rg(this)}parseEditorState(e,t){return function(e,t,n){let r=rM(),i=n9,l=n8,o=n7,s=t._dirtyElements,a=t._dirtyLeaves,u=t._cloneNotNeeded,d=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,n9=r,n8=!1,n7=t,r$=null;try{let i=t._nodes;rc(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=a,t._cloneNotNeeded=u,t._dirtyType=d,n9=i,n8=l,n7=o}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return rg(this),this.getEditorState().read(e,{editor:this})}update(e,t){this._updating?this._updates.push([e,t]):ry(this,e,t)}focus(e,t={}){let n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),rx(this,()=>{var r;
1let i=nG(),l=is();null!==i?i.dirty||iu(i.clone()):0!==l.getChildrenSize()&&("rootStart"===t.defaultSelection?l.selectStart():l.selectEnd()),iP("focus"),r=()=>{n.removeAttribute("autocapitalize"),e&&e()},ri(),rs()._deferred.push(r)}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;null!==e&&e.blur();let t=ij(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,rp("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}rW.version="0.44.0+prod.esm";let r$=null,rj=1;function rU(e,t){let n=rJ(e,t);return void 0===n&&o(30,t),n}function rJ(e,t){return e._nodes.get(t)}let rH="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function rV(e){let t=document.activeElement;if(!iJ(t))return!1;let n=t.nodeName;return rT(ii(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==rX(t))}function rq(e,t,n){let r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!rV(t)&&rG(t)===e}catch(e){return!1}}function rY(e){return e instanceof rW}function rG(e){let t=e;for(;null!=t;){let e=rX(t);if(rY(e))return e;t=iA(t)}return null}function rX(e){return e?e.__lexicalEditor:null}function rQ(e){return nE(e)||e.isToken()}function rZ(e){return rQ(e)||e.isSegmented()}function r0(e){return iH(e)&&3===e.nodeType}function r1(e){return iH(e)&&9===e.nodeType}function r2(e){let t=e;for(;null!=t;){if(r0(t))return t;t=t.firstChild}return null}function r3(e,t,n){let r=b[t];if(null!==n&&(e&r)==(n&r))return e;let i=e^r;return"subscript"===t?i&=~b.superscript:"superscript"===t?i&=~b.subscript:"lowercase"===t?(i&=~b.uppercase,i&=~b.capitalize):"uppercase"===t?(i&=~b.lowercase,i&=~b.capitalize):"capitalize"===t&&(i&=~b.lowercase,i&=~b.uppercase),i}function r5(e){return nb(e)||no(e)||rT(e)}function r6(e,t){let n,r=(n=r$,r$=null,n);if(null!=(t=t||r&&r.__key))return void(e.__key=t);ri(),rl();let i=rs(),l=ro(),o=""+rj++;l._nodeMap.set(o,e),rb(e)?i._dirtyElements.set(o,!0):i._dirtyLeaves.add(o),i._cloneNotNeeded.add(o),i._dirtyType=1,e.__key=o}function r4(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 r9(e){rl(),tZ(e)&&o(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent,r=ro(),i=rs(),l=r._nodeMap,s=i._dirtyElements;null!==n&&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=e.__parent}}(n,l,s);let a=t.__key;i._dirtyType=1,rb(e)?s.set(a,!0):i._dirtyLeaves.add(a)}function r7(e){ri();let t=rs(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){let e=ie(n);null!==e&&e.getWritable()}if(null!==e){let t=ie(e);null!==t&&t.getWritable()}}}function r8(){return rr()?null:rs()._compositionKey}function ie(e,t){let n=(t||ro())._nodeMap.get(e);return void 0===n?null:n}function it(e,t){let n=ir(e,rs());return void 0!==n?ie(n,t):null}function ir(e,t){return e[`__lexicalKey_${t._key}`]}function ii(e,t){let n=e;for(;null!=n;){let e=it(n,t);if(null!==e)return e;n=iA(n)}return null}function il(e){let t=Object.assign({},e._decorators);return e._pendingDecorators=t,t}function io(e){return e.read(()=>is().getTextContent())}function is(){return ia(ro())}function ia(e){return e._nodeMap.get("root")}function iu(e){ri();let t=ro();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function id(e){let t=rs(),n=function(e,t){let n=e;for(;null!=n;){let e=ir(n,t);if(void 0!==e)return e;n=iA(n)}return null}(e,t);return null===n?e===t.getRootElement()?ie("root"):null:ie(n)}function ic(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function ih(e){let t=[];for(let n=e;null!==n;n=n._parentEditor)t.push(n);return t}function ig(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function ip(e){return r0(e)?e.nodeValue:null}function im(e,t,n){let r=ij(iI(t));if(null===r)return;let i=r.anchorNode,{anchorOffset:l,focusOffset:o}=r;if(null!==i){let t=ip(i),r=ii(i);if(null!==t&&nb(r)){if((t===x||t===v)&&n){let e=n.length;t=n,l=e,o=e}null!==t&&i_(r,t,l,o,e)}}}function i_(e,t,n,r,i){let l=e;if(l.isAttached()&&(i||!l.isDirty())){let o=l.isComposing(),s=t;if((o||i)&&(t.endsWith(x)&&(s=t.slice(0,-x.length)),i)){let e;for(;-1!==(e=s.indexOf(v));)s=s.slice(0,e)+s.slice(e+v.length),null!==n&&n>e&&(n=Math.max(e,n-v.length)),null!==r&&r>e&&(r=Math.max(e,r-v.length))}let a=l.getTextContent();if(i||s!==a){if(""===s){if(r7(null),p||h||y)l.remove();else{let e=rs();setTimeout(()=>{e.update(()=>{l.isAttached()&&l.remove()})},20)}return}let t=l.getParent(),i=nX(),a=l.getTextContentSize(),u=r8(),d=l.getKey();if(l.isToken()||null!==u&&d===u&&!o||nP(i)&&(null!==t&&!t.canInsertTextBefore()&&0===i.anchor.offset||i.anchor.key===e.__key&&0===i.anchor.offset&&!l.canInsertTextBefore()&&!o||i.focus.key===e.__key&&i.focus.offset===a&&!l.canInsertTextAfter()&&!o))return void l.markDirty();let f=nG();if(!nP(f)||null===n||null===r)return void iy(l,s,f);if(f.setTextNodeRange(l,n,l,r),l.isSegmented()){let e=nC(l.getTextContent());l.replace(e),l=e}iy(l,s,f)}}}function iy(e,t,n){if(e.setTextContent(t),nP(n)){let t=e.getKey();for(let r of["anchor","focus"]){let i=n[r];"text"===i.type&&i.key===t&&(i.offset=lg(e,i.offset,"clamp"))}}}function ix(e,t,n){let r=t[n]||!1;return"any"===r||r===e[n]}function iv(e,t,n){if(!(ix(e,n,"altKey")&&ix(e,n,"ctrlKey")&&ix(e,n,"shiftKey")&&ix(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}let iS={ctrlKey:!d,metaKey:d},iC={altKey:d,ctrlKey:!d};function ib(e){return"Backspace"===e.key}function iN(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=lU(i);return n[t]=e,e}return i}function ik(e,t,n,r,i){if(0===n.size)return;let l=r.__type,s=r.__key,a=t.get(l);void 0===a&&o(33,l);let u=a.klass,d=e.get(u);void 0===d&&(d=new Map,e.set(u,d));let f=d.get(s),c="destroyed"===f&&"created"===i;(void 0===f||c)&&d.set(s,c?"updated":i)}function iT(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 iE(e,t){let n=e.offset;if("element"===e.type)return iT(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?iT(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function iw(e){let t=iI(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function iO(e,t,n){return function e(t,n,r,i){let l,o=ih(t);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(rx(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,e)}function iM(e,t){let n=e._keyToDOMMap.get(t);return void 0===n&&o(75,t),n}function iA(e){let t=e.assignedSlot||e.parentElement;return iV(t)?t.host:t}function iD(e){return r1(e)?e:iJ(e)?e.ownerDocument:null}function iP(e){ri(),rs()._updateTags.add(e)}function iF(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function iL(e){let t=iD(e);return t?t.defaultView:null}function iI(e){let t=e._window;return null===t&&o(78),t}function iR(e){return rw(e)||rb(e)&&e.isShadowRoot()}function iz(e,t=!1){let n=e.constructor.clone(e);return r6(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function iK(e){let t=rs(),n=e.getType(),r=rJ(t,n);void 0===r&&o(200,e.constructor.name,n);let{replace:i,replaceWithKlass:l}=r;if(null!==i){let t=i(e),r=t.constructor;return null!==l?t instanceof l||o(201,l.name,l.getType(),r.name,r.getType(),e.constructor.name,n):t instanceof e.constructor&&r!==e.constructor||o(202,r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&o(203,e.constructor.name,n,r.name,r.getType()),t}return e}function iB(e,t){!rw(e.getParent())||rb(t)||rT(t)||o(99)}function iW(e){return(rT(e)||rb(e)&&!e.canBeEmpty())&&!e.isInline()}function i$(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;let r=e.parentElement;null!==r&&r.removeChild(e)}function ij(e){return a?(e||window).getSelection():null}function iU(e){return iJ(e)&&"A"===e.tagName}function iJ(e){return iH(e)&&1===e.nodeType}function iH(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function iV(e){return iH(e)&&11===e.nodeType}function iq(e){let t=RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function iY(e){let t=RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)}function iG(e){if(rT(e)&&!e.isInline())return!0;if(!rb(e)||iR(e))return!1;let t=e.getFirstChild(),n=null===t||no(t)||nb(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function iX(){return rs()}function iQ(e=iX()){return e._config.dom||rz}let iZ=new WeakMap,i0=new Map;function i1(e){if(!e._readOnly&&e.isEmpty())return i0;e._readOnly||o(192);let t=iZ.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),iZ.set(e,t)),t}function i2(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function i3(e,t){let n=Math.round((parseInt(e.style.paddingInlineStart,10)||0)/40);t.setIndent(n)}function i5(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==t0[t]}function i6(e){let t=O in e.prototype?e.prototype[O]():void 0,n=function(e){if(!(e===t0||e.prototype instanceof t0)){let t="<unknown>",n="<unknown>";try{t=e.getType()}catch(e){}try{rW.version&&(n=JSON.parse(rW.version))}catch(e){}o(290,e.name,t,n)}return e===rk||e===rC||e===t0}(e),r=!n&&i5(e,"getType")?e.getType():void 0,i,l=r;if(t)if(r)i=t[r];else for(let[e,n]of Object.entries(t))l=e,i=n;if(!n&&l&&(i5(e,"getType")||(e.getType=()=>l),i5(e,"clone")||(e.clone=t=>(r$=t,new e)),i5(e,"importJSON")||(e.importJSON=i&&i.$importJSON||(t=>(new e).updateFromJSON(t))),!i5(e,"importDOM")&&i)){let{importDOM:t}=i;t&&(e.importDOM=()=>t)}return{ownNodeConfig:i,ownNodeType:l}}function i4(e){let t=iX();return ri(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}let i9=(e,t)=>{let n=e;for(;null!=n&&!rw(n);){if(t(n))return n;n=n.getParent()}return null};function i7(e,t){let n=[],r=e.__first;for(;null!==r;){let e=null===t?ie(r):t.get(r);null==e&&o(174),n.push(r),r=e.__next}return n}let i8={next:"previous",previous:"next"};class le{origin;constructor(e){this.origin=e}[Symbol.iterator](){return lS({hasNext:ls,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return lc(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return lc(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,n="next"){let r=n===this.direction?t:Array.from(t).reverse(),i=this,l=this.getParentAtCaret(),s=new Map;for(let t=i.getAdjacentCaret();null!==t&&s.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();s.set(e.getKey(),e)}for(let e of r){if(s.size>0){let t=i.getNodeAtCaret();if(t)if(s.delete(t.getKey()),s.delete(e.getKey()),t.is(e)||i.origin.is(e));else{let n=e.getParent();n&&n.is(l)&&e.remove(),t.replace(e)}else null===t&&o(263,Array.from(s).join(" "))}else i.insert(e);i=lc(e,this.direction)}for(let e of s.values())e.remove();return this}}class lt extends le{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:lp(e,this.direction)}getParentCaret(e="root"){return lc(lr(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=i8[this.direction];return lc(this.getNodeAtCaret(),e)||lp(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof lt&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}let ln={root:rw,shadowRoot:iR};function lr(e,t="root"){return ln[t](e)?null:e}class li extends le{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:lc(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return rb(this.origin)?lp(this.origin,this.direction):null}getParentCaret(e="root"){return lc(lr(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=i8[this.direction];return lc(this.getNodeAtCaret(),e)||lp(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof li&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof li||e instanceof ll)&&this.direction===e.direction&&this.origin.is(e.origin)}}class ll extends le{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:lh(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return lc(lr(this.getParentAtCaret(),e),this.direction)}getFlipped(){return lh(this.origin,i8[this.direction],this.offset)}isSamePointCaret(e){return e instanceof ll&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof li||e instanceof ll)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return lc(this.origin,this.direction)}}function lo(e){return e instanceof ll}function ls(e){return e instanceof li}function la(e){return e instanceof lt}let lu={next:class extends ll{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends ll{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},ld={next:class extends li{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends li{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},lf={next:class extends lt{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends lt{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function lc(e,t){return e?new ld[t](e):null}function lh(e,t,n){return e?new lu[t](e,lg(e,n)):null}function lg(e,t,n="error"){let r=e.getTextContentSize(),i="next"===t?r:"previous"===t?0:t;return(i<0||i>
1r)&&("clamp"!==n&&s(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function lp(e,t){return rb(e)?new lf[t](e):null}function lm(e){var t;return e&&((t=e.getAdjacentCaret())&&t.getChildCaret()||t)}class l_{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 l_(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return lo(t)?function(e,t){let{direction:n,origin:r}=e;return new ly(e,lg(r,"focus"===t?i8[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 ly(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){let t=lo(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=lo(n),i=t=>t.isSameNodeCaret(n)?null:lm(t)||t.getParentCaret(e);return lS({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 ly{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 lh(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}}function lx(e){return lv(e,lc(is(),e.direction))}function lv(e,t){return e.direction!==t.direction&&o(265),new l_(e,t,e.direction)}function lS(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 lC(e,t){let n=lk(e.origin,t.origin);switch(null===n&&o(275,e.origin.getKey(),t.origin.getKey()),n.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 lb(n)}}function lb(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 lN(e){return rb(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function lk(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};let n=new Map;for(let[t,r]=lN(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=lN(t);r;i=r,r=r.getParent()){let l=n.get(r);if(void 0!==l)return null===l?(r.is(e)||o(276),{commonAncestor:r,type:"ancestor"}):null===i?(r.is(t)||o(277),{commonAncestor:r,type:"descendant"}):((rb(l)||l.is(e))&&(rb(i)||i.is(t))&&r.is(l.getParent())&&r.is(i.getParent())||o(278),{a:l,b:i,commonAncestor:r,type:"branch"})}return null}function lT(e,t){var n;let r,{type:i,key:l,offset:s}=e,a=(null===(r=ie(n=e.key))&&o(63,n),r);return"text"===i?(nb(a)||o(266,a.getType(),l),lh(a,t,s)):(rb(a)||o(267,a.getType(),l),lz(a,e.offset,t))}function lE(e,t){let{origin:n,direction:r}=t,i="next"===r;lo(t)?e.set(n.getKey(),t.offset,"text"):ls(t)?nb(n)?e.set(n.getKey(),lg(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,"element"):(la(t)&&rb(n)||o(268),e.set(n.getKey(),i?0:n.getChildrenSize(),"element"))}function lw(e){let t=nG(),n=nP(t)?t:nV();return lO(n,e),iu(n),n}function lO(e,t){lE(e.anchor,t.anchor),lE(e.focus,t.focus)}function lM(e){let{anchor:t,focus:n}=e,r=lT(t,"next"),i=lT(n,"next"),l=0>=lC(r,i)?"next":"previous";return lv(lI(r,l),lI(i,l))}function lA(e){let{direction:t,origin:n}=e,r=lc(n,i8[t]).getNodeAtCaret();return r?lc(r,t):lp(n.getParentOrThrow(),t)}function lD(e,t="root"){let n=[e];for(let r=la(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;r=r.getParentCaret(t))n.push(lA(r));return n}function lP(e){return!!e&&e.origin.isAttached()}function lF(e){let t=function(e){let t=e;for(;la(t);){let e=lm(t);if(!la(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(nb(t.origin))return lo(t)?t:lh(t.origin,n,n);let r=t.getAdjacentCaret();
1return ls(r)&&nb(r.origin)?lh(r.origin,n,i8[n]):t}function lL(e){return lo(e)&&e.offset!==lg(e.origin,e.direction)}function lI(e,t){return e.direction===t?e:e.getFlipped()}function lR(e,t){return e.direction===t?e:lv(lI(e.focus,t),lI(e.anchor,t))}function lz(e,t,n){let r=lp(e,"next");for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(null===e)break;r=e}return lI(r,n)}function lK(e){let{origin:t,offset:n,direction:r}=e;if(n===lg(t,r))return e.getSiblingCaret();if(n===lg(t,i8[r]))return lA(e.getSiblingCaret());let[i]=t.splitText(n);return nb(i)||o(281),lI(lc(i,"next"),r)}function lB(e,t){return!0}function lW(e,{$copyElementNode:t=iz,$splitTextPointCaretNext:n=lK,rootMode:r="shadowRoot",$shouldSplit:i=lB,removeEmptyDestination:l=!1}={}){if(lo(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(la(e)){let e=lA(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 l$(...e){return e}function lj(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function lU(...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 lJ(e,...t){let n=lU(...t);n.length>0&&e.classList.add(...n)}function lH(e,...t){let n=lU(...t);n.length>0&&e.classList.remove(...n)}function lV(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function lq(e){let t=iX().getElementByKey(e.getKey());if(null===t)return null;let n=t.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(t)}function lY(e){return lq(rw(e)?e:e.getParentOrThrow())}function lG(e){let t=lY(e);return null!==t&&"rtl"===t.direction}function lX(e,t,n="self"){let r=e.getStartEndPoints();if(t.isSelected(e)&&!rZ(t)&&null!==r){let[l,o]=r,s=e.isBackward(),a=l.getNode(),u=o.getNode(),d=t.is(a),f=t.is(u);if(d||f){var i;let[r,l]=nR(e),o=a.is(u),d=t.is(s?u:a),f=t.is(s?a:u),c,h=0;o?(h=r>l?l:r,c=r>l?r:l):d?(h=s?l:r,c=void 0):f&&(h=0,c=s?r:l);let g=t.__text.slice(h,c);g!==t.__text&&("clone"===n&&((i=i2(t))[tQ]=!0,t=i),t.__text=g)}}return t}let lQ=()=>{};function lZ(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function l0(e,t,n=lZ){if(null===e)return;let r=e.getStartEndPoints(),i=new Map,l=null;if(r){let[e,t]=r;(l=nV()).anchor.set(e.key,e.offset,e.type),l.focus.set(t.key,t.offset,t.type);let n=i9(e.getNode(),iG),o=i9(t.getNode(),iG);rb(n)&&i.set(n.getKey(),n),rb(o)&&i.set(o.getKey(),o)}for(let t of e.getNodes())if(rb(t)&&iG(t))i.set(t.getKey(),t);else if(null===r){let e=i9(t,iG);rb(e)&&i.set(e.getKey(),e)}for(let[e,r]of i){let i=t();n(r,i),r.replace(i,!0),l&&(e===l.anchor.key&&l.anchor.set(i.getKey(),l.anchor.offset,l.anchor.type),e===l.focus.key&&l.focus.set(i.getKey(),l.focus.offset,l.focus.type))}l&&e.is(nG())&&iu(l)}function l1(e){let t=l2(e);return null!==t&&"vertical-rl"===t.writingMode}function l2(e){let t=e.anchor.getNode();return rb(t)?lq(t):lY(t)}function l3(e,t){let n=l1(e)?!t:t;l5(e)&&(n=!n);let r=lT(e.focus,n?"previous":"next");if(lL(r))return!1;for(let e of lx(r)){if(la(e))return!e.origin.isInline();if(!rb(e.origin)){if(rT(e.origin))return!0;break}}return!1}function l5(e){let t=l2(e);return null!==t&&"rtl"===t.direction}function l6(e,t,n){let r,i=l5(e);r=l1(e)||i?!n:n,e.modify(t?"extend":"move",r,"character")}function l4(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let n of(r.append("code",e),t))r.append("v",n);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let l9="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,l7=l9&&"documentMode"in document?document.documentMode:null,l8=(l9&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),l9&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent));l9&&"InputEvent"in window&&!l7&&new window.InputEvent("input"),l9&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,l9&&/Android/.test(navigator.userAgent),l9&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),l9&&/^(?=.*Chrome).*/i.test(navigator.userAgent),l9&&/AppleWeb
1Kit\/[\d.]+/.test(navigator.userAgent);function oe(e){let t=i9(e,e=>rb(e)&&!e.isInline());return rb(t)||l4(4,e.__key),t}function ot(e,t,n){let r=lI(t,"next");lo(r)&&(0===r.offset?r=lc(r.origin,"previous").getFlipped():r.offset===r.origin.getTextContentSize()&&(r=lc(r.origin,"next"))),r.origin.is(e)&&(ls(r)||l4(342,e.getKey(),e.getType()),r=lA(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=lW(e,n))r=e;return lo(r)&&l4(283),r.insert(e.isInline()?rL().append(e):e),lI(lc(e.getLatest(),"next"),t.direction)}function on(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function or(e){let t=nG();if(!nP(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],l=i.getKey();if(n.has(l))continue;let o=i9(i,e=>rb(e)&&!e.isInline());if(null===o)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}let oi=!(l8||!l9)&&void 0,ol=Symbol.for("preact-signals");function oo(){if(ou>1)return void ou--;let e,t=!1;for(!function(){let e=oa;for(oa=void 0;void 0!==e;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();void 0!==n;){let r=n;for(n=void 0,od++;void 0!==r;){let n=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&op(r))try{r.c()}catch(n){t||(e=n,t=!0)}r=n}}if(od=0,ou--,t)throw e}function os(e){let n=t;t=void 0;try{return e()}finally{t=n}}let oa,ou=0,od=0,of=0,oc=0;function oh(e){if(void 0===t)return;let n=e.n;return void 0===n||n.t!==t?(n={i:0,S:e,p:t.s,n:void 0,t:t,e:void 0,x:void 0,r:n},void 0!==t.s&&(t.s.n=n),t.s=n,e.n=n,32&t.f&&e.S(n),n):-1===n.i?(n.i=0,void 0!==n.n&&(n.n.p=n.p,void 0!==n.p&&(n.p.n=n.n),n.p=t.s,n.n=void 0,t.s.n=n,t.s=n),n):void 0}function og(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function op(e){for(let t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function om(e){for(let t=e.s;void 0!==t;t=t.n){let n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function o_(e){let t,n=e.s;for(;void 0!==n;){let e=n.p;-1===n.i?(n.S.U(n),void 0!==e&&(e.n=n.n),void 0!==n.n&&(n.n.p=e)):t=n,n.S.n=n.r,void 0!==n.r&&(n.r=void 0),n=e}e.s=t}function oy(e,t){og.call(this,void 0),this.x=e,this.s=void 0,this.g=oc-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function ox(e){let n=e.m;if(e.m=void 0,"function"==typeof n){ou++;let r=t;t=void 0;try{n()}catch(t){throw e.f&=-2,e.f|=8,ov(e),t}finally{t=r,oo()}}}function ov(e){for(let t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ox(e)}function oS(e){if(t!==this)throw Error("Out-of-order effect");o_(this),t=e,this.f&=-2,8&this.f&&ov(this),oo()}function oC(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=null==t?void 0:t.name}function ob(e,t){let n=new oC(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}function oN(e,t={}){let n={};for(let r in e){let i=t[r],l=new og(void 0===i?e[r]:i,void 0);n[r]=l}return n}function ok(e){return("function"==typeof e.nodes?e.nodes():e.nodes)||[]}og.prototype.brand=ol,og.prototype.h=function(){return!0},og.prototype.S=function(e){let t=this.t;t!==e&&void 0===e.e&&(e.x=t,this.t=e,void 0!==t?t.e=e:os(()=>{var e;null==(e=this.W)||e.call(this)}))},og.prototype.U=function(e){if(void 0!==this.t){let t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,void 0===n&&os(()=>{var e;null==(e=this.Z)||e.call(this)}))}},og.prototype.subscribe=function(e){return ob(()=>{let n=this.value,r=t;t=void 0;try{e(n)}finally{t=r}},{name:"sub"})},og.prototype.valueOf=function(){return this.value},og.prototype.toString=function(){return this.value+""},og.prototype.toJSON=function(){return this.value},og.prototype.peek=function(){let e=t;t=void 0;try{return this.value}finally{t=e}},Object.defineProperty(og.prototype,"value",{get(){let e=oh(this);return void 0!==e&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(od>100)throw Error("Cycle detected");0!==ou&&0===od&&this.l!==of&&(this.l=of,oa={S:this,v:this.v,i:this.i,o:oa}),this.v=e,this.i++,oc++,ou++;try{for(let e=this.t;void 0!==e;e=e.x)e.t.N()}finally{oo()}}}}),oy.prototype=new og,oy.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f)||(this.f&=-5,this.g===oc))return!0;
1if(this.g=oc,this.f|=1,this.i>0&&!op(this))return this.f&=-2,!0;let e=t;try{om(this),t=this;let e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return t=e,o_(this),this.f&=-2,!0},oy.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(let e=this.s;void 0!==e;e=e.n)e.S.S(e)}og.prototype.S.call(this,e)},oy.prototype.U=function(e){if(void 0!==this.t&&(og.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(let e=this.s;void 0!==e;e=e.n)e.S.U(e)}},oy.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(oy.prototype,"value",{get(){if(1&this.f)throw Error("Cycle detected");let e=oh(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),oC.prototype.c=function(){let e=this.S();try{if(8&this.f||void 0===this.x)return;let e=this.x();"function"==typeof e&&(this.m=e)}finally{e()}},oC.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,ox(this),om(this),ou++;let e=t;return t=this,oS.bind(this,e)},oC.prototype.N=function(){2&this.f||(this.f|=2,this.u=n,n=this)},oC.prototype.d=function(){this.f|=8,1&this.f||ov(this)},oC.prototype.dispose=function(){this.d()};K("format",{parse:e=>"number"==typeof e?e:0});function oT(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let n of(r.append("code",e),t))r.append("v",n);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let oE=new Set;class ow{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):lj;for(let n of this.configs)e=t(e,n);return e}init(e){let t,n=this.state;2===n.id||oT(306,String(n.id));let r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},i={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},l=Object.assign(n,{config:this.mergeConfigs(),id:3,registerState:r});this.state=l,this.extension.init&&(t=this.extension.init(e,l.config,r)),this.state=Object.assign(l,{id:4,initResult:t,registerState:i})}build(e){let t,n=this.state;4!==n.id&&oT(307,String(n.id),String(5)),this.extension.build&&(t=this.extension.build(e,n.config,n.registerState));let r={...n.registerState,getOutput:()=>t,getSignal:this.getSignal.bind(this)};this.state=Object.assign(n,{id:5,output:t,registerState:r})}register(e,t){this._signal=t;let n=this.state;5!==n.id&&oT(308,String(n.id),String(5));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=Object.assign(n,{id:6}),()=>{let e=this.state;7!==e.id&&oT(309,String(n.id),String(7)),this.state=Object.assign(e,{id:5}),r&&r()}}afterRegistration(e){let t,n=this.state;return 6!==n.id&&oT(310,String(n.id),String(6)),this.extension.afterRegistration&&(t=this.extension.afterRegistration(e,n.config,n.registerState)),this.state=Object.assign(n,{id:7}),t}getSignal(){return void 0===this._signal&&oT(311),this._signal}getInitResult(){void 0===this.extension.init&&oT(312,this.extension.name);let e=this.state;return e.id>=4||oT(313,String(e.id),String(4)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return e.id>=3||oT(314,String(e.id),String(3)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return void 0===t&&oT(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return void 0===t&&oT(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return e.id>=7||oT(316,String(e.id),String(7)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||oE}getPeerNameSet(){let e=this._peerNameSet;
1return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;e.id>=5||oT(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}let oO={tag:t5};function oM(){let e=is();e.isEmpty()&&e.append(rL())}let oA={config:{setOptions:oO,updateOptions:oO},init:({$initialEditorState:e=oM})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(r instanceof rA)e.setEditorState(r,n);else if("function"==typeof r)e.update(()=>{r(e)},t);else if(r&&("string"==typeof r||"object"==typeof r)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[rE,ng,nr,nk,rP]},oD=Symbol.for("@lexical/extension/LexicalBuilder");function oP(){}function oF(e){throw e}function oL(e){return Array.isArray(e)?e:[e]}let oI="0.44.0+prod.esm";class oR{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){for(const t of(this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=oI,this.roots=e,e))this.addExtension(t)}static fromExtensions(e){let t=[oL(oA)];for(let n of e)t.push(oL(n));return new oR(t)}static maybeFromEditor(e){let t=e[oD];return t&&(t.PACKAGE_VERSION!==oI&&oT(292,t.PACKAGE_VERSION,oI),t instanceof oR||oT(293)),t}static fromEditor(e){let t=oR.maybeFromEditor(e);return void 0===t&&oT(294),t}constructEditor(){let{$initialEditorState:e,onError:t,...n}=this.buildCreateEditorArgs(),r=Object.assign(function(e){var t,n;let r,i,l,o,s=e||{},a=n7,u=s.theme||{},d=void 0===e?a:s.parentEditor||null,f=s.disableEvents||!1,c=rM(),h=s.namespace||(null!==d?d._config.namespace:ig()),g=s.editorState,p=[rE,ng,nr,nk,rP,rD,...s.nodes||[]],{onError:m,html:_}=s,y=void 0===s.editable||s.editable;if(void 0===e&&null!==a)r=a._nodes;else{r=new Map;for(let e=0;e<p.length;e++){let t=p[e],n=null,i=null;if("function"!=typeof t){let e=t;t=e.replace,n=e.with,i=e.withKlass||null}i6(t);let l=t.getType(),o=function(e){let t=new Set,n=new Set,r=e;for(;r;){let{ownNodeConfig:e}=i6(r),i=r.transform;if(!n.has(i)){n.add(i);let e=r.transform();e&&t.add(e)}if(e){let n=e.$transform;n&&t.add(n),r=e.extends}else{let e=Object.getPrototypeOf(r);r=e.prototype instanceof t0&&e!==t0?e:void 0}}return t}(t);r.set(l,{exportDOM:_&&_.export?_.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:i,sharedNodeState:function(e){let t=new Map,n=new Set;for(let r="function"==typeof e?e:e.replace;r.prototype&&void 0!==r.prototype.getType;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=i6(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;"stateConfig"in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}(p[e]),transforms:o})}}let x=new rW(c,d,r,{disableEvents:f,dom:{...rz,...e&&e.dom},namespace:h,theme:u},m||console.error,(t=r,n=_?_.import:void 0,i=new Map,l=new Set,o=e=>{Object.keys(e).forEach(t=>{let n=i.get(t);void 0===n&&(n=[],i.set(t,n)),n.push(e[t])})},t.forEach(e=>{let t=e.klass.importDOM;if(null==t||l.has(t))return;l.add(t);let n=t.call(e.klass);null!==n&&o(n)}),n&&o(n),i),y,e);return void 0!==g&&(x._pendingEditorState=g,x._dirtyType=2),x.registerCommand(eL,tK,0),x.registerCommand(eI,tB,0),x.registerCommand(eR,tW,0),x.registerCommand(ez,t$,0),x.registerCommand(eG,tU,0),x}({...n,...t?{onError:e=>{t(e,r)}}:{}}),{[oD]:this});for(let e of this.sortedExtensionReps())e.build(r);return r}buildEditor(){let e=oP;function t(){try{e()}finally{e=oP}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});
1return e=lV(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&oT(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){void 0!==this._sortedExtensionReps&&oT(296);let[t]=oL(e);"string"!=typeof t.name&&oT(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(void 0!==n&&n.extension!==t&&oT(298,t.name),!n){n=new ow(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);for(let n of("string"==typeof e&&oT(299,t.name,e),t.conflictsWith||[]))this.extensionNameMap.has(n)&&oT(299,t.name,n),this.conflicts.set(n,t.name);for(let e of t.dependencies||[]){let n=oL(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{var i,l;let o=n.state;if(2===o.id)return;let s=n.extension.name;0===o.id||oT(300,s,r||"[unknown]"),0===(i=o).id||oT(304,String(i.id),String(0)),n.state=o=Object.assign(i,{id:1});let a=this.outgoingConfigEdges.get(s);if(a)for(let e of a.keys()){let n=this.extensionNameMap.get(e);n&&t(n,s)}1===(l=o).id||oT(305,String(l.id),String(1)),n.state=o=Object.assign(l,{id:2}),e.push(n)};for(let e of this.extensionNameMap.values())0===e.state.id&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);for(let r of(void 0===n&&oT(301,e.name),t))n.configs.add(r)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return lV(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},l={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(void 0!==o.onError&&(e.onError=o.onError),void 0!==o.disableEvents&&(e.disableEvents=o.disableEvents),void 0!==o.parentEditor&&(e.parentEditor=o.parentEditor),void 0!==o.editable&&(e.editable=o.editable),void 0!==o.namespace&&(e.namespace=o.namespace),void 0!==o.$initialEditorState&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of ok(o)){if("function"!=typeof e){let t=n.get(e.replace);t&&oT(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&function e(t,n){if(t&&n&&!Array.isArray(n)&&"object"==typeof t&&"object"==typeof n){for(let r in n)t[r]=e(t[r],n[r]);return t}return n}(l,o.theme)}Object.keys(l).length>0&&(e.theme=l),t.size&&(e.nodes=[...t]);let s=Object.keys(i).length>0,a=r.size>0;for(let t of((s||a)&&(e.html={},s&&(e.html.import=i),a&&(e.html.export=r)),o))t.init(e);return e.onError||(e.onError=oF),e}}function oz(e,t){let n=oR.fromEditor(e).getExtensionRep(t);return void 0===n&&oT(303,t.name),n.getExtensionDependency()}eA("INSERT_HORIZONTAL_RULE_COMMAND");class oK extends rk{static getType(){return"horizontalrule"}static clone(e){return new oK(e.__key)}static importJSON(e){return i4(oK).updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:oB,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){let t=document.createElement("hr");return lJ(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}}function oB(){return{node:i4(oK)}}function oW(e){return e.canBeEmpty()}let o$={build:(e,t,n)=>oN(t),config:{$canIndent:oW,disabled:!1,maxIndent:null},name:"@lexical/extension/TabIndentation",register(e,t,n){let{disabled:r,maxIndent:i,$canIndent:l}=n.getOutput();return ob(()=>{if(!r.value)return function(e,t,n=oW){return lV(e.registerCommand(e7,t=>{let n=nG();if(!nP(n))return!1;t.preventDefault();let r=!function(e){if(e.getNodes().filter(e=>nJ(e)&&e.canIndent()).length>0)return!0;let t=e.anchor,n=e.focus,r=n.isBefore(t)?n:t,i=oe(r.getNode());if(i.canIndent()){let e=i.getKey(),t=nV();
1if(t.anchor.set(e,0,"element"),t.focus.set(e,0,"element"),(t=Z(t)).anchor.is(r))return!0}return!1}(n)?e8:t.shiftKey?tt:te;return e.dispatchCommand(r,void 0)},0),e.registerCommand(te,()=>{let e="number"==typeof t?t:t?t.peek():null;if(!nP(nG()))return!1;let r="function"==typeof n?n:n.peek();return or(t=>{if(r(t)){let n=t.getIndent()+1;(!e||n<e)&&t.setIndent(n)}})},4))}(e,i,l)})}};function oj(e){e.undoStack=[],e.redoStack=[],e.current=null}let oU={build:(e,{delay:t,createInitialHistoryState:n,disabled:r,now:i})=>oN({delay:t,disabled:r,historyState:n(e),now:i}),config:{createInitialHistoryState:function(){return{current:null,redoStack:[],undoStack:[]}},delay:300,disabled:"u"<typeof window,now:Date.now},name:"@lexical/history/History",register:(e,t,n)=>{let r=n.getOutput();return ob(()=>r.disabled.value?void 0:function(e,t,n,r=Date.now){let i,l,o,s,a,u=(i=r(),l=0,o=i,s=0,a=null,(t,u,d,f,c,h)=>{let g=r();if(h.has(t7)&&(o=i,s=l,a=t),h.has(t2))return l=0,i=g,2;h.has(t8)&&a&&(i=o,l=s,t=a);let p=function(e,t,n,r,i){if(null===e||0===n.size&&0===r.size&&!i)return 0;let l=t._selection,o=e._selection;if(i)return 1;if(!(nP(l)&&nP(o)&&o.isCollapsed()&&l.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);void 0!==t&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);void 0===n||rw(n)||i.push(n)}return i}(t,n,r);if(0===s.length)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(l.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&nb(r)&&1===r.__text.length&&1===l.anchor.offset?2:0}let a=s[0],u=e._nodeMap.get(a.__key);if(!nb(u)||!nb(a)||u.__mode!==a.__mode)return 0;let d=u.__text,f=a.__text;if(d===f)return 0;let c=l.anchor,h=o.anchor;if(c.key!==h.key||"text"!==c.type)return 0;let g=c.offset,p=h.offset,m=f.length-d.length;return 1===m&&p===g-1?2:-1===m&&p===g+1?3:4*(-1===m&&p===g)}(t,u,f,c,e.isComposing()),m=(()=>{var r,o;let s,a,m,_,y=null===d||d.editor===e,x=h.has(t3);if(!x&&y&&h.has(t5))return 0;if(1===p)return 2;if(null===t)return 1;let v=u._selection;if(!(f.size>0||c.size>0))return 2*(null===v);let S="number"==typeof n?n:n.peek();return!1===x&&0!==p&&p===l&&g<i+S&&y?0:1!==f.size||(r=Array.from(f)[0],s=(o=t)._nodeMap.get(r),a=u._nodeMap.get(r),m=o._selection,_=u._selection,nP(m)&&nP(_)&&"element"===m.anchor.type&&"element"===m.focus.type&&"text"===_.anchor.type&&"text"===_.focus.type||!nb(s)||!nb(a)||s.__parent!==a.__parent||JSON.stringify(o.read(()=>s.exportJSON()))!==JSON.stringify(u.read(()=>a.exportJSON())))?1:0})();return i=g,l=p,m});return lV(e.registerCommand(eq,()=>((function(e,t){let n=t.redoStack,r=t.undoStack;if(0!==r.length){let i=t.current,l=r.pop();null!==i&&(n.push(i),e.dispatchCommand(tc,!0)),0===r.length&&e.dispatchCommand(th,!1),t.current=l||null,l&&l.editor.setEditorState(l.editorState,{tag:t2})}})(e,t),!0),0),e.registerCommand(eY,()=>((function(e,t){let n=t.redoStack,r=t.undoStack;if(0!==n.length){let i=t.current;null!==i&&(r.push(i),e.dispatchCommand(th,!0));let l=n.pop();0===n.length&&e.dispatchCommand(tc,!1),t.current=l||null,l&&l.editor.setEditorState(l.editorState,{tag:t2})}})(e,t),!0),0),e.registerCommand(td,()=>(oj(t),!1),0),e.registerCommand(tf,()=>(oj(t),e.dispatchCommand(tc,!1),e.dispatchCommand(th,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:l,tags:o})=>{let s=t.current,a=t.redoStack,d=t.undoStack,f=null===s?null:s.editorState;if(null!==s&&n===f)return;let c=u(r,n,s,i,l,o);if(1===c)0!==a.length&&(t.redoStack=[],e.dispatchCommand(tc,!1)),null!==s&&(d.push({...s}),e.dispatchCommand(th,!0));else if(2===c)return;t.current={editor:e,editorState:n}}))}(e,r.historyState.value,r.delay,()=>r.now.peek()()))}};function oJ(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let n of(r.append("code",e),t))r.append("v",n);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function oH(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function oV(e){return r&&r.editor===e?r:void 0}function oq(e,t){let n=t;for(let r of e){let[e,i]=function(e,t){if("cfg"in t){let{cfg:n,updater:r}=t;return[n,r(oH(e,n))]}return t}(n,r),l=e.key;if(n===t&&oH(n,e)===i)continue;let o=n||Object.create(t||null);o[l]=i,n=o}return n}l$(oU,{disabled:!0});let oY="@lexical/html/DOM",oG=Symbol.for("@lexical/html/DOMExportContext"),oX=()=>!0;function oQ(e){return(t,n,r)=>e(t,r)}function oZ(e){return(t,n,r,i)=>e(t,n,i)}function o0(e){return(t,n,r,i,l)=>e(t,n,r,l)}function o1(e){return(t,n,r,i,l,o)=>e(t,n,r,i,o)}function o2(e,t){return(n,r)=>{let i=()=>e(n,r),l=t(n);return l?l(n,i,r):i()}}function o3(e,t){return(n,r,i)=>{let l=()=>e(n,r,i),o=t(n);return o?o(n,r,l,i):l()}}function o5(e,t){return(n,r,i,l)=>{let o=()=>e(n,r,i,l),s=t(n);return s?s(n,r,i,o,l):o()}}function o6(e,t){return(n,r,i,l,o)=>{let s=()=>e(n,r,i,l,o),a=t(n);return a?a(n,r,i,l,s,o):s()}}function o4(e,t){return(n,r,i,l)=>{e(n,r,i,l);let o=t(n);o&&o(n,r,i,l)}}function o9(e,t,n,r,i){let l=n[t];for(let n of e[t])if("function"==typeof n[0]){let[e,t]=n;l=r(l,n=>e(n)&&t||void 0)}else{let e=n[1],t={};for(let n in e){let i=e[n];i&&(t[n]=i.reduce((e,t)=>
1r(e,()=>t),l))}l=r(l,e=>{let n=t[e.getType()];return n&&i(n)})}n[t]=l}function o7(e){return e}let o8={build:(e,t,n)=>({defaults:oq(t.contextDefaults,void 0)}),config:{contextDefaults:[],overrides:[]},html:{export:new Map([[rE,()=>{let e=document.createElement("div");return e.role="textbox",{element:e}}]])},init(e,t){e.dom=function(e,{overrides:t}){let n=function(e,t){let n=function(e){let t={},{nodes:n}=function(e){let t=new Set,n=new Set;for(let r of ok(e)){let e="function"==typeof r?r:r.replace;i6(e),t.add(e.getType()),n.add(e)}return{nodes:n,types:t}}(e);for(let e of n)t[e.getType()]={klass:e,types:{}};for(let e of Object.values(t))if(e){let n=e.klass.getType();for(let{klass:r}=e;t1(r.prototype);r=Object.getPrototypeOf(r)){let{ownNodeType:e}=i6(r),i=e&&t[e];i&&(i.types[n]=!0)}}return t}(e),r={$createDOM:[],$decorateDOM:[],$exportDOM:[],$extractWithChild:[],$getDOMSlot:[],$shouldExclude:[],$shouldInclude:[],$updateDOM:[]};for(let e of function(e){let t=[],n=[],r=[];for(let i of e)if("*"===i.nodes)t.push(i);else if(Array.isArray(i.nodes))for(let e of i.nodes)t1(e.prototype)?r.push(1===i.nodes.length?i:{...i,nodes:[e]}):n.push(1===i.nodes.length?i:{...i,nodes:[e]});let i=new Map,l=e=>{let t=i.get(e);if(void 0===t){t=0;for(let n=e;t1(n.prototype);n=Object.getPrototypeOf(n))t++;i.set(e,t)}return t};return r.sort((e,t)=>l(e.nodes[0])-l(t.nodes[0])),[...r,...n,...t]}(t)){let t=function(e,{nodes:t}){if("*"===t)return oX;let n={},r=[];for(let i of t)if("getType"in i){let t=i.getType();if(n){let r=e[t];void 0===r&&oJ(339,i.name,t),n=Object.assign(n,r.types)}r.push(function(e){return t=>t instanceof e}(i))}else n=void 0,r.push(i);return n||(1===r.length?r[0]:e=>{for(let t of r)if(t(e))return!0;return!1})}(n,e);for(let n in r)!function(e,t,n,r){if(!r)return;let i=e[t];if("function"==typeof n)i.push([n,r]);else{let e,t=i[i.length-1];for(let l in t&&"types"===t[0]?e=t[1]:(e={},i.push(["types",e])),n){let t=e[l]||[];e[l]=t,t.push(r)}}}(r,n,t,e[n])}return r}(e,t),r={...rz,...e.dom};return o9(n,"$createDOM",r,o2,oQ),o9(n,"$exportDOM",r,o2,oQ),o9(n,"$extractWithChild",r,o6,o1),o9(n,"$getDOMSlot",r,o3,oZ),o9(n,"$shouldExclude",r,o3,oZ),o9(n,"$shouldInclude",r,o3,oZ),o9(n,"$updateDOM",r,o5,o0),o9(n,"$decorateDOM",r,o4,o7),r}(e,t)},mergeConfig(e,t){let n=lj(e,t);for(let r of["overrides","contextDefaults"])t[r]&&(n[r]=[...e[r],...t[r]]);return n},name:oY};function se(e,t,n){return Object.assign(K(Symbol(e),{isEqual:n,parse:t}),{[oG]:!0})}se("root",Boolean);let st=se("isExport",Boolean),sn=function(e,t=()=>{}){return(n,i=iX())=>l=>{let o=oV(i),s=o&&o[e],a=oq(n,s||t(i));return a&&a!==s?function(e,t,n,i=iX()){let l=r,o=oV(i);try{return r={...o,editor:i,[e]:t},n()}finally{r=l}}(e,a,l,i):l()}}(oG,function(e){let t=oR.maybeFromEditor(e);return t&&t.hasExtensionByName(oY)?oz(e,o8).output.defaults:void 0}),sr=new Set(["STYLE","SCRIPT"]);function si(e,t){r1(t)&&function(e){if(null===e.querySelector("style"))return;let t=new Map;try{for(let n of Array.from(e.styleSheets)){let r;try{r=n.cssRules}catch(e){continue}for(let n of Array.from(r)){let r;if(n.constructor.name===CSSStyleRule.name){try{r=e.querySelectorAll(n.selectorText)}catch(e){continue}for(let e of Array.from(r)){if(!iJ(e))continue;let r=function(e){let n=t.get(e);if(void 0===n){n=new Set;for(let t=0;t<e.style.length;t++)n.add(e.style[t]);t.set(e,n)}return n}(e);for(let t=0;t<n.style.length;t++){let i=n.style[t];r.has(i)||e.style.setProperty(i,n.style.getPropertyValue(i),n.style.getPropertyPriority(i))}}}}}}catch(e){}}(t);let n=r1(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!sr.has(t.nodeName)){let n=function e(t,n,r,i,l=new Map,o){let s=[];if(sr.has(t.nodeName))return s;let a=null,u=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(void 0!==r)for(let t of r){let n=t(e);null!==n&&(null===i||(i.priority||0)<=(n.priority||0))&&(i=n)}return null!==i?i.conversion:null}(t,n),d=u?u(t):null,f=null;if(null!==d){f=d.after;let e=d.node;if(null!==(a=Array.isArray(e)?e[e.length-1]:e)){for(let[,e]of l)if(!(a=e(a,o)))break;a&&s.push(...Array.isArray(e)?e:[a])}null!=d.forChild&&l.set(t.nodeName,d.forChild)}let c=t.childNodes,h=[],g=(null==a||!iR(a))&&(null!=a&&nJ(a)||i);for(let t=0;t<c.length;t++)h.push(...e(c[t],n,r,g,new Map(l),a));if(null!=f&&(h=f(h)),iY(t)&&(h=function(e,t,n){let r=e.style.textAlign,i=[],l=[];for(let e=0;e<t.length;e++){let o=t[e];if(nJ(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(l.push(o),e===t.length-1||e<t.length-1&&nJ(t[e+1])){let e=n();e.setFormat(r),e.append(...l),i.push(e),l=[]}}return i}(t,h,g?()=>{let e=new rD;return r.push(e),e}:rL)),null==a)if(h.length>0)for(let e of h)s.push(e);else iY(t)&&null!=t.nextSibling&&null!=t.previousSibling&&iq(t.nextSibling)&&iq(t.previousSibling)&&s.push(nl());else rb(a)&&a.append(...h);return s}(t,e,i,!1);if(null!==n)for(let e of n)r.push(e)}return function(e){for(let t of e)t.getParent()&&t.getNextSibling()instanceof rD&&t.insertAfter(nl());for(let t of e){let e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function sl(t,n=null){return("u"<typeof document||"u"<typeof window&&void 0===e.g.window)&&oJ(338),function(e,t=null,n=iX()){return sn([[st,!0]],n)(()=>{let r=is(),i=iQ(n),l=e.append.bind(e);for(let e of r.getChildren())!function e(t,n,r,i=null,l=iQ(t)){let o=l.$shouldInclude(n,i,t),s=l.$shouldExclude(n,i,t),a=n;null!==i&&nb(n)&&(a=lX(i,n,"clone"));let{element:u,after:d,append:f,$getChildNodes:c}=l.$exportDOM(a,t);
1if(!u)return!1;let h=document.createDocumentFragment(),g=c?c():rb(a)?a.getChildren():[],p=h.append.bind(h);for(let r of g){let s=e(t,r,p,i,l);!o&&s&&l.$extractWithChild(n,r,i,"html",t)&&(o=!0)}if(o&&!s){if((iJ(u)||iV(u))&&(f?f(h):u.append(h)),r(u),d){let e=d.call(a,u);e&&(iV(u)?u.replaceChildren(e):u.replaceWith(e))}}else r(h);return o}(n,e,l,t,i);return e})}(document.createElement("div"),n,t).innerHTML}function so(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let n of(r.append("code",e),t))r.append("v",n);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ss(e){let t=e.getParent();sE(t)||so(40);let n=t;for(;null!==n;)sE(n=n.getParent())&&(t=n);return t}function sa(e){return sv(e)&&sE(e.getFirstChild())}function su(e){return sx().append(e)}function sd(e,t){return sv(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function sf(e){let t=nG();if(null!==t){let n=t.getNodes();if(nP(t)){let r=t.getStartEndPoints();null===r&&so(143);let[i]=r,l=i.getNode(),o=l.getParent();if(iR(l)){let e=l.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=rL();l.append(e),n=e.select().getNodes()}}else if(sd(l,n)){let t=sT(e);if(iR(o)){l.replace(t);let e=sx();rb(l)&&(e.setFormat(l.getFormatType()),e.setIndent(l.getIndent())),t.append(e)}else if(sv(l)){let e=l.getParentOrThrow();sc(t,e.getChildren()),e.replace(t)}return}}let r=new Set;for(let t=0;t<n.length;t++){let i=n[t];if(rb(i)&&i.isEmpty()&&!sv(i)&&!r.has(i.getKey())){sh(i,e);continue}let l=r5(i)?i.getParent():sv(i)&&i.isEmpty()?i:null;for(;null!=l;){let t=l.getKey();if(sE(l)){if(!r.has(t)){let n=sT(e);sc(n,l.getChildren()),l.replace(n),r.add(t)}break}{let n=l.getParent();if(iR(n)&&!r.has(t)){r.add(t),sh(l,e);break}l=n}}}}}function sc(e,t){e.splice(e.getChildrenSize(),0,t)}function sh(e,t){let n;if(sE(e))return e;let r=e.getPreviousSibling(),i=e.getNextSibling(),l=sx();
1if(sc(l,e.getChildren()),sE(r)&&t===r.getListType())r.append(l),sE(i)&&t===i.getListType()&&(sc(r,i.getChildren()),i.remove()),n=r;else if(sE(i)&&t===i.getListType())i.getFirstChildOrThrow().insertBefore(l),n=i;else{let r=sT(t);r.append(l),e.replace(r),n=r}l.setFormat(e.getFormatType()),l.setIndent(e.getIndent());let o=nG();return nP(o)&&(n.getKey()===o.anchor.key&&o.anchor.set(l.getKey(),o.anchor.offset,"element"),n.getKey()===o.focus.key&&o.focus.set(l.getKey(),o.focus.offset,"element")),e.remove(),n}function sg(e,t){let n=e.getLastChild(),r=t.getFirstChild();n&&r&&sa(n)&&sa(r)&&(sg(n.getFirstChild(),r.getFirstChild()),r.remove());let i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function sp(e){let t="check"!==e.getListType(),n=e.getStart();for(let r of e.getChildren())sv(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),sE(r.getFirstChild())||n++)}class sm extends rC{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{let t=e.getParent();if(sE(t))"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();sE(n)||so(340);let r=[e];for(let t of["previous","next"])for(let{origin:n}of(r.reverse(),lc(e,t))){if(!sv(n))break;r.push(n)}e.insertBefore(n),n.splice(0,0,r),iR(t)||(ot(n,lA(lc(n,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:rC,importDOM:{li:()=>({conversion:s_,priority:0})}})}constructor(e=1,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){let r;!sE(r=this.getParent())||"check"!==r.getListType()||sE(this.getFirstChild())?(t.removeAttribute("role"),t.removeAttribute("tabIndex"),t.removeAttribute("aria-checked")):(t.setAttribute("role","checkbox"),t.setAttribute("tabIndex","-1"),e&&this.__checked===e.__checked||t.setAttribute("aria-checked",this.getChecked()?"true":"false")),t.value=this.__value,function(e,t,n){let r,i=[],l=[],o=t.list,s=o?o.listitem:void 0;if(o&&o.nested&&(r=o.nested.listitem),void 0!==s&&i.push(...lU(s)),o){let e=n.getParent(),t=sE(e)&&"check"===e.getListType(),r=n.getChecked();t&&!r||l.push(o.listitemUnchecked),t&&r||l.push(o.listitemChecked),t&&i.push(r?o.listitemChecked:o.listitemUnchecked)}if(void 0!==r){let e=lU(r);n.getChildren().some(e=>sE(e))?i.push(...e):l.push(...e)}l.length>0&&lH(e,...l),i.length>0&&lJ(e,...i)}(t,n.theme,this);let i=e?e.__style:"",l=this.__style;i!==l&&nn(t.style,l,i),function(e,t,n){let r=t.__textStyle,i=n?n.__textStyle:"";if(null!==n&&i===r)return;let l=nt(r);for(let t in l)e.style.setProperty(`--listitem-marker-${t}`,l[t]);if(""!==i)for(let t in nt(i))t in l||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){return this.updateListItemDOM(e,t,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),sa(this)?{after(e){if(iJ(e)){let t=e.previousElementSibling;if(iJ(t)&&"LI"===t.nodeName){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(rb(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(sv(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!sE(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=iz(n),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}
1return t&&(rb(e)||so(139),this.getChildren().forEach(t=>{e.append(t)})),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(sE(n)||so(39),sv(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){let i=iz(n);r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&sa(t)&&sa(n)&&(sg(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=iz(this);return this.insertAfter(n,t),n}collapseAtStart(e){let t=rL();this.getChildren().forEach(e=>t.append(e));let n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=sv(r);if(1===n.getChildrenSize())if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();let r=e.anchor,i=e.focus,l=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(l,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(l,i.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e,t=this.getLatest(),n=this.getParent();return sE(n)&&(e=n.getListType()),"check"===e?!!t.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(null===e||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;sv(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&so(117),(e=Math.floor(e))>=0||so(199);let t=this.getIndent();for(;t!==e;)t<e?(function(e){let t=new Set;if(sa(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(sa(r)&&sa(i)){let n=i.getFirstChild();if(sE(n)){n.append(e);let i=r.getFirstChild();sE(i)&&(sc(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(sa(r)){let t=r.getFirstChild();if(sE(t)){let n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(sa(i)){let t=i.getFirstChild();sE(t)&&t.append(e)}else if(sE(n)){let t=iz(e),l=iz(n);t.append(l),l.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}(this),t++):(function(e){if(sa(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(sE(n?n.getParent():void 0)&&sv(n)&&sE(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=iz(e),i=iz(t);
1r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let l=iz(e),o=iz(t);l.append(o),sc(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(l),n.replace(e)}}}(this),t--);return this}canInsertAfter(e){return sv(e)}canReplaceWith(e){return sv(e)}canMergeWith(e){return sv(e)||rI(e)}extractWithChild(e,t){if(!nP(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return sT("bullet")}canMergeWhenEmpty(){return!0}}function s_(e){if(e.classList.contains("task-list-item")){for(let t of e.children)if("INPUT"===t.tagName)return sy(t)}if(e.classList.contains("joplin-checkbox")){for(let t of e.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&"INPUT"===t.children[0].tagName)return sy(t.children[0])}let t=e.getAttribute("aria-checked");return{node:sx("true"===t||"false"!==t&&void 0)}}function sy(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:sx(e.hasAttribute("checked"))}}function sx(e){return iK(new sm(void 0,e))}function sv(e){return e instanceof sm}class sS extends rC{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{let t;sE(t=e.getNextSibling())&&e.getListType()===t.getListType()&&sg(e,t),sp(e)},extends:rC,importDOM:{ol:()=>({conversion:sN,priority:0}),ul:()=>({conversion:sN,priority:0})}})}constructor(e="number",t=1,n){super(n);const r=sk[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,sC(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(sC(t,n.theme,this),e.__start!==this.__start&&t.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return iJ(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n.find(sv)??this.getChildren().find(sv),i=r?()=>iz(r):sx,l=n;for(let e=0;e<n.length;e++){let t=n[e];sv(t)||(l===n&&(l=[...n]),l[e]=i().append(!rb(t)||sE(t)||t.isInline()?t:nC(t.getTextContent())))}return super.splice(e,t,l)}extractWithChild(e){return sv(e)}}function sC(e,t,n){let r=[],i=[],l=t.list;if(void 0!==l){let e,t=l[`${n.__tag}Depth`]||[],o=function(e){let t=1,n=e.getParent();for(;null!=n;){if(sv(n)){let e=n.getParent();if(sE(e)){t++,n=e.getParent();continue}so(40)}break}return t}(n)-1,s=o%t.length,a=t[s],u=l[n.__tag],d=l.nested,f=l.checklist;if(void 0!==d&&d.list&&(e=d.list),void 0!==u&&r.push(u),void 0!==f&&"check"===n.__listType&&r.push(f),void 0!==a){r.push(...lU(a));for(let e=0;e<t.length;e++)e!==s&&i.push(n.__tag+e)}if(void 0!==e){let t=lU(e);o>1?r.push(...t):i.push(...t)}}i.length>0&&lH(e,...i),r.length>0&&lJ(e,...r)}function sb(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(sv(r)){t.push(r);let e=r.getChildren();e.length>1&&e.forEach(e=>{sE(e)&&t.push(su(e))})}else t.push(su(r))}return t}function sN(e){let t=e.nodeName.toLowerCase(),n=null;return"ol"===t?n=sT("number",e.start):"ul"===t&&(n=!function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list")||"1"===e.getAttribute("data-is-checklist"))return!0;for(let t of e.childNodes)if(iJ(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?sT("bullet"):sT("check")),{after:sb,node:n}}let sk={ol:"number",ul:"bullet"};function sT(e="number",t=1){return iK(new sS(e,t))}function sE(e){return e instanceof sS}eA("INSERT_CHECK_LIST_COMMAND");let sw=eA("UPDATE_LIST_START_COMMAND"),sO=eA("INSERT_UNORDERED_LIST_COMMAND"),sM=eA("INSERT_ORDERED_LIST_COMMAND"),sA=eA("REMOVE_LIST_COMMAND");function sD(e,...t){let n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;for(let n of(r.append("code",e),t))r.append("v",n);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function sP(e,t=nG()){return null==t&&sD(166),nP(t)&&t.isCollapsed()||0===t.getNodes().length?"":sl(e,t)}function sF(e,t=nG()){return null==t&&sD(166),nP(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){let n=[],r=is().getChildren();for(let i=0;i<r.length;i++)!function e(t,n,r,i=[]){var l;let o,s,a=null===n||r.isSelected(n),u=rb(r)&&r.excludeFromCopy("html"),d=r;
1null!==n&&nb(d)&&(d=lX(n,d,"clone"));let f=rb(d)?d.getChildren():[],c=(o=(l=d).exportJSON(),s=l.constructor,o.type!==s.getType()&&sD(58,s.name),rb(l)&&(Array.isArray(o.children)||sD(59,s.name)),o);nb(d)&&0===d.getTextContentSize()&&(a=!1);for(let i=0;i<f.length;i++){let l=f[i],o=e(t,n,l,c.children);!a&&rb(r)&&o&&r.extractWithChild(l,n,"clone")&&(a=!0)}if(a&&!u)i.push(c);else if(Array.isArray(c.children))for(let e=0;e<c.children.length;e++){let t=c.children[e];i.push(t)}return a}(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}function sL(e,t,n){let r=e.getData("application/x-lexical-editor");if(r)try{let e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return sR(n,function(e){let t=[];for(let n=0;n<e.length;n++){let r=rc(e[n],rs()._nodes);nb(r)&&lQ(r),t.push(r)}return t}(e.nodes),t)}catch(e){console.error(e)}let i=e.getData("text/html"),l=e.getData("text/plain");if(i&&l!==i)try{let e=(new DOMParser).parseFromString(window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(i):i,"text/html");return sR(n,si(n,e),t)}catch(e){console.error(e)}let o=l||e.getData("text/uri-list");if(null!=o)if(nP(t)){let e=o.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){let n=nG();if(nP(n)){let r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"	"===r?n.insertNodes([nT()]):n.insertText(r)}}}else t.insertRawText(o)}let sI="application/x-lexical-drag";function sR(e,t,n){e.dispatchCommand(eP,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(nP(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=lT(t,"previous");if(r)if(lo(r))n=r.origin;else for(let e of lv(r,lp(is(),"next").getFlipped())){if(nb(e.origin)){n=e.origin;break}if(rb(e.origin)&&!e.origin.isInline())break}if(n&&nb(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}let sz=null;async function sK(e,t,n){if(null!==sz)return!1;if(null!==t)return new Promise((r,i)=>{e.update(()=>{r(sB(e,t,n))})});let r=e.getRootElement(),i=e._window||window,l=i.document,o=ij(i);if(null===r||null===o)return!1;let s=l.createElement("span");s.style.position="fixed",s.style.top="-1000px",s.append(l.createTextNode("#")),r.append(s);let a=new Range;return a.setStart(s,0),a.setEnd(s,1),o.removeAllRanges(),o.addRange(a),new Promise((t,r)=>{let o=e.registerCommand(ts,r=>(on(r,ClipboardEvent)&&(o(),null!==sz&&(i.clearTimeout(sz),sz=null),t(sB(e,r,n))),!0),4);sz=i.setTimeout(()=>{o(),sz=null,t(!1)},50),l.execCommand("copy"),s.remove()})}function sB(e,t,n){if(void 0===n){let t=ij(e._window),r=nG();if(!r||r.isCollapsed()||!t)return!1;let i=t.anchorNode,l=t.focusNode;if(null!==i&&null!==l&&!rq(e,i,l))return!1;n=s$(r)}t.preventDefault();let r=t.clipboardData;return null!==r&&(sj(r,n),!0)}let sW=[["text/html",sP],["application/x-lexical-editor",sF]];function s$(e=nG()){let t,n;var r=(t=iX(),(n=oR.maybeFromEditor(t))&&n.hasExtensionByName(sJ.name)?oz(t,sJ).output:sU);let i={"text/plain":""};for(let[t,n]of Object.entries(r)){let r=function(e,t){let n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}(n,e);null!==r&&(i[t]=r)}return i}function sj(e,t){for(let[n]of sW)void 0===t[n]&&e.setData(n,"");for(let n in t){let r=t[n];void 0!==r&&e.setData(n,r)}}let sU={"application/x-lexical-editor":[(e,t)=>e?sF(iX(),e):t()],"text/html":[(e,t)=>e?sP(iX(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]},sJ={build:(e,t,n)=>t.$exportMimeType,config:{$exportMimeType:sU},mergeConfig(e,t){let n=lj(e,t);if(t.$exportMimeType){let r={...e.$exportMimeType};for(let[e,n]of Object.entries(t.$exportMimeType))r[e]=[...r[e],...n];n.$exportMimeType=r}return n},name:"@lexical/clipboard/GetClipboardData"},sH={build:(e,t,n)=>oN(t),config:{disabled:"u"<typeof window},name:"@lexical/dragon",register:(e,t,n)=>ob(()=>{let t,r;return n.getOutput().disabled.value?void 0:(t=window.location.origin,r=n=>{if(n.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let i=n.data;if("string"==typeof i){let t;try{t=JSON.parse(i)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){let r=t.payload;if(r&&"makeChanges"===r.functionId){let t=r.args;if(t){let[r,i,l,o,s]=t;e.update(()=>{let e=nG();if(nP(e)){let t=e.anchor,a=t.getNode(),u=0,d=0;if(nb(a)&&r>=0&&i>=0&&(u=r,d=r+i,e.setTextNodeRange(a,u,a,d)),u===d&&""===l||(e.insertRawText(l),a=t.getNode()),nb(a)){u=o,d=o+s;let t=a.getTextContentSize();u=u>t?t:u,d=d>t?t:d,e.setTextNodeRange(a,u,a,d)}n.stopImmediatePropagation()}})}}}}},window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)})})};function sV(e,t){if(void 0!==document.caretRangeFromPoint){let n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){let n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}let sq="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,sY=sq&&"documentMode"in document?document.documentMode:null,sG=sq&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),sX=!(!sq||!("InputEvent"in window)||sY)&&"getTargetRanges"in new window.InputEvent("input"),sQ=sq&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,sZ=sq&&/Android/.test(navigator.userAgent),s0=sq&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!sZ,s1=sq&&/^(?=.*Chrome).*/i.test(navigator.userAgent),s2=sq&&/AppleWeb
1Kit\/[\d.]+/.test(navigator.userAgent)&&sG&&!s1,s3=eA("DRAG_DROP_PASTE_FILE");class s5 extends rC{static getType(){return"quote"}static clone(e){return new s5(e.__key)}createDOM(e){let t=document.createElement("blockquote");return lJ(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:ae,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(iJ(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return s6().updateFromJSON(e)}insertNewAfter(e,t){let n=rL(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){let e=rL();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function s6(){return iK(new s5)}function s4(e){return e instanceof s5}class s9 extends rC{__tag;static getType(){return"heading"}static clone(e){return new s9(e.__tag,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e="h1",t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=document.createElement(t),r=e.theme.heading;return void 0!==r&&lJ(n,r[t]),n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:s8,priority:0}),h2:e=>({conversion:s8,priority:0}),h3:e=>({conversion:s8,priority:0}),h4:e=>({conversion:s8,priority:0}),h5:e=>({conversion:s8,priority:0}),h6:e=>({conversion:s8,priority:0}),p:e=>{let t=e.firstChild;return null!==t&&s7(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>s7(e)?{conversion:e=>({node:at("h1")}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if(iJ(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return at(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=r&&(!e||e.anchor.key!==r.getKey()||n!==r.getTextContentSize())&&e?at(this.getTag()):rL(),l=this.getDirection();if(i.setDirection(l),this.insertAfter(i,t),0===n&&!this.isEmpty()&&e){let e=rL();e.select(),this.replace(e,!0)}return i}collapseAtStart(){let e=this.isEmpty()?rL():at(this.getTag());
1return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function s7(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function s8(e){let t=e.nodeName.toLowerCase(),n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=at(t),null!==e.style&&(i3(e,n),n.setFormat(e.style.textAlign))),{node:n}}function ae(e){let t=s6();return null!==e.style&&(t.setFormat(e.style.textAlign),i3(e,t)),{node:t}}function at(e="h1"){return iK(new s9(e))}function an(e){return e instanceof s9}function ar(e){let t=null;if(on(e,DragEvent)?t=e.dataTransfer:on(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];let n=t.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),i]}function ai(e){for(let t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}let al={conflictsWith:["@lexical/plain-text"],dependencies:[sH],name:"@lexical/rich-text",nodes:()=>[s9,s5],register:function(e){return lV(e.registerCommand(eF,e=>{let t=nG();return!!nL(t)&&(t.clear(),!0)},0),e.registerCommand(eK,e=>{let t=nG();return nP(t)?(t.deleteCharacter(e),!0):!!nL(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(eJ,e=>{let t=nG();return!!nP(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(eH,e=>{let t=nG();return!!nP(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(e$,t=>{let n=nG();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;let r=t.dataTransfer;if(null!=r)sL(r,n,e);else if(nP(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(eU,()=>{let e=nG();return!!nP(e)&&(e.removeText(),!0)},0),e.registerCommand(eV,e=>{let t=nG();return!!nP(t)&&(t.formatText(e),!0)},0),e.registerCommand(tr,e=>{let t=nG();if(!nP(t)&&!nL(t))return!1;for(let n of t.getNodes()){let t=i9(n,e=>rb(e)&&!e.isInline());null!==t&&t.setFormat(e)}return!0},0),e.registerCommand(eB,e=>{let t=nG();return!!nP(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(eW,()=>{let e=nG();return!!nP(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(e8,()=>{let e=nT(),t=nG();return nP(t)&&(e.setFormat(t.format),e.setStyle(t.style)),n5([e]),!0},0),e.registerCommand(te,()=>or(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(tt,()=>or(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(e1,e=>{let t=nG();if(nL(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}else if(nP(t)){let n=iE(t.focus,!0);if(!e.shiftKey&&rT(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1},0),e.registerCommand(e2,e=>{let t=nG();if(nL(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}else if(nP(t)){let n;if("root"===(n=t.focus).key&&n.offset===is().getChildrenSize())return e.preventDefault(),!0;let r=iE(t.focus,!1);if(!e.shiftKey&&rT(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},0),e.registerCommand(eZ,e=>{let t=nG();if(nL(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),lG(n[0])?n[0].selectNext(0,0):n[0].selectPrevious(),!0}if(!nP(t))return!1;if(l3(t,!0)){let n=e.shiftKey;return e.preventDefault(),l6(t,n,!0),!0}return!1},0),e.registerCommand(eX,e=>{let t=nG();if(nL(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),lG(n[0])?n[0].selectPrevious():n[0].selectNext(0,0),!0}if(!nP(t))return!1;let n=e.shiftKey;return!!l3(t,!1)&&(e.preventDefault(),l6(t,n,!1),!0)},0),e.registerCommand(e6,t=>{if(rT(ii(t.target)))return!1;let n=nG();if(nP(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(0!==t.offset)return!1;let n=t.getNode();if(rw(n))return!1;let r=oe(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(tt,void 0);if(sQ&&"ko-KR"===navigator.language)return!1}else if(!nL(n))return!1;return t.preventDefault(),e.dispatchCommand(eK,!0)},0),e.registerCommand(e9,t=>{if(rT(ii(t.target)))return!1;let n=nG();return!(!nP(n)&&!nL(n))&&(t.preventDefault(),e.dispatchCommand(eK,!1))},0),e.registerCommand(e3,t=>{let n=nG();if(!nP(n))return!1;if(ai(n),null!==t){if((sQ||s0||s2)&&sX)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(eB,!1)}return e.dispatchCommand(eW,void 0)}
1,0),e.registerCommand(e4,()=>!!nP(nG())&&(e.blur(),!0),0),e.registerCommand(tn,t=>{let[,n]=ar(t);if(n.length>0){let r=sV(t.clientX,t.clientY);if(null!==r){let{offset:t,node:i}=r,l=ii(i);if(null!==l){let e=nV();if(nb(l))e.anchor.set(l.getKey(),t,"text"),e.focus.set(l.getKey(),t,"text");else{let t=l.getParentOrThrow().getKey(),n=l.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}iu(Z(e))}e.dispatchCommand(s3,n)}return t.preventDefault(),!0}return function(e,t,n){let r=e.dataTransfer;if(null===r)return!1;let i=function(e){var t;let n,r=e.getData(sI);if(!r)return null;try{n=JSON.parse(r)}catch(e){return null}return null!==(t=n)&&"object"==typeof t&&"editorKey"in t&&"string"==typeof t.editorKey?n:null}(r);if(null===i)return!1;let l=function(e){let t=function(e,t){if(void 0!==document.caretRangeFromPoint){let n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){let n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}(e.clientX,e.clientY);if(null===t)return null;let n=ii(t.node);if(null===n)return null;if(nb(n))return lh(n,"next",t.offset);if(rb(n))return lz(n,t.offset,"next");let r=n.getParent();return null===r?null:lz(r,n.getIndexWithinParent()+1,"next")}(e);if(null===l)return!1;let o=lW(l);if(null===o)return!1;let s=i.editorKey===t.getKey(),a=nG();if(s){if(!nP(a)||a.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=lR(lM(t),"next");return 0>lC(n,e)&&0>lC(e,r)}(l,a))return e.preventDefault(),!0;a.removeText()}if(!o.origin.isAttached())return e.preventDefault(),!0;if(n(r,lw(lv(o,o)),t),!s){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of Array.from(t.querySelectorAll('[data-lexical-editor="true"]'))){let t=n.__lexicalEditor;if(t&&t.getKey()===e)return n}return null}(i.editorKey,n):null;null!==r&&r.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}(t,e,sL)},0),e.registerCommand(ti,t=>{var n;let r,[i]=ar(t),l=nG();return!(i&&!nP(l))&&(nP(l)&&!l.isCollapsed()&&null!==t.dataTransfer&&(sj(t.dataTransfer,s$(l)),n=t.dataTransfer,r={editorKey:e.getKey()},n.setData(sI,JSON.stringify(r))),!0)},0),e.registerCommand(tl,e=>{let[t]=ar(e),n=nG();if(t&&!nP(n))return!1;let r=sV(e.clientX,e.clientY);return null!==r&&rT(ii(r.node))&&e.preventDefault(),!0},0),e.registerCommand(tu,()=>((function(){let e=is();if(nP(void 0)){let e=(void 0).anchor,t=(void 0).focus,n=e.getNode().getTopLevelElementOrThrow().getParentOrThrow();return e.set(n.getKey(),0,"element"),t.set(n.getKey(),n.getChildrenSize(),"element"),Z(void 0)}iu(Z(e.select(0,e.getChildrenSize())))})(),!0),0),e.registerCommand(ts,t=>(sK(e,on(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(ta,t=>((async function(e,t){await sK(t,on(e,ClipboardEvent)?e:null),t.update(()=>{let e=nG();nP(e)?e.removeText():nL(e)&&e.getNodes().forEach(e=>e.remove())})})(t,e),!0),0),e.registerCommand(ej,t=>{let[,n,r]=ar(t);return n.length>0&&!r?(e.dispatchCommand(s3,n),!0):!(iH(t.target)&&rV(t.target))&&null!==nG()&&(t.preventDefault(),e.update(()=>{let n=nG(),r=on(t,InputEvent)||on(t,KeyboardEvent)?null:t.clipboardData;null!=r&&null!==n&&sL(r,n,e)},{tag:"paste"}),!0)},0),e.registerCommand(e5,e=>{let t=nG();return nP(t)&&ai(t),!1},0),e.registerCommand(e7,e=>{let t=nG();return nP(t)&&ai(t),!1},0))}},ao="data-language",as="data-highlight-language",aa="data-theme";class au extends rC{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new au(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=document.createElement("code");lJ(t,e.theme.code),t.setAttribute("spellcheck","false");let n=this.getLanguage();n&&(t.setAttribute(ao,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(as,n));let r=this.getTheme();r&&t.setAttribute(aa,r);let i=this.getStyle();return i&&nn(t.style,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(ao,r):i&&t.removeAttribute(ao);let l=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?l&&r?r!==i&&t.setAttribute(as,r):t.removeAttribute(as):l&&r&&t.setAttribute(as,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(aa,o):s&&t.removeAttribute(aa);let a=this.__style,u=e.__style;return a!==u&&nn(t.style,a,u),!1}exportDOM(e){let t=document.createElement("pre");
1lJ(t,e._config.theme.code),t.setAttribute("spellcheck","false");let n=this.getLanguage();n&&(t.setAttribute(ao,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(as,n));let r=this.getTheme();r&&t.setAttribute(aa,r);let i=this.getStyle();return i&&nn(t.style,i),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||function e(t,n){for(let r of t.childNodes){if(iJ(r)&&r.tagName===n)return!0;e(r,n)}return!1}(e,"BR"))?{conversion:ac,priority:1}:null,div:()=>({conversion:ah,priority:1}),pre:()=>({conversion:ac,priority:0}),table:e=>a_(e)?{conversion:ag,priority:3}:null,td:e=>{let t=e.closest("table");return e.classList.contains("js-file-line")||t&&a_(t)?{conversion:ap,priority:3}:null},tr:e=>{let t=e.closest("table");return t&&a_(t)?{conversion:ap,priority:3}:null}}}static importJSON(e){return ad().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){if(!function(e,t){let n=oR.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}(iX(),"@lexical/code")){let t=function(e){let{anchor:t}=e;if(e.isCollapsed()&&"element"===t.type){let e=t.getNode();if(af(e)){let n=e.getChildrenSize();if(n>=2&&t.offset===n){let t=e.getLastChild();if(no(t)&&no(t.getPreviousSibling())){let t=rL();return e.splice(n-2,2,[]).insertAfter(t,!1),t.select(),t}}}}return null}(e);if(t)return t}let{anchor:n,focus:r}=e,i=(n.isBefore(r)?n:r).getNode();if(nb(i)){let e=function(e){let t=e;for(let n=lc(e,"previous");n&&(aS(n.origin)||nE(n.origin));n=n.getAdjacentCaret())t=n.origin;return t}(i),t=[];for(;;)if(nE(e))t.push(nT()),e=e.getNextSibling();else{if(!aS(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(av(" ".repeat(n))),n!==i)break;e=e.getNextSibling()}}let r=i.splitText(n.offset)[0],l=+(0!==n.offset),o=r.getIndexWithinParent()+l,s=i.getParentOrThrow(),a=[nl(),...t];s.splice(o,0,a);let u=t[t.length-1];u?u.select():0===n.offset?r.selectPrevious():r.getNextSibling().selectNext(0,0)}if(af(i)){let{offset:t}=e.anchor;i.splice(t,0,[nl()]),i.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){let e=rL();
1return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}}function ad(e,t){return i4(au).setLanguage(e).setTheme(t)}function af(e){return e instanceof au}function ac(e){return{node:ad(e.getAttribute(ao))}}function ah(e){let t=am(e);return t||function(e){let t=e.parentElement;for(;null!==t;){if(am(t))return!0;t=t.parentElement}return!1}(e)?{node:t?ad():null}:{node:null}}function ag(){return{node:ad()}}function ap(){return{node:null}}function am(e){return null!==e.style.fontFamily.match("monospace")}function a_(e){return e.classList.contains("js-file-line-container")}class ay extends ng{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new ay(e.__text,e.__highlightType||void 0,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return lJ(t,ax(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=ax(n.theme,e.__highlightType),l=ax(n.theme,this.__highlightType);return i!==l&&(i&&lH(t,i),l&&lJ(t,l)),r}static importJSON(e){return av().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return ad()}}function ax(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function av(e="",t){return iK(new ay(e,t))}function aS(e){return e instanceof ay}let aC=new Set(["http:","https:","mailto:","sms:","tel:"]);class ab extends rC{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new ab(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},n){super(n);const{target:r=null,rel:i=null,title:l=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=l}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){let t=document.createElement("a");return this.updateLinkDOM(null,t,e),lJ(t,e.theme.link),t}updateLinkDOM(e,t,n){if(iU(t))for(let n of(e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url)),["target","rel","title"])){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:aN,priority:1})}}static importJSON(e){return ak().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=aA(e);try{let t=new URL(aA(e));if(!aC.has(t.protocol))return"about:blank"}catch(e){}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=iz(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!nP(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.__url===e.__url&&this.__target===e.__target&&this.__rel===e.__rel&&this.__title===e.__title}}function aN(e){let t=null;if(iU(e)){let n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=ak(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function ak(e="",t){return iK(new ab(e,t))}function aT(e){return e instanceof ab}class aE extends ab{__isUnlinked;constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}static getType(){return"autolink"}static clone(e){return new aE(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return aw().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let n=aw(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}}function aw(e="",t){return iK(new aE(e,t))}function aO(e){return e instanceof aE}eA("TOGGLE_LINK_COMMAND");let aM=/^\+?[0-9\s()-]{5,}$/;function aA(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:aM.test(e)?`tel:${e}`:`https://${e}`}function aD(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function aP(e){let t=aD(e,e=>e.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}let aF=/[!-/:-@[-`{-~\s]/,aL=/^\s{0,3}$/;function aI(e){if(!rI(e))return!1;let t=e.getFirstChild();return null==t||1===e.getChildrenSize()&&nb(t)&&aL.test(t.getTextContent())}function aR(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number(t)))}function az(e,t,n,r,i,l=!1){let o=[],s=e.getChildren();r||(r=[]),i||(i=[]);e:for(let e of s){for(let s of n){if(!s.export)continue;let a=s.export(e,e=>az(e,t,n,r,[...i,...r],l),(e,n)=>aK(e,n,t,r,i,l));if(null!=a){o.push(a);continue e}}no(e)?o.push("\n"):nb(e)?o.push(aK(e,e.getTextContent(),t,r,i,l)):rb(e)?o.push(az(e,t,n,r,i,l)):rT(e)&&o.push(e.getTextContent())}return o.join("")}function aK(e,t,n,r,i,l=!1){let o=t;e.hasFormat("code")||(o=l?o.replace(/([*_`~])/g,"\\$1"):o.replace(/([*_`~\\])/g,"\\$1"));let s=o.match(/^(\s*)(.*?)(\s*)$/s)||["","",o,""],a=s[1],u=s[2],d=s[3],f="",c="",h="",g=aB(e,!0),p=aB(e,!1),m=new Set;for(let t of n){let n=t.format[0],i=t.tag;a$(e,n)&&!m.has(n)&&(m.add(n),a$(g,n)&&r.find(e=>e.tag===i)||(r.push({format:n,tag:i}),f+=i))}for(let t=0;t<r.length;t++){let n=aW(e,r[t].format),l=aW(p,r[t].format);if(n&&l)continue;let o=[...r];for(;o.length>t;){let e=o.pop();i&&e&&i.find(t=>t.tag===e.tag)||(e&&"string"==typeof e.tag&&(n?l||(h+=e.tag):c+=e.tag),r.pop())}break}return""!==u||e.hasFormat("code")?c+a+f+u+h+d:c+o}function aB(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();return nb(n)?n:null}function aW(e,t){return nb(e)&&e.hasFormat(t)}function a$(e,t){return!!aW(e,t)&&("code"===t||!e||!/^\s*$/.test(e.getTextContent()))}function aj(e){return nb(e)&&!e.hasFormat("code")}let aU=K("mdListMarker",{parse:e=>"string"==typeof e&&/^[-*+]$/.test(e)?e:"-",resetOnCopyNode:!0}),aJ=K("mdCodeFence",{parse:e=>"string"==typeof e&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),aH=e=>(t,n,r,i)=>{let l=e(r);l.append(...n),t.replace(l),i||l.select(0,0)},aV=e=>(t,n,r,i)=>{var l;let o,s,a,u=t.getPreviousSibling(),d=t.getNextSibling(),f=sx("check"===e?"x"===r[3]:void 0),c=r[0].trim()[0],h="bullet"!==e&&"check"!==e||c!==aU.parse(c)?void 0:c;if(sE(d)&&d.getListType()===e){h&&W(d,aU,h);let e=d.getFirstChild();null!==e?e.insertBefore(f):d.append(f),t.remove()}else if(sE(u)&&u.getListType()===e)h&&W(u,aU,h),u.append(f),t.remove();else{let n=sT(e,"number"===e?Number(r[2]):void 0);h&&W(n,aU,h),n.append(f),t.replace(n)}f.append(...n),i||f.select(0,0);let g=(o=(l=r[1]).match(/\t/g),s=l.match(/ /g),a=0,o&&(a+=o.length),s&&(a+=Math.floor(s.length/4)),a);g&&f.setIndent(g)},aq=(e,t,n)=>{let r=[],i=e.getChildren(),l=0;for(let o of i)if(sv(o)){if(1===o.getChildrenSize()){let e=o.getFirstChild();if(sE(e)){r.push(aq(e,t,n+1));continue}}let i=" ".repeat(4*n),s=e.getListType(),a=B(e,aU),u="number"===s?`${e.getStart()+l}. `:"check"===s?`${a} [${o.getChecked()?"x":" "}] `:a+" ",d=t(o);"number"!==s&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,"$1\\$2")),r.push(i+u+d),l++}return r.join("\n")},aY={dependencies:[s9],export:(e,t)=>{if(!an(e))return null;let n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:/^(#{1,6})\s/,replace:aH(e=>at("h"+e[1].length)),type:"element"},aG={dependencies:[au],export:e=>{if(!af(e))return null;let t=e.getTextContent(),n=B(e,aJ);if(t.indexOf(n)>-1){let e=t.match(/`{3,}/g);if(e){let t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}return n+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n"+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{let i=r[1],l=i.trim().length,o=e[n],s=r.index+i.length,a=o.slice(s),u=RegExp(`\`{${l},}$`);if(u.test(a)){let e=a.match(u),i=a.slice(0,a.lastIndexOf(e[0])),l=[...r];return l[2]="",aG.replace(t,null,l,e,[i],!0),[!0,n]}let d=RegExp(`^[ \\t]*\`{${l},}$`);for(let i=n+1;i<e.length;i++){let l=e[i];if(d.test(l)){let s=l.match(d),a=e.slice(n+1,i),u=o.slice(r[0].length);return u.length>0&&a.unshift(u),aG.replace(t,null,r,s,a,!0),[!0,i]}}let f=e.slice(n+1),c=o.slice(r[0].length);return c.length>0&&f.unshift(c),aG.replace(t,null,r,null,f,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:/^[ \t]*`{3,}$/},regExpStart:/^([ \t]*`{3,})([\w-]+)?[ \t]?/,replace:(e,t,n,r,i,l)=>{let o,s,a=n[1]?n[1].trim():"```",u=n[2]||void 0;if(!t&&i){if(1===i.length)r?(o=ad(u),s=i[0]):(o=ad(u),s=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{for(o=ad(u),i.length>0&&(0===i[0].trim().length?i.shift():i[0].startsWith(" ")&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();s=i.join("\n")}W(o,aJ,a);let t=nC(s);o.append(t),e.append(o)}else t&&aH(e=>ad(e?e[2]:void 0))(e,t,n,l)},type:"multiline-element"},aX=[aY,{dependencies:[s5],export:(e,t)=>{if(!s4(e))return null;let n=t(e).split("\n"),r=[];for(let e of n)r.push("> "+e);return r.join("\n")},regExp:/^>\s/,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(s4(n))return n.splice(n.getChildrenSize(),0,[nl(),...t]),void e.remove()}let i=s6();i.append(...t),e.replace(i),r||i.select(0,0)},type:"element"},{dependencies:[sS,sm],export:(e,t)=>sE(e)?aq(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:aV("bullet"),type:"element"},(aV("check"),{dependencies:[sS,sm],export:(e,t)=>sE(e)?aq(e,t,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:aV("number"),type:"element"})],aQ=[{format:["code"],tag:"`",type:"text-format"},{format:["bold","italic"],tag:"***",type:"text-format"},{format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},{format:["bold"],tag:"**",type:"text-format"},{format:["bold"],intraword:!1,tag:"__",type:"text-format"},{format:["highlight"],tag:"==",type:"text-format"},{format:["italic"],tag:"*",type:"text-format"},{format:["italic"],intraword:!1,tag:"_",type:"text-format"},{format:["strikethrough"],tag:"~~",type:"text-format"}],aZ=[...aX,aG,...aQ,{dependencies:[ab],export:(e,t,n)=>{if(!aT(e)||aO(e))return null;let r=t(e),i=e.getTitle();return null!=i&&(i=i.replace(/([\\"])/g,"\\$1")),i?`[${r}](${e.getURL()} "${i}")`:`[${r}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*
1)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{if(i9(e,aT))return;let[,n,r,i]=t,l=ak(null!=r?aR(r):void 0,{title:null!=i?aR(i):void 0}),o=n.split("[").length-1,s=n.split("]").length-1,a=n,u="";if(o<s)return;if(o>s){let e=n.split("[");u="["+e[0],a=e.slice(1).join("[")}let d=nC(a);return d.setFormat(e.getFormat()),l.append(d),e.replace(l),u&&l.insertBefore(nC(u)),d},trigger:")",type:"text-match"}];function a0(e,t,n,r,i){if(!iR(e.getParent())||e.getFirstChild()!==t)return!1;let l=t.getTextContent();if(!i&&" "!==l[n-1])return!1;for(let{regExpStart:o,replace:s,regExpEnd:a}of r){if(a&&!("optional"in a)||a&&"optional"in a&&!a.optional)continue;let r=l.match(o);if(r){let l=i||r[0].endsWith(" ")?n:n-1;if(r[0].length!==l)continue;let o=t.getNextSiblings(),[a,u]=t.splitText(n);if(!1!==s(e,u?[u,...o]:o,r,null,null,!1))return a.remove(),!0}}return!1}function a1(e,t,n){let r=n.length;for(let i=t;i>=r;i--){let t=i-r;if(a2(e,t,n,0,r)&&" "!==e[t+r])return t}return -1}function a2(e,t,n,r,i){for(let l=0;l<i;l++)if(e[t+l]!==n[r+l])return!1;return!0}let a3=(0,l.createContext)(null);function a5(){let e=(0,l.useContext)(a3);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}function a6({defaultSelection:e}){let[t]=a5();return(0,l.useEffect)(()=>{t.focus(()=>{let e=document.activeElement,n=t.getRootElement();null===n||null!==e&&n.contains(e)||n.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}let a4="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect,a9=(0,l.forwardRef)(function({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:s,ariaExpanded:a,ariaInvalid:u,ariaLabel:d,ariaLabelledBy:f,ariaMultiline:c,ariaOwns:h,ariaRequired:g,autoCapitalize:p,className:m,id:_,role:y="textbox",spellCheck:x=!0,style:v,tabIndex:S,"data-testid":C,...b},N){let[k,T]=(0,l.useState)(e.isEditable()),E=(0,l.useCallback)(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),w=(0,l.useMemo)(()=>(function(...e){return t=>{for(let n of e)"function"==typeof n?n(t):null!=n&&(n.current=t)}})(N,E),[E,N]);return a4(()=>(T(e.isEditable()),e.registerEditableListener(e=>{T(e)})),[e]),(0,i.jsx)("div",{"aria-activedescendant":k?t:void 0,"aria-autocomplete":k?n:"none","aria-controls":k?r:void 0,"aria-describedby":o,...null!=s?{"aria-errormessage":s}:{},"aria-expanded":k&&"combobox"===y?!!a:void 0,...null!=u?{"aria-invalid":u}:{},"aria-label":d,"aria-labelledby":f,"aria-multiline":c,"aria-owns":k?h:void 0,"aria-readonly":!k||void 0,"aria-required":g,autoCapitalize:p,className:m,contentEditable:k,"data-testid":C,id:_,ref:w,role:y,spellCheck:x,style:v,tabIndex:S,...b})});function a7(e){var t;return e.getEditorState().read((t=e.isComposing(),()=>(function(e){if(!function(e,t=!0){if(e)return!1;let n=is().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;let t=is().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(rT(n))return!1;if(rb(n)){if(!rI(n)||0!==n.__indent)return!1;let t=n.getChildren(),r=t.length;for(let n=0;n<r;n++)if(!nb(t[e]))return!1}}return!0})(t)))}let a8=(0,l.forwardRef)(function(e,t){let{placeholder:n,...r}=e,[l]=a5();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a9,{editor:l,...r,ref:t}),null!=n&&(0,i.jsx)(ue,{editor:l,content:n})]})});function ue({content:e,editor:t}){let n=function(e){let[t,n]=(0,l.useState)(()=>a7(e));return a4(()=>{function t(){n(a7(e))}return t(),lV(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),[r,o]=(0,l.useState)(t.isEditable());if((0,l.useLayoutEffect)(()=>(o(t.isEditable()),t.registerEditableListener(e=>{o(e)})),[t]),!n)return null;let s=null;return"function"==typeof e?s=e(r):null!==e&&(s=e),null===s?null:(0,i.jsx)("div",{"aria-hidden":!0,
1children:s})}var ut=l;let un=(0,ut.createContext)(null),ur={didCatch:!1,error:null};class ui extends ut.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=ur}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;null!==t&&(this.props.onReset?.({args:e,reason:"imperative-api"}),this.setState(ur))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&null!==t.error&&function(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:"keys"}),this.setState(ur))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:l}=this.state,o=e;if(i){let e={error:l,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)o=t(e);else if(n)o=(0,ut.createElement)(n,e);else if(void 0!==r)o=r;else throw l}return(0,ut.createElement)(un.Provider,{value:{didCatch:i,error:l,resetErrorBoundary:this.resetErrorBoundary}},o)}}let ul={name:"@lexical/react/ReactProvider"};var uo=e.i(174080);let us={build(e,t,n){n.getPeer(ul.name)||function(...e){let t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;for(let t of(n.append("code",321),e))n.append("v",t);throw t.search=n.toString(),Error(`Minified Lexical error #321; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}([...n.getDirectDependentNames()].join(" "));let r=[e,{getTheme:()=>e._config.theme}];return{Component:function(e,t){let[n]=t,r=e.decorators.map(e=>"function"==typeof e?(0,i.jsx)(e,{context:t}):e);return function(o){let{EditorChildrenComponent:s=e.EditorChildrenComponent,ErrorBoundary:a=e.ErrorBoundary,contentEditable:u=e.contentEditable,children:d}=o,f=function(e,t){let[n,r]=(0,l.useMemo)(()=>[t=>e.registerDecoratorListener(t),()=>e.getDecorators()],[e]),o=(0,l.useSyncExternalStore)(n,r,r);return(0,l.useMemo)(()=>{let n=[];for(let r in o){let s=e.getElementByKey(r);if(null!==s){let a=(0,i.jsx)(t,{onError:t=>{e._onError(t)},children:(0,i.jsx)(l.Suspense,{fallback:null,children:o[r]})});n.push((0,uo.createPortal)(a,s,r))}}return n},[t,o,e])}(n,a),c=(0,l.useMemo)(()=>r.map((e,t)=>(0,i.jsx)(a,{onError:e=>{n._onError(e)},children:(0,i.jsx)(l.Suspense,{fallback:null,children:e})},t)),[a]);return(0,i.jsx)(a3.Provider,{value:t,children:(0,i.jsxs)(s,{context:t,contentEditable:u,children:[d,c,f]})})}}(t,r),context:r}},config:{EditorChildrenComponent:function({contentEditable:e,children:t}){return(0,i.jsxs)(i.Fragment,{children:[e,t]})},ErrorBoundary:function({children:e,onError:t}){return(0,i.jsx)(ui,{fallback:(0,i.jsx)("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})},contentEditable:(0,i.jsx)(a8,{}),decorators:[]},mergeConfig(e,t){let n=lj(e,t);return t.decorators&&(n.decorators=t.decorators.length>0?[...e.decorators,...t.decorators]:e.decorators),n},name:"@lexical/react/React",peerDependencies:[[ul.name,void 0]]};function ua({extension:e,children:t,contentEditable:n}){let r=(0,l.useMemo)(()=>oR.fromExtensions([ul,l$(us,void 0===n?{}:{contentEditable:n}),e]).buildEditor(),[n,e]);(0,l.useEffect)(()=>{let e=!1;return queueMicrotask(()=>{e=!0}),()=>{e&&r.dispose()}},[r]);let{Component:o}=oz(r,us).output;return(0,i.jsx)(o,{children:t})}let uu=[{dependencies:[oK],export:e=>e instanceof oK?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=i4(oK);r||null!=e.getNextSibling()?e.replace(i):e.insertBefore(i),i.selectNext()},type:"element"},...aZ];function ud({transformers:e=uu}){let[t]=a5();return(0,l.useEffect)(()=>(function(e,t=aZ){let n=aP(t),r=aD(n.textFormat,({tag:e})=>e[e.length-1]),i=aD(n.textMatch,({trigger:e})=>e);for(let n of t){let t=n.type;if("element"===t||"text-match"===t||"multiline-element"===t)for(let t of n.dependencies)e.hasNode(t)||function(...e){let t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;for(let t of(n.append("code",173),e))n.append("v",t);throw t.search=n.toString(),Error(`Minified Lexical error #173; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(t.getType())}return lV(e.registerUpdateListener(({tags:t,dirtyLeaves:l,editorState:o,prevEditorState:s})=>{if(t.has(t6)||t.has(t2)||e.isComposing())return;let a=o.read(nG),u=s.read(nG);if(!nP(u)||!nP(a)||!a.isCollapsed()||a.is(u))return;let d=a.anchor.key,f=a.anchor.offset,c=o._nodeMap.get(d);nb(c)&&l.has(d)&&(1===f||!(f>u.anchor.offset+1))&&e.update(()=>{let e;if(!aj(c))return;let t=c.getParent();null===t||af(t)||(function(e,t,n,r){if(!iR(e.getParent())||e.getFirstChild()!==t)return!1;let i=t.getTextContent();if(" "!==i[n-1])return!1;for(let{regExp:l,replace:o}of r){let r=i.match(l);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){let i=t.getNextSiblings(),[l,s]=t.splitText(n);if(!1!==o(e,s?[s,...i]:i,r,!1))return l.remove(),!0}}return!1}(t,c,e=a.anchor.offset,n.element)||a0(t,c,e,n.multilineElement)||function(e,t,n){let r=e.getTextContent(),i=n[r[t-1]];if(null==i)return!1;for(let n of(t<r.length&&(r=r.slice(0,t)),i)){let t;if(!n.replace||!n.regExp)continue;let i=r.match(n.regExp);if(null===i)continue;let l=i.index||0,o=l+i[0].length;return 0===l?[t]=e.splitText(o):[,t]=e.splitText(l,o),t.selectNext(0,0),n.replace(t,i),!0}return!1}(c,e,i)||function(e,t,n){let r=e.getTextContent(),i=t-1,l=r[i],o=n[l];if(!o)return!1;for(let t of o){let{tag:n}=t,o=n.length,s=i-o+1;if(o>1&&!a2(r,s,n,0,o)||" "===r[s-1])continue;let a=r[i+1];if(!1===t.intraword&&a&&!aF.test(a))continue;let u=e,d=a1(r,s,n),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!no(f);)if(nb(f)){if(f.hasFormat("code"))continue;let e=f.getTextContent();u=f,d=a1(e,e.length,n)}if(d<0||u===e&&d+o===s)continue;let c=u.getTextContent();if(d>0&&c[d-1]===l)continue;let h=c[d-1];if(!1===t.intraword&&h&&!aF.test(h)||!t.format.includes("code")&&function(e,t){let n=0,r=e.getTextContent();for(let e=0;e<t;e++)"`"===r[e]&&n++;return n%2!=0}(u,d))continue;let g=e.getTextContent(),p=g.slice(0,s)+g.slice(i+1);e.setTextContent(p);let m=u===e?p:c;u.setTextContent(m.slice(0,d)+m.slice(d+o));let _=nG(),y=nV();iu(y);let x=i-o*(u===e?2:1)+1;
1for(let n of(y.anchor.set(u.__key,d,"text"),y.focus.set(e.__key,x,"text"),t.format))y.hasFormat(n)||y.formatText(n);for(let e of(y.anchor.set(y.focus.key,y.focus.offset,y.focus.type),t.format))y.hasFormat(e)&&y.toggleFormat(e);return nP(_)&&(y.format=_.format),!0}return!1}(c,e,r))&&iP(t3)})}),e.registerCommand(e3,e=>{if(null!==e&&e.shiftKey)return!1;let t=nG();if(!nP(t)||!t.isCollapsed())return!1;let r=t.anchor.offset,i=t.anchor.getNode();if(!nb(i)||!aj(i))return!1;let l=i.getParent();return!(null===l||af(l))&&r===i.getTextContent().length&&!!a0(l,i,r,n.multilineElement,!0)&&(null!==e&&e.preventDefault(),!0)},1))})(t,e),[t,e]),null}let uf="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;function uc({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){let[r]=a5();return uf(()=>{if(n)return r.registerUpdateListener(({editorState:i,dirtyElements:l,dirtyLeaves:o,prevEditorState:s,tags:a})=>{t&&0===l.size&&0===o.size||e&&a.has(t5)||s.isEmpty()||n(i,r,a)})},[r,e,t,n]),null}var uh=e.i(456420);let ug=(0,uh.default)("text-align-center",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]]);var up=e.i(676441),up=up;let um=(0,uh.default)("text-align-start",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]]),u_=(0,uh.default)("text-align-end",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}
1]]),uy=(0,uh.default)("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]),ux=(0,uh.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),uv=(0,uh.default)("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]),uS=(0,uh.default)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),uC=(0,uh.default)("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]),ub=(0,uh.default)("redo-2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]),uN=(0,uh.default)("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]),uk=(0,uh.default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),uT=[{label:"Normal",value:"paragraph"},{label:"Heading 1",value:"h1"},{label:"Heading 2",value:"h2"},{label:"Heading 3",value:"h3"},{label:"Quote",value:"quote"}];function uE(e,t,n){n===t?e.dispatchCommand(sA,void 0):e.dispatchCommand("bullet"===t?sO:sM,void 0)}function uw(){return(0,i.jsx)("div",{className:"mx-1 w-px self-stretch bg-zinc-200 dark:bg-zinc-600"})}function uO(){let[e]=a5(),t=(0,l.useRef)(null),[n,r]=(0,l.useState)(!1),[o,s]=(0,l.useState)(!1),[a,u]=(0,l.useState)("paragraph"),[d,f]=(0,l.useState)(!1),[c,h]=(0,l.useState)(!1),[g,p]=(0,l.useState)(!1),[m,_]=(0,l.useState)(!1),[y,x]=(0,l.useState)(null),v=(0,l.useCallback)(()=>{let e=nG();if(nP(e))try{let t=e.anchor.getNode();if(!t.isAttached()){u("paragraph"),f(!1),h(!1),p(!1),_(!1),x(null);return}let n=i9(t,e=>sE(e)),r=n?"number"===n.getListType()?"number":"bullet":null;x(r);let i=i9(t,e=>{let t=e.getParent();return null!==t&&iR(t)});if(null===i)try{i=t.getTopLevelElementOrThrow()}catch{u("paragraph"),f(!1),h(!1),p(!1),_(!1);return}an(i)?u(i.getTag()):u(i.getType()),f(e.hasFormat("bold")),h(e.hasFormat("italic")),p(e.hasFormat("underline")),_(e.hasFormat("code"))}catch{u("paragraph"),f(!1),h(!1),p(!1),_(!1),x(null)}},[]);(0,l.useEffect)(()=>lV(e.registerUpdateListener(({editorState:t})=>{t.read(()=>v(),{editor:e})}),e.registerCommand(th,e=>(r(e),!1),1),e.registerCommand(tc,e=>(s(e),!1),1)),[e,v]);let S="flex size-8 cursor-pointer items-center justify-center rounded-md border-0 transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-30 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-500",C="bg-transparent text-zinc-700 enabled:hover:bg-zinc-200 dark:text-zinc-200 dark:enabled:hover:bg-zinc-700",b="bg-blue-500 text-white enabled:hover:bg-blue-600 dark:bg-blue-600 dark:enabled:hover:bg-blue-700",N=e=>e?"opacity-100":"opacity-70",k=e=>t=>{t.preventDefault(),e()};return(0,i.jsxs)("div",{ref:t,role:"toolbar","aria-label":"Formatting",className:"flex flex-wrap items-center gap-0.5 overflow-x-auto border-b border-solid border-[#E8ECF3] bg-[#FAFBFC] px-2 py-1.5 dark:border-white/10 dark:bg-[#1B1E29]",children:[(0,i.jsx)("select",{className:"cursor-pointer appearance-none rounded-md border border-transparent bg-transparent px-2 py-1 text-sm font-medium text-zinc-700 transition-colors hover:bg-zinc-200 focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-500 dark:text-zinc-200 dark:hover:bg-zinc-700",value:a,onChange:t=>(function(e,t){if("paragraph"===t)e.update(()=>{l0(nG(),()=>rL())});else if("quote"===t)e.update(()=>{l0(nG(),()=>s6())});else e.update(()=>{l0(nG(),()=>at(t))})})(e,t.target.value),"aria-label":"Block type",children:uT.map(({label:e,value:t})=>(0,i.jsx)("option",{value:t,children:e},t))}),(0,i.jsx)(uw,{}),(0,i.jsx)("button",{type:"button",disabled:!n,onMouseDown:k(()=>
1e.dispatchCommand(eq,void 0)),className:`${S} ${C}`,"aria-label":"Undo",children:(0,i.jsx)(uk,{size:16,className:N(!1)})}),(0,i.jsx)("button",{type:"button",disabled:!o,onMouseDown:k(()=>e.dispatchCommand(eY,void 0)),className:`${S} ${C}`,"aria-label":"Redo",children:(0,i.jsx)(ub,{size:16,className:N(!1)})}),(0,i.jsx)(uw,{}),(0,i.jsx)("button",{type:"button",onMouseDown:k(()=>e.dispatchCommand(eV,"bold")),className:`${S} ${d?b:C}`,"aria-label":"Bold","aria-pressed":d,children:(0,i.jsx)(uy,{size:16,className:N(d)})}),(0,i.jsx)("button",{type:"button",onMouseDown:k(()=>e.dispatchCommand(eV,"italic")),className:`${S} ${c?b:C}`,"aria-label":"Italic","aria-pressed":c,children:(0,i.jsx)(uv,{size:16,className:N(c)})}),(0,i.jsx)("button",{type:"button",onMouseDown:k(()=>e.dispatchCommand(eV,"underline")),className:`${S} ${g?b:C}`,"aria-label":"Underline","aria-pressed":g,children:(0,i.jsx)(uN,{size:16,className:N(g)})}),(0,i.jsx)("button",{type:"button",onMouseDown:k(()=>e.dispatchCommand(eV,"code")),className:`${S} ${m?b:C}`,"aria-label":"Inline code",title:"Inline code","aria-pressed":m,children:(0,i.jsx)(ux,{size:16,className:N(m)})}),(0,i.jsx)(uw,{}),(0,i.jsx)("button",{type:"button",onMouseDown:k(()=>uE(e,"bullet",y)),className:`${S} ${"bullet"===y?b:C}`,"aria-label":"Bullet list","aria-pressed":"bullet"===y,children:(0,i.jsx)(uS,{size:16,className:N("bullet"===y)})}),(0,i.jsx)("button",{type:"button",onMouseDown:k(()=>uE(e,"number",y)),className:`${S} ${"number"===y?b:C}`,"aria-label":"Numbered list","aria-pressed":"number"===y,children:(0,i.jsx)(uC,{size:16,className:N("number"===y)})}),(0,i.jsx)(uw,{}),(0,i.jsx)("button",{type:"button",onMouseDown:k(()=>e.dispatchCommand(tr,"left")),className:`${S} ${C}`,"aria-label":"Align left",children:(0,i.jsx)(um,{size:16,className:N(!1)})}),(0,i.jsx)("button",{type:"button",onMouseDown:k(()=>e.dispatchCommand(tr,"center")),className:`${S} ${C}`,"aria-label":"Align center",children:(0,i.jsx)(ug,{size:16,className:N(!1)})}),(0,i.jsx)("button",{type:"button",onMouseDown:k(()=>e.dispatchCommand(tr,"right")),className:`${S} ${C}`,"aria-label":"Align right",children:(0,i.jsx)(u_,{size:16,className:N(!1)})}),(0,i.jsx)("button",{type:"button",onMouseDown:k(()=>e.dispatchCommand(tr,"justify")),className:`${S} ${C}`,"aria-label":"Justify",children:(0,i.jsx)(up.default,{size:16,className:N(!1)})})]})}var uM=e.i(647163);let uA=new Set(["P","BR","STRONG","B","EM","I","U","S","STRIKE","DEL","CODE","H1","H2","H3","BLOCKQUOTE","SPAN","UL","OL","LI"]);function uD(e){return/^\s*</.test(e)}let uP=new Set(["P","DIV","LI","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","PRE","TABLE","TBODY","TR","TD","TH"]);function uF(e){if("u"<typeof document)return"";let t=new DOMParser().parseFromString(e,"text/html"),n=e=>{[...e.children].forEach(t=>{if(!uA.has(t.tagName)){t.replaceWith(...t.childNodes),n(e);return}[...t.attributes].forEach(e=>{"style"!==e.name&&t.removeAttribute(e.name)});let r=t.getAttribute("style");if(r){let e=r.split(";").map(e=>e.trim()).filter(e=>/^(text-decoration|white-space)\s*:/i.test(e)).join("; ");e?t.setAttribute("style",e):t.removeAttribute("style")}n(t)})};return n(t.body),t.body.innerHTML}let uL={heading:{h1:"mb-1 text-base font-bold",h2:"mb-1 text-[14px] font-bold",h3:"mb-0.5 text-[14px] font-semibold"},paragraph:"community-comment-editor__paragraph my-0",quote:"my-1 border-l-2 border-[#E8ECF3] pl-2 text-[14px] italic text-[#6B7280] dark:border-white/15 dark:text-[#9EA3B5]",text:{bold:"font-bold",italic:"italic",underline:"underline",code:"rounded bg-black/5 px-1 py-0.5 font-mono text-[0.85em] text-[#0F172A] dark:bg-white/10 dark:text-[#E2E8F0]"},list:{ul:"community-comment-editor__ul ml-5 list-disc",ol:"community-comment-editor__ol ml-5 list-decimal",listitem:"community-comment-editor__li my-0.5",nested:{listitem:"community-comment-editor__li--nested ml-4"}}},uI={name:"aipub-community-list",nodes:[sS,sm],register:e=>{var t;return lV((t=e).registerCommand(sM,()=>(sf("number"),!0),1),t.registerCommand(sw,e=>{let{listNodeKey:t,newStart:n}=e,r=ie(t);return!!sE(r)&&("number"===r.getListType()&&(r.setStart(n),sp(r)),!0)},1),t.registerCommand(sO,()=>(sf("bullet"),!0),1),t.registerCommand(sA,()=>((function(){let e=nG();if(nP(e)){let t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(sd(r,n))t.add(ss(r));else for(let e=0;e<n.length;e++){let r=n[e];if(r5(r)){let e=function(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}(r,sm);null!=e&&t.add(ss(e))}}for(let n of t){let t=n;for(let r of function e(t){let n=[],r=t.getChildren().filter(sv);for(let t=0;t<r.length;t++){let i=r[t],l=i.getFirstChild();sE(l)?n=n.concat(e(l)):n.push(i)}return n}(n)){let n=rL().setTextStyle(e.style).setTextFormat(e.format);sc(n,r.getChildren()),t.insertAfter(n),t=n,r.__key===e.anchor.key&&lE(e.anchor,lF(lp(n,"next"))),r.__key===e.focus.key&&lE(e.focus,lF(lp(n,"next"))),r.remove()}n.remove()}}})(),!0),1),t.registerCommand(eW,()=>(function(e=!1){let t,n=nG();if(!nP(n)||!n.isCollapsed())return!1;let r=n.anchor.getNode(),i=null;if(sv(r)&&0===r.getChildrenSize())i=r;else if(nb(r)){let e=r.getParent();sv(e)&&e.getChildren().every(e=>nb(e)&&""===e.getTextContent().trim())&&(i=e)}if(null===i)return!1;let l=ss(i),o=i.getParent();sE(o)||so(40);let s=o.getParent();if(iR(s))t=rL(),l.insertAfter(t);else{if(!sv(s))return!1;t=iz(s),s.insertAfter(t)}t.setTextStyle(n.style).setTextFormat(n.format).select();let a=i.getNextSiblings();if(a.length>0){var u;let n=e?(u=i,o.getStart()+u.getIndexWithinParent()):1,r=iz(o).setStart(n);if(sv(t)){let e=iz(t);e.append(r),t.insertAfter(e)}else t.insertAfter(r);r.append(...a)}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){let e=t.getParent();if(null==e||!sv(e)&&!sE(e))break;t=e}t.remove()}(i),!0})(false),1),t.registerNodeTransform(sm,e=>{let t=e.getFirstChild();if(t){if(nb(t)){let n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{let t=nG();nP(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),t.registerNodeTransform(ng,e=>{let t=e.getParent();if(sv(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}};function uR(e,t){e.update(()=>{let n=is();n.clear();let r=t.trim();if(!r){let e=rL();n.append(e),e.select(0,0);return}if(uD(r)&&"u">typeof document)try{let t=new DOMParser().parseFromString(uF(r),"text/html"),i=si(e,t);if(i.length>0){let e=rL();n.append(e),e.select(0,0),n5(i);return}}catch{}let i=rL();i.append(nC(r)),n.append(i),i.selectEnd()})}function uz({onChange:e,maxLength:t,autoFocus:n,disabled:r,resetSignal:o,initialValue:s}){let[a]=a5();return(0,l.useEffect)(()=>{a.setEditable(!r)},[a,r]),(0,l.useEffect)(()=>{s&&uR(a,s)},[a]),(0,l.useEffect)(()=>
1{if(0!==o){if(s)return void uR(a,s);a.update(()=>{let e=is();e.clear();let t=rL();e.append(t),t.select(0,0)})}},[a,o,s]),(0,l.useEffect)(()=>a.registerTextContentListener(e=>{if(e.length<=t)return;let n=e.slice(0,t);a.update(()=>{let e=is(),t=nG();e.clear();let r=rL();r.append(nC(n)),e.append(r),nP(t)&&r.selectEnd()})}),[a,t]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(uc,{ignoreSelectionChange:!0,onChange:n=>{n.read(()=>is().getTextContent().length)>t||e(n.read(()=>sl(a))||n.read(()=>(function(e=aZ,t=!1){return(function(e,t=!1){let n=aP(e),r=[...n.multilineElement,...n.element],i=!t,l=n.textFormat.filter(e=>1===e.format.length).sort((e,t)=>Number(e.format.includes("code"))-Number(t.format.includes("code")));return e=>{let o=[],s=(e||is()).getChildren();for(let e=0;e<s.length;e++){let a=s[e],u=function(e,t,n,r,i){for(let l of t){if(!l.export)continue;let t=l.export(e,e=>az(e,n,r,void 0,void 0,i));if(null!=t)return t}return rb(e)?az(e,n,r,void 0,void 0,i):rT(e)?e.getTextContent():null}(a,r,l,n.textMatch,t);null!=u&&o.push(i&&e>0&&!aI(a)&&!aI(s[e-1])?"\n".concat(u):u)}return o.join("\n")}})(e,t)(void 0)})(aQ)))}}),(0,i.jsx)(ud,{transformers:aQ}),n?(0,i.jsx)(a6,{}):null]})}e.s(["default",0,function({onChange:e,placeholder:t="Write a comment…",minHeightClass:n="min-h-[84px]",contentClassName:r,maxLength:o=1500,autoFocus:s=!1,disabled:a=!1,resetSignal:u=0,initialValue:d,"aria-label":f="Comment"}){let c=(0,l.useId)(),h=(0,l.useMemo)(()=>{let e;return e=c.replace(/:/g,""),{dependencies:[al,oU,o$,uI],name:`aipub-community-comment${e}`,namespace:`aipub-community-comment${e}`,theme:uL}},[c]);return(0,i.jsx)(ua,{extension:h,contentEditable:null,children:(0,i.jsxs)("div",{className:(0,uM.cn)("flex w-full flex-col overflow-hidden",a&&"opacity-60"),children:[(0,i.jsx)(uO,{}),(0,i.jsxs)("div",{className:"community-comment-editor relative",children:[(0,i.jsx)(a8,{className:(0,uM.cn)("community-comment-editor__input relative z-[1] overflow-y-auto p-3 text-[14px] leading-relaxed text-wrap text-[#0A0A0A] outline-none dark:text-foreground",n,r),"aria-label":f,"aria-placeholder":t,placeholder:(0,i.jsx)("div",{className:"pointer-events-none absolute top-3 left-3 select-none text-[14px] text-[#9A9AA3]",children:t})}),(0,i.jsx)(uz,{onChange:e,maxLength:o,autoFocus:s,disabled:a,resetSignal:u,initialValue:d})]})]})})},"formatCommentMessage",0,function(e){let t;if(!e)return null;if(uD(e))return(0,i.jsx)("span",{className:"comment-message-html [&_ul]:my-1 [&_ul]:ml-5 [&_ul]:list-disc [&_ol]:my-1 [&_ol]:ml-5 [&_ol]:list-decimal [&_li]:my-0.5 [&_code]:rounded [&_code]:bg-black/5 [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em] [&_code]:text-[#0F172A] dark:[&_code]:bg-white/10 dark:[&_code]:text-[#E2E8F0]",dangerouslySetInnerHTML:{__html:uF(e)}});let n=[],r=/(\*\*[^*]+\*\*|\*[^*]+\*|~~[^~]+~~|`[^`]+`)/g,l=0,o=0;for(;null!==(t=r.exec(e));){t.index>l&&n.push(e.slice(l,t.index));let s=t[0],a=s.slice(s.startsWith("**")||s.startsWith("~~")?2:1,s.endsWith("**")||s.endsWith("~~")?-2:-1);s.startsWith("**")?n.push((0,i.jsx)("strong",{className:"font-semibold text-[#3F3F4A] dark:text-foreground",children:a},o++)):s.startsWith("~~")?n.push((0,i.jsx)("span",{className:"line-through",children:a},o++)):s.startsWith("`")?n.push((0,i.jsx)("code",{className:"rounded bg-black/5 px-1 py-0.5 font-mono text-[0.85em] dark:bg-white/10",children:a},o++)):n.push((0,i.jsx)("em",{className:"italic",children:a},o++)),l=r.lastIndex}return l<e.length&&n.push(e.slice(l)),1===n.length?n[0]:n},"getEditorPlainText",0,function(e){let t=e.trim();if(!t)return"";if(uD(t)){if("u"<typeof document)return t.replace(/<\/(p|div|li|h[1-6]|blockquote|ul|ol|pre|tr|td|th|table|tbody)>/gi," ").replace(/<br\s*\/?>/gi," ").replace(/<[^>]+>/g,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/\s+/g," ").trim();let e=new DOMParser().parseFromString(t,"text/html"),n=[],r=e=>{if(e.nodeType===Node.TEXT_NODE)return void n.push(e.textContent??"");if(e.nodeType!==Node.ELEMENT_NODE)return;if("BR"===e.tagName)return void n.push(" ");let t=uP.has(e.tagName);
1e.childNodes.forEach(r),t&&n.push(" ")};return e.body.childNodes.forEach(r),n.join("").replace(/\s+/g," ").trim()}return t.replace(/```[\w-]*\s*\n?/g," ").replace(/```/g," ").replace(/`([^`]+)`/g,"$1").replace(/^\s*>\s?/gm,"").replace(/^\s*#{1,6}\s+/gm,"").replace(/^\s*[-*+]\s+/gm,"").replace(/^\s*\d+[.)]\s+/gm,"").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/_([^_]+)_/g,"$1").replace(/~~([^~]+)~~/g,"$1").replace(/!?\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\s+/g," ").trim()}],980885)}]);

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.