Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
demountable
/
wp-content
/
plugins
/
surerank
/
build
:
index.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
"use strict";(globalThis.webpackChunksurerank=globalThis.webpackChunksurerank||[]).push([[770],{6246:(t,e,n)=>{n.d(e,{n:()=>u});var r=n(94439),i=n(48832),o=n(51609),s=n(74848);const l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,c=l?o.useLayoutEffect:o.useEffect,a={tag:i.T40};function u({initialConfig:t,children:e}){const n=(0,o.useMemo)(()=>{const{theme:e,namespace:n,nodes:o,onError:s,editorState:c,html:u}=t,d=(0,r.Mx)(null,e),f=(0,i.ieJ)({editable:t.editable,html:u,namespace:n,nodes:o,onError:t=>s(t,f),theme:e});return function(t,e){if(null!==e)if(void 0===e)t.update(()=>{const e=(0,i.NiT)();if(e.isEmpty()){const n=(0,i.lJ7)();e.append(n);const r=l?document.activeElement:null;(null!==(0,i.vJq)()||null!==r&&r===t.getRootElement())&&n.select()}},a);else if(null!==e)switch(typeof e){case"string":{const n=t.parseEditorState(e);t.setEditorState(n,a);break}case"object":t.setEditorState(e,a);break;case"function":t.update(()=>{(0,i.NiT)().isEmpty()&&e(t)},a)}}(f,c),[f,d]},[]);return c(()=>{const e=t.editable,[r]=n;r.setEditable(void 0===e||e)},[]),(0,s.jsx)(r.Gu.Provider,{value:n,children:e})}},12532:(t,e,n)=>{n.d(e,{x:()=>o});var r=n(94439),i=n(51609);function o({defaultSelection:t}){const[e]=(0,r.DF)();return(0,i.useEffect)(()=>{e.focus(()=>{const t=document.activeElement,n=e.getRootElement();null===n||null!==t&&n.contains(t)||n.focus({preventScroll:!0})},{defaultSelection:t})},[t,e]),null}},16191:(t,e,n)=>{n.d(e,{G:()=>o});var r=n(94439),i=n(51609);function o({editorRef:t}){const[e]=(0,r.DF)();return i.useEffect(()=>{"function"==typeof t?t(e):"object"==typeof t&&(t.current=e)},[e]),null}},24119:(t,e,n)=>{n.d(e,{B:()=>r});class r extends Map{constructor(t,e=o){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[n,r]of t)this.set(n,r)}get(t){return super.get(i(this,t))}has(t){return super.has(i(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}(this,t))}}function i({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function o(t){return null!==t&&"object"===typeof t?t.valueOf():t}Set},27639:(t,e,n)=>{n.d(e,{Cb:()=>l,Rk:()=>c,SD:()=>i,_A:()=>o});var r=n(48832);function i(t,e){const n=t.getStartEndPoints();if(e.isSelected(t)&&!e.isSegmented()&&!e.isToken()&&null!==n){const[i,o]=n,s=t.isBackward(),l=i.getNode(),c=o.getNode(),a=e.is(l),u=e.is(c);if(a||u){const[n,i]=(0,r.Cku)(t),o=l.is(c),a=e.is(s?c:l),u=e.is(s?l:c);let d,f=0;return o?(f=n>i?i:n,d=n>i?n:i):a?(f=s?i:n,d=void 0):u&&(f=0,d=s?n:i),e.__text=e.__text.slice(f,d),e}}return e}function o(t,e,n){let i=e.getNode(),o=n;if((0,r.ff4)(i)){const t=i.getDescendantByIndex(e.offset);null!==t&&(i=t)}for(;o>0&&null!==i;){if((0,r.ff4)(i)){const t=i.getLastDescendant();null!==t&&(i=t)}let n=i.getPreviousSibling(),s=0;if(null===n){let t=i.getParentOrThrow(),e=t.getPreviousSibling();for(;null===e;){if(t=t.getParent(),null===t){n=null;break}e=t.getPreviousSibling()}null!==t&&(s=t.isInline()?0:2,n=e)}let l=i.getTextContent();""===l&&(0,r.ff4)(i)&&!i.isInline()&&(l="\n\n");const c=l.length;if(!(0,r.kFe)(i)||o>=c){const t=i.getParent();i.remove(),null==t||0!==t.getChildrenSize()||(0,r.hVZ)(t)||t.remove(),o-=c+s,i=n}else{const n=i.getKey(),s=t.getEditorState().read(()=>{const t=(0,r.nsf)(n);return(0,r.kFe)(t)&&t.isSimpleText()?t.getTextContent():null}),a=c-o,u=l.slice(0,a);if(null!==s&&s!==l){const t=(0,r.S1w)();let e=i;if(i.isSimpleText())i.setTextContent(s);else{const t=(0,r.sTu)(s);i.replace(t),e=t}if((0,r.I2P)(t)&&t.isCollapsed()){const n=t.anchor.offset;e.select(n,n)}}else if(i.isSimpleText()){const t=e.key===n;let r=e.offset;r<o&&(r=c);const s=t?r-o:0,l=t?r:a;if(t&&0===s){const[t]=i.splitText(s,l);t.remove()}else{const[,t]=i.splitText(s,l);t.remove()}}else{const t=(0,r.sTu)(u);i.replace(t)}o=0}}}function s(t){const e=t.anchor.getNode(),n=(0,r.hVZ)(e)?e:e.getParentOrThrow(),i=(0,r.i0_)().getElementByKey(n.getKey());if(null===i)return!1;const o=i.ownerDocument.defaultView;return null!==o&&"vertical-rl"===o.getComputedStyle(i).writingMode}function l(t,e){const n=s(t)?!e:e,i=(0,r.Ave)(t.focus,n?"previous":"next");if((0,r.pGK)(i))return!1;for(const o of(0,r.mWO)(i)){if((0,r.cmH)(o))return!o.origin.isInline();if(!(0,r.ff4)(o.origin)){if((0,r.Cyw)(o.origin))return!0;break}}return!1}function c(t,e,n){const i=function(t){const e=t.anchor.getNode();return"rtl"===((0,r.hVZ)(e)?e:e.getParentOrThrow()).getDirection()}(t);let o;o=s(t)||i?!n:n,function(t,e,n){t.modify(e?"extend":"move",n,"character")}(t,e,o)}new Map},40290:(t,e,n)=>{n.d(e,{G:()=>m});var r=n(94439),i=n(73105),o=n(48832);const s=0,l=1,c=2,a=0,u=1,d=2,f=3,h=4;function g(t,e,n,r,i){if(null===t||0===n.size&&0===r.size&&!i)return a;const s=e._selection,l=t._selection;if(i)return u;if(!((0,o.I2P)(s)&&(0,o.I2P)(l)&&l.isCollapsed()&&s.isCollapsed()))return a;const c=function(t,e,n){const r=t._nodeMap,i=[];for(const o of e){const t=r.get(o);void 0!==t&&i.push(t)}for(const[s,l]of n){if(!l)continue;const t=r.get(s);void 0===t||(0,o.hVZ)(t)||i.push(t)}return i}(e,n,r);if(0===c.length)return a;if(c.length>1){const n=e._nodeMap,r=n.get(s.anchor.key),i=n.get(l.anchor.key);return r&&i&&!t._nodeMap.has(r.__key)&&(0,o.kFe)(r)&&1===r.__text.length&&1===s.anchor.offset?d:a}const g=c[0],p=t._nodeMap.get(g.__key);if(!(0,o.kFe)(p)||!(0,o.kFe)(g)||p.__mode!==g.__mode)return a;const _=p.__text,m=g.__text;if(_===m)return a;const y=s.anchor,x=l.anchor;if(y.key!==x.key||"text"!==y.type)return a;const v=y.offset,C=x.offset,S=m.length-_.length;return 1===S&&C===v-1?d:-1===S&&C===v+1?f:-1===S&&C===v?h:a}function p(t){t.undoStack=[],t.redoStack=[],t.current=null}var _=n(51609);function m({delay:t,externalHistoryState:e}){const[n]=(0,r.DF)();return function(t,e,n=1e3){const r=(0,_.useMemo)(()=>e||{current:null,redoStack:[],undoStack:[]},[e]);(0,_.useEffect)(()=>function(t,e,n){const r=function(t,e){let n=Date.now(),r=a;return(i,u,d,f,h,p)=>{const _=Date.now();if(p.has(o.n0X))return r=a,n=_,c;const m=g(i,u,f,h,t.isComposing()),y=(()=>{const g=null===d||d.editor===t,y=p.has(o.bMH);if(!y&&g&&p.has(o.T40))return s;if(null===i)return l;const x=u._selection;return f.size>0||h.size>0?!1===y&&m!==a&&m===r&&_<n+e&&g||1===f.size&&function(t,e,n){const r=e._nodeMap.get(t),i=n._nodeMap.get(t),s=e._selection,l=n._selection;return!((0,o.I2P)(s)&&(0,o.I2P)(l)&&"element"===s.anchor.type&&"element"===s.focus.type&&"text"===l.anchor.type&&"text"===l.focus.type||!(0,o.kFe)(r)||!(0,o.kFe)(i)||r.__parent!==i.__parent)&&JSON.stringify(e.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(f)[0],i,u)?s:l:null!==x?s:c})();return n=_,r=m,y}}(t,n),u=(0,i.Sd)(t.registerCommand(o.ZKf,()=>(function(t,e){const n=e.redoStack,r=e.undoStack;if(0!==r.length){const i=e.current,s=r.pop();null!==i&&(n.push(i),t.dispatchCommand(o.WWb,!0)),0===r.length&&t.dispatchCommand(o.KfJ,!1),e.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:o.n0X})}}(t,e),!0),o.jZM),t.registerCommand(o.V30,()=>(function(t,e){const n=e.redoStack;if(0!==n.length){const r=e.current;null!==r&&(e.undoStack.push(r),t.dispatchCommand(o.KfJ,!0));const i=n.pop();0===n.length&&t.dispatchCommand(o.WWb,!1),e.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:o.n0X})}}(t,e),!0),o.jZM),t.registerCommand(o.SKc,()=>(p(e),!1),o.jZM),t.registerCommand(o.t5V,()=>(p(e),t.dispatchCommand(o.WWb,!1),t.dispatchCommand(o.KfJ,!1),!0),o.jZM),t.registerUpdateListener(({editorState:n,prevEditorState:i,dirtyLeaves:s,dirtyElements:a,tags:u})=>{const d=e.current,f=e.redoStack,h=e.undoStack;if(null!==d&&n===(null===d?null:d.editorState))return;const g=r(i,n,d,s,a,u);if(g===l)0!==f.length&&(e.redoStack=[],t.dispatchCommand(o.WWb,!1)),null!==d&&(h.push({...d}),t.dispatchCommand(o.KfJ,!0));else if(g===c)return;e.current={editor:t,editorState:n}}));return u}(t,r,n),[n,t,r])}(n,e,t),null}},45838:(t,e,n)=>{n.d(e,{D:()=>l});var r=n(94439),i=n(48832),o=n(51609);const s="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function l({ignoreHistoryMergeTagChange:t=!0,ignoreSelectionChange:e=!1,onChange:n}){const[o]=(0,r.DF)();return s(()=>{if(n)return o.registerUpdateListener(({editorState:r,dirtyElements:s,dirtyLeaves:l,prevEditorState:c,tags:a})=>{e&&0===s.size&&0===l.size||t&&a.has(i.T40)||c.isEmpty()||n(r,o,a)})},[o,t,e,n]),null}},48832:(t,e,n)=>{function r(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}n.d(e,{$7r:()=>Te,$ey:()=>Ht,AX0:()=>ie,AcJ:()=>ti,Ave:()=>Go,BEs:()=>vo,Cku:()=>Bn,Cyw:()=>Fr,FEN:()=>qt,HYn:()=>ve,I2P:()=>Ln,JM3:()=>ne,K8K:()=>uo,KfJ:()=>ke,Kp7:()=>Dr,NiT:()=>wi,OXk:()=>he,Q$N:()=>de,R18:()=>ee,RTo:()=>ce,S1w:()=>Xn,SKc:()=>Ce,Sr4:()=>ge,T40:()=>jr,TgX:()=>pe,UDz:()=>se,V30:()=>te,VSO:()=>xe,WWb:()=>be,WuB:()=>Vt,XKQ:()=>Ut,ZKf:()=>Qt,bM3:()=>$t,bMH:()=>Jr,bSg:()=>Gr,bbF:()=>le,cmH:()=>Po,e1k:()=>ji,ff4:()=>Ar,fwY:()=>Vr,gCZ:()=>ue,guI:()=>Wt,hVZ:()=>Ir,haT:()=>Lr,hi0:()=>Yt,i0_:()=>_o,ieJ:()=>ni,jZM:()=>Qr,kFe:()=>wn,lJ7:()=>Xr,mWO:()=>Vo,n0X:()=>Wr,n1P:()=>Ni,nsf:()=>vi,pGK:()=>ls,peL:()=>lo,sTu:()=>Tn,sby:()=>co,t5V:()=>Se,u5G:()=>ye,vJq:()=>Yn,viC:()=>Xt,w$Z:()=>fe,waI:()=>Zt});const i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,o=i&&"documentMode"in document?document.documentMode:null,s=i&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),l=i&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),c=!(!i||!("InputEvent"in window)||o)&&"getTargetRanges"in new window.InputEvent("input"),a=i&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),u=i&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,d=i&&/Android/.test(navigator.userAgent),f=i&&/^(?=.*Chrome).*/i.test(navigator.userAgent),h=i&&d&&f,g=i&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!f;function p(...t){const e=[];for(const n of t)if(n&&"string"==typeof n)for(const[t]of n.matchAll(/\S+/g))e.push(t);return e}const _=1,m=11,y=2,x=0,v=1,C=2,S=1,b=2,k=3,T=4,w=5,E=6,N=a||u||g?"\xa0":"\u200b",M="\n\n",O=l?"\xa0":N,A="\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc",P="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff",D=new RegExp("^[^"+P+"]*["+A+"]"),F=new RegExp("^[^"+A+"]*["+P+"]"),L={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},I={directionless:1,unmergeable:2},R={center:2,end:6,justify:4,left:1,right:3,start:5},K={[b]:"center",[E]:"end",[T]:"justify",[S]:"left",[k]:"right",[w]:"start"},B={normal:0,segmented:2,token:1},z={[x]:"normal",[C]:"segmented",[v]:"token"},W="$";function J(t,e,n,r,i,o){let s=t.getFirstChild();for(;null!==s;){const t=s.__key;s.__parent===e&&(Ar(s)&&J(s,t,n,r,i,o),n.has(t)||o.delete(t),i.push(t)),s=s.getNextSibling()}}let j=!1,V=0;function q(t){V=t.timeStamp}function U(t,e,n){const r="BR"===t.nodeName,i=e.__lexicalLineBreak;return i&&(t===i||r&&t.previousSibling===i)||r&&void 0!==Si(t,n)}function $(t,e,n){const r=lo(eo(n));let i=null,o=null;null!==r&&r.anchorNode===t&&(i=r.anchorOffset,o=r.focusOffset);const s=t.nodeValue;null!==s&&Ii(e,s,i,o,!1)}function Z(t,e,n){if(Ln(t)){const e=t.anchor.getNode();if(e.is(n)&&t.format!==e.getFormat())return!1}return hi(e)&&n.isAttached()}function H(t,e,n,r){for(let i=t;i&&!Co(i);i=Xi(i)){const t=Si(i,e);if(void 0!==t){const e=vi(t,n);if(e)return Fr(e)||!co(i)?void 0:[i,e]}else if(i===r)return[r,Ei(n)]}}function Y(t,e,n){j=!0;const r=performance.now()-V>100;try{Er(t,()=>{const i=Yn()||function(t){return t.getEditorState().read(()=>{const t=Yn();return null!==t?t.clone():null})}(t),o=new Map,s=t.getRootElement(),c=t._editorState,a=t._blockCursorElement;let u=!1,d="";for(let n=0;n<e.length;n++){const f=e[n],h=f.type,g=f.target,p=H(g,t,c,s);if(!p)continue;const[_,m]=p;if("characterData"===h)r&&wn(m)&&hi(g)&&Z(i,g,m)&&$(g,m,t);else if("childList"===h){u=!0;const e=f.addedNodes;for(let i=0;i<e.length;i++){const n=e[i],r=Ci(n),o=n.parentNode;if(null!=o&&n!==a&&null===r&&!U(n,o,t)){if(l){const t=(co(n)?n.innerText:null)||n.nodeValue;t&&(d+=t)}o.removeChild(n)}}const n=f.removedNodes,r=n.length;if(r>0){let e=0;for(let i=0;i<r;i++){const r=n[i];(U(r,g,t)||a===r)&&(g.appendChild(r),e++)}r!==e&&o.set(_,m)}}}if(o.size>0)for(const[e,n]of o)n.reconcileObservedMutation(e,t);const f=n.takeRecords();if(f.length>0){for(let e=0;e<f.length;e++){const n=f[e],r=n.addedNodes,i=n.target;for(let e=0;e<r.length;e++){const n=r[e],o=n.parentNode;null==o||"BR"!==n.nodeName||U(n,i,t)||o.removeChild(n)}}n.takeRecords()}null!==i&&(u&&Ni(i),l&&$i(t)&&i.insertRawText(d))})}finally{j=!1}}function X(t){const e=t._observer;null!==e&&Y(t,e.takeRecords(),e)}function G(t){!function(t){0===V&&eo(t).addEventListener("textInput",q,!0)}(t),t._observer=new MutationObserver((e,n)=>{Y(t,e,n)})}class Q{constructor(t,e=new Map,n=void 0,r=new Map,i=void 0){this.node=t,this.sharedConfigMap=e,this.unknownState=n,this.knownState=r;const o=void 0!==i?i:function(t,e,n){let r=n.size;if(e)for(const i in e){const e=t.get(i);e&&n.has(e)||r++}return r}(e,n,r);this.size=o}getValue(t){const e=this.knownState.get(t);if(void 0!==e)return e;this.sharedConfigMap.set(t.key,t);let n=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const e=this.unknownState[t.key];void 0!==e&&(n=t.parse(e)),this.updateFromKnown(t,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState};for(const[e,n]of this.knownState)e.isEqual(n,e.defaultValue)?delete t[e.key]:t[e.key]=e.unparse(n);return tt(t)?{[W]:t}:{}}getWritable(t){if(this.node===t)return this;const e=new Map(this.knownState),n=tt(r=this.unknownState)&&{...r};var r;if(n)for(const i of e.keys())delete n[i.key];return new Q(t,this.sharedConfigMap,tt(n),e,this.size)}updateFromKnown(t,e){const n=t.key;this.sharedConfigMap.set(n,t);const{knownState:r,unknownState:i}=this;r.has(t)||i&&n in i||this.size++,r.set(t,e)}updateFromUnknown(t,e){const n=this.sharedConfigMap.get(t);n?this.updateFromKnown(n,n.parse(e)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=e)}updateFromJSON(t){const{knownState:e}=this;for(const n of e.keys())e.set(n,n.defaultValue);if(this.size=e.size,this.unknownState={},t)for(const[n,r]of Object.entries(t))this.updateFromUnknown(n,r);this.unknownState=tt(this.unknownState)}}function tt(t){if(t)for(const e in t)return t}function et(t,e){const n=t.__mode,r=t.__format,i=t.__style,o=t.__state,s=e.__state;return(null===n||n===e.__mode)&&(null===r||r===e.__format)&&(null===i||i===e.__style)&&(null===t.__state||o===s||function(t,e){if(t===e)return!0;if(t&&e&&t.size!==e.size)return!1;const n=new Set,r=(t,e)=>{for(const[r,i]of t.knownState){if(n.has(r.key))continue;n.add(r.key);const t=e?e.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1},i=(t,e)=>{const{unknownState:r}=t,i=e?e.unknownState:void 0;if(r)for(const[o,s]of Object.entries(r))if(!n.has(o)&&(n.add(o),s!==(i?i[o]:void 0)))return!0;return!1};return!(t&&r(t,e)||e&&r(e,t)||t&&i(t,e)||e&&i(e,t))}(o,s))}function nt(t,e){const n=t.mergeWithSibling(e),r=_r()._normalizedNodes;return r.add(t.__key),r.add(e.__key),n}function rt(t){let e,n,r=t;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(e=r.getPreviousSibling())&&wn(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(""!==e.__text){if(et(e,r)){r=nt(e,r);break}break}e.remove()}for(;null!==(n=r.getNextSibling())&&wn(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(et(r,n)){r=nt(r,n);break}break}n.remove()}}else r.remove()}function it(t){return ot(t.anchor),ot(t.focus),t}function ot(t){for(;"element"===t.type;){const e=t.getNode(),n=t.offset;let r,i;if(n===e.getChildrenSize()?(r=e.getChildAtIndex(n-1),i=!0):(r=e.getChildAtIndex(n),i=!1),wn(r)){t.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!Ar(r))break;t.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let st,lt,ct,at,ut,dt,ft,ht,gt,pt,_t="",mt="",yt=null,xt="",vt="",Ct=!1,St=!1,bt=null;function kt(t,e){const n=ft.get(t);if(null!==e){const n=zt(t);n.parentNode===e&&e.removeChild(n)}if(ht.has(t)||lt._keyToDOMMap.delete(t),Ar(n)){const t=It(n,ft);Tt(t,0,t.length-1,null)}void 0!==n&&qi(pt,ct,at,n,"destroyed")}function Tt(t,e,n,r){let i=e;for(;i<=n;++i){const e=t[i];void 0!==e&&kt(e,r)}}function wt(t,e){t.setProperty("text-align",e)}const Et="40px";function Nt(t,e){const n=st.theme.indent;if("string"==typeof n){const r=t.classList.contains(n);e>0&&!r?t.classList.add(n):e<1&&r&&t.classList.remove(n)}const r=getComputedStyle(t).getPropertyValue("--lexical-indent-base-value")||Et;t.style.setProperty("padding-inline-start",0===e?"":`calc(${e} * ${r})`)}function Mt(t,e){const n=t.style;0===e?wt(n,""):1===e?wt(n,"left"):2===e?wt(n,"center"):3===e?wt(n,"right"):4===e?wt(n,"justify"):5===e?wt(n,"start"):6===e&&wt(n,"end")}function Ot(t,e){const n=ht.get(t);void 0===n&&r(60);const i=n.createDOM(st,lt);if(function(t,e,n){const r=n._keyToDOMMap;(function(t,e,n){t[`__lexicalKey_${e._key}`]=n})(e,n,t),r.set(t,e)}(t,i,lt),wn(n)?i.setAttribute("data-lexical-text","true"):Fr(n)&&i.setAttribute("data-lexical-decorator","true"),Ar(n)){const t=n.__indent,e=n.__size;if(0!==t&&Nt(i,t),0!==e){const t=e-1;!function(t,e,n,r){const i=mt;mt="",At(t,n,0,e,n.getDOMSlot(r)),Ft(n,r),mt=i}(It(n,ht),t,n,i)}const r=n.__format;0!==r&&Mt(i,r),n.isInline()||Dt(null,n,i),Hi(n)&&(_t+=M,vt+=M)}else{const e=n.getTextContent();if(Fr(n)){const e=n.decorate(lt,st);null!==e&&Kt(t,e),i.contentEditable="false"}else wn(n)&&(n.isDirectionless()||(mt+=e));_t+=e,vt+=e}return null!==e&&e.insertChild(i),qi(pt,ct,at,n,"created"),i}function At(t,e,n,r,i){const o=_t;_t="";let s=n;for(;s<=r;++s){Ot(t[s],i);const e=ht.get(t[s]);null!==e&&wn(e)&&(null===yt&&(yt=e.getFormat()),""===xt&&(xt=e.getStyle()))}Hi(e)&&(_t+=M),i.element.__lexicalTextContent=_t,_t=o+_t}function Pt(t,e){if(t){const n=t.__last;if(n){const t=e.get(n);if(t)return cn(t)?"line-break":Fr(t)&&t.isInline()?"decorator":null}return"empty"}return null}function Dt(t,e,n){const r=Pt(t,ft),i=Pt(e,ht);r!==i&&e.getDOMSlot(n).setManagedLineBreak(i)}function Ft(t,e){const n=e.__lexicalDir||"";if((e.__lexicalDirTextContent||"")!==mt||n!==bt){const r=""===mt,i=r?bt:function(t){return D.test(t)?"rtl":F.test(t)?"ltr":null}(mt);if(i!==n){const o=e.classList,s=st.theme;let l=null!==n?s[n]:void 0,c=null!==i?s[i]:void 0;if(void 0!==l){if("string"==typeof l){const t=p(l);l=s[n]=t}o.remove(...l)}if(null===i||r&&"ltr"===i)e.removeAttribute("dir");else{if(void 0!==c){if("string"==typeof c){const t=p(c);c=s[i]=t}void 0!==c&&o.add(...c)}e.dir=i}St||(t.getWritable().__dir=i)}bt=i,e.__lexicalDirTextContent=mt,e.__lexicalDir=i}}function Lt(t,e,n){const i=mt;var o;mt="",yt=null,xt="",function(t,e,n){const i=_t,o=t.__size,s=e.__size;_t="";const l=n.element;if(1===o&&1===s){const n=t.__first,r=e.__first;if(n===r)Rt(n,l);else{const t=zt(n),e=Ot(r,null);try{l.replaceChild(e,t)}catch(i){if("object"==typeof i&&null!=i){const o=`${i.toString()} Parent: ${l.tagName}, new child: {tag: ${e.tagName} key: ${r}}, old child: {tag: ${t.tagName}, key: ${n}}.`;throw new Error(o)}throw i}kt(n,null)}const o=ht.get(r);wn(o)&&(null===yt&&(yt=o.getFormat()),""===xt&&(xt=o.getStyle()))}else{const i=It(t,ft),c=It(e,ht);if(i.length!==o&&r(227),c.length!==s&&r(228),0===o)0!==s&&At(c,e,0,s-1,n);else if(0===s){if(0!==o){const t=null==n.after&&null==n.before&&null==n.element.__lexicalLineBreak;Tt(i,0,o-1,t?null:l),t&&(l.textContent="")}}else!function(t,e,n,r,i,o){const s=r-1,l=i-1;let c,a,u=o.getFirstChild(),d=0,f=0;for(;d<=s&&f<=l;){const t=e[d],r=n[f];if(t===r)u=Bt(Rt(r,o.element)),d++,f++;else{void 0===c&&(c=new Set(e)),void 0===a&&(a=new Set(n));const i=a.has(t),s=c.has(r);if(i)if(s){const t=Yi(lt,r);t===u?u=Bt(Rt(r,o.element)):(o.withBefore(u).insertChild(t),Rt(r,o.element)),d++,f++}else Ot(r,o.withBefore(u)),f++;else u=Bt(zt(t)),kt(t,o.element),d++}const i=ht.get(r);null!==i&&wn(i)&&(null===yt&&(yt=i.getFormat()),""===xt&&(xt=i.getStyle()))}const h=d>s,g=f>l;if(h&&!g){const e=n[l+1],r=void 0===e?null:lt.getElementByKey(e);At(n,t,f,l,o.withBefore(r))}else g&&!h&&Tt(e,d,s,o.element)}(e,i,c,o,s,n)}Hi(e)&&(_t+=M),l.__lexicalTextContent=_t,_t=i+_t}(t,e,e.getDOMSlot(n)),Ft(e,n),o=e,null==yt||yt===o.__textFormat||St||o.setTextFormat(yt),function(t){""===xt||xt===t.__textStyle||St||t.setTextStyle(xt)}(e),mt=i}function It(t,e){const n=[];let i=t.__first;for(;null!==i;){const t=e.get(i);void 0===t&&r(101),n.push(i),i=t.__next}return n}function Rt(t,e){const n=ft.get(t);let i=ht.get(t);void 0!==n&&void 0!==i||r(61);const o=Ct||dt.has(t)||ut.has(t),s=Yi(lt,t);if(n===i&&!o){if(Ar(n)){const t=s.__lexicalTextContent;void 0!==t&&(_t+=t,vt+=t);const e=s.__lexicalDirTextContent;void 0!==e&&(mt+=e)}else{const t=n.getTextContent();wn(n)&&!n.isDirectionless()&&(mt+=t),vt+=t,_t+=t}return s}if(n!==i&&o&&qi(pt,ct,at,i,"updated"),i.updateDOM(n,s,st)){const n=Ot(t,null);return null===e&&r(62),e.replaceChild(n,s),kt(t,null),n}if(Ar(n)&&Ar(i)){const t=i.__indent;t!==n.__indent&&Nt(s,t);const e=i.__format;e!==n.__format&&Mt(s,e),o&&(Lt(n,i,s),Ir(i)||i.isInline()||Dt(n,i,s)),Hi(i)&&(_t+=M,vt+=M)}else{const e=i.getTextContent();if(Fr(i)){const e=i.decorate(lt,st);null!==e&&Kt(t,e)}else wn(i)&&!i.isDirectionless()&&(mt+=e);_t+=e,vt+=e}if(!St&&Ir(i)&&i.__cachedText!==vt){const t=i.getWritable();t.__cachedText=vt,i=t}return s}function Kt(t,e){let n=lt._pendingDecorators;if(null===n){if(lt._decorators[t]===e)return;n=ki(lt)}n[t]=e}function Bt(t){let e=t.nextSibling;return null!==e&&e===lt._blockCursorElement&&(e=e.nextSibling),e}function zt(t){const e=gt.get(t);return void 0===e&&r(75,t),e}function Wt(t){return{type:t}}const Jt=Wt("SELECTION_CHANGE_COMMAND"),jt=(Wt("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Wt("CLICK_COMMAND")),Vt=Wt("DELETE_CHARACTER_COMMAND"),qt=Wt("INSERT_LINE_BREAK_COMMAND"),Ut=Wt("INSERT_PARAGRAPH_COMMAND"),$t=Wt("CONTROLLED_TEXT_INSERTION_COMMAND"),Zt=Wt("PASTE_COMMAND"),Ht=Wt("REMOVE_TEXT_COMMAND"),Yt=Wt("DELETE_WORD_COMMAND"),Xt=Wt("DELETE_LINE_COMMAND"),Gt=Wt("FORMAT_TEXT_COMMAND"),Qt=Wt("UNDO_COMMAND"),te=Wt("REDO_COMMAND"),ee=Wt("KEYDOWN_COMMAND"),ne=Wt("KEY_ARROW_RIGHT_COMMAND"),re=Wt("MOVE_TO_END"),ie=Wt("KEY_ARROW_LEFT_COMMAND"),oe=Wt("MOVE_TO_START"),se=Wt("KEY_ARROW_UP_COMMAND"),le=Wt("KEY_ARROW_DOWN_COMMAND"),ce=Wt("KEY_ENTER_COMMAND"),ae=Wt("KEY_SPACE_COMMAND"),ue=Wt("KEY_BACKSPACE_COMMAND"),de=Wt("KEY_ESCAPE_COMMAND"),fe=Wt("KEY_DELETE_COMMAND"),he=Wt("KEY_TAB_COMMAND"),ge=(Wt("INSERT_TAB_COMMAND"),Wt("INDENT_CONTENT_COMMAND"),Wt("OUTDENT_CONTENT_COMMAND"),Wt("DROP_COMMAND")),pe=(Wt("FORMAT_ELEMENT_COMMAND"),Wt("DRAGSTART_COMMAND")),_e=Wt("DRAGOVER_COMMAND"),me=Wt("DRAGEND_COMMAND"),ye=Wt("COPY_COMMAND"),xe=Wt("CUT_COMMAND"),ve=Wt("SELECT_ALL_COMMAND"),Ce=Wt("CLEAR_EDITOR_COMMAND"),Se=Wt("CLEAR_HISTORY_COMMAND"),be=Wt("CAN_REDO_COMMAND"),ke=Wt("CAN_UNDO_COMMAND"),Te=Wt("FOCUS_COMMAND"),we=Wt("BLUR_COMMAND"),Ee=Wt("KEY_MODIFIER_COMMAND"),Ne=Object.freeze({}),Me=[["keydown",function(t,e){if(Oe=t.timeStamp,Ae=t.key,!e.isComposing()&&!Zi(e,ee,t)&&null!=t.key){if(Be&&Wi(t))return Er(e,()=>{He(e,ze)}),Be=!1,void(ze="");if(function(t){return Ki(t,"ArrowRight",{shiftKey:"any"})}(t))Zi(e,ne,t);else if(function(t){return Ki(t,"ArrowRight",Bi)}(t))Zi(e,re,t);else if(function(t){return Ki(t,"ArrowLeft",{shiftKey:"any"})}(t))Zi(e,ie,t);else if(function(t){return Ki(t,"ArrowLeft",Bi)}(t))Zi(e,oe,t);else if(function(t){return Ki(t,"ArrowUp",{altKey:"any",shiftKey:"any"})}(t))Zi(e,se,t);else if(function(t){return Ki(t,"ArrowDown",{altKey:"any",shiftKey:"any"})}(t))Zi(e,le,t);else if(function(t){return Ki(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(t))Re=!0,Zi(e,ce,t);else if(function(t){return" "===t.key}(t))Zi(e,ae,t);else if(function(t){return s&&Ki(t,"o",{ctrlKey:!0})}(t))t.preventDefault(),Re=!0,Zi(e,qt,!0);else if(function(t){return Ki(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(t))Re=!1,Zi(e,ce,t);else if(function(t){return Ki(t,"Backspace",{shiftKey:"any"})||s&&Ki(t,"h",{ctrlKey:!0})}(t))Wi(t)?Zi(e,ue,t):(t.preventDefault(),Zi(e,Vt,!0));else if(function(t){return"Escape"===t.key}(t))Zi(e,de,t);else if(function(t){return Ki(t,"Delete",{})||s&&Ki(t,"d",{ctrlKey:!0})}(t))!function(t){return"Delete"===t.key}(t)?(t.preventDefault(),Zi(e,Vt,!1)):Zi(e,fe,t);else if(function(t){return Ki(t,"Backspace",zi)}(t))t.preventDefault(),Zi(e,Yt,!0);else if(function(t){return Ki(t,"Delete",zi)}(t))t.preventDefault(),Zi(e,Yt,!1);else if(function(t){return s&&Ki(t,"Backspace",{metaKey:!0})}(t))t.preventDefault(),Zi(e,Xt,!0);else if(function(t){return s&&(Ki(t,"Delete",{metaKey:!0})||Ki(t,"k",{ctrlKey:!0}))}(t))t.preventDefault(),Zi(e,Xt,!1);else if(function(t){return Ki(t,"b",Bi)}(t))t.preventDefault(),Zi(e,Gt,"bold");else if(function(t){return Ki(t,"u",Bi)}(t))t.preventDefault(),Zi(e,Gt,"underline");else if(function(t){return Ki(t,"i",Bi)}(t))t.preventDefault(),Zi(e,Gt,"italic");else if(function(t){return Ki(t,"Tab",{shiftKey:"any"})}(t))Zi(e,he,t);else if(function(t){return Ki(t,"z",Bi)}(t))t.preventDefault(),Zi(e,Qt,void 0);else if(function(t){return s?Ki(t,"z",{metaKey:!0,shiftKey:!0}):Ki(t,"y",{ctrlKey:!0})||Ki(t,"z",{ctrlKey:!0,shiftKey:!0})}(t))t.preventDefault(),Zi(e,te,void 0);else{const n=e._editorState._selection;null===n||Ln(n)?!l&&Ji(t)&&(t.preventDefault(),Zi(e,ve,t)):function(t){return Ki(t,"c",Bi)}(t)?(t.preventDefault(),Zi(e,ye,t)):function(t){return Ki(t,"x",Bi)}(t)?(t.preventDefault(),Zi(e,xe,t)):Ji(t)&&(t.preventDefault(),Zi(e,ve,t))}(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(t)&&Zi(e,Ee,t)}}],["pointerdown",function(t,e){const n=t.target,r=t.pointerType;ao(n)&&"touch"!==r&&0===t.button&&Er(e,()=>{si(n)||(Ie=!0)})}],["compositionstart",function(t,e){Er(e,()=>{const n=Yn();if(Ln(n)&&!e.isComposing()){const r=n.anchor,i=n.anchor.getNode();yi(r.key),(t.timeStamp<Oe+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||wn(i)&&i.getStyle()!==n.style)&&Zi(e,$t,O)}})}],["compositionend",function(t,e){l?Ke=!0:u||!a&&!g?Er(e,()=>{He(e,t.data)}):(Be=!0,ze=t.data)}],["input",function(t,e){t.stopPropagation(),Er(e,()=>{if(co(t.target)&&si(t.target))return;const n=Yn(),r=t.data,i=Ze(t);if(null!=r&&Ln(n)&&je(n,i,r,t.timeStamp,!1)){Ke&&(He(e,r),Ke=!1);const i=n.anchor.getNode(),o=lo(eo(e));if(null===o)return;const s=n.isBackward(),d=s?n.anchor.offset:n.focus.offset,f=s?n.focus.offset:n.anchor.offset;c&&!n.isCollapsed()&&wn(i)&&null!==o.anchorNode&&i.getTextContent().slice(0,d)+r+i.getTextContent().slice(d+f)===Fi(o.anchorNode)||Zi(e,$t,r);const h=r.length;l&&h>1&&"insertCompositionText"===t.inputType&&!e.isComposing()&&(n.anchor.offset-=h),a||u||g||!e.isComposing()||(Oe=0,yi(null))}else Li(!1,e,null!==r?r:void 0),Ke&&(He(e,r||void 0),Ke=!1);hr(),X(_r())},{event:t}),De=null}],["click",function(t,e){Er(e,()=>{const n=Yn(),r=lo(eo(e)),i=Xn();if(r)if(Ln(n)){const e=n.anchor,o=e.getNode();if("element"===e.type&&0===e.offset&&n.isCollapsed()&&!Ir(o)&&1===wi().getChildrenSize()&&o.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(3===t.detail&&!n.isCollapsed()&&o!==n.focus.getNode()){const t=function(t,e){let n=t;for(;n!==wi()&&null!=n;){if(e(n))return n;n=n.getParent()}return null}(o,t=>Ar(t)&&!t.isInline());Ar(t)&&t.select(0)}}else if("touch"===t.pointerType){const n=r.anchorNode;(co(n)||hi(n))&&Ni(Hn(i,r,e,t))}Zi(e,jt,t)})}],["cut",Ne],["copy",Ne],["dragstart",Ne],["dragover",Ne],["dragend",Ne],["paste",Ne],["focus",Ne],["blur",Ne],["drop",Ne]];c&&Me.push(["beforeinput",(t,e)=>function(t,e){const n=t.inputType,i=Ze(t);"deleteCompositionText"===n||l&&$i(e)||"insertCompositionText"!==n&&Er(e,()=>{const o=Yn();if("deleteContentBackward"===n){if(null===o){const t=Xn();if(!Ln(t))return;Ni(t.clone())}if(Ln(o)){const n=o.anchor.key===o.focus.key;if("MediaLast"===Ae&&t.timeStamp<Oe+30&&e.isComposing()&&n){if(yi(null),Oe=0,setTimeout(()=>{Er(e,()=>{yi(null)})},30),Ln(o)){const t=o.anchor.getNode();t.markDirty(),wn(t)||r(142),$e(o,t)}}else{yi(null),t.preventDefault();const r=o.anchor.getNode(),i=r.getTextContent(),s=r.canInsertTextAfter();let l=h&&n&&!(0===o.anchor.offset&&o.focus.offset===i.length)&&s;if(l&&o.isCollapsed()&&(l=!Fr(function(t,e){const n=t.offset;if("element"===t.type)return Ui(t.getNode(),e,n);{const r=t.getNode();if(0===n){const t=r.getPreviousSibling();return null===t?Ui(r.getParentOrThrow(),e,r.getIndexWithinParent()+0):t}}return null}(o.anchor,!0))),!l){Zi(e,Vt,!0);const t=Yn();h&&Ln(t)&&t.isCollapsed()&&(We=t,setTimeout(()=>We=null))}}return}}if(!Ln(o))return;const s=t.data;null!==De&&Li(!1,e,De),o.dirty&&null===De||!o.isCollapsed()||Ir(o.anchor.getNode())||null===i||o.applyDOMRange(i),De=null;const l=o.focus,c=o.anchor.getNode(),a=l.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(t.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Zi(e,$t,t);break;case"insertFromComposition":yi(null),Zi(e,$t,t);break;case"insertLineBreak":yi(null),Zi(e,qt,!1);break;case"insertParagraph":yi(null),Re&&!u?(Re=!1,Zi(e,qt,!1)):Zi(e,Ut,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Zi(e,Zt,t);break;case"deleteByComposition":(function(t,e){return t!==e||Ar(t)||Ar(e)||!t.isToken()||!e.isToken()})(c,a)&&Zi(e,Ht,t);break;case"deleteByDrag":case"deleteByCut":Zi(e,Ht,t);break;case"deleteContent":Zi(e,Vt,!1);break;case"deleteWordBackward":Zi(e,Yt,!0);break;case"deleteWordForward":Zi(e,Yt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Zi(e,Xt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Zi(e,Xt,!1);break;case"formatStrikeThrough":Zi(e,Gt,"strikethrough");break;case"formatBold":Zi(e,Gt,"bold");break;case"formatItalic":Zi(e,Gt,"italic");break;case"formatUnderline":Zi(e,Gt,"underline");break;case"historyUndo":Zi(e,Qt,void 0);break;case"historyRedo":Zi(e,te,void 0)}else{if("\n"===s)t.preventDefault(),Zi(e,qt,!1);else if(s===M)t.preventDefault(),Zi(e,Ut,void 0);else if(null==s&&t.dataTransfer){const e=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(e)}else null!=s&&je(o,i,s,t.timeStamp,!0)?(t.preventDefault(),Zi(e,$t,s)):De=s;Pe=t.timeStamp}})}(t,e)]);let Oe=0,Ae=null,Pe=0,De=null;const Fe=new WeakMap;let Le=!1,Ie=!1,Re=!1,Ke=!1,Be=!1,ze="",We=null,Je=[0,"",0,"root",0];function je(t,e,n,r,i){const o=t.anchor,s=t.focus,l=o.getNode(),a=_r(),u=lo(eo(a)),d=null!==u?u.anchorNode:null,f=o.key,h=a.getElementByKey(f),g=n.length;return f!==s.key||!wn(l)||(!i&&(!c||Pe<r+50)||l.isDirty()&&g<2||Ai(n))&&o.offset!==s.offset&&!l.isComposing()||fi(l)||l.isDirty()&&g>1||(i||!c)&&null!==h&&!l.isComposing()&&d!==gi(h)||null!==u&&null!==e&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||l.getFormat()!==t.format||l.getStyle()!==t.style||function(t,e){if(e.isSegmented())return!0;if(!t.isCollapsed())return!1;const n=t.anchor.offset,r=e.getParentOrThrow(),i=e.isToken();return 0===n?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(t){const e=t.getPreviousSibling();return(wn(e)||Ar(e)&&e.isInline())&&!e.canInsertTextAfter()}(e):n===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}(t,l)}function Ve(t,e){return hi(t)&&null!==t.nodeValue&&0!==e&&e!==t.nodeValue.length}function qe(t,e,n){const{anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:l}=t;Le&&(Le=!1,Ve(i,o)&&Ve(s,l)&&!We)||Er(e,()=>{if(!n)return void Ni(null);if(!ci(e,i,s))return;let c=Yn();if(We&&Ln(c)&&c.isCollapsed()){const t=c.anchor,e=We.anchor;(t.key===e.key&&t.offset===e.offset+1||1===t.offset&&e.getNode().is(t.getNode().getPreviousSibling()))&&(c=We.clone(),Ni(c))}if(We=null,Ln(c)){const n=c.anchor,i=n.getNode();if(c.isCollapsed()){"Range"===t.type&&t.anchorNode===t.focusNode&&(c.dirty=!0);const o=eo(e).event,s=o?o.timeStamp:performance.now(),[l,a,u,d,f]=Je,h=wi(),g=!1===e.isComposing()&&""===h.getTextContent();if(s<f+200&&n.offset===u&&n.key===d)Ue(c,l,a);else if("text"===n.type)wn(i)||r(141),$e(c,i);else if("element"===n.type&&!g){Ar(i)||r(259);const t=n.getNode();t.isEmpty()?function(t,e){Ue(t,e.getTextFormat(),e.getTextStyle())}(c,t):Ue(c,0,"")}}else{const t=n.key,e=c.focus.key,r=c.getNodes(),i=r.length,s=c.isBackward(),a=s?l:o,u=s?o:l,d=s?e:t,f=s?t:e;let h=2047,g=!1;for(let n=0;n<i;n++){const t=r[n],e=t.getTextContentSize();if(wn(t)&&0!==e&&!(0===n&&t.__key===d&&a===e||n===i-1&&t.__key===f&&0===u)&&(g=!0,h&=t.getFormat(),0===h))break}c.format=g?h:0}}Zi(e,Jt,void 0)})}function Ue(t,e,n){t.format===e&&t.style===n||(t.format=e,t.style=n,t.dirty=!0)}function $e(t,e){Ue(t,e.getFormat(),e.getStyle())}function Ze(t){if(!t.getTargetRanges)return null;const e=t.getTargetRanges();return 0===e.length?null:e[0]}function He(t,e){const n=t._compositionKey;if(yi(null),null!==n&&null!=e){if(""===e){const e=vi(n),r=gi(t.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&wn(e)&&Ii(e,r.nodeValue,null,null,!0))}if("\n"===e[e.length-1]){const e=Yn();if(Ln(e)){const n=e.focus;return e.anchor.set(n.key,n.offset,n.type),void Zi(t,ce,null)}}}Li(!0,t,e)}function Ye(t){let e=t.__lexicalEventHandles;return void 0===e&&(e=[],t.__lexicalEventHandles=e),e}const Xe=new Map;function Ge(t){const e=function(t){const e=to(t);return e?e.getSelection():null}(t.target);if(null===e)return;const n=ui(e.anchorNode);if(null===n)return;Ie&&(Ie=!1,Er(n,()=>{const r=Xn(),i=e.anchorNode;(co(i)||hi(i))&&Ni(Hn(r,e,n,t))}));const r=Pi(n),i=r[r.length-1],o=i._key,s=Xe.get(o),l=s||i;l!==n&&qe(e,l,!1),qe(e,n,!0),n!==i?Xe.set(o,n):s&&Xe.delete(o)}function Qe(t){t._lexicalHandled=!0}function tn(t){return!0===t._lexicalHandled}function en(t){const e=t.ownerDocument,n=Fe.get(e);if(void 0===n)return;const i=n-1;i>=0||r(164),Fe.set(e,i),0===i&&e.removeEventListener("selectionchange",Ge);const o=di(t);ai(o)?(function(t){if(null!==t._parentEditor){const e=Pi(t),n=e[e.length-1]._key;Xe.get(n)===t&&Xe.delete(n)}else Xe.delete(t._key)}(o),t.__lexicalEditor=null):o&&r(198);const s=Ye(t);for(let r=0;r<s.length;r++)s[r]();t.__lexicalEventHandles=[]}function nn(t,e,n){hr();const r=t.__key,i=t.getParent();if(null===i)return;const o=function(t){const e=Yn();if(!Ln(e)||!Ar(t))return e;const{anchor:n,focus:r}=e,i=n.getNode(),o=r.getNode();return Qi(i,t)&&n.set(t.__key,0,"element"),Qi(o,t)&&r.set(t.__key,0,"element"),e}(t);let s=!1;if(Ln(o)&&e){const e=o.anchor,n=o.focus;e.key===r&&(tr(e,t,i,t.getPreviousSibling(),t.getNextSibling()),s=!0),n.key===r&&(tr(n,t,i,t.getPreviousSibling(),t.getNextSibling()),s=!0)}else Rn(o)&&e&&t.isSelected()&&t.selectPrevious();if(Ln(o)&&e&&!s){const e=t.getIndexWithinParent();_i(t),Gn(o,i,e,-1)}else _i(t);n||no(i)||i.canBeEmpty()||!i.isEmpty()||nn(i,e),e&&o&&Ir(i)&&i.isEmpty()&&i.selectEnd()}class rn{static getType(){r(64,this.name)}static clone(t){r(65,this.name)}afterCloneFrom(t){this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state}constructor(t){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}),function(t,e){if(null!=e)return void(t.__key=e);hr(),gr();const n=_r(),r=pr(),i=""+ii++;r._nodeMap.set(i,t),Ar(t)?n._dirtyElements.set(i,!0):n._dirtyLeaves.add(i),n._cloneNotNeeded.add(i),n._dirtyType=1,t.__key=i}(this,t)}getType(){return this.__type}isInline(){r(137,this.constructor.name)}isAttached(){let t=this.__key;for(;null!==t;){if("root"===t)return!0;const e=vi(t);if(null===e)break;t=e.__parent}return!1}isSelected(t){const e=t||Yn();if(null==e)return!1;const n=e.getNodes().some(t=>t.__key===this.__key);if(wn(this))return n;if(Ln(e)&&"element"===e.anchor.type&&"element"===e.focus.type){if(e.isCollapsed())return!1;const t=this.getParent();if(Fr(this)&&this.isInline()&&t){const n=e.isBackward()?e.focus:e.anchor;if(t.is(n.getNode())&&n.offset===t.getChildrenSize()&&this.is(t.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(null===t)return-1;let e=t.getFirstChild(),n=0;for(;null!==e;){if(this.is(e))return n;n++,e=e.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return null===t?null:vi(t)}getParentOrThrow(){const t=this.getParent();return null===t&&r(66,this.__key),t}getTopLevelElement(){let t=this;for(;null!==t;){const e=t.getParent();if(no(e))return Ar(t)||t===this&&Fr(t)||r(194),t;t=e}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return null===t&&r(67,this.__key),t}getParents(){const t=[];let e=this.getParent();for(;null!==e;)t.push(e),e=e.getParent();return t}getParentKeys(){const t=[];let e=this.getParent();for(;null!==e;)t.push(e.__key),e=e.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return null===t?null:vi(t)}getPreviousSiblings(){const t=[],e=this.getParent();if(null===e)return t;let n=e.getFirstChild();for(;null!==n&&!n.is(this);)t.push(n),n=n.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return null===t?null:vi(t)}getNextSiblings(){const t=[];let e=this.getNextSibling();for(;null!==e;)t.push(e),e=e.getNextSibling();return t}getCommonAncestor(t){const e=Ar(this)?this:this.getParent(),n=Ar(t)?t:t.getParent(),r=e&&n?Xo(e,n):null;return r?r.commonAncestor:null}is(t){return null!=t&&this.__key===t.__key}isBefore(t){const e=Xo(this,t);return null!==e&&("descendant"===e.type||("branch"===e.type?-1===Zo(e):("same"!==e.type&&"ancestor"!==e.type&&r(279),!1)))}isParentOf(t){const e=Xo(this,t);return null!==e&&"ancestor"===e.type}getNodesBetween(t){const e=this.isBefore(t),n=[],i=new Set;let o=this;for(;null!==o;){const s=o.__key;if(i.has(s)||(i.add(s),n.push(o)),o===t)break;const l=Ar(o)?e?o.getFirstChild():o.getLastChild():null;if(null!==l){o=l;continue}const c=e?o.getNextSibling():o.getPreviousSibling();if(null!==c){o=c;continue}const a=o.getParentOrThrow();if(i.has(a.__key)||n.push(a),a===t)break;let u=null,d=a;do{if(null===d&&r(68),u=e?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),null===d)break;null!==u||i.has(d.__key)||n.push(d)}while(null===u);o=u}return e||n.reverse(),n}isDirty(){const t=_r()._dirtyLeaves;return null!==t&&t.has(this.__key)}getLatest(){const t=vi(this.__key);return null===t&&r(113),t}getWritable(){hr();const t=pr(),e=_r(),n=t._nodeMap,r=this.__key,i=this.getLatest(),o=e._cloneNotNeeded,s=Yn();if(null!==s&&s.setCachedNodes(null),o.has(r))return mi(i),i;const l=vo(i);return o.add(r),mi(l),n.set(r,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,e){r(70)}updateDOM(t,e,n){r(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){r(18,this.name)}updateFromJSON(t){return function(t,e){const n=t.getWritable();return(e||n.__state)&&function(t){const e=t.getWritable(),n=e.__state?e.__state.getWritable(e):new Q(e);return e.__state=n,n}(t).updateFromJSON(e),n}(this,t.$)}static transform(){return null}remove(t){nn(this,!0,t)}replace(t,e){hr();let n=Yn();null!==n&&(n=n.clone()),io(this,t);const i=this.getLatest(),o=this.__key,s=t.__key,l=t.getWritable(),c=this.getParentOrThrow().getWritable(),a=c.__size;_i(l);const u=i.getPreviousSibling(),d=i.getNextSibling(),f=i.__prev,h=i.__next,g=i.__parent;if(nn(i,!1,!0),null===u?c.__first=s:u.getWritable().__next=s,l.__prev=f,null===d?c.__last=s:d.getWritable().__prev=s,l.__next=h,l.__parent=g,c.__size=a,e&&(Ar(this)&&Ar(l)||r(139),this.getChildren().forEach(t=>{l.append(t)})),Ln(n)){Ni(n);const t=n.anchor,e=n.focus;t.key===o&&Dn(t,l),e.key===o&&Dn(e,l)}return xi()===o&&yi(s),l}insertAfter(t,e=!0){hr(),io(this,t);const n=this.getWritable(),r=t.getWritable(),i=r.getParent(),o=Yn();let s=!1,l=!1;if(null!==i){const e=t.getIndexWithinParent();if(_i(r),Ln(o)){const t=i.__key,n=o.anchor,r=o.focus;s="element"===n.type&&n.key===t&&n.offset===e+1,l="element"===r.type&&r.key===t&&r.offset===e+1}}const c=this.getNextSibling(),a=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===c?a.__last=u:c.getWritable().__prev=u,a.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,e&&Ln(o)){const t=this.getIndexWithinParent();Gn(o,a,t+1);const e=a.__key;s&&o.anchor.set(e,t+2,"element"),l&&o.focus.set(e,t+2,"element")}return t}insertBefore(t,e=!0){hr(),io(this,t);const n=this.getWritable(),r=t.getWritable(),i=r.__key;_i(r);const o=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),l=n.__prev,c=this.getIndexWithinParent();null===o?s.__first=i:o.getWritable().__next=i,s.__size++,n.__prev=i,r.__prev=l,r.__next=n.__key,r.__parent=n.__parent;const a=Yn();return e&&Ln(a)&&Gn(a,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return Xr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,e){hr();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Ar(n))return n.select();if(!wn(n)){const t=n.getIndexWithinParent()+1;return r.select(t,t)}return n.select(t,e)}selectNext(t,e){hr();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Ar(n))return n.select(0,0);if(!wn(n)){const t=n.getIndexWithinParent();return r.select(t,t)}return n.select(t,e)}markDirty(){this.getWritable()}reconcileObservedMutation(t,e){this.markDirty()}}class on extends rn{static getType(){return"linebreak"}static clone(t){return new on(t.__key)}constructor(t){super(t)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>function(t){const e=t.parentElement;if(null!==e&&ho(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&an(n)){const n=e.lastChild;if(n===t||n.previousSibling===t&&an(n))return!0}}return!1}(t)||function(t){const e=t.parentElement;if(null!==e&&ho(e)){const n=e.firstChild;if(n===t||n.nextSibling===t&&an(n))return!1;const r=e.lastChild;if(r===t||r.previousSibling===t&&an(r))return!0}return!1}(t)?null:{conversion:sn,priority:0}}}static importJSON(t){return ln().updateFromJSON(t)}}function sn(t){return{node:ln()}}function ln(){return ro(new on)}function cn(t){return t instanceof on}function an(t){return hi(t)&&/^( |\t|\r?\n)+$/.test(t.textContent||"")}function un(t,e){return 16&e?"code":128&e?"mark":32&e?"sub":64&e?"sup":null}function dn(t,e){return 1&e?"strong":2&e?"em":"span"}function fn(t,e,n,r,i){const o=r.classList;let s=Vi(i,"base");void 0!==s&&o.add(...s),s=Vi(i,"underlineStrikethrough");let l=!1;const c=8&e&&4&e;void 0!==s&&(8&n&&4&n?(l=!0,c||o.add(...s)):c&&o.remove(...s));for(const a in L){const t=L[a];if(s=Vi(i,a),void 0!==s)if(n&t){if(l&&("underline"===a||"strikethrough"===a)){e&t&&o.remove(...s);continue}e&t&&(!c||"underline"!==a)&&"strikethrough"!==a||o.add(...s)}else e&t&&o.remove(...s)}}function hn(t,e,n){const r=e.firstChild,i=n.isComposing(),o=t+(i?N:"");if(null==r)e.textContent=o;else{const t=r.nodeValue;if(t!==o)if(i||l){const[e,n,i]=function(t,e){const n=t.length,r=e.length;let i=0,o=0;for(;i<n&&i<r&&t[i]===e[i];)i++;for(;o+i<n&&o+i<r&&t[n-o-1]===e[r-o-1];)o++;return[i,n-i-o,e.slice(i,r-o)]}(t,o);0!==n&&r.deleteData(e,n),r.insertData(e,i)}else r.nodeValue=o}}function gn(t,e,n,r,i,o){hn(i,t,e);const s=o.theme.text;void 0!==s&&fn(0,0,r,t,s)}function pn(t,e){const n=document.createElement(e);return n.appendChild(t),n}class _n extends rn{static getType(){return"text"}static clone(t){return new _n(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",e){super(e),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return z[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===xi()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const e=L[t];return!!(this.getFormat()&e)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(t,e){return pi(this.getLatest().__format,t,e)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,e){const n=this.__format,r=un(0,n),i=dn(0,n),o=document.createElement(null===r?i:r);let s=o;this.hasFormat("code")&&o.setAttribute("spellcheck","false"),null!==r&&(s=document.createElement(i),o.appendChild(s)),gn(s,this,0,n,this.__text,t);const l=this.__style;return""!==l&&(o.style.cssText=l),o}updateDOM(t,e,n){const i=this.__text,o=t.__format,s=this.__format,l=un(0,o),c=un(0,s),a=dn(0,o),u=dn(0,s);if((null===l?a:l)!==(null===c?u:c))return!0;if(l===c&&a!==u){const t=e.firstChild;null==t&&r(48);const o=document.createElement(u);return gn(o,this,0,s,i,n),e.replaceChild(o,t),!1}let d=e;null!==c&&null!==l&&(d=e.firstChild,null==d&&r(49)),hn(i,d,this);const f=n.theme.text;void 0!==f&&o!==s&&fn(0,o,s,d,f);const h=this.__style;return t.__style!==h&&(e.style.cssText=h),!1}static importDOM(){return{"#text":()=>({conversion:Cn,priority:0}),b:()=>({conversion:yn,priority:0}),code:()=>({conversion:kn,priority:0}),em:()=>({conversion:kn,priority:0}),i:()=>({conversion:kn,priority:0}),mark:()=>({conversion:kn,priority:0}),s:()=>({conversion:kn,priority:0}),span:()=>({conversion:mn,priority:0}),strong:()=>({conversion:kn,priority:0}),sub:()=>({conversion:kn,priority:0}),sup:()=>({conversion:kn,priority:0}),u:()=>({conversion:kn,priority:0})}}static importJSON(t){return Tn().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:e}=super.exportDOM(t);return co(e)||r(132),e.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?e.style.textTransform="lowercase":this.hasFormat("uppercase")?e.style.textTransform="uppercase":this.hasFormat("capitalize")&&(e.style.textTransform="capitalize"),this.hasFormat("bold")&&(e=pn(e,"b")),this.hasFormat("italic")&&(e=pn(e,"i")),this.hasFormat("strikethrough")&&(e=pn(e,"s")),this.hasFormat("underline")&&(e=pn(e,"u")),{element:e}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,e){}setFormat(t){const e=this.getWritable();return e.__format="string"==typeof t?L[t]:t,e}setDetail(t){const e=this.getWritable();return e.__detail="string"==typeof t?I[t]:t,e}setStyle(t){const e=this.getWritable();return e.__style=t,e}toggleFormat(t){const e=pi(this.getFormat(),t,null);return this.setFormat(e)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const e=B[t];if(this.__mode===e)return this;const n=this.getWritable();return n.__mode=e,n}setTextContent(t){if(this.__text===t)return this;const e=this.getWritable();return e.__text=t,e}select(t,e){hr();let n=t,r=e;const i=Yn(),o=this.getTextContent(),s=this.__key;if("string"==typeof o){const t=o.length;void 0===n&&(n=t),void 0===r&&(r=t)}else n=0,r=0;if(!Ln(i))return $n(s,n,s,r,"text","text");{const t=xi();t!==i.anchor.key&&t!==i.focus.key||yi(s),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,e,n,r){const i=this.getWritable(),o=i.__text,s=n.length;let l=t;l<0&&(l=s+l,l<0&&(l=0));const c=Yn();if(r&&Ln(c)){const e=t+s;c.setTextNodeRange(i,e,i,e)}const a=o.slice(0,l)+n+o.slice(l+e);return i.__text=a,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){hr();const e=this.getLatest(),n=e.getTextContent();if(""===n)return[];const r=e.__key,i=xi(),o=n.length;t.sort((t,e)=>t-e),t.push(o);const s=[],l=t.length;for(let b=0,k=0;b<o&&k<=l;k++){const e=t[k];e>b&&(s.push(n.slice(b,e)),b=e)}const c=s.length;if(1===c)return[e];const a=s[0],u=e.getParent();let d;const f=e.getFormat(),h=e.getStyle(),g=e.__detail;let p=!1,_=null,m=null;const y=Yn();if(Ln(y)){const[t,e]=y.isBackward()?[y.focus,y.anchor]:[y.anchor,y.focus];"text"===t.type&&t.key===r&&(_=t),"text"===e.type&&e.key===r&&(m=e)}e.isSegmented()?(d=Tn(a),d.__format=f,d.__style=h,d.__detail=g,p=!0):(d=e.getWritable(),d.__text=a);const x=[d];for(let b=1;b<c;b++){const t=Tn(s[b]);t.__format=f,t.__style=h,t.__detail=g,i===r&&yi(t.__key),x.push(t)}const v=_?_.offset:null,C=m?m.offset:null;let S=0;for(const b of x){if(!_&&!m)break;const t=S+b.getTextContentSize();if(null!==_&&null!==v&&v<=t&&v>=S&&(_.set(b.getKey(),v-S,"text"),v<t&&(_=null)),null!==m&&null!==C&&C<=t&&C>=S){m.set(b.getKey(),C-S,"text");break}S=t}if(null!==u){!function(t){const e=t.getPreviousSibling(),n=t.getNextSibling();null!==e&&mi(e),null!==n&&mi(n)}(this);const t=u.getWritable(),e=this.getIndexWithinParent();p?(t.splice(e,0,x),this.remove()):t.splice(e,1,x),Ln(y)&&Gn(y,u,e,c-1)}return x}mergeWithSibling(t){const e=t===this.getPreviousSibling();e||t===this.getNextSibling()||r(50);const n=this.__key,i=t.__key,o=this.__text,s=o.length;xi()===i&&yi(n);const l=Yn();if(Ln(l)){const r=l.anchor,o=l.focus;null!==r&&r.key===i&&er(r,e,n,t,s),null!==o&&o.key===i&&er(o,e,n,t,s)}const c=t.__text;this.setTextContent(e?c+o:o+c);const a=this.getWritable();return t.remove(),a}isTextEntity(){return!1}}function mn(t){return{forChild:En(t.style),node:null}}function yn(t){return{forChild:En(t.style,"normal"===t.style.fontWeight?void 0:"bold"),node:null}}const xn=new WeakMap;function vn(t){if(!co(t))return!1;if("PRE"===t.nodeName)return!0;const e=t.style.whiteSpace;return"string"==typeof e&&e.startsWith("pre")}function Cn(t){const e=t;null===t.parentElement&&r(129);let n=e.textContent||"";if(null!==function(t){let e,n=t.parentNode;const r=[t];for(;null!==n&&void 0===(e=xn.get(n))&&!vn(n);)r.push(n),n=n.parentNode;const i=void 0===e?n:e;for(let o=0;o<r.length;o++)xn.set(r[o],i);return i}(e)){const t=n.split(/(\r?\n|\t)/),e=[],r=t.length;for(let n=0;n<r;n++){const r=t[n];"\n"===r||"\r\n"===r?e.push(ln()):"\t"===r?e.push(Mn()):""!==r&&e.push(Tn(r))}return{node:e}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let t=e,r=!0;for(;null!==t&&null!==(t=Sn(t,!1));){const e=t.textContent||"";if(e.length>0){/[ \t\n]$/.test(e)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let t=e,r=!0;for(;null!==t&&null!==(t=Sn(t,!0));)if((t.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Tn(n)}}function Sn(t,e){let n=t;for(;;){let t;for(;null===(t=e?n.nextSibling:n.previousSibling);){const t=n.parentElement;if(null===t)return null;n=t}if(n=t,co(n)){const t=n.style.display;if(""===t&&!fo(n)||""!==t&&!t.startsWith("inline"))return null}let r=n;for(;null!==(r=e?n.firstChild:n.lastChild);)n=r;if(hi(n))return n;if("BR"===n.nodeName)return null}}const bn={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function kn(t){const e=bn[t.nodeName.toLowerCase()];return void 0===e?{node:null}:{forChild:En(t.style,e),node:null}}function Tn(t=""){return ro(new _n(t))}function wn(t){return t instanceof _n}function En(t,e){const n=t.fontWeight,r=t.textDecoration.split(" "),i="700"===n||"bold"===n,o=r.includes("line-through"),s="italic"===t.fontStyle,l=r.includes("underline"),c=t.verticalAlign;return t=>wn(t)?(i&&!t.hasFormat("bold")&&t.toggleFormat("bold"),o&&!t.hasFormat("strikethrough")&&t.toggleFormat("strikethrough"),s&&!t.hasFormat("italic")&&t.toggleFormat("italic"),l&&!t.hasFormat("underline")&&t.toggleFormat("underline"),"sub"!==c||t.hasFormat("subscript")||t.toggleFormat("subscript"),"super"!==c||t.hasFormat("superscript")||t.toggleFormat("superscript"),e&&!t.hasFormat(e)&&t.toggleFormat(e),t):t}class Nn extends _n{static getType(){return"tab"}static clone(t){return new Nn(t.__key)}constructor(t){super("\t",t),this.__detail=2}static importDOM(){return null}createDOM(t){const e=super.createDOM(t),n=Vi(t.theme,"tab");return void 0!==n&&e.classList.add(...n),e}static importJSON(t){return Mn().updateFromJSON(t)}setTextContent(t){return"\t"!==t&&""!==t&&r(126),super.setTextContent(t)}setDetail(t){return 2!==t&&r(127),this}setMode(t){return"normal"!==t&&r(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Mn(){return ro(new Nn)}class On{constructor(t,e,n){this._selection=null,this.key=t,this.offset=e,this.type=n}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:$o(ss(Go(this,"next")),ss(Go(t,"next")))<0}getNode(){const t=vi(this.key);return null===t&&r(20),t}set(t,e,n,r){const i=this._selection,o=this.key;r&&this.key===t&&this.offset===e&&this.type===n||(this.key=t,this.offset=e,this.type=n,fr()||(xi()===o&&yi(t),null!==i&&(i.setCachedNodes(null),i.dirty=!0)))}}function An(t,e,n){return new On(t,e,n)}function Pn(t,e){let n=e.__key,r=t.offset,i="element";if(wn(e)){i="text";const t=e.getTextContentSize();r>t&&(r=t)}else if(!Ar(e)){const t=e.getNextSibling();if(wn(t))n=t.__key,r=0,i="text";else{const t=e.getParent();t&&(n=t.__key,r=e.getIndexWithinParent()+1)}}t.set(n,r,i)}function Dn(t,e){if(Ar(e)){const n=e.getLastDescendant();Ar(n)||wn(n)?Pn(t,n):Pn(t,e)}else Pn(t,e)}class Fn{constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!Rn(t))return!1;const e=this._nodes,n=t._nodes;return e.size===n.size&&Array.from(e).every(t=>n.has(t))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new Fn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const e=this.getNodes(),n=e.length,r=e[n-1];let i;if(wn(r))i=r.select();else{const t=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(t,t)}i.insertNodes(t);for(let o=0;o<n;o++)e[o].remove()}getNodes(){const t=this._cachedNodes;if(null!==t)return t;const e=this._nodes,n=[];for(const r of e){const t=vi(r);null!==t&&n.push(t)}return fr()||(this._cachedNodes=n),n}getTextContent(){const t=this.getNodes();let e="";for(let n=0;n<t.length;n++)e+=t[n].getTextContent();return e}deleteNodes(){const t=this.getNodes();if((Yn()||Xn())===this&&t[0]){const e=Io(t[0],"next");!function(t){const e=Yn(),n=Ln(e)?e:function(){const t=An("root",0,"element"),e=An("root",0,"element");return new In(t,e,0,"")}();ts(n,t),Ni(n)}(qo(e,e))}for(const e of t)e.remove()}}function Ln(t){return t instanceof In}class In{constructor(t,e,n,r){this.anchor=t,this.focus=e,t._selection=this,e._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!Ln(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(null!==t)return t;const e=function(t){const e=[],[n,r]=t.getTextSlices();n&&e.push(n.caret.origin);const i=new Set,o=new Set;for(const s of t)if(Po(s)){const{origin:t}=s;0===e.length?i.add(t):(o.add(t),e.push(t))}else{const{origin:t}=s;Ar(t)&&o.has(t)||e.push(t)}if(r&&e.push(r.caret.origin),Ao(t.focus)&&Ar(t.focus.origin)&&null===t.focus.getNodeAtCaret())for(let s=zo(t.focus.origin,"previous");Po(s)&&i.has(s.origin)&&!s.origin.isEmpty()&&s.origin.is(e[e.length-1]);s=Wo(s))i.delete(s.origin),e.pop();for(;e.length>1;){const t=e[e.length-1];if(!Ar(t)||o.has(t)||t.isEmpty()||i.has(t))break;e.pop()}if(0===e.length&&t.isCollapsed()){const n=ss(t.anchor),r=ss(t.anchor.getFlipped()),i=t=>Oo(t)?t.origin:t.getNodeAtCaret(),o=i(n)||i(r)||(t.anchor.getNodeAtCaret()?n.origin:r.origin);e.push(o)}return e}(as(es(this),"next"));return fr()||(this._cachedNodes=e),e}setTextNodeRange(t,e,n,r){this.anchor.set(t.__key,e,"text"),this.focus.set(n.__key,r,"text")}getTextContent(){const t=this.getNodes();if(0===t.length)return"";const e=t[0],n=t[t.length-1],r=this.anchor,i=this.focus,o=r.isBefore(i),[s,l]=Bn(this);let c="",a=!0;for(let u=0;u<t.length;u++){const d=t[u];if(Ar(d)&&!d.isInline())a||(c+="\n"),a=!d.isEmpty();else if(a=!1,wn(d)){let t=d.getTextContent();d===e?d===n?"element"===r.type&&"element"===i.type&&i.offset!==r.offset||(t=s<l?t.slice(s,l):t.slice(l,s)):t=t.slice(o?s:l):d===n&&(t=t.slice(0,o?l:s)),c+=t}else!Fr(d)&&!cn(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(t){const e=_r(),n=e.getEditorState()._selection,r=Un(t.startContainer,t.startOffset,t.endContainer,t.endOffset,e,n);if(null===r)return;const[i,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(o.key,o.offset,o.type,!0),it(this)}clone(){const t=this.anchor,e=this.focus;return new In(An(t.key,t.offset,t.type),An(e.key,e.offset,e.type),this.format,this.style)}toggleFormat(t){this.format=pi(this.format,t,null),this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){return!!(this.format&L[t])}insertRawText(t){const e=t.split(/(\r?\n|\t)/),n=[],r=e.length;for(let i=0;i<r;i++){const t=e[i];n.push("\n"===t||"\r\n"===t?ln():"\t"===t?Mn():Tn(t))}this.insertNodes(n)}insertText(t){const e=this.anchor,n=this.focus,i=this.format,o=this.style;let s=e,l=n;!this.isCollapsed()&&n.isBefore(e)&&(s=n,l=e),"element"===s.type&&function(t,e,n,r){const i=t.getNode(),o=i.getChildAtIndex(t.offset),s=Tn(),l=Ir(i)?Xr().append(s):s;s.setFormat(n),s.setStyle(r),null===o?i.append(l):o.insertBefore(l),t.is(e)&&e.set(s.__key,0,"text"),t.set(s.__key,0,"text")}(s,l,i,o),"element"===l.type&&Qo(l,ss(Go(l,"next")));const c=s.offset;let a=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];wn(f)||r(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let p=u[d-1];if(1===d&&"element"===l.type&&(a=h,l.set(s.key,a,"text")),this.isCollapsed()&&c===h&&(f.isSegmented()||f.isToken()||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&null===f.getNextSibling())){let e=f.getNextSibling();if(wn(e)&&e.canInsertTextBefore()&&!fi(e)||(e=Tn(),e.setFormat(i),e.setStyle(o),g.canInsertTextAfter()?f.insertAfter(e):g.insertAfter(e)),e.select(0,0),f=e,""!==t)return void this.insertText(t)}else if(this.isCollapsed()&&0===c&&(f.isSegmented()||f.isToken()||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&null===f.getPreviousSibling())){let e=f.getPreviousSibling();if(wn(e)&&!fi(e)||(e=Tn(),e.setFormat(i),g.canInsertTextBefore()?f.insertBefore(e):g.insertBefore(e)),e.select(),f=e,""!==t)return void this.insertText(t)}else if(f.isSegmented()&&c!==h){const t=Tn(f.getTextContent());t.setFormat(i),f.replace(t),f=t}else if(!this.isCollapsed()&&""!==t){const e=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||Ar(e)&&(!e.canInsertTextBefore()||!e.canInsertTextAfter()))return this.insertText(""),qn(this.anchor,this.focus,null),void this.insertText(t)}if(1===d){if(f.isToken()){const e=Tn(t);return e.select(),void f.replace(e)}const e=f.getFormat(),n=f.getStyle();if(c!==a||e===i&&n===o){if(function(t){return t instanceof Nn}(f)){const e=Tn(t);return e.setFormat(i),e.setStyle(o),e.select(),void f.replace(e)}}else{if(""!==f.getTextContent()){const e=Tn(t);if(e.setFormat(i),e.setStyle(o),e.select(),0===c)f.insertBefore(e,!1);else{const[t]=f.splitText(c);t.insertAfter(e,!1)}return void(e.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=t.length))}f.setFormat(i),f.setStyle(o)}f=f.spliceText(c,a-c,t,!0),""===f.getTextContent()?f.remove():"text"===this.anchor.type&&(f.isComposing()?this.anchor.offset-=t.length:(this.format=e,this.style=n))}else{const e=new Set([...f.getParentKeys(),...p.getParentKeys()]),n=Ar(f)?f:f.getParentOrThrow();let r=Ar(p)?p:p.getParentOrThrow(),i=p;if(!n.is(r)&&r.isInline())do{i=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===l.type&&(0!==a||""===p.getTextContent())||"element"===l.type&&p.getIndexWithinParent()<a)if(wn(p)&&!p.isToken()&&a!==p.getTextContentSize()){if(p.isSegmented()){const t=Tn(p.getTextContent());p.replace(t),p=t}Ir(l.getNode())||"text"!==l.type||(p=p.spliceText(0,a,"")),e.add(p.__key)}else{const t=p.getParentOrThrow();t.canBeEmpty()||1!==t.getChildrenSize()?p.remove():t.remove()}else e.add(p.__key);const o=r.getChildren(),s=new Set(u),g=n.is(r),_=n.isInline()&&null===f.getNextSibling()?n:f;for(let t=o.length-1;t>=0;t--){const e=o[t];if(e.is(f)||Ar(e)&&e.isParentOf(f))break;e.isAttached()&&(!s.has(e)||e.is(i)?g||_.insertAfter(e,!1):e.remove())}if(!g){let t=r,n=null;for(;null!==t;){const r=t.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(e.delete(t.__key),n=t),t=t.getParent()}}if(f.isToken())if(c===h)f.select();else{const e=Tn(t);e.select(),f.replace(e)}else f=f.spliceText(c,h-c,t,!0),""===f.getTextContent()?f.remove():f.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=t.length);for(let t=1;t<d;t++){const n=u[t];e.has(n.__key)||n.remove()}}}removeText(){const t=Yn()===this;ts(this,os(es(this))),t&&Yn()!==this&&Ni(this)}formatText(t,e=null){if(this.isCollapsed())return this.toggleFormat(t),void yi(null);const n=this.getNodes(),r=[];for(const x of n)wn(x)&&r.push(x);const i=e=>{n.forEach(n=>{if(Ar(n)){const r=n.getFormatFlags(t,e);n.setTextFormat(r)}})},o=r.length;if(0===o)return this.toggleFormat(t),yi(null),void i(e);const s=this.anchor,l=this.focus,c=this.isBackward(),a=c?l:s,u=c?s:l;let d=0,f=r[0],h="element"===a.type?0:a.offset;if("text"===a.type&&h===f.getTextContentSize()&&(d=1,f=r[1],h=0),null==f)return;const g=f.getFormatFlags(t,e);i(g);const p=o-1;let _=r[p];const m="text"===u.type?u.offset:_.getTextContentSize();if(f.is(_)){if(h===m)return;if(fi(f)||0===h&&m===f.getTextContentSize())f.setFormat(g);else{const t=f.splitText(h,m),e=0===h?t[0]:t[1];e.setFormat(g),"text"===a.type&&a.set(e.__key,0,"text"),"text"===u.type&&u.set(e.__key,m-h,"text")}return void(this.format=g)}0===h||fi(f)||([,f]=f.splitText(h),h=0),f.setFormat(g);const y=_.getFormatFlags(t,g);m>0&&(m===_.getTextContentSize()||fi(_)||([_]=_.splitText(m)),_.setFormat(y));for(let x=d+1;x<p;x++){const e=r[x],n=e.getFormatFlags(t,y);e.setFormat(n)}"text"===a.type&&a.set(f.__key,h,"text"),"text"===u.type&&u.set(_.__key,m,"text"),this.format=g|y}insertNodes(t){if(0===t.length)return;if(this.isCollapsed()||this.removeText(),"root"===this.anchor.key){this.insertParagraph();const e=Yn();return Ln(e)||r(134),e.insertNodes(t)}const e=(this.isBackward()?this.focus:this.anchor).getNode(),n=po(e,go),i=t[t.length-1];if(Ar(n)&&"__language"in n){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const e=rr(this);n.splice(e,0,t),i.selectEnd()}return}if(!t.some(t=>(Ar(t)||Fr(t))&&!t.isInline())){Ar(n)||r(211,e.constructor.name,e.getType());const o=rr(this);return n.splice(o,0,t),void i.selectEnd()}const o=function(t){const e=Xr();let n=null;for(let r=0;r<t.length;r++){const i=t[r],o=cn(i);if(o||Fr(i)&&i.isInline()||Ar(i)&&i.isInline()||wn(i)||i.isParentRequired()){if(null===n&&(n=i.createParentElementNode(),e.append(n),o))continue;null!==n&&n.append(i)}else e.append(i),n=null}return e}(t),s=o.getLastDescendant(),l=o.getChildren(),c=Ar(n)&&n.isEmpty()?null:this.insertParagraph(),a=l[l.length-1];let u=l[0];var d;Ar(d=u)&&go(d)&&!d.isEmpty()&&Ar(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(Ar(n)||r(211,e.constructor.name,e.getType()),n.append(...u.getChildren()),u=l[1]),u&&(null===n&&r(212,e.constructor.name,e.getType()),function(t,e){const n=e.getParentOrThrow().getLastChild();let i=e;const o=[e];for(;i!==n;)i.getNextSibling()||r(140),i=i.getNextSibling(),o.push(i);let s=t;for(const r of o)s=s.insertAfter(r)}(n,u));const f=po(s,go);c&&Ar(f)&&(c.canMergeWhenEmpty()||go(a))&&(f.append(...c.getChildren()),c.remove()),Ar(n)&&n.isEmpty()&&n.remove(),s.selectEnd();const h=Ar(n)?n.getLastChild():null;cn(h)&&f!==n&&h.remove()}insertParagraph(){if("root"===this.anchor.key){const t=Xr();return wi().splice(this.anchor.offset,0,[t]),t.select(),t}const t=rr(this),e=po(this.anchor.getNode(),go);Ar(e)||r(213);const n=e.getChildAtIndex(t),i=n?[n,...n.getNextSiblings()]:[],o=e.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(t){const e=ln();if(this.insertNodes([e]),t){const t=e.getParentOrThrow(),n=e.getIndexWithinParent();t.select(n,n)}}extract(){const t=this.getNodes(),e=t.length,n=e-1,r=this.anchor,i=this.focus;let o=t[0],s=t[n];const[l,c]=Bn(this);if(0===e)return[];if(1===e){if(wn(o)&&!this.isCollapsed()){const t=l>c?c:l,e=o.splitText(t,l>c?l:c),n=0===t?e[0]:e[1];return null!=n?[n]:[]}return[o]}const a=r.isBefore(i);if(wn(o)){const e=a?l:c;e===o.getTextContentSize()?t.shift():0!==e&&([,o]=o.splitText(e),t[0]=o)}if(wn(s)){const e=s.getTextContent().length,r=a?c:l;0===r?t.pop():r!==e&&([s]=s.splitText(r),t[n]=s)}return t}modify(t,e,n){if(or(this,t,e,n))return;const r="move"===t,i=_r(),o=lo(eo(i));if(!o)return;const s=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(null===l||null===s||!Ar(c)||c.isInline()||c.canBeEmpty()||so(s,i,l),this.dirty){let t=Yi(i,this.anchor.key),e=Yi(i,this.focus.key);"text"===this.anchor.type&&(t=gi(t)),"text"===this.focus.type&&(e=gi(e)),t&&e&&nr(o,t,this.anchor.offset,e,this.focus.offset)}if(function(t,e,n,r){t.modify(e,n,r)}(o,t,e?"backward":"forward",n),o.rangeCount>0){const t=o.getRangeAt(0),n=this.anchor.getNode(),i=Ir(n)?n:function(t){let e=t.getParentOrThrow();for(;null!==e;){if(no(e))return e;e=e.getParentOrThrow()}return e}(n);if(this.applyDOMRange(t),this.dirty=!0,!r){const n=this.getNodes(),r=[];let s=!1;for(let t=0;t<n.length;t++){const e=n[t];Qi(e,i)?r.push(e):s=!0}if(s&&r.length>0)if(e){const t=r[0];Ar(t)?t.selectStart():t.getParentOrThrow().selectStart()}else{const t=r[r.length-1];Ar(t)?t.selectEnd():t.getParentOrThrow().selectEnd()}o.anchorNode===t.startContainer&&o.anchorOffset===t.startOffset||function(t){const e=t.focus,n=t.anchor,r=n.key,i=n.offset,o=n.type;n.set(e.key,e.offset,e.type,!0),e.set(r,i,o,!0)}(this)}}"lineboundary"===n&&or(this,t,e,n,"decorators")}forwardDeletion(t,e,n){if(!n&&("element"===t.type&&Ar(e)&&t.offset===e.getChildrenSize()||"text"===t.type&&t.offset===e.getTextContentSize())){const t=e.getParent(),n=e.getNextSibling()||(null===t?null:t.getNextSibling());if(Ar(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(t){const e=this.isCollapsed();if(this.isCollapsed()){const e=this.anchor;let n=e.getNode();if(this.forwardDeletion(e,n,t))return;const r=Vo(Go(e,t?"previous":"next"));if(r.getTextSlices().every(t=>null===t||0===t.distance)){let t={type:"initial"};for(const e of r.iterNodeCarets("shadowRoot"))if(Po(e))if(e.origin.isInline());else{if(e.origin.isShadowRoot()){if("merge-block"===t.type)break;if(Ar(r.anchor.origin)&&r.anchor.origin.isEmpty()){const t=ss(e);ts(this,qo(t,t)),r.anchor.origin.remove()}return}"merge-next-block"!==t.type&&"merge-block"!==t.type||(t={block:t.block,caret:e,type:"merge-block"})}else{if("merge-block"===t.type)break;if(Ao(e)){if(Ar(e.origin)){if(e.origin.isInline()){if(!e.origin.isParentOf(r.anchor.origin))break}else t={block:e.origin,type:"merge-next-block"};continue}if(Fr(e.origin)){if(e.origin.isIsolated());else if("merge-next-block"===t.type&&(e.origin.isKeyboardSelectable()||!e.origin.isInline())&&Ar(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const t=Zn();t.add(e.origin.getKey()),Ni(t)}else e.origin.remove();return}break}}if("merge-block"===t.type){const{caret:e,block:n}=t;return ts(this,qo(!e.origin.isEmpty()&&n.isEmpty()?ns(Io(n,e.direction)):r.anchor,e)),this.removeText()}}const i=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&0===e.offset&&zn(this,e.getNode()))return}else{const r="text"===i.type?i.getNode():null;if(n="text"===e.type?e.getNode():null,null!==r&&r.isSegmented()){const e=i.offset,o=r.getTextContentSize();if(r.is(n)||t&&e!==o||!t&&0!==e)return void Jn(r,t,e)}else if(null!==n&&n.isSegmented()){const i=e.offset,o=n.getTextContentSize();if(n.is(r)||t&&0!==i||!t&&i!==o)return void Jn(n,t,i)}!function(t,e){const n=t.anchor,r=t.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){const t=n.offset,o=r.offset,s=t<o,l=s?t:o,c=s?o:t,a=c-1;l!==a&&function(t){return!(Ai(t)||Wn(t))}(i.getTextContent().slice(l,c))&&(e?r.set(r.key,a,r.type):n.set(n.key,a,n.type))}}(this,t)}}if(this.removeText(),t&&!e&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const t=this.anchor.getNode();t.isEmpty()&&Ir(t.getParent())&&null===t.getPreviousSibling()&&zn(this,t)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){const e=this.anchor,n=e.getNode();if(this.forwardDeletion(e,n,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Rn(t){return t instanceof Fn}function Kn(t){const e=t.offset;if("text"===t.type)return e;const n=t.getNode();return e===n.getChildrenSize()?n.getTextContent().length:0}function Bn(t){const e=t.getStartEndPoints();if(null===e)return[0,0];const[n,r]=e;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[Kn(n),Kn(r)]}function zn(t,e){for(let n=e;n;n=n.getParent()){if(Ar(n)){if(n.collapseAtStart(t))return!0;if(no(n))break}if(n.getPreviousSibling())break}return!1}const Wn=(()=>{try{const t=new RegExp("\\p{Emoji}","u"),e=t.test.bind(t);if(e("\u2764\ufe0f")&&e("#\ufe0f\u20e3")&&e("\ud83d\udc4d"))return e}catch(r){}return()=>!1})();function Jn(t,e,n){const r=t,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,l=0;for(let a=0;a<o;a++){const t=a===o-1;if(l=s,s+=i[a].length,e&&s===n||s>n||t){i.splice(a,1),t&&(l=void 0);break}}const c=i.join("").trim();""===c?r.remove():(r.setTextContent(c),r.select(l,l))}function jn(t,e,n,i){let o,s=e;if(co(t)){let l=!1;const c=t.childNodes,a=c.length,u=i._blockCursorElement;s===a&&(l=!0,s=a-1);let d=c[s],f=!1;if(d===u)d=c[s+1],f=!0;else if(null!==u){const n=u.parentNode;t===n&&e>Array.prototype.indexOf.call(n.children,u)&&s--}if(o=Mi(d),wn(o))s=Oi(o,l);else{let c=Mi(t);if(null===c)return null;if(Ar(c)){const a=i.getElementByKey(c.getKey());null===a&&r(214);const u=c.getDOMSlot(a);[c,s]=u.resolveChildIndex(c,a,t,e),Ar(c)||r(215),l&&s>=c.getChildrenSize()&&(s=Math.max(0,c.getChildrenSize()-1));let d=c.getChildAtIndex(s);if(Ar(d)&&function(t,e,n){const r=t.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(d,0,n)){const t=l?d.getLastDescendant():d.getFirstDescendant();null===t?c=d:(d=t,c=Ar(d)?d:d.getParentOrThrow()),s=0}wn(d)?(o=d,c=null,s=Oi(d,l)):d!==c&&l&&!f&&(Ar(c)||r(216),s=Math.min(c.getChildrenSize(),s+1))}else{const n=c.getIndexWithinParent();s=0===e&&Fr(c)&&Mi(t)===c?n:n+1,c=c.getParentOrThrow()}if(Ar(c))return An(c.__key,s,"element")}}else o=Mi(t);return wn(o)?An(o.__key,s,"text"):null}function Vn(t,e,n){const r=t.offset,i=t.getNode();if(0===r){const r=i.getPreviousSibling(),o=i.getParent();if(e){if((n||!e)&&null===r&&Ar(o)&&o.isInline()){const e=o.getPreviousSibling();wn(e)&&t.set(e.__key,e.getTextContent().length,"text")}}else Ar(r)&&!n&&r.isInline()?t.set(r.__key,r.getChildrenSize(),"element"):wn(r)&&t.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){const r=i.getNextSibling(),o=i.getParent();if(e&&Ar(r)&&r.isInline())t.set(r.__key,0,"element");else if((n||e)&&null===r&&Ar(o)&&o.isInline()&&!o.canInsertTextAfter()){const e=o.getNextSibling();wn(e)&&t.set(e.__key,0,"text")}}}function qn(t,e,n){if("text"===t.type&&"text"===e.type){const r=t.isBefore(e),i=t.is(e);Vn(t,r,i),Vn(e,!r,i),i&&e.set(t.key,t.offset,t.type);const o=_r();if(o.isComposing()&&o._compositionKey!==t.key&&Ln(n)){const r=n.anchor,i=n.focus;t.set(r.key,r.offset,r.type,!0),e.set(i.key,i.offset,i.type,!0)}}}function Un(t,e,n,r,i,o){if(null===t||null===n||!ci(i,t,n))return null;const s=jn(t,e,Ln(o)?o.anchor:null,i);if(null===s)return null;const l=jn(n,r,Ln(o)?o.focus:null,i);if(null===l)return null;if("element"===s.type&&"element"===l.type){const e=Mi(t),r=Mi(n);if(Fr(e)&&Fr(r))return null}return qn(s,l,o),[s,l]}function $n(t,e,n,r,i,o){const s=pr(),l=new In(An(t,e,i),An(n,r,o),0,"");return l.dirty=!0,s._selection=l,l}function Zn(){return new Fn(new Set)}function Hn(t,e,n,r){const i=n._window;if(null===i)return null;const o=r||i.event,s=o?o.type:void 0,l="selectionchange"===s,c=!j&&(l||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&o&&3===o.detail||"drop"===s||void 0===s);let a,u,d,f;if(Ln(t)&&!c)return t.clone();if(null===e)return null;if(a=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,l&&Ln(t)&&!ci(n,a,u))return t.clone();const h=Un(a,d,u,f,n,t);if(null===h)return null;const[g,p]=h;return new In(g,p,Ln(t)?t.format:0,Ln(t)?t.style:"")}function Yn(){return pr()._selection}function Xn(){return _r()._editorState._selection}function Gn(t,e,n,r=1){const i=t.anchor,o=t.focus,s=i.getNode(),l=o.getNode();if(!e.is(s)&&!e.is(l))return;const c=e.__key;if(t.isCollapsed()){const e=i.offset;if(n<=e&&r>0||n<e&&r<0){const n=Math.max(0,e+r);i.set(c,n,"element"),o.set(c,n,"element"),Qn(t)}}else{const s=t.isBackward(),l=s?o:i,a=l.getNode(),u=s?i:o,d=u.getNode();if(e.is(a)){const t=l.offset;(n<=t&&r>0||n<t&&r<0)&&l.set(c,Math.max(0,t+r),"element")}if(e.is(d)){const t=u.offset;(n<=t&&r>0||n<t&&r<0)&&u.set(c,Math.max(0,t+r),"element")}}Qn(t)}function Qn(t){const e=t.anchor,n=e.offset,r=t.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(t.isCollapsed()){if(!Ar(o))return;const t=o.getChildrenSize(),i=n>=t,s=o.getChildAtIndex(i?t-1:n);if(wn(s)){let t=0;i&&(t=s.getTextContentSize()),e.set(s.__key,t,"text"),r.set(s.__key,t,"text")}}else{if(Ar(o)){const t=o.getChildrenSize(),r=n>=t,i=o.getChildAtIndex(r?t-1:n);if(wn(i)){let t=0;r&&(t=i.getTextContentSize()),e.set(i.__key,t,"text")}}if(Ar(s)){const t=s.getChildrenSize(),e=i>=t,n=s.getChildAtIndex(e?t-1:i);if(wn(n)){let t=0;e&&(t=n.getTextContentSize()),r.set(n.__key,t,"text")}}}}function tr(t,e,n,r,i){let o=null,s=0,l=null;null!==r?(o=r.__key,wn(r)?(s=r.getTextContentSize(),l="text"):Ar(r)&&(s=r.getChildrenSize(),l="element")):null!==i&&(o=i.__key,wn(i)?l="text":Ar(i)&&(l="element")),null!==o&&null!==l?t.set(o,s,l):(s=e.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),t.set(n.__key,s,"element"))}function er(t,e,n,r,i){"text"===t.type?t.set(n,t.offset+(e?0:i),"text"):t.offset>r.getIndexWithinParent()&&t.set(t.key,t.offset-1,"element")}function nr(t,e,n,r,i){try{t.setBaseAndExtent(e,n,r,i)}catch(t){}}function rr(t){let e=t;t.isCollapsed()||e.removeText();const n=Yn();Ln(n)&&(e=n),Ln(e)||r(161);const i=e.anchor;let o=i.getNode(),s=i.offset;for(;!go(o);){const t=o;if([o,s]=ir(o,s),t.is(o))break}return s}function ir(t,e){const n=t.getParent();if(!n){const t=Xr();return wi().append(t),t.select(),[wi(),0]}if(wn(t)){const r=t.splitText(e);if(0===r.length)return[n,t.getIndexWithinParent()];const i=0===e?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!Ar(t)||0===e)return[n,t.getIndexWithinParent()];const r=t.getChildAtIndex(e);if(r){const n=new In(An(t.__key,e,"element"),An(t.__key,e,"element"),0,""),i=t.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,t.getIndexWithinParent()+1]}function or(t,e,n,r,i="decorators-and-blocks"){if("move"===e&&"character"===r&&!t.isCollapsed()){const[e,r]=n===t.isBackward()?[t.focus,t.anchor]:[t.anchor,t.focus];return r.set(e.key,e.offset,e.type),!0}const o=Go(t.focus,n?"previous":"next"),s="lineboundary"===r,l="move"===e;let c=o,a="decorators-and-blocks"===i;if(!ls(c)){for(const t of c){a=!1;const{origin:e}=t;if(!Fr(e)||e.isIsolated()||(c=t,!s||!e.isInline()))break}if(a)for(const t of Vo(o).iterNodeCarets("extend"===e?"shadowRoot":"root")){if(Po(t))t.origin.isInline()||(c=t);else{if(Ar(t.origin))continue;Fr(t.origin)&&!t.origin.isInline()&&(c=t)}break}}if(c===o)return!1;if(l&&!s&&Fr(c.origin)&&c.origin.isKeyboardSelectable()){const t=Zn();return t.add(c.origin.getKey()),Ni(t),!0}return c=ss(c),l&&Qo(t.anchor,c),Qo(t.focus,c),a||!s}let sr=null,lr=null,cr=!1,ar=!1,ur=0;const dr={characterData:!0,childList:!0,subtree:!0};function fr(){return cr||null!==sr&&sr._readOnly}function hr(){cr&&r(13)}function gr(){ur>99&&r(14)}function pr(){return null===sr&&r(195,mr()),sr}function _r(){return null===lr&&r(196,mr()),lr}function mr(){let t=0;const e=new Set,n=ri.version;if("undefined"!=typeof window)for(const i of document.querySelectorAll("[contenteditable]")){const r=di(i);if(ai(r))t++;else if(r){let t=String(r.constructor.version||"<0.17.1");t===n&&(t+=" (separately built, likely a bundler configuration issue)"),e.add(t)}}let r=` Detected on the page: ${t} compatible editor(s) with version ${n}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function yr(t,e,n){const i=e.__type,o=function(t,e){const n=t._nodes.get(e);return void 0===n&&r(30,e),n}(t,i);let s=n.get(i);void 0===s&&(s=Array.from(o.transforms),n.set(i,s));const l=s.length;for(let r=0;r<l&&(s[r](e),e.isAttached());r++);}function xr(t,e){return void 0!==t&&t.__key!==e&&t.isAttached()}function vr(t,e){if(!e)return;const n=t._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const i of r)n.add(i)}function Cr(t,e){const n=t.type,i=e.get(n);void 0===i&&r(17,n);const o=i.klass;t.type!==o.getType()&&r(18,o.name);const s=o.importJSON(t),l=t.children;if(Ar(s)&&Array.isArray(l))for(let r=0;r<l.length;r++){const t=Cr(l[r],e);s.append(t)}return s}function Sr(t,e,n){const r=sr,i=cr,o=lr;sr=e,cr=!0,lr=t;try{return n()}finally{sr=r,cr=i,lr=o}}function br(t,e){const n=t._pendingEditorState,r=t._rootElement,i=t._headless||null===r;if(null===n)return;const o=t._editorState,s=o._selection,l=n._selection,c=0!==t._dirtyType,a=sr,u=cr,d=lr,f=t._updating,h=t._observer;let g=null;if(t._pendingEditorState=null,t._editorState=n,!i&&c&&null!==h){lr=t,sr=n,cr=!1,t._updating=!0;try{const e=t._dirtyType,r=t._dirtyElements,i=t._dirtyLeaves;h.disconnect(),g=function(t,e,n,r,i,o){_t="",vt="",mt="",Ct=r===y,bt=null,lt=n,st=n._config,ct=n._nodes,at=lt._listeners.mutation,ut=i,dt=o,ft=t._nodeMap,ht=e._nodeMap,St=e._readOnly,gt=new Map(n._keyToDOMMap);const s=new Map;return pt=s,Rt("root",null),lt=void 0,ct=void 0,ut=void 0,dt=void 0,ft=void 0,ht=void 0,st=void 0,gt=void 0,pt=void 0,s}(o,n,t,e,r,i)}catch(e){if(e instanceof Error&&t._onError(e),ar)throw e;return ei(t,null,r,n),G(t),t._dirtyType=y,ar=!0,br(t,o),void(ar=!1)}finally{h.observe(r,dr),t._updating=f,sr=a,cr=u,lr=d}}n._readOnly||(n._readOnly=!0);const _=t._dirtyLeaves,m=t._dirtyElements,x=t._normalizedNodes,v=t._updateTags,C=t._deferred;c&&(t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements=new Map,t._normalizedNodes=new Set,t._updateTags=new Set),function(t,e){const n=t._decorators;let r=t._pendingDecorators||n;const i=e._nodeMap;let o;for(o in r)i.has(o)||(r===n&&(r=ki(t)),delete r[o])}(t,n);const S=i?null:lo(eo(t));if(t._editable&&null!==S&&(c||null===l||l.dirty)&&null!==r&&!v.has($r)){lr=t,sr=n;try{if(null!==h&&h.disconnect(),c||null===l||l.dirty){const e=t._blockCursorElement;null!==e&&so(e,t,r),function(t,e,n,r,i,o){const s=r.anchorNode,l=r.focusNode,c=r.anchorOffset,a=r.focusOffset,u=document.activeElement;if(i.has(qr)&&u!==o||null!==u&&li(u))return;if(!Ln(e))return void(null!==t&&ci(n,s,l)&&r.removeAllRanges());const d=e.anchor,f=e.focus,h=d.key,g=f.key,p=Yi(n,h),_=Yi(n,g),m=d.offset,y=f.offset,x=e.format,v=e.style,C=e.isCollapsed();let S=p,b=_,k=!1;if("text"===d.type){S=gi(p);const t=d.getNode();k=t.getFormat()!==x||t.getStyle()!==v}else Ln(t)&&"text"===t.anchor.type&&(k=!0);var T,w,E,N,M;if("text"===f.type&&(b=gi(_)),null!==S&&null!==b&&(C&&(null===t||k||Ln(t)&&(t.format!==x||t.style!==v))&&(T=x,w=v,E=m,N=h,M=performance.now(),Je=[T,w,E,N,M]),c!==m||a!==y||s!==S||l!==b||"Range"===r.type&&C||(null!==u&&o.contains(u)||o.focus({preventScroll:!0}),"element"===d.type))){if(nr(r,S,m,b,y),!i.has(Ur)&&e.isCollapsed()&&null!==o&&o===document.activeElement){const t=Ln(e)&&"element"===e.anchor.type?S.childNodes[m]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==t){let e;if(t instanceof Text){const n=document.createRange();n.selectNode(t),e=n.getBoundingClientRect()}else e=t.getBoundingClientRect();!function(t,e,n){const r=Gi(n),i=to(r);if(null===r||null===i)return;let{top:o,bottom:s}=e,l=0,c=0,a=n;for(;null!==a;){const e=a===r.body;if(e)l=0,c=eo(t).innerHeight;else{const t=a.getBoundingClientRect();l=t.top,c=t.bottom}let n=0;if(o<l?n=-(l-o):s>c&&(n=s-c),0!==n)if(e)i.scrollBy(0,n);else{const t=a.scrollTop;a.scrollTop+=n;const e=a.scrollTop-t;o-=e,s-=e}if(e)break;a=Xi(a)}}(n,e,o)}}Le=!0}}(s,l,t,S,v,r)}!function(t,e,n){let r=t._blockCursorElement;if(Ln(n)&&n.isCollapsed()&&"element"===n.anchor.type&&e.contains(document.activeElement)){const i=n.anchor,o=i.getNode(),s=i.offset;let l=!1,c=null;if(s===o.getChildrenSize())oo(o.getChildAtIndex(s-1))&&(l=!0);else{const e=o.getChildAtIndex(s);if(null!==e&&oo(e)){const n=e.getPreviousSibling();(null===n||oo(n))&&(l=!0,c=t.getElementByKey(e.__key))}}if(l){const n=t.getElementByKey(o.__key);return null===r&&(t._blockCursorElement=r=function(t){const e=t.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=e.blockCursor;if(void 0!==r){if("string"==typeof r){const t=p(r);r=e.blockCursor=t}void 0!==r&&n.classList.add(...r)}return n}(t._config)),e.style.caretColor="transparent",void(null===c?n.appendChild(r):n.insertBefore(r,c))}}null!==r&&so(r,t,e)}(t,r,l)}finally{null!==h&&h.observe(r,dr),lr=d,sr=a}}null!==g&&function(t,e,n,r,i){const o=Array.from(t._listeners.mutation),s=o.length;for(let l=0;l<s;l++){const[t,s]=o[l],c=e.get(s);void 0!==c&&t(c,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}(t,g,v,_,o),Ln(l)||null===l||null!==s&&s.is(l)||t.dispatchCommand(Jt,void 0);const b=t._pendingDecorators;null!==b&&(t._decorators=b,t._pendingDecorators=null,kr("decorator",t,!0,b)),function(t,e,n){const r=Ti(e),i=Ti(n);r!==i&&kr("textcontent",t,!0,i)}(t,e||o,n),kr("update",t,!0,{dirtyElements:m,dirtyLeaves:_,editorState:n,mutatedNodes:g,normalizedNodes:x,prevEditorState:e||o,tags:v}),function(t,e){if(t._deferred=[],0!==e.length){const n=t._updating;t._updating=!0;try{for(let t=0;t<e.length;t++)e[t]()}finally{t._updating=n}}}(t,C),function(t){const e=t._updates;if(0!==e.length){const n=e.shift();if(n){const[e,r]=n;wr(t,e,r)}}}(t)}function kr(t,e,n,...r){const i=e._updating;e._updating=n;try{const n=Array.from(e._listeners[t]);for(let t=0;t<n.length;t++)n[t].apply(null,r)}finally{e._updating=i}}function Tr(t,e){const n=t._updates;let i=e||!1;for(;0!==n.length;){const e=n.shift();if(e){const[n,o]=e;let s;if(void 0!==o){if(s=o.onUpdate,o.skipTransforms&&(i=!0),o.discrete){const e=t._pendingEditorState;null===e&&r(191),e._flushSync=!0}s&&t._deferred.push(s),vr(t,o.tag)}n()}}return i}function wr(t,e,n){const i=t._updateTags;let o,s=!1,l=!1;void 0!==n&&(o=n.onUpdate,vr(t,n.tag),s=n.skipTransforms||!1,l=n.discrete||!1),o&&t._deferred.push(o);const c=t._editorState;let a=t._pendingEditorState,u=!1;(null===a||a._readOnly)&&(a=t._pendingEditorState=Rr(a||c),u=!0),a._flushSync=l;const d=sr,f=cr,h=lr,g=t._updating;sr=a,cr=!1,t._updating=!0,lr=t;const p=t._headless||null===t.getRootElement();try{u&&(p?null!==c._selection&&(a._selection=c._selection.clone()):a._selection=function(t,e){const n=t.getEditorState()._selection,r=lo(eo(t));return Ln(n)||null==n?Hn(n,r,t,e):n.clone()}(t,n&&n.event||null));const i=t._compositionKey;e(),s=Tr(t,s),function(t,e){const n=e.getEditorState()._selection,r=t._selection;if(Ln(r)){const t=r.anchor,e=r.focus;let i;if("text"===t.type&&(i=t.getNode(),i.selectionTransform(n,r)),"text"===e.type){const t=e.getNode();i!==t&&t.selectionTransform(n,r)}}}(a,t),0!==t._dirtyType&&(s?function(t,e){const n=e._dirtyLeaves,r=t._nodeMap;for(const i of n){const t=r.get(i);wn(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&rt(t)}}(a,t):function(t,e){const n=e._dirtyLeaves,r=e._dirtyElements,i=t._nodeMap,o=xi(),s=new Map;let l=n,c=l.size,a=r,u=a.size;for(;c>0||u>0;){if(c>0){e._dirtyLeaves=new Set;for(const t of l){const r=i.get(t);wn(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&rt(r),void 0!==r&&xr(r,o)&&yr(e,r,s),n.add(t)}if(l=e._dirtyLeaves,c=l.size,c>0){ur++;continue}}e._dirtyLeaves=new Set,e._dirtyElements=new Map,a.delete("root")&&a.set("root",!0);for(const t of a){const n=t[0],l=t[1];if(r.set(n,l),!l)continue;const c=i.get(n);void 0!==c&&xr(c,o)&&yr(e,c,s)}l=e._dirtyLeaves,c=l.size,a=e._dirtyElements,u=a.size,ur++}e._dirtyLeaves=n,e._dirtyElements=r}(a,t),Tr(t),function(t,e,n,r){const i=t._nodeMap,o=e._nodeMap,s=[];for(const[l]of r){const t=o.get(l);void 0!==t&&(t.isAttached()||(Ar(t)&&J(t,l,i,o,s,r),i.has(l)||r.delete(l),s.push(l)))}for(const l of s)o.delete(l);for(const l of n){const t=o.get(l);void 0===t||t.isAttached()||(i.has(l)||n.delete(l),o.delete(l))}}(c,a,t._dirtyLeaves,t._dirtyElements)),i!==t._compositionKey&&(a._flushSync=!0);const o=a._selection;if(Ln(o)){const t=a._nodeMap,e=o.focus.key;void 0!==t.get(o.anchor.key)&&void 0!==t.get(e)||r(19)}else Rn(o)&&0===o._nodes.size&&(a._selection=null)}catch(r){return r instanceof Error&&t._onError(r),t._pendingEditorState=c,t._dirtyType=y,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),void br(t)}finally{sr=d,cr=f,lr=h,t._updating=g,ur=0}const _=0!==t._dirtyType||t._deferred.length>0||function(t,e){const n=e.getEditorState()._selection,r=t._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(a,t);_?a._flushSync?(a._flushSync=!1,br(t)):u&&oi(()=>{br(t)}):(a._flushSync=!1,u&&(i.clear(),t._deferred=[],t._pendingEditorState=null))}function Er(t,e,n){lr===t&&void 0===n?e():wr(t,e,n)}class Nr{constructor(t,e,n){this.element=t,this.before=e||null,this.after=n||null}withBefore(t){return new Nr(this.element,t,this.after)}withAfter(t){return new Nr(this.element,this.before,t)}withElement(t){return this.element===t?this:new Nr(t,this.before,this.after)}insertChild(t){const e=this.before||this.getManagedLineBreak();return null!==e&&e.parentElement!==this.element&&r(222),this.element.insertBefore(t,e),this}removeChild(t){return t.parentElement!==this.element&&r(223),this.element.removeChild(t),this}replaceChild(t,e){return e.parentElement!==this.element&&r(224),this.element.replaceChild(t,e),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){null===t?this.removeManagedLineBreak():this.insertManagedLineBreak("decorator"===t&&(u||a))}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const e=this.element,n="IMG"===t.nodeName?t.nextSibling:null;n&&e.removeChild(n),e.removeChild(t),e.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const e=this.getManagedLineBreak();if(e){if(t===("IMG"===e.nodeName))return;this.removeManagedLineBreak()}const n=this.element,r=this.before,i=document.createElement("br");if(n.insertBefore(i,r),t){const t=document.createElement("img");t.setAttribute("data-lexical-linebreak","true"),t.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",t.alt="",n.insertBefore(t,i),n.__lexicalLineBreak=t}else n.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let e=this.after;null!==e;e=e.previousSibling)t++;return t}resolveChildIndex(t,e,n,r){if(n===this.element){const e=this.getFirstChildOffset();return[t,Math.min(e+t.getChildrenSize(),Math.max(e,r))]}const i=Mr(e,n);i.push(r);const o=Mr(e,this.element);let s=t.getIndexWithinParent();for(let l=0;l<o.length;l++){const t=i[l],e=o[l];if(void 0===t||t<e)break;if(t>e){s+=1;break}}return[t.getParentOrThrow(),s]}}function Mr(t,e){const n=[];let i=e;for(;i!==t&&null!==i;i=i.parentNode){let t=0;for(let e=i.previousSibling;null!==e;e=e.previousSibling)t++;n.push(t)}return i!==t&&r(225),n.reverse()}class Or extends rn{constructor(t){super(t),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(t){super.afterCloneFrom(t),this.__first=t.__first,this.__last=t.__last,this.__size=t.__size,this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return K[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let e=this.getFirstChild();for(;null!==e;)t.push(e),e=e.getNextSibling();return t}getChildrenKeys(){const t=[];let e=this.getFirstChild();for(;null!==e;)t.push(e.__key),e=e.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const t=_r()._dirtyElements;return null!==t&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),e=this.getParentOrThrow().getLastChild();return null!==e&&e.is(t)}getAllTextNodes(){const t=[];let e=this.getFirstChild();for(;null!==e;){if(wn(e)&&t.push(e),Ar(e)){const n=e.getAllTextNodes();t.push(...n)}e=e.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;Ar(t);){const e=t.getFirstChild();if(null===e)break;t=e}return t}getLastDescendant(){let t=this.getLastChild();for(;Ar(t);){const e=t.getLastChild();if(null===e)break;t=e}return t}getDescendantByIndex(t){const e=this.getChildren(),n=e.length;if(t>=n){const t=e[n-1];return Ar(t)&&t.getLastDescendant()||t||null}const r=e[t];return Ar(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const t=this.getLatest().__first;return null===t?null:vi(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return null===t&&r(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return null===t?null:vi(t)}getLastChildOrThrow(){const t=this.getLastChild();return null===t&&r(96,this.__key),t}getChildAtIndex(t){const e=this.getChildrenSize();let n,r;if(t<e/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=t;){if(r===t)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=e-1;null!==n&&r>=t;){if(r===t)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let t="";const e=this.getChildren(),n=e.length;for(let r=0;r<n;r++){const i=e[r];t+=i.getTextContent(),Ar(i)&&r!==n-1&&!i.isInline()&&(t+=M)}return t}getTextContentSize(){let t=0;const e=this.getChildren(),n=e.length;for(let r=0;r<n;r++){const i=e[r];t+=i.getTextContentSize(),Ar(i)&&r!==n-1&&!i.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(""!==t){const e=R[t];return!!(this.getFormat()&e)}return!1}hasTextFormat(t){const e=L[t];return!!(this.getTextFormat()&e)}getFormatFlags(t,e){return pi(this.getLatest().__textFormat,t,e)}getTextStyle(){return this.getLatest().__textStyle}select(t,e){hr();const n=Yn();let r=t,i=e;const o=this.getChildrenSize();if(!this.canBeEmpty())if(0===t&&0===e){const t=this.getFirstChild();if(wn(t)||Ar(t))return t.select(0,0)}else if(!(void 0!==t&&t!==o||void 0!==e&&e!==o)){const t=this.getLastChild();if(wn(t)||Ar(t))return t.select()}void 0===r&&(r=o),void 0===i&&(i=o);const s=this.__key;return Ln(n)?(n.anchor.set(s,r,"element"),n.focus.set(s,i,"element"),n.dirty=!0,n):$n(s,r,s,i,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(t=>t.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const e=this.getWritable();return e.__dir=t,e}setFormat(t){return this.getWritable().__format=""!==t?R[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const e=this.getWritable();return e.__textFormat=t,e}setTextStyle(t){const e=this.getWritable();return e.__textStyle=t,e}setIndent(t){return this.getWritable().__indent=t,this}splice(t,e,n){const i=n.length,o=this.getChildrenSize(),s=this.getWritable();t+e<=o||r(226,String(t),String(e),String(o));const l=s.__key,c=[],a=[],u=this.getChildAtIndex(t+e);let d=null,f=o-e+i;if(0!==t)if(t===o)d=this.getLastChild();else{const e=this.getChildAtIndex(t);null!==e&&(d=e.getPreviousSibling())}if(e>0){let t=null===d?this.getFirstChild():d.getNextSibling();for(let n=0;n<e;n++){null===t&&r(100);const e=t.getNextSibling(),n=t.__key;_i(t.getWritable()),a.push(n),t=e}}let h=d;for(let g=0;g<i;g++){const t=n[g];null!==h&&t.is(h)&&(d=h=h.getPreviousSibling());const e=t.getWritable();e.__parent===l&&f--,_i(e);const i=t.__key;if(null===h)s.__first=i,e.__prev=null;else{const t=h.getWritable();t.__next=i,e.__prev=t.__key}t.__key===l&&r(76),e.__parent=l,c.push(i),h=t}if(t+e===o)null!==h&&(h.getWritable().__next=null,s.__last=h.__key);else if(null!==u){const t=u.getWritable();if(null!==h){const e=h.getWritable();t.__prev=h.__key,e.__next=u.__key}else t.__prev=null}if(s.__size=f,a.length){const t=Yn();if(Ln(t)){const e=new Set(a),n=new Set(c),{anchor:r,focus:i}=t;Pr(r,e,n)&&tr(r,r.getNode(),this,d,u),Pr(i,e,n)&&tr(i,i.getNode(),this,d,u),0!==f||this.canBeEmpty()||no(this)||this.remove()}}return s}getDOMSlot(t){return new Nr(t)}exportDOM(t){const{element:e}=super.exportDOM(t);if(co(e)){const t=this.getIndent();t>0&&(e.style.paddingInlineStart=40*t+"px");const n=this.getDirection();n&&(e.dir=n)}return{element:e}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},e=this.getTextFormat(),n=this.getTextStyle();return 0!==e&&(t.textFormat=e),""!==n&&(t.textStyle=n),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,e){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,e,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,e){const n=this.getDOMSlot(t);let r=n.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const t=e.getElementByKey(i.getKey());null!==t&&(null==r?(n.insertChild(t),r=t):r!==t&&n.replaceChild(t,r),r=r.nextSibling)}}}function Ar(t){return t instanceof Or}function Pr(t,e,n){let r=t.getNode();for(;r;){const t=r.__key;if(e.has(t)&&!n.has(t))return!0;r=r.getParent()}return!1}class Dr extends rn{decorate(t,e){r(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Fr(t){return t instanceof Dr}class Lr extends Or{static getType(){return"root"}static clone(){return new Lr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){r(51)}getTextContent(){const t=this.__cachedText;return!fr()&&0!==_r()._dirtyType||null===t?super.getTextContent():t}remove(){r(52)}replace(t){r(53)}insertBefore(t){r(54)}insertAfter(t){r(55)}updateDOM(t,e){return!1}splice(t,e,n){for(const i of n)Ar(i)||Fr(i)||r(282);return super.splice(t,e,n)}static importJSON(t){return wi().updateFromJSON(t)}collapseAtStart(){return!0}}function Ir(t){return t instanceof Lr}function Rr(t){return new zr(new Map(t._nodeMap))}function Kr(){return new zr(new Map([["root",new Lr]]))}function Br(t){const e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&r(130,n.name),Ar(t)){const i=e.children;Array.isArray(i)||r(59,n.name);const o=t.getChildren();for(let t=0;t<o.length;t++){const e=Br(o[t]);i.push(e)}}return e}class zr{constructor(t,e){this._nodeMap=t,this._selection=e||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(t,e){return Sr(e&&e.editor||null,this,t)}clone(t){const e=new zr(this._nodeMap,void 0===t?this._selection:t);return e._readOnly=!0,e}toJSON(){return Sr(null,this,()=>({root:Br(wi())}))}}const Wr="historic",Jr="history-push",jr="history-merge",Vr="paste",qr="collaboration",Ur="skip-scroll-into-view",$r="skip-dom-selection";class Zr extends Or{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class Hr extends Or{static getType(){return"paragraph"}static clone(t){return new Hr(t.__key)}createDOM(t){const e=document.createElement("p"),n=Vi(t.theme,"paragraph");return void 0!==n&&e.classList.add(...n),e}updateDOM(t,e,n){return!1}static importDOM(){return{p:t=>({conversion:Yr,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(co(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();t&&(e.style.textAlign=t)}return{element:e}}static importJSON(t){return Xr().updateFromJSON(t)}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle()}}insertNewAfter(t,e){const n=Xr();n.setTextFormat(t.format),n.setTextStyle(t.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,e),n}collapseAtStart(){const t=this.getChildren();if(0===t.length||wn(t[0])&&""===t[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 Yr(t){const e=Xr();return t.style&&(e.setFormat(t.style.textAlign),function(t,e){const n=parseInt(t.style.paddingInlineStart,10)||0,r=Math.round(n/40);e.setIndent(r)}(t,e)),{node:e}}function Xr(){return ro(new Hr)}function Gr(t){return t instanceof Hr}const Qr=0,ti=1;function ei(t,e,n,r){const i=t._keyToDOMMap;i.clear(),t._editorState=Kr(),t._pendingEditorState=r,t._compositionKey=null,t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),t._normalizedNodes=new Set,t._updateTags=new Set,t._updates=[],t._blockCursorElement=null;const o=t._observer;null!==o&&(o.disconnect(),t._observer=null),null!==e&&(e.textContent=""),null!==n&&(n.textContent="",i.set("root",n))}function ni(t){const e=t||{},n=lr,r=e.theme||{},i=void 0===t?n:e.parentEditor||null,o=e.disableEvents||!1,s=Kr(),l=e.namespace||(null!==i?i._config.namespace:Di()),c=e.editorState,a=[Lr,_n,on,Nn,Hr,Zr,...e.nodes||[]],{onError:u,html:d}=e,f=void 0===e.editable||e.editable;let h;if(void 0===t&&null!==n)h=n._nodes;else{h=new Map;for(let t=0;t<a.length;t++){let e=a[t],n=null,r=null;if("function"!=typeof e){const t=e;e=t.replace,n=t.with,r=t.withKlass||null}const i=e.getType(),o=e.transform(),s=new Set;null!==o&&s.add(o),h.set(i,{exportDOM:d&&d.export?d.export.get(e):void 0,klass:e,replace:n,replaceWithKlass:r,transforms:s})}}const g=new ri(s,i,h,{disableEvents:o,namespace:l,theme:r},u||console.error,function(t,e){const n=new Map,r=new Set,i=t=>{Object.keys(t).forEach(e=>{let r=n.get(e);void 0===r&&(r=[],n.set(e,r)),r.push(t[e])})};return t.forEach(t=>{const e=t.klass.importDOM;if(null==e||r.has(e))return;r.add(e);const n=e.call(t.klass);null!==n&&i(n)}),e&&i(e),n}(h,d?d.import:void 0),f,t);return void 0!==c&&(g._pendingEditorState=c,g._dirtyType=y),g}class ri{constructor(t,e,n,r,i,o,s,l){this._createEditorArgs=l,this._parentEditor=e,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=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=Di(),this._onError=i,this._htmlConversions=o,this._editable=s,this._headless=null!==e&&e._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(t){const e=this._listeners.update;return e.add(t),()=>{e.delete(t)}}registerEditableListener(t){const e=this._listeners.editable;return e.add(t),()=>{e.delete(t)}}registerDecoratorListener(t){const e=this._listeners.decorator;return e.add(t),()=>{e.delete(t)}}registerTextContentListener(t){const e=this._listeners.textcontent;return e.add(t),()=>{e.delete(t)}}registerRootListener(t){const e=this._listeners.root;return t(this._rootElement,null),e.add(t),()=>{t(null,this._rootElement),e.delete(t)}}registerCommand(t,e,n){void 0===n&&r(35);const i=this._commands;i.has(t)||i.set(t,[new Set,new Set,new Set,new Set,new Set]);const o=i.get(t);void 0===o&&r(36,String(t));const s=o[n];return s.add(e),()=>{s.delete(e),o.every(t=>0===t.size)&&i.delete(t)}}registerMutationListener(t,e,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;i.set(e,r);const o=n&&n.skipInitialization;return void 0!==o&&o||this.initializeMutationListener(e,r),()=>{i.delete(e)}}getRegisteredNode(t){const e=this._nodes.get(t.getType());return void 0===e&&r(37,t.name),e}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,e){const n=this._editorState,r=xo(n).get(e.getType());if(!r)return;const i=new Map;for(const o of r.keys())i.set(o,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,e){const n=this.getRegisteredNode(t);return n.transforms.add(e),n}registerNodeTransform(t,e){const n=this.registerNodeTransformToKlass(t,e),r=[n],i=n.replaceWithKlass;if(null!=i){const t=this.registerNodeTransformToKlass(i,e);r.push(t)}return function(t,e){const n=xo(t.getEditorState()),r=[];for(const i of e){const t=n.get(i);t&&r.push(t)}0!==r.length&&t.update(()=>{for(const t of r)for(const e of t.keys()){const t=vi(e);t&&t.markDirty()}},null===t._pendingEditorState?{tag:jr}:void 0)}(this,r.map(t=>t.klass.getType())),()=>{r.forEach(t=>t.transforms.delete(e))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,e){return Zi(this,t,e)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const e=this._rootElement;if(t!==e){const n=Vi(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=t,ei(this,e,t,r),null!==e&&(this._config.disableEvents||en(e),null!=n&&e.classList.remove(...n)),null!==t){const e=to(t),r=t.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=e,this._dirtyType=y,G(this),this._updateTags.add(jr),br(this),this._config.disableEvents||function(t,e){const n=t.ownerDocument,r=Fe.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",Ge),Fe.set(n,(r||0)+1),t.__lexicalEditor=e;const i=Ye(t);for(let o=0;o<Me.length;o++){const[n,r]=Me[o],s="function"==typeof r?t=>{tn(t)||(Qe(t),(e.isEditable()||"click"===n)&&r(t,e))}:t=>{if(tn(t))return;Qe(t);const r=e.isEditable();switch(n){case"cut":return r&&Zi(e,xe,t);case"copy":return Zi(e,ye,t);case"paste":return r&&Zi(e,Zt,t);case"dragstart":return r&&Zi(e,pe,t);case"dragover":return r&&Zi(e,_e,t);case"dragend":return r&&Zi(e,me,t);case"focus":return r&&Zi(e,Te,t);case"blur":return r&&Zi(e,we,t);case"drop":return r&&Zi(e,ge,t)}};t.addEventListener(n,s),i.push(()=>{t.removeEventListener(n,s)})}}(t,this),null!=n&&t.classList.add(...n)}else this._window=null,this._updateTags.add(jr),br(this);kr("root",this,!1,t,e)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,e){t.isEmpty()&&r(38);let n=t;n._readOnly&&(n=Rr(t),n._selection=t._selection?t._selection.clone():null),X(this);const i=this._pendingEditorState,o=this._updateTags,s=void 0!==e?e.tag:null;null===i||i.isEmpty()||(null!=s&&o.add(s),br(this)),this._pendingEditorState=n,this._dirtyType=y,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=s&&o.add(s),this._updating||br(this)}parseEditorState(t,e){return function(t,e,n){const r=Kr(),i=sr,o=cr,s=lr,l=e._dirtyElements,c=e._dirtyLeaves,a=e._cloneNotNeeded,u=e._dirtyType;e._dirtyElements=new Map,e._dirtyLeaves=new Set,e._cloneNotNeeded=new Set,e._dirtyType=0,sr=r,cr=!1,lr=e;try{Cr(t.root,e._nodes),n&&n(),r._readOnly=!0}catch(t){t instanceof Error&&e._onError(t)}finally{e._dirtyElements=l,e._dirtyLeaves=c,e._cloneNotNeeded=a,e._dirtyType=u,sr=i,cr=o,lr=s}return r}("string"==typeof t?JSON.parse(t):t,this,e)}read(t){return br(this),this.getEditorState().read(t,{editor:this})}update(t,e){!function(t,e,n){t._updating?t._updates.push([e,n]):wr(t,e,n)}(this,t,e)}focus(t,e={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),Er(this,()=>{const r=Yn(),i=wi();null!==r?r.dirty||Ni(r.clone()):0!==i.getChildrenSize()&&("rootStart"===e.defaultSelection?i.selectStart():i.selectEnd()),hr(),_r()._updateTags.add("focus"),function(t){hr(),_r()._deferred.push(t)}(()=>{n.removeAttribute("autocapitalize"),t&&t()})}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;null!==t&&t.blur();const e=lo(this._window);null!==e&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,kr("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}ri.version="0.31.2+prod.esm";let ii=1;const oi="function"==typeof queueMicrotask?queueMicrotask:t=>{Promise.resolve().then(t)};function si(t){return Fr(bi(t))}function li(t){const e=document.activeElement;if(!co(e))return!1;const n=e.nodeName;return Fr(bi(t))&&("INPUT"===n||"TEXTAREA"===n||"true"===e.contentEditable&&null==di(e))}function ci(t,e,n){const r=t.getRootElement();try{return null!==r&&r.contains(e)&&r.contains(n)&&null!==e&&!li(e)&&ui(e)===t}catch(t){return!1}}function ai(t){return t instanceof ri}function ui(t){let e=t;for(;null!=e;){const t=di(e);if(ai(t))return t;e=Xi(e)}return null}function di(t){return t?t.__lexicalEditor:null}function fi(t){return t.isToken()||t.isSegmented()}function hi(t){return ao(t)&&3===t.nodeType}function gi(t){let e=t;for(;null!=e;){if(hi(e))return e;e=e.firstChild}return null}function pi(t,e,n){const r=L[e];if(null!==n&&(t&r)==(n&r))return t;let i=t^r;return"subscript"===e?i&=~L.superscript:"superscript"===e?i&=~L.subscript:"lowercase"===e?(i&=~L.uppercase,i&=~L.capitalize):"uppercase"===e?(i&=~L.lowercase,i&=~L.capitalize):"capitalize"===e&&(i&=~L.lowercase,i&=~L.uppercase),i}function _i(t){const e=t.getParent();if(null!==e){const n=t.getWritable(),r=e.getWritable(),i=t.getPreviousSibling(),o=t.getNextSibling(),s=null!==o?o.__key:null,l=null!==i?i.__key:null,c=null!==i?i.getWritable():null,a=null!==o?o.getWritable():null;null===i&&(r.__first=s),null===o&&(r.__last=l),null!==c&&(c.__next=s),null!==a&&(a.__prev=l),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function mi(t){gr();const e=t.getLatest(),n=e.__parent,r=pr(),i=_r(),o=i._dirtyElements;null!==n&&function(t,e,n){let r=t;for(;null!==r;){if(n.has(r))return;const t=e.get(r);if(void 0===t)break;n.set(r,!1),r=t.__parent}}(n,r._nodeMap,o);const s=e.__key;i._dirtyType=1,Ar(t)?o.set(s,!0):i._dirtyLeaves.add(s)}function yi(t){hr();const e=_r(),n=e._compositionKey;if(t!==n){if(e._compositionKey=t,null!==n){const t=vi(n);null!==t&&t.getWritable()}if(null!==t){const e=vi(t);null!==e&&e.getWritable()}}}function xi(){return fr()?null:_r()._compositionKey}function vi(t,e){const n=(e||pr())._nodeMap.get(t);return void 0===n?null:n}function Ci(t,e){const n=Si(t,_r());return void 0!==n?vi(n,e):null}function Si(t,e){return t[`__lexicalKey_${e._key}`]}function bi(t,e){let n=t;for(;null!=n;){const t=Ci(n,e);if(null!==t)return t;n=Xi(n)}return null}function ki(t){const e=Object.assign({},t._decorators);return t._pendingDecorators=e,e}function Ti(t){return t.read(()=>wi().getTextContent())}function wi(){return Ei(pr())}function Ei(t){return t._nodeMap.get("root")}function Ni(t){hr();const e=pr();null!==t&&(t.dirty=!0,t.setCachedNodes(null)),e._selection=t}function Mi(t){const e=_r(),n=function(t,e){let n=t;for(;null!=n;){const t=Si(n,e);if(void 0!==t)return t;n=Xi(n)}return null}(t,e);return null===n?t===e.getRootElement()?vi("root"):null:vi(n)}function Oi(t,e){return e?t.getTextContentSize():0}function Ai(t){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t)}function Pi(t){const e=[];let n=t;for(;null!==n;)e.push(n),n=n._parentEditor;return e}function Di(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Fi(t){return hi(t)?t.nodeValue:null}function Li(t,e,n){const r=lo(eo(e));if(null===r)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(null!==i){let e=Fi(i);const r=bi(i);if(null!==e&&wn(r)){if(e===N&&n){const t=n.length;e=n,o=t,s=t}null!==e&&Ii(r,e,o,s,t)}}}function Ii(t,e,n,r,i){let o=t;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let l=e;(s||i)&&e[e.length-1]===N&&(l=e.slice(0,-1));const c=o.getTextContent();if(i||l!==c){if(""===l){if(yi(null),a||u||g)o.remove();else{const t=_r();setTimeout(()=>{t.update(()=>{o.isAttached()&&o.remove()})},20)}return}const e=o.getParent(),i=Xn(),c=o.getTextContentSize(),d=xi(),f=o.getKey();if(o.isToken()||null!==d&&f===d&&!s||Ln(i)&&(null!==e&&!e.canInsertTextBefore()&&0===i.anchor.offset||i.anchor.key===t.__key&&0===i.anchor.offset&&!o.canInsertTextBefore()&&!s||i.focus.key===t.__key&&i.focus.offset===c&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const h=Yn();if(!Ln(h)||null===n||null===r)return void o.setTextContent(l);if(h.setTextNodeRange(o,n,o,r),o.isSegmented()){const t=Tn(o.getTextContent());o.replace(t),o=t}o.setTextContent(l)}}}function Ri(t,e,n){const r=e[n]||!1;return"any"===r||r===t[n]}function Ki(t,e,n){return function(t,e){return Ri(t,e,"altKey")&&Ri(t,e,"ctrlKey")&&Ri(t,e,"shiftKey")&&Ri(t,e,"metaKey")}(t,n)&&t.key.toLowerCase()===e.toLowerCase()}const Bi={ctrlKey:!s,metaKey:s},zi={altKey:s,ctrlKey:!s};function Wi(t){return"Backspace"===t.key}function Ji(t){return Ki(t,"a",Bi)}function ji(t){const e=wi();if(Ln(t)){const e=t.anchor,n=t.focus,r=e.getNode().getTopLevelElementOrThrow().getParentOrThrow();return e.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),it(t),t}{const t=e.select(0,e.getChildrenSize());return Ni(it(t)),t}}function Vi(t,e){void 0===t.__lexicalClassNameCache&&(t.__lexicalClassNameCache={});const n=t.__lexicalClassNameCache,r=n[e];if(void 0!==r)return r;const i=t[e];if("string"==typeof i){const t=p(i);return n[e]=t,t}return i}function qi(t,e,n,i,o){if(0===n.size)return;const s=i.__type,l=i.__key,c=e.get(s);void 0===c&&r(33,s);const a=c.klass;let u=t.get(a);void 0===u&&(u=new Map,t.set(a,u));const d=u.get(l),f="destroyed"===d&&"created"===o;(void 0===d||f)&&u.set(l,f?"updated":o)}function Ui(t,e,n){const r=t.getParent();let i=n,o=t;return null!==r&&(e&&0===n?(i=o.getIndexWithinParent(),o=r):e||n!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(e?i-1:i)}function $i(t){const e=eo(t).event,n=e&&e.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Zi(t,e,n){return function(t,e,n){const r=Pi(t);for(let i=4;i>=0;i--)for(let o=0;o<r.length;o++){const s=r[o],l=s._commands.get(e);if(void 0!==l){const e=l[i];if(void 0!==e){const r=Array.from(e),i=r.length;let o=!1;if(Er(s,()=>{for(let e=0;e<i;e++)if(r[e](n,t))return void(o=!0)}),o)return o}}}return!1}(t,e,n)}function Hi(t){return!Ir(t)&&!t.isLastChild()&&!t.isInline()}function Yi(t,e){const n=t._keyToDOMMap.get(e);return void 0===n&&r(75,e),n}function Xi(t){const e=t.assignedSlot||t.parentElement;return uo(e)?e.host:e}function Gi(t){return function(t){return ao(t)&&9===t.nodeType}(t)?t:co(t)?t.ownerDocument:null}function Qi(t,e){let n=t.getParent();for(;null!==n;){if(n.is(e))return!0;n=n.getParent()}return!1}function to(t){const e=Gi(t);return e?e.defaultView:null}function eo(t){const e=t._window;return null===e&&r(78),e}function no(t){return Ir(t)||Ar(t)&&t.isShadowRoot()}function ro(t){const e=_r(),n=t.constructor.getType(),i=e._nodes.get(n);void 0===i&&r(200,t.constructor.name,n);const{replace:o,replaceWithKlass:s}=i;if(null!==o){const e=o(t),i=e.constructor;return null!==s?e instanceof s||r(201,s.name,s.getType(),i.name,i.getType(),t.constructor.name,n):e instanceof t.constructor&&i!==t.constructor||r(202,i.name,i.getType(),t.constructor.name,n),e.__key===t.__key&&r(203,t.constructor.name,n,i.name,i.getType()),e}return t}function io(t,e){!Ir(t.getParent())||Ar(e)||Fr(e)||r(99)}function oo(t){return(Fr(t)||Ar(t)&&!t.canBeEmpty())&&!t.isInline()}function so(t,e,n){n.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=t.parentElement;null!==r&&r.removeChild(t)}function lo(t){return i?(t||window).getSelection():null}function co(t){return ao(t)&&t.nodeType===_}function ao(t){return"object"==typeof t&&null!==t&&"nodeType"in t&&"number"==typeof t.nodeType}function uo(t){return ao(t)&&t.nodeType===m}function fo(t){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==t.nodeName.match(e)}function ho(t){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==t.nodeName.match(e)}function go(t){if(Fr(t)&&!t.isInline())return!0;if(!Ar(t)||no(t))return!1;const e=t.getFirstChild(),n=null===e||cn(e)||wn(e)||e.isInline();return!t.isInline()&&!1!==t.canBeEmpty()&&n}function po(t,e){let n=t;for(;null!==n&&null!==n.getParent()&&!e(n);)n=n.getParentOrThrow();return e(n)?n:null}function _o(){return _r()}const mo=new WeakMap,yo=new Map;function xo(t){if(!t._readOnly&&t.isEmpty())return yo;t._readOnly||r(192);let e=mo.get(t);return e||(e=function(t){const e=new Map;for(const[n,r]of t._nodeMap){const t=r.__type;let i=e.get(t);i||(i=new Map,e.set(t,i)),i.set(n,r)}return e}(t),mo.set(t,e)),e}function vo(t){const e=t.constructor.clone(t);return e.afterCloneFrom(t),e}function Co(t){return!0===t.__lexicalUnmanaged}const So={next:"previous",previous:"next"};class bo{constructor(t){this.origin=t}[Symbol.iterator](){return Uo({hasNext:Ao,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return Io(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Io(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,e){const n=this.getNodeAtCaret();return t.is(this.origin)||t.is(n)||(null===n?this.insert(t):n.replace(t,e)),this}splice(t,e,n="next"){const i=n===this.direction?e:Array.from(e).reverse();let o=this;const s=this.getParentAtCaret(),l=new Map;for(let r=o.getAdjacentCaret();null!==r&&l.size<t;r=r.getAdjacentCaret()){const t=r.origin.getWritable();l.set(t.getKey(),t)}for(const c of i){if(l.size>0){const t=o.getNodeAtCaret();if(t)if(l.delete(t.getKey()),l.delete(c.getKey()),t.is(c)||o.origin.is(c));else{const e=c.getParent();e&&e.is(s)&&c.remove(),t.replace(c)}else null===t&&r(263,Array.from(l).join(" "))}else o.insert(c);o=Io(c,this.direction)}for(const r of l.values())r.remove();return this}}class ko extends bo{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:zo(t,this.direction)}getParentCaret(t="root"){return Io(Eo(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=wo(this.direction);return Io(this.getNodeAtCaret(),t)||zo(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof ko&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const To={root:Ir,shadowRoot:no};function wo(t){return So[t]}function Eo(t,e="root"){return To[e](t)?null:t}class No extends bo{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Io(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Ar(this.origin)?zo(this.origin,this.direction):null}getParentCaret(t="root"){return Io(Eo(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=wo(this.direction);return Io(this.getNodeAtCaret(),t)||zo(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof No&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof No||t instanceof Mo)&&this.direction===t.direction&&this.origin.is(t.origin)}}class Mo extends bo{type="text";constructor(t,e){super(t),this.offset=e}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Ro(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return Io(Eo(this.getParentAtCaret(),t),this.direction)}getFlipped(){return Ro(this.origin,wo(this.direction),this.offset)}isSamePointCaret(t){return t instanceof Mo&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof No||t instanceof Mo)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Io(this.origin,this.direction)}}function Oo(t){return t instanceof Mo}function Ao(t){return t instanceof No}function Po(t){return t instanceof ko}const Do={next:class extends Mo{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends Mo{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},Fo={next:class extends No{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(t){return this.origin.insertAfter(t),this}},previous:class extends No{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(t){return this.origin.insertBefore(t),this}}},Lo={next:class extends ko{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(t){return this.origin.splice(0,0,[t]),this}},previous:class extends ko{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(t){return this.origin.splice(this.origin.getChildrenSize(),0,[t]),this}}};function Io(t,e){return t?new Fo[e](t):null}function Ro(t,e,n){return t?new Do[e](t,Ko(t,n)):null}function Ko(t,e){const n=t.getTextContentSize();let r="next"===e?n:"previous"===e?0:e;return(r<0||r>n)&&(function(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);n.search=r.toString()}(284,String(e),String(n),t.getKey()),r=r<0?0:n),r}function Bo(t,e){return new jo(t,e)}function zo(t,e){return Ar(t)?new Lo[e](t):null}function Wo(t){return t&&function(t){return t&&t.getChildCaret()||t}(t.getAdjacentCaret())}class Jo{type="node-caret-range";constructor(t,e,n){this.anchor=t,this.focus=e,this.direction=n}getLatest(){const t=this.anchor.getLatest(),e=this.focus.getLatest();return t===this.anchor&&e===this.focus?this:new Jo(t,e,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=t=>{const e=this[t].getLatest();return Oo(e)?function(t,e){const{direction:n,origin:r}=t;return Bo(t,Ko(r,"focus"===e?wo(n):n)-t.offset)}(e,t):null},e=t("anchor"),n=t("focus");if(e&&n){const{caret:t}=e,{caret:r}=n;if(t.isSameNodeCaret(r))return[Bo(t,r.offset-t.offset),null]}return[e,n]}iterNodeCarets(t="root"){const e=Oo(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=Oo(n),i=e=>e.isSameNodeCaret(n)?null:Wo(e)||e.getParentCaret(t);return Uo({hasNext:t=>null!==t&&!(r&&n.isSameNodeCaret(t)),initial:e.isSameNodeCaret(n)?null:i(e),map:t=>t,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class jo{type="slice";constructor(t,e){this.caret=t,this.distance=e}getSliceIndices(){const{distance:t,caret:{offset:e}}=this,n=e+t;return n<e?[n,e]:[e,n]}getTextContent(){const[t,e]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,e)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:e}}=this,[n,r]=this.getSliceIndices(),i=t.getTextContent();return Ro(t.setTextContent(i.slice(0,n)+i.slice(r)),e,n)}}function Vo(t){return qo(t,Io(wi(),t.direction))}function qo(t,e){return t.direction!==e.direction&&r(265),new Jo(t,e,t.direction)}function Uo(t){const{initial:e,hasNext:n,step:r,map:i}=t;let o=e;return{[Symbol.iterator](){return this},next(){if(!n(o))return{done:!0,value:void 0};const t={done:!1,value:i(o)};return o=r(o),t}}}function $o(t,e){const n=Xo(t.origin,e.origin);switch(null===n&&r(275,t.origin.getKey(),e.origin.getKey()),n.type){case"same":{const n="text"===t.type,r="text"===e.type;return n&&r?function(t,e){return Math.sign(t-e)}(t.offset,e.offset):t.type===e.type?0:n?-1:r?1:"child"===t.type?-1:1}case"ancestor":return"child"===t.type?-1:1;case"descendant":return"child"===e.type?1:-1;case"branch":return Zo(n)}}function Zo(t){const{a:e,b:n}=t,r=e.__key,i=n.__key;let o=e,s=n;for(;o&&s;o=o.getNextSibling(),s=s.getNextSibling()){if(o.__key===i)return-1;if(s.__key===r)return 1}return null===o?1:-1}function Ho(t,e){return e.is(t)}function Yo(t){return Ar(t)?[t.getLatest(),null]:[t.getParent(),t.getLatest()]}function Xo(t,e){if(t.is(e))return{commonAncestor:t,type:"same"};const n=new Map;for(let[r,i]=Yo(t);r;i=r,r=r.getParent())n.set(r,i);for(let[i,o]=Yo(e);i;o=i,i=i.getParent()){const s=n.get(i);if(void 0!==s)return null===s?(Ho(t,i)||r(276),{commonAncestor:i,type:"ancestor"}):null===o?(Ho(e,i)||r(277),{commonAncestor:i,type:"descendant"}):((Ar(s)||Ho(t,s))&&(Ar(o)||Ho(e,o))&&i.is(s.getParent())&&i.is(o.getParent())||r(278),{a:s,b:o,commonAncestor:i,type:"branch"})}return null}function Go(t,e){const{type:n,key:i,offset:o}=t,s=function(t){const e=vi(t);return null===e&&r(63,t),e}(t.key);return"text"===n?(wn(s)||r(266,s.getType(),i),Ro(s,e,o)):(Ar(s)||r(267,s.getType(),i),function(t,e,n){let r=zo(t,"next");for(let i=0;i<e;i++){const t=r.getAdjacentCaret();if(null===t)break;r=t}return cs(r,n)}(s,t.offset,e))}function Qo(t,e){const{origin:n,direction:i}=e,o="next"===i;Oo(e)?t.set(n.getKey(),e.offset,"text"):Ao(e)?wn(n)?t.set(n.getKey(),Ko(n,i),"text"):t.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(Po(e)&&Ar(n)||r(268),t.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function ts(t,e){Qo(t.anchor,e.anchor),Qo(t.focus,e.focus)}function es(t){const{anchor:e,focus:n}=t,r=Go(e,"next"),i=Go(n,"next"),o=$o(r,i)<=0?"next":"previous";return qo(cs(r,o),cs(i,o))}function ns(t){const{direction:e,origin:n}=t,r=Io(n,wo(e)).getNodeAtCaret();return r?Io(r,e):zo(n.getParentOrThrow(),e)}function rs(t,e="root"){const n=[t];for(let r=Po(t)?t.getParentCaret(e):t.getSiblingCaret();null!==r;r=r.getParentCaret(e))n.push(ns(r));return n}function is(t){return!!t&&t.origin.isAttached()}function os(t,e="removeEmptySlices"){if(t.isCollapsed())return t;const n="root",i="next";let o=e;const s=as(t,i),l=rs(s.anchor,n),c=rs(s.focus.getFlipped(),n),a=new Set,u=[];for(const r of s.iterNodeCarets(n))if(Po(r))a.add(r.origin.getKey());else if(Ao(r)){const{origin:t}=r;Ar(t)&&!a.has(t.getKey())||u.push(t)}for(const r of u)r.remove();for(const r of s.getTextSlices()){if(!r)continue;const{origin:t}=r.caret,e=t.getTextContentSize(),n=ns(Io(t,i)),s=t.getMode();if(Math.abs(r.distance)===e&&"removeEmptySlices"===o||"token"===s&&0!==r.distance)n.remove();else if(0!==r.distance){o="removeEmptySlices";let t=r.removeTextSlice();const e=r.caret.origin;if("segmented"===s){const e=t.origin,r=Tn(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());n.replaceOrInsert(r),t=Ro(r,i,t.offset)}e.is(l[0].origin)&&(l[0]=t),e.is(c[0].origin)&&(c[0]=t.getFlipped())}}let d,f;for(const r of l)if(is(r)){d=ss(r);break}for(const r of c)if(is(r)){f=ss(r);break}const h=function(t,e,n){if(!t||!e)return null;const r=t.getParentAtCaret(),i=e.getParentAtCaret();if(!r||!i)return null;const o=r.getParents().reverse();o.push(r);const s=i.getParents().reverse();s.push(i);const l=Math.min(o.length,s.length);let c;for(c=0;c<l&&o[c]===s[c];c++);const a=(t,e)=>{let n;for(let r=c;r<t.length;r++){const i=t[r];if(no(i))return;!n&&e(i)&&(n=i)}return n},u=a(o,go),d=u&&a(s,t=>n.has(t.getKey())&&go(t));return u&&d?[u,d]:null}(d,f,a);if(h){const[t,e]=h;zo(t,"previous").splice(0,e.getChildren()),e.remove()}const g=[d,f,...l,...c].find(is);if(g)return function(t){return qo(t,t)}(cs(ss(g),t.direction));r(269,JSON.stringify(l.map(t=>t.origin.__key)))}function ss(t){const e=function(t){let e=t;for(;Po(e);){const t=Wo(e);if(!Po(t))break;e=t}return e}(t.getLatest()),{direction:n}=e;if(wn(e.origin))return Oo(e)?e:Ro(e.origin,n,n);const r=e.getAdjacentCaret();return Ao(r)&&wn(r.origin)?Ro(r.origin,n,wo(n)):e}function ls(t){return Oo(t)&&t.offset!==Ko(t.origin,t.direction)}function cs(t,e){return t.direction===e?t:t.getFlipped()}function as(t,e){return t.direction===e?t:qo(cs(t.focus,e),cs(t.anchor,e))}},59798:(t,e,n)=>{n.d(e,{R:()=>c});var r=n(51609),i=n(74848);function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}var s={error:null},l=function(t){var e,n;function i(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).state=s,e.resetErrorBoundary=function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];null==e.props.onReset||(t=e.props).onReset.apply(t,r),e.reset()},e}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,o(e,n),i.getDerivedStateFromError=function(t){return{error:t}};var l=i.prototype;return l.reset=function(){this.setState(s)},l.componentDidCatch=function(t,e){var n,r;null==(n=(r=this.props).onError)||n.call(r,t,e)},l.componentDidUpdate=function(t,e){var n,r,i,o,s=this.props.resetKeys;null!==this.state.error&&null!==e.error&&(void 0===(i=t.resetKeys)&&(i=[]),void 0===(o=s)&&(o=[]),i.length!==o.length||i.some(function(t,e){return!Object.is(t,o[e])}))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,t.resetKeys,s),this.reset())},l.render=function(){var t=this.state.error,e=this.props,n=e.fallbackRender,i=e.FallbackComponent,o=e.fallback;if(null!==t){var s={error:t,resetErrorBoundary:this.resetErrorBoundary};if(r.isValidElement(o))return o;if("function"==typeof n)return n(s);if(i)return r.createElement(i,s);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},i}(r.Component);function c({children:t,onError:e}){return(0,i.jsx)(l,{fallback:(0,i.jsx)("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:t})}},60083:(t,e,n)=>{n.d(e,{a:()=>d});var r=n(94439),i=n(51609),o=n(74848),s=n(85745),l=n(73105);const c="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect,a=(0,i.forwardRef)(function({editor:t,ariaActiveDescendant:e,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:s,ariaErrorMessage:l,ariaExpanded:a,ariaInvalid:u,ariaLabel:d,ariaLabelledBy:f,ariaMultiline:h,ariaOwns:g,ariaRequired:p,autoCapitalize:_,className:m,id:y,role:x="textbox",spellCheck:v=!0,style:C,tabIndex:S,"data-testid":b,...k},T){const[w,E]=(0,i.useState)(t.isEditable()),N=(0,i.useCallback)(e=>{t.setRootElement(e&&e.ownerDocument&&e.ownerDocument.defaultView?e:null)},[t]),M=(0,i.useMemo)(()=>function(...t){return e=>{t.forEach(t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)})}}(T,N),[N,T]);return c(()=>(E(t.isEditable()),t.registerEditableListener(t=>{E(t)})),[t]),(0,o.jsx)("div",{"aria-activedescendant":w?e:void 0,"aria-autocomplete":w?n:"none","aria-controls":w?r:void 0,"aria-describedby":s,...null!=l?{"aria-errormessage":l}:{},"aria-expanded":w&&"combobox"===x?!!a:void 0,...null!=u?{"aria-invalid":u}:{},"aria-label":d,"aria-labelledby":f,"aria-multiline":h,"aria-owns":w?g:void 0,"aria-readonly":!w||void 0,"aria-required":p,autoCapitalize:_,className:m,contentEditable:w,"data-testid":b,id:y,ref:M,role:w?x:void 0,spellCheck:v,style:C,tabIndex:S,...k})});function u(t){return t.getEditorState().read((0,s.yl)(t.isComposing()))}const d=(0,i.forwardRef)(function(t,e){const{placeholder:n,...i}=t,[s]=(0,r.DF)();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a,{editor:s,...i,ref:e}),null!=n&&(0,o.jsx)(f,{editor:s,content:n})]})});function f({content:t,editor:e}){const n=function(t){const[e,n]=(0,i.useState)(()=>u(t));return c(()=>{function e(){const e=u(t);n(e)}return e(),(0,l.Sd)(t.registerUpdateListener(()=>{e()}),t.registerEditableListener(()=>{e()}))},[t]),e}(e),[r,s]=(0,i.useState)(e.isEditable());if((0,i.useLayoutEffect)(()=>(s(e.isEditable()),e.registerEditableListener(t=>{s(t)})),[e]),!n)return null;let a=null;return"function"==typeof t?a=t(r):null!==t&&(a=t),null===a?null:(0,o.jsx)("div",{"aria-hidden":!0,children:a})}},69923:(t,e,n)=>{n.d(e,{h:()=>T});var r=n(94439),i=n(51609);const o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function s(t){return{initialValueFn:()=>t.isEditable(),subscribe:e=>t.registerEditableListener(e)}}var l=n(85745),c=n(73105),a=n(75795),u=n(74848),d=n(48832),f=n(27639);function h(t,e,n,r=null){let i=null===r||e.isSelected(r);const o=(0,d.ff4)(e)&&e.excludeFromCopy("html");let s=e;if(null!==r){let t=(0,d.BEs)(e);t=(0,d.kFe)(t)&&null!==r?(0,f.SD)(r,t):t,s=t}const l=(0,d.ff4)(s)?s.getChildren():[],c=t._nodes.get(s.getType());let a;a=c&&void 0!==c.exportDOM?c.exportDOM(t,s):s.exportDOM(t);const{element:u,after:g}=a;if(!u)return!1;const p=document.createDocumentFragment();for(let f=0;f<l.length;f++){const n=l[f],o=h(t,n,p,r);!i&&(0,d.ff4)(e)&&o&&e.extractWithChild(n,r,"html")&&(i=!0)}if(i&&!o){if(((0,d.sby)(u)||(0,d.K8K)(u))&&u.append(p),n.append(u),g){const t=g.call(s,u);t&&((0,d.K8K)(u)?u.replaceChildren(t):u.replaceWith(t))}}else n.append(p);return i}function g(t,e){const n=t.getData("text/plain")||t.getData("text/uri-list");null!=n&&e.insertRawText(n)}new Set(["STYLE","SCRIPT"]);const p="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,_=p&&"documentMode"in document?document.documentMode:null,m=!(!p||!("InputEvent"in window)||_)&&"getTargetRanges"in new window.InputEvent("input"),y=p&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),x=p&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,v=p&&/^(?=.*Chrome).*/i.test(navigator.userAgent),C=p&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!v;function S(t,e){e.update(()=>{if(null!==t){const n=(0,c.xj)(t,KeyboardEvent)?null:t.clipboardData,r=(0,d.vJq)();if(null!==r&&null!=n){t.preventDefault();const i=function(t,e=(0,d.vJq)()){return null==e&&function(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(166),(0,d.I2P)(e)&&e.isCollapsed()||0===e.getNodes().length?"":function(t,e){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=(0,d.NiT)().getChildren();for(let i=0;i<r.length;i++)h(t,r[i],n,e);return n.innerHTML}(t,e)}(e);null!==i&&n.setData("text/html",i),n.setData("text/plain",r.getTextContent())}}})}const b="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function k(t){return t.getEditorState().read((0,l.yl)(t.isComposing()))}function T({contentEditable:t,placeholder:e=null,ErrorBoundary:n}){const[o]=(0,r.DF)(),s=function(t,e){const[n,r]=(0,i.useState)(()=>t.getDecorators());return b(()=>t.registerDecoratorListener(t=>{(0,a.flushSync)(()=>{r(t)})}),[t]),(0,i.useEffect)(()=>{r(t.getDecorators())},[t]),(0,i.useMemo)(()=>{const r=[],o=Object.keys(n);for(let s=0;s<o.length;s++){const l=o[s],c=(0,u.jsx)(e,{onError:e=>t._onError(e),children:(0,u.jsx)(i.Suspense,{fallback:null,children:n[l]})}),d=t.getElementByKey(l);null!==d&&r.push((0,a.createPortal)(c,d,l))}return r},[e,n,t])}(o,n);return b(()=>(0,c.Sd)(function(t){return(0,c.Sd)(t.registerCommand(d.WuB,t=>{const e=(0,d.vJq)();return!!(0,d.I2P)(e)&&(e.deleteCharacter(t),!0)},d.jZM),t.registerCommand(d.hi0,t=>{const e=(0,d.vJq)();return!!(0,d.I2P)(e)&&(e.deleteWord(t),!0)},d.jZM),t.registerCommand(d.viC,t=>{const e=(0,d.vJq)();return!!(0,d.I2P)(e)&&(e.deleteLine(t),!0)},d.jZM),t.registerCommand(d.bM3,t=>{const e=(0,d.vJq)();if(!(0,d.I2P)(e))return!1;if("string"==typeof t)e.insertText(t);else{const n=t.dataTransfer;if(null!=n)g(n,e);else{const n=t.data;n&&e.insertText(n)}}return!0},d.jZM),t.registerCommand(d.$ey,()=>{const t=(0,d.vJq)();return!!(0,d.I2P)(t)&&(t.removeText(),!0)},d.jZM),t.registerCommand(d.FEN,t=>{const e=(0,d.vJq)();return!!(0,d.I2P)(e)&&(e.insertLineBreak(t),!0)},d.jZM),t.registerCommand(d.XKQ,()=>{const t=(0,d.vJq)();return!!(0,d.I2P)(t)&&(t.insertLineBreak(),!0)},d.jZM),t.registerCommand(d.AX0,t=>{const e=(0,d.vJq)();if(!(0,d.I2P)(e))return!1;const n=t,r=n.shiftKey;return!!(0,f.Cb)(e,!0)&&(n.preventDefault(),(0,f.Rk)(e,r,!0),!0)},d.jZM),t.registerCommand(d.JM3,t=>{const e=(0,d.vJq)();if(!(0,d.I2P)(e))return!1;const n=t,r=n.shiftKey;return!!(0,f.Cb)(e,!1)&&(n.preventDefault(),(0,f.Rk)(e,r,!1),!0)},d.jZM),t.registerCommand(d.gCZ,e=>{const n=(0,d.vJq)();return!!(0,d.I2P)(n)&&(!x||"ko-KR"!==navigator.language)&&(e.preventDefault(),t.dispatchCommand(d.WuB,!0))},d.jZM),t.registerCommand(d.w$Z,e=>{const n=(0,d.vJq)();return!!(0,d.I2P)(n)&&(e.preventDefault(),t.dispatchCommand(d.WuB,!1))},d.jZM),t.registerCommand(d.RTo,e=>{const n=(0,d.vJq)();if(!(0,d.I2P)(n))return!1;if(null!==e){if((x||y||C)&&m)return!1;e.preventDefault()}return t.dispatchCommand(d.FEN,!1)},d.jZM),t.registerCommand(d.HYn,()=>((0,d.e1k)(),!0),d.jZM),t.registerCommand(d.u5G,e=>{const n=(0,d.vJq)();return!!(0,d.I2P)(n)&&(S(e,t),!0)},d.jZM),t.registerCommand(d.VSO,e=>{const n=(0,d.vJq)();return!!(0,d.I2P)(n)&&(function(t,e){S(t,e),e.update(()=>{const t=(0,d.vJq)();(0,d.I2P)(t)&&t.removeText()})}(e,t),!0)},d.jZM),t.registerCommand(d.waI,e=>{const n=(0,d.vJq)();return!!(0,d.I2P)(n)&&(function(t,e){t.preventDefault(),e.update(()=>{const e=(0,d.vJq)(),n=(0,c.xj)(t,ClipboardEvent)?t.clipboardData:null;null!=n&&(0,d.I2P)(e)&&g(n,e)},{tag:d.fwY})}(e,t),!0)},d.jZM),t.registerCommand(d.Sr4,t=>{const e=(0,d.vJq)();return!!(0,d.I2P)(e)&&(t.preventDefault(),!0)},d.jZM),t.registerCommand(d.TgX,t=>{const e=(0,d.vJq)();return!!(0,d.I2P)(e)&&(t.preventDefault(),!0)},d.jZM))}(l),function(e){const n=window.location.origin,r=r=>{if(r.origin!==n)return;const i=e.getRootElement();if(document.activeElement!==i)return;const o=r.data;if("string"==typeof o){let n;try{n=JSON.parse(o)}catch(t){return}if(n&&"nuanria_messaging"===n.protocol&&"request"===n.type){const t=n.payload;if(t&&"makeChanges"===t.functionId){const n=t.args;if(n){const[t,i,o,s,l,c]=n;e.update(()=>{const e=(0,d.vJq)();if((0,d.I2P)(e)){const n=e.anchor;let c=n.getNode(),a=0,u=0;if((0,d.kFe)(c)&&t>=0&&i>=0&&(a=t,u=t+i,e.setTextNodeRange(c,a,c,u)),a===u&&""===o||(e.insertRawText(o),c=n.getNode()),(0,d.kFe)(c)){a=s,u=s+l;const t=c.getTextContentSize();a=a>t?t:a,u=u>t?t:u,e.setTextNodeRange(c,a,c,u)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}}(l)),[l=o]),(0,u.jsxs)(u.Fragment,{children:[t,(0,u.jsx)(w,{content:e}),s]});var l}function w({content:t}){const[e]=(0,r.DF)(),n=function(t){const[e,n]=(0,i.useState)(()=>k(t));return b(()=>{function e(){const e=k(t);n(e)}return e(),(0,c.Sd)(t.registerUpdateListener(()=>{e()}),t.registerEditableListener(()=>{e()}))},[t]),e}(e),l=function(t){const[e]=(0,r.DF)(),n=(0,i.useMemo)(()=>t(e),[e,t]),[s,l]=(0,i.useState)(()=>n.initialValueFn()),c=(0,i.useRef)(s);return o(()=>{const{initialValueFn:t,subscribe:e}=n,r=t();return c.current!==r&&(c.current=r,l(r)),e(t=>{c.current=t,l(t)})},[n,t]),s}(s);return n?"function"==typeof t?t(l):t:null}},73105:(t,e,n)=>{n.d(e,{Sd:()=>s,Xq:()=>l,xj:()=>c});var r=n(48832);const i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,o=i&&"documentMode"in document?document.documentMode:null;function s(...t){return()=>{for(let e=t.length-1;e>=0;e--)t[e]();t.length=0}}function l(t,e){const n=new Map,i=t._pendingEditorState;for(const[s,l]of e._nodeMap)n.set(s,(0,r.BEs)(l));i&&(i._nodeMap=n),t._dirtyType=2;const o=e._selection;(0,r.n1P)(null===o?null:o.clone())}function c(t,e){return null!==t&&Object.getPrototypeOf(t).constructor.name===e.name}i&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),i&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!i||!("InputEvent"in window)||o)&&new window.InputEvent("input"),i&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),i&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window,i&&/Android/.test(navigator.userAgent),i&&/^(?=.*Chrome).*/i.test(navigator.userAgent),i&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)},85745:(t,e,n)=>{n.d(e,{yl:()=>i});var r=n(48832);function i(t){return()=>function(t){if(!function(t,e=!0){if(t)return!1;let n=(0,r.NiT)().getTextContent();return e&&(n=n.trim()),""===n}(t,!1))return!1;const e=(0,r.NiT)().getChildren(),n=e.length;if(n>1)return!1;for(let i=0;i<n;i++){const t=e[i];if((0,r.Cyw)(t))return!1;if((0,r.ff4)(t)){if(!(0,r.bSg)(t))return!1;if(0!==t.__indent)return!1;const e=t.getChildren(),n=e.length;for(let t=0;t<n;t++)if(!(0,r.kFe)(e[i]))return!1}}return!0}(t)}},94439:(t,e,n)=>{n.d(e,{DF:()=>s,Gu:()=>i,Mx:()=>o});var r=n(51609);const i=(0,r.createContext)(null);function o(t,e){let n=null;return null!=t&&(n=t[1]),{getTheme:function(){return null!=e?e:null!=n?n.getTheme():null}}}function s(){const t=(0,r.useContext)(i);return null==t&&function(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const i of e)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),t}},95591:(t,e,n)=>{n.d(e,{QP:()=>m});var r=n(94439),i=n(48832),o=n(51609),s=n(73105),l=n(74848);const c="startTransition",a="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,u=a?o.useLayoutEffect:o.useEffect,d=t=>{const e=document.getElementById("typeahead-menu");if(!e)return;const n=e.getBoundingClientRect();n.top+n.height>window.innerHeight&&e.scrollIntoView({block:"center"}),n.top<0&&e.scrollIntoView({block:"center"}),t.scrollIntoView({block:"nearest"})};function f(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top>r.top&&n.top<r.bottom}function h(t,e,n,i){const[s]=(0,r.DF)();(0,o.useEffect)(()=>{if(null!=e&&null!=t){const t=s.getRootElement(),r=null!=t?function(t){let e=getComputedStyle(t);const n="absolute"===e.position,r=/(auto|scroll)/;if("fixed"===e.position)return document.body;for(let i=t;i=i.parentElement;)if(e=getComputedStyle(i),(!n||"static"!==e.position)&&r.test(e.overflow+e.overflowY+e.overflowX))return i;return document.body}(t):document.body;let o=!1,l=f(e,r);const c=function(){o||(window.requestAnimationFrame(function(){n(),o=!1}),o=!0);const t=f(e,r);t!==l&&(l=t,null!=i&&i(t))},a=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",c,{capture:!0,passive:!0}),a.observe(e),()=>{a.unobserve(e),window.removeEventListener("resize",n),document.removeEventListener("scroll",c,!0)}}},[e,s,i,n,t])}const g=(0,i.guI)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function p({close:t,editor:e,anchorElementRef:n,resolution:r,options:l,menuRenderFn:c,onSelectOption:a,shouldSplitNodeWithQuery:f=!1,commandPriority:h=i.AcJ,preselectFirstItem:p=!0}){const[_,m]=(0,o.useState)(null);(0,o.useEffect)(()=>{p&&m(0)},[r.match&&r.match.matchingString,p]);const y=(0,o.useCallback)(n=>{e.update(()=>{const e=null!=r.match&&f?function(t){const e=(0,i.vJq)();if(!(0,i.I2P)(e)||!e.isCollapsed())return null;const n=e.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,s=o-function(t,e,n){let r=n;for(let i=r;i<=e.length;i++)t.slice(-i)===e.substring(0,i)&&(r=i);return r}(r.getTextContent().slice(0,o),t.matchingString,t.replaceableString.length);if(s<0)return null;let l;return 0===s?[l]=r.splitText(o):[,l]=r.splitText(s,o),l}(r.match):null;a(n,e,t,r.match?r.match.matchingString:"")})},[e,f,r.match,a,t]),x=(0,o.useCallback)(t=>{const n=e.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+t),m(t))},[e]);return(0,o.useEffect)(()=>()=>{const t=e.getRootElement();null!==t&&t.removeAttribute("aria-activedescendant")},[e]),u(()=>{null===l?m(null):null===_&&p&&x(0)},[l,_,x,p]),(0,o.useEffect)(()=>(0,s.Sd)(e.registerCommand(g,({option:t})=>!(!t.ref||null==t.ref.current)&&(d(t.ref.current),!0),h)),[e,x,h]),(0,o.useEffect)(()=>(0,s.Sd)(e.registerCommand(i.bbF,t=>{const n=t;if(null!==l&&l.length){const t=null===_?0:_!==l.length-1?_+1:0;x(t);const r=l[t];null!=r.ref&&r.ref.current&&e.dispatchCommand(g,{index:t,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0},h),e.registerCommand(i.UDz,t=>{const e=t;if(null!==l&&l.length){const t=null===_?l.length-1:0!==_?_-1:l.length-1;x(t);const n=l[t];null!=n.ref&&n.ref.current&&d(n.ref.current),e.preventDefault(),e.stopImmediatePropagation()}return!0},h),e.registerCommand(i.Q$N,e=>{const n=e;return n.preventDefault(),n.stopImmediatePropagation(),t(),!0},h),e.registerCommand(i.OXk,t=>{const e=t;return null!==l&&null!==_&&null!=l[_]&&(e.preventDefault(),e.stopImmediatePropagation(),y(l[_]),!0)},h),e.registerCommand(i.RTo,t=>null!==l&&null!==_&&null!=l[_]&&(null!==t&&(t.preventDefault(),t.stopImmediatePropagation()),y(l[_]),!0),h)),[y,t,e,l,_,x,h]),c(n,(0,o.useMemo)(()=>({options:l,selectOptionAndCleanUp:y,selectedIndex:_,setHighlightedIndex:m}),[y,_,l]),r.match?r.match.matchingString:"")}function _(t,e){null!=e&&(t.className=e),t.setAttribute("aria-label","Typeahead menu"),t.setAttribute("role","listbox"),t.style.display="block",t.style.position="absolute"}function m({options:t,onQueryChange:e,onSelectOption:n,onOpen:s,onClose:u,menuRenderFn:d,triggerFn:f,anchorClassName:g,commandPriority:m=i.AcJ,parent:y,preselectFirstItem:x=!0,ignoreEntityBoundary:v=!1}){const[C]=(0,r.DF)(),[S,b]=(0,o.useState)(null),k=function(t,e,n,i=(a?document.body:void 0),s=!0){const[l]=(0,r.DF)(),c=(0,o.useRef)(a?document.createElement("div"):null),u=(0,o.useCallback)(()=>{if(null===c.current||void 0===i)return;c.current.style.top=c.current.style.bottom;const e=l.getRootElement(),r=c.current,o=r.firstChild;if(null!==e&&null!==t){const{left:l,top:a,width:u,height:d}=t.getRect();if(r.style.top=`${a+c.current.offsetHeight+3+(s?window.pageYOffset:0)}px`,r.style.left=`${l+window.pageXOffset}px`,r.style.height=`${d}px`,r.style.width=`${u}px`,null!==o){o.style.top=`${a}`;const t=o.getBoundingClientRect(),n=t.height,i=t.width,c=e.getBoundingClientRect();l+i>c.right&&(r.style.left=`${c.right-i+window.pageXOffset}px`),(a+n>window.innerHeight||a+n>c.bottom)&&a-c.top>n+d&&(r.style.top=`${a-n-d+(s?window.pageYOffset:0)}px`)}r.isConnected||(_(r,n),i.append(r)),r.setAttribute("id","typeahead-menu"),c.current=r,e.setAttribute("aria-controls","typeahead-menu")}},[l,t,s,n,i]);(0,o.useEffect)(()=>{const e=l.getRootElement();return null!==t&&u(),()=>{null!==e&&e.removeAttribute("aria-controls");const t=c.current;null!==t&&t.isConnected&&(t.remove(),t.removeAttribute("id"))}},[l,u,t]);const d=(0,o.useCallback)(n=>{null!==t&&(n||e(null))},[t,e]);h(t,c.current,u,d);const f=c.current;return null!=f&&(_(f,n),null!=i&&i.append(f)),c}(S,b,g,y),T=(0,o.useCallback)(()=>{b(null),null!=u&&null!==S&&u()},[u,S]),w=(0,o.useCallback)(t=>{b(t),null!=s&&null===S&&s(t)},[s,S]);return(0,o.useEffect)(()=>{const t=C.registerUpdateListener(()=>{C.getEditorState().read(()=>{if(!C.isEditable())return void T();const t=C._window||window,n=t.document.createRange(),r=(0,i.vJq)(),s=function(t){let e=null;return t.getEditorState().read(()=>{const t=(0,i.vJq)();(0,i.I2P)(t)&&(e=function(t){const e=t.anchor;if("text"!==e.type)return null;const n=e.getNode();if(!n.isSimpleText())return null;const r=e.offset;return n.getTextContent().slice(0,r)}(t))}),e}(C);if(!(0,i.I2P)(r)||!r.isCollapsed()||null===s||null===n)return void T();const l=f(s,C);if(e(l?l.matchingString:null),null!==l&&(v||!function(t,e){return 0===e&&t.getEditorState().read(()=>{const t=(0,i.vJq)();if((0,i.I2P)(t)){const e=t.anchor.getNode().getPreviousSibling();return(0,i.kFe)(e)&&e.isTextEntity()}return!1})}(C,l.leadOffset))){const e=function(t,e,n){const r=(0,i.peL)(n);if(null===r||!r.isCollapsed)return!1;const o=r.anchorNode,s=t,l=r.anchorOffset;if(null==o||null==l)return!1;try{e.setStart(o,s),e.setEnd(o,l)}catch(t){return!1}return!0}(l.leadOffset,n,t);if(null!==e)return a=()=>w({getRect:()=>n.getBoundingClientRect(),match:l}),void(c in o?o[c](a):a())}var a;T()})});return()=>{t()}},[C,f,e,S,T,w,v]),(0,o.useEffect)(()=>C.registerEditableListener(t=>{t||T()}),[C,T]),null===S||null===C||null===k.current?null:(0,l.jsx)(p,{close:T,resolution:S,editor:C,anchorElementRef:k,options:t,menuRenderFn:d,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:m,preselectFirstItem:x})}(0,i.guI)("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND")}}]);