(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,714751,974725,410911,501522,397910,800569,704338,35500,20207,e=>{"use strict";let t,n,i;var r=e.i(605913),o=e.i(592121),l=e.i(699173),s=e.i(827669),s=s,a=e.i(973776),d=e.i(703057),u=d;let c=new Map;function f(e){let t={};if(!e)return t;for(let n of e.split(";"))if(""!==n){let[e,i]=n.split(/:([^]+)/);e&&i&&(t[e.trim()]=i.trim())}return t}function g(e){let t=c.get(e);return void 0===t&&(t=f(e),c.set(e,t)),t}function h(e){let t=(0,d.$getEditor)().getElementByKey(e.getKey());if(null===t)return null;let n=t.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(t)}function p(e){return h((0,d.$isRootNode)(e)?e:e.getParentOrThrow())}function m(e){let t=p(e);return null!==t&&"rtl"===t.direction}function N(e,t,n="self"){let i=e.getStartEndPoints();if(t.isSelected(e)&&!(0,d.$isTokenOrSegmented)(t)&&null!==i){let[r,o]=i,l=e.isBackward(),s=r.getNode(),a=o.getNode(),u=t.is(s),c=t.is(a);if(u||c){let[i,r]=(0,d.$getCharacterOffsets)(e),o=s.is(a),u=t.is(l?a:s),c=t.is(l?s:a),f,g=0;o?(g=i>r?r:i,f=i>r?i:r):u?(g=l?r:i,f=void 0):c&&(g=0,f=l?i:r);let h=t.__text.slice(g,f);h!==t.__text&&("clone"===n&&(t=(0,d.$cloneWithPropertiesEphemeral)(t)),t.__text=h)}}return t}function C(e){let t=e.getStyle(),n=f(t);c.set(t,n)}function _(e,t){let n=e.getFormatType(),i=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),i!==t.getIndent()&&t.setIndent(i)}function S(e){let t=E(e);return null!==t&&"vertical-rl"===t.writingMode}function E(e){let t=e.anchor.getNode();return(0,d.$isElementNode)(t)?h(t):p(t)}function x(e,t){let n=S(e)?!t:t;T(e)&&(n=!n);let i=(0,d.$caretFromPoint)(e.focus,n?"previous":"next");if((0,d.$isExtendableTextPointCaret)(i))return!1;for(let e of(0,d.$extendCaretToRange)(i)){if((0,d.$isChildCaret)(e))return!e.origin.isInline();if(!(0,d.$isElementNode)(e.origin)){if((0,d.$isDecoratorNode)(e.origin))return!0;break}}return!1}function T(e){let t=E(e);return null!==t&&"rtl"===t.direction}function y(e,t,n){let i,r=T(e);i=S(e)||r?!n:n,e.modify(t?"extend":"move",i,"character")}function O(e,...t){let n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let n of(i.append("code",e),t))i.append("v",n);throw n.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}e.s(["$addNodeStyle",0,C,"$forEachSelectedTextNode",0,function(e){let t=(0,d.$getSelection)();if(!t)return;let n=new Map,i=e=>n.get(e.getKey())||[0,e.getTextContentSize()];if((0,d.$isRangeSelection)(t))for(let e of(0,d.$caretRangeFromSelection)(t).getTextSlices())e&&n.set(e.caret.origin.getKey(),e.getSliceIndices());for(let n of t.getNodes()){if(!(0,d.$isTextNode)(n)||!n.canHaveFormat())continue;let[t,r]=i(n);r!==t&&e((0,d.$isTokenOrSegmented)(n)||0===t&&r===n.getTextContentSize()?n:n.splitText(t,r)[+(0!==t)])}(0,d.$isRangeSelection)(t)&&"text"===t.anchor.type&&"text"===t.focus.type&&t.anchor.key===t.focus.key&&function(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:i,offset:r,type:o}=t;t.set(n.key,n.offset,n.type),n.set(i,r,o)}}(t)},"$isAtNodeEnd",0,function(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return(0,d.$isElementNode)(t)||function(...e){let t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;for(let t of(n.append("code",177),e))n.append("v",t);throw t.search=n.toString(),Error(`Minified Lexical error #177; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(),e.offset===t.getChildrenSize()},"$isParentRTL",0,m,"$moveCharacter",0,y,"$setBlocksType",0,function(e,t,n=_){if(null===e)return;let i=e.getStartEndPoints(),r=new Map,o=null;if(i){let[e,t]=i;(o=(0,d.$createRangeSelection)()).anchor.set(e.key,e.offset,e.type),o.focus.set(t.key,t.offset,t.type);let n=(0,d.$findMatchingParent)(e.getNode(),d.INTERNAL_$isBlock),l=(0,d.$findMatchingParent)(t.getNode(),d.INTERNAL_$isBlock);(0,d.$isElementNode)(n)&&r.set(n.getKey(),n),(0,d.$isElementNode)(l)&&r.set(l.getKey(),l)}for(let t of e.getNodes())if((0,d.$isElementNode)(t)&&(0,d.INTERNAL_$isBlock)(t))r.set(t.getKey(),t);else if(null===i){let e=(0,d.$findMatchingParent)(t,d.INTERNAL_$isBlock);(0,d.$isElementNode)(e)&&r.set(e.getKey(),e)}for(let[e,i]of r){let r=t();n(i,r),i.replace(r,!0),o&&(e===o.anchor.key&&o.anchor.set(r.getKey(),o.anchor.offset,o.anchor.type),e===o.focus.key&&o.focus.set(r.getKey(),o.focus.offset,o.focus.type))}o&&e.is((0,d.$getSelection)())&&(0,d.$setSelection)(o)},"$shouldOverrideDefaultCharacterSelection",0,x,"$sliceSelectedTextNodeContent",0,N,"createRectsFromDOMRange",0,function(e,t){let n=e.getRootElement();if(null===n)return[];let i=n.getBoundingClientRect(),r=getComputedStyle(n),o=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),l=Array.from(t.getClientRects()),s,a=l.length;l.sort((e,t)=>{let n=e.top-t.top;return 3>=Math.abs(n)?e.left-t.left:n});for(let e=0;et.top&&s.left+s.width>t.left,r=t.width+o===i.width;n||r?(l.splice(e--,1),a--):s=t}return l},"getStyleObjectFromCSS",0,g],974725);let R="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,v=R&&"documentMode"in document?document.documentMode:null,$=(R&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),R&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent));function M(e,t){var n,i,r;let o,l,s,a,u,c;return n="next",i=e,r=t,o=(0,d.$getRoot)(),l=i||o,s=(0,d.$isElementNode)(l)?(0,d.$getChildCaret)(l,n):(0,d.$getSiblingCaret)(l,n),a=function(e){let t=-1;for(let n=e;null!==n;n=n.getParent())t++;return t}(l),u=r?(0,d.$getAdjacentChildCaret)((0,d.$getChildCaretOrSelf)((0,d.$getSiblingCaret)(r,n)))||D(r,n):D(l,n),c=a,(0,d.makeStepwiseIterator)({hasNext:e=>null!==e,initial:s,map:e=>({depth:c,node:e.origin}),step:e=>{if(e.isSameNodeCaret(u))return null;(0,d.$isChildCaret)(e)&&c++;let t=(0,d.$getAdjacentSiblingOrParentSiblingCaret)(e);return!t||t[0].isSameNodeCaret(u)?null:(c+=t[1],t[0])}})}function D(e,t){let n=(0,d.$getAdjacentSiblingOrParentSiblingCaret)((0,d.$getSiblingCaret)(e,t));return n&&n[0]}function I(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function b(e){let t=(0,d.$findMatchingParent)(e,e=>(0,d.$isElementNode)(e)&&!e.isInline());return(0,d.$isElementNode)(t)||O(4,e.__key),t}function A(e,t,n){let i=(0,d.$getCaretInDirection)(t,"next");for(let e=i;e;e=(0,d.$splitAtPointCaretNext)(e,n))i=e;return(0,d.$isTextPointCaret)(i)&&O(283),i.insert(e.isInline()?(0,d.$createParagraphNode)().append(e):e),(0,d.$getCaretInDirection)((0,d.$getSiblingCaret)(e.getLatest(),"next"),t.direction)}function w(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function P(e){let t=(0,d.$getSelection)();if(!(0,d.$isRangeSelection)(t))return!1;let n=new Set,i=t.getNodes();for(let t=0;t(0,d.$isElementNode)(e)&&!e.isInline());if(null===l)continue;let s=l.getKey();l.canIndent()&&!n.has(s)&&(n.add(s),e(l))}return n.size>0}R&&"InputEvent"in window&&!v&&new window.InputEvent("input"),R&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),R&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,R&&/Android/.test(navigator.userAgent),R&&/^(?=.*Chrome).*/i.test(navigator.userAgent),R&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);let L=!($||!R)&&void 0;function k(e,t=!1){let n=1;if(function(){if(void 0===L){let e=document.createElement("div");e.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(e);let t=e.getBoundingClientRect();e.style.setProperty("zoom","2"),L=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return L}()||t)for(;e;)n*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return n}function F(e){var t;return t=(0,d.$getChildCaret)(e,"previous"),(0,d.makeStepwiseIterator)({hasNext:d.$isSiblingCaret,initial:t.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}e.s(["$descendantsMatching",0,function(e,t){let n=[],i=Array.from(e).reverse();for(let e=i.pop();void 0!==e;e=i.pop())if(t(e))n.push(e);else if((0,d.$isElementNode)(e))for(let t of F(e))i.push(t);return n},"$dfs",0,function(e,t){return Array.from(M(e,t))},"$dfsIterator",0,M,"$getNearestBlockElementAncestorOrThrow",0,b,"$getNearestNodeOfType",0,I,"$handleIndentAndOutdent",0,P,"$insertFirst",0,function(e,t){(0,d.$getChildCaret)(e,"next").insert(t)},"$insertNodeToNearestRoot",0,function(e){let t,n=(0,d.$getSelection)()||(0,d.$getPreviousSelection)();if((0,d.$isRangeSelection)(n))t=(0,d.$caretFromPoint)(n.focus,"next");else{if(null!=n){let e=n.getNodes(),i=e[e.length-1];i&&(t=(0,d.$getSiblingCaret)(i,"next"))}t=t||(0,d.$getChildCaret)((0,d.$getRoot)(),"previous").getFlipped().insert((0,d.$createParagraphNode)())}let i=A(e,t),r=(0,d.$getAdjacentChildCaret)(i),o=(0,d.$isChildCaret)(r)?(0,d.$normalizeCaret)(r):i;return(0,d.$setSelectionFromCaretRange)((0,d.$getCollapsedCaretRange)(o)),e.getLatest()},"$insertNodeToNearestRootAtCaret",0,A,"$unwrapAndFilterDescendants",0,function(e,t){return function e(t,n,i){let r=!1;for(let o of F(t))n(o)?null!==i&&i(o):(r=!0,(0,d.$isElementNode)(o)&&e(o,n,i||(e=>o.insertAfter(e))),o.remove());return r}(e,t,null)},"$wrapNodeInElement",0,function(e,t){let n=t();return e.replace(n),n.append(e),n},"calculateZoomLevel",0,k,"objectKlassEquals",0,w],410911);let B=Symbol.for("preact-signals");function K(){if(z>1)return void z--;let e,t=!1;for(;void 0!==n;){let i=n;for(n=void 0,j++;void 0!==i;){let n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&X(i))try{i.c()}catch(n){t||(e=n,t=!0)}i=n}}if(j=0,z--,t)throw e}function Y(e){if(z>0)return e();z++;try{return e()}finally{K()}}function W(e){let n=t;t=void 0;try{return e()}finally{t=n}}let z=0,j=0,U=0;function H(e){if(void 0===t)return;let n=e.n;return void 0===n||n.t!==t?(n={i:0,S:e,p:t.s,n:void 0,t:t,e:void 0,x:void 0,r:n},void 0!==t.s&&(t.s.n=n),t.s=n,e.n=n,32&t.f&&e.S(n),n):-1===n.i?(n.i=0,void 0!==n.n&&(n.n.p=n.p,void 0!==n.p&&(n.p.n=n.n),n.p=t.s,n.n=void 0,t.s.n=n,t.s=n),n):void 0}function V(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function J(e,t){return new V(e,t)}function X(e){for(let t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function q(e){for(let t=e.s;void 0!==t;t=t.n){let n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function G(e){let t,n=e.s;for(;void 0!==n;){let e=n.p;-1===n.i?(n.S.U(n),void 0!==e&&(e.n=n.n),void 0!==n.n&&(n.n.p=e)):t=n,n.S.n=n.r,void 0!==n.r&&(n.r=void 0),n=e}e.s=t}function Q(e,t){V.call(this,void 0),this.x=e,this.s=void 0,this.g=U-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function Z(e){let n=e.u;if(e.u=void 0,"function"==typeof n){z++;let i=t;t=void 0;try{n()}catch(t){throw e.f&=-2,e.f|=8,ee(e),t}finally{t=i,K()}}}function ee(e){for(let t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Z(e)}function et(e){if(t!==this)throw Error("Out-of-order effect");G(this),t=e,this.f&=-2,8&this.f&&ee(this),K()}function en(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==t?void 0:t.name}function ei(e,t){let n=new en(e,t);try{n.c()}catch(e){throw n.d(),e}let i=n.d.bind(n);return i[Symbol.dispose]=i,i}function er(e,t={}){let n={};for(let i in e){let r=t[i],o=J(void 0===r?e[i]:r);n[i]=o}return n}function eo(){let e=(0,u.$getRoot)(),t=(0,u.$getSelection)(),n=(0,u.$createParagraphNode)();e.clear(),e.append(n),null!==t&&n.select(),(0,u.$isRangeSelection)(t)&&(t.format=0)}V.prototype.brand=B,V.prototype.h=function(){return!0},V.prototype.S=function(e){let t=this.t;t!==e&&void 0===e.e&&(e.x=t,this.t=e,void 0!==t?t.e=e:W(()=>{var e;null==(e=this.W)||e.call(this)}))},V.prototype.U=function(e){if(void 0!==this.t){let t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,void 0===n&&W(()=>{var e;null==(e=this.Z)||e.call(this)}))}},V.prototype.subscribe=function(e){return ei(()=>{let n=this.value,i=t;t=void 0;try{e(n)}finally{t=i}},{name:"sub"})},V.prototype.valueOf=function(){return this.value},V.prototype.toString=function(){return this.value+""},V.prototype.toJSON=function(){return this.value},V.prototype.peek=function(){let e=t;t=void 0;try{return this.value}finally{t=e}},Object.defineProperty(V.prototype,"value",{get(){let e=H(this);return void 0!==e&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(j>100)throw Error("Cycle detected");this.v=e,this.i++,U++,z++;try{for(let e=this.t;void 0!==e;e=e.x)e.t.N()}finally{K()}}}}),Q.prototype=new V,Q.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f)||(this.f&=-5,this.g===U))return!0;if(this.g=U,this.f|=1,this.i>0&&!X(this))return this.f&=-2,!0;let e=t;try{q(this),t=this;let e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return t=e,G(this),this.f&=-2,!0},Q.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(let e=this.s;void 0!==e;e=e.n)e.S.S(e)}V.prototype.S.call(this,e)},Q.prototype.U=function(e){if(void 0!==this.t&&(V.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(let e=this.s;void 0!==e;e=e.n)e.S.U(e)}},Q.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(Q.prototype,"value",{get(){if(1&this.f)throw Error("Cycle detected");let e=H(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),en.prototype.c=function(){let e=this.S();try{if(8&this.f||void 0===this.x)return;let e=this.x();"function"==typeof e&&(this.u=e)}finally{e()}},en.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,Z(this),q(this),z++;let e=t;return t=this,et.bind(this,e)},en.prototype.N=function(){2&this.f||(this.f|=2,this.o=n,n=this)},en.prototype.d=function(){this.f|=8,1&this.f||ee(this)},en.prototype.dispose=function(){this.d()},(0,u.defineExtension)({build:(e,t,n)=>er(t),config:(0,u.safeCast)({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(e,t,n){let i=n.getOutput();return ei(()=>i.disabled.value?void 0:e.registerRootListener(t=>{e.focus(()=>{let e=document.activeElement;null===t||null!==e&&t.contains(e)||t.focus({preventScroll:!0})},{defaultSelection:i.defaultSelection.peek()})}))}}),(0,u.defineExtension)({build:(e,t,n)=>er(t),config:(0,u.safeCast)({$onClear:eo}),name:"@lexical/extension/ClearEditor",register(e,t,n){let{$onClear:i}=n.getOutput();return ei(()=>(function(e,t=eo){return e.registerCommand(u.CLEAR_EDITOR_COMMAND,n=>(e.update(t),!0),u.COMMAND_PRIORITY_EDITOR)})(e,i.value))}});let el=(0,u.createState)("format",{parse:e=>"number"==typeof e?e:0});class es extends u.DecoratorNode{$config(){return this.config("decorator-text",{extends:u.DecoratorNode,stateConfigs:[{flat:!0,stateConfig:el}]})}getFormat(){return(0,u.$getState)(this,el)}getFormatFlags(e,t){return(0,u.toggleTextFormatType)(this.getFormat(),e,t)}hasFormat(e){let t=u.TEXT_TYPE_TO_FORMAT[e];return 0!=(this.getFormat()&t)}setFormat(e){return(0,u.$setState)(this,el,e)}toggleFormat(e){let t=this.getFormat(),n=(0,u.toggleTextFormatType)(t,e,null);return this.setFormat(n)}isInline(){return!0}createDOM(){return document.createElement("span")}updateDOM(){return!1}}function ea(e,t){let n;return J(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}(0,u.defineExtension)({name:"@lexical/extension/DecoratorText",nodes:()=>[es],register:(e,t,n)=>e.registerCommand(u.FORMAT_TEXT_COMMAND,e=>{let t=(0,u.$getSelection)();if((0,u.$isNodeSelection)(t)||(0,u.$isRangeSelection)(t))for(let n of t.getNodes())n instanceof es&&n.toggleFormat(e);return!1},u.COMMAND_PRIORITY_LOW)});let ed=(0,u.defineExtension)({build:e=>ea(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:"@lexical/extension/EditorState"});function eu(e,...t){let n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let n of(i.append("code",e),t))i.append("v",n);throw n.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let ec=new Set;class ef{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):u.shallowMergeConfig;for(let n of this.configs)e=t(e,n);return e}init(e){let t,n=this.state;2===n.id||eu(306,String(n.id));let i={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...i,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},o=Object.assign(n,{config:this.mergeConfigs(),id:3,registerState:i});this.state=o,this.extension.init&&(t=this.extension.init(e,o.config,i)),this.state=Object.assign(o,{id:4,initResult:t,registerState:r})}build(e){let t,n=this.state;4!==n.id&&eu(307,String(n.id),String(5)),this.extension.build&&(t=this.extension.build(e,n.config,n.registerState));let i={...n.registerState,getOutput:()=>t,getSignal:this.getSignal.bind(this)};this.state=Object.assign(n,{id:5,output:t,registerState:i})}register(e,t){this._signal=t;let n=this.state;5!==n.id&&eu(308,String(n.id),String(5));let i=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=Object.assign(n,{id:6}),()=>{let e=this.state;7!==e.id&&eu(309,String(n.id),String(7)),this.state=Object.assign(e,{id:5}),i&&i()}}afterRegistration(e){let t,n=this.state;return 6!==n.id&&eu(310,String(n.id),String(6)),this.extension.afterRegistration&&(t=this.extension.afterRegistration(e,n.config,n.registerState)),this.state=Object.assign(n,{id:7}),t}getSignal(){return void 0===this._signal&&eu(311),this._signal}getInitResult(){void 0===this.extension.init&&eu(312,this.extension.name);let e=this.state;return e.id>=4||eu(313,String(e.id),String(4)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return e.id>=3||eu(314,String(e.id),String(3)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return void 0===t&&eu(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return void 0===t&&eu(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return e.id>=7||eu(316,String(e.id),String(7)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||ec}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;e.id>=5||eu(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}}let eg={tag:u.HISTORY_MERGE_TAG};function eh(){let e=(0,u.$getRoot)();e.isEmpty()&&e.append((0,u.$createParagraphNode)())}let ep=(0,u.defineExtension)({config:(0,u.safeCast)({setOptions:eg,updateOptions:eg}),init:({$initialEditorState:e=eh})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},i){let r=i.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:i}=r;if((0,u.$isEditorState)(i))e.setEditorState(i,n);else if("function"==typeof i)e.update(()=>{i(e)},t);else if(i&&("string"==typeof i||"object"==typeof i)){let t=e.parseEditorState(i);e.setEditorState(t,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[u.RootNode,u.TextNode,u.LineBreakNode,u.TabNode,u.ParagraphNode]}),em=Symbol.for("@lexical/extension/LexicalBuilder");function eN(){}function eC(e){throw e}function e_(e){return Array.isArray(e)?e:[e]}let eS="0.41.0+prod.esm";class eE{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){for(const t of(this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=eS,this.roots=e,e))this.addExtension(t)}static fromExtensions(e){let t=[e_(ep)];for(let n of e)t.push(e_(n));return new eE(t)}static maybeFromEditor(e){let t=e[em];return t&&(t.PACKAGE_VERSION!==eS&&eu(292,t.PACKAGE_VERSION,eS),t instanceof eE||eu(293)),t}static fromEditor(e){let t=eE.maybeFromEditor(e);return void 0===t&&eu(294),t}constructEditor(){let{$initialEditorState:e,onError:t,...n}=this.buildCreateEditorArgs(),i=Object.assign((0,u.createEditor)({...n,...t?{onError:e=>{t(e,i)}}:{}}),{[em]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=eN;function t(){try{e()}finally{e=eN}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=(0,u.mergeRegister)(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&eu(295,e.name),t}addEdge(e,t,n){let i=this.outgoingConfigEdges.get(e);i?i.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let r=this.incomingEdges.get(t);r?r.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){void 0!==this._sortedExtensionReps&&eu(296);let[t]=e_(e);"string"!=typeof t.name&&eu(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(void 0!==n&&n.extension!==t&&eu(298,t.name),!n){n=new ef(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);for(let n of("string"==typeof e&&eu(299,t.name,e),t.conflictsWith||[]))this.extensionNameMap.has(n)&&eu(299,t.name,n),this.conflicts.set(n,t.name);for(let e of t.dependencies||[]){let n=e_(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,i)=>{var r,o;let l=n.state;if(2===l.id)return;let s=n.extension.name;0===l.id||eu(300,s,i||"[unknown]"),0===(r=l).id||eu(304,String(r.id),String(0)),n.state=l=Object.assign(r,{id:1});let a=this.outgoingConfigEdges.get(s);if(a)for(let e of a.keys()){let n=this.extensionNameMap.get(e);n&&t(n,s)}1===(o=l).id||eu(305,String(o.id),String(1)),n.state=l=Object.assign(o,{id:2}),e.push(n)};for(let e of this.extensionNameMap.values())0===e.state.id&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);for(let i of(void 0===n&&eu(301,e.name),t))n.configs.add(i)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,i=[()=>n.abort()],r=n.signal;for(let n of t){let t=n.register(e,r);t&&i.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&i.push(t)}return(0,u.mergeRegister)(...i)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,i=new Map,r={},o={},l=this.sortedExtensionReps();for(let s of l){let{extension:l}=s;if(void 0!==l.onError&&(e.onError=l.onError),void 0!==l.disableEvents&&(e.disableEvents=l.disableEvents),void 0!==l.parentEditor&&(e.parentEditor=l.parentEditor),void 0!==l.editable&&(e.editable=l.editable),void 0!==l.namespace&&(e.namespace=l.namespace),void 0!==l.$initialEditorState&&(e.$initialEditorState=l.$initialEditorState),l.nodes){for(let e of("function"==typeof l.nodes?l.nodes():l.nodes)||[]){if("function"!=typeof e){let t=n.get(e.replace);t&&eu(302,l.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}}if(l.html){if(l.html.export)for(let[e,t]of l.html.export.entries())i.set(e,t);l.html.import&&Object.assign(r,l.html.import)}l.theme&&function e(t,n){if(t&&n&&!Array.isArray(n)&&"object"==typeof t&&"object"==typeof n){for(let i in n)t[i]=e(t[i],n[i]);return t}return n}(o,l.theme)}Object.keys(o).length>0&&(e.theme=o),t.size&&(e.nodes=[...t]);let s=Object.keys(r).length>0,a=i.size>0;for(let t of((s||a)&&(e.html={},s&&(e.html.import=r),a&&(e.html.export=i)),l))t.init(e);return e.onError||(e.onError=eC),e}}let ex=new Set,eT=(0,u.defineExtension)({build(e,t,n){let i=n.getDependency(ed).output,r=J({watchedNodeKeys:new Map}),o=ea(()=>{},()=>ei(()=>{let e=o.peek(),{watchedNodeKeys:t}=r.value,n,l=!1;i.value.read(()=>{if((0,u.$getSelection)())for(let[i,r]of t.entries()){if(0===r.size){t.delete(i);continue}let o=(0,u.$getNodeByKey)(i),s=o&&o.isSelected()||!1;l=l||s!==(!!e&&e.has(i)),s&&(n=n||new Set).add(i)}}),!l&&n&&e&&n.size===e.size||(o.value=n)}));return{watchNodeKey:function(e){let t=new Q(()=>(o.value||ex).has(e),void 0),{watchedNodeKeys:n}=r.peek(),i=n.get(e),l=void 0!==i;return(i=i||new Set).add(t),l||(n.set(e,i),r.value={watchedNodeKeys:n}),t}}},dependencies:[ed],name:"@lexical/extension/NodeSelection"});(0,u.createCommand)("INSERT_HORIZONTAL_RULE_COMMAND");class ey extends u.DecoratorNode{static getType(){return"horizontalrule"}static clone(e){return new ey(e.__key)}static importJSON(e){return eR().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:eO,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){let t=document.createElement("hr");return(0,u.addClassNamesToElement)(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}}function eO(){return{node:eR()}}function eR(){return(0,u.$create)(ey)}function ev(e){return e.canBeEmpty()}function e$(e,t,n=ev){return(0,u.mergeRegister)(e.registerCommand(u.KEY_TAB_COMMAND,t=>{let n=(0,u.$getSelection)();if(!(0,u.$isRangeSelection)(n))return!1;t.preventDefault();let i=!function(e){if(e.getNodes().filter(e=>(0,u.$isBlockElementNode)(e)&&e.canIndent()).length>0)return!0;let t=e.anchor,n=e.focus,i=n.isBefore(t)?n:t,r=b(i.getNode());if(r.canIndent()){let e=r.getKey(),t=(0,u.$createRangeSelection)();if(t.anchor.set(e,0,"element"),t.focus.set(e,0,"element"),(t=(0,u.$normalizeSelection__EXPERIMENTAL)(t)).anchor.is(i))return!0}return!1}(n)?u.INSERT_TAB_COMMAND:t.shiftKey?u.OUTDENT_CONTENT_COMMAND:u.INDENT_CONTENT_COMMAND;return e.dispatchCommand(i,void 0)},u.COMMAND_PRIORITY_EDITOR),e.registerCommand(u.INDENT_CONTENT_COMMAND,()=>{let e="number"==typeof t?t:t?t.peek():null,i=(0,u.$getSelection)();if(!(0,u.$isRangeSelection)(i))return!1;let r="function"==typeof n?n:n.peek();return P(t=>{if(r(t)){let n=t.getIndent()+1;(!e||n[ey],register(e,t,n){let{watchNodeKey:i}=n.getDependency(eT).output,r=J({nodeSelections:new Map}),o=e._config.theme.hrSelected??"selected";return(0,u.mergeRegister)(e.registerCommand(u.CLICK_COMMAND,e=>{if((0,u.isDOMNode)(e.target)){let t=(0,u.$getNodeFromDOMNode)(e.target);if(t instanceof ey)return function(e,t=!1){let n,i=(0,u.$getSelection)(),r=e.isSelected(),o=e.getKey();t&&(0,u.$isNodeSelection)(i)?n=i:(n=(0,u.$createNodeSelection)(),(0,u.$setSelection)(n)),r?n.delete(o):n.add(o)}(t,e.shiftKey),!0}return!1},u.COMMAND_PRIORITY_LOW),e.registerMutationListener(ey,(t,n)=>{Y(()=>{let n=!1,{nodeSelections:o}=r.peek();for(let[r,l]of t.entries())if("destroyed"===l)o.delete(r),n=!0;else{let t=o.get(r),l=e.getElementByKey(r);t?t.domNode.value=l:(n=!0,o.set(r,{domNode:J(l),selectedSignal:i(r)}))}n&&(r.value={nodeSelections:o})})}),ei(()=>{let e=[];for(let{domNode:t,selectedSignal:n}of r.value.nodeSelections.values())e.push(ei(()=>{let e=t.value;e&&(n.value?(0,u.addClassNamesToElement)(e,o):(0,u.removeClassNamesFromElement)(e,o))}));return(0,u.mergeRegister)(...e)}))}}),(0,u.defineExtension)({build:(e,t,n)=>er(t),config:(0,u.safeCast)({$canIndent:ev,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(e,t,n){let{disabled:i,maxIndent:r,$canIndent:o}=n.getOutput();return ei(()=>{if(!i.value)return e$(e,r,o)})}}),e.s(["LexicalBuilder",0,eE,"batch",0,Y,"effect",0,ei,"getPeerDependencyFromEditor",0,function(e,t){let n=eE.fromEditor(e).extensionNameMap.get(t);return n?n.getExtensionDependency():void 0},"namedSignals",0,er,"registerTabIndentation",0,e$,"signal",0,J],501522);var eM=d;function eD(e,...t){let n=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;for(let n of(i.append("code",e),t))i.append("v",n);throw n.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function eI(e){let t=1,n=e.getParent();for(;null!=n;){if(eU(n)){let e=n.getParent();if(eQ(e)){t++,n=e.getParent();continue}eD(40)}break}return t}function eb(e){let t=e.getParent();eQ(t)||eD(40);let n=t;for(;null!==n;)eQ(n=n.getParent())&&(t=n);return t}function eA(e){return eU(e)&&eQ(e.getFirstChild())}function ew(e){return ej().append(e)}function eP(e,t){return eU(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function eL(e){let t=(0,eM.$getSelection)();if(null!==t){let n=t.getNodes();if((0,eM.$isRangeSelection)(t)){let i=t.getStartEndPoints();null===i&&eD(143);let[r]=i,o=r.getNode(),l=o.getParent();if((0,eM.$isRootOrShadowRoot)(o)){let e=o.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=(0,eM.$createParagraphNode)();o.append(e),n=e.select().getNodes()}}else if(eP(o,n)){let t=eG(e);if((0,eM.$isRootOrShadowRoot)(l)){o.replace(t);let e=ej();(0,eM.$isElementNode)(o)&&(e.setFormat(o.getFormatType()),e.setIndent(o.getIndent())),t.append(e)}else if(eU(o)){let e=o.getParentOrThrow();ek(t,e.getChildren()),e.replace(t)}return}}let i=new Set;for(let t=0;t0&&e.append(...r),t.remove()}function eK(e){let t="check"!==e.getListType(),n=e.getStart();for(let i of e.getChildren())eU(i)&&(i.getValue()!==n&&i.setValue(n),t&&null!=i.getLatest().__checked&&i.setChecked(void 0),eQ(i.getFirstChild())||n++)}class eY extends eM.ElementNode{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(null==e.__checked)return;let t=e.getParent();eQ(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)},extends:eM.ElementNode,importDOM:(0,eM.buildImportMap)({li:()=>({conversion:eW,priority:0})})})}constructor(e=1,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){let i;!eQ(i=this.getParent())||"check"!==i.getListType()||eQ(this.getFirstChild())?(t.removeAttribute("role"),t.removeAttribute("tabIndex"),t.removeAttribute("aria-checked")):(t.setAttribute("role","checkbox"),t.setAttribute("tabIndex","-1"),e&&this.__checked===e.__checked||t.setAttribute("aria-checked",this.getChecked()?"true":"false")),t.value=this.__value,function(e,t,n){let i,r=[],o=[],l=t.list,s=l?l.listitem:void 0;if(l&&l.nested&&(i=l.nested.listitem),void 0!==s&&r.push(...(0,eM.normalizeClassNames)(s)),l){let e=n.getParent(),t=eQ(e)&&"check"===e.getListType(),i=n.getChecked();t&&!i||o.push(l.listitemUnchecked),t&&i||o.push(l.listitemChecked),t&&r.push(i?l.listitemChecked:l.listitemUnchecked)}if(void 0!==i){let e=(0,eM.normalizeClassNames)(i);n.getChildren().some(e=>eQ(e))?r.push(...e):o.push(...e)}o.length>0&&(0,eM.removeClassNamesFromElement)(e,...o),r.length>0&&(0,eM.addClassNamesToElement)(e,...r)}(t,n.theme,this);let r=e?e.__style:"",o=this.__style;r!==o&&(""===o?t.removeAttribute("style"):t.style.cssText=o),function(e,t,n){let i=g(t.__textStyle);for(let t in i)e.style.setProperty(`--listitem-marker-${t}`,i[t]);if(n)for(let t in g(n.__textStyle))t in i||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){return this.updateListItemDOM(e,t,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let i=this.getDirection();return i&&(t.dir=i),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t{e.append(t)})),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(eQ(n)||eD(39),eU(e))return super.insertAfter(e,t);let i=this.getNextSiblings();if(n.insertAfter(e,t),0!==i.length){let r=eG(n.getListType());i.forEach(e=>r.append(e)),e.insertAfter(r,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&eA(t)&&eA(n)&&(eB(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){let n=ej().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){let t=(0,eM.$createParagraphNode)();this.getChildren().forEach(e=>t.append(e));let n=this.getParentOrThrow(),i=n.getParentOrThrow(),r=eU(i);if(1===n.getChildrenSize())if(r)n.remove(),i.select();else{n.insertBefore(t),n.remove();let i=e.anchor,r=e.focus,o=t.getKey();"element"===i.type&&i.getNode().is(this)&&i.set(o,i.offset,"element"),"element"===r.type&&r.getNode().is(this)&&r.set(o,r.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e,t=this.getLatest(),n=this.getParent();return eQ(n)&&(e=n.getListType()),"check"===e?!!t.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(null===e||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;eU(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&eD(117),(e=Math.floor(e))>=0||eD(199);let t=this.getIndent();for(;t!==e;)to.append(e));let l=ej(),s=eG(i);l.append(s),ek(s,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(l),n.replace(e)}}}(this),t--);return this}canInsertAfter(e){return eU(e)}canReplaceWith(e){return eU(e)}canMergeWith(e){return eU(e)||(0,eM.$isParagraphNode)(e)}extractWithChild(e,t){if(!(0,eM.$isRangeSelection)(t))return!1;let n=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return eG("bullet")}canMergeWhenEmpty(){return!0}}function eW(e){if(e.classList.contains("task-list-item")){for(let t of e.children)if("INPUT"===t.tagName)return ez(t)}if(e.classList.contains("joplin-checkbox")){for(let t of e.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&"INPUT"===t.children[0].tagName)return ez(t.children[0])}let t=e.getAttribute("aria-checked");return{node:ej("true"===t||"false"!==t&&void 0)}}function ez(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:ej(e.hasAttribute("checked"))}}function ej(e){return(0,eM.$applyNodeReplacement)(new eY(void 0,e))}function eU(e){return e instanceof eY}class eH extends eM.ElementNode{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{let t;eQ(t=e.getNextSibling())&&e.getListType()===t.getListType()&&eB(e,t),eK(e)},extends:eM.ElementNode,importDOM:(0,eM.buildImportMap)({ol:()=>({conversion:eX,priority:0}),ul:()=>({conversion:eX,priority:0})})})}constructor(e="number",t=1,n){super(n);const i=eq[e]||e;this.__listType=i,this.__tag="number"===i?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,i=document.createElement(n);return 1!==this.__start&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,eV(i,e.theme,this),i}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(eV(t,n.theme,this),e.__start!==this.__start&&t.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return(0,eM.isHTMLElement)(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let i=n;for(let e=0;e1?i.push(...t):r.push(...t)}}r.length>0&&(0,eM.removeClassNamesFromElement)(e,...r),i.length>0&&(0,eM.addClassNamesToElement)(e,...i)}function eJ(e){let t=[];for(let n=0;n1&&e.forEach(e=>{eQ(e)&&t.push(ew(e))})}else t.push(ew(i))}return t}function eX(e){let t=e.nodeName.toLowerCase(),n=null;return"ol"===t?n=eG("number",e.start):"ul"===t&&(n=!function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list")||"1"===e.getAttribute("data-is-checklist"))return!0;for(let t of e.childNodes)if((0,eM.isHTMLElement)(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?eG("bullet"):eG("check")),{after:eJ,node:n}}let eq={ol:"number",ul:"bullet"};function eG(e="number",t=1){return(0,eM.$applyNodeReplacement)(new eH(e,t))}function eQ(e){return e instanceof eH}let eZ=(0,eM.createCommand)("INSERT_CHECK_LIST_COMMAND");function e0(e,t){let n=t&&t.disableTakeFocusOnClick||!1,i=e=>{e1(e,()=>{if((0,eM.isHTMLElement)(e.target)){let t=e.target,i=(0,eM.getNearestEditorFromDOMNode)(t);null!=i&&i.isEditable()&&i.update(()=>{let e=(0,eM.$getNearestNodeFromDOMNode)(t);eU(e)&&(n?((0,eM.$addUpdateTag)(eM.SKIP_SELECTION_FOCUS_TAG),(0,eM.$addUpdateTag)(eM.SKIP_DOM_SELECTION_TAG)):t.focus(),e.toggleChecked())})}})},r=e=>{e1(e,()=>{e.preventDefault(),n&&e.stopPropagation()})};return(0,eM.mergeRegister)(e.registerCommand(eZ,()=>(eL("check"),!0),eM.COMMAND_PRIORITY_LOW),e.registerCommand(eM.KEY_ARROW_DOWN_COMMAND,t=>e3(t,e,!1),eM.COMMAND_PRIORITY_LOW),e.registerCommand(eM.KEY_ARROW_UP_COMMAND,t=>e3(t,e,!0),eM.COMMAND_PRIORITY_LOW),e.registerCommand(eM.KEY_ESCAPE_COMMAND,()=>{if(null!=e2()){let t=e.getRootElement();return null!=t&&t.focus(),!0}return!1},eM.COMMAND_PRIORITY_LOW),e.registerCommand(eM.KEY_SPACE_COMMAND,t=>{let n=e2();return!(null==n||!e.isEditable())&&(e.update(()=>{let e=(0,eM.$getNearestNodeFromDOMNode)(n);eU(e)&&(t.preventDefault(),e.toggleChecked())}),!0)},eM.COMMAND_PRIORITY_LOW),e.registerCommand(eM.KEY_ARROW_LEFT_COMMAND,t=>e.getEditorState().read(()=>{let n=(0,eM.$getSelection)();if((0,eM.$isRangeSelection)(n)&&n.isCollapsed()){let{anchor:i}=n,r="element"===i.type;if(r||0===i.offset){let n=i.getNode(),o=(0,eM.$findMatchingParent)(n,e=>(0,eM.$isElementNode)(e)&&!e.isInline());if(eU(o)){let i=o.getParent();if(eQ(i)&&"check"===i.getListType()&&(r||o.getFirstDescendant()===n)){let n=e.getElementByKey(o.__key);if(null!=n&&document.activeElement!==n)return n.focus(),t.preventDefault(),!0}}}}return!1}),eM.COMMAND_PRIORITY_LOW),e.registerRootListener((e,t)=>{null!==e&&(e.addEventListener("click",i),e.addEventListener("pointerdown",r,{capture:!0}),e.addEventListener("mousedown",r,{capture:!0}),e.addEventListener("touchstart",r,{capture:!0,passive:!1})),null!==t&&(t.removeEventListener("click",i),t.removeEventListener("pointerdown",r,{capture:!0}),t.removeEventListener("mousedown",r,{capture:!0}),t.removeEventListener("touchstart",r,{capture:!0}))}))}function e1(e,t){let n=e.target;if(!(0,eM.isHTMLElement)(n))return;let i=n.firstChild;if((0,eM.isHTMLElement)(i)&&("UL"===i.tagName||"OL"===i.tagName))return;let r=n.parentNode;if(!r||"check"!==r.__lexicalListType)return;let o=null,l=null;if("clientX"in e)o=e.clientX;else if("touches"in e){let t=e.touches;t.length>0&&(o=t[0].clientX,l="touch")}if(null==o)return;let s=n.getBoundingClientRect(),a=o/k(n),d=parseFloat((window.getComputedStyle?window.getComputedStyle(n,"::before"):{width:"0px"}).width),u=32*("touch"===l||"touch"===e.pointerType);("rtl"===n.dir?as.right-d-u:a>s.left-u&&a{let r=(0,eM.$getNearestNodeFromDOMNode)(i);if(!eU(r))return;let o=function(e,t){let n=t?e.getPreviousSibling():e.getNextSibling(),i=e;for(;null==n&&eU(i);)null!=(i=i.getParentOrThrow().getParent())&&(n=t?i.getPreviousSibling():i.getNextSibling());for(;eU(n);){let e=t?n.getLastChild():n.getFirstChild();if(!eQ(e))return n;n=t?e.getLastChild():e.getFirstChild()}return null}(r,n);if(null!=o){o.selectStart();let n=t.getElementByKey(o.__key);null!=n&&(e.preventDefault(),setTimeout(()=>{n.focus()},0))}}),!1}let e5=(0,eM.createCommand)("UPDATE_LIST_START_COMMAND"),e7=(0,eM.createCommand)("INSERT_UNORDERED_LIST_COMMAND"),e9=(0,eM.createCommand)("INSERT_ORDERED_LIST_COMMAND"),e4=(0,eM.createCommand)("REMOVE_LIST_COMMAND");function e6(e,t){return(0,eM.mergeRegister)(e.registerCommand(e9,()=>(eL("number"),!0),eM.COMMAND_PRIORITY_LOW),e.registerCommand(e5,e=>{let{listNodeKey:t,newStart:n}=e,i=(0,eM.$getNodeByKey)(t);return!!eQ(i)&&("number"===i.getListType()&&(i.setStart(n),eK(i)),!0)},eM.COMMAND_PRIORITY_LOW),e.registerCommand(e7,()=>(eL("bullet"),!0),eM.COMMAND_PRIORITY_LOW),e.registerCommand(e4,()=>((function(){let e=(0,eM.$getSelection)();if((0,eM.$isRangeSelection)(e)){let t=new Set,n=e.getNodes(),i=e.anchor.getNode();if(eP(i,n))t.add(eb(i));else for(let e=0;e(function(e=!1){let t,n=(0,eM.$getSelection)();if(!(0,eM.$isRangeSelection)(n)||!n.isCollapsed())return!1;let i=n.anchor.getNode(),r=null;if(eU(i)&&0===i.getChildrenSize())r=i;else if((0,eM.$isTextNode)(i)){let e=i.getParent();eU(e)&&e.getChildren().every(e=>(0,eM.$isTextNode)(e)&&""===e.getTextContent().trim())&&(r=e)}if(null===r)return!1;let o=eb(r),l=r.getParent();eQ(l)||eD(40);let s=l.getParent();if((0,eM.$isRootOrShadowRoot)(s))t=(0,eM.$createParagraphNode)(),o.insertAfter(t);else{if(!eU(s))return!1;t=ej(),s.insertAfter(t)}t.setTextStyle(n.style).setTextFormat(n.format).select();let a=r.getNextSiblings();if(a.length>0){var d;let n=e?(d=r,l.getStart()+d.getIndexWithinParent()):1,i=eG(l.getListType(),n);if(eU(t)){let e=ej();e.append(i),t.insertAfter(e)}else t.insertAfter(i);i.append(...a)}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){let e=t.getParent();if(null==e||!eU(e)&&!eQ(e))break;t=e}t.remove()}(r),!0})(!!(t&&t.restoreNumbering)),eM.COMMAND_PRIORITY_LOW),e.registerNodeTransform(eY,e=>{let t=e.getFirstChild();if(t){if((0,eM.$isTextNode)(t)){let n=t.getStyle(),i=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==i&&e.setTextFormat(i)}}else{let t=(0,eM.$getSelection)();(0,eM.$isRangeSelection)(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(eM.TextNode,e=>{let t=e.getParent();if(eU(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),i=e.getFormat();n===t.getTextStyle()&&i===t.getTextFormat()||t.setTextStyle(n).setTextFormat(i)}}))}function e8(e){let t=e=>{let t=e.getParent();if(eQ(e.getFirstChild())||!eQ(t))return;let n=(0,eM.$findMatchingParent)(e,e=>eU(e)&&eQ(e.getParent())&&eU(e.getPreviousSibling()));if(null===n&&e.getIndent()>0)e.setIndent(0);else if(eU(n)){let i=n.getPreviousSibling();if(eU(i)){let n=(function(e){let t=e,n=t.getFirstChild();for(;eQ(n);){let e=n.getLastChild();if(!eU(e))break;n=(t=e).getFirstChild()}return t})(i).getParent();if(eQ(n)){let i=eI(n);i+1{let n=[e];for(;n.length>0;){let e=n.shift();if(eQ(e)){for(let i of e.getChildren())if(eU(i)){t(i);let e=i.getFirstChild();eQ(e)&&n.push(e)}}}})}let te=(0,eM.defineExtension)({build:(e,t,n)=>er(t),config:(0,eM.safeCast)({hasStrictIndent:!1,shouldPreserveNumbering:!1}),name:"@lexical/list/List",nodes:()=>[eH,eY],register(e,t,n){let i=n.getOutput();return(0,eM.mergeRegister)(ei(()=>e6(e,{restoreNumbering:i.shouldPreserveNumbering.value})),ei(()=>i.hasStrictIndent.value?e8(e):void 0))}});function tt(e,t){let n=(0,d.isDOMDocumentNode)(t)?t.body.childNodes:t.childNodes,i=[],r=[];for(let t of n)if(!ti.has(t.nodeName)){let n=function e(t,n,i,r,o=new Map,l){let s=[];if(ti.has(t.nodeName))return s;let a=null,u=function(e,t){let{nodeName:n}=e,i=t._htmlConversions.get(n.toLowerCase()),r=null;if(void 0!==i)for(let t of i){let n=t(e);null!==n&&(null===r||(r.priority||0){let e=new d.ArtificialNode__DO_NOT_USE;return i.push(e),e}:d.$createParagraphNode)),null==a?h.length>0?s=s.concat(h):(0,d.isBlockDomNode)(t)&&null!=t.nextSibling&&null!=t.previousSibling&&(0,d.isInlineDomNode)(t.nextSibling)&&(0,d.isInlineDomNode)(t.previousSibling)&&(s=s.concat((0,d.$createLineBreakNode)())):(0,d.$isElementNode)(a)&&a.append(...h),s}(t,e,r,!1);null!==n&&(i=i.concat(n))}return function(e){for(let t of e)t.getNextSibling()instanceof d.ArtificialNode__DO_NOT_USE&&t.insertAfter((0,d.$createLineBreakNode)());for(let t of e){for(let e of t.getChildren())t.insertBefore(e);t.remove()}}(r),i}function tn(t,n){if("u"e}).createHTML(r):r,"text/html");return tl(n,tt(n,e),t)}catch(e){console.error(e)}let l=o||e.getData("text/uri-list");if(null!=l)if((0,d.$isRangeSelection)(t)){let e=l.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t{e.update(()=>{i(td(e,t,n))})});let i=e.getRootElement(),r=e._window||window,o=r.document,l=(0,d.getDOMSelection)(r);if(null===i||null===l)return!1;let s=o.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(o.createTextNode("#")),i.append(s);let a=new Range;return a.setStart(s,0),a.setEnd(s,1),l.removeAllRanges(),l.addRange(a),new Promise((t,i)=>{let l=e.registerCommand(d.COPY_COMMAND,i=>(w(i,ClipboardEvent)&&(l(),null!==ts&&(r.clearTimeout(ts),ts=null),t(td(e,i,n))),!0),d.COMMAND_PRIORITY_CRITICAL);ts=r.setTimeout(()=>{l(),ts=null,t(!1)},50),o.execCommand("copy"),s.remove()})}function td(e,t,n){if(void 0===n){let t=(0,d.getDOMSelection)(e._window),i=(0,d.$getSelection)();if(!i||i.isCollapsed()||!t)return!1;let r=t.anchorNode,o=t.focusNode;if(null!==r&&null!==o&&!(0,d.isSelectionWithinEditor)(e,r,o))return!1;n=tc(i)}t.preventDefault();let i=t.clipboardData;return null!==i&&(function(e,t){for(let[n]of tu)void 0===t[n]&&e.setData(n,"");for(let n in t){let i=t[n];void 0!==i&&e.setData(n,i)}}(i,n),!0)}let tu=[["text/html",function(e,t=(0,d.$getSelection)()){return null==t&&tr(166),(0,d.$isRangeSelection)(t)&&t.isCollapsed()||0===t.getNodes().length?"":tn(e,t)}],["application/x-lexical-editor",function(e,t=(0,d.$getSelection)()){return null==t&&tr(166),(0,d.$isRangeSelection)(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){let n=[],i=(0,d.$getRoot)().getChildren();for(let r=0;r{if(n.origin!==t)return;let i=e.getRootElement();if(document.activeElement!==i)return;let r=n.data;if("string"==typeof r){let t;try{t=JSON.parse(r)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){let i=t.payload;if(i&&"makeChanges"===i.functionId){let t=i.args;if(t){let[i,r,o,l,s]=t;e.update(()=>{let e=(0,d.$getSelection)();if((0,d.$isRangeSelection)(e)){let t=e.anchor,a=t.getNode(),u=0,c=0;if((0,d.$isTextNode)(a)&&i>=0&&r>=0&&(u=i,c=i+r,e.setTextNodeRange(a,u,a,c)),u===c&&""===o||(e.insertRawText(o),a=t.getNode()),(0,d.$isTextNode)(a)){u=l,c=l+s;let t=a.getTextContentSize();u=u>t?t:u,c=c>t?t:c,e.setTextNodeRange(a,u,a,c)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}e.s(["$getClipboardDataFromSelection",0,tc,"$insertDataTransferForRichText",0,to,"copyToClipboard",0,ta],704338);let tg=(0,d.defineExtension)({build:(e,t,n)=>er(t),config:(0,d.safeCast)({disabled:"u"ei(()=>n.getOutput().disabled.value?void 0:tf(e))});e.s(["DragonExtension",0,tg,"registerDragonSupport",0,tf],35500);var th=d;function tp(e,t){if(void 0!==document.caretRangeFromPoint){let n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){let n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}let tm="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,tN=tm&&"documentMode"in document?document.documentMode:null,tC=tm&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),t_=!(!tm||!("InputEvent"in window)||tN)&&"getTargetRanges"in new window.InputEvent("input"),tS=tm&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),tE=tm&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,tx=tm&&/^(?=.*Chrome).*/i.test(navigator.userAgent),tT=tm&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&tC&&!tx,ty=(0,th.createCommand)("DRAG_DROP_PASTE_FILE");class tO extends th.ElementNode{static getType(){return"quote"}static clone(e){return new tO(e.__key)}createDOM(e){let t=document.createElement("blockquote");return(0,th.addClassNamesToElement)(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:tI,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if((0,th.isHTMLElement)(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return tR().updateFromJSON(e)}insertNewAfter(e,t){let n=(0,th.$createParagraphNode)(),i=this.getDirection();return n.setDirection(i),this.insertAfter(n,t),n}collapseAtStart(){let e=(0,th.$createParagraphNode)();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function tR(){return(0,th.$applyNodeReplacement)(new tO)}function tv(e){return e instanceof tO}class t$ extends th.ElementNode{__tag;static getType(){return"heading"}static clone(e){return new t$(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){let t=this.getWritable();return this.__tag=e,t}createDOM(e){let t=this.__tag,n=document.createElement(t),i=e.theme.heading;if(void 0!==i){let e=i[t];(0,th.addClassNamesToElement)(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:tD,priority:0}),h2:e=>({conversion:tD,priority:0}),h3:e=>({conversion:tD,priority:0}),h4:e=>({conversion:tD,priority:0}),h5:e=>({conversion:tD,priority:0}),h6:e=>({conversion:tD,priority:0}),p:e=>{let t=e.firstChild;return null!==t&&tM(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>tM(e)?{conversion:e=>({node:tb("h1")}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if((0,th.isHTMLElement)(t)){this.isEmpty()&&t.append(document.createElement("br"));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return tb(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,i=this.getLastDescendant(),r=i&&(!e||e.anchor.key!==i.getKey()||n!==i.getTextContentSize())&&e?tb(this.getTag()):(0,th.$createParagraphNode)(),o=this.getDirection();if(r.setDirection(o),this.insertAfter(r,t),0===n&&!this.isEmpty()&&e){let e=(0,th.$createParagraphNode)();e.select(),this.replace(e,!0)}return r}collapseAtStart(){let e=this.isEmpty()?(0,th.$createParagraphNode)():tb(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function tM(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function tD(e){let t=e.nodeName.toLowerCase(),n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=tb(t),null!==e.style&&((0,th.setNodeIndentFromDOM)(e,n),n.setFormat(e.style.textAlign))),{node:n}}function tI(e){let t=tR();return null!==e.style&&(t.setFormat(e.style.textAlign),(0,th.setNodeIndentFromDOM)(e,t)),{node:t}}function tb(e="h1"){return(0,th.$applyNodeReplacement)(new t$(e))}function tA(e){return e instanceof t$}function tw(e){let t=null;if(w(e,DragEvent)?t=e.dataTransfer:w(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];let n=t.types,i=n.includes("Files"),r=n.includes("text/html")||n.includes("text/plain");return[i,Array.from(t.files),r]}function tP(e){let t=(0,th.$getNearestNodeFromDOMNode)(e);return(0,th.$isDecoratorNode)(t)}function tL(e){for(let t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function tk(e){return(0,th.mergeRegister)(e.registerCommand(th.CLICK_COMMAND,e=>{let t=(0,th.$getSelection)();return!!(0,th.$isNodeSelection)(t)&&(t.clear(),!0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.DELETE_CHARACTER_COMMAND,e=>{let t=(0,th.$getSelection)();return(0,th.$isRangeSelection)(t)?(t.deleteCharacter(e),!0):!!(0,th.$isNodeSelection)(t)&&(t.deleteNodes(),!0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.DELETE_WORD_COMMAND,e=>{let t=(0,th.$getSelection)();return!!(0,th.$isRangeSelection)(t)&&(t.deleteWord(e),!0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.DELETE_LINE_COMMAND,e=>{let t=(0,th.$getSelection)();return!!(0,th.$isRangeSelection)(t)&&(t.deleteLine(e),!0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.CONTROLLED_TEXT_INSERTION_COMMAND,t=>{let n=(0,th.$getSelection)();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;let i=t.dataTransfer;if(null!=i)to(i,n,e);else if((0,th.$isRangeSelection)(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.REMOVE_TEXT_COMMAND,()=>{let e=(0,th.$getSelection)();return!!(0,th.$isRangeSelection)(e)&&(e.removeText(),!0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.FORMAT_TEXT_COMMAND,e=>{let t=(0,th.$getSelection)();return!!(0,th.$isRangeSelection)(t)&&(t.formatText(e),!0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.FORMAT_ELEMENT_COMMAND,e=>{let t=(0,th.$getSelection)();if(!(0,th.$isRangeSelection)(t)&&!(0,th.$isNodeSelection)(t))return!1;for(let n of t.getNodes()){let t=(0,th.$findMatchingParent)(n,e=>(0,th.$isElementNode)(e)&&!e.isInline());null!==t&&t.setFormat(e)}return!0},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.INSERT_LINE_BREAK_COMMAND,e=>{let t=(0,th.$getSelection)();return!!(0,th.$isRangeSelection)(t)&&(t.insertLineBreak(e),!0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.INSERT_PARAGRAPH_COMMAND,()=>{let e=(0,th.$getSelection)();return!!(0,th.$isRangeSelection)(e)&&(e.insertParagraph(),!0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.INSERT_TAB_COMMAND,()=>{let e=(0,th.$createTabNode)(),t=(0,th.$getSelection)();return(0,th.$isRangeSelection)(t)&&(e.setFormat(t.format),e.setStyle(t.style)),(0,th.$insertNodes)([e]),!0},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.INDENT_CONTENT_COMMAND,()=>P(e=>{let t=e.getIndent();e.setIndent(t+1)}),th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.OUTDENT_CONTENT_COMMAND,()=>P(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.KEY_ARROW_UP_COMMAND,e=>{let t=(0,th.$getSelection)();if((0,th.$isNodeSelection)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}else if((0,th.$isRangeSelection)(t)){let n=(0,th.$getAdjacentNode)(t.focus,!0);if(!e.shiftKey&&(0,th.$isDecoratorNode)(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.KEY_ARROW_DOWN_COMMAND,e=>{let t=(0,th.$getSelection)();if((0,th.$isNodeSelection)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}else if((0,th.$isRangeSelection)(t)){let n;if("root"===(n=t.focus).key&&n.offset===(0,th.$getRoot)().getChildrenSize())return e.preventDefault(),!0;let i=(0,th.$getAdjacentNode)(t.focus,!1);if(!e.shiftKey&&(0,th.$isDecoratorNode)(i)&&!i.isIsolated()&&!i.isInline())return i.selectNext(),e.preventDefault(),!0}return!1},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.KEY_ARROW_LEFT_COMMAND,e=>{let t=(0,th.$getSelection)();if((0,th.$isNodeSelection)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),m(n[0])?n[0].selectNext(0,0):n[0].selectPrevious(),!0}if(!(0,th.$isRangeSelection)(t))return!1;if(x(t,!0)){let n=e.shiftKey;return e.preventDefault(),y(t,n,!0),!0}return!1},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.KEY_ARROW_RIGHT_COMMAND,e=>{let t=(0,th.$getSelection)();if((0,th.$isNodeSelection)(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),m(n[0])?n[0].selectPrevious():n[0].selectNext(0,0),!0}if(!(0,th.$isRangeSelection)(t))return!1;let n=e.shiftKey;return!!x(t,!1)&&(e.preventDefault(),y(t,n,!1),!0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.KEY_BACKSPACE_COMMAND,t=>{if(tP(t.target))return!1;let n=(0,th.$getSelection)();if((0,th.$isRangeSelection)(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(0!==t.offset)return!1;let n=t.getNode();if((0,th.$isRootNode)(n))return!1;let i=b(n);return i.getIndent()>0&&(i.is(n)||n.is(i.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(th.OUTDENT_CONTENT_COMMAND,void 0);if(tE&&"ko-KR"===navigator.language)return!1}else if(!(0,th.$isNodeSelection)(n))return!1;return t.preventDefault(),e.dispatchCommand(th.DELETE_CHARACTER_COMMAND,!0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.KEY_DELETE_COMMAND,t=>{if(tP(t.target))return!1;let n=(0,th.$getSelection)();return!(!(0,th.$isRangeSelection)(n)&&!(0,th.$isNodeSelection)(n))&&(t.preventDefault(),e.dispatchCommand(th.DELETE_CHARACTER_COMMAND,!1))},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.KEY_ENTER_COMMAND,t=>{let n=(0,th.$getSelection)();if(!(0,th.$isRangeSelection)(n))return!1;if(tL(n),null!==t){if((tE||tS||tT)&&t_)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(th.INSERT_LINE_BREAK_COMMAND,!1)}return e.dispatchCommand(th.INSERT_PARAGRAPH_COMMAND,void 0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.KEY_ESCAPE_COMMAND,()=>{let t=(0,th.$getSelection)();return!!(0,th.$isRangeSelection)(t)&&(e.blur(),!0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.DROP_COMMAND,t=>{let[,n]=tw(t);if(n.length>0){let i=tp(t.clientX,t.clientY);if(null!==i){let{offset:t,node:r}=i,o=(0,th.$getNearestNodeFromDOMNode)(r);if(null!==o){let e=(0,th.$createRangeSelection)();if((0,th.$isTextNode)(o))e.anchor.set(o.getKey(),t,"text"),e.focus.set(o.getKey(),t,"text");else{let t=o.getParentOrThrow().getKey(),n=o.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}let n=(0,th.$normalizeSelection__EXPERIMENTAL)(e);(0,th.$setSelection)(n)}e.dispatchCommand(ty,n)}return t.preventDefault(),!0}let i=(0,th.$getSelection)();return!!(0,th.$isRangeSelection)(i)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.DRAGSTART_COMMAND,e=>{let[t]=tw(e),n=(0,th.$getSelection)();return!(t&&!(0,th.$isRangeSelection)(n))},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.DRAGOVER_COMMAND,e=>{let[t]=tw(e),n=(0,th.$getSelection)();if(t&&!(0,th.$isRangeSelection)(n))return!1;let i=tp(e.clientX,e.clientY);if(null!==i){let t=(0,th.$getNearestNodeFromDOMNode)(i.node);(0,th.$isDecoratorNode)(t)&&e.preventDefault()}return!0},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.SELECT_ALL_COMMAND,()=>((0,th.$selectAll)(),!0),th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.COPY_COMMAND,t=>(ta(e,w(t,ClipboardEvent)?t:null),!0),th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.CUT_COMMAND,t=>((async function(e,t){await ta(t,w(e,ClipboardEvent)?e:null),t.update(()=>{let e=(0,th.$getSelection)();(0,th.$isRangeSelection)(e)?e.removeText():(0,th.$isNodeSelection)(e)&&e.getNodes().forEach(e=>e.remove())})})(t,e),!0),th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.PASTE_COMMAND,t=>{let[,n,i]=tw(t);return n.length>0&&!i?(e.dispatchCommand(ty,n),!0):!((0,th.isDOMNode)(t.target)&&(0,th.isSelectionCapturedInDecoratorInput)(t.target))&&null!==(0,th.$getSelection)()&&(t.preventDefault(),e.update(()=>{let n=(0,th.$getSelection)(),i=w(t,InputEvent)||w(t,KeyboardEvent)?null:t.clipboardData;null!=i&&null!==n&&to(i,n,e)},{tag:th.PASTE_TAG}),!0)},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.KEY_SPACE_COMMAND,e=>{let t=(0,th.$getSelection)();return(0,th.$isRangeSelection)(t)&&tL(t),!1},th.COMMAND_PRIORITY_EDITOR),e.registerCommand(th.KEY_TAB_COMMAND,e=>{let t=(0,th.$getSelection)();return(0,th.$isRangeSelection)(t)&&tL(t),!1},th.COMMAND_PRIORITY_EDITOR))}(0,th.defineExtension)({conflictsWith:["@lexical/plain-text"],dependencies:[tg],name:"@lexical/rich-text",nodes:()=>[t$,tO],register:tk}),e.s(["$createHeadingNode",0,tb,"$createQuoteNode",0,tR,"$isHeadingNode",0,tA,"$isQuoteNode",0,tv,"HeadingNode",0,t$,"QuoteNode",0,tO,"eventFiles",0,tw,"registerRichText",0,tk],20207);var tF="u">typeof window&&"u">typeof window.document&&"u">typeof window.document.createElement,tB=(0,o.createContext)({currentView:"default",inheritable:!1,setCurrentView:()=>{}});function tK(){return(0,o.use)(tB)}var tY=class{_x;_y;constructor(e,t){this._x=e,this._y=t}calcDeltaXTo({x:e}){return this.x-e}calcDeltaYTo({y:e}){return this.y-e}calcDistanceTo(e){return Math.sqrt(Math.pow(this.calcDeltaXTo(e),2)+Math.pow(this.calcDeltaYTo(e),2))}calcHorizontalDistanceTo(e){return Math.abs(this.calcDeltaXTo(e))}calcVerticalDistance(e){return Math.abs(this.calcDeltaYTo(e))}equals({x:e,y:t}){return this.x===e&&this.y===t}get x(){return this._x}get y(){return this._y}};function tW(e){return e instanceof tY}var tz=e=>{let t=document.getElementById("slash-menu");if(!t)return;let n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.topi.top&&n.top{let t=n.getRootElement();null!==t&&(t.setAttribute("aria-activedescendant",`slash-menu-popup__item-${e.key}`),u(e.key))},[n]),g=(0,o.useCallback)(()=>{if(null!==i&&null!=c){let e=i.flatMap(e=>e.items);e.length&&f(e[0])}},[i,f,c]);(0,o.useEffect)(()=>{g()},[c,g]);let h=(0,o.useCallback)(e=>{t(),n.update(()=>{let e=null!=l.match&&s?function(e){let t,n=(0,d.$getSelection)();if(!(0,d.$isRangeSelection)(n)||!n.isCollapsed())return;let i=n.anchor;if("text"!==i.type)return;let r=i.getNode();if(!r.isSimpleText())return;let o=i.offset,l=r.getTextContent().slice(0,o),s=e.replaceableString.length,a=o-function(e,t,n){let i=n;for(let n=i;n{let t;n.read(()=>{t=(0,d.$getSelection)()?.clone()}),n.update(()=>{t&&(0,d.$setSelection)(t)}),e.onSelect({editor:n,queryString:l.match?l.match.matchingString:""})},0)},[n,s,l.match,t]);return(0,o.useEffect)(()=>()=>{let e=n.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")},[n]),(0,o.useLayoutEffect)(()=>{null===i?u(null):null===a&&g()},[i,a,f,g]),(0,o.useEffect)(()=>(0,d.mergeRegister)(n.registerCommand(tU,({item:e})=>!!e.ref&&null!=e.ref.current&&(tz(e.ref.current),!0),d.COMMAND_PRIORITY_LOW)),[n,f]),(0,o.useEffect)(()=>(0,d.mergeRegister)(n.registerCommand(d.KEY_ARROW_DOWN_COMMAND,e=>{if(null!==i&&i.length&&null!==a){let t=i.flatMap(e=>e.items),r=t.findIndex(e=>e.key===a),o=r!==t.length-1?r+1:0,l=t[o];if(!l)return!1;f(l),null!=l.ref&&l.ref.current&&n.dispatchCommand(tU,{index:o,item:l}),e.preventDefault(),e.stopImmediatePropagation()}return!0},d.COMMAND_PRIORITY_NORMAL),n.registerCommand(d.KEY_ARROW_UP_COMMAND,e=>{if(null!==i&&i.length&&null!==a){let t=i.flatMap(e=>e.items),n=t.findIndex(e=>e.key===a),r=0!==n?n-1:t.length-1,o=t[r];if(!o)return!1;f(o),null!=o.ref&&o.ref.current&&tz(o.ref.current),e.preventDefault(),e.stopImmediatePropagation()}return!0},d.COMMAND_PRIORITY_NORMAL),n.registerCommand(d.KEY_ESCAPE_COMMAND,e=>(e.preventDefault(),e.stopImmediatePropagation(),t(),!0),d.COMMAND_PRIORITY_LOW),n.registerCommand(d.KEY_TAB_COMMAND,e=>{if(null===i||null===a)return!1;let t=i.flatMap(e=>e.items).find(e=>e.key===a);return!!t&&(e.preventDefault(),e.stopImmediatePropagation(),h(t),!0)},d.COMMAND_PRIORITY_NORMAL),n.registerCommand(d.KEY_ENTER_COMMAND,e=>{if(null===i||null===a)return!1;let t=i.flatMap(e=>e.items).find(e=>e.key===a);return!!t&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),h(t),!0)},d.COMMAND_PRIORITY_NORMAL)),[h,t,n,i,a,f]),r(e,(0,o.useMemo)(()=>({groups:i,selectedItemKey:a,selectItemAndCleanUp:h,setSelectedItemKey:u}),[h,a,i]),l.match?l.match.matchingString:"")}function tV(e,t,n){let i=(0,d.getDOMSelection)(n);if(null===i||!i.isCollapsed)return!1;let r=i.anchorNode,o=i.anchorOffset;if(null==r||null==o)return!1;try{t.setStart(r,e),t.setEnd(r,o>1?o:1)}catch{return!1}return!0}function tJ(e,t){return 0===t&&e.getEditorState().read(()=>{let e=(0,d.$getSelection)();if((0,d.$isRangeSelection)(e)){let t=e.anchor.getNode().getPreviousSibling();return(0,d.$isTextNode)(t)&&t.isTextEntity()}return!1})}function tX(e){o.startTransition?o.startTransition(e):e()}var tq=(0,d.createCommand)("ENABLE_SLASH_MENU_COMMAND"),tG=class e{_bottom;_left;_right;_top;constructor(e,t,n,i){let[r,o]=tthis._bottom,o=tthis._right;return{reason:{isOnBottomSide:r,isOnLeftSide:o,isOnRightSide:l,isOnTopSide:i},result:!i&&!r&&!o&&!l}}let{bottom:t,left:n,right:i,top:r}=e;return r>=this._top&&r=this._top&&t=this._left&&n=this._left&&ithis._right&&(n=e.x-this._right),e.ythis._bottom&&(i=e.y-this._bottom),{distance:Math.sqrt(n*n+i*i),isOnBottomSide:e.y>this._bottom,isOnLeftSide:e.xthis._right,isOnTopSide:e.y=l+a?n+r:l+a)-(n=s+o?i+t:s+o)-(i\s/,t9=/^[ \t]*(\\`\\`\\`|```)(\w+)?/,t4=/[ \t]*(\\`\\`\\`|```)$/,t6=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,t8=/^\|(.+)\|\s?$/,ne=/^(\| ?:?-*:? ?)+\|\s?$/,nt=/^[ \t]*]*)?\/?>/i,nn=/^[ \t]*/i,ni=(0,d.createState)("mdHardLineBreak",{parse:e=>"string"==typeof e&&/^(\\| {2,})$/.test(e)?e:""});function nr(e){if(e.endsWith("\\"))return[e.slice(0,-1),"\\"];let t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function no(e){let t=(0,d.$createLineBreakNode)(),n=function(e){let t=e.getChildren(),n=t.length-1,i=t[n];if(!(0,d.$isTextNode)(i))return null;let r=i.getTextContent(),o=nr(r);if(null!==o){let[e,t]=o;return i.setTextContent(e),t}return/^ {2,}$/.test(r)&&function(e,t){for(let n=t-1;n>=0&&!(0,d.$isLineBreakNode)(e[n]);n--)if(/\S/.test(e[n].getTextContent()))return!0;return!1}(t,n)?(i.setTextContent(""),r):null}(e);return null!==n&&(0,d.$setState)(t,ni,n),t}var nl=e=>(t,n,i)=>{var r;let o,l,s,a=t.getPreviousSibling(),d=t.getNextSibling(),u=ej("check"===e?"x"===i[3]:void 0);if(eQ(d)&&d.getListType()===e){let e=d.getFirstChild();null!==e?e.insertBefore(u):d.append(u),t.remove()}else if(eQ(a)&&a.getListType()===e)a.append(u),t.remove();else{let n=eG(e,"number"===e?Number(i[2]):void 0);n.append(u),t.replace(n)}u.append(...n),u.select(0,0);let c=(o=(r=i[1]).match(/\t/g),l=r.match(/ /g),s=0,o&&(s+=o.length),l&&(s+=Math.floor(l.length/4)),s);c&&u.setIndent(c)},ns=(e,t,n)=>{let i=[],r=e.getChildren(),o=0;for(let l of r)if(eU(l)){if(1===l.getChildrenSize()){let e=l.getFirstChild();if(eQ(e)){i.push(ns(e,t,n+1));continue}}let r=" ".repeat(4*n),s=e.getListType(),a="number"===s?`${e.getStart()+o}. `:"check"===s?`- [${l.getChecked()?"x":" "}] `:"- ";i.push(r+a+t(l)),o++}return i.join(` `)},na={type:"element",dependencies:[t$],export:(e,t)=>{if(!tA(e))return null;let n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:t5,replace:(i=e=>tb("h"+e[1].length),(e,t,n)=>{let r=i(n);r.append(...t),e.replace(r),r.select(0,0)})},nd={type:"element",dependencies:[eH,eY],export:(e,t)=>eQ(e)?ns(e,t,0):null,regExp:t2,replace:nl("bullet")},nu=(nl("check"),{type:"element",dependencies:[eH,eY],export:(e,t)=>eQ(e)?ns(e,t,0):null,regExp:t1,replace:nl("number")});function nc(e){return(t,n)=>tA(t)&&t.getTag()==="h"+e?"#".repeat(e)+" "+n(t):null}function nf(e,t){let n={};for(let i of e){let e=t(i);e&&(n[e]?n[e].push(i):n[e]=[i])}return n}function ng(e){let t=nf(e,e=>e.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}nc(1),nc(2),nc(3),nc(4),nc(5),nc(6);var nh=/[!-/:-@[-`{-~\s]/,np=/^\s{0,3}$/;function nm(e){if(!(0,d.$isParagraphNode)(e))return!1;let t=e.getFirstChild();return null==t||1===e.getChildrenSize()&&(0,d.$isTextNode)(t)&&np.test(t.getTextContent())}function nN(e,t,n,i,r){let o=[],l=e.getChildren();i||(i=[]),r||(r=[]);e:for(let e of l){var s;for(let l of n){if(!l.export)continue;let s=l.export(e,e=>nN(e,t,n,i,[...r,...i]),(e,n)=>nC(e,n,t,i,r));if(null!=s){o.push(s);continue e}}(0,d.$isLineBreakNode)(e)?o.push((s=e,(0,d.$getState)(s,ni)+` `)):(0,d.$isTextNode)(e)?o.push(nC(e,e.getTextContent(),t,i,r)):(0,d.$isElementNode)(e)?o.push(nN(e,t,n,i,r)):(0,d.$isDecoratorNode)(e)&&o.push(e.getTextContent())}return o.join("")}function nC(e,t,n,i,r){let o=t.trim(),l=o;e.hasFormat("code")||(l=l.replace(/([*_`~\\])/g,"\\$1"));let s="",a="",d="",u=n_(e,!0),c=n_(e,!1),f=new Set;for(let t of n){let n=t.format[0],r=t.tag;nS(e,n)&&!f.has(n)&&(f.add(n),nS(u,n)&&i.find(e=>e.tag===r)||(i.push({format:n,tag:r}),s+=r))}for(let t=0;tt;){let e=s.pop();r&&e&&r.find(t=>t.tag===e.tag)||(e&&"string"==typeof e.tag&&(o?l||(d+=e.tag):a+=e.tag),i.pop())}break}return l=s+l+d,a+t.replace(o,()=>l)}function n_(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){let i=e.getParentOrThrow();i.isInline()&&(n=t?i.getPreviousSibling():i.getNextSibling())}for(;n;){if((0,d.$isElementNode)(n)){if(!n.isInline())break;let e=t?n.getLastDescendant():n.getFirstDescendant();if((0,d.$isTextNode)(e))return e;n=t?n.getPreviousSibling():n.getNextSibling()}if((0,d.$isTextNode)(n))return n;if(!(0,d.$isElementNode)(n))break}return null}function nS(e,t){return(0,d.$isTextNode)(e)&&e.hasFormat(t)}function nE(e,t,n){let i=n.length;for(let r=t;r>=i;r--){let t=r-i;if(nx(e,t,n,0,i)&&" "!==e[t+i])return t}return -1}function nx(e,t,n,i,r){for(let o=0;o{if(!tv(e))return null;let n=t(e).split(` `),i=[];for(let e of n)i.push("> "+e);return i.join(` `)},regExp:t7,replace:(e,t,n,i)=>{if(i){let n=e.getPreviousSibling();if(tv(n)){n.splice(n.getChildrenSize(),0,[no(n),...t]),n.select(0,0),e.remove();return}}let r=tR();r.append(...t),e.replace(r),r.select(0,0)}},nd,nu,{type:"text-format",format:["code"],tag:"`"},{type:"text-format",format:["bold","italic"],tag:"***"},{type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},{type:"text-format",format:["bold"],tag:"**"},{type:"text-format",format:["bold"],intraword:!1,tag:"__"},{type:"text-format",format:["highlight"],tag:"=="},{type:"text-format",format:["italic"],tag:"*"},{type:"text-format",format:["italic"],intraword:!1,tag:"_"},{type:"text-format",format:["strikethrough"],tag:"~~"}];e.s(["a",0,function(e,t=nT){let n=ng(t),i=nf(n.textFormat,({tag:e})=>e[e.length-1]),r=nf(n.textMatch,({trigger:e})=>e);for(let n of t){let t=n.type;if("element"===t||"text-match"===t||"multiline-element"===t){for(let t of n.dependencies)if(!e.hasNode(t))throw Error("MarkdownShortcuts: missing dependency %s for transformer. Ensure node dependency is included in editor initial config."+t.getType())}}return e.registerUpdateListener(({dirtyLeaves:t,editorState:o,prevEditorState:l,tags:s})=>{if(s.has("collaboration")||s.has("historic")||e.isComposing())return;let a=o.read(d.$getSelection),u=l.read(d.$getSelection);if(!(0,d.$isRangeSelection)(u)||!(0,d.$isRangeSelection)(a)||!a.isCollapsed()||a.is(u))return;let c=a.anchor.key,f=a.anchor.offset,g=o._nodeMap.get(c);(0,d.$isTextNode)(g)&&t.has(c)&&(1===f||!(f>u.anchor.offset+1))&&e.update(()=>{var e;if(g.hasFormat("code"))return;let t=g.getParent();null!==t&&(function(e,t,n,i){let r=e.getParent();if(!(0,d.$isRootOrShadowRoot)(r)||e.getFirstChild()!==t)return!1;let o=t.getTextContent();if(" "!==o[n-1])return!1;for(let{regExp:r,replace:l}of i){let i=o.match(r);if(i&&i[0].length===(i[0].endsWith(" ")?n:n-1)){let r=t.getNextSiblings(),[o,s]=t.splitText(n);if(o?.remove(),!1!==l(e,s?[s,...r]:r,i,!1))return!0}}return!1}(t,g,e=a.anchor.offset,n.element)||function(e,t,n,i){let r=e.getParent();if(!(0,d.$isRootOrShadowRoot)(r)||e.getFirstChild()!==t)return!1;let o=t.getTextContent();if(" "!==o[n-1])return!1;for(let{regExpEnd:r,regExpStart:l,replace:s}of i){if(r&&!("optional"in r)||r&&"optional"in r&&!r.optional)continue;let i=o.match(l);if(i&&i[0].length===(i[0].endsWith(" ")?n:n-1)){let r=t.getNextSiblings(),[o,l]=t.splitText(n);if(o?.remove(),!1!==s(e,l?[l,...r]:r,i,null,null,!1))return!0}}return!1}(t,g,e,n.multilineElement)||function(e,t,n){let i=e.getTextContent(),r=n[i[t-1]];if(null==r)return!1;for(let n of(t1&&!nx(i,s,n,0,l)||" "===i[s-1])continue;let a=i[r+1];if(!1===t.intraword&&a&&!nh.test(a))continue;let u=e,c=nE(i,s,n),f=u;for(;c0&&g[c-1]===o)continue;let h=g[c-1];if(!1===t.intraword&&h&&!nh.test(h))continue;let p=e.getTextContent(),m=p.slice(0,s)+p.slice(r+1);e.setTextContent(m);let N=u===e?m:g;u.setTextContent(N.slice(0,c)+N.slice(c+l));let C=(0,d.$getSelection)(),_=(0,d.$createRangeSelection)();(0,d.$setSelection)(_);let S=r-l*(u===e?2:1)+1;for(let n of(_.anchor.set(u.__key,c,"text"),_.focus.set(e.__key,S,"text"),t.format))_.hasFormat(n)||_.formatText(n);for(let e of(_.anchor.set(_.focus.key,_.focus.offset,_.focus.type),t.format))_.hasFormat(e)&&_.toggleFormat(e);return(0,d.$isRangeSelection)(C)&&(_.format=C.format),!0}}(g,e,i))})})},"b",0,function(e,t=nT,n,i=!1,r=!0){let o=i?e:function(e,t){let n=e.split(` `),i=!1,r=[],o=0;for(let e=0;e0&&o--,r.push(l);continue}if(t9.test(l)){i=!0,o++,r.push(l);continue}if(i){r.push(l);continue}t0.test(l)||t0.test(s)||!s||t5.test(s)||t5.test(l)||t7.test(l)||t1.test(l)||t2.test(l)||t3.test(l)||t8.test(l)||ne.test(l)||d||!t||nt.test(l)||nn.test(l)||nt.test(s)||nn.test(s)||t4.test(s)?r.push(l):r[r.length-1]=s+" "+(null===a?l.trim():l.trimStart())}return r.join(` `)}(e,r);return(function(e,t=!1){let n=ng(e),i=function(e){let t={},n={},i=[];for(let r of e){let{tag:e}=r;t[e]=r;let o=e.replace(/([*^+])/g,"\\$1");i.push(o),1===e.length?n[e]=RegExp(`(?{let o=e.split(` `),l=o.length,s=r||(0,d.$getRoot)();s.clear();for(let e=0;ei)&&(n=s,i=a,r=l,o=t)}return void 0===n||void 0===i||void 0===r||void 0===o?null:{endIndex:i,match:o,startIndex:n,transformer:r}}(t,i);if(r&&o&&(r.startIndex=o.endIndex?o=null:r=null),r){let o=function(e,t,n,i,r){let o=e.getTextContent(),l,s,a;if(r[0]===o?a=e:0===t?[a,l]=e.splitText(n):[s,a,l]=e.splitText(t,n),a.setTextContent(r[2]),i)for(let e of i.format)a.hasFormat(e)||a.toggleFormat(e);return{nodeAfter:l,nodeBefore:s,transformedNode:a}}(t,r.startIndex,r.endIndex,r.transformer,r.match);o.nodeAfter&&(0,d.$isTextNode)(o.nodeAfter)&&!o.nodeAfter.hasFormat("code")&&e(o.nodeAfter,n,i),o.nodeBefore&&(0,d.$isTextNode)(o.nodeBefore)&&!o.nodeBefore.hasFormat("code")&&e(o.nodeBefore,n,i),o.transformedNode&&(0,d.$isTextNode)(o.transformedNode)&&!o.transformedNode.hasFormat("code")&&e(o.transformedNode,n,i)}else if(o){var l,s,a,u;let r,c,f,g=(l=o.startIndex,s=o.endIndex,a=o.transformer,u=o.match,(0===l?[f,r]=t.splitText(s):[c,f,r]=t.splitText(l,s),a.replace)?{nodeAfter:r,nodeBefore:c,transformedNode:(f?a.replace(f,u):void 0)||void 0}:null);if(!g)return;g.nodeAfter&&(0,d.$isTextNode)(g.nodeAfter)&&!g.nodeAfter.hasFormat("code")&&e(g.nodeAfter,n,i),g.nodeBefore&&(0,d.$isTextNode)(g.nodeBefore)&&!g.nodeBefore.hasFormat("code")&&e(g.nodeBefore,n,i),g.transformedNode&&(0,d.$isTextNode)(g.transformedNode)&&!g.transformedNode.hasFormat("code")&&e(g.transformedNode,n,i)}let c=t.getTextContent().replace(/\\([*_`~])/g,"$1");t.setTextContent(c)}(o,i,r),l.isAttached()&&e.length>0){let e=l.getPreviousSibling();if((0,d.$isParagraphNode)(e)||tv(e)||eQ(e)){let t=e;if(eQ(e)){let n=e.getLastDescendant();t=null==n?null:(0,d.$findMatchingParent)(n,eU)}null!=t&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[no(t),...l.getChildren()]),l.remove())}}}(t,s,n.element,i,n.textMatch)}for(let e of s.getChildren())!t&&nm(e)&&s.getChildrenSize()>1&&e.remove();null!==(0,d.$getSelection)()&&s.selectStart()}})(t,i)(o,n)},"c",0,function(e=nT,t,n=!1){return(function(e,t=!1){let n=ng(e),i=[...n.multilineElement,...n.element],r=!t,o=n.textFormat.filter(e=>1===e.format.length).sort((e,t)=>e.format.includes("code")&&!t.format.includes("code")?1:!e.format.includes("code")&&t.format.includes("code")?-1:0);return e=>{let t=[],l=(e||(0,d.$getRoot)()).getChildren();return l.forEach((e,s)=>{let a=function(e,t,n,i){for(let r of t){if(!r.export)continue;let t=r.export(e,e=>nN(e,n,i));if(null!=t)return t}return(0,d.$isElementNode)(e)?nN(e,n,i):(0,d.$isDecoratorNode)(e)?e.getTextContent():null}(e,i,o,n.textMatch);null!=a&&t.push(r&&s>0&&!nm(e)&&!nm(l[s-1])?` `.concat(a):a)}),t.join(` `)}})(e,n)(t)},"d",0,tF,"e",0,function(e){let t=(0,r.c)(2),n=void 0===e?500:e,i=(0,o.useRef)(void 0),l;return t[0]!==n?(l=e=>new Promise(t=>{let r=()=>{e(),t()};"requestIdleCallback"in window?("cancelIdleCallback"in window&&void 0!==i.current&&cancelIdleCallback(i.current),i.current=requestIdleCallback(r,{timeout:n})):new Promise(e=>{setTimeout(e,100),requestAnimationFrame(()=>{setTimeout(e,0)})}).then(r)}),t[0]=n,t[1]=l):l=t[1],l},"f",0,e=>{let t=tK(),n=void 0!==e.currentView,i=t.inheritable&&(!!t.views||!!t.hasExplicitCurrentView),r=n||t.inheritable&&!!t.hasExplicitCurrentView,{children:a,currentView:d,inheritable:u,views:c}={children:e.children,currentView:i?t.currentView:e.currentView,inheritable:t.inheritable||e.inheritable,views:i&&t.views?t.views:e.views},[f,g]=(0,s.a)(d,"default"),h=c&&"default"!==f&&!c[f]?"default":f,p=(0,o.useMemo)(()=>{let e=c?c[h]:void 0;return{currentView:h,currentViewMap:e,hasExplicitCurrentView:r,inheritable:u,isControlledByParent:i,setCurrentView:g,views:c}},[h,u,r,i,g,c]);return(0,l.jsx)(tB,{value:p,children:a})},"g",0,tK,"h",0,tY,"i",0,tW,"j",0,"\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=_:;","k",0,tq,"l",0,function({anchorClassName:e,anchorElem:t,groups:n,menuRenderFn:i,onClose:s,onOpen:u,onQueryChange:c,triggerFn:f}){let[g]=(0,a.useLexicalComposerContext)(),[h,p]=(0,o.useState)(null),m=function(e,t,n,i){let l,s=(0,r.c)(14),[d]=(0,a.useLexicalComposerContext)(),u;s[0]===Symbol.for("react.memo_cache_sentinel")?(u=tF?document.createElement("div"):null,s[0]=u):u=s[0];let c=(0,o.useRef)(u),f;s[1]!==e||s[2]!==i||s[3]!==d||s[4]!==t?(f=()=>{if(null===c.current||void 0===parent)return;let n=d.getRootElement(),r=c.current,o=r.firstChild;if(null!==n&&null!==t){let{height:l,width:s}=t.getRect(),{left:a,top:d}=t.getRect(),u=d;if(d-=e.getBoundingClientRect().top+window.scrollY,a-=e.getBoundingClientRect().left+window.scrollX,r.style.left=`${a+window.scrollX}px`,r.style.height=`${l}px`,r.style.width=`${s}px`,null!==o){let t=o.getBoundingClientRect(),i=t.height,s=t.width,c=n.getBoundingClientRect(),f="rtl"===document.dir||"rtl"===document.documentElement.dir,g=e.getBoundingClientRect(),h=Math.max(0,c.left);if(!f&&a+s>c.right)r.style.left=`${c.right-s+window.scrollX}px`;else if(f&&t.leftwindow.innerHeight&&!(u{let e=d.getRootElement();if(null!==t)return g(),()=>{null!==e&&e.removeAttribute("aria-controls");let t=c.current;null!==t&&t.isConnected&&(t.remove(),t.removeAttribute("id"))}},p=[d,g,t],s[6]=d,s[7]=g,s[8]=t,s[9]=h,s[10]=p):(h=s[9],p=s[10]),(0,o.useEffect)(h,p),s[11]!==t||s[12]!==n?(l=e=>{null!==t&&(e||n(null))},s[11]=t,s[12]=n,s[13]=l):l=s[13],function(e,t,n,i){let l=(0,r.c)(7),[s]=(0,a.useLexicalComposerContext)(),d,u;l[0]!==s||l[1]!==n||l[2]!==i||l[3]!==e||l[4]!==t?(d=()=>{let r=t.current;if(null!=r&&null!=e){let e=s.getRootElement(),t=null!=e?function(e,t){let n=getComputedStyle(e),i="absolute"===n.position,r=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),!(i&&"static"===n.position)&&r.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body}(e,!1):document.body,o=!1,l=tj(r,t),a=function(){o||(window.requestAnimationFrame(function(){n(),o=!1}),o=!0);let e=tj(r,t);e!==l&&(l=e,i?.(e))},d=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",a,{capture:!0,passive:!0}),d.observe(r),()=>{d.disconnect(),window.removeEventListener("resize",n),document.removeEventListener("scroll",a,!0)}}},u=[s,i,n,e,t],l[0]=s,l[1]=n,l[2]=i,l[3]=e,l[4]=t,l[5]=d,l[6]=u):(d=l[5],u=l[6]),(0,o.useEffect)(d,u)}(t,c,g,l),c}(t,h,p,e),N=(0,o.useCallback)(()=>{p(null),null!=s&&null!==h&&s()},[s,h]),C=(0,o.useCallback)(e=>{p(e),null!=u&&null===h&&u(e)},[u,h]);return(0,o.useEffect)(()=>(0,d.mergeRegister)(g.registerCommand(tq,({node:e})=>(g.getEditorState().read(()=>{let t={leadOffset:0,matchingString:"",replaceableString:""};if(!tJ(g,t.leadOffset)&&null!==e){let e=g._window??window,n=e.document.createRange();null!==tV(t.leadOffset,n,e)&&tX(()=>C({getRect:()=>n.getBoundingClientRect(),match:t}));return}}),!0),d.COMMAND_PRIORITY_LOW)),[g,C]),(0,o.useEffect)(()=>{let e=g.registerUpdateListener(()=>{g.getEditorState().read(()=>{let e,t=g._window??window,n=t.document.createRange(),i=(0,d.$getSelection)(),r=(g.getEditorState().read(()=>{let t=(0,d.$getSelection)();(0,d.$isRangeSelection)(t)&&(e=function(e){let t=e.anchor;if("text"!==t.type)return null;let n=t.getNode();if(!n.isSimpleText())return null;let i=t.offset;return n.getTextContent().slice(0,i)}(t))}),e);if(!(0,d.$isRangeSelection)(i)||!i.isCollapsed()||void 0===r||null===n)return void N();let o=f({editor:g,query:r});(c(o?o.matchingString:null),null===o||tJ(g,o.leadOffset)||null===tV(o.leadOffset,n,t))?N():tX(()=>C({getRect:()=>n.getBoundingClientRect(),match:o}))})});return()=>{e()}},[g,f,c,h,N,C]),null===m.current||null===h||null===g?null:(0,l.jsx)(tH,{anchorElementRef:m,close:N,editor:g,groups:n,menuRenderFn:i,resolution:h,shouldSplitNodeWithQuery:!0})},"m",0,tG,"n",0,function(e,t){tQ.has(e)||tQ.set(e,new Map);let n=tQ.get(e);for(let[e,i]of Object.entries(t))if(!(!i||"object"!=typeof i)){if("blocks"===e){for(let[e,t]of Object.entries(i))n.set(`block:${e}`,t);continue}if("inlineBlocks"===e){for(let[e,t]of Object.entries(i))n.set(`inlineBlock:${e}`,t);continue}n.set(e,i)}},"o",0,function(e){tQ.delete(e)},"p",0,function({editorConfig:e,nodeViews:t}){let n=function({nodes:e}){return e.map(e=>"node"in e?e.node:e)}({nodes:e.features.nodes});if(t){let e=new Set;for(let[n,i]of Object.entries(t))i&&"object"==typeof i&&("blocks"===n&&Object.keys(i).length>0?e.add("block"):"inlineBlocks"===n&&Object.keys(i).length>0?e.add("inlineBlock"):e.add(n));for(let t of n)if("getType"in t){let n=t.getType();e.has(n)&&function({node:e,nodeType:t}){if("getType"in e&&e.getType()===t){if(e.prototype._originalDecorate||(e.prototype._originalDecorate=e.prototype.decorate),e.prototype._originalCreateDOM||(e.prototype._originalCreateDOM=e.prototype.createDOM),e.prototype.decorate&&!e.prototype._decorateOverridden){e.prototype._decorateOverridden=!0;let n=!!e.prototype.createDOM;e.prototype.decorate=function(i,r){let l=tZ(i,t,this);if(l){if(l.Component)return l.Component({config:r,editor:i,isEditor:!0,isJSXConverter:!1,node:this});if(l.createDOM&&l.html){let e="function"==typeof l.html?l.html({config:r,editor:i,isEditor:!0,isJSXConverter:!1,node:this}):l.html;return o.default.createElement("span",{dangerouslySetInnerHTML:{__html:e}})}if(l.html&&n&&!l.createDOM)return o.default.createElement(o.default.Fragment);if("block"===t){if(l.Block||l.Label)return e.prototype._originalDecorate.call(this,i,r,l.Block,l.Label)}else if("inlineBlock"===t&&(l.Block||l.Label))return e.prototype._originalDecorate.call(this,i,r,l.Block,l.Label)}return e.prototype._originalDecorate.call(this,i,r)}}e.prototype.createDOM&&!e.prototype._createDOMOverridden&&(e.prototype._createDOMOverridden=!0,e.prototype.createDOM=function(n,i){let r=tZ(i,t,this);if(r){if(r.createDOM)return r.createDOM({config:n,editor:i,node:this});if(r.html){let e="function"==typeof r.html?r.html({config:n,editor:i,isEditor:!0,isJSXConverter:!1,node:this}):r.html,t=document.createElement("div");return t.innerHTML=e,t.firstElementChild||t}}return e.prototype._originalCreateDOM.call(this,n,i)})}}({node:t,nodeType:n})}}return n}],714751)}]);