@valencets/cms 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/admin/editor/admin-client.js +2 -0
  2. package/dist/admin/editor/admin-client.js.map +1 -1
  3. package/dist/admin/editor/blocks-client.d.ts +2 -0
  4. package/dist/admin/editor/blocks-client.d.ts.map +1 -0
  5. package/dist/admin/editor/blocks-client.js +100 -0
  6. package/dist/admin/editor/blocks-client.js.map +1 -0
  7. package/dist/admin/field-renderers.d.ts.map +1 -1
  8. package/dist/admin/field-renderers.js +34 -1
  9. package/dist/admin/field-renderers.js.map +1 -1
  10. package/dist/admin/layout.d.ts.map +1 -1
  11. package/dist/admin/layout.js +62 -0
  12. package/dist/admin/layout.js.map +1 -1
  13. package/dist/admin-client.js +11 -11
  14. package/dist/auth/auth-routes.d.ts +2 -1
  15. package/dist/auth/auth-routes.d.ts.map +1 -1
  16. package/dist/auth/auth-routes.js +22 -7
  17. package/dist/auth/auth-routes.js.map +1 -1
  18. package/dist/config/cms-config.d.ts +1 -0
  19. package/dist/config/cms-config.d.ts.map +1 -1
  20. package/dist/config/cms-config.js +1 -1
  21. package/dist/config/cms-config.js.map +1 -1
  22. package/dist/db/column-map.d.ts.map +1 -1
  23. package/dist/db/column-map.js +2 -1
  24. package/dist/db/column-map.js.map +1 -1
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/schema/field-types.d.ts +16 -1
  29. package/dist/schema/field-types.d.ts.map +1 -1
  30. package/dist/schema/field-types.js +2 -1
  31. package/dist/schema/field-types.js.map +1 -1
  32. package/dist/schema/fields.d.ts +2 -1
  33. package/dist/schema/fields.d.ts.map +1 -1
  34. package/dist/schema/fields.js +3 -0
  35. package/dist/schema/fields.js.map +1 -1
  36. package/dist/schema/index.d.ts +1 -1
  37. package/dist/schema/index.d.ts.map +1 -1
  38. package/dist/schema/index.js.map +1 -1
  39. package/dist/schema/infer.d.ts +5 -2
  40. package/dist/schema/infer.d.ts.map +1 -1
  41. package/dist/validation/zod-generator.d.ts.map +1 -1
  42. package/dist/validation/zod-generator.js +31 -1
  43. package/dist/validation/zod-generator.js.map +1 -1
  44. package/package.json +2 -2
@@ -1,16 +1,16 @@
1
- "use strict";(()=>{var Rh=Object.defineProperty;var we=(n,e)=>{for(var t in e)Rh(n,t,{get:e[t],enumerable:!0})};var ha={};we(ha,{$addUpdateTag:()=>Fr,$applyNodeReplacement:()=>vo,$caretFromPoint:()=>Lt,$caretRangeFromSelection:()=>Mi,$cloneWithProperties:()=>aa,$cloneWithPropertiesEphemeral:()=>hm,$comparePointCaretNext:()=>da,$copyNode:()=>sa,$create:()=>mm,$createLineBreakNode:()=>On,$createNodeSelection:()=>Hi,$createParagraphNode:()=>mt,$createPoint:()=>ze,$createRangeSelection:()=>Nu,$createRangeSelectionFromDom:()=>zp,$createTabNode:()=>kr,$createTextNode:()=>le,$extendCaretToRange:()=>ca,$findMatchingParent:()=>ao,$getAdjacentChildCaret:()=>In,$getAdjacentNode:()=>Bu,$getAdjacentSiblingOrParentSiblingCaret:()=>Em,$getCaretInDirection:()=>Pt,$getCaretRange:()=>$t,$getCaretRangeInDirection:()=>ga,$getCharacterOffsets:()=>xi,$getChildCaret:()=>xt,$getChildCaretAtIndex:()=>td,$getChildCaretOrSelf:()=>qu,$getCollapsedCaretRange:()=>Xu,$getCommonAncestor:()=>lo,$getCommonAncestorResultBranchOrder:()=>fa,$getEditor:()=>ia,$getNearestNodeFromDOMNode:()=>wr,$getNearestRootOrShadowRoot:()=>zu,$getNodeByKey:()=>re,$getNodeByKeyOrThrow:()=>Hu,$getNodeFromDOMNode:()=>Qi,$getPreviousSelection:()=>rn,$getRoot:()=>ve,$getSelection:()=>G,$getSiblingCaret:()=>ge,$getState:()=>dr,$getStateChange:()=>cp,$getTextContent:()=>Gp,$getTextNodeOffset:()=>Ue,$getTextPointCaret:()=>It,$getTextPointCaretSlice:()=>Ei,$getWritableNodeState:()=>bi,$hasAncestor:()=>Mr,$hasUpdateTag:()=>cm,$insertNodes:()=>Yp,$isBlockElementNode:()=>Up,$isChildCaret:()=>We,$isDecoratorNode:()=>Q,$isEditorState:()=>qp,$isElementNode:()=>M,$isExtendableTextPointCaret:()=>ed,$isInlineElementOrDecoratorNode:()=>um,$isLeafNode:()=>im,$isLineBreakNode:()=>Xt,$isNodeCaret:()=>ym,$isNodeSelection:()=>To,$isParagraphNode:()=>vu,$isRangeSelection:()=>L,$isRootNode:()=>pe,$isRootOrShadowRoot:()=>Ie,$isSiblingCaret:()=>on,$isTabNode:()=>zi,$isTextNode:()=>I,$isTextPointCaret:()=>_t,$isTextPointCaretSlice:()=>Tm,$isTokenOrSegmented:()=>gt,$isTokenOrTab:()=>At,$nodesOfType:()=>lm,$normalizeCaret:()=>Ke,$normalizeSelection__EXPERIMENTAL:()=>fr,$onUpdate:()=>Uu,$parseSerializedNode:()=>Vp,$removeTextFromCaretRange:()=>Zu,$rewindSiblingCaret:()=>wn,$selectAll:()=>am,$setCompositionKey:()=>ue,$setPointFromCaret:()=>$n,$setSelection:()=>Ee,$setSelectionFromCaretRange:()=>Qu,$setState:()=>up,$splitAtPointCaretNext:()=>vm,$splitNode:()=>dm,$updateRangeSelectionFromCaretRange:()=>co,ArtificialNode__DO_NOT_USE:()=>Er,BEFORE_INPUT_COMMAND:()=>ki,BLUR_COMMAND:()=>Zc,CAN_REDO_COMMAND:()=>Sp,CAN_UNDO_COMMAND:()=>Tp,CLEAR_EDITOR_COMMAND:()=>Np,CLEAR_HISTORY_COMMAND:()=>Cp,CLICK_COMMAND:()=>Pc,COLLABORATION_TAG:()=>uu,COMMAND_PRIORITY_CRITICAL:()=>tm,COMMAND_PRIORITY_EDITOR:()=>yn,COMMAND_PRIORITY_HIGH:()=>em,COMMAND_PRIORITY_LOW:()=>Qp,COMMAND_PRIORITY_NORMAL:()=>Zp,COMPOSITION_END_COMMAND:()=>Li,COMPOSITION_END_TAG:()=>hu,COMPOSITION_START_COMMAND:()=>$i,COMPOSITION_START_TAG:()=>gu,CONTROLLED_TEXT_INSERTION_COMMAND:()=>Cn,COPY_COMMAND:()=>Bi,CUT_COMMAND:()=>Wi,DELETE_CHARACTER_COMMAND:()=>ho,DELETE_LINE_COMMAND:()=>mo,DELETE_WORD_COMMAND:()=>po,DRAGEND_COMMAND:()=>Xc,DRAGOVER_COMMAND:()=>qc,DRAGSTART_COMMAND:()=>Vc,DROP_COMMAND:()=>Jc,DecoratorNode:()=>xo,ElementNode:()=>Rt,FOCUS_COMMAND:()=>Qc,FORMAT_ELEMENT_COMMAND:()=>yp,FORMAT_TEXT_COMMAND:()=>Mt,HISTORIC_TAG:()=>Rp,HISTORY_MERGE_TAG:()=>lr,HISTORY_PUSH_TAG:()=>kp,INDENT_CONTENT_COMMAND:()=>_p,INPUT_COMMAND:()=>Ii,INSERT_LINE_BREAK_COMMAND:()=>ro,INSERT_PARAGRAPH_COMMAND:()=>li,INSERT_TAB_COMMAND:()=>mp,INTERNAL_$isBlock:()=>pt,IS_ALL_FORMATTING:()=>Hh,IS_BOLD:()=>wh,IS_CODE:()=>Wh,IS_HIGHLIGHT:()=>vi,IS_ITALIC:()=>Fh,IS_STRIKETHROUGH:()=>Kh,IS_SUBSCRIPT:()=>Uh,IS_SUPERSCRIPT:()=>zh,IS_UNDERLINE:()=>Bh,KEY_ARROW_DOWN_COMMAND:()=>Uc,KEY_ARROW_LEFT_COMMAND:()=>Kc,KEY_ARROW_RIGHT_COMMAND:()=>wc,KEY_ARROW_UP_COMMAND:()=>Wc,KEY_BACKSPACE_COMMAND:()=>Hc,KEY_DELETE_COMMAND:()=>Gc,KEY_DOWN_COMMAND:()=>Ki,KEY_ENTER_COMMAND:()=>_r,KEY_ESCAPE_COMMAND:()=>Yc,KEY_MODIFIER_COMMAND:()=>eu,KEY_SPACE_COMMAND:()=>zc,KEY_TAB_COMMAND:()=>jc,LineBreakNode:()=>En,MOVE_TO_END:()=>Fc,MOVE_TO_START:()=>Bc,NODE_STATE_KEY:()=>op,OUTDENT_CONTENT_COMMAND:()=>xp,PASTE_COMMAND:()=>Pi,PASTE_TAG:()=>Ip,ParagraphNode:()=>An,REDO_COMMAND:()=>Fi,REMOVE_TEXT_COMMAND:()=>ci,RootNode:()=>vn,SELECTION_CHANGE_COMMAND:()=>Ri,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>pp,SELECT_ALL_COMMAND:()=>ui,SKIP_COLLAB_TAG:()=>$p,SKIP_DOM_SELECTION_TAG:()=>fu,SKIP_SCROLL_INTO_VIEW_TAG:()=>du,SKIP_SELECTION_FOCUS_TAG:()=>mi,TEXT_TYPE_TO_FORMAT:()=>xe,TabNode:()=>Mn,TextNode:()=>en,UNDO_COMMAND:()=>wi,addClassNamesToElement:()=>Im,buildImportMap:()=>bp,configExtension:()=>Dm,createCommand:()=>w,createEditor:()=>nm,createSharedNodeState:()=>bc,createState:()=>lp,declarePeerDependency:()=>bm,defineExtension:()=>Am,flipDirection:()=>wt,getDOMOwnerDocument:()=>oa,getDOMSelection:()=>Ye,getDOMSelectionFromTarget:()=>Yu,getDOMTextNode:()=>nn,getEditorPropertyFromDOMNode:()=>Oo,getNearestEditorFromDOMNode:()=>Xi,getRegisteredNode:()=>Vi,getRegisteredNodeOrThrow:()=>Ji,getStaticNodeConfig:()=>Ao,getTextDirection:()=>sm,getTransformSetFromKlass:()=>Du,isBlockDomNode:()=>Si,isCurrentlyReadOnlyMode:()=>Ln,isDOMDocumentNode:()=>ku,isDOMNode:()=>Pn,isDOMTextNode:()=>tt,isDOMUnmanaged:()=>Vu,isDocumentFragment:()=>Gu,isExactShortcutMatch:()=>J,isHTMLAnchorElement:()=>fm,isHTMLElement:()=>Ne,isInlineDomNode:()=>ju,isLexicalEditor:()=>Lr,isModifierMatch:()=>Ku,isSelectionCapturedInDecoratorInput:()=>qi,isSelectionWithinEditor:()=>Eo,makeStepwiseIterator:()=>ua,mergeRegister:()=>Lm,normalizeClassNames:()=>Do,removeClassNamesFromElement:()=>$m,removeFromParent:()=>Dt,resetRandomKey:()=>om,safeCast:()=>Rm,setDOMUnmanaged:()=>pm,setNodeIndentFromDOM:()=>Ju,shallowMergeConfig:()=>km,toggleTextFormatType:()=>No});function v(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Sc(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);t.search=o.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var He=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,kh=He&&"documentMode"in document?document.documentMode:null,Fe=He&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),bt=He&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ur=!(!He||!("InputEvent"in window)||kh)&&"getTargetRanges"in new window.InputEvent("input"),Ar=He&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),So=He&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ih=He&&/Android/.test(navigator.userAgent),Tc=He&&/^(?=.*Chrome).*/i.test(navigator.userAgent),qs=He&&Ih&&Tc,Dr=He&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Fe&&!Tc,$h=0,Lh=1,Ph=2,wh=1,Fh=2,Kh=4,Bh=8,Wh=16,Uh=32,zh=64,vi=128,Hh=2047,Yh=1,Gh=2,jh=3,Jh=4,Vh=5,qh=6,uo=Ar||So||Dr?"\xA0":"\u200B",br=`
1
+ "use strict";(()=>{var Ih=Object.defineProperty;var we=(n,e)=>{for(var t in e)Ih(n,t,{get:e[t],enumerable:!0})};function no(n){let e=n.querySelector('input[type="hidden"]');if(!e)return;let t=n.querySelectorAll(".blocks-item"),o=[];for(let r of t){let i={blockType:r.getAttribute("data-block-type")??""},a=r.querySelectorAll('input:not([type="hidden"]), textarea, select');for(let l of a)l.name&&(i[l.name]=l.value);o.push(i)}e.value=JSON.stringify(o)}function $h(n,e,t){let o=document.createElement("fieldset");o.className="blocks-item",o.setAttribute("data-block-index",String(e)),o.setAttribute("data-block-type",n.slug);let r=document.createElement("legend");r.textContent=n.labels?.singular??n.slug,o.appendChild(r);for(let i of n.fields){let a=document.createElement("label");a.className="form-field";let l=document.createElement("span");l.textContent=i.name,a.appendChild(l);let c=document.createElement("input");c.className="form-input",c.type="text",c.name=i.name,c.value="",a.appendChild(c),o.appendChild(a),c.addEventListener("input",()=>no(t))}let s=document.createElement("button");return s.type="button",s.className="blocks-remove",s.textContent="Remove",s.addEventListener("click",()=>{o.remove(),no(t)}),o.appendChild(s),o}function kl(){let n=document.querySelectorAll(".blocks-field");for(let e of n){let t=e.getAttribute("data-blocks-config");if(!t)continue;let o=[];try{o=JSON.parse(t)}catch{continue}let r=e.querySelector(".blocks-add"),s=e.querySelector(".blocks-type-select"),i=e.querySelector(".blocks-add-btn"),a=e.querySelectorAll(".blocks-remove");for(let c of a)c.addEventListener("click",()=>{let u=c.closest(".blocks-item");u&&(u.remove(),no(e))});let l=e.querySelectorAll('.blocks-item input:not([type="hidden"])');for(let c of l)c.addEventListener("input",()=>no(e));!i||!s||!r||i.addEventListener("click",()=>{let c=s.value,u=o.find(h=>h.slug===c);if(!u)return;let d=e.querySelectorAll(".blocks-item"),f=$h(u,d.length,e);e.insertBefore(f,r),no(e)})}}var pa={};we(pa,{$addUpdateTag:()=>Kr,$applyNodeReplacement:()=>Ao,$caretFromPoint:()=>Lt,$caretRangeFromSelection:()=>vi,$cloneWithProperties:()=>la,$cloneWithPropertiesEphemeral:()=>_m,$comparePointCaretNext:()=>fa,$copyNode:()=>ia,$create:()=>ym,$createLineBreakNode:()=>On,$createNodeSelection:()=>Yi,$createParagraphNode:()=>mt,$createPoint:()=>ze,$createRangeSelection:()=>Su,$createRangeSelectionFromDom:()=>Gp,$createTabNode:()=>Ir,$createTextNode:()=>le,$extendCaretToRange:()=>ua,$findMatchingParent:()=>lo,$getAdjacentChildCaret:()=>In,$getAdjacentNode:()=>Uu,$getAdjacentSiblingOrParentSiblingCaret:()=>vm,$getCaretInDirection:()=>Pt,$getCaretRange:()=>$t,$getCaretRangeInDirection:()=>ha,$getCharacterOffsets:()=>yi,$getChildCaret:()=>xt,$getChildCaretAtIndex:()=>od,$getChildCaretOrSelf:()=>Qu,$getCollapsedCaretRange:()=>Zu,$getCommonAncestor:()=>co,$getCommonAncestorResultBranchOrder:()=>ga,$getEditor:()=>aa,$getNearestNodeFromDOMNode:()=>Fr,$getNearestRootOrShadowRoot:()=>Yu,$getNodeByKey:()=>re,$getNodeByKeyOrThrow:()=>Gu,$getNodeFromDOMNode:()=>Zi,$getPreviousSelection:()=>rn,$getRoot:()=>ve,$getSelection:()=>G,$getSiblingCaret:()=>ge,$getState:()=>fr,$getStateChange:()=>fp,$getTextContent:()=>Vp,$getTextNodeOffset:()=>Ue,$getTextPointCaret:()=>It,$getTextPointCaretSlice:()=>Oi,$getWritableNodeState:()=>Ri,$hasAncestor:()=>vr,$hasUpdateTag:()=>fm,$insertNodes:()=>Jp,$isBlockElementNode:()=>Yp,$isChildCaret:()=>We,$isDecoratorNode:()=>Q,$isEditorState:()=>Zp,$isElementNode:()=>M,$isExtendableTextPointCaret:()=>nd,$isInlineElementOrDecoratorNode:()=>gm,$isLeafNode:()=>cm,$isLineBreakNode:()=>Xt,$isNodeCaret:()=>Sm,$isNodeSelection:()=>Eo,$isParagraphNode:()=>Du,$isRangeSelection:()=>L,$isRootNode:()=>pe,$isRootOrShadowRoot:()=>Ie,$isSiblingCaret:()=>on,$isTabNode:()=>Hi,$isTextNode:()=>I,$isTextPointCaret:()=>_t,$isTextPointCaretSlice:()=>Mm,$isTokenOrSegmented:()=>gt,$isTokenOrTab:()=>At,$nodesOfType:()=>dm,$normalizeCaret:()=>Ke,$normalizeSelection__EXPERIMENTAL:()=>gr,$onUpdate:()=>Hu,$parseSerializedNode:()=>Qp,$removeTextFromCaretRange:()=>td,$rewindSiblingCaret:()=>wn,$selectAll:()=>um,$setCompositionKey:()=>ue,$setPointFromCaret:()=>$n,$setSelection:()=>Ee,$setSelectionFromCaretRange:()=>ed,$setState:()=>gp,$splitAtPointCaretNext:()=>bm,$splitNode:()=>hm,$updateRangeSelectionFromCaretRange:()=>uo,ArtificialNode__DO_NOT_USE:()=>Or,BEFORE_INPUT_COMMAND:()=>Ii,BLUR_COMMAND:()=>tu,CAN_REDO_COMMAND:()=>Op,CAN_UNDO_COMMAND:()=>Mp,CLEAR_EDITOR_COMMAND:()=>Tp,CLEAR_HISTORY_COMMAND:()=>Ep,CLICK_COMMAND:()=>Fc,COLLABORATION_TAG:()=>fu,COMMAND_PRIORITY_CRITICAL:()=>rm,COMMAND_PRIORITY_EDITOR:()=>yn,COMMAND_PRIORITY_HIGH:()=>om,COMMAND_PRIORITY_LOW:()=>tm,COMMAND_PRIORITY_NORMAL:()=>nm,COMPOSITION_END_COMMAND:()=>Pi,COMPOSITION_END_TAG:()=>mu,COMPOSITION_START_COMMAND:()=>Li,COMPOSITION_START_TAG:()=>pu,CONTROLLED_TEXT_INSERTION_COMMAND:()=>Cn,COPY_COMMAND:()=>Wi,CUT_COMMAND:()=>Ui,DELETE_CHARACTER_COMMAND:()=>po,DELETE_LINE_COMMAND:()=>_o,DELETE_WORD_COMMAND:()=>mo,DRAGEND_COMMAND:()=>Zc,DRAGOVER_COMMAND:()=>Qc,DRAGSTART_COMMAND:()=>Xc,DROP_COMMAND:()=>qc,DecoratorNode:()=>yo,ElementNode:()=>Rt,FOCUS_COMMAND:()=>eu,FORMAT_ELEMENT_COMMAND:()=>Sp,FORMAT_TEXT_COMMAND:()=>Mt,HISTORIC_TAG:()=>$p,HISTORY_MERGE_TAG:()=>cr,HISTORY_PUSH_TAG:()=>Lp,INDENT_CONTENT_COMMAND:()=>Np,INPUT_COMMAND:()=>$i,INSERT_LINE_BREAK_COMMAND:()=>so,INSERT_PARAGRAPH_COMMAND:()=>ci,INSERT_TAB_COMMAND:()=>yp,INTERNAL_$isBlock:()=>pt,IS_ALL_FORMATTING:()=>jh,IS_BOLD:()=>Bh,IS_CODE:()=>Hh,IS_HIGHLIGHT:()=>Ai,IS_ITALIC:()=>Wh,IS_STRIKETHROUGH:()=>Uh,IS_SUBSCRIPT:()=>Yh,IS_SUPERSCRIPT:()=>Gh,IS_UNDERLINE:()=>zh,KEY_ARROW_DOWN_COMMAND:()=>Hc,KEY_ARROW_LEFT_COMMAND:()=>Wc,KEY_ARROW_RIGHT_COMMAND:()=>Kc,KEY_ARROW_UP_COMMAND:()=>zc,KEY_BACKSPACE_COMMAND:()=>Gc,KEY_DELETE_COMMAND:()=>Jc,KEY_DOWN_COMMAND:()=>Bi,KEY_ENTER_COMMAND:()=>xr,KEY_ESCAPE_COMMAND:()=>jc,KEY_MODIFIER_COMMAND:()=>nu,KEY_SPACE_COMMAND:()=>Yc,KEY_TAB_COMMAND:()=>Vc,LineBreakNode:()=>En,MOVE_TO_END:()=>Bc,MOVE_TO_START:()=>Uc,NODE_STATE_KEY:()=>ip,OUTDENT_CONTENT_COMMAND:()=>Cp,PASTE_COMMAND:()=>wi,PASTE_TAG:()=>Pp,ParagraphNode:()=>An,REDO_COMMAND:()=>Ki,REMOVE_TEXT_COMMAND:()=>ui,RootNode:()=>vn,SELECTION_CHANGE_COMMAND:()=>ki,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:()=>xp,SELECT_ALL_COMMAND:()=>di,SKIP_COLLAB_TAG:()=>wp,SKIP_DOM_SELECTION_TAG:()=>hu,SKIP_SCROLL_INTO_VIEW_TAG:()=>gu,SKIP_SELECTION_FOCUS_TAG:()=>_i,TEXT_TYPE_TO_FORMAT:()=>xe,TabNode:()=>Mn,TextNode:()=>en,UNDO_COMMAND:()=>Fi,addClassNamesToElement:()=>Pm,buildImportMap:()=>Ip,configExtension:()=>km,createCommand:()=>w,createEditor:()=>sm,createSharedNodeState:()=>kc,createState:()=>dp,declarePeerDependency:()=>Im,defineExtension:()=>Rm,flipDirection:()=>wt,getDOMOwnerDocument:()=>ra,getDOMSelection:()=>Ye,getDOMSelectionFromTarget:()=>ju,getDOMTextNode:()=>nn,getEditorPropertyFromDOMNode:()=>Mo,getNearestEditorFromDOMNode:()=>Qi,getRegisteredNode:()=>qi,getRegisteredNodeOrThrow:()=>Vi,getStaticNodeConfig:()=>Do,getTextDirection:()=>lm,getTransformSetFromKlass:()=>Ru,isBlockDomNode:()=>Ti,isCurrentlyReadOnlyMode:()=>Ln,isDOMDocumentNode:()=>$u,isDOMNode:()=>Pn,isDOMTextNode:()=>tt,isDOMUnmanaged:()=>Xu,isDocumentFragment:()=>Ju,isExactShortcutMatch:()=>J,isHTMLAnchorElement:()=>pm,isHTMLElement:()=>Ne,isInlineDomNode:()=>Vu,isLexicalEditor:()=>Pr,isModifierMatch:()=>Wu,isSelectionCapturedInDecoratorInput:()=>Xi,isSelectionWithinEditor:()=>Oo,makeStepwiseIterator:()=>da,mergeRegister:()=>Fm,normalizeClassNames:()=>bo,removeClassNamesFromElement:()=>wm,removeFromParent:()=>Dt,resetRandomKey:()=>im,safeCast:()=>$m,setDOMUnmanaged:()=>xm,setNodeIndentFromDOM:()=>qu,shallowMergeConfig:()=>Lm,toggleTextFormatType:()=>Co});function v(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Ec(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);t.search=o.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var He=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Lh=He&&"documentMode"in document?document.documentMode:null,Fe=He&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),bt=He&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),dr=!(!He||!("InputEvent"in window)||Lh)&&"getTargetRanges"in new window.InputEvent("input"),Dr=He&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),To=He&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ph=He&&/Android/.test(navigator.userAgent),Oc=He&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Xs=He&&Ph&&Oc,br=He&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Fe&&!Oc,wh=0,Fh=1,Kh=2,Bh=1,Wh=2,Uh=4,zh=8,Hh=16,Yh=32,Gh=64,Ai=128,jh=2047,Jh=1,Vh=2,qh=3,Xh=4,Qh=5,Zh=6,fo=Dr||To||br?"\xA0":"\u200B",Rr=`
2
2
 
3
- `,Ai=bt?"\xA0":uo,Ec="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Oc="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Xh=new RegExp("^[^"+Oc+"]*["+Ec+"]"),Qh=new RegExp("^[^"+Ec+"]*["+Oc+"]"),xe={bold:1,capitalize:1024,code:16,highlight:vi,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Zh={directionless:1,unmergeable:2},Xs={center:2,end:6,justify:4,left:1,right:3,start:5},ep={[Gh]:"center",[qh]:"end",[Jh]:"justify",[Yh]:"left",[jh]:"right",[Vh]:"start"},tp={normal:0,segmented:2,token:1},np={[$h]:"normal",[Ph]:"segmented",[Lh]:"token"},op="$",Rl="$config";function Mc(n,e,t,o,r,s){let i=n.getFirstChild();for(;i!==null;){let a=i.__key;i.__parent===e&&(M(i)&&Mc(i,a,t,o,r,s),t.has(a)||s.delete(a),r.push(a)),i=i.getNextSibling()}}var Qs=!1,Di=0;function rp(n){Di=n.timeStamp}function Bs(n,e,t){let o=n.nodeName==="BR",r=e.__lexicalLineBreak;return r&&(n===r||o&&n.previousSibling===r)||o&&Pr(n,t)!==void 0}function sp(n,e,t){let o=Ye(Ae(t)),r=null,s=null;o!==null&&o.anchorNode===n&&(r=o.anchorOffset,s=o.focusOffset);let i=n.nodeValue;i!==null&&ta(e,i,r,s,!1)}function ip(n,e,t){if(L(n)){let o=n.anchor.getNode();if(o.is(t)&&n.format!==o.getFormat())return!1}return tt(e)&&t.isAttached()}function ap(n,e,t,o){for(let r=n;r&&!Vu(r);r=Mo(r)){let s=Pr(r,e);if(s!==void 0){let i=re(s,t);if(i)return Q(i)||!Ne(r)?void 0:[r,i]}else if(r===o)return[o,Lu(t)]}}function vc(n,e,t){Qs=!0;let o=performance.now()-Di>100;try{et(n,()=>{let r=G()||(function(f){return f.getEditorState().read(()=>{let h=G();return h!==null?h.clone():null})})(n),s=new Map,i=n.getRootElement(),a=n._editorState,l=n._blockCursorElement,c=!1,u="";for(let f=0;f<e.length;f++){let h=e[f],g=h.type,p=h.target,m=ap(p,n,a,i);if(!m)continue;let[x,y]=m;if(g==="characterData")o&&I(y)&&tt(p)&&ip(r,p,y)&&sp(p,y,n);else if(g==="childList"){c=!0;let N=h.addedNodes;for(let E=0;E<N.length;E++){let A=N[E],C=Qi(A),S=A.parentNode;if(S!=null&&A!==l&&C===null&&!Bs(A,S,n)){if(bt){let k=(Ne(A)?A.innerText:null)||A.nodeValue;k&&(u+=k)}S.removeChild(A)}}let T=h.removedNodes,O=T.length;if(O>0){let E=0;for(let A=0;A<O;A++){let C=T[A];(Bs(C,p,n)||l===C)&&(p.appendChild(C),E++)}O!==E&&s.set(x,y)}}}if(s.size>0)for(let[f,h]of s)h.reconcileObservedMutation(f,n);let d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){let h=d[f],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){let x=g[m],y=x.parentNode;y==null||x.nodeName!=="BR"||Bs(x,p,n)||y.removeChild(x)}}t.takeRecords()}r!==null&&(c&&Ee(r),bt&&Wu(n)&&r.insertRawText(u))})}finally{Qs=!1}}function Ac(n){let e=n._observer;e!==null&&vc(n,e.takeRecords(),e)}function Dc(n){(function(e){Di===0&&Ae(e).addEventListener("textInput",rp,!0)})(n),n._observer=new MutationObserver((e,t)=>{vc(n,e,t)})}var Zs=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||dp).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function lp(n,e){return new Zs(n,e)}function dr(n,e,t="latest"){let o=(t==="latest"?n.getLatest():n).__state;return o?o.getValue(e):e.defaultValue}function cp(n,e,t){let o=dr(n,t,"direct"),r=dr(e,t,"direct");return t.isEqual(o,r)?null:[o,r]}function up(n,e,t){let o;if(ce(),typeof t=="function"){let s=n.getLatest(),i=dr(s,e);if(o=t(i),e.isEqual(i,o))return s}else o=t;let r=n.getWritable();return bi(r).updateFromKnown(e,o),r}function bc(n){let e=new Map,t=new Set;for(let o=typeof n=="function"?n:n.replace;o.prototype&&o.prototype.getType!==void 0;o=Object.getPrototypeOf(o)){let{ownNodeConfig:r}=Ao(o);if(r&&r.stateConfigs)for(let s of r.stateConfigs){let i;"stateConfig"in s?(i=s.stateConfig,s.flat&&t.add(i.key)):i=s,e.set(i.key,i)}}return{flatKeys:t,sharedConfigMap:e}}var ei=class n{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,o=void 0,r=new Map,s=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=o,this.knownState=r;let{sharedConfigMap:i}=this.sharedNodeState,a=s!==void 0?s:(function(l,c,u){let d=u.size;if(c)for(let f in c){let h=l.get(f);h&&u.has(h)||d++}return d})(i,o,r);this.size=a}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let o=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let r=this.unknownState[e.key];r!==void 0&&(o=e.parse(r)),this.updateFromKnown(e,o)}return o}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[o,r]of this.knownState)o.isEqual(r,o.defaultValue)?delete e[o.key]:e[o.key]=o.unparse(r);for(let o of this.sharedNodeState.flatKeys)o in e&&(t[o]=e[o],delete e[o]);return kl(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;let{sharedNodeState:t,unknownState:o}=this,r=new Map(this.knownState);return new n(e,t,(function(s,i,a){let l;if(a)for(let[c,u]of Object.entries(a)){let d=s.get(c);d?i.has(d)||i.set(d,d.parse(u)):(l=l||{},l[c]=u)}return l})(t.sharedConfigMap,r,o),r,this.size)}updateFromKnown(e,t){let o=e.key;this.sharedNodeState.sharedConfigMap.set(o,e);let{knownState:r,unknownState:s}=this;r.has(e)||s&&o in s||(s&&(delete s[o],this.unknownState=kl(s)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let o=this.sharedNodeState.sharedConfigMap.get(e);o?this.updateFromKnown(o,o.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let o of t.keys())t.set(o,o.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[o,r]of Object.entries(e))this.updateFromUnknown(o,r)}};function bi(n){let e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new ei(e,Rc(e));return e.__state=t,t}function Rc(n){return n.__state?n.__state.sharedNodeState:Ji(ia(),n.getType()).sharedNodeState}function kl(n){if(n)for(let e in n)return n}function dp(n){return n}function Il(n,e,t){for(let[o,r]of e.knownState){if(n.has(o.key))continue;n.add(o.key);let s=t?t.getValue(o):o.defaultValue;if(s!==r&&!o.isEqual(s,r))return!0}return!1}function $l(n,e,t){let{unknownState:o}=e,r=t?t.unknownState:void 0;if(o){for(let[s,i]of Object.entries(o))if(!n.has(s)&&(n.add(s),i!==(r?r[s]:void 0)))return!0}return!1}function Ll(n,e){let t=n.__state;return t&&t.node===n?t.getWritable(e):t}function Pl(n,e){let t=n.__mode,o=n.__format,r=n.__style,s=e.__mode,i=e.__format,a=e.__style,l=n.__state,c=e.__state;return(t===null||t===s)&&(o===null||o===i)&&(r===null||r===a)&&(n.__state===null||l===c||(function(u,d){if(u===d)return!0;if(u&&d&&u.size!==d.size)return!1;let f=new Set;return!(u&&Il(f,u,d)||d&&Il(f,d,u)||u&&$l(f,u,d)||d&&$l(f,d,u))})(l,c))}function wl(n,e){let t=n.mergeWithSibling(e),o=X()._normalizedNodes;return o.add(n.__key),o.add(e.__key),t}function Fl(n){let e,t,o=n;if(o.__text!==""||!o.isSimpleText()||o.isUnmergeable()){for(;(e=o.getPreviousSibling())!==null&&I(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Pl(e,o)){o=wl(e,o);break}break}e.remove()}for(;(t=o.getNextSibling())!==null&&I(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Pl(o,t)){o=wl(o,t);break}break}t.remove()}}else o.remove()}function fr(n){return Kl(n.anchor),Kl(n.focus),n}function Kl(n){for(;n.type==="element";){let e=n.getNode(),t=n.offset,o,r;if(t===e.getChildrenSize()?(o=e.getChildAtIndex(t-1),r=!0):(o=e.getChildAtIndex(t),r=!1),I(o)){n.set(o.__key,r?o.getTextContentSize():0,"text",!0);break}if(!M(o))break;n.set(o.__key,r?o.getChildrenSize():0,"element",!0)}}var Qt,me,fo,Rr,ti,ni,Zt,Be,oi,go,oe="",Ze=null,Vt=null,_n=!1,gr=!1;function hr(n,e){let t=Zt.get(n);if(e!==null){let o=ai(n);o.parentNode===e&&e.removeChild(o)}if(Be.has(n)||me._keyToDOMMap.delete(n),M(t)){let o=mr(t,Zt);ri(o,0,o.length-1,null)}t!==void 0&&na(go,fo,Rr,t,"destroyed")}function ri(n,e,t,o){for(let r=e;r<=t;++r){let s=n[r];s!==void 0&&hr(s,o)}}function Jt(n,e){n.setProperty("text-align",e)}var fp="40px";function kc(n,e){let t=Qt.theme.indent;if(typeof t=="string"){let r=n.classList.contains(t);e>0&&!r?n.classList.add(t):e<1&&r&&n.classList.remove(t)}if(e===0)return void n.style.setProperty("padding-inline-start","");let o=getComputedStyle(me._rootElement||n).getPropertyValue("--lexical-indent-base-value")||fp;n.style.setProperty("padding-inline-start",`calc(${e} * ${o})`)}function Ic(n,e){let t=n.style;e===0?Jt(t,""):e===1?Jt(t,"left"):e===2?Jt(t,"center"):e===3?Jt(t,"right"):e===4?Jt(t,"justify"):e===5?Jt(t,"start"):e===6&&Jt(t,"end")}function si(n,e){let t=(function(o){let r=o.__dir;if(r!==null)return r;if(pe(o))return null;let s=o.getParentOrThrow();return pe(s)&&s.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function pr(n,e){let t=Be.get(n);t===void 0&&v(60);let o=t.createDOM(Qt,me);if((function(r,s,i){let a=i._keyToDOMMap;(function(l,c,u){let d=`__lexicalKey_${c._key}`;l[d]=u})(s,i,r),a.set(r,s)})(n,o,me),I(t)?o.setAttribute("data-lexical-text","true"):Q(t)&&o.setAttribute("data-lexical-decorator","true"),M(t)){let r=t.__indent,s=t.__size;if(si(o,t),r!==0&&kc(o,r),s!==0){let a=s-1;ii(mr(t,Be),t,0,a,t.getDOMSlot(o))}let i=t.__format;i!==0&&Ic(o,i),t.isInline()||$c(null,t,o)}else{let r=t.getTextContent();if(Q(t)){let s=t.decorate(me,Qt);s!==null&&Lc(n,s),o.contentEditable="false"}oe+=r}return e!==null&&e.insertChild(o),na(go,fo,Rr,t,"created"),o}function ii(n,e,t,o,r){let s=oe;oe="";let i=t;for(;i<=o;++i){pr(n[i],r);let a=Be.get(n[i]);a!==null&&I(a)?Ze===null&&(Ze=a.getFormat(),Vt=a.getStyle()):M(a)&&i<o&&!a.isInline()&&(oe+=br)}r.element.__lexicalTextContent=oe,oe=s+oe}function Bl(n,e){if(n){let t=n.__last;if(t){let o=e.get(t);if(o)return Xt(o)?"line-break":Q(o)&&o.isInline()?"decorator":null}return"empty"}return null}function $c(n,e,t){let o=Bl(n,Zt),r=Bl(e,Be);o!==r&&e.getDOMSlot(t).setManagedLineBreak(r)}function gp(n,e,t){var o;Ze=null,Vt=null,(function(r,s,i){let a=oe,l=r.__size,c=s.__size;oe="";let u=i.element;if(l===1&&c===1){let d=r.__first,f=s.__first;if(d===f)rr(d,u);else{let g=ai(d),p=pr(f,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){let x=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${f}}, old child: {tag: ${g.tagName}, key: ${d}}.`;throw new Error(x)}throw m}hr(d,null)}let h=Be.get(f);I(h)&&Ze===null&&(Ze=h.getFormat(),Vt=h.getStyle())}else{let d=mr(r,Zt),f=mr(s,Be);if(d.length!==l&&v(227),f.length!==c&&v(228),l===0)c!==0&&ii(f,0,0,c-1,i);else if(c===0){if(l!==0){let h=i.after==null&&i.before==null&&i.element.__lexicalLineBreak==null;ri(d,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,x,y){let N=m-1,T=x-1,O,E,A=y.getFirstChild(),C=0,S=0;for(;C<=N&&S<=T;){let j=g[C],Y=p[S];if(j===Y)A=Ws(rr(Y,y.element)),C++,S++;else{if(E===void 0&&(E=Wl(p,S)),O===void 0)O=Wl(g,C);else if(!O.has(j)){C++;continue}if(!E.has(j)){A=Ws(ai(j)),hr(j,y.element),C++,O.delete(j);continue}if(O.has(Y)){let te=Dn(me,Y);te!==A&&y.withBefore(A).insertChild(te),A=Ws(rr(Y,y.element)),C++,S++}else pr(Y,y.withBefore(A)),S++}let H=Be.get(Y);H!==null&&I(H)?Ze===null&&(Ze=H.getFormat(),Vt=H.getStyle()):M(H)&&S<=T&&!H.isInline()&&(oe+=br)}let k=C>N,F=S>T;if(k&&!F){let j=p[T+1],Y=j===void 0?null:me.getElementByKey(j);ii(p,0,S,T,y.withBefore(Y))}else F&&!k&&ri(g,C,N,y.element)})(0,d,f,l,c,i)}u.__lexicalTextContent=oe,oe=a+oe})(n,e,e.getDOMSlot(t)),o=e,Ze==null||Ze===o.__textFormat||gr||o.setTextFormat(Ze),(function(r){Vt==null||Vt===r.__textStyle||gr||r.setTextStyle(Vt)})(e)}function mr(n,e){let t=[],o=n.__first;for(;o!==null;){let r=e.get(o);r===void 0&&v(101),t.push(o),o=r.__next}return t}function rr(n,e){let t=Zt.get(n),o=Be.get(n);t!==void 0&&o!==void 0||v(61);let r=_n||ni.has(n)||ti.has(n),s=Dn(me,n);if(t===o&&!r){let i;if(M(t)){let a=s.__lexicalTextContent;typeof a=="string"?i=a:(i=t.getTextContent(),s.__lexicalTextContent=i)}else i=t.getTextContent();return oe+=i,s}if(t!==o&&r&&na(go,fo,Rr,o,"updated"),o.updateDOM(t,s,Qt)){let i=pr(n,null);return e===null&&v(62),e.replaceChild(i,s),hr(n,null),i}if(M(t)){M(o)||v(334,n);let i=o.__indent;(_n||i!==t.__indent)&&kc(s,i);let a=o.__format;if((_n||a!==t.__format)&&Ic(s,a),r)gp(t,o,s),pe(o)||o.isInline()||$c(t,o,s);else{let l=s.__lexicalTextContent,c;typeof l=="string"?c=l:(c=t.getTextContent(),s.__lexicalTextContent=c),oe+=c}if((_n||o.__dir!==t.__dir)&&(si(s,o),pe(o)&&!_n))for(let l of o.getChildren())M(l)&&si(Dn(me,l.getKey()),l)}else{let i=o.getTextContent();if(Q(o)){let a=o.decorate(me,Qt);a!==null&&Lc(n,a)}oe+=i}if(!gr&&pe(o)&&o.__cachedText!==oe){let i=o.getWritable();i.__cachedText=oe,o=i}return s}function Lc(n,e){let t=me._pendingDecorators,o=me._decorators;if(t===null){if(o[n]===e)return;t=$u(me)}t[n]=e}function Ws(n){let e=n.nextSibling;return e!==null&&e===me._blockCursorElement&&(e=e.nextSibling),e}function Wl(n,e){let t=new Set;for(let o=e;o<n.length;o++)t.add(n[o]);return t}function hp(n,e,t,o,r,s){oe="",_n=o===2,me=t,Qt=t._config,fo=t._nodes,Rr=me._listeners.mutation,ti=r,ni=s,Zt=n._nodeMap,Be=e._nodeMap,gr=e._readOnly,oi=new Map(t._keyToDOMMap);let i=new Map;return go=i,rr("root",null),me=void 0,fo=void 0,ti=void 0,ni=void 0,Zt=void 0,Be=void 0,Qt=void 0,oi=void 0,go=void 0,i}function ai(n){let e=oi.get(n);return e===void 0&&v(75,n),e}function w(n){return{type:n}}var Ri=w("SELECTION_CHANGE_COMMAND"),pp=w("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Pc=w("CLICK_COMMAND"),ki=w("BEFORE_INPUT_COMMAND"),Ii=w("INPUT_COMMAND"),$i=w("COMPOSITION_START_COMMAND"),Li=w("COMPOSITION_END_COMMAND"),ho=w("DELETE_CHARACTER_COMMAND"),ro=w("INSERT_LINE_BREAK_COMMAND"),li=w("INSERT_PARAGRAPH_COMMAND"),Cn=w("CONTROLLED_TEXT_INSERTION_COMMAND"),Pi=w("PASTE_COMMAND"),ci=w("REMOVE_TEXT_COMMAND"),po=w("DELETE_WORD_COMMAND"),mo=w("DELETE_LINE_COMMAND"),Mt=w("FORMAT_TEXT_COMMAND"),wi=w("UNDO_COMMAND"),Fi=w("REDO_COMMAND"),Ki=w("KEYDOWN_COMMAND"),wc=w("KEY_ARROW_RIGHT_COMMAND"),Fc=w("MOVE_TO_END"),Kc=w("KEY_ARROW_LEFT_COMMAND"),Bc=w("MOVE_TO_START"),Wc=w("KEY_ARROW_UP_COMMAND"),Uc=w("KEY_ARROW_DOWN_COMMAND"),_r=w("KEY_ENTER_COMMAND"),zc=w("KEY_SPACE_COMMAND"),Hc=w("KEY_BACKSPACE_COMMAND"),Yc=w("KEY_ESCAPE_COMMAND"),Gc=w("KEY_DELETE_COMMAND"),jc=w("KEY_TAB_COMMAND"),mp=w("INSERT_TAB_COMMAND"),_p=w("INDENT_CONTENT_COMMAND"),xp=w("OUTDENT_CONTENT_COMMAND"),Jc=w("DROP_COMMAND"),yp=w("FORMAT_ELEMENT_COMMAND"),Vc=w("DRAGSTART_COMMAND"),qc=w("DRAGOVER_COMMAND"),Xc=w("DRAGEND_COMMAND"),Bi=w("COPY_COMMAND"),Wi=w("CUT_COMMAND"),ui=w("SELECT_ALL_COMMAND"),Np=w("CLEAR_EDITOR_COMMAND"),Cp=w("CLEAR_HISTORY_COMMAND"),Sp=w("CAN_REDO_COMMAND"),Tp=w("CAN_UNDO_COMMAND"),Qc=w("FOCUS_COMMAND"),Zc=w("BLUR_COMMAND"),eu=w("KEY_MODIFIER_COMMAND"),ut=Object.freeze({}),di=[["keydown",function(n,e){_o=n.timeStamp,tu=n.key,!e.isComposing()&&b(e,Ki,n)}],["pointerdown",function(n,e){let t=n.target,o=n.pointerType;Pn(t)&&o!=="touch"&&o!=="pen"&&n.button===0&&et(e,()=>{Ru(t)||(hi=!0)})}],["compositionstart",function(n,e){b(e,$i,n)}],["compositionend",function(n,e){bt?oo=!0:So||!Ar&&!Dr?b(e,Li,n):(sr=!0,ir=n.data)}],["input",function(n,e){n.stopPropagation(),et(e,()=>{e.dispatchCommand(Ii,n)},{event:n}),xn=null}],["click",function(n,e){et(e,()=>{let t=G(),o=Ye(Ae(e)),r=rn();if(o){if(L(t)){let s=t.anchor,i=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!pe(i)&&ve().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&r!==null&&t.is(r))o.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&i!==t.focus.getNode()){let a=ao(i,l=>M(l)&&!l.isInline());M(a)&&a.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){let s=o.anchorNode;(Ne(s)||tt(s))&&Ee(Ir(r,o,e,n))}}b(e,Pc,n)})}],["cut",ut],["copy",ut],["dragstart",ut],["dragover",ut],["dragend",ut],["paste",ut],["focus",ut],["blur",ut],["drop",ut]];ur&&di.push(["beforeinput",(n,e)=>(function(t,o){let r=t.inputType;r==="deleteCompositionText"||bt&&Wu(o)||r!=="insertCompositionText"&&b(o,ki,t)})(n,e)]);var _o=0,tu=null,nu=0,xn=null,fi=new WeakMap,xr=new WeakMap,gi=!1,hi=!1,so=!1,oo=!1,sr=!1,ir="",qt=null,ou=[0,"",0,"root",0];function ru(n,e,t,o,r){let s=n.anchor,i=n.focus,a=s.getNode(),l=X(),c=Ye(Ae(l)),u=c!==null?c.anchorNode:null,d=s.key,f=l.getElementByKey(d),h=t.length;return d!==i.key||!I(a)||(!r&&(!ur||nu<o+50)||a.isDirty()&&h<2||Pu(t))&&s.offset!==i.offset&&!a.isComposing()||gt(a)||a.isDirty()&&h>1||(r||!ur)&&f!==null&&!a.isComposing()&&u!==nn(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||!a.isComposing()&&(a.getFormat()!==n.format||a.getStyle()!==n.style)||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;let m=g.anchor.offset,x=p.getParentOrThrow(),y=At(p);return m===0?!p.canInsertTextBefore()||!x.canInsertTextBefore()&&!p.isComposing()||y||(function(N){let T=N.getPreviousSibling();return(I(T)||M(T)&&T.isInline())&&!T.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!x.canInsertTextAfter()&&!p.isComposing()||y)})(n,a)}function Ul(n,e){return tt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function zl(n,e,t){let{anchorNode:o,anchorOffset:r,focusNode:s,focusOffset:i}=n;gi&&(gi=!1,Ul(o,r)&&Ul(s,i)&&!qt)||et(e,()=>{if(!t)return void Ee(null);if(!Eo(e,o,s))return;let a=G();if(qt&&L(a)&&a.isCollapsed()){let l=a.anchor,c=qt.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=qt.clone(),Ee(a))}if(qt=null,L(a)){let l=a.anchor,c=l.getNode();if(a.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(a.dirty=!0);let u=Ae(e).event,d=u?u.timeStamp:performance.now(),[f,h,g,p,m]=ou,x=ve(),y=e.isComposing()===!1&&x.getTextContent()==="";if(d<m+200&&l.offset===g&&l.key===p)ar(a,f,h);else if(l.type==="text")I(c)||v(141),su(a,c);else if(l.type==="element"&&!y){M(c)||v(259);let N=l.getNode();N.isEmpty()?(function(T,O){let E=O.getTextFormat(),A=O.getTextStyle();ar(T,E,A)})(a,N):ar(a,0,"")}}else{let u=l.key,d=a.focus.key,f=a.getNodes(),h=f.length,g=a.isBackward(),p=g?i:r,m=g?r:i,x=g?d:u,y=g?u:d,N=2047,T=!1;for(let O=0;O<h;O++){let E=f[O],A=E.getTextContentSize();if(I(E)&&A!==0&&!(O===0&&E.__key===x&&p===A||O===h-1&&E.__key===y&&m===0)&&(T=!0,N&=E.getFormat(),N===0))break}a.format=T?N:0}}b(e,Ri,void 0)})}function ar(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function su(n,e){ar(n,e.getFormat(),e.getStyle())}function iu(n){if(!n.getTargetRanges)return null;let e=n.getTargetRanges();return e.length===0?null:e[0]}function Ep(n){let e=n.inputType,t=iu(n),o=X(),r=G();if(e==="deleteContentBackward"){if(r===null){let d=rn();if(!L(d))return!0;Ee(d.clone())}if(L(r)){let d=r.anchor.key===r.focus.key;if(s=n.timeStamp,tu==="MediaLast"&&s<_o+30&&o.isComposing()&&d){if(ue(null),_o=0,setTimeout(()=>{et(o,()=>{ue(null)})},30),L(r)){let f=r.anchor.getNode();f.markDirty(),I(f)||v(142),su(r,f)}}else{ue(null),n.preventDefault();let f=r.anchor.getNode(),h=f.getTextContent(),g=f.canInsertTextAfter(),p=r.anchor.offset===0&&r.focus.offset===h.length,m=qs&&d&&!p&&g;if(m&&r.isCollapsed()&&(m=!Q(Bu(r.anchor,!0))),!m){b(o,ho,!0);let x=G();qs&&L(x)&&x.isCollapsed()&&(qt=x,setTimeout(()=>qt=null))}}return!0}}var s;if(!L(r))return!0;let i=n.data;xn!==null&&ea(!1,o,xn),r.dirty&&xn===null||!r.isCollapsed()||pe(r.anchor.getNode())||t===null||r.applyDOMRange(t),xn=null;let a=r.anchor,l=r.focus,c=a.getNode(),u=l.getNode();if(e==="insertText"||e==="insertTranspose"){if(i===`
4
- `)n.preventDefault(),b(o,ro,!1);else if(i===br)n.preventDefault(),b(o,li,void 0);else if(i==null&&n.dataTransfer){let d=n.dataTransfer.getData("text/plain");n.preventDefault(),r.insertRawText(d)}else i!=null&&ru(r,t,i,n.timeStamp,!0)?(n.preventDefault(),b(o,Cn,i)):xn=i;return nu=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":b(o,Cn,n);break;case"insertFromComposition":ue(null),b(o,Cn,n);break;case"insertLineBreak":ue(null),b(o,ro,!1);break;case"insertParagraph":ue(null),so&&!So?(so=!1,b(o,ro,!1)):b(o,li,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":b(o,Pi,n);break;case"deleteByComposition":(function(d,f){return d!==f||M(d)||M(f)||!At(d)||!At(f)})(c,u)&&b(o,ci,n);break;case"deleteByDrag":case"deleteByCut":b(o,ci,n);break;case"deleteContent":b(o,ho,!1);break;case"deleteWordBackward":b(o,po,!0);break;case"deleteWordForward":b(o,po,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":b(o,mo,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":b(o,mo,!1);break;case"formatStrikeThrough":b(o,Mt,"strikethrough");break;case"formatBold":b(o,Mt,"bold");break;case"formatItalic":b(o,Mt,"italic");break;case"formatUnderline":b(o,Mt,"underline");break;case"historyUndo":b(o,wi,void 0);break;case"historyRedo":b(o,Fi,void 0)}return!0}function Op(n){if(Ne(n.target)&&Ru(n.target))return!0;let e=X(),t=G(),o=n.data,r=iu(n);if(o!=null&&L(t)&&ru(t,r,o,n.timeStamp,!1)){oo&&(yr(e,o),oo=!1);let s=t.anchor.getNode(),i=Ye(Ae(e));if(i===null)return!0;let a=t.isBackward(),l=a?t.anchor.offset:t.focus.offset,c=a?t.focus.offset:t.anchor.offset;ur&&!t.isCollapsed()&&I(s)&&i.anchorNode!==null&&s.getTextContent().slice(0,l)+o+s.getTextContent().slice(l+c)===Fu(i.anchorNode)||b(e,Cn,o);let u=o.length;bt&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),qs&&e.isComposing()&&(_o=0,ue(null))}else ea(!1,e,o!==null?o:void 0),oo&&(yr(e,o||void 0),oo=!1);return(function(){ce();let s=X();Ac(s)})(),!0}function Mp(n){let e=X(),t=G();if(L(t)&&!e.isComposing()){let o=t.anchor,r=t.anchor.getNode();ue(o.key),Fr(gu),(n.timeStamp<_o+30||o.type==="element"||!t.isCollapsed()||r.getFormat()!==t.format||I(r)&&r.getStyle()!==t.style)&&b(e,Cn,Ai)}return!0}function vp(n){return yr(X(),n.data),Fr(hu),!0}function yr(n,e){let t=n._compositionKey;if(ue(null),t!==null&&e!=null){if(e===""){let o=re(t),r=nn(n.getElementByKey(t));if(r!==null&&r.nodeValue!==null&&I(o)){let s=Ye(Ae(n)),i=null,a=null;s!==null&&s.anchorNode===r&&(i=s.anchorOffset,a=s.focusOffset),ta(o,r.nodeValue,i,a,!0)}return}if(e[e.length-1]===`
5
- `){let o=G();if(L(o)||To(o)){if(L(o)){let r=o.focus;o.anchor.set(r.key,r.offset,r.type)}return void b(n,_r,null)}}}ea(!0,n,e)}function Ap(n){let e=X();if(n.key==null)return!0;if(sr){if(mc(n))return et(e,()=>{yr(e,ir)}),sr=!1,ir="",!0;sr=!1,ir=""}if((function(t){return J(t,"ArrowRight",{shiftKey:"any"})})(n))b(e,wc,n);else if((function(t){return J(t,"ArrowRight",ft)})(n))b(e,Fc,n);else if((function(t){return J(t,"ArrowLeft",{shiftKey:"any"})})(n))b(e,Kc,n);else if((function(t){return J(t,"ArrowLeft",ft)})(n))b(e,Bc,n);else if((function(t){return J(t,"ArrowUp",{altKey:"any",shiftKey:"any"})})(n))b(e,Wc,n);else if((function(t){return J(t,"ArrowDown",{altKey:"any",shiftKey:"any"})})(n))b(e,Uc,n);else if((function(t){return J(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(n))so=!0,b(e,_r,n);else if((function(t){return t.key===" "})(n))b(e,zc,n);else if((function(t){return Fe&&J(t,"o",{ctrlKey:!0})})(n))n.preventDefault(),so=!0,b(e,ro,!0);else if((function(t){return J(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(n))so=!1,b(e,_r,n);else if((function(t){return J(t,"Backspace",{shiftKey:"any"})||Fe&&J(t,"h",{ctrlKey:!0})})(n))mc(n)?b(e,Hc,n):(n.preventDefault(),b(e,ho,!0));else if((function(t){return t.key==="Escape"})(n))b(e,Yc,n);else if((function(t){return J(t,"Delete",{})||Fe&&J(t,"d",{ctrlKey:!0})})(n))(function(t){return t.key==="Delete"})(n)?b(e,Gc,n):(n.preventDefault(),b(e,ho,!1));else if((function(t){return J(t,"Backspace",pc)})(n))n.preventDefault(),b(e,po,!0);else if((function(t){return J(t,"Delete",pc)})(n))n.preventDefault(),b(e,po,!1);else if((function(t){return Fe&&J(t,"Backspace",{metaKey:!0})})(n))n.preventDefault(),b(e,mo,!0);else if((function(t){return Fe&&(J(t,"Delete",{metaKey:!0})||J(t,"k",{ctrlKey:!0}))})(n))n.preventDefault(),b(e,mo,!1);else if((function(t){return J(t,"b",ft)})(n))n.preventDefault(),b(e,Mt,"bold");else if((function(t){return J(t,"u",ft)})(n))n.preventDefault(),b(e,Mt,"underline");else if((function(t){return J(t,"i",ft)})(n))n.preventDefault(),b(e,Mt,"italic");else if((function(t){return J(t,"Tab",{shiftKey:"any"})})(n))b(e,jc,n);else if((function(t){return J(t,"z",ft)})(n))n.preventDefault(),b(e,wi,void 0);else if((function(t){return Fe?J(t,"z",{metaKey:!0,shiftKey:!0}):J(t,"y",{ctrlKey:!0})||J(t,"z",{ctrlKey:!0,shiftKey:!0})})(n))n.preventDefault(),b(e,Fi,void 0);else{let t=e._editorState._selection;t===null||L(t)?_c(n)&&(n.preventDefault(),b(e,ui,n)):(function(o){return J(o,"c",ft)})(n)?(n.preventDefault(),b(e,Bi,n)):(function(o){return J(o,"x",ft)})(n)?(n.preventDefault(),b(e,Wi,n)):_c(n)&&(n.preventDefault(),b(e,ui,n))}return(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&e.dispatchCommand(eu,n),!0}function au(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}var Sn=new Map;function lu(n){let e=Yu(n.target);if(e===null)return;let t=Xi(e.anchorNode);if(t===null)return;hi&&(hi=!1,et(t,()=>{let l=rn(),c=e.anchorNode;(Ne(c)||tt(c))&&Ee(Ir(l,e,t,n))}));let o=Zi(t),r=o[o.length-1],s=r._key,i=Sn.get(s),a=i||r;a!==t&&zl(e,a,!1),zl(e,t,!0),t!==r?Sn.set(s,t):i&&Sn.delete(s)}function Hl(n){n._lexicalHandled=!0}function Yl(n){return n._lexicalHandled===!0}var Gl=()=>{};function Dp(n){let e=fi.get(n);if(e===void 0)return void Gl();let t=xr.get(e);if(t===void 0)return void Gl();let o=t-1;o>=0||v(164),fi.delete(n),xr.set(e,o),o===0&&e.removeEventListener("selectionchange",lu);let r=Oo(n);Lr(r)?((function(i){if(i._parentEditor!==null){let a=Zi(i),l=a[a.length-1]._key;Sn.get(l)===i&&Sn.delete(l)}else Sn.delete(i._key)})(r),n.__lexicalEditor=null):r&&v(198);let s=au(n);for(let i=0;i<s.length;i++)s[i]();n.__lexicalEventHandles=[]}function pi(n,e,t){ce();let o=n.__key,r=n.getParent();if(r===null)return;let s=(function(a){let l=G();if(!L(l)||!M(a))return l;let{anchor:c,focus:u}=l,d=c.getNode(),f=u.getNode();return Mr(d,a)&&c.set(a.__key,0,"element"),Mr(f,a)&&u.set(a.__key,0,"element"),l})(n),i=!1;if(L(s)&&e){let a=s.anchor,l=s.focus;a.key===o&&(Tr(a,n,r,n.getPreviousSibling(),n.getNextSibling()),i=!0),l.key===o&&(Tr(l,n,r,n.getPreviousSibling(),n.getNextSibling()),i=!0)}else To(s)&&e&&n.isSelected()&&n.selectPrevious();if(L(s)&&e&&!i){let a=n.getIndexWithinParent();Dt(n),Sr(s,r,a,-1)}else Dt(n);t||Ie(r)||r.canBeEmpty()||!r.isEmpty()||pi(r,e),e&&s&&pe(r)&&r.isEmpty()&&r.selectEnd()}function bp(n){return n}var cu=Symbol.for("ephemeral");function Nr(n){return n[cu]||!1}var ke=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=Ao(this);return e===void 0&&v(64,this.name),e}static clone(e){v(65,this.name)}$config(){return{}}config(e,t){let o=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:o,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Iu(this,e)}getType(){return this.__type}isInline(){v(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;let t=re(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){let t=e||G();if(t==null)return!1;let o=t.getNodes().some(r=>r.__key===this.__key);if(I(this))return o;if(L(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;let r=this.getParent();if(Q(this)&&this.isInline()&&r){let s=t.isBackward()?t.focus:t.anchor;if(r.is(s.getNode())&&s.offset===r.getChildrenSize()&&this.is(r.getLastChild()))return!1}}return o}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),o=0;for(;t!==null;){if(this.is(t))return o;o++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:re(e)}getParentOrThrow(){let e=this.getParent();return e===null&&v(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(Ie(t))return M(e)||e===this&&Q(e)||v(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&v(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:re(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let o=t.getFirstChild();for(;o!==null&&!o.is(this);)e.push(o),o=o.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:re(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=M(this)?this:this.getParent(),o=M(e)?e:e.getParent(),r=t&&o?lo(t,o):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=lo(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?fa(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&v(279),!1)))}isParentOf(e){let t=lo(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){let t=this.isBefore(e),o=[],r=new Set,s=this;for(;s!==null;){let i=s.__key;if(r.has(i)||(r.add(i),o.push(s)),s===e)break;let a=M(s)?t?s.getFirstChild():s.getLastChild():null;if(a!==null){s=a;continue}let l=t?s.getNextSibling():s.getPreviousSibling();if(l!==null){s=l;continue}let c=s.getParentOrThrow();if(r.has(c.__key)||o.push(c),c===e)break;let u=null,d=c;do{if(d===null&&v(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||r.has(d.__key)||o.push(d)}while(u===null);s=u}return t||o.reverse(),o}isDirty(){let e=X()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Nr(this))return this;let e=re(this.__key);return e===null&&v(113),e}getWritable(){if(Nr(this))return this;ce();let e=yt(),t=X(),o=e._nodeMap,r=this.__key,s=this.getLatest(),i=t._cloneNotNeeded,a=G();if(a!==null&&a.setCachedNodes(null),i.has(r))return Or(s),s;let l=aa(s);return i.add(r),Or(l),o.set(r,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){v(70)}updateDOM(e,t,o){v(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){v(18,this.name)}updateFromJSON(e){return(function(t,o){let r=t.getWritable(),s=o.$,i=s;for(let a of Rc(r).flatKeys)a in o&&(i!==void 0&&i!==s||(i={...s}),i[a]=o[a]);return(r.__state||i)&&bi(t).updateFromJSON(i),r})(this,e)}static transform(){return null}remove(e){pi(this,!0,e)}replace(e,t){ce();let o=G();o!==null&&(o=o.clone()),js(this,e);let r=this.getLatest(),s=this.__key,i=e.__key,a=e.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;Dt(a);let u=r.getPreviousSibling(),d=r.getNextSibling(),f=r.__prev,h=r.__next,g=r.__parent;if(pi(r,!1,!0),u===null?l.__first=i:u.getWritable().__next=i,a.__prev=f,d===null?l.__last=i:d.getWritable().__prev=i,a.__next=h,a.__parent=g,l.__size=c,t&&(M(this)&&M(a)||v(139),this.getChildren().forEach(p=>{a.append(p)})),L(o)){Ee(o);let p=o.anchor,m=o.focus;p.key===s&&ql(p,a),m.key===s&&ql(m,a)}return vt()===s&&ue(i),a}insertAfter(e,t=!0){ce(),js(this,e);let o=this.getWritable(),r=e.getWritable(),s=r.getParent(),i=G(),a=!1,l=!1;if(s!==null){let h=e.getIndexWithinParent();if(Dt(r),L(i)){let g=s.__key,p=i.anchor,m=i.focus;a=p.type==="element"&&p.key===g&&p.offset===h+1,l=m.type==="element"&&m.key===g&&m.offset===h+1}}let c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=r.__key,f=o.__next;if(c===null?u.__last=d:c.getWritable().__prev=d,u.__size++,o.__next=d,r.__next=f,r.__prev=o.__key,r.__parent=o.__parent,t&&L(i)){let h=this.getIndexWithinParent();Sr(i,u,h+1);let g=u.__key;a&&i.anchor.set(g,h+2,"element"),l&&i.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){ce(),js(this,e);let o=this.getWritable(),r=e.getWritable(),s=r.__key;Dt(r);let i=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=o.__prev,c=this.getIndexWithinParent();i===null?a.__first=s:i.getWritable().__next=s,a.__size++,o.__prev=s,r.__prev=l,r.__next=o.__key,r.__parent=o.__parent;let u=G();return t&&L(u)&&Sr(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return mt()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){ce();let o=this.getPreviousSibling(),r=this.getParentOrThrow();if(o===null)return r.select(0,0);if(M(o))return o.select();if(!I(o)){let s=o.getIndexWithinParent()+1;return r.select(s,s)}return o.select(e,t)}selectNext(e,t){ce();let o=this.getNextSibling(),r=this.getParentOrThrow();if(o===null)return r.select();if(M(o))return o.select(0,0);if(!I(o)){let s=o.getIndexWithinParent();return r.select(s,s)}return o.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}},Rp="historic",kp="history-push",lr="history-merge",Ip="paste",uu="collaboration",$p="skip-collab",du="skip-scroll-into-view",fu="skip-dom-selection",mi="skip-selection-focus",gu="composition-start",hu="composition-end",En=class n extends ke{static getType(){return"linebreak"}static clone(e){return new n(e.__key)}constructor(e){super(e)}getTextContent(){return`
6
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(t){let o=t.parentElement;if(o!==null&&Si(o)){let r=o.firstChild;if(r===t||r.nextSibling===t&&er(r)){let s=o.lastChild;if(s===t||s.previousSibling===t&&er(s))return!0}}return!1})(e)||(function(t){let o=t.parentElement;if(o!==null&&Si(o)){let r=o.firstChild;if(r===t||r.nextSibling===t&&er(r))return!1;let s=o.lastChild;if(s===t||s.previousSibling===t&&er(s))return!0}return!1})(e)?null:{conversion:Lp,priority:0}}}static importJSON(e){return On().updateFromJSON(e)}};function Lp(n){return{node:On()}}function On(){return vo(new En)}function Xt(n){return n instanceof En}function er(n){return tt(n)&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function Us(n,e){return 16&e?"code":e&vi?"mark":32&e?"sub":64&e?"sup":null}function zs(n,e){return 1&e?"strong":2&e?"em":"span"}function pu(n,e,t,o,r){let s=o.classList,i=Tn(r,"base");i!==void 0&&s.add(...i),i=Tn(r,"underlineStrikethrough");let a=!1,l=8&e&&4&e;i!==void 0&&(8&t&&4&t?(a=!0,l||s.add(...i)):l&&s.remove(...i));for(let c in xe){let u=xe[c];if(i=Tn(r,c),i!==void 0)if(t&u){if(a&&(c==="underline"||c==="strikethrough")){e&u&&s.remove(...i);continue}((e&u)===0||l&&c==="underline"||c==="strikethrough")&&s.add(...i)}else e&u&&s.remove(...i)}}function mu(n,e,t){let o=e.firstChild,r=t.isComposing(),s=n+(r?uo:"");if(o==null)e.textContent=s;else{let i=o.nodeValue;if(i!==s)if(r||bt){let[a,l,c]=(function(u,d){let f=u.length,h=d.length,g=0,p=0;for(;g<f&&g<h&&u[g]===d[g];)g++;for(;p+g<f&&p+g<h&&u[f-p-1]===d[h-p-1];)p++;return[g,f-g-p,d.slice(g,h-p)]})(i,s);l!==0&&o.deleteData(a,l),o.insertData(a,c)}else o.nodeValue=s}}function jl(n,e,t,o,r,s){mu(r,n,e);let i=s.theme.text;i!==void 0&&pu(0,0,o,n,i)}function tr(n,e){let t=document.createElement(e);return t.appendChild(n),t}var en=class n extends ke{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new n(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let e=this.getLatest();return np[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===vt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=xe[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return No(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let o=this.__format,r=Us(0,o),s=zs(0,o),i=r===null?s:r,a=document.createElement(i),l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),r!==null&&(l=document.createElement(s),a.appendChild(l)),jl(l,this,0,o,this.__text,e);let c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(e,t,o){let r=this.__text,s=e.__format,i=this.__format,a=Us(0,s),l=Us(0,i),c=zs(0,s),u=zs(0,i);if((a===null?c:a)!==(l===null?u:l))return!0;if(a===l&&c!==u){let p=t.firstChild;p==null&&v(48);let m=document.createElement(u);return jl(m,this,0,i,r,o),t.replaceChild(m,p),!1}let d=t;l!==null&&a!==null&&(d=t.firstChild,d==null&&v(49)),mu(r,d,this);let f=o.theme.text;f!==void 0&&s!==i&&pu(0,s,i,d,f);let h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:Kp,priority:0}),b:()=>({conversion:wp,priority:0}),code:()=>({conversion:dt,priority:0}),em:()=>({conversion:dt,priority:0}),i:()=>({conversion:dt,priority:0}),mark:()=>({conversion:dt,priority:0}),s:()=>({conversion:dt,priority:0}),span:()=>({conversion:Pp,priority:0}),strong:()=>({conversion:dt,priority:0}),sub:()=>({conversion:dt,priority:0}),sup:()=>({conversion:dt,priority:0}),u:()=>({conversion:dt,priority:0})}}static importJSON(e){return le().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Ne(t)||v(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=tr(t,"b")),this.hasFormat("italic")&&(t=tr(t,"i")),this.hasFormat("strikethrough")&&(t=tr(t,"s")),this.hasFormat("underline")&&(t=tr(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e=="string"?xe[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e=="string"?Zh[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=No(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=tp[e];if(this.__mode===t)return this;let o=this.getWritable();return o.__mode=t,o}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){ce();let o=e,r=t,s=G(),i=this.getTextContent(),a=this.__key;if(typeof i=="string"){let l=i.length;o===void 0&&(o=l),r===void 0&&(r=l)}else o=0,r=0;if(!L(s))return yu(a,o,a,r,"text","text");{let l=vt();l!==s.anchor.key&&l!==s.focus.key||ue(a),s.setTextNodeRange(this,o,this,r)}return s}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,o,r){let s=this.getWritable(),i=s.__text,a=o.length,l=e;l<0&&(l=a+l,l<0&&(l=0));let c=G();if(r&&L(c)){let d=e+a;c.setTextNodeRange(s,d,s,d)}let u=i.slice(0,l)+o+i.slice(l+t);return s.__text=u,s}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){ce();let t=this.getLatest(),o=t.getTextContent();if(o==="")return[];let r=t.__key,s=vt(),i=o.length;e.sort((C,S)=>C-S),e.push(i);let a=[],l=e.length;for(let C=0,S=0;C<i&&S<=l;S++){let k=e[S];k>C&&(a.push(o.slice(C,k)),C=k)}let c=a.length;if(c===1)return[t];let u=a[0],d=t.getParent(),f,h=t.getFormat(),g=t.getStyle(),p=t.__detail,m=!1,x=null,y=null,N=G();if(L(N)){let[C,S]=N.isBackward()?[N.focus,N.anchor]:[N.anchor,N.focus];C.type==="text"&&C.key===r&&(x=C),S.type==="text"&&S.key===r&&(y=S)}t.isSegmented()?(f=le(u),f.__format=h,f.__style=g,f.__detail=p,f.__state=Ll(t,f),m=!0):f=t.setTextContent(u);let T=[f];for(let C=1;C<c;C++){let S=le(a[C]);S.__format=h,S.__style=g,S.__detail=p,S.__state=Ll(t,S);let k=S.__key;s===r&&ue(k),T.push(S)}let O=x?x.offset:null,E=y?y.offset:null,A=0;for(let C of T){if(!x&&!y)break;let S=A+C.getTextContentSize();if(x!==null&&O!==null&&O<=S&&O>=A&&(x.set(C.getKey(),O-A,"text"),O<S&&(x=null)),y!==null&&E!==null&&E<=S&&E>=A){y.set(C.getKey(),E-A,"text");break}A=S}if(d!==null){(function(k){let F=k.getPreviousSibling(),j=k.getNextSibling();F!==null&&Or(F),j!==null&&Or(j)})(this);let C=d.getWritable(),S=this.getIndexWithinParent();m?(C.splice(S,0,T),this.remove()):C.splice(S,1,T),L(N)&&Sr(N,d,S,c-1)}return T}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||v(50);let o=this.__key,r=e.__key,s=this.__text,i=s.length;vt()===r&&ue(o);let a=G();if(L(a)){let d=a.anchor,f=a.focus;d!==null&&d.key===r&&oc(d,t,o,e,i),f!==null&&f.key===r&&oc(f,t,o,e,i)}let l=e.__text,c=t?l+s:s+l;this.setTextContent(c);let u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}};function Pp(n){return{forChild:Ui(n.style),node:null}}function wp(n){let e=n,t=e.style.fontWeight==="normal";return{forChild:Ui(e.style,t?void 0:"bold"),node:null}}var Jl=new WeakMap;function Fp(n){if(!Ne(n))return!1;if(n.nodeName==="PRE")return!0;let e=n.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function Kp(n){let e=n;n.parentElement===null&&v(129);let t=e.textContent||"";if((function(o){let r,s=o.parentNode,i=[o];for(;s!==null&&(r=Jl.get(s))===void 0&&!Fp(s);)i.push(s),s=s.parentNode;let a=r===void 0?s:r;for(let l=0;l<i.length;l++)Jl.set(i[l],a);return a})(e)!==null){let o=t.split(/(\r?\n|\t)/),r=[],s=o.length;for(let i=0;i<s;i++){let a=o[i];a===`
3
+ `,Di=bt?"\xA0":fo,Mc="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",vc="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",ep=new RegExp("^[^"+vc+"]*["+Mc+"]"),tp=new RegExp("^[^"+Mc+"]*["+vc+"]"),xe={bold:1,capitalize:1024,code:16,highlight:Ai,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},np={directionless:1,unmergeable:2},Qs={center:2,end:6,justify:4,left:1,right:3,start:5},op={[Vh]:"center",[Zh]:"end",[Xh]:"justify",[Jh]:"left",[qh]:"right",[Qh]:"start"},rp={normal:0,segmented:2,token:1},sp={[wh]:"normal",[Kh]:"segmented",[Fh]:"token"},ip="$",Il="$config";function Ac(n,e,t,o,r,s){let i=n.getFirstChild();for(;i!==null;){let a=i.__key;i.__parent===e&&(M(i)&&Ac(i,a,t,o,r,s),t.has(a)||s.delete(a),r.push(a)),i=i.getNextSibling()}}var Zs=!1,bi=0;function ap(n){bi=n.timeStamp}function Ws(n,e,t){let o=n.nodeName==="BR",r=e.__lexicalLineBreak;return r&&(n===r||o&&n.previousSibling===r)||o&&wr(n,t)!==void 0}function lp(n,e,t){let o=Ye(Ae(t)),r=null,s=null;o!==null&&o.anchorNode===n&&(r=o.anchorOffset,s=o.focusOffset);let i=n.nodeValue;i!==null&&na(e,i,r,s,!1)}function cp(n,e,t){if(L(n)){let o=n.anchor.getNode();if(o.is(t)&&n.format!==o.getFormat())return!1}return tt(e)&&t.isAttached()}function up(n,e,t,o){for(let r=n;r&&!Xu(r);r=vo(r)){let s=wr(r,e);if(s!==void 0){let i=re(s,t);if(i)return Q(i)||!Ne(r)?void 0:[r,i]}else if(r===o)return[o,wu(t)]}}function Dc(n,e,t){Zs=!0;let o=performance.now()-bi>100;try{et(n,()=>{let r=G()||(function(f){return f.getEditorState().read(()=>{let h=G();return h!==null?h.clone():null})})(n),s=new Map,i=n.getRootElement(),a=n._editorState,l=n._blockCursorElement,c=!1,u="";for(let f=0;f<e.length;f++){let h=e[f],g=h.type,p=h.target,m=up(p,n,a,i);if(!m)continue;let[x,y]=m;if(g==="characterData")o&&I(y)&&tt(p)&&cp(r,p,y)&&lp(p,y,n);else if(g==="childList"){c=!0;let N=h.addedNodes;for(let E=0;E<N.length;E++){let A=N[E],C=Zi(A),S=A.parentNode;if(S!=null&&A!==l&&C===null&&!Ws(A,S,n)){if(bt){let k=(Ne(A)?A.innerText:null)||A.nodeValue;k&&(u+=k)}S.removeChild(A)}}let T=h.removedNodes,O=T.length;if(O>0){let E=0;for(let A=0;A<O;A++){let C=T[A];(Ws(C,p,n)||l===C)&&(p.appendChild(C),E++)}O!==E&&s.set(x,y)}}}if(s.size>0)for(let[f,h]of s)h.reconcileObservedMutation(f,n);let d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){let h=d[f],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){let x=g[m],y=x.parentNode;y==null||x.nodeName!=="BR"||Ws(x,p,n)||y.removeChild(x)}}t.takeRecords()}r!==null&&(c&&Ee(r),bt&&zu(n)&&r.insertRawText(u))})}finally{Zs=!1}}function bc(n){let e=n._observer;e!==null&&Dc(n,e.takeRecords(),e)}function Rc(n){(function(e){bi===0&&Ae(e).addEventListener("textInput",ap,!0)})(n),n._observer=new MutationObserver((e,t)=>{Dc(n,e,t)})}var ei=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||hp).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function dp(n,e){return new ei(n,e)}function fr(n,e,t="latest"){let o=(t==="latest"?n.getLatest():n).__state;return o?o.getValue(e):e.defaultValue}function fp(n,e,t){let o=fr(n,t,"direct"),r=fr(e,t,"direct");return t.isEqual(o,r)?null:[o,r]}function gp(n,e,t){let o;if(ce(),typeof t=="function"){let s=n.getLatest(),i=fr(s,e);if(o=t(i),e.isEqual(i,o))return s}else o=t;let r=n.getWritable();return Ri(r).updateFromKnown(e,o),r}function kc(n){let e=new Map,t=new Set;for(let o=typeof n=="function"?n:n.replace;o.prototype&&o.prototype.getType!==void 0;o=Object.getPrototypeOf(o)){let{ownNodeConfig:r}=Do(o);if(r&&r.stateConfigs)for(let s of r.stateConfigs){let i;"stateConfig"in s?(i=s.stateConfig,s.flat&&t.add(i.key)):i=s,e.set(i.key,i)}}return{flatKeys:t,sharedConfigMap:e}}var ti=class n{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,o=void 0,r=new Map,s=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=o,this.knownState=r;let{sharedConfigMap:i}=this.sharedNodeState,a=s!==void 0?s:(function(l,c,u){let d=u.size;if(c)for(let f in c){let h=l.get(f);h&&u.has(h)||d++}return d})(i,o,r);this.size=a}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let o=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let r=this.unknownState[e.key];r!==void 0&&(o=e.parse(r)),this.updateFromKnown(e,o)}return o}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[o,r]of this.knownState)o.isEqual(r,o.defaultValue)?delete e[o.key]:e[o.key]=o.unparse(r);for(let o of this.sharedNodeState.flatKeys)o in e&&(t[o]=e[o],delete e[o]);return $l(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;let{sharedNodeState:t,unknownState:o}=this,r=new Map(this.knownState);return new n(e,t,(function(s,i,a){let l;if(a)for(let[c,u]of Object.entries(a)){let d=s.get(c);d?i.has(d)||i.set(d,d.parse(u)):(l=l||{},l[c]=u)}return l})(t.sharedConfigMap,r,o),r,this.size)}updateFromKnown(e,t){let o=e.key;this.sharedNodeState.sharedConfigMap.set(o,e);let{knownState:r,unknownState:s}=this;r.has(e)||s&&o in s||(s&&(delete s[o],this.unknownState=$l(s)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let o=this.sharedNodeState.sharedConfigMap.get(e);o?this.updateFromKnown(o,o.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let o of t.keys())t.set(o,o.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[o,r]of Object.entries(e))this.updateFromUnknown(o,r)}};function Ri(n){let e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new ti(e,Ic(e));return e.__state=t,t}function Ic(n){return n.__state?n.__state.sharedNodeState:Vi(aa(),n.getType()).sharedNodeState}function $l(n){if(n)for(let e in n)return n}function hp(n){return n}function Ll(n,e,t){for(let[o,r]of e.knownState){if(n.has(o.key))continue;n.add(o.key);let s=t?t.getValue(o):o.defaultValue;if(s!==r&&!o.isEqual(s,r))return!0}return!1}function Pl(n,e,t){let{unknownState:o}=e,r=t?t.unknownState:void 0;if(o){for(let[s,i]of Object.entries(o))if(!n.has(s)&&(n.add(s),i!==(r?r[s]:void 0)))return!0}return!1}function wl(n,e){let t=n.__state;return t&&t.node===n?t.getWritable(e):t}function Fl(n,e){let t=n.__mode,o=n.__format,r=n.__style,s=e.__mode,i=e.__format,a=e.__style,l=n.__state,c=e.__state;return(t===null||t===s)&&(o===null||o===i)&&(r===null||r===a)&&(n.__state===null||l===c||(function(u,d){if(u===d)return!0;if(u&&d&&u.size!==d.size)return!1;let f=new Set;return!(u&&Ll(f,u,d)||d&&Ll(f,d,u)||u&&Pl(f,u,d)||d&&Pl(f,d,u))})(l,c))}function Kl(n,e){let t=n.mergeWithSibling(e),o=X()._normalizedNodes;return o.add(n.__key),o.add(e.__key),t}function Bl(n){let e,t,o=n;if(o.__text!==""||!o.isSimpleText()||o.isUnmergeable()){for(;(e=o.getPreviousSibling())!==null&&I(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Fl(e,o)){o=Kl(e,o);break}break}e.remove()}for(;(t=o.getNextSibling())!==null&&I(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Fl(o,t)){o=Kl(o,t);break}break}t.remove()}}else o.remove()}function gr(n){return Wl(n.anchor),Wl(n.focus),n}function Wl(n){for(;n.type==="element";){let e=n.getNode(),t=n.offset,o,r;if(t===e.getChildrenSize()?(o=e.getChildAtIndex(t-1),r=!0):(o=e.getChildAtIndex(t),r=!1),I(o)){n.set(o.__key,r?o.getTextContentSize():0,"text",!0);break}if(!M(o))break;n.set(o.__key,r?o.getChildrenSize():0,"element",!0)}}var Qt,me,go,kr,ni,oi,Zt,Be,ri,ho,oe="",Ze=null,Vt=null,_n=!1,hr=!1;function pr(n,e){let t=Zt.get(n);if(e!==null){let o=li(n);o.parentNode===e&&e.removeChild(o)}if(Be.has(n)||me._keyToDOMMap.delete(n),M(t)){let o=_r(t,Zt);si(o,0,o.length-1,null)}t!==void 0&&oa(ho,go,kr,t,"destroyed")}function si(n,e,t,o){for(let r=e;r<=t;++r){let s=n[r];s!==void 0&&pr(s,o)}}function Jt(n,e){n.setProperty("text-align",e)}var pp="40px";function $c(n,e){let t=Qt.theme.indent;if(typeof t=="string"){let r=n.classList.contains(t);e>0&&!r?n.classList.add(t):e<1&&r&&n.classList.remove(t)}if(e===0)return void n.style.setProperty("padding-inline-start","");let o=getComputedStyle(me._rootElement||n).getPropertyValue("--lexical-indent-base-value")||pp;n.style.setProperty("padding-inline-start",`calc(${e} * ${o})`)}function Lc(n,e){let t=n.style;e===0?Jt(t,""):e===1?Jt(t,"left"):e===2?Jt(t,"center"):e===3?Jt(t,"right"):e===4?Jt(t,"justify"):e===5?Jt(t,"start"):e===6&&Jt(t,"end")}function ii(n,e){let t=(function(o){let r=o.__dir;if(r!==null)return r;if(pe(o))return null;let s=o.getParentOrThrow();return pe(s)&&s.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function mr(n,e){let t=Be.get(n);t===void 0&&v(60);let o=t.createDOM(Qt,me);if((function(r,s,i){let a=i._keyToDOMMap;(function(l,c,u){let d=`__lexicalKey_${c._key}`;l[d]=u})(s,i,r),a.set(r,s)})(n,o,me),I(t)?o.setAttribute("data-lexical-text","true"):Q(t)&&o.setAttribute("data-lexical-decorator","true"),M(t)){let r=t.__indent,s=t.__size;if(ii(o,t),r!==0&&$c(o,r),s!==0){let a=s-1;ai(_r(t,Be),t,0,a,t.getDOMSlot(o))}let i=t.__format;i!==0&&Lc(o,i),t.isInline()||Pc(null,t,o)}else{let r=t.getTextContent();if(Q(t)){let s=t.decorate(me,Qt);s!==null&&wc(n,s),o.contentEditable="false"}oe+=r}return e!==null&&e.insertChild(o),oa(ho,go,kr,t,"created"),o}function ai(n,e,t,o,r){let s=oe;oe="";let i=t;for(;i<=o;++i){mr(n[i],r);let a=Be.get(n[i]);a!==null&&I(a)?Ze===null&&(Ze=a.getFormat(),Vt=a.getStyle()):M(a)&&i<o&&!a.isInline()&&(oe+=Rr)}r.element.__lexicalTextContent=oe,oe=s+oe}function Ul(n,e){if(n){let t=n.__last;if(t){let o=e.get(t);if(o)return Xt(o)?"line-break":Q(o)&&o.isInline()?"decorator":null}return"empty"}return null}function Pc(n,e,t){let o=Ul(n,Zt),r=Ul(e,Be);o!==r&&e.getDOMSlot(t).setManagedLineBreak(r)}function mp(n,e,t){var o;Ze=null,Vt=null,(function(r,s,i){let a=oe,l=r.__size,c=s.__size;oe="";let u=i.element;if(l===1&&c===1){let d=r.__first,f=s.__first;if(d===f)sr(d,u);else{let g=li(d),p=mr(f,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){let x=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${f}}, old child: {tag: ${g.tagName}, key: ${d}}.`;throw new Error(x)}throw m}pr(d,null)}let h=Be.get(f);I(h)&&Ze===null&&(Ze=h.getFormat(),Vt=h.getStyle())}else{let d=_r(r,Zt),f=_r(s,Be);if(d.length!==l&&v(227),f.length!==c&&v(228),l===0)c!==0&&ai(f,0,0,c-1,i);else if(c===0){if(l!==0){let h=i.after==null&&i.before==null&&i.element.__lexicalLineBreak==null;si(d,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,x,y){let N=m-1,T=x-1,O,E,A=y.getFirstChild(),C=0,S=0;for(;C<=N&&S<=T;){let j=g[C],Y=p[S];if(j===Y)A=Us(sr(Y,y.element)),C++,S++;else{if(E===void 0&&(E=zl(p,S)),O===void 0)O=zl(g,C);else if(!O.has(j)){C++;continue}if(!E.has(j)){A=Us(li(j)),pr(j,y.element),C++,O.delete(j);continue}if(O.has(Y)){let te=Dn(me,Y);te!==A&&y.withBefore(A).insertChild(te),A=Us(sr(Y,y.element)),C++,S++}else mr(Y,y.withBefore(A)),S++}let H=Be.get(Y);H!==null&&I(H)?Ze===null&&(Ze=H.getFormat(),Vt=H.getStyle()):M(H)&&S<=T&&!H.isInline()&&(oe+=Rr)}let k=C>N,F=S>T;if(k&&!F){let j=p[T+1],Y=j===void 0?null:me.getElementByKey(j);ai(p,0,S,T,y.withBefore(Y))}else F&&!k&&si(g,C,N,y.element)})(0,d,f,l,c,i)}u.__lexicalTextContent=oe,oe=a+oe})(n,e,e.getDOMSlot(t)),o=e,Ze==null||Ze===o.__textFormat||hr||o.setTextFormat(Ze),(function(r){Vt==null||Vt===r.__textStyle||hr||r.setTextStyle(Vt)})(e)}function _r(n,e){let t=[],o=n.__first;for(;o!==null;){let r=e.get(o);r===void 0&&v(101),t.push(o),o=r.__next}return t}function sr(n,e){let t=Zt.get(n),o=Be.get(n);t!==void 0&&o!==void 0||v(61);let r=_n||oi.has(n)||ni.has(n),s=Dn(me,n);if(t===o&&!r){let i;if(M(t)){let a=s.__lexicalTextContent;typeof a=="string"?i=a:(i=t.getTextContent(),s.__lexicalTextContent=i)}else i=t.getTextContent();return oe+=i,s}if(t!==o&&r&&oa(ho,go,kr,o,"updated"),o.updateDOM(t,s,Qt)){let i=mr(n,null);return e===null&&v(62),e.replaceChild(i,s),pr(n,null),i}if(M(t)){M(o)||v(334,n);let i=o.__indent;(_n||i!==t.__indent)&&$c(s,i);let a=o.__format;if((_n||a!==t.__format)&&Lc(s,a),r)mp(t,o,s),pe(o)||o.isInline()||Pc(t,o,s);else{let l=s.__lexicalTextContent,c;typeof l=="string"?c=l:(c=t.getTextContent(),s.__lexicalTextContent=c),oe+=c}if((_n||o.__dir!==t.__dir)&&(ii(s,o),pe(o)&&!_n))for(let l of o.getChildren())M(l)&&ii(Dn(me,l.getKey()),l)}else{let i=o.getTextContent();if(Q(o)){let a=o.decorate(me,Qt);a!==null&&wc(n,a)}oe+=i}if(!hr&&pe(o)&&o.__cachedText!==oe){let i=o.getWritable();i.__cachedText=oe,o=i}return s}function wc(n,e){let t=me._pendingDecorators,o=me._decorators;if(t===null){if(o[n]===e)return;t=Pu(me)}t[n]=e}function Us(n){let e=n.nextSibling;return e!==null&&e===me._blockCursorElement&&(e=e.nextSibling),e}function zl(n,e){let t=new Set;for(let o=e;o<n.length;o++)t.add(n[o]);return t}function _p(n,e,t,o,r,s){oe="",_n=o===2,me=t,Qt=t._config,go=t._nodes,kr=me._listeners.mutation,ni=r,oi=s,Zt=n._nodeMap,Be=e._nodeMap,hr=e._readOnly,ri=new Map(t._keyToDOMMap);let i=new Map;return ho=i,sr("root",null),me=void 0,go=void 0,ni=void 0,oi=void 0,Zt=void 0,Be=void 0,Qt=void 0,ri=void 0,ho=void 0,i}function li(n){let e=ri.get(n);return e===void 0&&v(75,n),e}function w(n){return{type:n}}var ki=w("SELECTION_CHANGE_COMMAND"),xp=w("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Fc=w("CLICK_COMMAND"),Ii=w("BEFORE_INPUT_COMMAND"),$i=w("INPUT_COMMAND"),Li=w("COMPOSITION_START_COMMAND"),Pi=w("COMPOSITION_END_COMMAND"),po=w("DELETE_CHARACTER_COMMAND"),so=w("INSERT_LINE_BREAK_COMMAND"),ci=w("INSERT_PARAGRAPH_COMMAND"),Cn=w("CONTROLLED_TEXT_INSERTION_COMMAND"),wi=w("PASTE_COMMAND"),ui=w("REMOVE_TEXT_COMMAND"),mo=w("DELETE_WORD_COMMAND"),_o=w("DELETE_LINE_COMMAND"),Mt=w("FORMAT_TEXT_COMMAND"),Fi=w("UNDO_COMMAND"),Ki=w("REDO_COMMAND"),Bi=w("KEYDOWN_COMMAND"),Kc=w("KEY_ARROW_RIGHT_COMMAND"),Bc=w("MOVE_TO_END"),Wc=w("KEY_ARROW_LEFT_COMMAND"),Uc=w("MOVE_TO_START"),zc=w("KEY_ARROW_UP_COMMAND"),Hc=w("KEY_ARROW_DOWN_COMMAND"),xr=w("KEY_ENTER_COMMAND"),Yc=w("KEY_SPACE_COMMAND"),Gc=w("KEY_BACKSPACE_COMMAND"),jc=w("KEY_ESCAPE_COMMAND"),Jc=w("KEY_DELETE_COMMAND"),Vc=w("KEY_TAB_COMMAND"),yp=w("INSERT_TAB_COMMAND"),Np=w("INDENT_CONTENT_COMMAND"),Cp=w("OUTDENT_CONTENT_COMMAND"),qc=w("DROP_COMMAND"),Sp=w("FORMAT_ELEMENT_COMMAND"),Xc=w("DRAGSTART_COMMAND"),Qc=w("DRAGOVER_COMMAND"),Zc=w("DRAGEND_COMMAND"),Wi=w("COPY_COMMAND"),Ui=w("CUT_COMMAND"),di=w("SELECT_ALL_COMMAND"),Tp=w("CLEAR_EDITOR_COMMAND"),Ep=w("CLEAR_HISTORY_COMMAND"),Op=w("CAN_REDO_COMMAND"),Mp=w("CAN_UNDO_COMMAND"),eu=w("FOCUS_COMMAND"),tu=w("BLUR_COMMAND"),nu=w("KEY_MODIFIER_COMMAND"),ut=Object.freeze({}),fi=[["keydown",function(n,e){xo=n.timeStamp,ou=n.key,!e.isComposing()&&b(e,Bi,n)}],["pointerdown",function(n,e){let t=n.target,o=n.pointerType;Pn(t)&&o!=="touch"&&o!=="pen"&&n.button===0&&et(e,()=>{Iu(t)||(pi=!0)})}],["compositionstart",function(n,e){b(e,Li,n)}],["compositionend",function(n,e){bt?ro=!0:To||!Dr&&!br?b(e,Pi,n):(ir=!0,ar=n.data)}],["input",function(n,e){n.stopPropagation(),et(e,()=>{e.dispatchCommand($i,n)},{event:n}),xn=null}],["click",function(n,e){et(e,()=>{let t=G(),o=Ye(Ae(e)),r=rn();if(o){if(L(t)){let s=t.anchor,i=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!pe(i)&&ve().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&r!==null&&t.is(r))o.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&i!==t.focus.getNode()){let a=lo(i,l=>M(l)&&!l.isInline());M(a)&&a.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){let s=o.anchorNode;(Ne(s)||tt(s))&&Ee($r(r,o,e,n))}}b(e,Fc,n)})}],["cut",ut],["copy",ut],["dragstart",ut],["dragover",ut],["dragend",ut],["paste",ut],["focus",ut],["blur",ut],["drop",ut]];dr&&fi.push(["beforeinput",(n,e)=>(function(t,o){let r=t.inputType;r==="deleteCompositionText"||bt&&zu(o)||r!=="insertCompositionText"&&b(o,Ii,t)})(n,e)]);var xo=0,ou=null,ru=0,xn=null,gi=new WeakMap,yr=new WeakMap,hi=!1,pi=!1,io=!1,ro=!1,ir=!1,ar="",qt=null,su=[0,"",0,"root",0];function iu(n,e,t,o,r){let s=n.anchor,i=n.focus,a=s.getNode(),l=X(),c=Ye(Ae(l)),u=c!==null?c.anchorNode:null,d=s.key,f=l.getElementByKey(d),h=t.length;return d!==i.key||!I(a)||(!r&&(!dr||ru<o+50)||a.isDirty()&&h<2||Fu(t))&&s.offset!==i.offset&&!a.isComposing()||gt(a)||a.isDirty()&&h>1||(r||!dr)&&f!==null&&!a.isComposing()&&u!==nn(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||!a.isComposing()&&(a.getFormat()!==n.format||a.getStyle()!==n.style)||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;let m=g.anchor.offset,x=p.getParentOrThrow(),y=At(p);return m===0?!p.canInsertTextBefore()||!x.canInsertTextBefore()&&!p.isComposing()||y||(function(N){let T=N.getPreviousSibling();return(I(T)||M(T)&&T.isInline())&&!T.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!x.canInsertTextAfter()&&!p.isComposing()||y)})(n,a)}function Hl(n,e){return tt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function Yl(n,e,t){let{anchorNode:o,anchorOffset:r,focusNode:s,focusOffset:i}=n;hi&&(hi=!1,Hl(o,r)&&Hl(s,i)&&!qt)||et(e,()=>{if(!t)return void Ee(null);if(!Oo(e,o,s))return;let a=G();if(qt&&L(a)&&a.isCollapsed()){let l=a.anchor,c=qt.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=qt.clone(),Ee(a))}if(qt=null,L(a)){let l=a.anchor,c=l.getNode();if(a.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(a.dirty=!0);let u=Ae(e).event,d=u?u.timeStamp:performance.now(),[f,h,g,p,m]=su,x=ve(),y=e.isComposing()===!1&&x.getTextContent()==="";if(d<m+200&&l.offset===g&&l.key===p)lr(a,f,h);else if(l.type==="text")I(c)||v(141),au(a,c);else if(l.type==="element"&&!y){M(c)||v(259);let N=l.getNode();N.isEmpty()?(function(T,O){let E=O.getTextFormat(),A=O.getTextStyle();lr(T,E,A)})(a,N):lr(a,0,"")}}else{let u=l.key,d=a.focus.key,f=a.getNodes(),h=f.length,g=a.isBackward(),p=g?i:r,m=g?r:i,x=g?d:u,y=g?u:d,N=2047,T=!1;for(let O=0;O<h;O++){let E=f[O],A=E.getTextContentSize();if(I(E)&&A!==0&&!(O===0&&E.__key===x&&p===A||O===h-1&&E.__key===y&&m===0)&&(T=!0,N&=E.getFormat(),N===0))break}a.format=T?N:0}}b(e,ki,void 0)})}function lr(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function au(n,e){lr(n,e.getFormat(),e.getStyle())}function lu(n){if(!n.getTargetRanges)return null;let e=n.getTargetRanges();return e.length===0?null:e[0]}function vp(n){let e=n.inputType,t=lu(n),o=X(),r=G();if(e==="deleteContentBackward"){if(r===null){let d=rn();if(!L(d))return!0;Ee(d.clone())}if(L(r)){let d=r.anchor.key===r.focus.key;if(s=n.timeStamp,ou==="MediaLast"&&s<xo+30&&o.isComposing()&&d){if(ue(null),xo=0,setTimeout(()=>{et(o,()=>{ue(null)})},30),L(r)){let f=r.anchor.getNode();f.markDirty(),I(f)||v(142),au(r,f)}}else{ue(null),n.preventDefault();let f=r.anchor.getNode(),h=f.getTextContent(),g=f.canInsertTextAfter(),p=r.anchor.offset===0&&r.focus.offset===h.length,m=Xs&&d&&!p&&g;if(m&&r.isCollapsed()&&(m=!Q(Uu(r.anchor,!0))),!m){b(o,po,!0);let x=G();Xs&&L(x)&&x.isCollapsed()&&(qt=x,setTimeout(()=>qt=null))}}return!0}}var s;if(!L(r))return!0;let i=n.data;xn!==null&&ta(!1,o,xn),r.dirty&&xn===null||!r.isCollapsed()||pe(r.anchor.getNode())||t===null||r.applyDOMRange(t),xn=null;let a=r.anchor,l=r.focus,c=a.getNode(),u=l.getNode();if(e==="insertText"||e==="insertTranspose"){if(i===`
4
+ `)n.preventDefault(),b(o,so,!1);else if(i===Rr)n.preventDefault(),b(o,ci,void 0);else if(i==null&&n.dataTransfer){let d=n.dataTransfer.getData("text/plain");n.preventDefault(),r.insertRawText(d)}else i!=null&&iu(r,t,i,n.timeStamp,!0)?(n.preventDefault(),b(o,Cn,i)):xn=i;return ru=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":b(o,Cn,n);break;case"insertFromComposition":ue(null),b(o,Cn,n);break;case"insertLineBreak":ue(null),b(o,so,!1);break;case"insertParagraph":ue(null),io&&!To?(io=!1,b(o,so,!1)):b(o,ci,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":b(o,wi,n);break;case"deleteByComposition":(function(d,f){return d!==f||M(d)||M(f)||!At(d)||!At(f)})(c,u)&&b(o,ui,n);break;case"deleteByDrag":case"deleteByCut":b(o,ui,n);break;case"deleteContent":b(o,po,!1);break;case"deleteWordBackward":b(o,mo,!0);break;case"deleteWordForward":b(o,mo,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":b(o,_o,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":b(o,_o,!1);break;case"formatStrikeThrough":b(o,Mt,"strikethrough");break;case"formatBold":b(o,Mt,"bold");break;case"formatItalic":b(o,Mt,"italic");break;case"formatUnderline":b(o,Mt,"underline");break;case"historyUndo":b(o,Fi,void 0);break;case"historyRedo":b(o,Ki,void 0)}return!0}function Ap(n){if(Ne(n.target)&&Iu(n.target))return!0;let e=X(),t=G(),o=n.data,r=lu(n);if(o!=null&&L(t)&&iu(t,r,o,n.timeStamp,!1)){ro&&(Nr(e,o),ro=!1);let s=t.anchor.getNode(),i=Ye(Ae(e));if(i===null)return!0;let a=t.isBackward(),l=a?t.anchor.offset:t.focus.offset,c=a?t.focus.offset:t.anchor.offset;dr&&!t.isCollapsed()&&I(s)&&i.anchorNode!==null&&s.getTextContent().slice(0,l)+o+s.getTextContent().slice(l+c)===Bu(i.anchorNode)||b(e,Cn,o);let u=o.length;bt&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),Xs&&e.isComposing()&&(xo=0,ue(null))}else ta(!1,e,o!==null?o:void 0),ro&&(Nr(e,o||void 0),ro=!1);return(function(){ce();let s=X();bc(s)})(),!0}function Dp(n){let e=X(),t=G();if(L(t)&&!e.isComposing()){let o=t.anchor,r=t.anchor.getNode();ue(o.key),Kr(pu),(n.timeStamp<xo+30||o.type==="element"||!t.isCollapsed()||r.getFormat()!==t.format||I(r)&&r.getStyle()!==t.style)&&b(e,Cn,Di)}return!0}function bp(n){return Nr(X(),n.data),Kr(mu),!0}function Nr(n,e){let t=n._compositionKey;if(ue(null),t!==null&&e!=null){if(e===""){let o=re(t),r=nn(n.getElementByKey(t));if(r!==null&&r.nodeValue!==null&&I(o)){let s=Ye(Ae(n)),i=null,a=null;s!==null&&s.anchorNode===r&&(i=s.anchorOffset,a=s.focusOffset),na(o,r.nodeValue,i,a,!0)}return}if(e[e.length-1]===`
5
+ `){let o=G();if(L(o)||Eo(o)){if(L(o)){let r=o.focus;o.anchor.set(r.key,r.offset,r.type)}return void b(n,xr,null)}}}ta(!0,n,e)}function Rp(n){let e=X();if(n.key==null)return!0;if(ir){if(xc(n))return et(e,()=>{Nr(e,ar)}),ir=!1,ar="",!0;ir=!1,ar=""}if((function(t){return J(t,"ArrowRight",{shiftKey:"any"})})(n))b(e,Kc,n);else if((function(t){return J(t,"ArrowRight",ft)})(n))b(e,Bc,n);else if((function(t){return J(t,"ArrowLeft",{shiftKey:"any"})})(n))b(e,Wc,n);else if((function(t){return J(t,"ArrowLeft",ft)})(n))b(e,Uc,n);else if((function(t){return J(t,"ArrowUp",{altKey:"any",shiftKey:"any"})})(n))b(e,zc,n);else if((function(t){return J(t,"ArrowDown",{altKey:"any",shiftKey:"any"})})(n))b(e,Hc,n);else if((function(t){return J(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(n))io=!0,b(e,xr,n);else if((function(t){return t.key===" "})(n))b(e,Yc,n);else if((function(t){return Fe&&J(t,"o",{ctrlKey:!0})})(n))n.preventDefault(),io=!0,b(e,so,!0);else if((function(t){return J(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(n))io=!1,b(e,xr,n);else if((function(t){return J(t,"Backspace",{shiftKey:"any"})||Fe&&J(t,"h",{ctrlKey:!0})})(n))xc(n)?b(e,Gc,n):(n.preventDefault(),b(e,po,!0));else if((function(t){return t.key==="Escape"})(n))b(e,jc,n);else if((function(t){return J(t,"Delete",{})||Fe&&J(t,"d",{ctrlKey:!0})})(n))(function(t){return t.key==="Delete"})(n)?b(e,Jc,n):(n.preventDefault(),b(e,po,!1));else if((function(t){return J(t,"Backspace",_c)})(n))n.preventDefault(),b(e,mo,!0);else if((function(t){return J(t,"Delete",_c)})(n))n.preventDefault(),b(e,mo,!1);else if((function(t){return Fe&&J(t,"Backspace",{metaKey:!0})})(n))n.preventDefault(),b(e,_o,!0);else if((function(t){return Fe&&(J(t,"Delete",{metaKey:!0})||J(t,"k",{ctrlKey:!0}))})(n))n.preventDefault(),b(e,_o,!1);else if((function(t){return J(t,"b",ft)})(n))n.preventDefault(),b(e,Mt,"bold");else if((function(t){return J(t,"u",ft)})(n))n.preventDefault(),b(e,Mt,"underline");else if((function(t){return J(t,"i",ft)})(n))n.preventDefault(),b(e,Mt,"italic");else if((function(t){return J(t,"Tab",{shiftKey:"any"})})(n))b(e,Vc,n);else if((function(t){return J(t,"z",ft)})(n))n.preventDefault(),b(e,Fi,void 0);else if((function(t){return Fe?J(t,"z",{metaKey:!0,shiftKey:!0}):J(t,"y",{ctrlKey:!0})||J(t,"z",{ctrlKey:!0,shiftKey:!0})})(n))n.preventDefault(),b(e,Ki,void 0);else{let t=e._editorState._selection;t===null||L(t)?yc(n)&&(n.preventDefault(),b(e,di,n)):(function(o){return J(o,"c",ft)})(n)?(n.preventDefault(),b(e,Wi,n)):(function(o){return J(o,"x",ft)})(n)?(n.preventDefault(),b(e,Ui,n)):yc(n)&&(n.preventDefault(),b(e,di,n))}return(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&e.dispatchCommand(nu,n),!0}function cu(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}var Sn=new Map;function uu(n){let e=ju(n.target);if(e===null)return;let t=Qi(e.anchorNode);if(t===null)return;pi&&(pi=!1,et(t,()=>{let l=rn(),c=e.anchorNode;(Ne(c)||tt(c))&&Ee($r(l,e,t,n))}));let o=ea(t),r=o[o.length-1],s=r._key,i=Sn.get(s),a=i||r;a!==t&&Yl(e,a,!1),Yl(e,t,!0),t!==r?Sn.set(s,t):i&&Sn.delete(s)}function Gl(n){n._lexicalHandled=!0}function jl(n){return n._lexicalHandled===!0}var Jl=()=>{};function kp(n){let e=gi.get(n);if(e===void 0)return void Jl();let t=yr.get(e);if(t===void 0)return void Jl();let o=t-1;o>=0||v(164),gi.delete(n),yr.set(e,o),o===0&&e.removeEventListener("selectionchange",uu);let r=Mo(n);Pr(r)?((function(i){if(i._parentEditor!==null){let a=ea(i),l=a[a.length-1]._key;Sn.get(l)===i&&Sn.delete(l)}else Sn.delete(i._key)})(r),n.__lexicalEditor=null):r&&v(198);let s=cu(n);for(let i=0;i<s.length;i++)s[i]();n.__lexicalEventHandles=[]}function mi(n,e,t){ce();let o=n.__key,r=n.getParent();if(r===null)return;let s=(function(a){let l=G();if(!L(l)||!M(a))return l;let{anchor:c,focus:u}=l,d=c.getNode(),f=u.getNode();return vr(d,a)&&c.set(a.__key,0,"element"),vr(f,a)&&u.set(a.__key,0,"element"),l})(n),i=!1;if(L(s)&&e){let a=s.anchor,l=s.focus;a.key===o&&(Er(a,n,r,n.getPreviousSibling(),n.getNextSibling()),i=!0),l.key===o&&(Er(l,n,r,n.getPreviousSibling(),n.getNextSibling()),i=!0)}else Eo(s)&&e&&n.isSelected()&&n.selectPrevious();if(L(s)&&e&&!i){let a=n.getIndexWithinParent();Dt(n),Tr(s,r,a,-1)}else Dt(n);t||Ie(r)||r.canBeEmpty()||!r.isEmpty()||mi(r,e),e&&s&&pe(r)&&r.isEmpty()&&r.selectEnd()}function Ip(n){return n}var du=Symbol.for("ephemeral");function Cr(n){return n[du]||!1}var ke=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=Do(this);return e===void 0&&v(64,this.name),e}static clone(e){v(65,this.name)}$config(){return{}}config(e,t){let o=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:o,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Lu(this,e)}getType(){return this.__type}isInline(){v(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;let t=re(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){let t=e||G();if(t==null)return!1;let o=t.getNodes().some(r=>r.__key===this.__key);if(I(this))return o;if(L(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;let r=this.getParent();if(Q(this)&&this.isInline()&&r){let s=t.isBackward()?t.focus:t.anchor;if(r.is(s.getNode())&&s.offset===r.getChildrenSize()&&this.is(r.getLastChild()))return!1}}return o}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),o=0;for(;t!==null;){if(this.is(t))return o;o++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:re(e)}getParentOrThrow(){let e=this.getParent();return e===null&&v(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(Ie(t))return M(e)||e===this&&Q(e)||v(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&v(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:re(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let o=t.getFirstChild();for(;o!==null&&!o.is(this);)e.push(o),o=o.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:re(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=M(this)?this:this.getParent(),o=M(e)?e:e.getParent(),r=t&&o?co(t,o):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=co(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?ga(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&v(279),!1)))}isParentOf(e){let t=co(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){let t=this.isBefore(e),o=[],r=new Set,s=this;for(;s!==null;){let i=s.__key;if(r.has(i)||(r.add(i),o.push(s)),s===e)break;let a=M(s)?t?s.getFirstChild():s.getLastChild():null;if(a!==null){s=a;continue}let l=t?s.getNextSibling():s.getPreviousSibling();if(l!==null){s=l;continue}let c=s.getParentOrThrow();if(r.has(c.__key)||o.push(c),c===e)break;let u=null,d=c;do{if(d===null&&v(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||r.has(d.__key)||o.push(d)}while(u===null);s=u}return t||o.reverse(),o}isDirty(){let e=X()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Cr(this))return this;let e=re(this.__key);return e===null&&v(113),e}getWritable(){if(Cr(this))return this;ce();let e=yt(),t=X(),o=e._nodeMap,r=this.__key,s=this.getLatest(),i=t._cloneNotNeeded,a=G();if(a!==null&&a.setCachedNodes(null),i.has(r))return Mr(s),s;let l=la(s);return i.add(r),Mr(l),o.set(r,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){v(70)}updateDOM(e,t,o){v(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){v(18,this.name)}updateFromJSON(e){return(function(t,o){let r=t.getWritable(),s=o.$,i=s;for(let a of Ic(r).flatKeys)a in o&&(i!==void 0&&i!==s||(i={...s}),i[a]=o[a]);return(r.__state||i)&&Ri(t).updateFromJSON(i),r})(this,e)}static transform(){return null}remove(e){mi(this,!0,e)}replace(e,t){ce();let o=G();o!==null&&(o=o.clone()),Js(this,e);let r=this.getLatest(),s=this.__key,i=e.__key,a=e.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;Dt(a);let u=r.getPreviousSibling(),d=r.getNextSibling(),f=r.__prev,h=r.__next,g=r.__parent;if(mi(r,!1,!0),u===null?l.__first=i:u.getWritable().__next=i,a.__prev=f,d===null?l.__last=i:d.getWritable().__prev=i,a.__next=h,a.__parent=g,l.__size=c,t&&(M(this)&&M(a)||v(139),this.getChildren().forEach(p=>{a.append(p)})),L(o)){Ee(o);let p=o.anchor,m=o.focus;p.key===s&&Ql(p,a),m.key===s&&Ql(m,a)}return vt()===s&&ue(i),a}insertAfter(e,t=!0){ce(),Js(this,e);let o=this.getWritable(),r=e.getWritable(),s=r.getParent(),i=G(),a=!1,l=!1;if(s!==null){let h=e.getIndexWithinParent();if(Dt(r),L(i)){let g=s.__key,p=i.anchor,m=i.focus;a=p.type==="element"&&p.key===g&&p.offset===h+1,l=m.type==="element"&&m.key===g&&m.offset===h+1}}let c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=r.__key,f=o.__next;if(c===null?u.__last=d:c.getWritable().__prev=d,u.__size++,o.__next=d,r.__next=f,r.__prev=o.__key,r.__parent=o.__parent,t&&L(i)){let h=this.getIndexWithinParent();Tr(i,u,h+1);let g=u.__key;a&&i.anchor.set(g,h+2,"element"),l&&i.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){ce(),Js(this,e);let o=this.getWritable(),r=e.getWritable(),s=r.__key;Dt(r);let i=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=o.__prev,c=this.getIndexWithinParent();i===null?a.__first=s:i.getWritable().__next=s,a.__size++,o.__prev=s,r.__prev=l,r.__next=o.__key,r.__parent=o.__parent;let u=G();return t&&L(u)&&Tr(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return mt()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){ce();let o=this.getPreviousSibling(),r=this.getParentOrThrow();if(o===null)return r.select(0,0);if(M(o))return o.select();if(!I(o)){let s=o.getIndexWithinParent()+1;return r.select(s,s)}return o.select(e,t)}selectNext(e,t){ce();let o=this.getNextSibling(),r=this.getParentOrThrow();if(o===null)return r.select();if(M(o))return o.select(0,0);if(!I(o)){let s=o.getIndexWithinParent();return r.select(s,s)}return o.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}},$p="historic",Lp="history-push",cr="history-merge",Pp="paste",fu="collaboration",wp="skip-collab",gu="skip-scroll-into-view",hu="skip-dom-selection",_i="skip-selection-focus",pu="composition-start",mu="composition-end",En=class n extends ke{static getType(){return"linebreak"}static clone(e){return new n(e.__key)}constructor(e){super(e)}getTextContent(){return`
6
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(t){let o=t.parentElement;if(o!==null&&Ti(o)){let r=o.firstChild;if(r===t||r.nextSibling===t&&tr(r)){let s=o.lastChild;if(s===t||s.previousSibling===t&&tr(s))return!0}}return!1})(e)||(function(t){let o=t.parentElement;if(o!==null&&Ti(o)){let r=o.firstChild;if(r===t||r.nextSibling===t&&tr(r))return!1;let s=o.lastChild;if(s===t||s.previousSibling===t&&tr(s))return!0}return!1})(e)?null:{conversion:Fp,priority:0}}}static importJSON(e){return On().updateFromJSON(e)}};function Fp(n){return{node:On()}}function On(){return Ao(new En)}function Xt(n){return n instanceof En}function tr(n){return tt(n)&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function zs(n,e){return 16&e?"code":e&Ai?"mark":32&e?"sub":64&e?"sup":null}function Hs(n,e){return 1&e?"strong":2&e?"em":"span"}function _u(n,e,t,o,r){let s=o.classList,i=Tn(r,"base");i!==void 0&&s.add(...i),i=Tn(r,"underlineStrikethrough");let a=!1,l=8&e&&4&e;i!==void 0&&(8&t&&4&t?(a=!0,l||s.add(...i)):l&&s.remove(...i));for(let c in xe){let u=xe[c];if(i=Tn(r,c),i!==void 0)if(t&u){if(a&&(c==="underline"||c==="strikethrough")){e&u&&s.remove(...i);continue}((e&u)===0||l&&c==="underline"||c==="strikethrough")&&s.add(...i)}else e&u&&s.remove(...i)}}function xu(n,e,t){let o=e.firstChild,r=t.isComposing(),s=n+(r?fo:"");if(o==null)e.textContent=s;else{let i=o.nodeValue;if(i!==s)if(r||bt){let[a,l,c]=(function(u,d){let f=u.length,h=d.length,g=0,p=0;for(;g<f&&g<h&&u[g]===d[g];)g++;for(;p+g<f&&p+g<h&&u[f-p-1]===d[h-p-1];)p++;return[g,f-g-p,d.slice(g,h-p)]})(i,s);l!==0&&o.deleteData(a,l),o.insertData(a,c)}else o.nodeValue=s}}function Vl(n,e,t,o,r,s){xu(r,n,e);let i=s.theme.text;i!==void 0&&_u(0,0,o,n,i)}function nr(n,e){let t=document.createElement(e);return t.appendChild(n),t}var en=class n extends ke{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new n(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let e=this.getLatest();return sp[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===vt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=xe[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Co(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let o=this.__format,r=zs(0,o),s=Hs(0,o),i=r===null?s:r,a=document.createElement(i),l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),r!==null&&(l=document.createElement(s),a.appendChild(l)),Vl(l,this,0,o,this.__text,e);let c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(e,t,o){let r=this.__text,s=e.__format,i=this.__format,a=zs(0,s),l=zs(0,i),c=Hs(0,s),u=Hs(0,i);if((a===null?c:a)!==(l===null?u:l))return!0;if(a===l&&c!==u){let p=t.firstChild;p==null&&v(48);let m=document.createElement(u);return Vl(m,this,0,i,r,o),t.replaceChild(m,p),!1}let d=t;l!==null&&a!==null&&(d=t.firstChild,d==null&&v(49)),xu(r,d,this);let f=o.theme.text;f!==void 0&&s!==i&&_u(0,s,i,d,f);let h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:Up,priority:0}),b:()=>({conversion:Bp,priority:0}),code:()=>({conversion:dt,priority:0}),em:()=>({conversion:dt,priority:0}),i:()=>({conversion:dt,priority:0}),mark:()=>({conversion:dt,priority:0}),s:()=>({conversion:dt,priority:0}),span:()=>({conversion:Kp,priority:0}),strong:()=>({conversion:dt,priority:0}),sub:()=>({conversion:dt,priority:0}),sup:()=>({conversion:dt,priority:0}),u:()=>({conversion:dt,priority:0})}}static importJSON(e){return le().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Ne(t)||v(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=nr(t,"b")),this.hasFormat("italic")&&(t=nr(t,"i")),this.hasFormat("strikethrough")&&(t=nr(t,"s")),this.hasFormat("underline")&&(t=nr(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e=="string"?xe[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e=="string"?np[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=Co(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=rp[e];if(this.__mode===t)return this;let o=this.getWritable();return o.__mode=t,o}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){ce();let o=e,r=t,s=G(),i=this.getTextContent(),a=this.__key;if(typeof i=="string"){let l=i.length;o===void 0&&(o=l),r===void 0&&(r=l)}else o=0,r=0;if(!L(s))return Cu(a,o,a,r,"text","text");{let l=vt();l!==s.anchor.key&&l!==s.focus.key||ue(a),s.setTextNodeRange(this,o,this,r)}return s}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,o,r){let s=this.getWritable(),i=s.__text,a=o.length,l=e;l<0&&(l=a+l,l<0&&(l=0));let c=G();if(r&&L(c)){let d=e+a;c.setTextNodeRange(s,d,s,d)}let u=i.slice(0,l)+o+i.slice(l+t);return s.__text=u,s}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){ce();let t=this.getLatest(),o=t.getTextContent();if(o==="")return[];let r=t.__key,s=vt(),i=o.length;e.sort((C,S)=>C-S),e.push(i);let a=[],l=e.length;for(let C=0,S=0;C<i&&S<=l;S++){let k=e[S];k>C&&(a.push(o.slice(C,k)),C=k)}let c=a.length;if(c===1)return[t];let u=a[0],d=t.getParent(),f,h=t.getFormat(),g=t.getStyle(),p=t.__detail,m=!1,x=null,y=null,N=G();if(L(N)){let[C,S]=N.isBackward()?[N.focus,N.anchor]:[N.anchor,N.focus];C.type==="text"&&C.key===r&&(x=C),S.type==="text"&&S.key===r&&(y=S)}t.isSegmented()?(f=le(u),f.__format=h,f.__style=g,f.__detail=p,f.__state=wl(t,f),m=!0):f=t.setTextContent(u);let T=[f];for(let C=1;C<c;C++){let S=le(a[C]);S.__format=h,S.__style=g,S.__detail=p,S.__state=wl(t,S);let k=S.__key;s===r&&ue(k),T.push(S)}let O=x?x.offset:null,E=y?y.offset:null,A=0;for(let C of T){if(!x&&!y)break;let S=A+C.getTextContentSize();if(x!==null&&O!==null&&O<=S&&O>=A&&(x.set(C.getKey(),O-A,"text"),O<S&&(x=null)),y!==null&&E!==null&&E<=S&&E>=A){y.set(C.getKey(),E-A,"text");break}A=S}if(d!==null){(function(k){let F=k.getPreviousSibling(),j=k.getNextSibling();F!==null&&Mr(F),j!==null&&Mr(j)})(this);let C=d.getWritable(),S=this.getIndexWithinParent();m?(C.splice(S,0,T),this.remove()):C.splice(S,1,T),L(N)&&Tr(N,d,S,c-1)}return T}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||v(50);let o=this.__key,r=e.__key,s=this.__text,i=s.length;vt()===r&&ue(o);let a=G();if(L(a)){let d=a.anchor,f=a.focus;d!==null&&d.key===r&&sc(d,t,o,e,i),f!==null&&f.key===r&&sc(f,t,o,e,i)}let l=e.__text,c=t?l+s:s+l;this.setTextContent(c);let u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}};function Kp(n){return{forChild:zi(n.style),node:null}}function Bp(n){let e=n,t=e.style.fontWeight==="normal";return{forChild:zi(e.style,t?void 0:"bold"),node:null}}var ql=new WeakMap;function Wp(n){if(!Ne(n))return!1;if(n.nodeName==="PRE")return!0;let e=n.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function Up(n){let e=n;n.parentElement===null&&v(129);let t=e.textContent||"";if((function(o){let r,s=o.parentNode,i=[o];for(;s!==null&&(r=ql.get(s))===void 0&&!Wp(s);)i.push(s),s=s.parentNode;let a=r===void 0?s:r;for(let l=0;l<i.length;l++)ql.set(i[l],a);return a})(e)!==null){let o=t.split(/(\r?\n|\t)/),r=[],s=o.length;for(let i=0;i<s;i++){let a=o[i];a===`
7
7
  `||a===`\r
8
- `?r.push(On()):a===" "?r.push(kr()):a!==""&&r.push(le(a))}return{node:r}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let o=e,r=!0;for(;o!==null&&(o=Vl(o,!1))!==null;){let s=o.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(t=t.slice(1)),r=!1;break}}r&&(t=t.slice(1))}if(t[t.length-1]===" "){let o=e,r=!0;for(;o!==null&&(o=Vl(o,!0))!==null;)if((o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:le(t)}}function Vl(n,e){let t=n;for(;;){let o;for(;(o=e?t.nextSibling:t.previousSibling)===null;){let s=t.parentElement;if(s===null)return null;t=s}if(t=o,Ne(t)){let s=t.style.display;if(s===""&&!ju(t)||s!==""&&!s.startsWith("inline"))return null}let r=t;for(;(r=e?t.firstChild:t.lastChild)!==null;)t=r;if(tt(t))return t;if(t.nodeName==="BR")return null}}var Bp={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function dt(n){let e=Bp[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Ui(n.style,e),node:null}}function le(n=""){return vo(new en(n))}function I(n){return n instanceof en}function Ui(n,e){let t=n.fontWeight,o=n.textDecoration.split(" "),r=t==="700"||t==="bold",s=o.includes("line-through"),i=n.fontStyle==="italic",a=o.includes("underline"),l=n.verticalAlign;return c=>(I(c)&&(r&&!c.hasFormat("bold")&&c.toggleFormat("bold"),s&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),i&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),l!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),l!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}var Mn=class n extends en{static getType(){return"tab"}static clone(e){return new n(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),o=Tn(e.theme,"tab");return o!==void 0&&t.classList.add(...o),t}static importJSON(e){return kr().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&Sc(126),super.setTextContent(" ")}spliceText(e,t,o,r){return o===""&&t===0||o===" "&&t===1||v(286),this}setDetail(e){return e!==2&&v(127),this}setMode(e){return e!=="normal"&&v(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function kr(){return vo(new Mn)}function zi(n){return n instanceof Mn}var _i=class{key;offset;type;_selection;constructor(e,t,o){this._selection=null,this.key=e,this.offset=t,this.type=o}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:da(Ke(Lt(this,"next")),Ke(Lt(e,"next")))<0}getNode(){let e=re(this.key);return e===null&&v(20),e}set(e,t,o,r){let s=this._selection,i=this.key;r&&this.key===e&&this.offset===t&&this.type===o||(this.key=e,this.offset=t,this.type=o,Ln()||(vt()===i&&ue(e),s!==null&&(s.setCachedNodes(null),s.dirty=!0)))}};function ze(n,e,t){return new _i(n,e,t)}function Hs(n,e){let t=e.__key,o=n.offset,r="element";if(I(e)){r="text";let s=e.getTextContentSize();o>s&&(o=s)}else if(!M(e)){let s=e.getNextSibling();if(I(s))t=s.__key,o=0,r="text";else{let i=e.getParent();i&&(t=i.__key,o=e.getIndexWithinParent()+1)}}n.set(t,o,r)}function ql(n,e){if(M(e)){let t=e.getLastDescendant();M(t)||I(t)?Hs(n,t):Hs(n,e)}else Hs(n,e)}var Cr=class n{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!To(e))return!1;let t=this._nodes,o=e._nodes;return t.size===o.size&&Array.from(t).every(r=>o.has(r))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new n(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes(),o=t.length,r=t[o-1],s;if(I(r))s=r.select();else{let i=r.getIndexWithinParent()+1;s=r.getParentOrThrow().select(i,i)}s.insertNodes(e);for(let i=0;i<o;i++)t[i].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,o=[];for(let r of t){let s=re(r);s!==null&&o.push(s)}return Ln()||(this._cachedNodes=o),o}getTextContent(){let e=this.getNodes(),t="";for(let o=0;o<e.length;o++)t+=e[o].getTextContent();return t}deleteNodes(){let e=this.getNodes();if((G()||rn())===this&&e[0]){let t=ge(e[0],"next");Qu($t(t,t))}for(let t of e)t.remove()}};function L(n){return n instanceof tn}var tn=class n{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,o,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=o,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!L(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=(function(o){let r=[],[s,i]=o.getTextSlices();s&&r.push(s.caret.origin);let a=new Set,l=new Set;for(let c of o)if(We(c)){let{origin:u}=c;r.length===0?a.add(u):(l.add(u),r.push(u))}else{let{origin:u}=c;M(u)&&l.has(u)||r.push(u)}if(i&&r.push(i.caret.origin),on(o.focus)&&M(o.focus.origin)&&o.focus.getNodeAtCaret()===null)for(let c=xt(o.focus.origin,"previous");We(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(r[r.length-1]);c=In(c))a.delete(c.origin),r.pop();for(;r.length>1;){let c=r[r.length-1];if(!M(c)||l.has(c)||c.isEmpty()||a.has(c))break;r.pop()}if(r.length===0&&o.isCollapsed()){let c=Ke(o.anchor),u=Ke(o.anchor.getFlipped()),d=h=>_t(h)?h.origin:h.getNodeAtCaret(),f=d(c)||d(u)||(o.anchor.getNodeAtCaret()?c.origin:u.origin);r.push(f)}return r})(ga(Mi(this),"next"));return Ln()||(this._cachedNodes=t),t}setTextNodeRange(e,t,o,r){this.anchor.set(e.__key,t,"text"),this.focus.set(o.__key,r,"text")}getTextContent(){let e=this.getNodes();if(e.length===0)return"";let t=e[0],o=e[e.length-1],r=this.anchor,s=this.focus,i=r.isBefore(s),[a,l]=xi(this),c="",u=!0;for(let d=0;d<e.length;d++){let f=e[d];if(M(f)&&!f.isInline())u||(c+=`
9
- `),u=!f.isEmpty();else if(u=!1,I(f)){let h=f.getTextContent();f===t?f===o?r.type==="element"&&s.type==="element"&&s.offset!==r.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=i?h.slice(a):h.slice(l):f===o&&(h=i?h.slice(0,l):h.slice(0,a)),c+=h}else!Q(f)&&!Xt(f)||f===o&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(e){let t=X(),o=t.getEditorState()._selection,r=xu(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,o);if(r===null)return;let[s,i]=r;this.anchor.set(s.key,s.offset,s.type,!0),this.focus.set(i.key,i.offset,i.type,!0),fr(this)}clone(){let e=this.anchor,t=this.focus;return new n(ze(e.key,e.offset,e.type),ze(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=No(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=xe[e];return(this.format&t)!==0}insertRawText(e){let t=e.split(/(\r?\n|\t)/),o=[],r=t.length;for(let s=0;s<r;s++){let i=t[s];i===`
8
+ `?r.push(On()):a===" "?r.push(Ir()):a!==""&&r.push(le(a))}return{node:r}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let o=e,r=!0;for(;o!==null&&(o=Xl(o,!1))!==null;){let s=o.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(t=t.slice(1)),r=!1;break}}r&&(t=t.slice(1))}if(t[t.length-1]===" "){let o=e,r=!0;for(;o!==null&&(o=Xl(o,!0))!==null;)if((o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:le(t)}}function Xl(n,e){let t=n;for(;;){let o;for(;(o=e?t.nextSibling:t.previousSibling)===null;){let s=t.parentElement;if(s===null)return null;t=s}if(t=o,Ne(t)){let s=t.style.display;if(s===""&&!Vu(t)||s!==""&&!s.startsWith("inline"))return null}let r=t;for(;(r=e?t.firstChild:t.lastChild)!==null;)t=r;if(tt(t))return t;if(t.nodeName==="BR")return null}}var zp={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function dt(n){let e=zp[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:zi(n.style,e),node:null}}function le(n=""){return Ao(new en(n))}function I(n){return n instanceof en}function zi(n,e){let t=n.fontWeight,o=n.textDecoration.split(" "),r=t==="700"||t==="bold",s=o.includes("line-through"),i=n.fontStyle==="italic",a=o.includes("underline"),l=n.verticalAlign;return c=>(I(c)&&(r&&!c.hasFormat("bold")&&c.toggleFormat("bold"),s&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),i&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),l!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),l!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}var Mn=class n extends en{static getType(){return"tab"}static clone(e){return new n(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),o=Tn(e.theme,"tab");return o!==void 0&&t.classList.add(...o),t}static importJSON(e){return Ir().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&Ec(126),super.setTextContent(" ")}spliceText(e,t,o,r){return o===""&&t===0||o===" "&&t===1||v(286),this}setDetail(e){return e!==2&&v(127),this}setMode(e){return e!=="normal"&&v(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function Ir(){return Ao(new Mn)}function Hi(n){return n instanceof Mn}var xi=class{key;offset;type;_selection;constructor(e,t,o){this._selection=null,this.key=e,this.offset=t,this.type=o}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:fa(Ke(Lt(this,"next")),Ke(Lt(e,"next")))<0}getNode(){let e=re(this.key);return e===null&&v(20),e}set(e,t,o,r){let s=this._selection,i=this.key;r&&this.key===e&&this.offset===t&&this.type===o||(this.key=e,this.offset=t,this.type=o,Ln()||(vt()===i&&ue(e),s!==null&&(s.setCachedNodes(null),s.dirty=!0)))}};function ze(n,e,t){return new xi(n,e,t)}function Ys(n,e){let t=e.__key,o=n.offset,r="element";if(I(e)){r="text";let s=e.getTextContentSize();o>s&&(o=s)}else if(!M(e)){let s=e.getNextSibling();if(I(s))t=s.__key,o=0,r="text";else{let i=e.getParent();i&&(t=i.__key,o=e.getIndexWithinParent()+1)}}n.set(t,o,r)}function Ql(n,e){if(M(e)){let t=e.getLastDescendant();M(t)||I(t)?Ys(n,t):Ys(n,e)}else Ys(n,e)}var Sr=class n{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Eo(e))return!1;let t=this._nodes,o=e._nodes;return t.size===o.size&&Array.from(t).every(r=>o.has(r))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new n(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes(),o=t.length,r=t[o-1],s;if(I(r))s=r.select();else{let i=r.getIndexWithinParent()+1;s=r.getParentOrThrow().select(i,i)}s.insertNodes(e);for(let i=0;i<o;i++)t[i].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,o=[];for(let r of t){let s=re(r);s!==null&&o.push(s)}return Ln()||(this._cachedNodes=o),o}getTextContent(){let e=this.getNodes(),t="";for(let o=0;o<e.length;o++)t+=e[o].getTextContent();return t}deleteNodes(){let e=this.getNodes();if((G()||rn())===this&&e[0]){let t=ge(e[0],"next");ed($t(t,t))}for(let t of e)t.remove()}};function L(n){return n instanceof tn}var tn=class n{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,o,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=o,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!L(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=(function(o){let r=[],[s,i]=o.getTextSlices();s&&r.push(s.caret.origin);let a=new Set,l=new Set;for(let c of o)if(We(c)){let{origin:u}=c;r.length===0?a.add(u):(l.add(u),r.push(u))}else{let{origin:u}=c;M(u)&&l.has(u)||r.push(u)}if(i&&r.push(i.caret.origin),on(o.focus)&&M(o.focus.origin)&&o.focus.getNodeAtCaret()===null)for(let c=xt(o.focus.origin,"previous");We(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(r[r.length-1]);c=In(c))a.delete(c.origin),r.pop();for(;r.length>1;){let c=r[r.length-1];if(!M(c)||l.has(c)||c.isEmpty()||a.has(c))break;r.pop()}if(r.length===0&&o.isCollapsed()){let c=Ke(o.anchor),u=Ke(o.anchor.getFlipped()),d=h=>_t(h)?h.origin:h.getNodeAtCaret(),f=d(c)||d(u)||(o.anchor.getNodeAtCaret()?c.origin:u.origin);r.push(f)}return r})(ha(vi(this),"next"));return Ln()||(this._cachedNodes=t),t}setTextNodeRange(e,t,o,r){this.anchor.set(e.__key,t,"text"),this.focus.set(o.__key,r,"text")}getTextContent(){let e=this.getNodes();if(e.length===0)return"";let t=e[0],o=e[e.length-1],r=this.anchor,s=this.focus,i=r.isBefore(s),[a,l]=yi(this),c="",u=!0;for(let d=0;d<e.length;d++){let f=e[d];if(M(f)&&!f.isInline())u||(c+=`
9
+ `),u=!f.isEmpty();else if(u=!1,I(f)){let h=f.getTextContent();f===t?f===o?r.type==="element"&&s.type==="element"&&s.offset!==r.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=i?h.slice(a):h.slice(l):f===o&&(h=i?h.slice(0,l):h.slice(0,a)),c+=h}else!Q(f)&&!Xt(f)||f===o&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(e){let t=X(),o=t.getEditorState()._selection,r=Nu(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,o);if(r===null)return;let[s,i]=r;this.anchor.set(s.key,s.offset,s.type,!0),this.focus.set(i.key,i.offset,i.type,!0),gr(this)}clone(){let e=this.anchor,t=this.focus;return new n(ze(e.key,e.offset,e.type),ze(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Co(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=xe[e];return(this.format&t)!==0}insertRawText(e){let t=e.split(/(\r?\n|\t)/),o=[],r=t.length;for(let s=0;s<r;s++){let i=t[s];i===`
10
10
  `||i===`\r
11
- `?o.push(On()):i===" "?o.push(kr()):o.push(le(i))}this.insertNodes(o)}insertText(e){let t=this.anchor,o=this.focus,r=this.format,s=this.style,i=t,a=o;!this.isCollapsed()&&o.isBefore(t)&&(i=o,a=t),i.type==="element"&&(function(m,x,y,N){let T=m.getNode(),O=T.getChildAtIndex(m.offset),E=le();if(E.setFormat(y),E.setStyle(N),vu(O))O.splice(0,0,[E]);else{let A=pe(T)?mt().append(E):E;O===null?T.append(A):O.insertBefore(A)}m.is(x)&&x.set(E.__key,0,"text"),m.set(E.__key,0,"text")})(i,a,r,s),a.type==="element"&&$n(a,Ke(Lt(a,"next")));let l=i.offset,c=a.offset,u=this.getNodes(),d=u.length,f=u[0];I(f)||v(26);let h=f.getTextContent().length,g=f.getParentOrThrow(),p=u[d-1];if(d===1&&a.type==="element"&&(c=h,a.set(i.key,c,"text")),this.isCollapsed()&&l===h&&(gt(f)||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let m=f.getNextSibling();if(I(m)&&m.canInsertTextBefore()&&!gt(m)||(m=le(),m.setFormat(r),m.setStyle(s),g.canInsertTextAfter()?f.insertAfter(m):g.insertAfter(m)),m.select(0,0),f=m,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&l===0&&(gt(f)||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let m=f.getPreviousSibling();if(I(m)&&!gt(m)||(m=le(),m.setFormat(r),g.canInsertTextBefore()?f.insertBefore(m):g.insertBefore(m)),m.select(),f=m,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&l!==h){let m=le(f.getTextContent());m.setFormat(r),f.replace(m),f=m}else if(!this.isCollapsed()&&e!==""){let m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||M(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),_u(this.anchor,this.focus),void this.insertText(e)}if(d===1){if(At(f)){let N=le(e);return N.select(),void f.replace(N)}let m=f.getFormat(),x=f.getStyle();if(l!==c||m===r&&x===s){if(zi(f)){let N=le(e);return N.setFormat(r),N.setStyle(s),N.select(),void f.replace(N)}}else{if(f.getTextContent()!==""){let N=le(e);if(N.setFormat(r),N.setStyle(s),N.select(),l===0)f.insertBefore(N,!1);else{let[T]=f.splitText(l);T.insertAfter(N,!1)}return void(N.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(r),f.setStyle(s)}let y=c-l;f=f.spliceText(l,y,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(this.format=m,this.style=x,f.isComposing()&&(this.anchor.offset-=e.length))}else{let m=new Set([...f.getParentKeys(),...p.getParentKeys()]),x=M(f)?f:f.getParentOrThrow(),y=M(p)?p:p.getParentOrThrow(),N=p;if(!x.is(y)&&y.isInline())do N=y,y=y.getParentOrThrow();while(y.isInline());if(a.type==="text"&&(c!==0||p.getTextContent()==="")||a.type==="element"&&p.getIndexWithinParent()<c)if(I(p)&&!At(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){let C=le(p.getTextContent());p.replace(C),p=C}pe(a.getNode())||a.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{let C=p.getParentOrThrow();C.canBeEmpty()||C.getChildrenSize()!==1?p.remove():C.remove()}else m.add(p.__key);let T=y.getChildren(),O=new Set(u),E=x.is(y),A=x.isInline()&&f.getNextSibling()===null?x:f;for(let C=T.length-1;C>=0;C--){let S=T[C];if(S.is(f)||M(S)&&S.isParentOf(f))break;S.isAttached()&&(!O.has(S)||S.is(N)?E||A.insertAfter(S,!1):S.remove())}if(!E){let C=y,S=null;for(;C!==null;){let k=C.getChildren(),F=k.length;(F===0||k[F-1].is(S))&&(m.delete(C.__key),S=C),C=C.getParent()}}if(At(f))if(l===h)f.select();else{let C=le(e);C.select(),f.replace(C)}else f=f.spliceText(l,h-l,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(this.format=f.getFormat(),this.style=f.getStyle(),f.isComposing()&&(this.anchor.offset-=e.length));for(let C=1;C<d;C++){let S=u[C],k=S.__key;m.has(k)||S.remove()}}}removeText(){let e=G()===this;co(this,Zu(Mi(this))),e&&G()!==this&&Ee(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void ue(null);let o=this.getNodes(),r=[];for(let T of o)I(T)&&r.push(T);let s=T=>{o.forEach(O=>{if(M(O)){let E=O.getFormatFlags(e,T);O.setTextFormat(E)}})},i=r.length;if(i===0)return this.toggleFormat(e),ue(null),void s(t);let a=this.anchor,l=this.focus,c=this.isBackward(),u=c?l:a,d=c?a:l,f=0,h=r[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(f=1,h=r[1],g=0),h==null)return;let p=h.getFormatFlags(e,t);s(p);let m=i-1,x=r[m],y=d.type==="text"?d.offset:x.getTextContentSize();if(h.is(x)){if(g===y)return;if(gt(h)||g===0&&y===h.getTextContentSize())h.setFormat(p);else{let T=h.splitText(g,y),O=g===0?T[0]:T[1];O.setFormat(p),u.type==="text"&&u.set(O.__key,0,"text"),d.type==="text"&&d.set(O.__key,y-g,"text")}return void(this.format=p)}g===0||gt(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);let N=x.getFormatFlags(e,p);y>0&&(y===x.getTextContentSize()||gt(x)||([x]=x.splitText(y)),x.setFormat(N));for(let T=f+1;T<m;T++){let O=r[T],E=O.getFormatFlags(e,N);O.setFormat(E)}u.type==="text"&&u.set(h.__key,g,"text"),d.type==="text"&&d.set(x.__key,y,"text"),this.format=p|N}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();let g=G();return L(g)||v(134),g.insertNodes(e)}let t=(this.isBackward()?this.focus:this.anchor).getNode(),o=ao(t,pt),r=e[e.length-1];if(M(o)&&"__language"in o){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let g=Ys(this);o.splice(g,0,e),r.selectEnd()}return}if(!e.some(g=>(M(g)||Q(g))&&!g.isInline())){M(o)||v(211,t.constructor.name,t.getType());let g=Ys(this);return o.splice(g,0,e),void r.selectEnd()}let s=(function(g){let p=mt(),m=null;for(let x=0;x<g.length;x++){let y=g[x],N=Xt(y);if(N||Q(y)&&y.isInline()||M(y)&&y.isInline()||I(y)||y.isParentRequired()){if(m===null&&(m=y.createParentElementNode(),p.append(m),N))continue;m!==null&&m.append(y)}else p.append(y),m=null}return p})(e),i=s.getLastDescendant(),a=s.getChildren(),l=!M(o)||!o.isEmpty()?this.insertParagraph():null,c=a[a.length-1],u=a[0];var d;M(d=u)&&pt(d)&&!d.isEmpty()&&M(o)&&(!o.isEmpty()||o.canMergeWhenEmpty())&&(M(o)||v(211,t.constructor.name,t.getType()),o.append(...u.getChildren()),u=a[1]),u&&(o===null&&v(212,t.constructor.name,t.getType()),(function(g,p){let m=p.getParentOrThrow().getLastChild(),x=p,y=[p];for(;x!==m;)x.getNextSibling()||v(140),x=x.getNextSibling(),y.push(x);let N=g;for(let T of y)N=N.insertAfter(T)})(o,u));let f=ao(i,pt);l&&M(f)&&(l.canMergeWhenEmpty()||pt(c))&&(f.append(...l.getChildren()),l.remove()),M(o)&&o.isEmpty()&&o.remove(),i.selectEnd();let h=M(o)?o.getLastChild():null;Xt(h)&&f!==o&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){let i=mt();return ve().splice(this.anchor.offset,0,[i]),i.select(),i}let e=Ys(this),t=ao(this.anchor.getNode(),pt);M(t)||v(213);let o=t.getChildAtIndex(e),r=o?[o,...o.getNextSiblings()]:[],s=t.insertNewAfter(this,!1);return s?(s.append(...r),s.selectStart(),s):null}insertLineBreak(e){let t=On();if(this.insertNodes([t]),e){let o=t.getParentOrThrow(),r=t.getIndexWithinParent();o.select(r,r)}}extract(){let e=[...this.getNodes()],t=e.length,o=e[0],r=e[t-1],[s,i]=xi(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,d]=a?[i,s]:[s,i];if(t===0)return[];if(t===1){if(I(o)&&!this.isCollapsed()){let f=o.splitText(u,d),h=u===0?f[0]:f[1];return h?(l.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[o]}if(I(o)&&(u===o.getTextContentSize()?e.shift():u!==0&&([,o]=o.splitText(u),e[0]=o,l.set(o.getKey(),0,"text"))),I(r)){let f=r.getTextContent().length;d===0?e.pop():d!==f&&([r]=r.splitText(d),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),"text"))}return e}modify(e,t,o){if(sc(this,e,t,o))return;let r=e==="move",s=X(),i=Ye(Ae(s));if(!i)return;let a=s._blockCursorElement,l=s._rootElement,c=this.focus.getNode();if(l===null||a===null||!M(c)||c.isInline()||c.canBeEmpty()||Ci(a,s,l),this.dirty){let u=Dn(s,this.anchor.key),d=Dn(s,this.focus.key);this.anchor.type==="text"&&(u=nn(u)),this.focus.type==="text"&&(d=nn(d)),u&&d&&Cu(i,u,this.anchor.offset,d,this.focus.offset)}if((function(u,d,f,h){u.modify(d,f,h)})(i,e,t?"backward":"forward",o),i.rangeCount>0){let u=i.getRangeAt(0),d=this.anchor.getNode(),f=pe(d)?d:zu(d);if(this.applyDOMRange(u),this.dirty=!0,!r){let h=this.getNodes(),g=[],p=!1;for(let m=0;m<h.length;m++){let x=h[m];Mr(x,f)?g.push(x):p=!0}if(p&&g.length>0)if(t){let m=g[0];M(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{let m=g[g.length-1];M(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}i.anchorNode===u.startContainer&&i.anchorOffset===u.startOffset||(function(m){let x=m.focus,y=m.anchor,N=y.key,T=y.offset,O=y.type;y.set(x.key,x.offset,x.type,!0),x.set(N,T,O,!0)})(this)}}o==="lineboundary"&&sc(this,e,t,o,"decorators")}forwardDeletion(e,t,o){if(!o&&(e.type==="element"&&M(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){let r=t.getParent(),s=t.getNextSibling()||(r===null?null:r.getNextSibling());if(M(s)&&s.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let o=this.anchor,r=o.getNode();if(this.forwardDeletion(o,r,e))return;let s=ca(Lt(o,e?"previous":"next"));if(s.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(let l of s.iterNodeCarets("shadowRoot"))if(We(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(M(s.anchor.origin)&&s.anchor.origin.isEmpty()){let c=Ke(l);co(this,$t(c,c)),s.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(on(l)){if(M(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(s.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(Q(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&M(s.anchor.origin)&&s.anchor.origin.isEmpty()){s.anchor.origin.remove();let c=Hi();c.add(l.origin.getKey()),Ee(c)}else l.origin.remove();return}break}}if(a.type==="merge-block"){let{caret:l,block:c}=a;return co(this,$t(!l.origin.isEmpty()&&c.isEmpty()?wn(ge(c,l.direction)):s.anchor,l)),this.removeText()}}let i=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&o.offset===0&&Ql(this,o.getNode()))return}else{let a=i.type==="text"?i.getNode():null;if(r=o.type==="text"?o.getNode():null,a!==null&&a.isSegmented()){let l=i.offset,c=a.getTextContentSize();if(a.is(r)||e&&l!==c||!e&&l!==0)return void Zl(a,e,l)}else if(r!==null&&r.isSegmented()){let l=o.offset,c=r.getTextContentSize();if(r.is(a)||e&&l!==0||!e&&l!==c)return void Zl(r,e,l)}(function(l,c){let u=l.anchor,d=l.focus,f=u.getNode(),h=d.getNode();if(f===h&&u.type==="text"&&d.type==="text"){let g=u.offset,p=d.offset,m=g<p,x=m?g:p,y=m?p:g,N=y-1;x!==N&&(function(T){return!(Pu(T)||Wp(T))})(f.getTextContent().slice(x,y))&&(c?d.set(d.key,N,d.type):u.set(u.key,N,u.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let o=this.anchor.getNode();o.isEmpty()&&pe(o.getParent())&&o.getPreviousSibling()===null&&Ql(this,o)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,o=t.getNode();if(this.forwardDeletion(t,o,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function To(n){return n instanceof Cr}function Xl(n){let e=n.offset;if(n.type==="text")return e;let t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function xi(n){let e=n.getStartEndPoints();if(e===null)return[0,0];let[t,o]=e;return t.type==="element"&&o.type==="element"&&t.key===o.key&&t.offset===o.offset?[0,0]:[Xl(t),Xl(o)]}function Ql(n,e){for(let t=e;t;t=t.getParent()){if(M(t)){if(t.collapseAtStart(n))return!0;if(Ie(t))break}if(t.getPreviousSibling())break}return!1}var Wp=(()=>{try{let n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("\u2764\uFE0F")&&e("#\uFE0F\u20E3")&&e("\u{1F44D}"))return e}catch{}return()=>!1})();function Zl(n,e,t){let o=n,r=o.getTextContent().split(/(?=\s)/g),s=r.length,i=0,a=0;for(let c=0;c<s;c++){let u=c===s-1;if(a=i,i+=r[c].length,e&&i===t||i>t||u){r.splice(c,1),u&&(a=void 0);break}}let l=r.join("").trim();l===""?o.remove():(o.setTextContent(l),o.select(a,a))}function ec(n,e,t,o){let r,s=e;if(Ne(n)){let i=!1,a=n.childNodes,l=a.length,c=o._blockCursorElement;s===l&&(i=!0,s=l-1);let u=a[s],d=!1;if(u===c)u=a[s+1],d=!0;else if(c!==null){let f=c.parentNode;n===f&&e>Array.prototype.indexOf.call(f.children,c)&&s--}if(r=Nn(u),I(r))s=Ue(r,i?"next":"previous");else{let f=Nn(n);if(f===null)return null;if(M(f)){let h=o.getElementByKey(f.getKey());h===null&&v(214),[f,s]=f.getDOMSlot(h).resolveChildIndex(f,h,n,e),M(f)||v(215),i&&s>=f.getChildrenSize()&&(s=Math.max(0,f.getChildrenSize()-1));let p=f.getChildAtIndex(s);if(M(p)&&(function(m,x,y){let N=m.getParent();return y===null||N===null||!N.canBeEmpty()||N!==y.getNode()})(p,0,t)){let m=i?p.getLastDescendant():p.getFirstDescendant();m===null?f=p:(p=m,f=M(p)?p:p.getParentOrThrow()),s=0}I(p)?(r=p,f=null,s=Ue(p,i?"next":"previous")):p!==f&&i&&!d&&(M(f)||v(216),s=Math.min(f.getChildrenSize(),s+1))}else{let h=f.getIndexWithinParent();s=e===0&&Q(f)&&Nn(n)===f?h:h+1,f=f.getParentOrThrow()}if(M(f))return ze(f.__key,s,"element")}}else r=Nn(n);return I(r)?ze(r.__key,Ue(r,s,"clamp"),"text"):null}function tc(n,e,t){let o=n.offset,r=n.getNode();if(o===0){let s=r.getPreviousSibling(),i=r.getParent();if(e){if((t||!e)&&s===null&&M(i)&&i.isInline()){let a=i.getPreviousSibling();I(a)&&n.set(a.__key,a.getTextContent().length,"text")}}else M(s)&&!t&&s.isInline()?n.set(s.__key,s.getChildrenSize(),"element"):I(s)&&n.set(s.__key,s.getTextContent().length,"text")}else if(o===r.getTextContent().length){let s=r.getNextSibling(),i=r.getParent();if(e&&M(s)&&s.isInline())n.set(s.__key,0,"element");else if((t||e)&&s===null&&M(i)&&i.isInline()&&!i.canInsertTextAfter()){let a=i.getNextSibling();I(a)&&n.set(a.__key,0,"text")}}}function _u(n,e,t){if(n.type==="text"&&e.type==="text"){let o=n.isBefore(e),r=n.is(e);tc(n,o,r),tc(e,!o,r),r&&e.set(n.key,n.offset,n.type)}}function xu(n,e,t,o,r,s){if(n===null||t===null||!Eo(r,n,t))return null;let i=ec(n,e,L(s)?s.anchor:null,r);if(i===null)return null;let a=ec(t,o,L(s)?s.focus:null,r);if(a===null)return null;if(i.type==="element"&&a.type==="element"){let l=Nn(n),c=Nn(t);if(Q(l)&&Q(c))return null}return _u(i,a),[i,a]}function Up(n){return M(n)&&!n.isInline()}function yu(n,e,t,o,r,s){let i=yt(),a=new tn(ze(n,e,r),ze(t,o,s),0,"");return a.dirty=!0,i._selection=a,a}function Nu(){let n=ze("root",0,"element"),e=ze("root",0,"element");return new tn(n,e,0,"")}function Hi(){return new Cr(new Set)}function zp(n,e){return Ir(null,n,e,null)}function Ir(n,e,t,o){let r=t._window;if(r===null)return null;let s=o||r.event,i=s?s.type:void 0,a=i==="selectionchange",l=!Qs&&(a||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&s&&s.detail===3||i==="drop"||i===void 0),c,u,d,f;if(L(n)&&!l)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,(a||i===void 0)&&L(n)&&!Eo(t,c,u))return n.clone();let h=xu(c,d,u,f,t,n);if(h===null)return null;let[g,p]=h,m=0,x="";if(L(n)){let y=n.anchor;if(g.key===y.key)m=n.format,x=n.style;else{let N=g.getNode();I(N)?(m=N.getFormat(),x=N.getStyle()):M(N)&&(m=N.getTextFormat(),x=N.getTextStyle())}}return new tn(g,p,m,x)}function G(){return yt()._selection}function rn(){return X()._editorState._selection}function Sr(n,e,t,o=1){let r=n.anchor,s=n.focus,i=r.getNode(),a=s.getNode();if(!e.is(i)&&!e.is(a))return;let l=e.__key;if(n.isCollapsed()){let c=r.offset;if(t<=c&&o>0||t<c&&o<0){let u=Math.max(0,c+o);r.set(l,u,"element"),s.set(l,u,"element"),nc(n)}}else{let c=n.isBackward(),u=c?s:r,d=u.getNode(),f=c?r:s,h=f.getNode();if(e.is(d)){let g=u.offset;(t<=g&&o>0||t<g&&o<0)&&u.set(l,Math.max(0,g+o),"element")}if(e.is(h)){let g=f.offset;(t<=g&&o>0||t<g&&o<0)&&f.set(l,Math.max(0,g+o),"element")}}nc(n)}function nc(n){let e=n.anchor,t=e.offset,o=n.focus,r=o.offset,s=e.getNode(),i=o.getNode();if(n.isCollapsed()){if(!M(s))return;let a=s.getChildrenSize(),l=t>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(t);if(I(c)){let u=0;l&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),o.set(c.__key,u,"text")}return}if(M(s)){let a=s.getChildrenSize(),l=t>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(t);if(I(c)){let u=0;l&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(M(i)){let a=i.getChildrenSize(),l=r>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(r);if(I(c)){let u=0;l&&(u=c.getTextContentSize()),o.set(c.__key,u,"text")}}}function Tr(n,e,t,o,r){let s=null,i=0,a=null;o!==null?(s=o.__key,I(o)?(i=o.getTextContentSize(),a="text"):M(o)&&(i=o.getChildrenSize(),a="element")):r!==null&&(s=r.__key,I(r)?a="text":M(r)&&(a="element")),s!==null&&a!==null?n.set(s,i,a):(i=e.getIndexWithinParent(),i===-1&&(i=t.getChildrenSize()),n.set(t.__key,i,"element"))}function oc(n,e,t,o,r){n.type==="text"?n.set(t,n.offset+(e?0:r),"text"):n.offset>o.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function Cu(n,e,t,o,r){try{n.setBaseAndExtent(e,t,o,r)}catch{}}function rc(n,e,t){let o=Dn(n,e.getKey());if(M(e)){let r=e.getDOMSlot(o);return[r.element,t+r.getFirstChildOffset()]}return[o,t]}function Hp(n,e,t,o,r,s,i){let a=o.anchorNode,l=o.focusNode,c=o.anchorOffset,u=o.focusOffset,d=document.activeElement;if(r.has(uu)&&d!==s||d!==null&&qi(d))return;if(!L(e))return void(n!==null&&Eo(t,a,l)&&o.removeAllRanges());let f=e.anchor,h=e.focus,g=f.getNode(),p=h.getNode(),[m,x]=rc(t,g,f.offset),[y,N]=rc(t,p,h.offset),T=e.format,O=e.style,E=e.isCollapsed(),A=m,C=y,S=!1;var k,F,j,Y,H;if(f.type==="text"?(A=nn(m),S=g.getFormat()!==T||g.getStyle()!==O):L(n)&&n.anchor.type==="text"&&(S=!0),h.type==="text"&&(C=nn(y)),A!==null&&C!==null&&(E&&(n===null||S||L(n)&&(n.format!==T||n.style!==O))&&(k=T,F=O,j=x,Y=f.key,H=performance.now(),ou=[k,F,j,Y,H]),c!==x||u!==N||a!==A||l!==C||o.type==="Range"&&E||(d!==null&&s.contains(d)||r.has(mi)||s.focus({preventScroll:!0}),f.type==="element"))){if(Cu(o,A,x,C,N),!bt||!e.isCollapsed()||s===null||r.has(mi)||document.activeElement!==null&&s.contains(document.activeElement)||s.focus({preventScroll:!0}),!r.has(du)&&e.isCollapsed()&&s!==null&&s===document.activeElement){let te=L(e)&&e.anchor.type==="element"?A.childNodes[x]||null:o.rangeCount>0?o.getRangeAt(0):null;if(te!==null){let ae;if(te instanceof Text){let Qe=document.createRange();Qe.selectNode(te),ae=Qe.getBoundingClientRect()}else ae=te.getBoundingClientRect();(function(Qe,mn,ct){let eo=oa(ct),Dl=ra(eo);if(eo===null||Dl===null)return;let{top:ws,bottom:Fs}=mn,Xo=0,Qo=0,Ot=ct;for(;Ot!==null;){let Ks=Ot===eo.body;if(Ks)Xo=0,Qo=Ae(Qe).innerHeight;else{let Zo=Ot.getBoundingClientRect();Xo=Zo.top,Qo=Zo.bottom}let to=0;if(ws<Xo?to=-(Xo-ws):Fs>Qo&&(to=Fs-Qo),to!==0)if(Ks)Dl.scrollBy(0,to);else{let Zo=Ot.scrollTop;Ot.scrollTop+=to;let bl=Ot.scrollTop-Zo;ws-=bl,Fs-=bl}if(Ks)break;Ot=Mo(Ot)}})(t,ae,s)}}gi=!0}}function Yp(n){let e=G()||rn();e===null&&(e=ve().selectEnd()),e.insertNodes(n)}function Gp(){let n=G();return n===null?"":n.getTextContent()}function Ys(n){let e=n;n.isCollapsed()||e.removeText();let t=G();L(t)&&(e=t),L(e)||v(161);let o=e.anchor,r=o.getNode(),s=o.offset;for(;!pt(r);){let i=r;if([r,s]=jp(r,s),i.is(r))break}return s}function jp(n,e){let t=n.getParent();if(!t){let r=mt();return ve().append(r),r.select(),[ve(),0]}if(I(n)){let r=n.splitText(e);if(r.length===0)return[t,n.getIndexWithinParent()];let s=e===0?0:1;return[t,r[0].getIndexWithinParent()+s]}if(!M(n)||e===0)return[t,n.getIndexWithinParent()];let o=n.getChildAtIndex(e);if(o){let r=new tn(ze(n.__key,e,"element"),ze(n.__key,e,"element"),0,""),s=n.insertNewAfter(r);s&&s.append(o,...o.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function sc(n,e,t,o,r="decorators-and-blocks"){if(e==="move"&&o==="character"&&!n.isCollapsed()){let[u,d]=t===n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];return d.set(u.key,u.offset,u.type),!0}let s=Lt(n.focus,t?"previous":"next"),i=o==="lineboundary",a=e==="move",l=s,c=r==="decorators-and-blocks";if(!ed(l)){for(let u of l){c=!1;let{origin:d}=u;if(!Q(d)||d.isIsolated()||(l=u,!i||!d.isInline()))break}if(c)for(let u of ca(s).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(We(u))u.origin.isInline()||(l=u);else{if(M(u.origin))continue;Q(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===s)return!1;if(a&&!i&&Q(l.origin)&&l.origin.isKeyboardSelectable()){let u=Hi();return u.add(l.origin.getKey()),Ee(u),!0}return l=Ke(l),a&&$n(n.anchor,l),$n(n.focus,l),c||!i}var de=null,fe=null,Te=!1,Gs=!1,cr=0,ic={characterData:!0,childList:!0,subtree:!0};function Ln(){return Te||de!==null&&de._readOnly}function ce(){Te&&v(13)}function Su(){cr>99&&v(14)}function yt(){return de===null&&v(195,Tu()),de}function X(){return fe===null&&v(196,Tu()),fe}function Tu(){let n=0,e=new Set,t=kt.version;if(typeof window<"u")for(let r of document.querySelectorAll("[contenteditable]")){let s=Oo(r);if(Lr(s))n++;else if(s){let i=String(s.constructor.version||"<0.17.1");i===t&&(i+=" (separately built, likely a bundler configuration issue)"),e.add(i)}}let o=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(o+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),o}function Jp(){return fe}function ac(n,e,t){let o=e.__type,r=Ji(n,o),s=t.get(o);s===void 0&&(s=Array.from(r.transforms),t.set(o,s));let i=s.length;for(let a=0;a<i&&(s[a](e),e.isAttached());a++);}function lc(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function Eu(n,e){if(!e)return;let t=n._updateTags,o=e;Array.isArray(e)||(o=[e]);for(let r of o)t.add(r)}function Vp(n){return Yi(n,X()._nodes)}function Yi(n,e){let t=n.type,o=e.get(t);o===void 0&&v(17,t);let r=o.klass;n.type!==r.getType()&&v(18,r.name);let s=r.importJSON(n),i=n.children;if(M(s)&&Array.isArray(i))for(let a=0;a<i.length;a++){let l=Yi(i[a],e);s.append(l)}return s}function cc(n,e,t){let o=de,r=Te,s=fe;de=e,Te=!0,fe=n;try{return t()}finally{de=o,Te=r,fe=s}}function ht(n,e){let t=n._pendingEditorState,o=n._rootElement,r=n._headless||o===null;if(t===null)return;let s=n._editorState,i=s._selection,a=t._selection,l=n._dirtyType!==0,c=de,u=Te,d=fe,f=n._updating,h=n._observer,g=null;if(n._pendingEditorState=null,n._editorState=t,!r&&l&&h!==null){fe=n,de=t,Te=!1,n._updating=!0;try{let E=n._dirtyType,A=n._dirtyElements,C=n._dirtyLeaves;h.disconnect(),g=hp(s,t,n,E,A,C)}catch(E){if(E instanceof Error&&n._onError(E),Gs)throw E;return Au(n,null,o,t),Dc(n),n._dirtyType=2,Gs=!0,ht(n,s),void(Gs=!1)}finally{h.observe(o,ic),n._updating=f,de=c,Te=u,fe=d}}t._readOnly||(t._readOnly=!0);let p=n._dirtyLeaves,m=n._dirtyElements,x=n._normalizedNodes,y=n._updateTags,N=n._deferred;l&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),(function(E,A){let C=E._decorators,S=E._pendingDecorators||C,k=A._nodeMap,F;for(F in S)k.has(F)||(S===C&&(S=$u(E)),delete S[F])})(n,t);let T=r?null:Ye(Ae(n));if(n._editable&&T!==null&&(l||a===null||a.dirty||!a.is(i))&&o!==null&&!y.has(fu)){fe=n,de=t;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){let E=n._blockCursorElement;E!==null&&Ci(E,n,o),Hp(i,a,n,T,y,o)}(function(E,A,C){let S=E._blockCursorElement;if(L(C)&&C.isCollapsed()&&C.anchor.type==="element"&&A.contains(document.activeElement)){let k=C.anchor,F=k.getNode(),j=k.offset,Y=!1,H=null;if(j===F.getChildrenSize())Js(F.getChildAtIndex(j-1))&&(Y=!0);else{let te=F.getChildAtIndex(j);if(te!==null&&Js(te)){let ae=te.getPreviousSibling();(ae===null||Js(ae))&&(Y=!0,H=E.getElementByKey(te.__key))}}if(Y){let te=E.getElementByKey(F.__key);return S===null&&(E._blockCursorElement=S=(function(ae){let Qe=ae.theme,mn=document.createElement("div");mn.contentEditable="false",mn.setAttribute("data-lexical-cursor","true");let ct=Qe.blockCursor;if(ct!==void 0){if(typeof ct=="string"){let eo=Do(ct);ct=Qe.blockCursor=eo}ct!==void 0&&mn.classList.add(...ct)}return mn})(E._config)),A.style.caretColor="transparent",void(H===null?te.appendChild(S):te.insertBefore(S,H))}}S!==null&&Ci(S,E,A)})(n,o,a)}finally{h!==null&&h.observe(o,ic),fe=d,de=c}}g!==null&&(function(E,A,C,S,k){let F=Array.from(E._listeners.mutation),j=F.length;for(let Y=0;Y<j;Y++){let[H,te]=F[Y];for(let ae of te){let Qe=A.get(ae);Qe!==void 0&&H(Qe,{dirtyLeaves:S,prevEditorState:k,updateTags:C})}}})(n,g,y,p,s),L(a)||a===null||i!==null&&i.is(a)||n.dispatchCommand(Ri,void 0);let O=n._pendingDecorators;O!==null&&(n._decorators=O,n._pendingDecorators=null,io("decorator",n,!0,O)),(function(E,A,C){let S=gc(A),k=gc(C);S!==k&&io("textcontent",E,!0,k)})(n,e||s,t),io("update",n,!0,{dirtyElements:m,dirtyLeaves:p,editorState:t,mutatedNodes:g,normalizedNodes:x,prevEditorState:e||s,tags:y}),(function(E,A){if(E._deferred=[],A.length!==0){let C=E._updating;E._updating=!0;try{for(let S=0;S<A.length;S++)A[S]()}finally{E._updating=C}}})(n,N),(function(E){let A=E._updates;if(A.length!==0){let C=A.shift();if(C){let[S,k]=C;$r(E,S,k)}}})(n)}function io(n,e,t,...o){let r=e._updating;e._updating=t;try{let s=Array.from(e._listeners[n]);for(let i=0;i<s.length;i++)s[i].apply(null,o)}finally{e._updating=r}}function uc(n,e){let t=n._updates,o=e||!1;for(;t.length!==0;){let r=t.shift();if(r){let[s,i]=r,a=n._pendingEditorState,l;i!==void 0&&(l=i.onUpdate,i.skipTransforms&&(o=!0),i.discrete&&(a===null&&v(191),a._flushSync=!0),l&&n._deferred.push(l),Eu(n,i.tag)),a==null?$r(n,s,i):s()}}return o}function $r(n,e,t){let o=n._updateTags,r,s=!1,i=!1;t!==void 0&&(r=t.onUpdate,Eu(n,t.tag),s=t.skipTransforms||!1,i=t.discrete||!1),r&&n._deferred.push(r);let a=n._editorState,l=n._pendingEditorState,c=!1;(l===null||l._readOnly)&&(l=n._pendingEditorState=Ou(l||a),c=!0),l._flushSync=i;let u=de,d=Te,f=fe,h=n._updating;de=l,Te=!1,n._updating=!0,fe=n;let g=n._headless||n.getRootElement()===null;ji(null);try{c&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(y,N){let T=y.getEditorState()._selection,O=Ye(Ae(y));return L(T)||T==null?Ir(T,O,y,N):T.clone()})(n,t&&t.event||null));let m=n._compositionKey;e(),s=uc(n,s),(function(y,N){let T=N.getEditorState()._selection,O=y._selection;if(L(O)){let E=O.anchor,A=O.focus,C;if(E.type==="text"&&(C=E.getNode(),C.selectionTransform(T,O)),A.type==="text"){let S=A.getNode();C!==S&&S.selectionTransform(T,O)}}})(l,n),n._dirtyType!==0&&(s?(function(y,N){let T=N._dirtyLeaves,O=y._nodeMap;for(let E of T){let A=O.get(E);I(A)&&A.isAttached()&&A.isSimpleText()&&!A.isUnmergeable()&&Fl(A)}})(l,n):(function(y,N){let T=N._dirtyLeaves,O=N._dirtyElements,E=y._nodeMap,A=vt(),C=new Map,S=T,k=S.size,F=O,j=F.size;for(;k>0||j>0;){if(k>0){N._dirtyLeaves=new Set;for(let Y of S){let H=E.get(Y);I(H)&&H.isAttached()&&H.isSimpleText()&&!H.isUnmergeable()&&Fl(H),H!==void 0&&lc(H,A)&&ac(N,H,C),T.add(Y)}if(S=N._dirtyLeaves,k=S.size,k>0){cr++;continue}}N._dirtyLeaves=new Set,N._dirtyElements=new Map,F.delete("root")&&F.set("root",!0);for(let Y of F){let H=Y[0],te=Y[1];if(O.set(H,te),!te)continue;let ae=E.get(H);ae!==void 0&&lc(ae,A)&&ac(N,ae,C)}S=N._dirtyLeaves,k=S.size,F=N._dirtyElements,j=F.size,cr++}N._dirtyLeaves=T,N._dirtyElements=O})(l,n),uc(n),(function(y,N,T,O){let E=y._nodeMap,A=N._nodeMap,C=[];for(let[S]of O){let k=A.get(S);k!==void 0&&(k.isAttached()||(M(k)&&Mc(k,S,E,A,C,O),E.has(S)||O.delete(S),C.push(S)))}for(let S of C)A.delete(S);for(let S of T){let k=A.get(S);k===void 0||k.isAttached()||(E.has(S)||T.delete(S),A.delete(S))}})(a,l,n._dirtyLeaves,n._dirtyElements)),m!==n._compositionKey&&(l._flushSync=!0);let x=l._selection;if(L(x)){let y=l._nodeMap,N=x.anchor.key,T=x.focus.key;y.get(N)!==void 0&&y.get(T)!==void 0||v(19)}else To(x)&&x._nodes.size===0&&(l._selection=null)}catch(m){return m instanceof Error&&n._onError(m),n._pendingEditorState=a,n._dirtyType=2,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void ht(n)}finally{de=u,Te=d,fe=f,n._updating=h,cr=0}n._dirtyType!==0||n._deferred.length>0||(function(m,x){let y=x.getEditorState()._selection,N=m._selection;if(N!==null){if(N.dirty||!N.is(y))return!0}else if(y!==null)return!0;return!1})(l,n)?l._flushSync?(l._flushSync=!1,ht(n)):c&&rm(()=>{ht(n)}):(l._flushSync=!1,c&&(o.clear(),n._deferred=[],n._pendingEditorState=null))}function et(n,e,t){fe===n&&t===void 0?e():$r(n,e,t)}var yi=class n{element;before;after;constructor(e,t,o){this.element=e,this.before=t||null,this.after=o||null}withBefore(e){return new n(this.element,e,this.after)}withAfter(e){return new n(this.element,this.before,e)}withElement(e){return this.element===e?this:new n(e,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&v(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&v(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&v(224),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{let t=e==="decorator"&&(Dr||So||Ar);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,o=e.nodeName==="IMG"?e.nextSibling:null;o&&t.removeChild(o),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}let o=this.element,r=this.before,s=document.createElement("br");if(o.insertBefore(s,r),e){let i=document.createElement("img");i.setAttribute("data-lexical-linebreak","true"),i.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",i.alt="",o.insertBefore(i,s),o.__lexicalLineBreak=i}else o.__lexicalLineBreak=s}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,o,r){if(o===this.element){let l=this.getFirstChildOffset();return[e,Math.min(l+e.getChildrenSize(),Math.max(l,r))]}let s=dc(t,o);s.push(r);let i=dc(t,this.element),a=e.getIndexWithinParent();for(let l=0;l<i.length;l++){let c=s[l],u=i[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[e.getParentOrThrow(),a]}};function dc(n,e){let t=[],o=e;for(;o!==n&&o!==null;o=o.parentNode){let r=0;for(let s=o.previousSibling;s!==null;s=s.previousSibling)r++;t.push(r)}return o!==n&&v(225),t.reverse()}var Rt=class extends ke{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){let e=this.getFormat();return ep[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=X()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;t!==null;){if(I(t)&&e.push(t),M(t)){let o=t.getAllTextNodes();e.push(...o)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;M(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;M(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),o=t.length;if(e>=o){let s=t[o-1];return M(s)&&s.getLastDescendant()||s||null}let r=t[e];return M(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:re(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&v(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:re(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&v(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),o,r;if(e<t/2){for(o=this.getFirstChild(),r=0;o!==null&&r<=e;){if(r===e)return o;o=o.getNextSibling(),r++}return null}for(o=this.getLastChild(),r=t-1;o!==null&&r>=e;){if(r===e)return o;o=o.getPreviousSibling(),r--}return null}getTextContent(){let e="",t=this.getChildren(),o=t.length;for(let r=0;r<o;r++){let s=t[r];e+=s.getTextContent(),M(s)&&r!==o-1&&!s.isInline()&&(e+=br)}return e}getTextContentSize(){let e=0,t=this.getChildren(),o=t.length;for(let r=0;r<o;r++){let s=t[r];e+=s.getTextContentSize(),M(s)&&r!==o-1&&!s.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){let t=Xs[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=xe[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return No(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){ce();let o=G(),r=e,s=t,i=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let l=this.getFirstChild();if(I(l)||M(l))return l.select(0,0)}else if(!(e!==void 0&&e!==i||t!==void 0&&t!==i)){let l=this.getLastChild();if(I(l)||M(l))return l.select()}}r===void 0&&(r=i),s===void 0&&(s=i);let a=this.__key;return L(o)?(o.anchor.set(a,r,"element"),o.focus.set(a,s,"element"),o.dirty=!0,o):yu(a,r,a,s,"element","element")}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Xs[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,o){Nr(this)&&v(324,this.__key,this.__type);let r=this.getChildrenSize(),s=this.getWritable();e+t<=r||v(226,String(e),String(t),String(r));let i=s.__key,a=[],l=[],c=this.getChildAtIndex(e+t),u=null,d=r-t+o.length;if(e!==0)if(e===r)u=this.getLastChild();else{let h=this.getChildAtIndex(e);h!==null&&(u=h.getPreviousSibling())}if(t>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<t;g++){h===null&&v(100);let p=h.getNextSibling(),m=h.__key;Dt(h.getWritable()),l.push(m),h=p}}let f=u;for(let h of o){f!==null&&h.is(f)&&(u=f=f.getPreviousSibling());let g=h.getWritable();g.__parent===i&&d--,Dt(g);let p=h.__key;if(f===null)s.__first=p,g.__prev=null;else{let m=f.getWritable();m.__next=p,g.__prev=m.__key}h.__key===i&&v(76),g.__parent=i,a.push(p),f=h}if(e+t===r)f!==null&&(f.getWritable().__next=null,s.__last=f.__key);else if(c!==null){let h=c.getWritable();if(f!==null){let g=f.getWritable();h.__prev=f.__key,g.__next=c.__key}else h.__prev=null}if(s.__size=d,l.length){let h=G();if(L(h)){let g=new Set(l),p=new Set(a),{anchor:m,focus:x}=h;fc(m,g,p)&&Tr(m,m.getNode(),this,u,c),fc(x,g,p)&&Tr(x,x.getNode(),this,u,c),d!==0||this.canBeEmpty()||Ie(this)||this.remove()}}return s}getDOMSlot(e){return new yi(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(Ne(t)){let o=this.getIndent();o>0&&(t.style.paddingInlineStart=40*o+"px");let r=this.getDirection();r&&(t.dir=r)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),o=this.getTextStyle();return t===0&&o===""||Ie(this)||this.getChildren().some(I)||(t!==0&&(e.textFormat=t),o!==""&&(e.textStyle=o)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,o){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let o=this.getDOMSlot(e),r=o.getFirstChild();for(let s=this.getFirstChild();s;s=s.getNextSibling()){let i=t.getElementByKey(s.getKey());i!==null&&(r==null?(o.insertChild(i),r=i):r!==i&&o.replaceChild(i,r),r=r.nextSibling)}}};function M(n){return n instanceof Rt}function fc(n,e,t){let o=n.getNode();for(;o;){let r=o.__key;if(e.has(r)&&!t.has(r))return!0;o=o.getParent()}return!1}var xo=class extends ke{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Q(n){return n instanceof xo}var vn=class n extends Rt{__cachedText;static getType(){return"root"}static clone(){return new n}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){v(51)}getTextContent(){let e=this.__cachedText;return!Ln()&&X()._dirtyType!==0||e===null?super.getTextContent():e}remove(){v(52)}replace(e){v(53)}insertBefore(e){v(54)}insertAfter(e){v(55)}updateDOM(e,t){return!1}splice(e,t,o){for(let r of o)M(r)||Q(r)||v(282);return super.splice(e,t,o)}static importJSON(e){return ve().updateFromJSON(e)}collapseAtStart(){return!0}};function pe(n){return n instanceof vn}function Ou(n){return new yo(new Map(n._nodeMap))}function Gi(){return new yo(new Map([["root",new vn]]))}function Mu(n){let e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&v(130,t.name),M(n)){let o=e.children;Array.isArray(o)||v(59,t.name);let r=n.getChildren();for(let s=0;s<r.length;s++){let i=Mu(r[s]);o.push(i)}}return e}function qp(n){return n instanceof yo}var yo=class n{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return cc(t&&t.editor||null,this,e)}clone(e){let t=new n(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return cc(null,this,()=>({root:Mu(ve())}))}},Er=class extends Rt{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}},An=class n extends Rt{static getType(){return"paragraph"}static clone(e){return new n(e.__key)}createDOM(e){let t=document.createElement("p"),o=Tn(e.theme,"paragraph");return o!==void 0&&t.classList.add(...o),t}updateDOM(e,t,o){return!1}static importDOM(){return{p:e=>({conversion:Xp,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Ne(t)){this.isEmpty()&&t.append(document.createElement("br"));let o=this.getFormatType();o&&(t.style.textAlign=o)}return{element:t}}static importJSON(e){return mt().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(I);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let o=mt();o.setTextFormat(e.format),o.setTextStyle(e.style);let r=this.getDirection();return o.setDirection(r),o.setFormat(this.getFormatType()),o.setStyle(this.getStyle()),this.insertAfter(o,t),o}collapseAtStart(){let e=this.getChildren();if(e.length===0||I(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function Xp(n){let e=mt();if(n.style&&(e.setFormat(n.style.textAlign),Ju(n,e)),e.getFormatType()===""){let t=n.getAttribute("align");t&&t&&t in Xs&&e.setFormat(t)}return{node:e}}function mt(){return vo(new An)}function vu(n){return n instanceof An}var yn=0,Qp=1,Zp=2,em=3,tm=4;function Au(n,e,t,o){let r=n._keyToDOMMap;r.clear(),n._editorState=Gi(),n._pendingEditorState=o,n._compositionKey=null,n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;let s=n._observer;s!==null&&(s.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",r.set("root",t))}function Du(n){let e=new Set,t=new Set,o=n;for(;o;){let{ownNodeConfig:r}=Ao(o),s=o.transform;if(!t.has(s)){t.add(s);let i=o.transform();i&&e.add(i)}if(r){let i=r.$transform;i&&e.add(i),o=r.extends}else{let i=Object.getPrototypeOf(o);o=i.prototype instanceof ke&&i!==ke?i:void 0}}return e}function nm(n){let e=n||{},t=Jp(),o=e.theme||{},r=n===void 0?t:e.parentEditor||null,s=e.disableEvents||!1,i=Gi(),a=e.namespace||(r!==null?r._config.namespace:wu()),l=e.editorState,c=[vn,en,En,Mn,An,Er,...e.nodes||[]],{onError:u,html:d}=e,f=e.editable===void 0||e.editable,h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],x=null,y=null;if(typeof m!="function"){let O=m;m=O.replace,x=O.with,y=O.withKlass||null}Ao(m);let N=m.getType(),T=Du(m);h.set(N,{exportDOM:d&&d.export?d.export.get(m):void 0,klass:m,replace:x,replaceWithKlass:y,sharedNodeState:bc(c[p]),transforms:T})}}let g=new kt(i,r,h,{disableEvents:s,namespace:a,theme:o},u||console.error,(function(p,m){let x=new Map,y=new Set,N=T=>{Object.keys(T).forEach(O=>{let E=x.get(O);E===void 0&&(E=[],x.set(O,E)),E.push(T[O])})};return p.forEach(T=>{let O=T.klass.importDOM;if(O==null||y.has(O))return;y.add(O);let E=O.call(T.klass);E!==null&&N(E)}),m&&N(m),x})(h,d?d.import:void 0),f,n);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(p){p.registerCommand(ki,Ep,yn),p.registerCommand(Ii,Op,yn),p.registerCommand($i,Mp,yn),p.registerCommand(Li,vp,yn),p.registerCommand(Ki,Ap,yn)})(g),g}var kt=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,o,r,s,i,a,l){this._createEditorArgs=l,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new 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=o,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=wu(),this._onError=s,this._htmlConversions=i,this._editable=a,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){let t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){let t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){let t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){let t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){let t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,o){o===void 0&&v(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let s=r.get(e);s===void 0&&v(36,String(e));let i=s[o];return i.add(t),()=>{i.delete(t),s.every(a=>a.size===0)&&r.delete(e)}}registerMutationListener(e,t,o){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,s=this._listeners.mutation,i=s.get(t);i===void 0&&(i=new Set,s.set(t,i)),i.add(r);let a=o&&o.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(t,r),()=>{i.delete(r),i.size===0&&s.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&v(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let o=this._editorState,r=Ti(o).get(t.getType());if(!r)return;let s=new Map;for(let i of r.keys())s.set(i,"created");s.size>0&&e(s,{dirtyLeaves:new Set,prevEditorState:o,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){let o=this.getRegisteredNode(e);return o.transforms.add(t),o}registerNodeTransform(e,t){let o=this.registerNodeTransformToKlass(e,t),r=[o],s=o.replaceWithKlass;if(s!=null){let i=this.registerNodeTransformToKlass(s,t);r.push(i)}return(function(i,a){let l=Ti(i.getEditorState()),c=[];for(let u of a){let d=l.get(u);d&&c.push(d)}c.length!==0&&i.update(()=>{for(let u of c)for(let d of u.keys()){let f=re(d);f&&f.markDirty()}},i._pendingEditorState===null?{tag:lr}:void 0)})(this,r.map(i=>i.klass.getType())),()=>{r.forEach(i=>i.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return b(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let o=Tn(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Au(this,t,e,r),t!==null&&(this._config.disableEvents||Dp(t),o!=null&&t.classList.remove(...o)),e!==null){let s=ra(e),i=e.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=s,this._dirtyType=2,Dc(this),this._updateTags.add(lr),ht(this),this._config.disableEvents||(function(a,l){let c=a.ownerDocument;fi.set(a,c);let u=xr.get(c)??0;u<1&&c.addEventListener("selectionchange",lu),xr.set(c,u+1),a.__lexicalEditor=l;let d=au(a);for(let f=0;f<di.length;f++){let[h,g]=di[f],p=typeof g=="function"?m=>{Yl(m)||(Hl(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(Yl(m))return;Hl(m);let x=l.isEditable();switch(h){case"cut":return x&&b(l,Wi,m);case"copy":return b(l,Bi,m);case"paste":return x&&b(l,Pi,m);case"dragstart":return x&&b(l,Vc,m);case"dragover":return x&&b(l,qc,m);case"dragend":return x&&b(l,Xc,m);case"focus":return x&&b(l,Qc,m);case"blur":return x&&b(l,Zc,m);case"drop":return x&&b(l,Jc,m)}};a.addEventListener(h,p),d.push(()=>{a.removeEventListener(h,p)})}})(e,this),o!=null&&e.classList.add(...o)}else this._window=null,this._updateTags.add(lr),ht(this);io("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&v(38);let o=e;o._readOnly&&(o=Ou(e),o._selection=e._selection?e._selection.clone():null),Ac(this);let r=this._pendingEditorState,s=this._updateTags,i=t!==void 0?t.tag:null;r===null||r.isEmpty()||(i!=null&&s.add(i),ht(this)),this._pendingEditorState=o,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&s.add(i),this._updating||ht(this)}parseEditorState(e,t){return(function(o,r,s){let i=Gi(),a=de,l=Te,c=fe,u=r._dirtyElements,d=r._dirtyLeaves,f=r._cloneNotNeeded,h=r._dirtyType;r._dirtyElements=new Map,r._dirtyLeaves=new Set,r._cloneNotNeeded=new Set,r._dirtyType=0,de=i,Te=!1,fe=r,ji(null);try{let g=r._nodes;Yi(o.root,g),s&&s(),i._readOnly=!0}catch(g){g instanceof Error&&r._onError(g)}finally{r._dirtyElements=u,r._dirtyLeaves=d,r._cloneNotNeeded=f,r._dirtyType=h,de=a,Te=l,fe=c}return i})(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return ht(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(o,r,s){o._updating?o._updates.push([r,s]):$r(o,r,s)})(this,e,t)}focus(e,t={}){let o=this._rootElement;o!==null&&(o.setAttribute("autocapitalize","off"),et(this,()=>{let r=G(),s=ve();r!==null?r.dirty||Ee(r.clone()):s.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?s.selectStart():s.selectEnd()),Fr("focus"),Uu(()=>{o.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&o.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Ye(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,io("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};kt.version="0.41.0+prod.esm";var Ni=null;function ji(n){Ni=n}var bu=1;function om(){bu=1}function Ji(n,e){let t=Vi(n,e);return t===void 0&&v(30,e),t}function Vi(n,e){return n._nodes.get(e)}var rm=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Ru(n){return Q(wr(n))}function qi(n){let e=document.activeElement;if(!Ne(e))return!1;let t=e.nodeName;return Q(wr(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Oo(e)==null)}function Eo(n,e,t){let o=n.getRootElement();try{return o!==null&&o.contains(e)&&o.contains(t)&&e!==null&&!qi(e)&&Xi(e)===n}catch{return!1}}function Lr(n){return n instanceof kt}function Xi(n){let e=n;for(;e!=null;){let t=Oo(e);if(Lr(t))return t;e=Mo(e)}return null}function Oo(n){return n?n.__lexicalEditor:null}function sm(n){return Xh.test(n)?"rtl":Qh.test(n)?"ltr":null}function At(n){return zi(n)||n.isToken()}function gt(n){return At(n)||n.isSegmented()}function tt(n){return Pn(n)&&n.nodeType===3}function ku(n){return Pn(n)&&n.nodeType===9}function nn(n){let e=n;for(;e!=null;){if(tt(e))return e;e=e.firstChild}return null}function No(n,e,t){let o=xe[e];if(t!==null&&(n&o)===(t&o))return n;let r=n^o;return e==="subscript"?r&=~xe.superscript:e==="superscript"?r&=~xe.subscript:e==="lowercase"?(r&=~xe.uppercase,r&=~xe.capitalize):e==="uppercase"?(r&=~xe.lowercase,r&=~xe.capitalize):e==="capitalize"&&(r&=~xe.lowercase,r&=~xe.uppercase),r}function im(n){return I(n)||Xt(n)||Q(n)}function Iu(n,e){let t=(function(){let i=Ni;return Ni=null,i})();if((e=e||t&&t.__key)!=null)return void(n.__key=e);ce(),Su();let o=X(),r=yt(),s=""+bu++;r._nodeMap.set(s,n),M(n)?o._dirtyElements.set(s,!0):o._dirtyLeaves.add(s),o._cloneNotNeeded.add(s),o._dirtyType=1,n.__key=s}function Dt(n){let e=n.getParent();if(e!==null){let t=n.getWritable(),o=e.getWritable(),r=n.getPreviousSibling(),s=n.getNextSibling(),i=s!==null?s.__key:null,a=r!==null?r.__key:null,l=r!==null?r.getWritable():null,c=s!==null?s.getWritable():null;r===null&&(o.__first=i),s===null&&(o.__last=a),l!==null&&(l.__next=i),c!==null&&(c.__prev=a),t.__prev=null,t.__next=null,t.__parent=null,o.__size--}}function Or(n){Su(),Nr(n)&&v(323,n.__key,n.__type);let e=n.getLatest(),t=e.__parent,o=yt(),r=X(),s=o._nodeMap,i=r._dirtyElements;t!==null&&(function(l,c,u){let d=l;for(;d!==null;){if(u.has(d))return;let f=c.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}})(t,s,i);let a=e.__key;r._dirtyType=1,M(n)?i.set(a,!0):r._dirtyLeaves.add(a)}function ue(n){ce();let e=X(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){let o=re(t);o!==null&&o.getWritable()}if(n!==null){let o=re(n);o!==null&&o.getWritable()}}}function vt(){return Ln()?null:X()._compositionKey}function re(n,e){let t=(e||yt())._nodeMap.get(n);return t===void 0?null:t}function Qi(n,e){let t=Pr(n,X());return t!==void 0?re(t,e):null}function Pr(n,e){return n[`__lexicalKey_${e._key}`]}function wr(n,e){let t=n;for(;t!=null;){let o=Qi(t,e);if(o!==null)return o;t=Mo(t)}return null}function $u(n){let e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function gc(n){return n.read(()=>ve().getTextContent())}function ve(){return Lu(yt())}function Lu(n){return n._nodeMap.get("root")}function Ee(n){ce();let e=yt();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function Nn(n){let e=X(),t=(function(o,r){let s=o;for(;s!=null;){let i=Pr(s,r);if(i!==void 0)return i;s=Mo(s)}return null})(n,e);return t===null?n===e.getRootElement()?re("root"):null:re(t)}function Pu(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Zi(n){let e=[],t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function wu(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Fu(n){return tt(n)?n.nodeValue:null}function ea(n,e,t){let o=Ye(Ae(e));if(o===null)return;let r=o.anchorNode,{anchorOffset:s,focusOffset:i}=o;if(r!==null){let a=Fu(r),l=wr(r);if(a!==null&&I(l)){if((a===uo||a===Ai)&&t){let c=t.length;a=t,s=c,i=c}a!==null&&ta(l,a,s,i,n)}}}function ta(n,e,t,o,r){let s=n;if(s.isAttached()&&(r||!s.isDirty())){let i=s.isComposing(),a=e;if((i||r)&&(e.endsWith(uo)&&(a=e.slice(0,-uo.length)),r)){let c=Ai,u;for(;(u=a.indexOf(c))!==-1;)a=a.slice(0,u)+a.slice(u+c.length),t!==null&&t>u&&(t=Math.max(u,t-c.length)),o!==null&&o>u&&(o=Math.max(u,o-c.length))}let l=s.getTextContent();if(r||a!==l){if(a===""){if(ue(null),Ar||So||Dr)s.remove();else{let p=X();setTimeout(()=>{p.update(()=>{s.isAttached()&&s.remove()})},20)}return}let c=s.getParent(),u=rn(),d=s.getTextContentSize(),f=vt(),h=s.getKey();if(s.isToken()||f!==null&&h===f&&!i||L(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!s.canInsertTextBefore()&&!i||u.focus.key===n.__key&&u.focus.offset===d&&!s.canInsertTextAfter()&&!i))return void s.markDirty();let g=G();if(!L(g)||t===null||o===null)return void hc(s,a,g);if(g.setTextNodeRange(s,t,s,o),s.isSegmented()){let p=le(s.getTextContent());s.replace(p),s=p}hc(s,a,g)}}}function hc(n,e,t){if(n.setTextContent(e),L(t)){let o=n.getKey();for(let r of["anchor","focus"]){let s=t[r];s.type==="text"&&s.key===o&&(s.offset=Ue(n,s.offset,"clamp"))}}}function nr(n,e,t){let o=e[t]||!1;return o==="any"||o===n[t]}function Ku(n,e){return nr(n,e,"altKey")&&nr(n,e,"ctrlKey")&&nr(n,e,"shiftKey")&&nr(n,e,"metaKey")}function J(n,e,t){if(!Ku(n,t))return!1;if(n.key.toLowerCase()===e.toLowerCase())return!0;if(e.length>1||n.key.length===1&&n.key.charCodeAt(0)<=127)return!1;let o="Key"+e.toUpperCase();return n.code===o}var ft={ctrlKey:!Fe,metaKey:Fe},pc={altKey:Fe,ctrlKey:!Fe};function mc(n){return n.key==="Backspace"}function _c(n){return J(n,"a",ft)}function am(n){let e=ve();if(L(n)){let t=n.anchor,o=n.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,"element"),o.set(r.getKey(),r.getChildrenSize(),"element"),fr(n),n}{let t=e.select(0,e.getChildrenSize());return Ee(fr(t)),t}}function Tn(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});let t=n.__lexicalClassNameCache,o=t[e];if(o!==void 0)return o;let r=n[e];if(typeof r=="string"){let s=Do(r);return t[e]=s,s}return r}function na(n,e,t,o,r){if(t.size===0)return;let s=o.__type,i=o.__key,a=e.get(s);a===void 0&&v(33,s);let l=a.klass,c=n.get(l);c===void 0&&(c=new Map,n.set(l,c));let u=c.get(i),d=u==="destroyed"&&r==="created";(u===void 0||d)&&c.set(i,d?"updated":r)}function lm(n){let e=n.getType(),t=yt();if(t._readOnly){let s=Ti(t).get(e);return s?Array.from(s.values()):[]}let o=t._nodeMap,r=[];for(let[,s]of o)s instanceof n&&s.__type===e&&s.isAttached()&&r.push(s);return r}function xc(n,e,t){let o=n.getParent(),r=t,s=n;return o!==null&&(e&&t===0?(r=s.getIndexWithinParent(),s=o):e||t!==s.getChildrenSize()||(r=s.getIndexWithinParent()+1,s=o)),s.getChildAtIndex(e?r-1:r)}function Bu(n,e){let t=n.offset;if(n.type==="element")return xc(n.getNode(),e,t);{let o=n.getNode();if(e&&t===0||!e&&t===o.getTextContentSize()){let r=e?o.getPreviousSibling():o.getNextSibling();return r===null?xc(o.getParentOrThrow(),e,o.getIndexWithinParent()+(e?0:1)):r}}return null}function Wu(n){let e=Ae(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function b(n,e,t){return(function(o,r,s){let i=Zi(o);for(let a=4;a>=0;a--)for(let l=0;l<i.length;l++){let c=i[l],u=c._commands.get(r);if(u!==void 0){let d=u[a];if(d!==void 0){let f=Array.from(d),h=f.length,g=!1;if(et(c,()=>{for(let p=0;p<h;p++)if(f[p](s,o))return void(g=!0)}),g)return g}}}return!1})(n,e,t)}function Dn(n,e){let t=n._keyToDOMMap.get(e);return t===void 0&&v(75,e),t}function Mo(n){let e=n.assignedSlot||n.parentElement;return Gu(e)?e.host:e}function oa(n){return ku(n)?n:Ne(n)?n.ownerDocument:null}function cm(n){return X()._updateTags.has(n)}function Fr(n){ce(),X()._updateTags.add(n)}function Uu(n){ce(),X()._deferred.push(n)}function Mr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function ra(n){let e=oa(n);return e?e.defaultView:null}function Ae(n){let e=n._window;return e===null&&v(78),e}function um(n){return M(n)&&n.isInline()||Q(n)&&n.isInline()}function zu(n){let e=n.getParentOrThrow();for(;e!==null;){if(Ie(e))return e;e=e.getParentOrThrow()}return e}function Ie(n){return pe(n)||M(n)&&n.isShadowRoot()}function sa(n){let e=n.constructor.clone(n);return Iu(e,null),e.afterCloneFrom(n),e}function vo(n){let e=X(),t=n.getType(),o=Vi(e,t);o===void 0&&v(200,n.constructor.name,t);let{replace:r,replaceWithKlass:s}=o;if(r!==null){let i=r(n),a=i.constructor;return s!==null?i instanceof s||v(201,s.name,s.getType(),a.name,a.getType(),n.constructor.name,t):i instanceof n.constructor&&a!==n.constructor||v(202,a.name,a.getType(),n.constructor.name,t),i.__key===n.__key&&v(203,n.constructor.name,t,a.name,a.getType()),i}return n}function js(n,e){!pe(n.getParent())||M(e)||Q(e)||v(99)}function Hu(n){let e=re(n);return e===null&&v(63,n),e}function Js(n){return(Q(n)||M(n)&&!n.canBeEmpty())&&!n.isInline()}function Ci(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;let o=n.parentElement;o!==null&&o.removeChild(n)}function Ye(n){return He?(n||window).getSelection():null}function Yu(n){let e=ra(n);return e?e.getSelection():null}function dm(n,e){let t=n.getChildAtIndex(e);t==null&&(t=n),Ie(n)&&v(102);let o=i=>{let a=i.getParentOrThrow(),l=Ie(a),c=i!==t||l?sa(i):i;if(l)return M(i)&&M(c)||v(133),i.insertAfter(c),[i,c,c];{let[u,d,f]=o(a),h=i.getNextSiblings();return f.append(c,...h),[u,d,c]}},[r,s]=o(t);return[r,s]}function fm(n){return Ne(n)&&n.tagName==="A"}function Ne(n){return Pn(n)&&n.nodeType===1}function Pn(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function Gu(n){return Pn(n)&&n.nodeType===11}function ju(n){let e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Si(n){let e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function pt(n){if(Q(n)&&!n.isInline())return!0;if(!M(n)||Ie(n))return!1;let e=n.getFirstChild(),t=e===null||Xt(e)||I(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function ia(){return X()}var yc=new WeakMap,gm=new Map;function Ti(n){if(!n._readOnly&&n.isEmpty())return gm;n._readOnly||v(192);let e=yc.get(n);return e||(e=(function(t){let o=new Map;for(let[r,s]of t._nodeMap){let i=s.__type,a=o.get(i);a||(a=new Map,o.set(i,a)),a.set(r,s)}return o})(n),yc.set(n,e)),e}function aa(n){let e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function hm(n){return(e=aa(n))[cu]=!0,e;var e}function Ju(n,e){let t=parseInt(n.style.paddingInlineStart,10)||0,o=Math.round(t/40);e.setIndent(o)}function pm(n){n.__lexicalUnmanaged=!0}function Vu(n){return n.__lexicalUnmanaged===!0}function no(n,e){return(function(t,o){return Object.prototype.hasOwnProperty.call(t,o)})(n,e)&&n[e]!==ke[e]}function Ao(n){let e=Rl in n.prototype?n.prototype[Rl]():void 0,t=(function(i){if(!(i===ke||i.prototype instanceof ke)){let a="<unknown>",l="<unknown>";try{a=i.getType()}catch{}try{kt.version&&(l=JSON.parse(kt.version))}catch{}v(290,i.name,a,l)}return i===xo||i===Rt||i===ke})(n),o=!t&&no(n,"getType")?n.getType():void 0,r,s=o;if(e)if(o)r=e[o];else for(let[i,a]of Object.entries(e))s=i,r=a;if(!t&&s&&(no(n,"getType")||(n.getType=()=>s),no(n,"clone")||(n.clone=i=>(ji(i),new n)),no(n,"importJSON")||(n.importJSON=r&&r.$importJSON||(i=>new n().updateFromJSON(i))),!no(n,"importDOM")&&r)){let{importDOM:i}=r;i&&(n.importDOM=()=>i)}return{ownNodeConfig:r,ownNodeType:s}}function mm(n){let e=ia();return ce(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}var ao=(n,e)=>{let t=n;for(;t!=null&&!pe(t);){if(e(t))return t;t=t.getParent()}return null},_m={next:"previous",previous:"next"},bn=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return ua({hasNext:on,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return ge(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return ge(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let o=this.getNodeAtCaret();return e.is(this.origin)||e.is(o)||(o===null?this.insert(e):o.replace(e,t)),this}splice(e,t,o="next"){let r=o===this.direction?t:Array.from(t).reverse(),s=this,i=this.getParentAtCaret(),a=new Map;for(let l=s.getAdjacentCaret();l!==null&&a.size<e;l=l.getAdjacentCaret()){let c=l.origin.getWritable();a.set(c.getKey(),c)}for(let l of r){if(a.size>0){let c=s.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||s.origin.is(l))){let u=l.getParent();u&&u.is(i)&&l.remove(),c.replace(l)}}else c===null&&v(263,Array.from(a).join(" "))}else s.insert(l);s=ge(l,this.direction)}for(let l of a.values())l.remove();return this}},Co=class n extends bn{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:xt(e,this.direction)}getParentCaret(e="root"){return ge(la(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=wt(this.direction);return ge(this.getNodeAtCaret(),e)||xt(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof n&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},xm={root:pe,shadowRoot:Ie};function wt(n){return _m[n]}function la(n,e="root"){return xm[e](n)?null:n}var Rn=class n extends bn{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:ge(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return M(this.origin)?xt(this.origin,this.direction):null}getParentCaret(e="root"){return ge(la(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=wt(this.direction);return ge(this.getNodeAtCaret(),e)||xt(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof n&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof n||e instanceof kn)&&this.direction===e.direction&&this.origin.is(e.origin)}},kn=class n extends bn{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:It(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return ge(la(this.getParentAtCaret(),e),this.direction)}getFlipped(){return It(this.origin,wt(this.direction),this.offset)}isSamePointCaret(e){return e instanceof n&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof Rn||e instanceof n)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return ge(this.origin,this.direction)}};function _t(n){return n instanceof kn}function ym(n){return n instanceof bn}function on(n){return n instanceof Rn}function We(n){return n instanceof Co}var Nm={next:class extends kn{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends kn{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Cm={next:class extends Rn{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends Rn{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Sm={next:class extends Co{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends Co{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function ge(n,e){return n?new Cm[e](n):null}function It(n,e,t){return n?new Nm[e](n,Ue(n,t)):null}function Ue(n,e,t="error"){let o=n.getTextContentSize(),r=e==="next"?o:e==="previous"?0:e;return(r<0||r>o)&&(t!=="clamp"&&Sc(284,String(e),String(o),n.getKey()),r=r<0?0:o),r}function Ei(n,e){return new vr(n,e)}function xt(n,e){return M(n)?new Sm[e](n):null}function qu(n){return n&&n.getChildCaret()||n}function In(n){return n&&qu(n.getAdjacentCaret())}var Oi=class n{type="node-caret-range";direction;anchor;focus;constructor(e,t,o){this.anchor=e,this.focus=t,this.direction=o}getLatest(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new n(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=r=>{let s=this[r].getLatest();return _t(s)?(function(i,a){let{direction:l,origin:c}=i,u=Ue(c,a==="focus"?wt(l):l);return Ei(i,u-i.offset)})(s,r):null},t=e("anchor"),o=e("focus");if(t&&o){let{caret:r}=t,{caret:s}=o;if(r.isSameNodeCaret(s))return[Ei(r,s.offset-r.offset),null]}return[t,o]}iterNodeCarets(e="root"){let t=_t(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),o=this.focus.getLatest(),r=_t(o),s=i=>i.isSameNodeCaret(o)?null:In(i)||i.getParentCaret(e);return ua({hasNext:i=>i!==null&&!(r&&o.isSameNodeCaret(i)),initial:t.isSameNodeCaret(o)?null:s(t),map:i=>i,step:s})}[Symbol.iterator](){return this.iterNodeCarets("root")}},vr=class{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,o=t+e;return o<t?[o,t]:[t,o]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[o,r]=this.getSliceIndices(),s=e.getTextContent();return It(e.setTextContent(s.slice(0,o)+s.slice(r)),t,o)}};function Tm(n){return n instanceof vr}function ca(n){return $t(n,ge(ve(),n.direction))}function Xu(n){return $t(n,n)}function $t(n,e){return n.direction!==e.direction&&v(265),new Oi(n,e,n.direction)}function ua(n){let{initial:e,hasNext:t,step:o,map:r}=n,s=e;return{[Symbol.iterator](){return this},next(){if(!t(s))return{done:!0,value:void 0};let i={done:!1,value:r(s)};return s=o(s),i}}}function da(n,e){let t=lo(n.origin,e.origin);switch(t===null&&v(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{let o=n.type==="text",r=e.type==="text";return o&&r?(function(s,i){return Math.sign(s-i)})(n.offset,e.offset):n.type===e.type?0:o?-1:r?1:n.type==="child"?-1:1}case"ancestor":return n.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return fa(t)}}function fa(n){let{a:e,b:t}=n,o=e.__key,r=t.__key,s=e,i=t;for(;s&&i;s=s.getNextSibling(),i=i.getNextSibling()){if(s.__key===r)return-1;if(i.__key===o)return 1}return s===null?1:-1}function or(n,e){return e.is(n)}function Nc(n){return M(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function lo(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};let t=new Map;for(let[o,r]=Nc(n);o;r=o,o=o.getParent())t.set(o,r);for(let[o,r]=Nc(e);o;r=o,o=o.getParent()){let s=t.get(o);if(s!==void 0)return s===null?(or(n,o)||v(276),{commonAncestor:o,type:"ancestor"}):r===null?(or(e,o)||v(277),{commonAncestor:o,type:"descendant"}):((M(s)||or(n,s))&&(M(r)||or(e,r))&&o.is(s.getParent())&&o.is(r.getParent())||v(278),{a:s,b:r,commonAncestor:o,type:"branch"})}return null}function Lt(n,e){let{type:t,key:o,offset:r}=n,s=Hu(n.key);return t==="text"?(I(s)||v(266,s.getType(),o),It(s,e,r)):(M(s)||v(267,s.getType(),o),td(s,n.offset,e))}function $n(n,e){let{origin:t,direction:o}=e,r=o==="next";_t(e)?n.set(t.getKey(),e.offset,"text"):on(e)?I(t)?n.set(t.getKey(),Ue(t,o),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(r?1:0),"element"):(We(e)&&M(t)||v(268),n.set(t.getKey(),r?0:t.getChildrenSize(),"element"))}function Qu(n){let e=G(),t=L(e)?e:Nu();return co(t,n),Ee(t),t}function co(n,e){$n(n.anchor,e.anchor),$n(n.focus,e.focus)}function Mi(n){let{anchor:e,focus:t}=n,o=Lt(e,"next"),r=Lt(t,"next"),s=da(o,r)<=0?"next":"previous";return $t(Pt(o,s),Pt(r,s))}function wn(n){let{direction:e,origin:t}=n,o=ge(t,wt(e)).getNodeAtCaret();return o?ge(o,e):xt(t.getParentOrThrow(),e)}function Cc(n,e="root"){let t=[n];for(let o=We(n)?n.getParentCaret(e):n.getSiblingCaret();o!==null;o=o.getParentCaret(e))t.push(wn(o));return t}function Vs(n){return!!n&&n.origin.isAttached()}function Zu(n,e="removeEmptySlices"){if(n.isCollapsed())return n;let t="root",o="next",r=e,s=ga(n,o),i=Cc(s.anchor,t),a=Cc(s.focus.getFlipped(),t),l=new Set,c=[];for(let g of s.iterNodeCarets(t))if(We(g))l.add(g.origin.getKey());else if(on(g)){let{origin:p}=g;M(p)&&!l.has(p.getKey())||c.push(p)}for(let g of c)g.remove();for(let g of s.getTextSlices()){if(!g)continue;let{origin:p}=g.caret,m=p.getTextContentSize(),x=wn(ge(p,o)),y=p.getMode();if(Math.abs(g.distance)===m&&r==="removeEmptySlices"||y==="token"&&g.distance!==0)x.remove();else if(g.distance!==0){r="removeEmptySlices";let N=g.removeTextSlice(),T=g.caret.origin;if(y==="segmented"){let O=N.origin,E=le(O.getTextContent()).setStyle(O.getStyle()).setFormat(O.getFormat());x.replaceOrInsert(E),N=It(E,o,N.offset)}T.is(i[0].origin)&&(i[0]=N),T.is(a[0].origin)&&(a[0]=N.getFlipped())}}let u,d;for(let g of i)if(Vs(g)){u=Ke(g);break}for(let g of a)if(Vs(g)){d=Ke(g);break}let f=(function(g,p,m){if(!g||!p)return null;let x=g.getParentAtCaret(),y=p.getParentAtCaret();if(!x||!y)return null;let N=x.getParents().reverse();N.push(x);let T=y.getParents().reverse();T.push(y);let O=Math.min(N.length,T.length),E;for(E=0;E<O&&N[E]===T[E];E++);let A=(k,F)=>{let j;for(let Y=E;Y<k.length;Y++){let H=k[Y];if(Ie(H))return;!j&&F(H)&&(j=H)}return j},C=A(N,pt),S=C&&A(T,k=>m.has(k.getKey())&&pt(k));return C&&S?[C,S]:null})(u,d,l);if(f){let[g,p]=f;xt(g,"previous").splice(0,p.getChildren());let m=p.getParent();for(p.remove(!0);m&&m.isEmpty();){let x=m;m=m.getParent(),x.remove(!0)}}let h=[u,d,...i,...a].find(Vs);if(h)return Xu(Pt(Ke(h),n.direction));v(269,JSON.stringify(i.map(g=>g.origin.__key)))}function Ke(n){let e=(function(r){let s=r;for(;We(s);){let i=In(s);if(!We(i))break;s=i}return s})(n.getLatest()),{direction:t}=e;if(I(e.origin))return _t(e)?e:It(e.origin,t,t);let o=e.getAdjacentCaret();return on(o)&&I(o.origin)?It(o.origin,t,wt(t)):e}function ed(n){return _t(n)&&n.offset!==Ue(n.origin,n.direction)}function Pt(n,e){return n.direction===e?n:n.getFlipped()}function ga(n,e){return n.direction===e?n:$t(Pt(n.focus,e),Pt(n.anchor,e))}function td(n,e,t){let o=xt(n,"next");for(let r=0;r<e;r++){let s=o.getAdjacentCaret();if(s===null)break;o=s}return Pt(o,t)}function Em(n,e="root"){let t=0,o=n,r=In(o);for(;r===null;){if(t--,r=o.getParentCaret(e),!r)return null;o=r,r=In(o)}return r&&[r,t]}function Om(n){let{origin:e,offset:t,direction:o}=n;if(t===Ue(e,o))return n.getSiblingCaret();if(t===Ue(e,wt(o)))return wn(n.getSiblingCaret());let[r]=e.splitText(t);return I(r)||v(281),Pt(ge(r,"next"),o)}function Mm(n,e){return!0}function vm(n,{$copyElementNode:e=sa,$splitTextPointCaretNext:t=Om,rootMode:o="shadowRoot",$shouldSplit:r=Mm}={}){if(_t(n))return t(n);let s=n.getParentCaret(o);if(s){let{origin:i}=s;if(We(n)&&(!i.canBeEmpty()||!r(i,"first")))return wn(s);let a=(function(l){let c=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(n);(a.length>0||i.canBeEmpty()&&r(i,"last"))&&s.insert(e(i).splice(0,0,a))}return s}function Am(n){return n}function Dm(...n){return n}function bm(n,e){return[n,e]}function Rm(n){return n}function km(n,e){if(!e||n===e)return n;for(let t in e)if(n[t]!==e[t])return{...n,...e};return n}function Do(...n){let e=[];for(let t of n)if(t&&typeof t=="string")for(let[o]of t.matchAll(/\S+/g))e.push(o);return e}function Im(n,...e){let t=Do(...e);t.length>0&&n.classList.add(...t)}function $m(n,...e){let t=Do(...e);t.length>0&&n.classList.remove(...t)}function Lm(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}var _=ha,pa=_.$addUpdateTag,Nt=_.$applyNodeReplacement,Ft=_.$caretFromPoint,nd=_.$caretRangeFromSelection,Kr=_.$cloneWithProperties,od=_.$cloneWithPropertiesEphemeral,ry=_.$comparePointCaretNext,rd=_.$copyNode,sd=_.$create,ma=_.$createLineBreakNode,id=_.$createNodeSelection,se=_.$createParagraphNode,sy=_.$createPoint,Fn=_.$createRangeSelection,iy=_.$createRangeSelectionFromDom,Br=_.$createTabNode,Kt=_.$createTextNode,ad=_.$extendCaretToRange,Ct=_.$findMatchingParent,_a=_.$getAdjacentChildCaret,xa=_.$getAdjacentNode,sn=_.$getAdjacentSiblingOrParentSiblingCaret,ya=_.$getCaretInDirection,ld=_.$getCaretRange,ay=_.$getCaretRangeInDirection,cd=_.$getCharacterOffsets,De=_.$getChildCaret,ly=_.$getChildCaretAtIndex,Na=_.$getChildCaretOrSelf,ud=_.$getCollapsedCaretRange,cy=_.$getCommonAncestor,uy=_.$getCommonAncestorResultBranchOrder,Wr=_.$getEditor,nt=_.$getNearestNodeFromDOMNode,dy=_.$getNearestRootOrShadowRoot,Kn=_.$getNodeByKey,fy=_.$getNodeByKeyOrThrow,dd=_.$getNodeFromDOMNode,bo=_.$getPreviousSelection,Ce=_.$getRoot,R=_.$getSelection,St=_.$getSiblingCaret,Ur=_.$getState,gy=_.$getStateChange,hy=_.$getTextContent,py=_.$getTextNodeOffset,my=_.$getTextPointCaret,_y=_.$getTextPointCaretSlice,xy=_.$getWritableNodeState,fd=_.$hasAncestor,yy=_.$hasUpdateTag,zr=_.$insertNodes,Bn=_.$isBlockElementNode,Ro=_.$isChildCaret,an=_.$isDecoratorNode,gd=_.$isEditorState,$=_.$isElementNode,hd=_.$isExtendableTextPointCaret,Ny=_.$isInlineElementOrDecoratorNode,ko=_.$isLeafNode,Ca=_.$isLineBreakNode,Cy=_.$isNodeCaret,he=_.$isNodeSelection,pd=_.$isParagraphNode,D=_.$isRangeSelection,ln=_.$isRootNode,$e=_.$isRootOrShadowRoot,md=_.$isSiblingCaret,Sy=_.$isTabNode,B=_.$isTextNode,Hr=_.$isTextPointCaret,Ty=_.$isTextPointCaretSlice,Sa=_.$isTokenOrSegmented,Ey=_.$isTokenOrTab,Oy=_.$nodesOfType,cn=_.$normalizeCaret,Bt=_.$normalizeSelection__EXPERIMENTAL,My=_.$onUpdate,_d=_.$parseSerializedNode,vy=_.$removeTextFromCaretRange,Yr=_.$rewindSiblingCaret,Gr=_.$selectAll,Ay=_.$setCompositionKey,Io=_.$setPointFromCaret,Ge=_.$setSelection,xd=_.$setSelectionFromCaretRange,jr=_.$setState,yd=_.$splitAtPointCaretNext,Nd=_.$splitNode,Dy=_.$updateRangeSelectionFromCaretRange,Ta=_.ArtificialNode__DO_NOT_USE,by=_.BEFORE_INPUT_COMMAND,Ry=_.BLUR_COMMAND,$o=_.CAN_REDO_COMMAND,Lo=_.CAN_UNDO_COMMAND,Jr=_.CLEAR_EDITOR_COMMAND,Cd=_.CLEAR_HISTORY_COMMAND,Vr=_.CLICK_COMMAND,ky=_.COLLABORATION_TAG,qr=_.COMMAND_PRIORITY_CRITICAL,W=_.COMMAND_PRIORITY_EDITOR,Iy=_.COMMAND_PRIORITY_HIGH,ie=_.COMMAND_PRIORITY_LOW,$y=_.COMMAND_PRIORITY_NORMAL,Ly=_.COMPOSITION_END_COMMAND,Sd=_.COMPOSITION_END_TAG,Py=_.COMPOSITION_START_COMMAND,Td=_.COMPOSITION_START_TAG,Ed=_.CONTROLLED_TEXT_INSERTION_COMMAND,Xr=_.COPY_COMMAND,Od=_.CUT_COMMAND,Qr=_.DELETE_CHARACTER_COMMAND,Md=_.DELETE_LINE_COMMAND,vd=_.DELETE_WORD_COMMAND,wy=_.DRAGEND_COMMAND,Ad=_.DRAGOVER_COMMAND,Dd=_.DRAGSTART_COMMAND,bd=_.DROP_COMMAND,Zr=_.DecoratorNode,ot=_.ElementNode,Fy=_.FOCUS_COMMAND,Rd=_.FORMAT_ELEMENT_COMMAND,Tt=_.FORMAT_TEXT_COMMAND,es=_.HISTORIC_TAG,ts=_.HISTORY_MERGE_TAG,kd=_.HISTORY_PUSH_TAG,Po=_.INDENT_CONTENT_COMMAND,Ky=_.INPUT_COMMAND,Ea=_.INSERT_LINE_BREAK_COMMAND,wo=_.INSERT_PARAGRAPH_COMMAND,ns=_.INSERT_TAB_COMMAND,Fo=_.INTERNAL_$isBlock,By=_.IS_ALL_FORMATTING,Wy=_.IS_BOLD,Uy=_.IS_CODE,zy=_.IS_HIGHLIGHT,Hy=_.IS_ITALIC,Yy=_.IS_STRIKETHROUGH,Gy=_.IS_SUBSCRIPT,jy=_.IS_SUPERSCRIPT,Jy=_.IS_UNDERLINE,os=_.KEY_ARROW_DOWN_COMMAND,rs=_.KEY_ARROW_LEFT_COMMAND,Id=_.KEY_ARROW_RIGHT_COMMAND,ss=_.KEY_ARROW_UP_COMMAND,$d=_.KEY_BACKSPACE_COMMAND,Ld=_.KEY_DELETE_COMMAND,Vy=_.KEY_DOWN_COMMAND,Pd=_.KEY_ENTER_COMMAND,is=_.KEY_ESCAPE_COMMAND,qy=_.KEY_MODIFIER_COMMAND,as=_.KEY_SPACE_COMMAND,ls=_.KEY_TAB_COMMAND,wd=_.LineBreakNode,Xy=_.MOVE_TO_END,Qy=_.MOVE_TO_START,Zy=_.NODE_STATE_KEY,Ko=_.OUTDENT_CONTENT_COMMAND,cs=_.PASTE_COMMAND,Fd=_.PASTE_TAG,Kd=_.ParagraphNode,Bd=_.REDO_COMMAND,Wd=_.REMOVE_TEXT_COMMAND,Ud=_.RootNode,eN=_.SELECTION_CHANGE_COMMAND,zd=_.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Hd=_.SELECT_ALL_COMMAND,tN=_.SKIP_COLLAB_TAG,Yd=_.SKIP_DOM_SELECTION_TAG,nN=_.SKIP_SCROLL_INTO_VIEW_TAG,Gd=_.SKIP_SELECTION_FOCUS_TAG,jd=_.TEXT_TYPE_TO_FORMAT,Jd=_.TabNode,Wn=_.TextNode,Vd=_.UNDO_COMMAND,Bo=_.addClassNamesToElement,Oa=_.buildImportMap,us=_.configExtension,Le=_.createCommand,ds=_.createEditor,oN=_.createSharedNodeState,qd=_.createState,Xd=_.declarePeerDependency,Z=_.defineExtension,rN=_.flipDirection,sN=_.getDOMOwnerDocument,Ma=_.getDOMSelection,iN=_.getDOMSelectionFromTarget,Qd=_.getDOMTextNode,aN=_.getEditorPropertyFromDOMNode,fs=_.getNearestEditorFromDOMNode,Zd=_.getRegisteredNode,lN=_.getRegisteredNodeOrThrow,cN=_.getStaticNodeConfig,uN=_.getTextDirection,dN=_.getTransformSetFromKlass,ef=_.isBlockDomNode,fN=_.isCurrentlyReadOnlyMode,tf=_.isDOMDocumentNode,Un=_.isDOMNode,gN=_.isDOMTextNode,hN=_.isDOMUnmanaged,va=_.isDocumentFragment,pN=_.isExactShortcutMatch,nf=_.isHTMLAnchorElement,gs=_.isHTMLElement,Wo=_.isInlineDomNode,mN=_.isLexicalEditor,_N=_.isModifierMatch,of=_.isSelectionCapturedInDecoratorInput,rf=_.isSelectionWithinEditor,Aa=_.makeStepwiseIterator,rt=_.mergeRegister,Uo=_.normalizeClassNames,hs=_.removeClassNamesFromElement,xN=_.removeFromParent,yN=_.resetRandomKey,ye=_.safeCast,NN=_.setDOMUnmanaged,Da=_.setNodeIndentFromDOM,Wt=_.shallowMergeConfig,ba=_.toggleTextFormatType;var Pa={};we(Pa,{$addNodeStyle:()=>Wm,$cloneWithProperties:()=>Kr,$copyBlockFormatIndent:()=>hf,$ensureForwardRangeSelection:()=>gf,$forEachSelectedTextNode:()=>ff,$getComputedStyleForElement:()=>Ia,$getComputedStyleForParent:()=>$a,$getSelectionStyleValueForProperty:()=>Vm,$isAtNodeEnd:()=>Bm,$isParentElementRTL:()=>La,$isParentRTL:()=>Fm,$moveCaretSelection:()=>_f,$moveCharacter:()=>jm,$patchStyleText:()=>Um,$selectAll:()=>Gr,$setBlocksType:()=>zm,$shouldOverrideDefaultCharacterSelection:()=>Gm,$sliceSelectedTextNodeContent:()=>Km,$trimTextContentFromAnchor:()=>df,$wrapNodes:()=>Ym,createDOMRange:()=>Pm,createRectsFromDOMRange:()=>wm,getCSSFromStyleObject:()=>uf,getStyleObjectFromCSS:()=>_s,trimTextContentFromAnchor:()=>qm});function ka(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var ms=new Map;function sf(n){let e=n;for(;e!=null;){if(e.nodeType===Node.TEXT_NODE)return e;e=e.firstChild}return null}function af(n){let e=n.parentNode;if(e==null)throw new Error("Should never happen");return[e,Array.from(e.childNodes).indexOf(n)]}function Pm(n,e,t,o,r){let s=e.getKey(),i=o.getKey(),a=document.createRange(),l=n.getElementByKey(s),c=n.getElementByKey(i),u=t,d=r;if(B(e)&&(l=sf(l)),B(o)&&(c=sf(c)),e===void 0||o===void 0||l===null||c===null)return null;l.nodeName==="BR"&&([l,u]=af(l)),c.nodeName==="BR"&&([c,d]=af(c));let f=l.firstChild;l===c&&f!=null&&f.nodeName==="BR"&&u===0&&d===0&&(d=1);try{a.setStart(l,u),a.setEnd(c,d)}catch{return null}return!a.collapsed||u===d&&s===i||(a.setStart(c,d),a.setEnd(l,u)),a}function wm(n,e){let t=n.getRootElement();if(t===null)return[];let o=t.getBoundingClientRect(),r=getComputedStyle(t),s=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),i=Array.from(e.getClientRects()),a,l=i.length;i.sort((c,u)=>{let d=c.top-u.top;return Math.abs(d)<=3?c.left-u.left:d});for(let c=0;c<l;c++){let u=i[c],d=a&&a.top<=u.top&&a.top+a.height>u.top&&a.left+a.width>u.left,f=u.width+s===o.width;d||f?(i.splice(c--,1),l--):a=u}return i}function cf(n){let e={};if(!n)return e;let t=n.split(";");for(let o of t)if(o!==""){let[r,s]=o.split(/:([^]+)/);r&&s&&(e[r.trim()]=s.trim())}return e}function _s(n){let e=ms.get(n);return e===void 0&&(e=cf(n),ms.set(n,e)),e}function uf(n){let e="";for(let t in n)t&&(e+=`${t}: ${n[t]};`);return e}function Ia(n){let e=Wr().getElementByKey(n.getKey());if(e===null)return null;let t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function $a(n){return Ia(ln(n)?n:n.getParentOrThrow())}function Fm(n){let e=$a(n);return e!==null&&e.direction==="rtl"}function Km(n,e,t="self"){let o=n.getStartEndPoints();if(e.isSelected(n)&&!Sa(e)&&o!==null){let[r,s]=o,i=n.isBackward(),a=r.getNode(),l=s.getNode(),c=e.is(a),u=e.is(l);if(c||u){let[d,f]=cd(n),h=a.is(l),g=e.is(i?l:a),p=e.is(i?a:l),m,x=0;h?(x=d>f?f:d,m=d>f?d:f):g?(x=i?f:d,m=void 0):p&&(x=0,m=i?d:f);let y=e.__text.slice(x,m);y!==e.__text&&(t==="clone"&&(e=od(e)),e.__text=y)}}return e}function Bm(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();let e=n.getNode();return $(e)||ka(177),n.offset===e.getChildrenSize()}function df(n,e,t){let o=e.getNode(),r=t;if($(o)){let s=o.getDescendantByIndex(e.offset);s!==null&&(o=s)}for(;r>0&&o!==null;){if($(o)){let c=o.getLastDescendant();c!==null&&(o=c)}let s=o.getPreviousSibling(),i=0;if(s===null){let c=o.getParentOrThrow(),u=c.getPreviousSibling();for(;u===null;){if(c=c.getParent(),c===null){s=null;break}u=c.getPreviousSibling()}c!==null&&(i=c.isInline()?0:2,s=u)}let a=o.getTextContent();a===""&&$(o)&&!o.isInline()&&(a=`
11
+ `?o.push(On()):i===" "?o.push(Ir()):o.push(le(i))}this.insertNodes(o)}insertText(e){let t=this.anchor,o=this.focus,r=this.format,s=this.style,i=t,a=o;!this.isCollapsed()&&o.isBefore(t)&&(i=o,a=t),i.type==="element"&&(function(m,x,y,N){let T=m.getNode(),O=T.getChildAtIndex(m.offset),E=le();if(E.setFormat(y),E.setStyle(N),Du(O))O.splice(0,0,[E]);else{let A=pe(T)?mt().append(E):E;O===null?T.append(A):O.insertBefore(A)}m.is(x)&&x.set(E.__key,0,"text"),m.set(E.__key,0,"text")})(i,a,r,s),a.type==="element"&&$n(a,Ke(Lt(a,"next")));let l=i.offset,c=a.offset,u=this.getNodes(),d=u.length,f=u[0];I(f)||v(26);let h=f.getTextContent().length,g=f.getParentOrThrow(),p=u[d-1];if(d===1&&a.type==="element"&&(c=h,a.set(i.key,c,"text")),this.isCollapsed()&&l===h&&(gt(f)||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let m=f.getNextSibling();if(I(m)&&m.canInsertTextBefore()&&!gt(m)||(m=le(),m.setFormat(r),m.setStyle(s),g.canInsertTextAfter()?f.insertAfter(m):g.insertAfter(m)),m.select(0,0),f=m,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&l===0&&(gt(f)||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let m=f.getPreviousSibling();if(I(m)&&!gt(m)||(m=le(),m.setFormat(r),g.canInsertTextBefore()?f.insertBefore(m):g.insertBefore(m)),m.select(),f=m,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&l!==h){let m=le(f.getTextContent());m.setFormat(r),f.replace(m),f=m}else if(!this.isCollapsed()&&e!==""){let m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||M(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),yu(this.anchor,this.focus),void this.insertText(e)}if(d===1){if(At(f)){let N=le(e);return N.select(),void f.replace(N)}let m=f.getFormat(),x=f.getStyle();if(l!==c||m===r&&x===s){if(Hi(f)){let N=le(e);return N.setFormat(r),N.setStyle(s),N.select(),void f.replace(N)}}else{if(f.getTextContent()!==""){let N=le(e);if(N.setFormat(r),N.setStyle(s),N.select(),l===0)f.insertBefore(N,!1);else{let[T]=f.splitText(l);T.insertAfter(N,!1)}return void(N.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(r),f.setStyle(s)}let y=c-l;f=f.spliceText(l,y,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(this.format=m,this.style=x,f.isComposing()&&(this.anchor.offset-=e.length))}else{let m=new Set([...f.getParentKeys(),...p.getParentKeys()]),x=M(f)?f:f.getParentOrThrow(),y=M(p)?p:p.getParentOrThrow(),N=p;if(!x.is(y)&&y.isInline())do N=y,y=y.getParentOrThrow();while(y.isInline());if(a.type==="text"&&(c!==0||p.getTextContent()==="")||a.type==="element"&&p.getIndexWithinParent()<c)if(I(p)&&!At(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){let C=le(p.getTextContent());p.replace(C),p=C}pe(a.getNode())||a.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{let C=p.getParentOrThrow();C.canBeEmpty()||C.getChildrenSize()!==1?p.remove():C.remove()}else m.add(p.__key);let T=y.getChildren(),O=new Set(u),E=x.is(y),A=x.isInline()&&f.getNextSibling()===null?x:f;for(let C=T.length-1;C>=0;C--){let S=T[C];if(S.is(f)||M(S)&&S.isParentOf(f))break;S.isAttached()&&(!O.has(S)||S.is(N)?E||A.insertAfter(S,!1):S.remove())}if(!E){let C=y,S=null;for(;C!==null;){let k=C.getChildren(),F=k.length;(F===0||k[F-1].is(S))&&(m.delete(C.__key),S=C),C=C.getParent()}}if(At(f))if(l===h)f.select();else{let C=le(e);C.select(),f.replace(C)}else f=f.spliceText(l,h-l,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(this.format=f.getFormat(),this.style=f.getStyle(),f.isComposing()&&(this.anchor.offset-=e.length));for(let C=1;C<d;C++){let S=u[C],k=S.__key;m.has(k)||S.remove()}}}removeText(){let e=G()===this;uo(this,td(vi(this))),e&&G()!==this&&Ee(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void ue(null);let o=this.getNodes(),r=[];for(let T of o)I(T)&&r.push(T);let s=T=>{o.forEach(O=>{if(M(O)){let E=O.getFormatFlags(e,T);O.setTextFormat(E)}})},i=r.length;if(i===0)return this.toggleFormat(e),ue(null),void s(t);let a=this.anchor,l=this.focus,c=this.isBackward(),u=c?l:a,d=c?a:l,f=0,h=r[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(f=1,h=r[1],g=0),h==null)return;let p=h.getFormatFlags(e,t);s(p);let m=i-1,x=r[m],y=d.type==="text"?d.offset:x.getTextContentSize();if(h.is(x)){if(g===y)return;if(gt(h)||g===0&&y===h.getTextContentSize())h.setFormat(p);else{let T=h.splitText(g,y),O=g===0?T[0]:T[1];O.setFormat(p),u.type==="text"&&u.set(O.__key,0,"text"),d.type==="text"&&d.set(O.__key,y-g,"text")}return void(this.format=p)}g===0||gt(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);let N=x.getFormatFlags(e,p);y>0&&(y===x.getTextContentSize()||gt(x)||([x]=x.splitText(y)),x.setFormat(N));for(let T=f+1;T<m;T++){let O=r[T],E=O.getFormatFlags(e,N);O.setFormat(E)}u.type==="text"&&u.set(h.__key,g,"text"),d.type==="text"&&d.set(x.__key,y,"text"),this.format=p|N}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();let g=G();return L(g)||v(134),g.insertNodes(e)}let t=(this.isBackward()?this.focus:this.anchor).getNode(),o=lo(t,pt),r=e[e.length-1];if(M(o)&&"__language"in o){if("__language"in e[0])this.insertText(e[0].getTextContent());else{let g=Gs(this);o.splice(g,0,e),r.selectEnd()}return}if(!e.some(g=>(M(g)||Q(g))&&!g.isInline())){M(o)||v(211,t.constructor.name,t.getType());let g=Gs(this);return o.splice(g,0,e),void r.selectEnd()}let s=(function(g){let p=mt(),m=null;for(let x=0;x<g.length;x++){let y=g[x],N=Xt(y);if(N||Q(y)&&y.isInline()||M(y)&&y.isInline()||I(y)||y.isParentRequired()){if(m===null&&(m=y.createParentElementNode(),p.append(m),N))continue;m!==null&&m.append(y)}else p.append(y),m=null}return p})(e),i=s.getLastDescendant(),a=s.getChildren(),l=!M(o)||!o.isEmpty()?this.insertParagraph():null,c=a[a.length-1],u=a[0];var d;M(d=u)&&pt(d)&&!d.isEmpty()&&M(o)&&(!o.isEmpty()||o.canMergeWhenEmpty())&&(M(o)||v(211,t.constructor.name,t.getType()),o.append(...u.getChildren()),u=a[1]),u&&(o===null&&v(212,t.constructor.name,t.getType()),(function(g,p){let m=p.getParentOrThrow().getLastChild(),x=p,y=[p];for(;x!==m;)x.getNextSibling()||v(140),x=x.getNextSibling(),y.push(x);let N=g;for(let T of y)N=N.insertAfter(T)})(o,u));let f=lo(i,pt);l&&M(f)&&(l.canMergeWhenEmpty()||pt(c))&&(f.append(...l.getChildren()),l.remove()),M(o)&&o.isEmpty()&&o.remove(),i.selectEnd();let h=M(o)?o.getLastChild():null;Xt(h)&&f!==o&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){let i=mt();return ve().splice(this.anchor.offset,0,[i]),i.select(),i}let e=Gs(this),t=lo(this.anchor.getNode(),pt);M(t)||v(213);let o=t.getChildAtIndex(e),r=o?[o,...o.getNextSiblings()]:[],s=t.insertNewAfter(this,!1);return s?(s.append(...r),s.selectStart(),s):null}insertLineBreak(e){let t=On();if(this.insertNodes([t]),e){let o=t.getParentOrThrow(),r=t.getIndexWithinParent();o.select(r,r)}}extract(){let e=[...this.getNodes()],t=e.length,o=e[0],r=e[t-1],[s,i]=yi(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,d]=a?[i,s]:[s,i];if(t===0)return[];if(t===1){if(I(o)&&!this.isCollapsed()){let f=o.splitText(u,d),h=u===0?f[0]:f[1];return h?(l.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[o]}if(I(o)&&(u===o.getTextContentSize()?e.shift():u!==0&&([,o]=o.splitText(u),e[0]=o,l.set(o.getKey(),0,"text"))),I(r)){let f=r.getTextContent().length;d===0?e.pop():d!==f&&([r]=r.splitText(d),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),"text"))}return e}modify(e,t,o){if(ac(this,e,t,o))return;let r=e==="move",s=X(),i=Ye(Ae(s));if(!i)return;let a=s._blockCursorElement,l=s._rootElement,c=this.focus.getNode();if(l===null||a===null||!M(c)||c.isInline()||c.canBeEmpty()||Si(a,s,l),this.dirty){let u=Dn(s,this.anchor.key),d=Dn(s,this.focus.key);this.anchor.type==="text"&&(u=nn(u)),this.focus.type==="text"&&(d=nn(d)),u&&d&&Tu(i,u,this.anchor.offset,d,this.focus.offset)}if((function(u,d,f,h){u.modify(d,f,h)})(i,e,t?"backward":"forward",o),i.rangeCount>0){let u=i.getRangeAt(0),d=this.anchor.getNode(),f=pe(d)?d:Yu(d);if(this.applyDOMRange(u),this.dirty=!0,!r){let h=this.getNodes(),g=[],p=!1;for(let m=0;m<h.length;m++){let x=h[m];vr(x,f)?g.push(x):p=!0}if(p&&g.length>0)if(t){let m=g[0];M(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{let m=g[g.length-1];M(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}i.anchorNode===u.startContainer&&i.anchorOffset===u.startOffset||(function(m){let x=m.focus,y=m.anchor,N=y.key,T=y.offset,O=y.type;y.set(x.key,x.offset,x.type,!0),x.set(N,T,O,!0)})(this)}}o==="lineboundary"&&ac(this,e,t,o,"decorators")}forwardDeletion(e,t,o){if(!o&&(e.type==="element"&&M(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){let r=t.getParent(),s=t.getNextSibling()||(r===null?null:r.getNextSibling());if(M(s)&&s.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let o=this.anchor,r=o.getNode();if(this.forwardDeletion(o,r,e))return;let s=ua(Lt(o,e?"previous":"next"));if(s.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(let l of s.iterNodeCarets("shadowRoot"))if(We(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(M(s.anchor.origin)&&s.anchor.origin.isEmpty()){let c=Ke(l);uo(this,$t(c,c)),s.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(on(l)){if(M(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(s.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(Q(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&M(s.anchor.origin)&&s.anchor.origin.isEmpty()){s.anchor.origin.remove();let c=Yi();c.add(l.origin.getKey()),Ee(c)}else l.origin.remove();return}break}}if(a.type==="merge-block"){let{caret:l,block:c}=a;return uo(this,$t(!l.origin.isEmpty()&&c.isEmpty()?wn(ge(c,l.direction)):s.anchor,l)),this.removeText()}}let i=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&o.offset===0&&ec(this,o.getNode()))return}else{let a=i.type==="text"?i.getNode():null;if(r=o.type==="text"?o.getNode():null,a!==null&&a.isSegmented()){let l=i.offset,c=a.getTextContentSize();if(a.is(r)||e&&l!==c||!e&&l!==0)return void tc(a,e,l)}else if(r!==null&&r.isSegmented()){let l=o.offset,c=r.getTextContentSize();if(r.is(a)||e&&l!==0||!e&&l!==c)return void tc(r,e,l)}(function(l,c){let u=l.anchor,d=l.focus,f=u.getNode(),h=d.getNode();if(f===h&&u.type==="text"&&d.type==="text"){let g=u.offset,p=d.offset,m=g<p,x=m?g:p,y=m?p:g,N=y-1;x!==N&&(function(T){return!(Fu(T)||Hp(T))})(f.getTextContent().slice(x,y))&&(c?d.set(d.key,N,d.type):u.set(u.key,N,u.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){let o=this.anchor.getNode();o.isEmpty()&&pe(o.getParent())&&o.getPreviousSibling()===null&&ec(this,o)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,o=t.getNode();if(this.forwardDeletion(t,o,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function Eo(n){return n instanceof Sr}function Zl(n){let e=n.offset;if(n.type==="text")return e;let t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function yi(n){let e=n.getStartEndPoints();if(e===null)return[0,0];let[t,o]=e;return t.type==="element"&&o.type==="element"&&t.key===o.key&&t.offset===o.offset?[0,0]:[Zl(t),Zl(o)]}function ec(n,e){for(let t=e;t;t=t.getParent()){if(M(t)){if(t.collapseAtStart(n))return!0;if(Ie(t))break}if(t.getPreviousSibling())break}return!1}var Hp=(()=>{try{let n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("\u2764\uFE0F")&&e("#\uFE0F\u20E3")&&e("\u{1F44D}"))return e}catch{}return()=>!1})();function tc(n,e,t){let o=n,r=o.getTextContent().split(/(?=\s)/g),s=r.length,i=0,a=0;for(let c=0;c<s;c++){let u=c===s-1;if(a=i,i+=r[c].length,e&&i===t||i>t||u){r.splice(c,1),u&&(a=void 0);break}}let l=r.join("").trim();l===""?o.remove():(o.setTextContent(l),o.select(a,a))}function nc(n,e,t,o){let r,s=e;if(Ne(n)){let i=!1,a=n.childNodes,l=a.length,c=o._blockCursorElement;s===l&&(i=!0,s=l-1);let u=a[s],d=!1;if(u===c)u=a[s+1],d=!0;else if(c!==null){let f=c.parentNode;n===f&&e>Array.prototype.indexOf.call(f.children,c)&&s--}if(r=Nn(u),I(r))s=Ue(r,i?"next":"previous");else{let f=Nn(n);if(f===null)return null;if(M(f)){let h=o.getElementByKey(f.getKey());h===null&&v(214),[f,s]=f.getDOMSlot(h).resolveChildIndex(f,h,n,e),M(f)||v(215),i&&s>=f.getChildrenSize()&&(s=Math.max(0,f.getChildrenSize()-1));let p=f.getChildAtIndex(s);if(M(p)&&(function(m,x,y){let N=m.getParent();return y===null||N===null||!N.canBeEmpty()||N!==y.getNode()})(p,0,t)){let m=i?p.getLastDescendant():p.getFirstDescendant();m===null?f=p:(p=m,f=M(p)?p:p.getParentOrThrow()),s=0}I(p)?(r=p,f=null,s=Ue(p,i?"next":"previous")):p!==f&&i&&!d&&(M(f)||v(216),s=Math.min(f.getChildrenSize(),s+1))}else{let h=f.getIndexWithinParent();s=e===0&&Q(f)&&Nn(n)===f?h:h+1,f=f.getParentOrThrow()}if(M(f))return ze(f.__key,s,"element")}}else r=Nn(n);return I(r)?ze(r.__key,Ue(r,s,"clamp"),"text"):null}function oc(n,e,t){let o=n.offset,r=n.getNode();if(o===0){let s=r.getPreviousSibling(),i=r.getParent();if(e){if((t||!e)&&s===null&&M(i)&&i.isInline()){let a=i.getPreviousSibling();I(a)&&n.set(a.__key,a.getTextContent().length,"text")}}else M(s)&&!t&&s.isInline()?n.set(s.__key,s.getChildrenSize(),"element"):I(s)&&n.set(s.__key,s.getTextContent().length,"text")}else if(o===r.getTextContent().length){let s=r.getNextSibling(),i=r.getParent();if(e&&M(s)&&s.isInline())n.set(s.__key,0,"element");else if((t||e)&&s===null&&M(i)&&i.isInline()&&!i.canInsertTextAfter()){let a=i.getNextSibling();I(a)&&n.set(a.__key,0,"text")}}}function yu(n,e,t){if(n.type==="text"&&e.type==="text"){let o=n.isBefore(e),r=n.is(e);oc(n,o,r),oc(e,!o,r),r&&e.set(n.key,n.offset,n.type)}}function Nu(n,e,t,o,r,s){if(n===null||t===null||!Oo(r,n,t))return null;let i=nc(n,e,L(s)?s.anchor:null,r);if(i===null)return null;let a=nc(t,o,L(s)?s.focus:null,r);if(a===null)return null;if(i.type==="element"&&a.type==="element"){let l=Nn(n),c=Nn(t);if(Q(l)&&Q(c))return null}return yu(i,a),[i,a]}function Yp(n){return M(n)&&!n.isInline()}function Cu(n,e,t,o,r,s){let i=yt(),a=new tn(ze(n,e,r),ze(t,o,s),0,"");return a.dirty=!0,i._selection=a,a}function Su(){let n=ze("root",0,"element"),e=ze("root",0,"element");return new tn(n,e,0,"")}function Yi(){return new Sr(new Set)}function Gp(n,e){return $r(null,n,e,null)}function $r(n,e,t,o){let r=t._window;if(r===null)return null;let s=o||r.event,i=s?s.type:void 0,a=i==="selectionchange",l=!Zs&&(a||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&s&&s.detail===3||i==="drop"||i===void 0),c,u,d,f;if(L(n)&&!l)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,(a||i===void 0)&&L(n)&&!Oo(t,c,u))return n.clone();let h=Nu(c,d,u,f,t,n);if(h===null)return null;let[g,p]=h,m=0,x="";if(L(n)){let y=n.anchor;if(g.key===y.key)m=n.format,x=n.style;else{let N=g.getNode();I(N)?(m=N.getFormat(),x=N.getStyle()):M(N)&&(m=N.getTextFormat(),x=N.getTextStyle())}}return new tn(g,p,m,x)}function G(){return yt()._selection}function rn(){return X()._editorState._selection}function Tr(n,e,t,o=1){let r=n.anchor,s=n.focus,i=r.getNode(),a=s.getNode();if(!e.is(i)&&!e.is(a))return;let l=e.__key;if(n.isCollapsed()){let c=r.offset;if(t<=c&&o>0||t<c&&o<0){let u=Math.max(0,c+o);r.set(l,u,"element"),s.set(l,u,"element"),rc(n)}}else{let c=n.isBackward(),u=c?s:r,d=u.getNode(),f=c?r:s,h=f.getNode();if(e.is(d)){let g=u.offset;(t<=g&&o>0||t<g&&o<0)&&u.set(l,Math.max(0,g+o),"element")}if(e.is(h)){let g=f.offset;(t<=g&&o>0||t<g&&o<0)&&f.set(l,Math.max(0,g+o),"element")}}rc(n)}function rc(n){let e=n.anchor,t=e.offset,o=n.focus,r=o.offset,s=e.getNode(),i=o.getNode();if(n.isCollapsed()){if(!M(s))return;let a=s.getChildrenSize(),l=t>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(t);if(I(c)){let u=0;l&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),o.set(c.__key,u,"text")}return}if(M(s)){let a=s.getChildrenSize(),l=t>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(t);if(I(c)){let u=0;l&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(M(i)){let a=i.getChildrenSize(),l=r>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(r);if(I(c)){let u=0;l&&(u=c.getTextContentSize()),o.set(c.__key,u,"text")}}}function Er(n,e,t,o,r){let s=null,i=0,a=null;o!==null?(s=o.__key,I(o)?(i=o.getTextContentSize(),a="text"):M(o)&&(i=o.getChildrenSize(),a="element")):r!==null&&(s=r.__key,I(r)?a="text":M(r)&&(a="element")),s!==null&&a!==null?n.set(s,i,a):(i=e.getIndexWithinParent(),i===-1&&(i=t.getChildrenSize()),n.set(t.__key,i,"element"))}function sc(n,e,t,o,r){n.type==="text"?n.set(t,n.offset+(e?0:r),"text"):n.offset>o.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function Tu(n,e,t,o,r){try{n.setBaseAndExtent(e,t,o,r)}catch{}}function ic(n,e,t){let o=Dn(n,e.getKey());if(M(e)){let r=e.getDOMSlot(o);return[r.element,t+r.getFirstChildOffset()]}return[o,t]}function jp(n,e,t,o,r,s,i){let a=o.anchorNode,l=o.focusNode,c=o.anchorOffset,u=o.focusOffset,d=document.activeElement;if(r.has(fu)&&d!==s||d!==null&&Xi(d))return;if(!L(e))return void(n!==null&&Oo(t,a,l)&&o.removeAllRanges());let f=e.anchor,h=e.focus,g=f.getNode(),p=h.getNode(),[m,x]=ic(t,g,f.offset),[y,N]=ic(t,p,h.offset),T=e.format,O=e.style,E=e.isCollapsed(),A=m,C=y,S=!1;var k,F,j,Y,H;if(f.type==="text"?(A=nn(m),S=g.getFormat()!==T||g.getStyle()!==O):L(n)&&n.anchor.type==="text"&&(S=!0),h.type==="text"&&(C=nn(y)),A!==null&&C!==null&&(E&&(n===null||S||L(n)&&(n.format!==T||n.style!==O))&&(k=T,F=O,j=x,Y=f.key,H=performance.now(),su=[k,F,j,Y,H]),c!==x||u!==N||a!==A||l!==C||o.type==="Range"&&E||(d!==null&&s.contains(d)||r.has(_i)||s.focus({preventScroll:!0}),f.type==="element"))){if(Tu(o,A,x,C,N),!bt||!e.isCollapsed()||s===null||r.has(_i)||document.activeElement!==null&&s.contains(document.activeElement)||s.focus({preventScroll:!0}),!r.has(gu)&&e.isCollapsed()&&s!==null&&s===document.activeElement){let te=L(e)&&e.anchor.type==="element"?A.childNodes[x]||null:o.rangeCount>0?o.getRangeAt(0):null;if(te!==null){let ae;if(te instanceof Text){let Qe=document.createRange();Qe.selectNode(te),ae=Qe.getBoundingClientRect()}else ae=te.getBoundingClientRect();(function(Qe,mn,ct){let eo=ra(ct),bl=sa(eo);if(eo===null||bl===null)return;let{top:Fs,bottom:Ks}=mn,Qo=0,Zo=0,Ot=ct;for(;Ot!==null;){let Bs=Ot===eo.body;if(Bs)Qo=0,Zo=Ae(Qe).innerHeight;else{let er=Ot.getBoundingClientRect();Qo=er.top,Zo=er.bottom}let to=0;if(Fs<Qo?to=-(Qo-Fs):Ks>Zo&&(to=Ks-Zo),to!==0)if(Bs)bl.scrollBy(0,to);else{let er=Ot.scrollTop;Ot.scrollTop+=to;let Rl=Ot.scrollTop-er;Fs-=Rl,Ks-=Rl}if(Bs)break;Ot=vo(Ot)}})(t,ae,s)}}hi=!0}}function Jp(n){let e=G()||rn();e===null&&(e=ve().selectEnd()),e.insertNodes(n)}function Vp(){let n=G();return n===null?"":n.getTextContent()}function Gs(n){let e=n;n.isCollapsed()||e.removeText();let t=G();L(t)&&(e=t),L(e)||v(161);let o=e.anchor,r=o.getNode(),s=o.offset;for(;!pt(r);){let i=r;if([r,s]=qp(r,s),i.is(r))break}return s}function qp(n,e){let t=n.getParent();if(!t){let r=mt();return ve().append(r),r.select(),[ve(),0]}if(I(n)){let r=n.splitText(e);if(r.length===0)return[t,n.getIndexWithinParent()];let s=e===0?0:1;return[t,r[0].getIndexWithinParent()+s]}if(!M(n)||e===0)return[t,n.getIndexWithinParent()];let o=n.getChildAtIndex(e);if(o){let r=new tn(ze(n.__key,e,"element"),ze(n.__key,e,"element"),0,""),s=n.insertNewAfter(r);s&&s.append(o,...o.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function ac(n,e,t,o,r="decorators-and-blocks"){if(e==="move"&&o==="character"&&!n.isCollapsed()){let[u,d]=t===n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];return d.set(u.key,u.offset,u.type),!0}let s=Lt(n.focus,t?"previous":"next"),i=o==="lineboundary",a=e==="move",l=s,c=r==="decorators-and-blocks";if(!nd(l)){for(let u of l){c=!1;let{origin:d}=u;if(!Q(d)||d.isIsolated()||(l=u,!i||!d.isInline()))break}if(c)for(let u of ua(s).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(We(u))u.origin.isInline()||(l=u);else{if(M(u.origin))continue;Q(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===s)return!1;if(a&&!i&&Q(l.origin)&&l.origin.isKeyboardSelectable()){let u=Yi();return u.add(l.origin.getKey()),Ee(u),!0}return l=Ke(l),a&&$n(n.anchor,l),$n(n.focus,l),c||!i}var de=null,fe=null,Te=!1,js=!1,ur=0,lc={characterData:!0,childList:!0,subtree:!0};function Ln(){return Te||de!==null&&de._readOnly}function ce(){Te&&v(13)}function Eu(){ur>99&&v(14)}function yt(){return de===null&&v(195,Ou()),de}function X(){return fe===null&&v(196,Ou()),fe}function Ou(){let n=0,e=new Set,t=kt.version;if(typeof window<"u")for(let r of document.querySelectorAll("[contenteditable]")){let s=Mo(r);if(Pr(s))n++;else if(s){let i=String(s.constructor.version||"<0.17.1");i===t&&(i+=" (separately built, likely a bundler configuration issue)"),e.add(i)}}let o=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(o+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),o}function Xp(){return fe}function cc(n,e,t){let o=e.__type,r=Vi(n,o),s=t.get(o);s===void 0&&(s=Array.from(r.transforms),t.set(o,s));let i=s.length;for(let a=0;a<i&&(s[a](e),e.isAttached());a++);}function uc(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function Mu(n,e){if(!e)return;let t=n._updateTags,o=e;Array.isArray(e)||(o=[e]);for(let r of o)t.add(r)}function Qp(n){return Gi(n,X()._nodes)}function Gi(n,e){let t=n.type,o=e.get(t);o===void 0&&v(17,t);let r=o.klass;n.type!==r.getType()&&v(18,r.name);let s=r.importJSON(n),i=n.children;if(M(s)&&Array.isArray(i))for(let a=0;a<i.length;a++){let l=Gi(i[a],e);s.append(l)}return s}function dc(n,e,t){let o=de,r=Te,s=fe;de=e,Te=!0,fe=n;try{return t()}finally{de=o,Te=r,fe=s}}function ht(n,e){let t=n._pendingEditorState,o=n._rootElement,r=n._headless||o===null;if(t===null)return;let s=n._editorState,i=s._selection,a=t._selection,l=n._dirtyType!==0,c=de,u=Te,d=fe,f=n._updating,h=n._observer,g=null;if(n._pendingEditorState=null,n._editorState=t,!r&&l&&h!==null){fe=n,de=t,Te=!1,n._updating=!0;try{let E=n._dirtyType,A=n._dirtyElements,C=n._dirtyLeaves;h.disconnect(),g=_p(s,t,n,E,A,C)}catch(E){if(E instanceof Error&&n._onError(E),js)throw E;return bu(n,null,o,t),Rc(n),n._dirtyType=2,js=!0,ht(n,s),void(js=!1)}finally{h.observe(o,lc),n._updating=f,de=c,Te=u,fe=d}}t._readOnly||(t._readOnly=!0);let p=n._dirtyLeaves,m=n._dirtyElements,x=n._normalizedNodes,y=n._updateTags,N=n._deferred;l&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),(function(E,A){let C=E._decorators,S=E._pendingDecorators||C,k=A._nodeMap,F;for(F in S)k.has(F)||(S===C&&(S=Pu(E)),delete S[F])})(n,t);let T=r?null:Ye(Ae(n));if(n._editable&&T!==null&&(l||a===null||a.dirty||!a.is(i))&&o!==null&&!y.has(hu)){fe=n,de=t;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){let E=n._blockCursorElement;E!==null&&Si(E,n,o),jp(i,a,n,T,y,o)}(function(E,A,C){let S=E._blockCursorElement;if(L(C)&&C.isCollapsed()&&C.anchor.type==="element"&&A.contains(document.activeElement)){let k=C.anchor,F=k.getNode(),j=k.offset,Y=!1,H=null;if(j===F.getChildrenSize())Vs(F.getChildAtIndex(j-1))&&(Y=!0);else{let te=F.getChildAtIndex(j);if(te!==null&&Vs(te)){let ae=te.getPreviousSibling();(ae===null||Vs(ae))&&(Y=!0,H=E.getElementByKey(te.__key))}}if(Y){let te=E.getElementByKey(F.__key);return S===null&&(E._blockCursorElement=S=(function(ae){let Qe=ae.theme,mn=document.createElement("div");mn.contentEditable="false",mn.setAttribute("data-lexical-cursor","true");let ct=Qe.blockCursor;if(ct!==void 0){if(typeof ct=="string"){let eo=bo(ct);ct=Qe.blockCursor=eo}ct!==void 0&&mn.classList.add(...ct)}return mn})(E._config)),A.style.caretColor="transparent",void(H===null?te.appendChild(S):te.insertBefore(S,H))}}S!==null&&Si(S,E,A)})(n,o,a)}finally{h!==null&&h.observe(o,lc),fe=d,de=c}}g!==null&&(function(E,A,C,S,k){let F=Array.from(E._listeners.mutation),j=F.length;for(let Y=0;Y<j;Y++){let[H,te]=F[Y];for(let ae of te){let Qe=A.get(ae);Qe!==void 0&&H(Qe,{dirtyLeaves:S,prevEditorState:k,updateTags:C})}}})(n,g,y,p,s),L(a)||a===null||i!==null&&i.is(a)||n.dispatchCommand(ki,void 0);let O=n._pendingDecorators;O!==null&&(n._decorators=O,n._pendingDecorators=null,ao("decorator",n,!0,O)),(function(E,A,C){let S=pc(A),k=pc(C);S!==k&&ao("textcontent",E,!0,k)})(n,e||s,t),ao("update",n,!0,{dirtyElements:m,dirtyLeaves:p,editorState:t,mutatedNodes:g,normalizedNodes:x,prevEditorState:e||s,tags:y}),(function(E,A){if(E._deferred=[],A.length!==0){let C=E._updating;E._updating=!0;try{for(let S=0;S<A.length;S++)A[S]()}finally{E._updating=C}}})(n,N),(function(E){let A=E._updates;if(A.length!==0){let C=A.shift();if(C){let[S,k]=C;Lr(E,S,k)}}})(n)}function ao(n,e,t,...o){let r=e._updating;e._updating=t;try{let s=Array.from(e._listeners[n]);for(let i=0;i<s.length;i++)s[i].apply(null,o)}finally{e._updating=r}}function fc(n,e){let t=n._updates,o=e||!1;for(;t.length!==0;){let r=t.shift();if(r){let[s,i]=r,a=n._pendingEditorState,l;i!==void 0&&(l=i.onUpdate,i.skipTransforms&&(o=!0),i.discrete&&(a===null&&v(191),a._flushSync=!0),l&&n._deferred.push(l),Mu(n,i.tag)),a==null?Lr(n,s,i):s()}}return o}function Lr(n,e,t){let o=n._updateTags,r,s=!1,i=!1;t!==void 0&&(r=t.onUpdate,Mu(n,t.tag),s=t.skipTransforms||!1,i=t.discrete||!1),r&&n._deferred.push(r);let a=n._editorState,l=n._pendingEditorState,c=!1;(l===null||l._readOnly)&&(l=n._pendingEditorState=vu(l||a),c=!0),l._flushSync=i;let u=de,d=Te,f=fe,h=n._updating;de=l,Te=!1,n._updating=!0,fe=n;let g=n._headless||n.getRootElement()===null;Ji(null);try{c&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(y,N){let T=y.getEditorState()._selection,O=Ye(Ae(y));return L(T)||T==null?$r(T,O,y,N):T.clone()})(n,t&&t.event||null));let m=n._compositionKey;e(),s=fc(n,s),(function(y,N){let T=N.getEditorState()._selection,O=y._selection;if(L(O)){let E=O.anchor,A=O.focus,C;if(E.type==="text"&&(C=E.getNode(),C.selectionTransform(T,O)),A.type==="text"){let S=A.getNode();C!==S&&S.selectionTransform(T,O)}}})(l,n),n._dirtyType!==0&&(s?(function(y,N){let T=N._dirtyLeaves,O=y._nodeMap;for(let E of T){let A=O.get(E);I(A)&&A.isAttached()&&A.isSimpleText()&&!A.isUnmergeable()&&Bl(A)}})(l,n):(function(y,N){let T=N._dirtyLeaves,O=N._dirtyElements,E=y._nodeMap,A=vt(),C=new Map,S=T,k=S.size,F=O,j=F.size;for(;k>0||j>0;){if(k>0){N._dirtyLeaves=new Set;for(let Y of S){let H=E.get(Y);I(H)&&H.isAttached()&&H.isSimpleText()&&!H.isUnmergeable()&&Bl(H),H!==void 0&&uc(H,A)&&cc(N,H,C),T.add(Y)}if(S=N._dirtyLeaves,k=S.size,k>0){ur++;continue}}N._dirtyLeaves=new Set,N._dirtyElements=new Map,F.delete("root")&&F.set("root",!0);for(let Y of F){let H=Y[0],te=Y[1];if(O.set(H,te),!te)continue;let ae=E.get(H);ae!==void 0&&uc(ae,A)&&cc(N,ae,C)}S=N._dirtyLeaves,k=S.size,F=N._dirtyElements,j=F.size,ur++}N._dirtyLeaves=T,N._dirtyElements=O})(l,n),fc(n),(function(y,N,T,O){let E=y._nodeMap,A=N._nodeMap,C=[];for(let[S]of O){let k=A.get(S);k!==void 0&&(k.isAttached()||(M(k)&&Ac(k,S,E,A,C,O),E.has(S)||O.delete(S),C.push(S)))}for(let S of C)A.delete(S);for(let S of T){let k=A.get(S);k===void 0||k.isAttached()||(E.has(S)||T.delete(S),A.delete(S))}})(a,l,n._dirtyLeaves,n._dirtyElements)),m!==n._compositionKey&&(l._flushSync=!0);let x=l._selection;if(L(x)){let y=l._nodeMap,N=x.anchor.key,T=x.focus.key;y.get(N)!==void 0&&y.get(T)!==void 0||v(19)}else Eo(x)&&x._nodes.size===0&&(l._selection=null)}catch(m){return m instanceof Error&&n._onError(m),n._pendingEditorState=a,n._dirtyType=2,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void ht(n)}finally{de=u,Te=d,fe=f,n._updating=h,ur=0}n._dirtyType!==0||n._deferred.length>0||(function(m,x){let y=x.getEditorState()._selection,N=m._selection;if(N!==null){if(N.dirty||!N.is(y))return!0}else if(y!==null)return!0;return!1})(l,n)?l._flushSync?(l._flushSync=!1,ht(n)):c&&am(()=>{ht(n)}):(l._flushSync=!1,c&&(o.clear(),n._deferred=[],n._pendingEditorState=null))}function et(n,e,t){fe===n&&t===void 0?e():Lr(n,e,t)}var Ni=class n{element;before;after;constructor(e,t,o){this.element=e,this.before=t||null,this.after=o||null}withBefore(e){return new n(this.element,e,this.after)}withAfter(e){return new n(this.element,this.before,e)}withElement(e){return this.element===e?this:new n(e,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&v(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&v(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&v(224),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{let t=e==="decorator"&&(br||To||Dr);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,o=e.nodeName==="IMG"?e.nextSibling:null;o&&t.removeChild(o),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}let o=this.element,r=this.before,s=document.createElement("br");if(o.insertBefore(s,r),e){let i=document.createElement("img");i.setAttribute("data-lexical-linebreak","true"),i.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",i.alt="",o.insertBefore(i,s),o.__lexicalLineBreak=i}else o.__lexicalLineBreak=s}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,o,r){if(o===this.element){let l=this.getFirstChildOffset();return[e,Math.min(l+e.getChildrenSize(),Math.max(l,r))]}let s=gc(t,o);s.push(r);let i=gc(t,this.element),a=e.getIndexWithinParent();for(let l=0;l<i.length;l++){let c=s[l],u=i[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[e.getParentOrThrow(),a]}};function gc(n,e){let t=[],o=e;for(;o!==n&&o!==null;o=o.parentNode){let r=0;for(let s=o.previousSibling;s!==null;s=s.previousSibling)r++;t.push(r)}return o!==n&&v(225),t.reverse()}var Rt=class extends ke{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){let e=this.getFormat();return op[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=X()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;t!==null;){if(I(t)&&e.push(t),M(t)){let o=t.getAllTextNodes();e.push(...o)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;M(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;M(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),o=t.length;if(e>=o){let s=t[o-1];return M(s)&&s.getLastDescendant()||s||null}let r=t[e];return M(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:re(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&v(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:re(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&v(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),o,r;if(e<t/2){for(o=this.getFirstChild(),r=0;o!==null&&r<=e;){if(r===e)return o;o=o.getNextSibling(),r++}return null}for(o=this.getLastChild(),r=t-1;o!==null&&r>=e;){if(r===e)return o;o=o.getPreviousSibling(),r--}return null}getTextContent(){let e="",t=this.getChildren(),o=t.length;for(let r=0;r<o;r++){let s=t[r];e+=s.getTextContent(),M(s)&&r!==o-1&&!s.isInline()&&(e+=Rr)}return e}getTextContentSize(){let e=0,t=this.getChildren(),o=t.length;for(let r=0;r<o;r++){let s=t[r];e+=s.getTextContentSize(),M(s)&&r!==o-1&&!s.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){let t=Qs[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=xe[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Co(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){ce();let o=G(),r=e,s=t,i=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let l=this.getFirstChild();if(I(l)||M(l))return l.select(0,0)}else if(!(e!==void 0&&e!==i||t!==void 0&&t!==i)){let l=this.getLastChild();if(I(l)||M(l))return l.select()}}r===void 0&&(r=i),s===void 0&&(s=i);let a=this.__key;return L(o)?(o.anchor.set(a,r,"element"),o.focus.set(a,s,"element"),o.dirty=!0,o):Cu(a,r,a,s,"element","element")}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Qs[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,o){Cr(this)&&v(324,this.__key,this.__type);let r=this.getChildrenSize(),s=this.getWritable();e+t<=r||v(226,String(e),String(t),String(r));let i=s.__key,a=[],l=[],c=this.getChildAtIndex(e+t),u=null,d=r-t+o.length;if(e!==0)if(e===r)u=this.getLastChild();else{let h=this.getChildAtIndex(e);h!==null&&(u=h.getPreviousSibling())}if(t>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<t;g++){h===null&&v(100);let p=h.getNextSibling(),m=h.__key;Dt(h.getWritable()),l.push(m),h=p}}let f=u;for(let h of o){f!==null&&h.is(f)&&(u=f=f.getPreviousSibling());let g=h.getWritable();g.__parent===i&&d--,Dt(g);let p=h.__key;if(f===null)s.__first=p,g.__prev=null;else{let m=f.getWritable();m.__next=p,g.__prev=m.__key}h.__key===i&&v(76),g.__parent=i,a.push(p),f=h}if(e+t===r)f!==null&&(f.getWritable().__next=null,s.__last=f.__key);else if(c!==null){let h=c.getWritable();if(f!==null){let g=f.getWritable();h.__prev=f.__key,g.__next=c.__key}else h.__prev=null}if(s.__size=d,l.length){let h=G();if(L(h)){let g=new Set(l),p=new Set(a),{anchor:m,focus:x}=h;hc(m,g,p)&&Er(m,m.getNode(),this,u,c),hc(x,g,p)&&Er(x,x.getNode(),this,u,c),d!==0||this.canBeEmpty()||Ie(this)||this.remove()}}return s}getDOMSlot(e){return new Ni(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(Ne(t)){let o=this.getIndent();o>0&&(t.style.paddingInlineStart=40*o+"px");let r=this.getDirection();r&&(t.dir=r)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),o=this.getTextStyle();return t===0&&o===""||Ie(this)||this.getChildren().some(I)||(t!==0&&(e.textFormat=t),o!==""&&(e.textStyle=o)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,o){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let o=this.getDOMSlot(e),r=o.getFirstChild();for(let s=this.getFirstChild();s;s=s.getNextSibling()){let i=t.getElementByKey(s.getKey());i!==null&&(r==null?(o.insertChild(i),r=i):r!==i&&o.replaceChild(i,r),r=r.nextSibling)}}};function M(n){return n instanceof Rt}function hc(n,e,t){let o=n.getNode();for(;o;){let r=o.__key;if(e.has(r)&&!t.has(r))return!0;o=o.getParent()}return!1}var yo=class extends ke{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Q(n){return n instanceof yo}var vn=class n extends Rt{__cachedText;static getType(){return"root"}static clone(){return new n}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){v(51)}getTextContent(){let e=this.__cachedText;return!Ln()&&X()._dirtyType!==0||e===null?super.getTextContent():e}remove(){v(52)}replace(e){v(53)}insertBefore(e){v(54)}insertAfter(e){v(55)}updateDOM(e,t){return!1}splice(e,t,o){for(let r of o)M(r)||Q(r)||v(282);return super.splice(e,t,o)}static importJSON(e){return ve().updateFromJSON(e)}collapseAtStart(){return!0}};function pe(n){return n instanceof vn}function vu(n){return new No(new Map(n._nodeMap))}function ji(){return new No(new Map([["root",new vn]]))}function Au(n){let e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&v(130,t.name),M(n)){let o=e.children;Array.isArray(o)||v(59,t.name);let r=n.getChildren();for(let s=0;s<r.length;s++){let i=Au(r[s]);o.push(i)}}return e}function Zp(n){return n instanceof No}var No=class n{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return dc(t&&t.editor||null,this,e)}clone(e){let t=new n(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return dc(null,this,()=>({root:Au(ve())}))}},Or=class extends Rt{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}},An=class n extends Rt{static getType(){return"paragraph"}static clone(e){return new n(e.__key)}createDOM(e){let t=document.createElement("p"),o=Tn(e.theme,"paragraph");return o!==void 0&&t.classList.add(...o),t}updateDOM(e,t,o){return!1}static importDOM(){return{p:e=>({conversion:em,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Ne(t)){this.isEmpty()&&t.append(document.createElement("br"));let o=this.getFormatType();o&&(t.style.textAlign=o)}return{element:t}}static importJSON(e){return mt().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(I);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let o=mt();o.setTextFormat(e.format),o.setTextStyle(e.style);let r=this.getDirection();return o.setDirection(r),o.setFormat(this.getFormatType()),o.setStyle(this.getStyle()),this.insertAfter(o,t),o}collapseAtStart(){let e=this.getChildren();if(e.length===0||I(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function em(n){let e=mt();if(n.style&&(e.setFormat(n.style.textAlign),qu(n,e)),e.getFormatType()===""){let t=n.getAttribute("align");t&&t&&t in Qs&&e.setFormat(t)}return{node:e}}function mt(){return Ao(new An)}function Du(n){return n instanceof An}var yn=0,tm=1,nm=2,om=3,rm=4;function bu(n,e,t,o){let r=n._keyToDOMMap;r.clear(),n._editorState=ji(),n._pendingEditorState=o,n._compositionKey=null,n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;let s=n._observer;s!==null&&(s.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",r.set("root",t))}function Ru(n){let e=new Set,t=new Set,o=n;for(;o;){let{ownNodeConfig:r}=Do(o),s=o.transform;if(!t.has(s)){t.add(s);let i=o.transform();i&&e.add(i)}if(r){let i=r.$transform;i&&e.add(i),o=r.extends}else{let i=Object.getPrototypeOf(o);o=i.prototype instanceof ke&&i!==ke?i:void 0}}return e}function sm(n){let e=n||{},t=Xp(),o=e.theme||{},r=n===void 0?t:e.parentEditor||null,s=e.disableEvents||!1,i=ji(),a=e.namespace||(r!==null?r._config.namespace:Ku()),l=e.editorState,c=[vn,en,En,Mn,An,Or,...e.nodes||[]],{onError:u,html:d}=e,f=e.editable===void 0||e.editable,h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],x=null,y=null;if(typeof m!="function"){let O=m;m=O.replace,x=O.with,y=O.withKlass||null}Do(m);let N=m.getType(),T=Ru(m);h.set(N,{exportDOM:d&&d.export?d.export.get(m):void 0,klass:m,replace:x,replaceWithKlass:y,sharedNodeState:kc(c[p]),transforms:T})}}let g=new kt(i,r,h,{disableEvents:s,namespace:a,theme:o},u||console.error,(function(p,m){let x=new Map,y=new Set,N=T=>{Object.keys(T).forEach(O=>{let E=x.get(O);E===void 0&&(E=[],x.set(O,E)),E.push(T[O])})};return p.forEach(T=>{let O=T.klass.importDOM;if(O==null||y.has(O))return;y.add(O);let E=O.call(T.klass);E!==null&&N(E)}),m&&N(m),x})(h,d?d.import:void 0),f,n);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(p){p.registerCommand(Ii,vp,yn),p.registerCommand($i,Ap,yn),p.registerCommand(Li,Dp,yn),p.registerCommand(Pi,bp,yn),p.registerCommand(Bi,Rp,yn)})(g),g}var kt=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,o,r,s,i,a,l){this._createEditorArgs=l,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new 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=o,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=Ku(),this._onError=s,this._htmlConversions=i,this._editable=a,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){let t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){let t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){let t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){let t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){let t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,o){o===void 0&&v(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let s=r.get(e);s===void 0&&v(36,String(e));let i=s[o];return i.add(t),()=>{i.delete(t),s.every(a=>a.size===0)&&r.delete(e)}}registerMutationListener(e,t,o){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,s=this._listeners.mutation,i=s.get(t);i===void 0&&(i=new Set,s.set(t,i)),i.add(r);let a=o&&o.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(t,r),()=>{i.delete(r),i.size===0&&s.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&v(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let o=this._editorState,r=Ei(o).get(t.getType());if(!r)return;let s=new Map;for(let i of r.keys())s.set(i,"created");s.size>0&&e(s,{dirtyLeaves:new Set,prevEditorState:o,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){let o=this.getRegisteredNode(e);return o.transforms.add(t),o}registerNodeTransform(e,t){let o=this.registerNodeTransformToKlass(e,t),r=[o],s=o.replaceWithKlass;if(s!=null){let i=this.registerNodeTransformToKlass(s,t);r.push(i)}return(function(i,a){let l=Ei(i.getEditorState()),c=[];for(let u of a){let d=l.get(u);d&&c.push(d)}c.length!==0&&i.update(()=>{for(let u of c)for(let d of u.keys()){let f=re(d);f&&f.markDirty()}},i._pendingEditorState===null?{tag:cr}:void 0)})(this,r.map(i=>i.klass.getType())),()=>{r.forEach(i=>i.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return b(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let o=Tn(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,bu(this,t,e,r),t!==null&&(this._config.disableEvents||kp(t),o!=null&&t.classList.remove(...o)),e!==null){let s=sa(e),i=e.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=s,this._dirtyType=2,Rc(this),this._updateTags.add(cr),ht(this),this._config.disableEvents||(function(a,l){let c=a.ownerDocument;gi.set(a,c);let u=yr.get(c)??0;u<1&&c.addEventListener("selectionchange",uu),yr.set(c,u+1),a.__lexicalEditor=l;let d=cu(a);for(let f=0;f<fi.length;f++){let[h,g]=fi[f],p=typeof g=="function"?m=>{jl(m)||(Gl(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(jl(m))return;Gl(m);let x=l.isEditable();switch(h){case"cut":return x&&b(l,Ui,m);case"copy":return b(l,Wi,m);case"paste":return x&&b(l,wi,m);case"dragstart":return x&&b(l,Xc,m);case"dragover":return x&&b(l,Qc,m);case"dragend":return x&&b(l,Zc,m);case"focus":return x&&b(l,eu,m);case"blur":return x&&b(l,tu,m);case"drop":return x&&b(l,qc,m)}};a.addEventListener(h,p),d.push(()=>{a.removeEventListener(h,p)})}})(e,this),o!=null&&e.classList.add(...o)}else this._window=null,this._updateTags.add(cr),ht(this);ao("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&v(38);let o=e;o._readOnly&&(o=vu(e),o._selection=e._selection?e._selection.clone():null),bc(this);let r=this._pendingEditorState,s=this._updateTags,i=t!==void 0?t.tag:null;r===null||r.isEmpty()||(i!=null&&s.add(i),ht(this)),this._pendingEditorState=o,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&s.add(i),this._updating||ht(this)}parseEditorState(e,t){return(function(o,r,s){let i=ji(),a=de,l=Te,c=fe,u=r._dirtyElements,d=r._dirtyLeaves,f=r._cloneNotNeeded,h=r._dirtyType;r._dirtyElements=new Map,r._dirtyLeaves=new Set,r._cloneNotNeeded=new Set,r._dirtyType=0,de=i,Te=!1,fe=r,Ji(null);try{let g=r._nodes;Gi(o.root,g),s&&s(),i._readOnly=!0}catch(g){g instanceof Error&&r._onError(g)}finally{r._dirtyElements=u,r._dirtyLeaves=d,r._cloneNotNeeded=f,r._dirtyType=h,de=a,Te=l,fe=c}return i})(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return ht(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(o,r,s){o._updating?o._updates.push([r,s]):Lr(o,r,s)})(this,e,t)}focus(e,t={}){let o=this._rootElement;o!==null&&(o.setAttribute("autocapitalize","off"),et(this,()=>{let r=G(),s=ve();r!==null?r.dirty||Ee(r.clone()):s.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?s.selectStart():s.selectEnd()),Kr("focus"),Hu(()=>{o.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&o.removeAttribute("autocapitalize"))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Ye(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,ao("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};kt.version="0.41.0+prod.esm";var Ci=null;function Ji(n){Ci=n}var ku=1;function im(){ku=1}function Vi(n,e){let t=qi(n,e);return t===void 0&&v(30,e),t}function qi(n,e){return n._nodes.get(e)}var am=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Iu(n){return Q(Fr(n))}function Xi(n){let e=document.activeElement;if(!Ne(e))return!1;let t=e.nodeName;return Q(Fr(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Mo(e)==null)}function Oo(n,e,t){let o=n.getRootElement();try{return o!==null&&o.contains(e)&&o.contains(t)&&e!==null&&!Xi(e)&&Qi(e)===n}catch{return!1}}function Pr(n){return n instanceof kt}function Qi(n){let e=n;for(;e!=null;){let t=Mo(e);if(Pr(t))return t;e=vo(e)}return null}function Mo(n){return n?n.__lexicalEditor:null}function lm(n){return ep.test(n)?"rtl":tp.test(n)?"ltr":null}function At(n){return Hi(n)||n.isToken()}function gt(n){return At(n)||n.isSegmented()}function tt(n){return Pn(n)&&n.nodeType===3}function $u(n){return Pn(n)&&n.nodeType===9}function nn(n){let e=n;for(;e!=null;){if(tt(e))return e;e=e.firstChild}return null}function Co(n,e,t){let o=xe[e];if(t!==null&&(n&o)===(t&o))return n;let r=n^o;return e==="subscript"?r&=~xe.superscript:e==="superscript"?r&=~xe.subscript:e==="lowercase"?(r&=~xe.uppercase,r&=~xe.capitalize):e==="uppercase"?(r&=~xe.lowercase,r&=~xe.capitalize):e==="capitalize"&&(r&=~xe.lowercase,r&=~xe.uppercase),r}function cm(n){return I(n)||Xt(n)||Q(n)}function Lu(n,e){let t=(function(){let i=Ci;return Ci=null,i})();if((e=e||t&&t.__key)!=null)return void(n.__key=e);ce(),Eu();let o=X(),r=yt(),s=""+ku++;r._nodeMap.set(s,n),M(n)?o._dirtyElements.set(s,!0):o._dirtyLeaves.add(s),o._cloneNotNeeded.add(s),o._dirtyType=1,n.__key=s}function Dt(n){let e=n.getParent();if(e!==null){let t=n.getWritable(),o=e.getWritable(),r=n.getPreviousSibling(),s=n.getNextSibling(),i=s!==null?s.__key:null,a=r!==null?r.__key:null,l=r!==null?r.getWritable():null,c=s!==null?s.getWritable():null;r===null&&(o.__first=i),s===null&&(o.__last=a),l!==null&&(l.__next=i),c!==null&&(c.__prev=a),t.__prev=null,t.__next=null,t.__parent=null,o.__size--}}function Mr(n){Eu(),Cr(n)&&v(323,n.__key,n.__type);let e=n.getLatest(),t=e.__parent,o=yt(),r=X(),s=o._nodeMap,i=r._dirtyElements;t!==null&&(function(l,c,u){let d=l;for(;d!==null;){if(u.has(d))return;let f=c.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}})(t,s,i);let a=e.__key;r._dirtyType=1,M(n)?i.set(a,!0):r._dirtyLeaves.add(a)}function ue(n){ce();let e=X(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){let o=re(t);o!==null&&o.getWritable()}if(n!==null){let o=re(n);o!==null&&o.getWritable()}}}function vt(){return Ln()?null:X()._compositionKey}function re(n,e){let t=(e||yt())._nodeMap.get(n);return t===void 0?null:t}function Zi(n,e){let t=wr(n,X());return t!==void 0?re(t,e):null}function wr(n,e){return n[`__lexicalKey_${e._key}`]}function Fr(n,e){let t=n;for(;t!=null;){let o=Zi(t,e);if(o!==null)return o;t=vo(t)}return null}function Pu(n){let e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function pc(n){return n.read(()=>ve().getTextContent())}function ve(){return wu(yt())}function wu(n){return n._nodeMap.get("root")}function Ee(n){ce();let e=yt();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function Nn(n){let e=X(),t=(function(o,r){let s=o;for(;s!=null;){let i=wr(s,r);if(i!==void 0)return i;s=vo(s)}return null})(n,e);return t===null?n===e.getRootElement()?re("root"):null:re(t)}function Fu(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function ea(n){let e=[],t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Ku(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Bu(n){return tt(n)?n.nodeValue:null}function ta(n,e,t){let o=Ye(Ae(e));if(o===null)return;let r=o.anchorNode,{anchorOffset:s,focusOffset:i}=o;if(r!==null){let a=Bu(r),l=Fr(r);if(a!==null&&I(l)){if((a===fo||a===Di)&&t){let c=t.length;a=t,s=c,i=c}a!==null&&na(l,a,s,i,n)}}}function na(n,e,t,o,r){let s=n;if(s.isAttached()&&(r||!s.isDirty())){let i=s.isComposing(),a=e;if((i||r)&&(e.endsWith(fo)&&(a=e.slice(0,-fo.length)),r)){let c=Di,u;for(;(u=a.indexOf(c))!==-1;)a=a.slice(0,u)+a.slice(u+c.length),t!==null&&t>u&&(t=Math.max(u,t-c.length)),o!==null&&o>u&&(o=Math.max(u,o-c.length))}let l=s.getTextContent();if(r||a!==l){if(a===""){if(ue(null),Dr||To||br)s.remove();else{let p=X();setTimeout(()=>{p.update(()=>{s.isAttached()&&s.remove()})},20)}return}let c=s.getParent(),u=rn(),d=s.getTextContentSize(),f=vt(),h=s.getKey();if(s.isToken()||f!==null&&h===f&&!i||L(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!s.canInsertTextBefore()&&!i||u.focus.key===n.__key&&u.focus.offset===d&&!s.canInsertTextAfter()&&!i))return void s.markDirty();let g=G();if(!L(g)||t===null||o===null)return void mc(s,a,g);if(g.setTextNodeRange(s,t,s,o),s.isSegmented()){let p=le(s.getTextContent());s.replace(p),s=p}mc(s,a,g)}}}function mc(n,e,t){if(n.setTextContent(e),L(t)){let o=n.getKey();for(let r of["anchor","focus"]){let s=t[r];s.type==="text"&&s.key===o&&(s.offset=Ue(n,s.offset,"clamp"))}}}function or(n,e,t){let o=e[t]||!1;return o==="any"||o===n[t]}function Wu(n,e){return or(n,e,"altKey")&&or(n,e,"ctrlKey")&&or(n,e,"shiftKey")&&or(n,e,"metaKey")}function J(n,e,t){if(!Wu(n,t))return!1;if(n.key.toLowerCase()===e.toLowerCase())return!0;if(e.length>1||n.key.length===1&&n.key.charCodeAt(0)<=127)return!1;let o="Key"+e.toUpperCase();return n.code===o}var ft={ctrlKey:!Fe,metaKey:Fe},_c={altKey:Fe,ctrlKey:!Fe};function xc(n){return n.key==="Backspace"}function yc(n){return J(n,"a",ft)}function um(n){let e=ve();if(L(n)){let t=n.anchor,o=n.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,"element"),o.set(r.getKey(),r.getChildrenSize(),"element"),gr(n),n}{let t=e.select(0,e.getChildrenSize());return Ee(gr(t)),t}}function Tn(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});let t=n.__lexicalClassNameCache,o=t[e];if(o!==void 0)return o;let r=n[e];if(typeof r=="string"){let s=bo(r);return t[e]=s,s}return r}function oa(n,e,t,o,r){if(t.size===0)return;let s=o.__type,i=o.__key,a=e.get(s);a===void 0&&v(33,s);let l=a.klass,c=n.get(l);c===void 0&&(c=new Map,n.set(l,c));let u=c.get(i),d=u==="destroyed"&&r==="created";(u===void 0||d)&&c.set(i,d?"updated":r)}function dm(n){let e=n.getType(),t=yt();if(t._readOnly){let s=Ei(t).get(e);return s?Array.from(s.values()):[]}let o=t._nodeMap,r=[];for(let[,s]of o)s instanceof n&&s.__type===e&&s.isAttached()&&r.push(s);return r}function Nc(n,e,t){let o=n.getParent(),r=t,s=n;return o!==null&&(e&&t===0?(r=s.getIndexWithinParent(),s=o):e||t!==s.getChildrenSize()||(r=s.getIndexWithinParent()+1,s=o)),s.getChildAtIndex(e?r-1:r)}function Uu(n,e){let t=n.offset;if(n.type==="element")return Nc(n.getNode(),e,t);{let o=n.getNode();if(e&&t===0||!e&&t===o.getTextContentSize()){let r=e?o.getPreviousSibling():o.getNextSibling();return r===null?Nc(o.getParentOrThrow(),e,o.getIndexWithinParent()+(e?0:1)):r}}return null}function zu(n){let e=Ae(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function b(n,e,t){return(function(o,r,s){let i=ea(o);for(let a=4;a>=0;a--)for(let l=0;l<i.length;l++){let c=i[l],u=c._commands.get(r);if(u!==void 0){let d=u[a];if(d!==void 0){let f=Array.from(d),h=f.length,g=!1;if(et(c,()=>{for(let p=0;p<h;p++)if(f[p](s,o))return void(g=!0)}),g)return g}}}return!1})(n,e,t)}function Dn(n,e){let t=n._keyToDOMMap.get(e);return t===void 0&&v(75,e),t}function vo(n){let e=n.assignedSlot||n.parentElement;return Ju(e)?e.host:e}function ra(n){return $u(n)?n:Ne(n)?n.ownerDocument:null}function fm(n){return X()._updateTags.has(n)}function Kr(n){ce(),X()._updateTags.add(n)}function Hu(n){ce(),X()._deferred.push(n)}function vr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function sa(n){let e=ra(n);return e?e.defaultView:null}function Ae(n){let e=n._window;return e===null&&v(78),e}function gm(n){return M(n)&&n.isInline()||Q(n)&&n.isInline()}function Yu(n){let e=n.getParentOrThrow();for(;e!==null;){if(Ie(e))return e;e=e.getParentOrThrow()}return e}function Ie(n){return pe(n)||M(n)&&n.isShadowRoot()}function ia(n){let e=n.constructor.clone(n);return Lu(e,null),e.afterCloneFrom(n),e}function Ao(n){let e=X(),t=n.getType(),o=qi(e,t);o===void 0&&v(200,n.constructor.name,t);let{replace:r,replaceWithKlass:s}=o;if(r!==null){let i=r(n),a=i.constructor;return s!==null?i instanceof s||v(201,s.name,s.getType(),a.name,a.getType(),n.constructor.name,t):i instanceof n.constructor&&a!==n.constructor||v(202,a.name,a.getType(),n.constructor.name,t),i.__key===n.__key&&v(203,n.constructor.name,t,a.name,a.getType()),i}return n}function Js(n,e){!pe(n.getParent())||M(e)||Q(e)||v(99)}function Gu(n){let e=re(n);return e===null&&v(63,n),e}function Vs(n){return(Q(n)||M(n)&&!n.canBeEmpty())&&!n.isInline()}function Si(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;let o=n.parentElement;o!==null&&o.removeChild(n)}function Ye(n){return He?(n||window).getSelection():null}function ju(n){let e=sa(n);return e?e.getSelection():null}function hm(n,e){let t=n.getChildAtIndex(e);t==null&&(t=n),Ie(n)&&v(102);let o=i=>{let a=i.getParentOrThrow(),l=Ie(a),c=i!==t||l?ia(i):i;if(l)return M(i)&&M(c)||v(133),i.insertAfter(c),[i,c,c];{let[u,d,f]=o(a),h=i.getNextSiblings();return f.append(c,...h),[u,d,c]}},[r,s]=o(t);return[r,s]}function pm(n){return Ne(n)&&n.tagName==="A"}function Ne(n){return Pn(n)&&n.nodeType===1}function Pn(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function Ju(n){return Pn(n)&&n.nodeType===11}function Vu(n){let e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Ti(n){let e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function pt(n){if(Q(n)&&!n.isInline())return!0;if(!M(n)||Ie(n))return!1;let e=n.getFirstChild(),t=e===null||Xt(e)||I(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function aa(){return X()}var Cc=new WeakMap,mm=new Map;function Ei(n){if(!n._readOnly&&n.isEmpty())return mm;n._readOnly||v(192);let e=Cc.get(n);return e||(e=(function(t){let o=new Map;for(let[r,s]of t._nodeMap){let i=s.__type,a=o.get(i);a||(a=new Map,o.set(i,a)),a.set(r,s)}return o})(n),Cc.set(n,e)),e}function la(n){let e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function _m(n){return(e=la(n))[du]=!0,e;var e}function qu(n,e){let t=parseInt(n.style.paddingInlineStart,10)||0,o=Math.round(t/40);e.setIndent(o)}function xm(n){n.__lexicalUnmanaged=!0}function Xu(n){return n.__lexicalUnmanaged===!0}function oo(n,e){return(function(t,o){return Object.prototype.hasOwnProperty.call(t,o)})(n,e)&&n[e]!==ke[e]}function Do(n){let e=Il in n.prototype?n.prototype[Il]():void 0,t=(function(i){if(!(i===ke||i.prototype instanceof ke)){let a="<unknown>",l="<unknown>";try{a=i.getType()}catch{}try{kt.version&&(l=JSON.parse(kt.version))}catch{}v(290,i.name,a,l)}return i===yo||i===Rt||i===ke})(n),o=!t&&oo(n,"getType")?n.getType():void 0,r,s=o;if(e)if(o)r=e[o];else for(let[i,a]of Object.entries(e))s=i,r=a;if(!t&&s&&(oo(n,"getType")||(n.getType=()=>s),oo(n,"clone")||(n.clone=i=>(Ji(i),new n)),oo(n,"importJSON")||(n.importJSON=r&&r.$importJSON||(i=>new n().updateFromJSON(i))),!oo(n,"importDOM")&&r)){let{importDOM:i}=r;i&&(n.importDOM=()=>i)}return{ownNodeConfig:r,ownNodeType:s}}function ym(n){let e=aa();return ce(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}var lo=(n,e)=>{let t=n;for(;t!=null&&!pe(t);){if(e(t))return t;t=t.getParent()}return null},Nm={next:"previous",previous:"next"},bn=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return da({hasNext:on,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return ge(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return ge(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let o=this.getNodeAtCaret();return e.is(this.origin)||e.is(o)||(o===null?this.insert(e):o.replace(e,t)),this}splice(e,t,o="next"){let r=o===this.direction?t:Array.from(t).reverse(),s=this,i=this.getParentAtCaret(),a=new Map;for(let l=s.getAdjacentCaret();l!==null&&a.size<e;l=l.getAdjacentCaret()){let c=l.origin.getWritable();a.set(c.getKey(),c)}for(let l of r){if(a.size>0){let c=s.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||s.origin.is(l))){let u=l.getParent();u&&u.is(i)&&l.remove(),c.replace(l)}}else c===null&&v(263,Array.from(a).join(" "))}else s.insert(l);s=ge(l,this.direction)}for(let l of a.values())l.remove();return this}},So=class n extends bn{type="child";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:xt(e,this.direction)}getParentCaret(e="root"){return ge(ca(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=wt(this.direction);return ge(this.getNodeAtCaret(),e)||xt(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof n&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},Cm={root:pe,shadowRoot:Ie};function wt(n){return Nm[n]}function ca(n,e="root"){return Cm[e](n)?null:n}var Rn=class n extends bn{type="sibling";getLatest(){let e=this.origin.getLatest();return e===this.origin?this:ge(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return M(this.origin)?xt(this.origin,this.direction):null}getParentCaret(e="root"){return ge(ca(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=wt(this.direction);return ge(this.getNodeAtCaret(),e)||xt(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof n&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof n||e instanceof kn)&&this.direction===e.direction&&this.origin.is(e.origin)}},kn=class n extends bn{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:It(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return ge(ca(this.getParentAtCaret(),e),this.direction)}getFlipped(){return It(this.origin,wt(this.direction),this.offset)}isSamePointCaret(e){return e instanceof n&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof Rn||e instanceof n)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return ge(this.origin,this.direction)}};function _t(n){return n instanceof kn}function Sm(n){return n instanceof bn}function on(n){return n instanceof Rn}function We(n){return n instanceof So}var Tm={next:class extends kn{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends kn{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Em={next:class extends Rn{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends Rn{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Om={next:class extends So{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends So{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function ge(n,e){return n?new Em[e](n):null}function It(n,e,t){return n?new Tm[e](n,Ue(n,t)):null}function Ue(n,e,t="error"){let o=n.getTextContentSize(),r=e==="next"?o:e==="previous"?0:e;return(r<0||r>o)&&(t!=="clamp"&&Ec(284,String(e),String(o),n.getKey()),r=r<0?0:o),r}function Oi(n,e){return new Ar(n,e)}function xt(n,e){return M(n)?new Om[e](n):null}function Qu(n){return n&&n.getChildCaret()||n}function In(n){return n&&Qu(n.getAdjacentCaret())}var Mi=class n{type="node-caret-range";direction;anchor;focus;constructor(e,t,o){this.anchor=e,this.focus=t,this.direction=o}getLatest(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new n(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=r=>{let s=this[r].getLatest();return _t(s)?(function(i,a){let{direction:l,origin:c}=i,u=Ue(c,a==="focus"?wt(l):l);return Oi(i,u-i.offset)})(s,r):null},t=e("anchor"),o=e("focus");if(t&&o){let{caret:r}=t,{caret:s}=o;if(r.isSameNodeCaret(s))return[Oi(r,s.offset-r.offset),null]}return[t,o]}iterNodeCarets(e="root"){let t=_t(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),o=this.focus.getLatest(),r=_t(o),s=i=>i.isSameNodeCaret(o)?null:In(i)||i.getParentCaret(e);return da({hasNext:i=>i!==null&&!(r&&o.isSameNodeCaret(i)),initial:t.isSameNodeCaret(o)?null:s(t),map:i=>i,step:s})}[Symbol.iterator](){return this.iterNodeCarets("root")}},Ar=class{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,o=t+e;return o<t?[o,t]:[t,o]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[o,r]=this.getSliceIndices(),s=e.getTextContent();return It(e.setTextContent(s.slice(0,o)+s.slice(r)),t,o)}};function Mm(n){return n instanceof Ar}function ua(n){return $t(n,ge(ve(),n.direction))}function Zu(n){return $t(n,n)}function $t(n,e){return n.direction!==e.direction&&v(265),new Mi(n,e,n.direction)}function da(n){let{initial:e,hasNext:t,step:o,map:r}=n,s=e;return{[Symbol.iterator](){return this},next(){if(!t(s))return{done:!0,value:void 0};let i={done:!1,value:r(s)};return s=o(s),i}}}function fa(n,e){let t=co(n.origin,e.origin);switch(t===null&&v(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{let o=n.type==="text",r=e.type==="text";return o&&r?(function(s,i){return Math.sign(s-i)})(n.offset,e.offset):n.type===e.type?0:o?-1:r?1:n.type==="child"?-1:1}case"ancestor":return n.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return ga(t)}}function ga(n){let{a:e,b:t}=n,o=e.__key,r=t.__key,s=e,i=t;for(;s&&i;s=s.getNextSibling(),i=i.getNextSibling()){if(s.__key===r)return-1;if(i.__key===o)return 1}return s===null?1:-1}function rr(n,e){return e.is(n)}function Sc(n){return M(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function co(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};let t=new Map;for(let[o,r]=Sc(n);o;r=o,o=o.getParent())t.set(o,r);for(let[o,r]=Sc(e);o;r=o,o=o.getParent()){let s=t.get(o);if(s!==void 0)return s===null?(rr(n,o)||v(276),{commonAncestor:o,type:"ancestor"}):r===null?(rr(e,o)||v(277),{commonAncestor:o,type:"descendant"}):((M(s)||rr(n,s))&&(M(r)||rr(e,r))&&o.is(s.getParent())&&o.is(r.getParent())||v(278),{a:s,b:r,commonAncestor:o,type:"branch"})}return null}function Lt(n,e){let{type:t,key:o,offset:r}=n,s=Gu(n.key);return t==="text"?(I(s)||v(266,s.getType(),o),It(s,e,r)):(M(s)||v(267,s.getType(),o),od(s,n.offset,e))}function $n(n,e){let{origin:t,direction:o}=e,r=o==="next";_t(e)?n.set(t.getKey(),e.offset,"text"):on(e)?I(t)?n.set(t.getKey(),Ue(t,o),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(r?1:0),"element"):(We(e)&&M(t)||v(268),n.set(t.getKey(),r?0:t.getChildrenSize(),"element"))}function ed(n){let e=G(),t=L(e)?e:Su();return uo(t,n),Ee(t),t}function uo(n,e){$n(n.anchor,e.anchor),$n(n.focus,e.focus)}function vi(n){let{anchor:e,focus:t}=n,o=Lt(e,"next"),r=Lt(t,"next"),s=fa(o,r)<=0?"next":"previous";return $t(Pt(o,s),Pt(r,s))}function wn(n){let{direction:e,origin:t}=n,o=ge(t,wt(e)).getNodeAtCaret();return o?ge(o,e):xt(t.getParentOrThrow(),e)}function Tc(n,e="root"){let t=[n];for(let o=We(n)?n.getParentCaret(e):n.getSiblingCaret();o!==null;o=o.getParentCaret(e))t.push(wn(o));return t}function qs(n){return!!n&&n.origin.isAttached()}function td(n,e="removeEmptySlices"){if(n.isCollapsed())return n;let t="root",o="next",r=e,s=ha(n,o),i=Tc(s.anchor,t),a=Tc(s.focus.getFlipped(),t),l=new Set,c=[];for(let g of s.iterNodeCarets(t))if(We(g))l.add(g.origin.getKey());else if(on(g)){let{origin:p}=g;M(p)&&!l.has(p.getKey())||c.push(p)}for(let g of c)g.remove();for(let g of s.getTextSlices()){if(!g)continue;let{origin:p}=g.caret,m=p.getTextContentSize(),x=wn(ge(p,o)),y=p.getMode();if(Math.abs(g.distance)===m&&r==="removeEmptySlices"||y==="token"&&g.distance!==0)x.remove();else if(g.distance!==0){r="removeEmptySlices";let N=g.removeTextSlice(),T=g.caret.origin;if(y==="segmented"){let O=N.origin,E=le(O.getTextContent()).setStyle(O.getStyle()).setFormat(O.getFormat());x.replaceOrInsert(E),N=It(E,o,N.offset)}T.is(i[0].origin)&&(i[0]=N),T.is(a[0].origin)&&(a[0]=N.getFlipped())}}let u,d;for(let g of i)if(qs(g)){u=Ke(g);break}for(let g of a)if(qs(g)){d=Ke(g);break}let f=(function(g,p,m){if(!g||!p)return null;let x=g.getParentAtCaret(),y=p.getParentAtCaret();if(!x||!y)return null;let N=x.getParents().reverse();N.push(x);let T=y.getParents().reverse();T.push(y);let O=Math.min(N.length,T.length),E;for(E=0;E<O&&N[E]===T[E];E++);let A=(k,F)=>{let j;for(let Y=E;Y<k.length;Y++){let H=k[Y];if(Ie(H))return;!j&&F(H)&&(j=H)}return j},C=A(N,pt),S=C&&A(T,k=>m.has(k.getKey())&&pt(k));return C&&S?[C,S]:null})(u,d,l);if(f){let[g,p]=f;xt(g,"previous").splice(0,p.getChildren());let m=p.getParent();for(p.remove(!0);m&&m.isEmpty();){let x=m;m=m.getParent(),x.remove(!0)}}let h=[u,d,...i,...a].find(qs);if(h)return Zu(Pt(Ke(h),n.direction));v(269,JSON.stringify(i.map(g=>g.origin.__key)))}function Ke(n){let e=(function(r){let s=r;for(;We(s);){let i=In(s);if(!We(i))break;s=i}return s})(n.getLatest()),{direction:t}=e;if(I(e.origin))return _t(e)?e:It(e.origin,t,t);let o=e.getAdjacentCaret();return on(o)&&I(o.origin)?It(o.origin,t,wt(t)):e}function nd(n){return _t(n)&&n.offset!==Ue(n.origin,n.direction)}function Pt(n,e){return n.direction===e?n:n.getFlipped()}function ha(n,e){return n.direction===e?n:$t(Pt(n.focus,e),Pt(n.anchor,e))}function od(n,e,t){let o=xt(n,"next");for(let r=0;r<e;r++){let s=o.getAdjacentCaret();if(s===null)break;o=s}return Pt(o,t)}function vm(n,e="root"){let t=0,o=n,r=In(o);for(;r===null;){if(t--,r=o.getParentCaret(e),!r)return null;o=r,r=In(o)}return r&&[r,t]}function Am(n){let{origin:e,offset:t,direction:o}=n;if(t===Ue(e,o))return n.getSiblingCaret();if(t===Ue(e,wt(o)))return wn(n.getSiblingCaret());let[r]=e.splitText(t);return I(r)||v(281),Pt(ge(r,"next"),o)}function Dm(n,e){return!0}function bm(n,{$copyElementNode:e=ia,$splitTextPointCaretNext:t=Am,rootMode:o="shadowRoot",$shouldSplit:r=Dm}={}){if(_t(n))return t(n);let s=n.getParentCaret(o);if(s){let{origin:i}=s;if(We(n)&&(!i.canBeEmpty()||!r(i,"first")))return wn(s);let a=(function(l){let c=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(n);(a.length>0||i.canBeEmpty()&&r(i,"last"))&&s.insert(e(i).splice(0,0,a))}return s}function Rm(n){return n}function km(...n){return n}function Im(n,e){return[n,e]}function $m(n){return n}function Lm(n,e){if(!e||n===e)return n;for(let t in e)if(n[t]!==e[t])return{...n,...e};return n}function bo(...n){let e=[];for(let t of n)if(t&&typeof t=="string")for(let[o]of t.matchAll(/\S+/g))e.push(o);return e}function Pm(n,...e){let t=bo(...e);t.length>0&&n.classList.add(...t)}function wm(n,...e){let t=bo(...e);t.length>0&&n.classList.remove(...t)}function Fm(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}var _=pa,ma=_.$addUpdateTag,Nt=_.$applyNodeReplacement,Ft=_.$caretFromPoint,rd=_.$caretRangeFromSelection,Br=_.$cloneWithProperties,sd=_.$cloneWithPropertiesEphemeral,ly=_.$comparePointCaretNext,id=_.$copyNode,ad=_.$create,_a=_.$createLineBreakNode,ld=_.$createNodeSelection,se=_.$createParagraphNode,cy=_.$createPoint,Fn=_.$createRangeSelection,uy=_.$createRangeSelectionFromDom,Wr=_.$createTabNode,Kt=_.$createTextNode,cd=_.$extendCaretToRange,Ct=_.$findMatchingParent,xa=_.$getAdjacentChildCaret,ya=_.$getAdjacentNode,sn=_.$getAdjacentSiblingOrParentSiblingCaret,Na=_.$getCaretInDirection,ud=_.$getCaretRange,dy=_.$getCaretRangeInDirection,dd=_.$getCharacterOffsets,De=_.$getChildCaret,fy=_.$getChildCaretAtIndex,Ca=_.$getChildCaretOrSelf,fd=_.$getCollapsedCaretRange,gy=_.$getCommonAncestor,hy=_.$getCommonAncestorResultBranchOrder,Ur=_.$getEditor,nt=_.$getNearestNodeFromDOMNode,py=_.$getNearestRootOrShadowRoot,Kn=_.$getNodeByKey,my=_.$getNodeByKeyOrThrow,gd=_.$getNodeFromDOMNode,Ro=_.$getPreviousSelection,Ce=_.$getRoot,R=_.$getSelection,St=_.$getSiblingCaret,zr=_.$getState,_y=_.$getStateChange,xy=_.$getTextContent,yy=_.$getTextNodeOffset,Ny=_.$getTextPointCaret,Cy=_.$getTextPointCaretSlice,Sy=_.$getWritableNodeState,hd=_.$hasAncestor,Ty=_.$hasUpdateTag,Hr=_.$insertNodes,Bn=_.$isBlockElementNode,ko=_.$isChildCaret,an=_.$isDecoratorNode,pd=_.$isEditorState,$=_.$isElementNode,md=_.$isExtendableTextPointCaret,Ey=_.$isInlineElementOrDecoratorNode,Io=_.$isLeafNode,Sa=_.$isLineBreakNode,Oy=_.$isNodeCaret,he=_.$isNodeSelection,_d=_.$isParagraphNode,D=_.$isRangeSelection,ln=_.$isRootNode,$e=_.$isRootOrShadowRoot,xd=_.$isSiblingCaret,My=_.$isTabNode,B=_.$isTextNode,Yr=_.$isTextPointCaret,vy=_.$isTextPointCaretSlice,Ta=_.$isTokenOrSegmented,Ay=_.$isTokenOrTab,Dy=_.$nodesOfType,cn=_.$normalizeCaret,Bt=_.$normalizeSelection__EXPERIMENTAL,by=_.$onUpdate,yd=_.$parseSerializedNode,Ry=_.$removeTextFromCaretRange,Gr=_.$rewindSiblingCaret,jr=_.$selectAll,ky=_.$setCompositionKey,$o=_.$setPointFromCaret,Ge=_.$setSelection,Nd=_.$setSelectionFromCaretRange,Jr=_.$setState,Cd=_.$splitAtPointCaretNext,Sd=_.$splitNode,Iy=_.$updateRangeSelectionFromCaretRange,Ea=_.ArtificialNode__DO_NOT_USE,$y=_.BEFORE_INPUT_COMMAND,Ly=_.BLUR_COMMAND,Lo=_.CAN_REDO_COMMAND,Po=_.CAN_UNDO_COMMAND,Vr=_.CLEAR_EDITOR_COMMAND,Td=_.CLEAR_HISTORY_COMMAND,qr=_.CLICK_COMMAND,Py=_.COLLABORATION_TAG,Xr=_.COMMAND_PRIORITY_CRITICAL,W=_.COMMAND_PRIORITY_EDITOR,wy=_.COMMAND_PRIORITY_HIGH,ie=_.COMMAND_PRIORITY_LOW,Fy=_.COMMAND_PRIORITY_NORMAL,Ky=_.COMPOSITION_END_COMMAND,Ed=_.COMPOSITION_END_TAG,By=_.COMPOSITION_START_COMMAND,Od=_.COMPOSITION_START_TAG,Md=_.CONTROLLED_TEXT_INSERTION_COMMAND,Qr=_.COPY_COMMAND,vd=_.CUT_COMMAND,Zr=_.DELETE_CHARACTER_COMMAND,Ad=_.DELETE_LINE_COMMAND,Dd=_.DELETE_WORD_COMMAND,Wy=_.DRAGEND_COMMAND,bd=_.DRAGOVER_COMMAND,Rd=_.DRAGSTART_COMMAND,kd=_.DROP_COMMAND,es=_.DecoratorNode,ot=_.ElementNode,Uy=_.FOCUS_COMMAND,Id=_.FORMAT_ELEMENT_COMMAND,Tt=_.FORMAT_TEXT_COMMAND,ts=_.HISTORIC_TAG,ns=_.HISTORY_MERGE_TAG,$d=_.HISTORY_PUSH_TAG,wo=_.INDENT_CONTENT_COMMAND,zy=_.INPUT_COMMAND,Oa=_.INSERT_LINE_BREAK_COMMAND,Fo=_.INSERT_PARAGRAPH_COMMAND,os=_.INSERT_TAB_COMMAND,Ko=_.INTERNAL_$isBlock,Hy=_.IS_ALL_FORMATTING,Yy=_.IS_BOLD,Gy=_.IS_CODE,jy=_.IS_HIGHLIGHT,Jy=_.IS_ITALIC,Vy=_.IS_STRIKETHROUGH,qy=_.IS_SUBSCRIPT,Xy=_.IS_SUPERSCRIPT,Qy=_.IS_UNDERLINE,rs=_.KEY_ARROW_DOWN_COMMAND,ss=_.KEY_ARROW_LEFT_COMMAND,Ld=_.KEY_ARROW_RIGHT_COMMAND,is=_.KEY_ARROW_UP_COMMAND,Pd=_.KEY_BACKSPACE_COMMAND,wd=_.KEY_DELETE_COMMAND,Zy=_.KEY_DOWN_COMMAND,Fd=_.KEY_ENTER_COMMAND,as=_.KEY_ESCAPE_COMMAND,eN=_.KEY_MODIFIER_COMMAND,ls=_.KEY_SPACE_COMMAND,cs=_.KEY_TAB_COMMAND,Kd=_.LineBreakNode,tN=_.MOVE_TO_END,nN=_.MOVE_TO_START,oN=_.NODE_STATE_KEY,Bo=_.OUTDENT_CONTENT_COMMAND,us=_.PASTE_COMMAND,Bd=_.PASTE_TAG,Wd=_.ParagraphNode,Ud=_.REDO_COMMAND,zd=_.REMOVE_TEXT_COMMAND,Hd=_.RootNode,rN=_.SELECTION_CHANGE_COMMAND,Yd=_.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Gd=_.SELECT_ALL_COMMAND,sN=_.SKIP_COLLAB_TAG,jd=_.SKIP_DOM_SELECTION_TAG,iN=_.SKIP_SCROLL_INTO_VIEW_TAG,Jd=_.SKIP_SELECTION_FOCUS_TAG,Vd=_.TEXT_TYPE_TO_FORMAT,qd=_.TabNode,Wn=_.TextNode,Xd=_.UNDO_COMMAND,Wo=_.addClassNamesToElement,Ma=_.buildImportMap,ds=_.configExtension,Le=_.createCommand,fs=_.createEditor,aN=_.createSharedNodeState,Qd=_.createState,Zd=_.declarePeerDependency,Z=_.defineExtension,lN=_.flipDirection,cN=_.getDOMOwnerDocument,va=_.getDOMSelection,uN=_.getDOMSelectionFromTarget,ef=_.getDOMTextNode,dN=_.getEditorPropertyFromDOMNode,gs=_.getNearestEditorFromDOMNode,tf=_.getRegisteredNode,fN=_.getRegisteredNodeOrThrow,gN=_.getStaticNodeConfig,hN=_.getTextDirection,pN=_.getTransformSetFromKlass,nf=_.isBlockDomNode,mN=_.isCurrentlyReadOnlyMode,of=_.isDOMDocumentNode,Un=_.isDOMNode,_N=_.isDOMTextNode,xN=_.isDOMUnmanaged,Aa=_.isDocumentFragment,yN=_.isExactShortcutMatch,rf=_.isHTMLAnchorElement,hs=_.isHTMLElement,Uo=_.isInlineDomNode,NN=_.isLexicalEditor,CN=_.isModifierMatch,sf=_.isSelectionCapturedInDecoratorInput,af=_.isSelectionWithinEditor,Da=_.makeStepwiseIterator,rt=_.mergeRegister,zo=_.normalizeClassNames,ps=_.removeClassNamesFromElement,SN=_.removeFromParent,TN=_.resetRandomKey,ye=_.safeCast,EN=_.setDOMUnmanaged,ba=_.setNodeIndentFromDOM,Wt=_.shallowMergeConfig,Ra=_.toggleTextFormatType;var wa={};we(wa,{$addNodeStyle:()=>Hm,$cloneWithProperties:()=>Br,$copyBlockFormatIndent:()=>mf,$ensureForwardRangeSelection:()=>pf,$forEachSelectedTextNode:()=>hf,$getComputedStyleForElement:()=>$a,$getComputedStyleForParent:()=>La,$getSelectionStyleValueForProperty:()=>Qm,$isAtNodeEnd:()=>zm,$isParentElementRTL:()=>Pa,$isParentRTL:()=>Wm,$moveCaretSelection:()=>yf,$moveCharacter:()=>qm,$patchStyleText:()=>Ym,$selectAll:()=>jr,$setBlocksType:()=>Gm,$shouldOverrideDefaultCharacterSelection:()=>Vm,$sliceSelectedTextNodeContent:()=>Um,$trimTextContentFromAnchor:()=>gf,$wrapNodes:()=>Jm,createDOMRange:()=>Km,createRectsFromDOMRange:()=>Bm,getCSSFromStyleObject:()=>ff,getStyleObjectFromCSS:()=>xs,trimTextContentFromAnchor:()=>Zm});function Ia(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var _s=new Map;function lf(n){let e=n;for(;e!=null;){if(e.nodeType===Node.TEXT_NODE)return e;e=e.firstChild}return null}function cf(n){let e=n.parentNode;if(e==null)throw new Error("Should never happen");return[e,Array.from(e.childNodes).indexOf(n)]}function Km(n,e,t,o,r){let s=e.getKey(),i=o.getKey(),a=document.createRange(),l=n.getElementByKey(s),c=n.getElementByKey(i),u=t,d=r;if(B(e)&&(l=lf(l)),B(o)&&(c=lf(c)),e===void 0||o===void 0||l===null||c===null)return null;l.nodeName==="BR"&&([l,u]=cf(l)),c.nodeName==="BR"&&([c,d]=cf(c));let f=l.firstChild;l===c&&f!=null&&f.nodeName==="BR"&&u===0&&d===0&&(d=1);try{a.setStart(l,u),a.setEnd(c,d)}catch{return null}return!a.collapsed||u===d&&s===i||(a.setStart(c,d),a.setEnd(l,u)),a}function Bm(n,e){let t=n.getRootElement();if(t===null)return[];let o=t.getBoundingClientRect(),r=getComputedStyle(t),s=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),i=Array.from(e.getClientRects()),a,l=i.length;i.sort((c,u)=>{let d=c.top-u.top;return Math.abs(d)<=3?c.left-u.left:d});for(let c=0;c<l;c++){let u=i[c],d=a&&a.top<=u.top&&a.top+a.height>u.top&&a.left+a.width>u.left,f=u.width+s===o.width;d||f?(i.splice(c--,1),l--):a=u}return i}function df(n){let e={};if(!n)return e;let t=n.split(";");for(let o of t)if(o!==""){let[r,s]=o.split(/:([^]+)/);r&&s&&(e[r.trim()]=s.trim())}return e}function xs(n){let e=_s.get(n);return e===void 0&&(e=df(n),_s.set(n,e)),e}function ff(n){let e="";for(let t in n)t&&(e+=`${t}: ${n[t]};`);return e}function $a(n){let e=Ur().getElementByKey(n.getKey());if(e===null)return null;let t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function La(n){return $a(ln(n)?n:n.getParentOrThrow())}function Wm(n){let e=La(n);return e!==null&&e.direction==="rtl"}function Um(n,e,t="self"){let o=n.getStartEndPoints();if(e.isSelected(n)&&!Ta(e)&&o!==null){let[r,s]=o,i=n.isBackward(),a=r.getNode(),l=s.getNode(),c=e.is(a),u=e.is(l);if(c||u){let[d,f]=dd(n),h=a.is(l),g=e.is(i?l:a),p=e.is(i?a:l),m,x=0;h?(x=d>f?f:d,m=d>f?d:f):g?(x=i?f:d,m=void 0):p&&(x=0,m=i?d:f);let y=e.__text.slice(x,m);y!==e.__text&&(t==="clone"&&(e=sd(e)),e.__text=y)}}return e}function zm(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();let e=n.getNode();return $(e)||Ia(177),n.offset===e.getChildrenSize()}function gf(n,e,t){let o=e.getNode(),r=t;if($(o)){let s=o.getDescendantByIndex(e.offset);s!==null&&(o=s)}for(;r>0&&o!==null;){if($(o)){let c=o.getLastDescendant();c!==null&&(o=c)}let s=o.getPreviousSibling(),i=0;if(s===null){let c=o.getParentOrThrow(),u=c.getPreviousSibling();for(;u===null;){if(c=c.getParent(),c===null){s=null;break}u=c.getPreviousSibling()}c!==null&&(i=c.isInline()?0:2,s=u)}let a=o.getTextContent();a===""&&$(o)&&!o.isInline()&&(a=`
12
12
 
13
- `);let l=a.length;if(!B(o)||r>=l){let c=o.getParent();o.remove(),c==null||c.getChildrenSize()!==0||ln(c)||c.remove(),r-=l+i,o=s}else{let c=o.getKey(),u=n.getEditorState().read(()=>{let h=Kn(c);return B(h)&&h.isSimpleText()?h.getTextContent():null}),d=l-r,f=a.slice(0,d);if(u!==null&&u!==a){let h=bo(),g=o;if(o.isSimpleText())o.setTextContent(u);else{let p=Kt(u);o.replace(p),g=p}if(D(h)&&h.isCollapsed()){let p=h.anchor.offset;g.select(p,p)}}else if(o.isSimpleText()){let h=e.key===c,g=e.offset;g<r&&(g=l);let p=h?g-r:0,m=h?g:d;if(h&&p===0){let[x]=o.splitText(p,m);x.remove()}else{let[,x]=o.splitText(p,m);x.remove()}}else{let h=Kt(f);o.replace(h)}r=0}}}function Wm(n){let e=n.getStyle(),t=cf(e);ms.set(e,t)}function ps(n,e){(D(n)?n.isCollapsed():B(n)||$(n))||ka(280);let t=_s(D(n)?n.style:B(n)?n.getStyle():n.getTextStyle()),o=Object.entries(e).reduce((s,[i,a])=>(typeof a=="function"?s[i]=a(t[i],n):a===null?delete s[i]:s[i]=a,s),{...t}),r=uf(o);D(n)||B(n)?n.setStyle(r):n.setTextStyle(r),ms.set(r,o)}function Um(n,e){if(D(n)&&n.isCollapsed()){ps(n,e);let o=n.anchor.getNode();$(o)&&o.isEmpty()&&ps(o,e)}ff(o=>{ps(o,e)});let t=n.getNodes();if(t.length>0){let o=new Set;for(let r of t){if(!$(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let s=r.getKey();o.has(s)||(o.add(s),ps(r,e))}}}function ff(n){let e=R();if(!e)return;let t=new Map,o=s=>t.get(s.getKey())||[0,s.getTextContentSize()];if(D(e))for(let s of nd(e).getTextSlices())s&&t.set(s.caret.origin.getKey(),s.getSliceIndices());let r=e.getNodes();for(let s of r){if(!B(s)||!s.canHaveFormat())continue;let[i,a]=o(s);a!==i&&(Sa(s)||i===0&&a===s.getTextContentSize()?n(s):n(s.splitText(i,a)[i===0?0:1]))}D(e)&&e.anchor.type==="text"&&e.focus.type==="text"&&e.anchor.key===e.focus.key&&gf(e)}function gf(n){if(n.isBackward()){let{anchor:e,focus:t}=n,{key:o,offset:r,type:s}=e;e.set(t.key,t.offset,t.type),t.set(o,r,s)}}function hf(n,e){let t=n.getFormatType(),o=n.getIndent();t!==e.getFormatType()&&e.setFormat(t),o!==e.getIndent()&&e.setIndent(o)}function zm(n,e,t=hf){if(n===null)return;let o=n.getStartEndPoints(),r=new Map,s=null;if(o){let[i,a]=o;s=Fn(),s.anchor.set(i.key,i.offset,i.type),s.focus.set(a.key,a.offset,a.type);let l=Ct(i.getNode(),Fo),c=Ct(a.getNode(),Fo);$(l)&&r.set(l.getKey(),l),$(c)&&r.set(c.getKey(),c)}for(let i of n.getNodes())if($(i)&&Fo(i))r.set(i.getKey(),i);else if(o===null){let a=Ct(i,Fo);$(a)&&r.set(a.getKey(),a)}for(let[i,a]of r){let l=e();t(a,l),a.replace(l,!0),s&&(i===s.anchor.key&&s.anchor.set(l.getKey(),s.anchor.offset,s.anchor.type),i===s.focus.key&&s.focus.set(l.getKey(),s.focus.offset,s.focus.type))}s&&n.is(R())&&Ge(s)}function lf(n){return n.getNode().isAttached()}function Hm(n){let e=n;for(;e!==null&&!$e(e);){let t=e.getLatest(),o=e.getParent();t.getChildrenSize()===0&&e.remove(!0),e=o}}function Ym(n,e,t=null){let o=n.getStartEndPoints(),r=o?o[0]:null,s=n.getNodes(),i=s.length;if(r!==null&&(i===0||i===1&&r.type==="element"&&r.getNode().getChildrenSize()===0)){let c=r.type==="text"?r.getNode().getParentOrThrow():r.getNode(),u=c.getChildren(),d=e();return d.setFormat(c.getFormatType()),d.setIndent(c.getIndent()),u.forEach(f=>d.append(f)),t&&(d=t.append(d)),void c.replace(d)}let a=null,l=[];for(let c=0;c<i;c++){let u=s[c];$e(u)?(Ra(n,l,l.length,e,t),l=[],a=u):a===null||a!==null&&fd(u,a)?l.push(u):(Ra(n,l,l.length,e,t),l=[u])}Ra(n,l,l.length,e,t)}function Ra(n,e,t,o,r=null){if(e.length===0)return;let s=e[0],i=new Map,a=[],l=$(s)?s:s.getParentOrThrow();l.isInline()&&(l=l.getParentOrThrow());let c=!1;for(;l!==null;){let g=l.getPreviousSibling();if(g!==null){l=g,c=!0;break}if(l=l.getParentOrThrow(),$e(l))break}let u=new Set;for(let g=0;g<t;g++){let p=e[g];$(p)&&p.getChildrenSize()===0&&u.add(p.getKey())}let d=new Set;for(let g=0;g<t;g++){let p=e[g],m=p.getParent();if(m!==null&&m.isInline()&&(m=m.getParent()),m!==null&&ko(p)&&!d.has(p.getKey())){let x=m.getKey();if(i.get(x)===void 0){let y=o();y.setFormat(m.getFormatType()),y.setIndent(m.getIndent()),a.push(y),i.set(x,y),m.getChildren().forEach(N=>{y.append(N),d.add(N.getKey()),$(N)&&N.getChildrenKeys().forEach(T=>d.add(T))}),Hm(m)}}else if(u.has(p.getKey())){$(p)||ka(179);let x=o();x.setFormat(p.getFormatType()),x.setIndent(p.getIndent()),a.push(x),p.remove(!0)}}if(r!==null)for(let g=0;g<a.length;g++){let p=a[g];r.append(p)}let f=null;if($e(l))if(c)if(r!==null)l.insertAfter(r);else for(let g=a.length-1;g>=0;g--){let p=a[g];l.insertAfter(p)}else{let g=l.getFirstChild();if($(g)&&(l=g),g===null)if(r)l.append(r);else for(let p=0;p<a.length;p++){let m=a[p];l.append(m),f=m}else if(r!==null)g.insertBefore(r);else for(let p=0;p<a.length;p++){let m=a[p];g.insertBefore(m),f=m}}else if(r)l.insertAfter(r);else for(let g=a.length-1;g>=0;g--){let p=a[g];l.insertAfter(p),f=p}let h=bo();D(h)&&lf(h.anchor)&&lf(h.focus)?Ge(h.clone()):f!==null?f.selectEnd():n.dirty=!0}function pf(n){let e=mf(n);return e!==null&&e.writingMode==="vertical-rl"}function mf(n){let e=n.anchor.getNode();return $(e)?Ia(e):$a(e)}function Gm(n,e){let t=pf(n)?!e:e;La(n)&&(t=!t);let o=Ft(n.focus,t?"previous":"next");if(hd(o))return!1;for(let r of ad(o)){if(Ro(r))return!r.origin.isInline();if(!$(r.origin)){if(an(r.origin))return!0;break}}return!1}function _f(n,e,t,o){n.modify(e?"extend":"move",t,o)}function La(n){let e=mf(n);return e!==null&&e.direction==="rtl"}function jm(n,e,t){let o=La(n),r;r=pf(n)||o?!t:t,_f(n,e,r,"character")}function Jm(n,e,t){let o=_s(n.getStyle());return o!==null&&o[e]||t}function Vm(n,e,t=""){let o=null,r=n.getNodes(),s=n.anchor,i=n.focus,a=n.isBackward(),l=a?i.offset:s.offset,c=a?i.getNode():s.getNode();if(D(n)&&n.isCollapsed()&&n.style!==""){let u=_s(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<r.length;u++){let d=r[u];if((u===0||l!==0||!d.is(c))&&B(d)){let f=Jm(d,e,t);if(o===null)o=f;else if(o!==f){o="";break}}}return o===null?t:o}var qm=df;var ee=Pa,xf=ee.$addNodeStyle,EN=ee.$cloneWithProperties,ON=ee.$copyBlockFormatIndent,MN=ee.$ensureForwardRangeSelection,vN=ee.$forEachSelectedTextNode,AN=ee.$getComputedStyleForElement,DN=ee.$getComputedStyleForParent,bN=ee.$getSelectionStyleValueForProperty,RN=ee.$isAtNodeEnd,kN=ee.$isParentElementRTL,wa=ee.$isParentRTL,IN=ee.$moveCaretSelection,Fa=ee.$moveCharacter,$N=ee.$patchStyleText,LN=ee.$selectAll,yf=ee.$setBlocksType,Ka=ee.$shouldOverrideDefaultCharacterSelection,xs=ee.$sliceSelectedTextNodeContent,PN=ee.$trimTextContentFromAnchor,wN=ee.$wrapNodes,FN=ee.createDOMRange,Nf=ee.createRectsFromDOMRange,KN=ee.getCSSFromStyleObject,Ba=ee.getStyleObjectFromCSS,BN=ee.trimTextContentFromAnchor;var Ha={};we(Ha,{$descendantsMatching:()=>I_,$dfs:()=>p_,$dfsIterator:()=>bf,$filter:()=>v_,$findMatchingParent:()=>Ct,$firstToLastIterator:()=>$_,$getAdjacentCaret:()=>m_,$getAdjacentSiblingOrParentSiblingCaret:()=>sn,$getDepth:()=>kf,$getNearestBlockElementAncestorOrThrow:()=>C_,$getNearestNodeOfType:()=>N_,$getNextRightPreorderNode:()=>y_,$getNextSiblingOrParentSibling:()=>x_,$handleIndentAndOutdent:()=>A_,$insertFirst:()=>D_,$insertNodeToNearestRoot:()=>E_,$insertNodeToNearestRootAtCaret:()=>$f,$isEditorIsNestedEditor:()=>R_,$lastToFirstIterator:()=>za,$restoreEditorState:()=>T_,$reverseDfs:()=>__,$reverseDfsIterator:()=>If,$splitNode:()=>Nd,$unwrapAndFilterDescendants:()=>k_,$unwrapNode:()=>L_,$wrapNodeInElement:()=>O_,CAN_USE_BEFORE_INPUT:()=>i_,CAN_USE_DOM:()=>vf,IS_ANDROID:()=>a_,IS_ANDROID_CHROME:()=>l_,IS_APPLE:()=>c_,IS_APPLE_WEBKIT:()=>u_,IS_CHROME:()=>d_,IS_FIREFOX:()=>Af,IS_IOS:()=>f_,IS_SAFARI:()=>g_,addClassNamesToElement:()=>Bo,calculateZoomLevel:()=>b_,isBlockDomNode:()=>ef,isHTMLAnchorElement:()=>nf,isHTMLElement:()=>gs,isInlineDomNode:()=>Wo,isMimeType:()=>Df,makeStateWrapper:()=>P_,markSelection:()=>Mf,mediaFileReader:()=>h_,mergeRegister:()=>rt,objectKlassEquals:()=>M_,positionNodeOnRange:()=>Of,registerNestedElementResolver:()=>S_,removeClassNamesFromElement:()=>hs,selectionAlwaysOnDisplay:()=>s_});function ys(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var je=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Xm=je&&"documentMode"in document?document.documentMode:null,Tf=je&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Qm=je&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Zm=!(!je||!("InputEvent"in window)||Xm)&&"getTargetRanges"in new window.InputEvent("input"),e_=je&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),t_=je&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ef=je&&/Android/.test(navigator.userAgent),Ua=je&&/^(?=.*Chrome).*/i.test(navigator.userAgent),n_=je&&Ef&&Ua,o_=je&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Tf&&!Ua;function st(n){return`${n}px`}var r_={attributes:!0,characterData:!0,childList:!0,subtree:!0};function Of(n,e,t){let o=null,r=null,s=null,i=[],a=document.createElement("div");function l(){o===null&&ys(182),r===null&&ys(183);let{left:d,top:f}=r.getBoundingClientRect(),h=Nf(n,e);var g,p;a.isConnected||(p=a,(g=r).insertBefore(p,g.firstChild));let m=!1;for(let x=0;x<h.length;x++){let y=h[x],N=i[x]||document.createElement("div"),T=N.style;T.position!=="absolute"&&(T.position="absolute",m=!0);let O=st(y.left-d);T.left!==O&&(T.left=O,m=!0);let E=st(y.top-f);T.top!==E&&(N.style.top=E,m=!0);let A=st(y.width);T.width!==A&&(N.style.width=A,m=!0);let C=st(y.height);T.height!==C&&(N.style.height=C,m=!0),N.parentNode!==a&&(a.append(N),m=!0),i[x]=N}for(;i.length>h.length;)i.pop();m&&t(i)}function c(){r=null,o=null,s!==null&&s.disconnect(),s=null,a.remove();for(let d of i)d.remove();i=[]}a.style.position="relative";let u=n.registerRootListener(function d(){let f=n.getRootElement();if(f===null)return c();let h=f.parentElement;if(!gs(h))return c();c(),o=f,r=h,s=new MutationObserver(g=>{let p=n.getRootElement(),m=p&&p.parentElement;if(p!==o||m!==r)return d();for(let x of g)if(!a.contains(x.target))return l()}),s.observe(h,r_),l()});return()=>{u(),c()}}function Cf(n,e,t){if(n.type!=="text"&&$(e)){let o=e.getDOMSlot(t);return[o.element,o.getFirstChildOffset()+n.offset]}return[Qd(t)||t,n.offset]}function Mf(n,e){let t=null,o=null,r=null,s=null,i=null,a=null,l=()=>{};function c(u){u.read(()=>{let d=R();if(!D(d))return t=null,r=null,s=null,a=null,l(),void(l=()=>{});let[f,h]=(function(C){let S=C.getStartEndPoints();return C.isBackward()?[S[1],S[0]]:S})(d),g=f.getNode(),p=g.getKey(),m=f.offset,x=h.getNode(),y=x.getKey(),N=h.offset,T=n.getElementByKey(p),O=n.getElementByKey(y),E=t===null||T!==o||m!==r||p!==t.getKey(),A=s===null||O!==i||N!==a||y!==s.getKey();if((E||A)&&T!==null&&O!==null){let C=(function(S,k,F,j,Y,H,te){let ae=(S._window?S._window.document:document).createRange();return ae.setStart(...Cf(k,F,j)),ae.setEnd(...Cf(Y,H,te)),ae})(n,f,g,T,h,x,O);l(),l=Of(n,C,S=>{if(e===void 0)for(let k of S){let F=k.style;F.background!=="Highlight"&&(F.background="Highlight"),F.color!=="HighlightText"&&(F.color="HighlightText"),F.marginTop!==st(-1.5)&&(F.marginTop=st(-1.5)),F.paddingTop!==st(4)&&(F.paddingTop=st(4)),F.paddingBottom!==st(0)&&(F.paddingBottom=st(0))}else e(S)})}t=g,o=T,r=m,s=x,i=O,a=N})}return c(n.getEditorState()),rt(n.registerUpdateListener(({editorState:u})=>c(u)),()=>{l()})}function s_(n,e){let t=null,o=()=>{let r=getSelection(),s=r&&r.anchorNode,i=n.getRootElement();s!==null&&i!==null&&i.contains(s)?t!==null&&(t(),t=null):t===null&&(t=Mf(n,e))};return document.addEventListener("selectionchange",o),()=>{t!==null&&t(),document.removeEventListener("selectionchange",o)}}var i_=Zm,vf=je,a_=Ef,l_=n_,c_=Tf,u_=o_,d_=Ua,Af=Qm,f_=t_,g_=e_;function Df(n,e){for(let t of e)if(n.type.startsWith(t))return!0;return!1}function h_(n,e){let t=n[Symbol.iterator]();return new Promise((o,r)=>{let s=[],i=()=>{let{done:a,value:l}=t.next();if(a)return o(s);let c=new FileReader;c.addEventListener("error",r),c.addEventListener("load",()=>{let u=c.result;typeof u=="string"&&s.push({file:l,result:u}),i()}),Df(l,e)?c.readAsDataURL(l):i()};i()})}function p_(n,e){return Array.from(bf(n,e))}function m_(n){return n?n.getAdjacentCaret():null}function __(n,e){return Array.from(If(n,e))}function bf(n,e){return Rf("next",n,e)}function Sf(n,e){let t=sn(St(n,e));return t&&t[0]}function Rf(n,e,t){let o=Ce(),r=e||o,s=$(r)?De(r,n):St(r,n),i=kf(r),a=t?_a(Na(St(t,n)))||Sf(t,n):Sf(r,n),l=i;return Aa({hasNext:c=>c!==null,initial:s,map:c=>({depth:l,node:c.origin}),step:c=>{if(c.isSameNodeCaret(a))return null;Ro(c)&&l++;let u=sn(c);return!u||u[0].isSameNodeCaret(a)?null:(l+=u[1],u[0])}})}function x_(n){let e=sn(St(n,"next"));return e&&[e[0].origin,e[1]]}function kf(n){let e=-1;for(let t=n;t!==null;t=t.getParent())e++;return e}function y_(n){let e=Na(St(n,"previous")),t=sn(e,"root");return t&&t[0].origin}function If(n,e){return Rf("previous",n,e)}function N_(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function C_(n){let e=Ct(n,t=>$(t)&&!t.isInline());return $(e)||ys(4,n.__key),e}function S_(n,e,t,o){let r=s=>s instanceof e;return n.registerNodeTransform(e,s=>{let i=(a=>{let l=a.getChildren();for(let d=0;d<l.length;d++){let f=l[d];if(r(f))return null}let c=a,u=a;for(;c!==null;)if(u=c,c=c.getParent(),r(c))return{child:u,parent:c};return null})(s);if(i!==null){let{child:a,parent:l}=i;if(a.is(s)){o(l,s);let c=a.getNextSiblings(),u=c.length;if(l.insertAfter(a),u!==0){let d=t(l);a.insertAfter(d);for(let f=0;f<u;f++)d.append(c[f])}l.canBeEmpty()||l.getChildrenSize()!==0||l.remove()}}})}function T_(n,e){let t=new Map,o=n._pendingEditorState;for(let[s,i]of e._nodeMap)t.set(s,Kr(i));o&&(o._nodeMap=t),n._dirtyType=2;let r=e._selection;Ge(r===null?null:r.clone())}function E_(n){let e=R()||bo(),t;if(D(e))t=Ft(e.focus,"next");else{if(e!=null){let i=e.getNodes(),a=i[i.length-1];a&&(t=St(a,"next"))}t=t||De(Ce(),"previous").getFlipped().insert(se())}let o=$f(n,t),r=_a(o),s=Ro(r)?cn(r):o;return xd(ud(s)),n.getLatest()}function $f(n,e,t){let o=ya(e,"next");for(let r=o;r;r=yd(r,t))o=r;return Hr(o)&&ys(283),o.insert(n.isInline()?se().append(n):n),ya(St(n.getLatest(),"next"),e.direction)}function O_(n,e){let t=e();return n.replace(t),t.append(n),t}function M_(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}function v_(n,e){let t=[];for(let o=0;o<n.length;o++){let r=e(n[o]);r!==null&&t.push(r)}return t}function A_(n){let e=R();if(!D(e))return!1;let t=new Set,o=e.getNodes();for(let r=0;r<o.length;r++){let s=o[r],i=s.getKey();if(t.has(i))continue;let a=Ct(s,c=>$(c)&&!c.isInline());if(a===null)continue;let l=a.getKey();a.canIndent()&&!t.has(l)&&(t.add(l),n(a))}return t.size>0}function D_(n,e){De(n,"next").insert(e)}var Wa=!(Af||!vf)&&void 0;function b_(n,e=!1){let t=1;if((function(){if(Wa===void 0){let o=document.createElement("div");o.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(o);let r=o.getBoundingClientRect();o.style.setProperty("zoom","2"),Wa=o.getBoundingClientRect().width===r.width,document.body.removeChild(o)}return Wa})()||e)for(;n;)t*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return t}function R_(n){return n._parentEditor!==null}function k_(n,e){return Lf(n,e,null)}function Lf(n,e,t){let o=!1;for(let r of za(n))e(r)?t!==null&&t(r):(o=!0,$(r)&&Lf(r,e,t||(s=>r.insertAfter(s))),r.remove());return o}function I_(n,e){let t=[],o=Array.from(n).reverse();for(let r=o.pop();r!==void 0;r=o.pop())if(e(r))t.push(r);else if($(r))for(let s of za(r))o.push(s);return t}function $_(n){return Pf(De(n,"next"))}function za(n){return Pf(De(n,"previous"))}function Pf(n){return Aa({hasNext:md,initial:n.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function L_(n){Yr(St(n,"next")).splice(1,n.getChildren())}function P_(n){let e=o=>Ur(o,n),t=(o,r)=>jr(o,n,r);return{$get:e,$set:t,accessors:[e,t],makeGetterMethod:()=>function(){return e(this)},makeSetterMethod:()=>function(o){return t(this,o)},stateConfig:n}}var P=Ha,YN=P.$descendantsMatching,GN=P.$dfs,jN=P.$dfsIterator,JN=P.$filter,be=P.$findMatchingParent,VN=P.$firstToLastIterator,qN=P.$getAdjacentCaret,XN=P.$getAdjacentSiblingOrParentSiblingCaret,QN=P.$getDepth,Ns=P.$getNearestBlockElementAncestorOrThrow,wf=P.$getNearestNodeOfType,ZN=P.$getNextRightPreorderNode,eC=P.$getNextSiblingOrParentSibling,zo=P.$handleIndentAndOutdent,tC=P.$insertFirst,nC=P.$insertNodeToNearestRoot,Ff=P.$insertNodeToNearestRootAtCaret,oC=P.$isEditorIsNestedEditor,rC=P.$lastToFirstIterator,sC=P.$restoreEditorState,iC=P.$reverseDfs,aC=P.$reverseDfsIterator,lC=P.$splitNode,cC=P.$unwrapAndFilterDescendants,uC=P.$unwrapNode,dC=P.$wrapNodeInElement,fC=P.CAN_USE_BEFORE_INPUT,gC=P.CAN_USE_DOM,hC=P.IS_ANDROID,pC=P.IS_ANDROID_CHROME,mC=P.IS_APPLE,_C=P.IS_APPLE_WEBKIT,xC=P.IS_CHROME,yC=P.IS_FIREFOX,NC=P.IS_IOS,CC=P.IS_SAFARI,Ut=P.addClassNamesToElement,Kf=P.calculateZoomLevel,Ya=P.isBlockDomNode,Cs=P.isHTMLAnchorElement,Pe=P.isHTMLElement,SC=P.isInlineDomNode,TC=P.isMimeType,EC=P.makeStateWrapper,OC=P.markSelection,MC=P.mediaFileReader,Je=P.mergeRegister,Ve=P.objectKlassEquals,vC=P.positionNodeOnRange,AC=P.registerNestedElementResolver,Ga=P.removeClassNamesFromElement,DC=P.selectionAlwaysOnDisplay;var ja={};we(ja,{$generateHtmlFromNodes:()=>F_,$generateNodesFromDOM:()=>w_});function w_(n,e){let t=tf(e)?e.body.childNodes:e.childNodes,o=[],r=[];for(let s of t)if(!Wf.has(s.nodeName)){let i=Uf(s,n,r,!1);i!==null&&(o=o.concat(i))}return(function(s){for(let i of s)i.getNextSibling()instanceof Ta&&i.insertAfter(ma());for(let i of s){let a=i.getChildren();for(let l of a)i.insertBefore(l);i.remove()}})(r),o}function F_(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let t=document.createElement("div"),o=Ce().getChildren();for(let r=0;r<o.length;r++)Bf(n,o[r],t,e);return t.innerHTML}function Bf(n,e,t,o=null){let r=o===null||e.isSelected(o),s=$(e)&&e.excludeFromCopy("html"),i=e;o!==null&&B(e)&&(i=xs(o,e,"clone"));let a=$(i)?i.getChildren():[],l=Zd(n,i.getType()),c;c=l&&l.exportDOM!==void 0?l.exportDOM(n,i):i.exportDOM(n);let{element:u,after:d}=c;if(!u)return!1;let f=document.createDocumentFragment();for(let h=0;h<a.length;h++){let g=a[h],p=Bf(n,g,f,o);!r&&$(e)&&p&&e.extractWithChild(g,o,"html")&&(r=!0)}if(r&&!s){if((Pe(u)||va(u))&&u.append(f),t.append(u),d){let h=d.call(i,u);h&&(va(u)?u.replaceChildren(h):u.replaceWith(h))}}else t.append(f);return r}var Wf=new Set(["STYLE","SCRIPT"]);function Uf(n,e,t,o,r=new Map,s){let i=[];if(Wf.has(n.nodeName))return i;let a=null,l=(function(g,p){let{nodeName:m}=g,x=p._htmlConversions.get(m.toLowerCase()),y=null;if(x!==void 0)for(let N of x){let T=N(g);T!==null&&(y===null||(y.priority||0)<=(T.priority||0))&&(y=T)}return y!==null?y.conversion:null})(n,e),c=l?l(n):null,u=null;if(c!==null){u=c.after;let g=c.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(let[,p]of r)if(a=p(a,s),!a)break;a&&i.push(...Array.isArray(g)?g:[a])}c.forChild!=null&&r.set(n.nodeName,c.forChild)}let d=n.childNodes,f=[],h=(a==null||!$e(a))&&(a!=null&&Bn(a)||o);for(let g=0;g<d.length;g++)f.push(...Uf(d[g],e,t,h,new Map(r),a));return u!=null&&(f=u(f)),Ya(n)&&(f=K_(n,f,h?()=>{let g=new Ta;return t.push(g),g}:se)),a==null?f.length>0?i=i.concat(f):Ya(n)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Wo(g.nextSibling)&&Wo(g.previousSibling)})(n)&&(i=i.concat(ma())):$(a)&&a.append(...f),i}function K_(n,e,t){let o=n.style.textAlign,r=[],s=[];for(let i=0;i<e.length;i++){let a=e[i];if(Bn(a))o&&!a.getFormat()&&a.setFormat(o),r.push(a);else if(s.push(a),i===e.length-1||i<e.length-1&&Bn(e[i+1])){let l=t();l.setFormat(o),l.append(...s),r.push(l),s=[]}}return r}var zf=ja,Ss=zf.$generateHtmlFromNodes,Ts=zf.$generateNodesFromDOM;var Va={};we(Va,{$generateJSONFromSelectedNodes:()=>Jf,$generateNodesFromSerializedNodes:()=>Vf,$getClipboardDataFromSelection:()=>Xf,$getHtmlContent:()=>Yf,$getLexicalContent:()=>Gf,$insertDataTransferForPlainText:()=>B_,$insertDataTransferForRichText:()=>W_,$insertGeneratedNodes:()=>Ja,copyToClipboard:()=>U_,setLexicalClipboardDataTransfer:()=>Qf});function Es(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Yf(n,e=R()){return e==null&&Es(166),D(e)&&e.isCollapsed()||e.getNodes().length===0?"":Ss(n,e)}function Gf(n,e=R()){return e==null&&Es(166),D(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Jf(n,e))}function B_(n,e){let t=n.getData("text/plain")||n.getData("text/uri-list");t!=null&&e.insertRawText(t)}function W_(n,e,t){let o=n.getData("application/x-lexical-editor");if(o)try{let a=JSON.parse(o);if(a.namespace===t._config.namespace&&Array.isArray(a.nodes))return Ja(t,Vf(a.nodes),e)}catch(a){console.error(a)}let r=n.getData("text/html"),s=n.getData("text/plain");if(r&&s!==r)try{let a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(l):l})(r),"text/html");return Ja(t,Ts(t,a),e)}catch(a){console.error(a)}let i=s||n.getData("text/uri-list");if(i!=null)if(D(e)){let a=i.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){let c=R();if(D(c)){let u=a[l];u===`
13
+ `);let l=a.length;if(!B(o)||r>=l){let c=o.getParent();o.remove(),c==null||c.getChildrenSize()!==0||ln(c)||c.remove(),r-=l+i,o=s}else{let c=o.getKey(),u=n.getEditorState().read(()=>{let h=Kn(c);return B(h)&&h.isSimpleText()?h.getTextContent():null}),d=l-r,f=a.slice(0,d);if(u!==null&&u!==a){let h=Ro(),g=o;if(o.isSimpleText())o.setTextContent(u);else{let p=Kt(u);o.replace(p),g=p}if(D(h)&&h.isCollapsed()){let p=h.anchor.offset;g.select(p,p)}}else if(o.isSimpleText()){let h=e.key===c,g=e.offset;g<r&&(g=l);let p=h?g-r:0,m=h?g:d;if(h&&p===0){let[x]=o.splitText(p,m);x.remove()}else{let[,x]=o.splitText(p,m);x.remove()}}else{let h=Kt(f);o.replace(h)}r=0}}}function Hm(n){let e=n.getStyle(),t=df(e);_s.set(e,t)}function ms(n,e){(D(n)?n.isCollapsed():B(n)||$(n))||Ia(280);let t=xs(D(n)?n.style:B(n)?n.getStyle():n.getTextStyle()),o=Object.entries(e).reduce((s,[i,a])=>(typeof a=="function"?s[i]=a(t[i],n):a===null?delete s[i]:s[i]=a,s),{...t}),r=ff(o);D(n)||B(n)?n.setStyle(r):n.setTextStyle(r),_s.set(r,o)}function Ym(n,e){if(D(n)&&n.isCollapsed()){ms(n,e);let o=n.anchor.getNode();$(o)&&o.isEmpty()&&ms(o,e)}hf(o=>{ms(o,e)});let t=n.getNodes();if(t.length>0){let o=new Set;for(let r of t){if(!$(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let s=r.getKey();o.has(s)||(o.add(s),ms(r,e))}}}function hf(n){let e=R();if(!e)return;let t=new Map,o=s=>t.get(s.getKey())||[0,s.getTextContentSize()];if(D(e))for(let s of rd(e).getTextSlices())s&&t.set(s.caret.origin.getKey(),s.getSliceIndices());let r=e.getNodes();for(let s of r){if(!B(s)||!s.canHaveFormat())continue;let[i,a]=o(s);a!==i&&(Ta(s)||i===0&&a===s.getTextContentSize()?n(s):n(s.splitText(i,a)[i===0?0:1]))}D(e)&&e.anchor.type==="text"&&e.focus.type==="text"&&e.anchor.key===e.focus.key&&pf(e)}function pf(n){if(n.isBackward()){let{anchor:e,focus:t}=n,{key:o,offset:r,type:s}=e;e.set(t.key,t.offset,t.type),t.set(o,r,s)}}function mf(n,e){let t=n.getFormatType(),o=n.getIndent();t!==e.getFormatType()&&e.setFormat(t),o!==e.getIndent()&&e.setIndent(o)}function Gm(n,e,t=mf){if(n===null)return;let o=n.getStartEndPoints(),r=new Map,s=null;if(o){let[i,a]=o;s=Fn(),s.anchor.set(i.key,i.offset,i.type),s.focus.set(a.key,a.offset,a.type);let l=Ct(i.getNode(),Ko),c=Ct(a.getNode(),Ko);$(l)&&r.set(l.getKey(),l),$(c)&&r.set(c.getKey(),c)}for(let i of n.getNodes())if($(i)&&Ko(i))r.set(i.getKey(),i);else if(o===null){let a=Ct(i,Ko);$(a)&&r.set(a.getKey(),a)}for(let[i,a]of r){let l=e();t(a,l),a.replace(l,!0),s&&(i===s.anchor.key&&s.anchor.set(l.getKey(),s.anchor.offset,s.anchor.type),i===s.focus.key&&s.focus.set(l.getKey(),s.focus.offset,s.focus.type))}s&&n.is(R())&&Ge(s)}function uf(n){return n.getNode().isAttached()}function jm(n){let e=n;for(;e!==null&&!$e(e);){let t=e.getLatest(),o=e.getParent();t.getChildrenSize()===0&&e.remove(!0),e=o}}function Jm(n,e,t=null){let o=n.getStartEndPoints(),r=o?o[0]:null,s=n.getNodes(),i=s.length;if(r!==null&&(i===0||i===1&&r.type==="element"&&r.getNode().getChildrenSize()===0)){let c=r.type==="text"?r.getNode().getParentOrThrow():r.getNode(),u=c.getChildren(),d=e();return d.setFormat(c.getFormatType()),d.setIndent(c.getIndent()),u.forEach(f=>d.append(f)),t&&(d=t.append(d)),void c.replace(d)}let a=null,l=[];for(let c=0;c<i;c++){let u=s[c];$e(u)?(ka(n,l,l.length,e,t),l=[],a=u):a===null||a!==null&&hd(u,a)?l.push(u):(ka(n,l,l.length,e,t),l=[u])}ka(n,l,l.length,e,t)}function ka(n,e,t,o,r=null){if(e.length===0)return;let s=e[0],i=new Map,a=[],l=$(s)?s:s.getParentOrThrow();l.isInline()&&(l=l.getParentOrThrow());let c=!1;for(;l!==null;){let g=l.getPreviousSibling();if(g!==null){l=g,c=!0;break}if(l=l.getParentOrThrow(),$e(l))break}let u=new Set;for(let g=0;g<t;g++){let p=e[g];$(p)&&p.getChildrenSize()===0&&u.add(p.getKey())}let d=new Set;for(let g=0;g<t;g++){let p=e[g],m=p.getParent();if(m!==null&&m.isInline()&&(m=m.getParent()),m!==null&&Io(p)&&!d.has(p.getKey())){let x=m.getKey();if(i.get(x)===void 0){let y=o();y.setFormat(m.getFormatType()),y.setIndent(m.getIndent()),a.push(y),i.set(x,y),m.getChildren().forEach(N=>{y.append(N),d.add(N.getKey()),$(N)&&N.getChildrenKeys().forEach(T=>d.add(T))}),jm(m)}}else if(u.has(p.getKey())){$(p)||Ia(179);let x=o();x.setFormat(p.getFormatType()),x.setIndent(p.getIndent()),a.push(x),p.remove(!0)}}if(r!==null)for(let g=0;g<a.length;g++){let p=a[g];r.append(p)}let f=null;if($e(l))if(c)if(r!==null)l.insertAfter(r);else for(let g=a.length-1;g>=0;g--){let p=a[g];l.insertAfter(p)}else{let g=l.getFirstChild();if($(g)&&(l=g),g===null)if(r)l.append(r);else for(let p=0;p<a.length;p++){let m=a[p];l.append(m),f=m}else if(r!==null)g.insertBefore(r);else for(let p=0;p<a.length;p++){let m=a[p];g.insertBefore(m),f=m}}else if(r)l.insertAfter(r);else for(let g=a.length-1;g>=0;g--){let p=a[g];l.insertAfter(p),f=p}let h=Ro();D(h)&&uf(h.anchor)&&uf(h.focus)?Ge(h.clone()):f!==null?f.selectEnd():n.dirty=!0}function _f(n){let e=xf(n);return e!==null&&e.writingMode==="vertical-rl"}function xf(n){let e=n.anchor.getNode();return $(e)?$a(e):La(e)}function Vm(n,e){let t=_f(n)?!e:e;Pa(n)&&(t=!t);let o=Ft(n.focus,t?"previous":"next");if(md(o))return!1;for(let r of cd(o)){if(ko(r))return!r.origin.isInline();if(!$(r.origin)){if(an(r.origin))return!0;break}}return!1}function yf(n,e,t,o){n.modify(e?"extend":"move",t,o)}function Pa(n){let e=xf(n);return e!==null&&e.direction==="rtl"}function qm(n,e,t){let o=Pa(n),r;r=_f(n)||o?!t:t,yf(n,e,r,"character")}function Xm(n,e,t){let o=xs(n.getStyle());return o!==null&&o[e]||t}function Qm(n,e,t=""){let o=null,r=n.getNodes(),s=n.anchor,i=n.focus,a=n.isBackward(),l=a?i.offset:s.offset,c=a?i.getNode():s.getNode();if(D(n)&&n.isCollapsed()&&n.style!==""){let u=xs(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<r.length;u++){let d=r[u];if((u===0||l!==0||!d.is(c))&&B(d)){let f=Xm(d,e,t);if(o===null)o=f;else if(o!==f){o="";break}}}return o===null?t:o}var Zm=gf;var ee=wa,Nf=ee.$addNodeStyle,AN=ee.$cloneWithProperties,DN=ee.$copyBlockFormatIndent,bN=ee.$ensureForwardRangeSelection,RN=ee.$forEachSelectedTextNode,kN=ee.$getComputedStyleForElement,IN=ee.$getComputedStyleForParent,$N=ee.$getSelectionStyleValueForProperty,LN=ee.$isAtNodeEnd,PN=ee.$isParentElementRTL,Fa=ee.$isParentRTL,wN=ee.$moveCaretSelection,Ka=ee.$moveCharacter,FN=ee.$patchStyleText,KN=ee.$selectAll,Cf=ee.$setBlocksType,Ba=ee.$shouldOverrideDefaultCharacterSelection,ys=ee.$sliceSelectedTextNodeContent,BN=ee.$trimTextContentFromAnchor,WN=ee.$wrapNodes,UN=ee.createDOMRange,Sf=ee.createRectsFromDOMRange,zN=ee.getCSSFromStyleObject,Wa=ee.getStyleObjectFromCSS,HN=ee.trimTextContentFromAnchor;var Ya={};we(Ya,{$descendantsMatching:()=>P_,$dfs:()=>x_,$dfsIterator:()=>kf,$filter:()=>b_,$findMatchingParent:()=>Ct,$firstToLastIterator:()=>w_,$getAdjacentCaret:()=>y_,$getAdjacentSiblingOrParentSiblingCaret:()=>sn,$getDepth:()=>$f,$getNearestBlockElementAncestorOrThrow:()=>E_,$getNearestNodeOfType:()=>T_,$getNextRightPreorderNode:()=>S_,$getNextSiblingOrParentSibling:()=>C_,$handleIndentAndOutdent:()=>R_,$insertFirst:()=>k_,$insertNodeToNearestRoot:()=>v_,$insertNodeToNearestRootAtCaret:()=>Pf,$isEditorIsNestedEditor:()=>$_,$lastToFirstIterator:()=>Ha,$restoreEditorState:()=>M_,$reverseDfs:()=>N_,$reverseDfsIterator:()=>Lf,$splitNode:()=>Sd,$unwrapAndFilterDescendants:()=>L_,$unwrapNode:()=>F_,$wrapNodeInElement:()=>A_,CAN_USE_BEFORE_INPUT:()=>c_,CAN_USE_DOM:()=>Df,IS_ANDROID:()=>u_,IS_ANDROID_CHROME:()=>d_,IS_APPLE:()=>f_,IS_APPLE_WEBKIT:()=>g_,IS_CHROME:()=>h_,IS_FIREFOX:()=>bf,IS_IOS:()=>p_,IS_SAFARI:()=>m_,addClassNamesToElement:()=>Wo,calculateZoomLevel:()=>I_,isBlockDomNode:()=>nf,isHTMLAnchorElement:()=>rf,isHTMLElement:()=>hs,isInlineDomNode:()=>Uo,isMimeType:()=>Rf,makeStateWrapper:()=>K_,markSelection:()=>Af,mediaFileReader:()=>__,mergeRegister:()=>rt,objectKlassEquals:()=>D_,positionNodeOnRange:()=>vf,registerNestedElementResolver:()=>O_,removeClassNamesFromElement:()=>ps,selectionAlwaysOnDisplay:()=>l_});function Ns(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var je=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,e_=je&&"documentMode"in document?document.documentMode:null,Of=je&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),t_=je&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),n_=!(!je||!("InputEvent"in window)||e_)&&"getTargetRanges"in new window.InputEvent("input"),o_=je&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),r_=je&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Mf=je&&/Android/.test(navigator.userAgent),za=je&&/^(?=.*Chrome).*/i.test(navigator.userAgent),s_=je&&Mf&&za,i_=je&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Of&&!za;function st(n){return`${n}px`}var a_={attributes:!0,characterData:!0,childList:!0,subtree:!0};function vf(n,e,t){let o=null,r=null,s=null,i=[],a=document.createElement("div");function l(){o===null&&Ns(182),r===null&&Ns(183);let{left:d,top:f}=r.getBoundingClientRect(),h=Sf(n,e);var g,p;a.isConnected||(p=a,(g=r).insertBefore(p,g.firstChild));let m=!1;for(let x=0;x<h.length;x++){let y=h[x],N=i[x]||document.createElement("div"),T=N.style;T.position!=="absolute"&&(T.position="absolute",m=!0);let O=st(y.left-d);T.left!==O&&(T.left=O,m=!0);let E=st(y.top-f);T.top!==E&&(N.style.top=E,m=!0);let A=st(y.width);T.width!==A&&(N.style.width=A,m=!0);let C=st(y.height);T.height!==C&&(N.style.height=C,m=!0),N.parentNode!==a&&(a.append(N),m=!0),i[x]=N}for(;i.length>h.length;)i.pop();m&&t(i)}function c(){r=null,o=null,s!==null&&s.disconnect(),s=null,a.remove();for(let d of i)d.remove();i=[]}a.style.position="relative";let u=n.registerRootListener(function d(){let f=n.getRootElement();if(f===null)return c();let h=f.parentElement;if(!hs(h))return c();c(),o=f,r=h,s=new MutationObserver(g=>{let p=n.getRootElement(),m=p&&p.parentElement;if(p!==o||m!==r)return d();for(let x of g)if(!a.contains(x.target))return l()}),s.observe(h,a_),l()});return()=>{u(),c()}}function Tf(n,e,t){if(n.type!=="text"&&$(e)){let o=e.getDOMSlot(t);return[o.element,o.getFirstChildOffset()+n.offset]}return[ef(t)||t,n.offset]}function Af(n,e){let t=null,o=null,r=null,s=null,i=null,a=null,l=()=>{};function c(u){u.read(()=>{let d=R();if(!D(d))return t=null,r=null,s=null,a=null,l(),void(l=()=>{});let[f,h]=(function(C){let S=C.getStartEndPoints();return C.isBackward()?[S[1],S[0]]:S})(d),g=f.getNode(),p=g.getKey(),m=f.offset,x=h.getNode(),y=x.getKey(),N=h.offset,T=n.getElementByKey(p),O=n.getElementByKey(y),E=t===null||T!==o||m!==r||p!==t.getKey(),A=s===null||O!==i||N!==a||y!==s.getKey();if((E||A)&&T!==null&&O!==null){let C=(function(S,k,F,j,Y,H,te){let ae=(S._window?S._window.document:document).createRange();return ae.setStart(...Tf(k,F,j)),ae.setEnd(...Tf(Y,H,te)),ae})(n,f,g,T,h,x,O);l(),l=vf(n,C,S=>{if(e===void 0)for(let k of S){let F=k.style;F.background!=="Highlight"&&(F.background="Highlight"),F.color!=="HighlightText"&&(F.color="HighlightText"),F.marginTop!==st(-1.5)&&(F.marginTop=st(-1.5)),F.paddingTop!==st(4)&&(F.paddingTop=st(4)),F.paddingBottom!==st(0)&&(F.paddingBottom=st(0))}else e(S)})}t=g,o=T,r=m,s=x,i=O,a=N})}return c(n.getEditorState()),rt(n.registerUpdateListener(({editorState:u})=>c(u)),()=>{l()})}function l_(n,e){let t=null,o=()=>{let r=getSelection(),s=r&&r.anchorNode,i=n.getRootElement();s!==null&&i!==null&&i.contains(s)?t!==null&&(t(),t=null):t===null&&(t=Af(n,e))};return document.addEventListener("selectionchange",o),()=>{t!==null&&t(),document.removeEventListener("selectionchange",o)}}var c_=n_,Df=je,u_=Mf,d_=s_,f_=Of,g_=i_,h_=za,bf=t_,p_=r_,m_=o_;function Rf(n,e){for(let t of e)if(n.type.startsWith(t))return!0;return!1}function __(n,e){let t=n[Symbol.iterator]();return new Promise((o,r)=>{let s=[],i=()=>{let{done:a,value:l}=t.next();if(a)return o(s);let c=new FileReader;c.addEventListener("error",r),c.addEventListener("load",()=>{let u=c.result;typeof u=="string"&&s.push({file:l,result:u}),i()}),Rf(l,e)?c.readAsDataURL(l):i()};i()})}function x_(n,e){return Array.from(kf(n,e))}function y_(n){return n?n.getAdjacentCaret():null}function N_(n,e){return Array.from(Lf(n,e))}function kf(n,e){return If("next",n,e)}function Ef(n,e){let t=sn(St(n,e));return t&&t[0]}function If(n,e,t){let o=Ce(),r=e||o,s=$(r)?De(r,n):St(r,n),i=$f(r),a=t?xa(Ca(St(t,n)))||Ef(t,n):Ef(r,n),l=i;return Da({hasNext:c=>c!==null,initial:s,map:c=>({depth:l,node:c.origin}),step:c=>{if(c.isSameNodeCaret(a))return null;ko(c)&&l++;let u=sn(c);return!u||u[0].isSameNodeCaret(a)?null:(l+=u[1],u[0])}})}function C_(n){let e=sn(St(n,"next"));return e&&[e[0].origin,e[1]]}function $f(n){let e=-1;for(let t=n;t!==null;t=t.getParent())e++;return e}function S_(n){let e=Ca(St(n,"previous")),t=sn(e,"root");return t&&t[0].origin}function Lf(n,e){return If("previous",n,e)}function T_(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function E_(n){let e=Ct(n,t=>$(t)&&!t.isInline());return $(e)||Ns(4,n.__key),e}function O_(n,e,t,o){let r=s=>s instanceof e;return n.registerNodeTransform(e,s=>{let i=(a=>{let l=a.getChildren();for(let d=0;d<l.length;d++){let f=l[d];if(r(f))return null}let c=a,u=a;for(;c!==null;)if(u=c,c=c.getParent(),r(c))return{child:u,parent:c};return null})(s);if(i!==null){let{child:a,parent:l}=i;if(a.is(s)){o(l,s);let c=a.getNextSiblings(),u=c.length;if(l.insertAfter(a),u!==0){let d=t(l);a.insertAfter(d);for(let f=0;f<u;f++)d.append(c[f])}l.canBeEmpty()||l.getChildrenSize()!==0||l.remove()}}})}function M_(n,e){let t=new Map,o=n._pendingEditorState;for(let[s,i]of e._nodeMap)t.set(s,Br(i));o&&(o._nodeMap=t),n._dirtyType=2;let r=e._selection;Ge(r===null?null:r.clone())}function v_(n){let e=R()||Ro(),t;if(D(e))t=Ft(e.focus,"next");else{if(e!=null){let i=e.getNodes(),a=i[i.length-1];a&&(t=St(a,"next"))}t=t||De(Ce(),"previous").getFlipped().insert(se())}let o=Pf(n,t),r=xa(o),s=ko(r)?cn(r):o;return Nd(fd(s)),n.getLatest()}function Pf(n,e,t){let o=Na(e,"next");for(let r=o;r;r=Cd(r,t))o=r;return Yr(o)&&Ns(283),o.insert(n.isInline()?se().append(n):n),Na(St(n.getLatest(),"next"),e.direction)}function A_(n,e){let t=e();return n.replace(t),t.append(n),t}function D_(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}function b_(n,e){let t=[];for(let o=0;o<n.length;o++){let r=e(n[o]);r!==null&&t.push(r)}return t}function R_(n){let e=R();if(!D(e))return!1;let t=new Set,o=e.getNodes();for(let r=0;r<o.length;r++){let s=o[r],i=s.getKey();if(t.has(i))continue;let a=Ct(s,c=>$(c)&&!c.isInline());if(a===null)continue;let l=a.getKey();a.canIndent()&&!t.has(l)&&(t.add(l),n(a))}return t.size>0}function k_(n,e){De(n,"next").insert(e)}var Ua=!(bf||!Df)&&void 0;function I_(n,e=!1){let t=1;if((function(){if(Ua===void 0){let o=document.createElement("div");o.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(o);let r=o.getBoundingClientRect();o.style.setProperty("zoom","2"),Ua=o.getBoundingClientRect().width===r.width,document.body.removeChild(o)}return Ua})()||e)for(;n;)t*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return t}function $_(n){return n._parentEditor!==null}function L_(n,e){return wf(n,e,null)}function wf(n,e,t){let o=!1;for(let r of Ha(n))e(r)?t!==null&&t(r):(o=!0,$(r)&&wf(r,e,t||(s=>r.insertAfter(s))),r.remove());return o}function P_(n,e){let t=[],o=Array.from(n).reverse();for(let r=o.pop();r!==void 0;r=o.pop())if(e(r))t.push(r);else if($(r))for(let s of Ha(r))o.push(s);return t}function w_(n){return Ff(De(n,"next"))}function Ha(n){return Ff(De(n,"previous"))}function Ff(n){return Da({hasNext:xd,initial:n.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function F_(n){Gr(St(n,"next")).splice(1,n.getChildren())}function K_(n){let e=o=>zr(o,n),t=(o,r)=>Jr(o,n,r);return{$get:e,$set:t,accessors:[e,t],makeGetterMethod:()=>function(){return e(this)},makeSetterMethod:()=>function(o){return t(this,o)},stateConfig:n}}var P=Ya,VN=P.$descendantsMatching,qN=P.$dfs,XN=P.$dfsIterator,QN=P.$filter,be=P.$findMatchingParent,ZN=P.$firstToLastIterator,eC=P.$getAdjacentCaret,tC=P.$getAdjacentSiblingOrParentSiblingCaret,nC=P.$getDepth,Cs=P.$getNearestBlockElementAncestorOrThrow,Kf=P.$getNearestNodeOfType,oC=P.$getNextRightPreorderNode,rC=P.$getNextSiblingOrParentSibling,Ho=P.$handleIndentAndOutdent,sC=P.$insertFirst,iC=P.$insertNodeToNearestRoot,Bf=P.$insertNodeToNearestRootAtCaret,aC=P.$isEditorIsNestedEditor,lC=P.$lastToFirstIterator,cC=P.$restoreEditorState,uC=P.$reverseDfs,dC=P.$reverseDfsIterator,fC=P.$splitNode,gC=P.$unwrapAndFilterDescendants,hC=P.$unwrapNode,pC=P.$wrapNodeInElement,mC=P.CAN_USE_BEFORE_INPUT,_C=P.CAN_USE_DOM,xC=P.IS_ANDROID,yC=P.IS_ANDROID_CHROME,NC=P.IS_APPLE,CC=P.IS_APPLE_WEBKIT,SC=P.IS_CHROME,TC=P.IS_FIREFOX,EC=P.IS_IOS,OC=P.IS_SAFARI,Ut=P.addClassNamesToElement,Wf=P.calculateZoomLevel,Ga=P.isBlockDomNode,Ss=P.isHTMLAnchorElement,Pe=P.isHTMLElement,MC=P.isInlineDomNode,vC=P.isMimeType,AC=P.makeStateWrapper,DC=P.markSelection,bC=P.mediaFileReader,Je=P.mergeRegister,Ve=P.objectKlassEquals,RC=P.positionNodeOnRange,kC=P.registerNestedElementResolver,ja=P.removeClassNamesFromElement,IC=P.selectionAlwaysOnDisplay;var Ja={};we(Ja,{$generateHtmlFromNodes:()=>W_,$generateNodesFromDOM:()=>B_});function B_(n,e){let t=of(e)?e.body.childNodes:e.childNodes,o=[],r=[];for(let s of t)if(!zf.has(s.nodeName)){let i=Hf(s,n,r,!1);i!==null&&(o=o.concat(i))}return(function(s){for(let i of s)i.getNextSibling()instanceof Ea&&i.insertAfter(_a());for(let i of s){let a=i.getChildren();for(let l of a)i.insertBefore(l);i.remove()}})(r),o}function W_(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let t=document.createElement("div"),o=Ce().getChildren();for(let r=0;r<o.length;r++)Uf(n,o[r],t,e);return t.innerHTML}function Uf(n,e,t,o=null){let r=o===null||e.isSelected(o),s=$(e)&&e.excludeFromCopy("html"),i=e;o!==null&&B(e)&&(i=ys(o,e,"clone"));let a=$(i)?i.getChildren():[],l=tf(n,i.getType()),c;c=l&&l.exportDOM!==void 0?l.exportDOM(n,i):i.exportDOM(n);let{element:u,after:d}=c;if(!u)return!1;let f=document.createDocumentFragment();for(let h=0;h<a.length;h++){let g=a[h],p=Uf(n,g,f,o);!r&&$(e)&&p&&e.extractWithChild(g,o,"html")&&(r=!0)}if(r&&!s){if((Pe(u)||Aa(u))&&u.append(f),t.append(u),d){let h=d.call(i,u);h&&(Aa(u)?u.replaceChildren(h):u.replaceWith(h))}}else t.append(f);return r}var zf=new Set(["STYLE","SCRIPT"]);function Hf(n,e,t,o,r=new Map,s){let i=[];if(zf.has(n.nodeName))return i;let a=null,l=(function(g,p){let{nodeName:m}=g,x=p._htmlConversions.get(m.toLowerCase()),y=null;if(x!==void 0)for(let N of x){let T=N(g);T!==null&&(y===null||(y.priority||0)<=(T.priority||0))&&(y=T)}return y!==null?y.conversion:null})(n,e),c=l?l(n):null,u=null;if(c!==null){u=c.after;let g=c.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(let[,p]of r)if(a=p(a,s),!a)break;a&&i.push(...Array.isArray(g)?g:[a])}c.forChild!=null&&r.set(n.nodeName,c.forChild)}let d=n.childNodes,f=[],h=(a==null||!$e(a))&&(a!=null&&Bn(a)||o);for(let g=0;g<d.length;g++)f.push(...Hf(d[g],e,t,h,new Map(r),a));return u!=null&&(f=u(f)),Ga(n)&&(f=U_(n,f,h?()=>{let g=new Ea;return t.push(g),g}:se)),a==null?f.length>0?i=i.concat(f):Ga(n)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Uo(g.nextSibling)&&Uo(g.previousSibling)})(n)&&(i=i.concat(_a())):$(a)&&a.append(...f),i}function U_(n,e,t){let o=n.style.textAlign,r=[],s=[];for(let i=0;i<e.length;i++){let a=e[i];if(Bn(a))o&&!a.getFormat()&&a.setFormat(o),r.push(a);else if(s.push(a),i===e.length-1||i<e.length-1&&Bn(e[i+1])){let l=t();l.setFormat(o),l.append(...s),r.push(l),s=[]}}return r}var Yf=Ja,Ts=Yf.$generateHtmlFromNodes,Es=Yf.$generateNodesFromDOM;var qa={};we(qa,{$generateJSONFromSelectedNodes:()=>qf,$generateNodesFromSerializedNodes:()=>Xf,$getClipboardDataFromSelection:()=>Zf,$getHtmlContent:()=>jf,$getLexicalContent:()=>Jf,$insertDataTransferForPlainText:()=>z_,$insertDataTransferForRichText:()=>H_,$insertGeneratedNodes:()=>Va,copyToClipboard:()=>Y_,setLexicalClipboardDataTransfer:()=>eg});function Os(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function jf(n,e=R()){return e==null&&Os(166),D(e)&&e.isCollapsed()||e.getNodes().length===0?"":Ts(n,e)}function Jf(n,e=R()){return e==null&&Os(166),D(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(qf(n,e))}function z_(n,e){let t=n.getData("text/plain")||n.getData("text/uri-list");t!=null&&e.insertRawText(t)}function H_(n,e,t){let o=n.getData("application/x-lexical-editor");if(o)try{let a=JSON.parse(o);if(a.namespace===t._config.namespace&&Array.isArray(a.nodes))return Va(t,Xf(a.nodes),e)}catch(a){console.error(a)}let r=n.getData("text/html"),s=n.getData("text/plain");if(r&&s!==r)try{let a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(l):l})(r),"text/html");return Va(t,Es(t,a),e)}catch(a){console.error(a)}let i=s||n.getData("text/uri-list");if(i!=null)if(D(e)){let a=i.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){let c=R();if(D(c)){let u=a[l];u===`
14
14
  `||u===`\r
15
- `?c.insertParagraph():u===" "?c.insertNodes([Br()]):c.insertText(u)}}}else e.insertRawText(i)}function Ja(n,e,t){n.dispatchCommand(zd,{nodes:e,selection:t})||(t.insertNodes(e),(function(o){if(D(o)&&o.isCollapsed()){let r=o.anchor,s=null,i=Ft(r,"previous");if(i)if(Hr(i))s=i.origin;else{let a=ld(i,De(Ce(),"next").getFlipped());for(let l of a){if(B(l.origin)){s=l.origin;break}if($(l.origin)&&!l.origin.isInline())break}}if(s&&B(s)){let a=s.getFormat(),l=s.getStyle();o.format===a&&o.style===l||(o.format=a,o.style=l,o.dirty=!0)}}})(t))}function jf(n,e,t,o=[]){let r=e===null||t.isSelected(e),s=$(t)&&t.excludeFromCopy("html"),i=t;e!==null&&B(i)&&(i=xs(e,i,"clone"));let a=$(i)?i.getChildren():[],l=(function(c){let u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&Es(58,d.name),$(c)){let f=u.children;Array.isArray(f)||Es(59,d.name)}return u})(i);B(i)&&i.getTextContentSize()===0&&(r=!1);for(let c=0;c<a.length;c++){let u=a[c],d=jf(n,e,u,l.children);!r&&$(t)&&d&&t.extractWithChild(u,e,"clone")&&(r=!0)}if(r&&!s)o.push(l);else if(Array.isArray(l.children))for(let c=0;c<l.children.length;c++){let u=l.children[c];o.push(u)}return r}function Jf(n,e){let t=[],o=Ce().getChildren();for(let r=0;r<o.length;r++)jf(n,e,o[r],t);return{namespace:n._config.namespace,nodes:t}}function Vf(n){let e=[];for(let t=0;t<n.length;t++){let o=n[t],r=_d(o);B(r)&&xf(r),e.push(r)}return e}var zn=null;async function U_(n,e,t){if(zn!==null)return!1;if(e!==null)return new Promise((c,u)=>{n.update(()=>{c(Hf(n,e,t))})});let o=n.getRootElement(),r=n._window||window,s=r.document,i=Ma(r);if(o===null||i===null)return!1;let a=s.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(s.createTextNode("#")),o.append(a);let l=new Range;return l.setStart(a,0),l.setEnd(a,1),i.removeAllRanges(),i.addRange(l),new Promise((c,u)=>{let d=n.registerCommand(Xr,f=>(Ve(f,ClipboardEvent)&&(d(),zn!==null&&(r.clearTimeout(zn),zn=null),c(Hf(n,f,t))),!0),qr);zn=r.setTimeout(()=>{d(),zn=null,c(!1)},50),s.execCommand("copy"),a.remove()})}function Hf(n,e,t){if(t===void 0){let r=Ma(n._window),s=R();if(!s||s.isCollapsed()||!r)return!1;let i=r.anchorNode,a=r.focusNode;if(i!==null&&a!==null&&!rf(n,i,a))return!1;t=Xf(s)}e.preventDefault();let o=e.clipboardData;return o!==null&&(Qf(o,t),!0)}var qf=[["text/html",Yf],["application/x-lexical-editor",Gf]];function Xf(n=R()){let e={"text/plain":n?n.getTextContent():""};if(n){let t=Wr();for(let[o,r]of qf){let s=r(t,n);s!==null&&(e[o]=s)}}return e}function Qf(n,e){for(let[t]of qf)e[t]===void 0&&n.setData(t,"");for(let t in e){let o=e[t];o!==void 0&&n.setData(t,o)}}var it=Va,KC=it.$generateJSONFromSelectedNodes,BC=it.$generateNodesFromSerializedNodes,WC=it.$getClipboardDataFromSelection,UC=it.$getHtmlContent,zC=it.$getLexicalContent,HC=it.$insertDataTransferForPlainText,qa=it.$insertDataTransferForRichText,YC=it.$insertGeneratedNodes,Xa=it.copyToClipboard,GC=it.setLexicalClipboardDataTransfer;var fl={};we(fl,{$createHorizontalRuleNode:()=>dl,$isDecoratorTextNode:()=>fg,$isHorizontalRuleNode:()=>xg,AutoFocusExtension:()=>Y_,ClearEditorExtension:()=>G_,DecoratorTextExtension:()=>Q_,DecoratorTextNode:()=>Go,EditorStateExtension:()=>As,HorizontalRuleExtension:()=>cx,HorizontalRuleNode:()=>dn,INSERT_HORIZONTAL_RULE_COMMAND:()=>ax,InitialStateExtension:()=>mg,LexicalBuilder:()=>jn,NodeSelectionExtension:()=>al,TabIndentationExtension:()=>ux,applyFormatFromStyle:()=>J_,applyFormatToDom:()=>V_,batch:()=>rg,buildEditorFromExtensions:()=>nx,computed:()=>ag,configExtension:()=>us,declarePeerDependency:()=>Xd,defineExtension:()=>Z,effect:()=>Ht,getExtensionDependencyFromEditor:()=>rx,getKnownTypesAndNodes:()=>j_,getPeerDependencyFromEditor:()=>_g,getPeerDependencyFromEditorOrThrow:()=>sx,namedSignals:()=>bs,registerClearEditor:()=>ug,registerTabIndentation:()=>Ng,safeCast:()=>ye,shallowMergeConfig:()=>Wt,signal:()=>Gn,untracked:()=>ol,watchedSignal:()=>cl});var z_=Symbol.for("preact-signals");function Ds(){if(zt>1)return void zt--;let n,e=!1;for(;Yo!==void 0;){let t=Yo;for(Yo=void 0,rl++;t!==void 0;){let o=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&sg(t))try{t.c()}catch(r){e||(n=r,e=!0)}t=o}}if(rl=0,zt--,e)throw n}function rg(n){if(zt>0)return n();zt++;try{return n()}finally{Ds()}}var V,Yo;function ol(n){let e=V;V=void 0;try{return n()}finally{V=e}}var zt=0,rl=0,vs=0;function Zf(n){if(V===void 0)return;let e=n.n;return e===void 0||e.t!==V?(e={i:0,S:n,p:V.s,n:void 0,t:V,e:void 0,x:void 0,r:e},V.s!==void 0&&(V.s.n=e),V.s=e,n.n=e,32&V.f&&n.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=V.s,e.n=void 0,V.s.n=e,V.s=e),e):void 0}function Se(n,e){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function Gn(n,e){return new Se(n,e)}function sg(n){for(let e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function eg(n){for(let e=n.s;e!==void 0;e=e.n){let t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function ig(n){let e,t=n.s;for(;t!==void 0;){let o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}n.s=e}function un(n,e){Se.call(this,void 0),this.x=n,this.s=void 0,this.g=vs-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function ag(n,e){return new un(n,e)}function lg(n){let e=n.u;if(n.u=void 0,typeof e=="function"){zt++;let t=V;V=void 0;try{e()}catch(o){throw n.f&=-2,n.f|=8,ll(n),o}finally{V=t,Ds()}}}function ll(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,lg(n)}function H_(n){if(V!==this)throw new Error("Out-of-order effect");ig(this),V=n,this.f&=-2,8&this.f&&ll(this),Ds()}function Yn(n,e){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}function Ht(n,e){let t=new Yn(n,e);try{t.c()}catch(r){throw t.d(),r}let o=t.d.bind(t);return o[Symbol.dispose]=o,o}function bs(n,e={}){let t={};for(let o in n){let r=e[o],s=Gn(r===void 0?n[o]:r);t[o]=s}return t}Se.prototype.brand=z_,Se.prototype.h=function(){return!0},Se.prototype.S=function(n){let e=this.t;e!==n&&n.e===void 0&&(n.x=e,this.t=n,e!==void 0?e.e=n:ol(()=>{var t;(t=this.W)==null||t.call(this)}))},Se.prototype.U=function(n){if(this.t!==void 0){let e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t,t===void 0&&ol(()=>{var o;(o=this.Z)==null||o.call(this)}))}},Se.prototype.subscribe=function(n){return Ht(()=>{let e=this.value,t=V;V=void 0;try{n(e)}finally{V=t}},{name:"sub"})},Se.prototype.valueOf=function(){return this.value},Se.prototype.toString=function(){return this.value+""},Se.prototype.toJSON=function(){return this.value},Se.prototype.peek=function(){let n=V;V=void 0;try{return this.value}finally{V=n}},Object.defineProperty(Se.prototype,"value",{get(){let n=Zf(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(rl>100)throw new Error("Cycle detected");this.v=n,this.i++,vs++,zt++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Ds()}}}}),un.prototype=new Se,un.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===vs))return!0;if(this.g=vs,this.f|=1,this.i>0&&!sg(this))return this.f&=-2,!0;let n=V;try{eg(this),V=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return V=n,ig(this),this.f&=-2,!0},un.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Se.prototype.S.call(this,n)},un.prototype.U=function(n){if(this.t!==void 0&&(Se.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},un.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(un.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");let n=Zf(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),Yn.prototype.c=function(){let n=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},Yn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,lg(this),eg(this),zt++;let n=V;return V=this,H_.bind(this,n)},Yn.prototype.N=function(){2&this.f||(this.f|=2,this.o=Yo,Yo=this)},Yn.prototype.d=function(){this.f|=8,1&this.f||ll(this)},Yn.prototype.dispose=function(){this.d()};var Y_=Z({build:(n,e,t)=>bs(e),config:ye({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(n,e,t){let o=t.getOutput();return Ht(()=>o.disabled.value?void 0:n.registerRootListener(r=>{n.focus(()=>{let s=document.activeElement;r===null||s!==null&&r.contains(s)||r.focus({preventScroll:!0})},{defaultSelection:o.defaultSelection.peek()})}))}});function cg(){let n=Ce(),e=R(),t=se();n.clear(),n.append(t),e!==null&&t.select(),D(e)&&(e.format=0)}function ug(n,e=cg){return n.registerCommand(Jr,t=>(n.update(e),!0),W)}var G_=Z({build:(n,e,t)=>bs(e),config:ye({$onClear:cg}),name:"@lexical/extension/ClearEditor",register(n,e,t){let{$onClear:o}=t.getOutput();return Ht(()=>ug(n,o.value))}});function j_(n){let e=new Set,t=new Set;for(let o of dg(n)){let r=typeof o=="function"?o:o.replace;e.add(r.getType()),t.add(r)}return{nodes:t,types:e}}function dg(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}var Qa=qd("format",{parse:n=>typeof n=="number"?n:0}),Go=class extends Zr{$config(){return this.config("decorator-text",{extends:Zr,stateConfigs:[{flat:!0,stateConfig:Qa}]})}getFormat(){return Ur(this,Qa)}getFormatFlags(e,t){return ba(this.getFormat(),e,t)}hasFormat(e){let t=jd[e];return(this.getFormat()&t)!==0}setFormat(e){return jr(this,Qa,e)}toggleFormat(e){let t=this.getFormat(),o=ba(t,e,null);return this.setFormat(o)}isInline(){return!0}createDOM(){return document.createElement("span")}updateDOM(){return!1}};function fg(n){return n instanceof Go}function J_(n,e,t){let o=e.fontWeight,r=e.textDecoration.split(" "),s=o==="700"||o==="bold",i=r.includes("line-through"),a=e.fontStyle==="italic",l=r.includes("underline"),c=e.verticalAlign;return s&&!n.hasFormat("bold")&&n.toggleFormat("bold"),i&&!n.hasFormat("strikethrough")&&n.toggleFormat("strikethrough"),a&&!n.hasFormat("italic")&&n.toggleFormat("italic"),l&&!n.hasFormat("underline")&&n.toggleFormat("underline"),c!=="sub"||n.hasFormat("subscript")||n.toggleFormat("subscript"),c!=="super"||n.hasFormat("superscript")||n.toggleFormat("superscript"),t&&!n.hasFormat(t)&&n.toggleFormat(t),n}function V_(n,e,t=X_){for(let[o,r]of Object.entries(t))n.hasFormat(r)&&(e=q_(e,o));return e}function q_(n,e){let t=document.createElement(e);return t.appendChild(n),t}var X_={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},Q_=Z({name:"@lexical/extension/DecoratorText",nodes:()=>[Go],register:(n,e,t)=>n.registerCommand(Tt,o=>{let r=R();if(he(r)||D(r))for(let s of r.getNodes())fg(s)&&s.toggleFormat(o);return!1},ie)});function cl(n,e){let t;return Gn(n(),{unwatched(){t&&(t(),t=void 0)},watched(){this.value=n(),t=e(this)}})}var As=Z({build:n=>cl(()=>n.getEditorState(),e=>n.registerUpdateListener(t=>{e.value=t.editorState})),name:"@lexical/extension/EditorState"});function q(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function gg(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){let t=n,o=e;for(let r in o)t[r]=gg(t[r],o[r]);return n}return e}var ul=0,sl=1,hg=2,Za=3,Os=4,Hn=5,el=6,Ho=7;function tl(n){return n.id===ul}function pg(n){return n.id===hg}function Z_(n){return(function(e){return e.id===sl})(n)||q(305,String(n.id),String(sl)),Object.assign(n,{id:hg})}var ex=new Set,il=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:ul}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Wt;for(let o of this.configs)e=t(e,o);return e}init(e){let t=this.state;pg(t)||q(306,String(t.id));let o={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...o,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},s=(function(a,l,c){return Object.assign(a,{config:l,id:Za,registerState:c})})(t,this.mergeConfigs(),o),i;this.state=s,this.extension.init&&(i=this.extension.init(e,s.config,o)),this.state=(function(a,l,c){return Object.assign(a,{id:Os,initResult:l,registerState:c})})(s,i,r)}build(e){let t=this.state,o;t.id!==Os&&q(307,String(t.id),String(Hn)),this.extension.build&&(o=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>o,getSignal:this.getSignal.bind(this)};this.state=(function(s,i,a){return Object.assign(s,{id:Hn,output:i,registerState:a})})(t,o,r)}register(e,t){this._signal=t;let o=this.state;o.id!==Hn&&q(308,String(o.id),String(Hn));let r=this.extension.register&&this.extension.register(e,o.config,o.registerState);return this.state=(function(s){return Object.assign(s,{id:el})})(o),()=>{let s=this.state;s.id!==Ho&&q(309,String(o.id),String(Ho)),this.state=(function(i){return Object.assign(i,{id:Hn})})(s),r&&r()}}afterRegistration(e){let t=this.state,o;return t.id!==el&&q(310,String(t.id),String(el)),this.extension.afterRegistration&&(o=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(r){return Object.assign(r,{id:Ho})})(t),o}getSignal(){return this._signal===void 0&&q(311),this._signal}getInitResult(){this.extension.init===void 0&&q(312,this.extension.name);let e=this.state;return(function(t){return t.id>=Os})(e)||q(313,String(e.id),String(Os)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return(function(t){return t.id>=Za})(e)||q(314,String(e.id),String(Za)),{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 t===void 0&&q(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&q(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return(function(t){return t.id>=Ho})(e)||q(316,String(e.id),String(Ho)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||ex}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(t){return t.id>=Hn})(e)||q(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},tg={tag:ts};function tx(){let n=Ce();n.isEmpty()&&n.append(se())}var mg=Z({config:ye({setOptions:tg,updateOptions:tg}),init:({$initialEditorState:n=tx})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},o){let r=o.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:s}=r;if(gd(s))n.setEditorState(s,t);else if(typeof s=="function")n.update(()=>{s(n)},e);else if(s&&(typeof s=="string"||typeof s=="object")){let i=n.parseEditorState(s);n.setEditorState(i,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Ud,Wn,wd,Jd,Kd]}),ng=Symbol.for("@lexical/extension/LexicalBuilder");function nx(...n){return jn.fromExtensions(n).buildEditor()}function og(){}function ox(n){throw n}function Ms(n){return Array.isArray(n)?n:[n]}var nl="0.41.0+prod.esm",jn=class n{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=nl,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(e){let t=[Ms(mg)];for(let o of e)t.push(Ms(o));return new n(t)}static maybeFromEditor(e){let t=e[ng];return t&&(t.PACKAGE_VERSION!==nl&&q(292,t.PACKAGE_VERSION,nl),t instanceof n||q(293)),t}static fromEditor(e){let t=n.maybeFromEditor(e);return t===void 0&&q(294),t}constructEditor(){let{$initialEditorState:e,onError:t,...o}=this.buildCreateEditorArgs(),r=Object.assign(ds({...o,...t?{onError:s=>{t(s,r)}}:{}}),{[ng]:this});for(let s of this.sortedExtensionReps())s.build(r);return r}buildEditor(){let e=og;function t(){try{e()}finally{e=og}}let o=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=rt(this.registerEditor(o),()=>o.setRootElement(null)),o}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&q(295,e.name),t}addEdge(e,t,o){let r=this.outgoingConfigEdges.get(e);r?r.set(t,o):this.outgoingConfigEdges.set(e,new Map([[t,o]]));let s=this.incomingEdges.get(t);s?s.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&q(296);let t=Ms(e),[o]=t;typeof o.name!="string"&&q(297,typeof o.name);let r=this.extensionNameMap.get(o.name);if(r!==void 0&&r.extension!==o&&q(298,o.name),!r){r=new il(this,o),this.extensionNameMap.set(o.name,r);let s=this.conflicts.get(o.name);typeof s=="string"&&q(299,o.name,s);for(let i of o.conflictsWith||[])this.extensionNameMap.has(i)&&q(299,o.name,i),this.conflicts.set(i,o.name);for(let i of o.dependencies||[]){let a=Ms(i);this.addEdge(o.name,a[0].name,a.slice(1)),this.addExtension(a)}for(let[i,a]of o.peerDependencies||[])this.addEdge(o.name,i,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(o,r)=>{let s=o.state;if(pg(s))return;let i=o.extension.name;var a;tl(s)||q(300,i,r||"[unknown]"),tl(a=s)||q(304,String(a.id),String(ul)),s=Object.assign(a,{id:sl}),o.state=s;let l=this.outgoingConfigEdges.get(i);if(l)for(let c of l.keys()){let u=this.extensionNameMap.get(c);u&&t(u,i)}s=Z_(s),o.state=s,e.push(o)};for(let o of this.extensionNameMap.values())tl(o.state)&&t(o);for(let o of e)for(let[r,s]of this.outgoingConfigEdges.get(o.extension.name)||[])if(s.length>0){let i=this.extensionNameMap.get(r);if(i)for(let a of s)i.configs.add(a)}for(let[o,...r]of this.roots)if(r.length>0){let s=this.extensionNameMap.get(o.name);s===void 0&&q(301,o.name);for(let i of r)s.configs.add(i)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),o=new AbortController,r=[()=>o.abort()],s=o.signal;for(let i of t){let a=i.register(e,s);a&&r.push(a)}for(let i of t){let a=i.afterRegistration(e);a&&r.push(a)}return rt(...r)}buildCreateEditorArgs(){let e={},t=new Set,o=new Map,r=new Map,s={},i={},a=this.sortedExtensionReps();for(let u of a){let{extension:d}=u;if(d.onError!==void 0&&(e.onError=d.onError),d.disableEvents!==void 0&&(e.disableEvents=d.disableEvents),d.parentEditor!==void 0&&(e.parentEditor=d.parentEditor),d.editable!==void 0&&(e.editable=d.editable),d.namespace!==void 0&&(e.namespace=d.namespace),d.$initialEditorState!==void 0&&(e.$initialEditorState=d.$initialEditorState),d.nodes)for(let f of dg(d)){if(typeof f!="function"){let h=o.get(f.replace);h&&q(302,d.name,f.replace.name,h.extension.name),o.set(f.replace,u)}t.add(f)}if(d.html){if(d.html.export)for(let[f,h]of d.html.export.entries())r.set(f,h);d.html.import&&Object.assign(s,d.html.import)}d.theme&&gg(i,d.theme)}Object.keys(i).length>0&&(e.theme=i),t.size&&(e.nodes=[...t]);let l=Object.keys(s).length>0,c=r.size>0;(l||c)&&(e.html={},l&&(e.html.import=s),c&&(e.html.export=r));for(let u of a)u.init(e);return e.onError||(e.onError=ox),e}};function rx(n,e){let t=jn.fromEditor(n).getExtensionRep(e);return t===void 0&&q(303,e.name),t.getExtensionDependency()}function _g(n,e){let t=jn.fromEditor(n).extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}function sx(n,e){let t=_g(n,e);return t===void 0&&q(291,e),t}var ix=new Set,al=Z({build(n,e,t){let o=t.getDependency(As).output,r=Gn({watchedNodeKeys:new Map}),s=cl(()=>{},()=>Ht(()=>{let i=s.peek(),{watchedNodeKeys:a}=r.value,l,c=!1;o.value.read(()=>{if(R())for(let[u,d]of a.entries()){if(d.size===0){a.delete(u);continue}let f=Kn(u),h=f&&f.isSelected()||!1;c=c||h!==(!!i&&i.has(u)),h&&(l=l||new Set,l.add(u))}}),!c&&l&&i&&l.size===i.size||(s.value=l)}));return{watchNodeKey:function(i){let a=ag(()=>(s.value||ix).has(i)),{watchedNodeKeys:l}=r.peek(),c=l.get(i),u=c!==void 0;return c=c||new Set,c.add(a),u||(l.set(i,c),r.value={watchedNodeKeys:l}),a}}},dependencies:[As],name:"@lexical/extension/NodeSelection"}),ax=Le("INSERT_HORIZONTAL_RULE_COMMAND"),dn=class n extends Zr{static getType(){return"horizontalrule"}static clone(e){return new n(e.__key)}static importJSON(e){return dl().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:lx,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){let t=document.createElement("hr");return Bo(t,e.theme.hr),t}getTextContent(){return`
16
- `}isInline(){return!1}updateDOM(){return!1}};function lx(){return{node:dl()}}function dl(){return sd(dn)}function xg(n){return n instanceof dn}var cx=Z({dependencies:[As,al],name:"@lexical/extension/HorizontalRule",nodes:()=>[dn],register(n,e,t){let{watchNodeKey:o}=t.getDependency(al).output,r=Gn({nodeSelections:new Map}),s=n._config.theme.hrSelected??"selected";return rt(n.registerCommand(Vr,i=>{if(Un(i.target)){let a=dd(i.target);if(xg(a))return(function(l,c=!1){let u=R(),d=l.isSelected(),f=l.getKey(),h;c&&he(u)?h=u:(h=id(),Ge(h)),d?h.delete(f):h.add(f)})(a,i.shiftKey),!0}return!1},ie),n.registerMutationListener(dn,(i,a)=>{rg(()=>{let l=!1,{nodeSelections:c}=r.peek();for(let[u,d]of i.entries())if(d==="destroyed")c.delete(u),l=!0;else{let f=c.get(u),h=n.getElementByKey(u);f?f.domNode.value=h:(l=!0,c.set(u,{domNode:Gn(h),selectedSignal:o(u)}))}l&&(r.value={nodeSelections:c})})}),Ht(()=>{let i=[];for(let{domNode:a,selectedSignal:l}of r.value.nodeSelections.values())i.push(Ht(()=>{let c=a.value;c&&(l.value?Bo(c,s):hs(c,s))}));return rt(...i)}))}});function yg(n){return n.canBeEmpty()}function Ng(n,e,t=yg){return rt(n.registerCommand(ls,o=>{let r=R();if(!D(r))return!1;o.preventDefault();let s=(function(i){if(i.getNodes().filter(f=>Bn(f)&&f.canIndent()).length>0)return!0;let a=i.anchor,l=i.focus,c=l.isBefore(a)?l:a,u=c.getNode(),d=Ns(u);if(d.canIndent()){let f=d.getKey(),h=Fn();if(h.anchor.set(f,0,"element"),h.focus.set(f,0,"element"),h=Bt(h),h.anchor.is(c))return!0}return!1})(r)?o.shiftKey?Ko:Po:ns;return n.dispatchCommand(s,void 0)},W),n.registerCommand(Po,()=>{let o=typeof e=="number"?e:e?e.peek():null,r=R();if(!D(r))return!1;let s=typeof t=="function"?t:t.peek();return zo(i=>{if(s(i)){let a=i.getIndent()+1;(!o||a<o)&&i.setIndent(a)}})},qr))}var ux=Z({build:(n,e,t)=>bs(e),config:ye({$canIndent:yg,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(n,e,t){let{disabled:o,maxIndent:r,$canIndent:s}=t.getOutput();return Ht(()=>{if(!o.value)return Ng(n,r,s)})}});var z=fl,XC=z.$createHorizontalRuleNode,QC=z.$isDecoratorTextNode,ZC=z.$isHorizontalRuleNode,eS=z.AutoFocusExtension,tS=z.ClearEditorExtension,nS=z.DecoratorTextExtension,oS=z.DecoratorTextNode,rS=z.EditorStateExtension,sS=z.HorizontalRuleExtension,iS=z.HorizontalRuleNode,aS=z.INSERT_HORIZONTAL_RULE_COMMAND,lS=z.InitialStateExtension,cS=z.LexicalBuilder,uS=z.NodeSelectionExtension,dS=z.TabIndentationExtension,fS=z.applyFormatFromStyle,gS=z.applyFormatToDom,Cg=z.batch,hS=z.buildEditorFromExtensions,pS=z.computed,mS=z.configExtension,_S=z.declarePeerDependency,xS=z.defineExtension,qe=z.effect,yS=z.getExtensionDependencyFromEditor,NS=z.getKnownTypesAndNodes,Sg=z.getPeerDependencyFromEditor,CS=z.getPeerDependencyFromEditorOrThrow,Et=z.namedSignals,SS=z.registerClearEditor,TS=z.registerTabIndentation,ES=z.safeCast,OS=z.shallowMergeConfig,MS=z.signal,vS=z.untracked,AS=z.watchedSignal;var gl={};we(gl,{DragonExtension:()=>dx,registerDragonSupport:()=>Tg});function Tg(n){let e=window.location.origin,t=o=>{if(o.origin!==e)return;let r=n.getRootElement();if(document.activeElement!==r)return;let s=o.data;if(typeof s=="string"){let i;try{i=JSON.parse(s)}catch{return}if(i&&i.protocol==="nuanria_messaging"&&i.type==="request"){let a=i.payload;if(a&&a.functionId==="makeChanges"){let l=a.args;if(l){let[c,u,d,f,h]=l;n.update(()=>{let g=R();if(D(g)){let p=g.anchor,m=p.getNode(),x=0,y=0;if(B(m)&&c>=0&&u>=0&&(x=c,y=c+u,g.setTextNodeRange(m,x,m,y)),x===y&&d===""||(g.insertRawText(d),m=p.getNode()),B(m)){x=f,y=f+h;let N=m.getTextContentSize();x=x>N?N:x,y=y>N?N:y,g.setTextNodeRange(m,x,m,y)}o.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}var dx=Z({build:(n,e,t)=>Et(e),config:ye({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(n,e,t)=>qe(()=>t.getOutput().disabled.value?void 0:Tg(n))});var Eg=gl,Og=Eg.DragonExtension,kS=Eg.registerDragonSupport;var _l={};we(_l,{$createHeadingNode:()=>Vn,$createQuoteNode:()=>ml,$isHeadingNode:()=>Nx,$isQuoteNode:()=>xx,DRAG_DROP_PASTE:()=>pl,HeadingNode:()=>Xn,QuoteNode:()=>qn,RichTextExtension:()=>Cx,eventFiles:()=>jo,registerRichText:()=>bg});function Mg(n,e){if(document.caretRangeFromPoint!==void 0){let t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){let t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}var fn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,fx=fn&&"documentMode"in document?document.documentMode:null,gx=fn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),hx=!(!fn||!("InputEvent"in window)||fx)&&"getTargetRanges"in new window.InputEvent("input"),px=fn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),vg=fn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,mx=fn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),_x=fn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&gx&&!mx,pl=Le("DRAG_DROP_PASTE_FILE"),qn=class n extends ot{static getType(){return"quote"}static clone(e){return new n(e.__key)}createDOM(e){let t=document.createElement("blockquote");return Ut(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:yx,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Pe(t)){this.isEmpty()&&t.append(document.createElement("br"));let o=this.getFormatType();o&&(t.style.textAlign=o);let r=this.getDirection();r&&(t.dir=r)}return{element:t}}static importJSON(e){return ml().updateFromJSON(e)}insertNewAfter(e,t){let o=se(),r=this.getDirection();return o.setDirection(r),this.insertAfter(o,t),o}collapseAtStart(){let e=se();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function ml(){return Nt(new qn)}function xx(n){return n instanceof qn}var Xn=class n extends ot{__tag;static getType(){return"heading"}static clone(e){return new n(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,o=document.createElement(t),r=e.theme.heading;if(r!==void 0){let s=r[t];Ut(o,s)}return o}updateDOM(e,t,o){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Jn,priority:0}),h2:e=>({conversion:Jn,priority:0}),h3:e=>({conversion:Jn,priority:0}),h4:e=>({conversion:Jn,priority:0}),h5:e=>({conversion:Jn,priority:0}),h6:e=>({conversion:Jn,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&Ag(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Ag(e)?{conversion:t=>({node:Vn("h1")}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Pe(t)){this.isEmpty()&&t.append(document.createElement("br"));let o=this.getFormatType();o&&(t.style.textAlign=o);let r=this.getDirection();r&&(t.dir=r)}return{element:t}}static importJSON(e){return Vn(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 o=e?e.anchor.offset:0,r=this.getLastDescendant(),s=!r||e&&e.anchor.key===r.getKey()&&o===r.getTextContentSize()||!e?se():Vn(this.getTag()),i=this.getDirection();if(s.setDirection(i),this.insertAfter(s,t),o===0&&!this.isEmpty()&&e){let a=se();a.select(),this.replace(a,!0)}return s}collapseAtStart(){let e=this.isEmpty()?se():Vn(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function Ag(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function Jn(n){let e=n.nodeName.toLowerCase(),t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Vn(e),n.style!==null&&(Da(n,t),t.setFormat(n.style.textAlign))),{node:t}}function yx(n){let e=ml();return n.style!==null&&(e.setFormat(n.style.textAlign),Da(n,e)),{node:e}}function Vn(n="h1"){return Nt(new Xn(n))}function Nx(n){return n instanceof Xn}function jo(n){let e=null;if(Ve(n,DragEvent)?e=n.dataTransfer:Ve(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];let t=e.types,o=t.includes("Files"),r=t.includes("text/html")||t.includes("text/plain");return[o,Array.from(e.files),r]}function Dg(n){let e=nt(n);return an(e)}function hl(n){for(let e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function bg(n){return Je(n.registerCommand(Vr,e=>{let t=R();return!!he(t)&&(t.clear(),!0)},W),n.registerCommand(Qr,e=>{let t=R();return D(t)?(t.deleteCharacter(e),!0):!!he(t)&&(t.deleteNodes(),!0)},W),n.registerCommand(vd,e=>{let t=R();return!!D(t)&&(t.deleteWord(e),!0)},W),n.registerCommand(Md,e=>{let t=R();return!!D(t)&&(t.deleteLine(e),!0)},W),n.registerCommand(Ed,e=>{let t=R();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;let o=e.dataTransfer;if(o!=null)qa(o,t,n);else if(D(t)){let r=e.data;return r&&t.insertText(r),!0}}return!0},W),n.registerCommand(Wd,()=>{let e=R();return!!D(e)&&(e.removeText(),!0)},W),n.registerCommand(Tt,e=>{let t=R();return!!D(t)&&(t.formatText(e),!0)},W),n.registerCommand(Rd,e=>{let t=R();if(!D(t)&&!he(t))return!1;let o=t.getNodes();for(let r of o){let s=be(r,i=>$(i)&&!i.isInline());s!==null&&s.setFormat(e)}return!0},W),n.registerCommand(Ea,e=>{let t=R();return!!D(t)&&(t.insertLineBreak(e),!0)},W),n.registerCommand(wo,()=>{let e=R();return!!D(e)&&(e.insertParagraph(),!0)},W),n.registerCommand(ns,()=>{let e=Br(),t=R();return D(t)&&(e.setFormat(t.format),e.setStyle(t.style)),zr([e]),!0},W),n.registerCommand(Po,()=>zo(e=>{let t=e.getIndent();e.setIndent(t+1)}),W),n.registerCommand(Ko,()=>zo(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),W),n.registerCommand(ss,e=>{let t=R();if(he(t)){let o=t.getNodes();if(o.length>0)return e.preventDefault(),o[0].selectPrevious(),!0}else if(D(t)){let o=xa(t.focus,!0);if(!e.shiftKey&&an(o)&&!o.isIsolated()&&!o.isInline())return o.selectPrevious(),e.preventDefault(),!0}return!1},W),n.registerCommand(os,e=>{let t=R();if(he(t)){let o=t.getNodes();if(o.length>0)return e.preventDefault(),o[0].selectNext(0,0),!0}else if(D(t)){if((function(r){let s=r.focus;return s.key==="root"&&s.offset===Ce().getChildrenSize()})(t))return e.preventDefault(),!0;let o=xa(t.focus,!1);if(!e.shiftKey&&an(o)&&!o.isIsolated()&&!o.isInline())return o.selectNext(),e.preventDefault(),!0}return!1},W),n.registerCommand(rs,e=>{let t=R();if(he(t)){let o=t.getNodes();if(o.length>0)return e.preventDefault(),wa(o[0])?o[0].selectNext(0,0):o[0].selectPrevious(),!0}if(!D(t))return!1;if(Ka(t,!0)){let o=e.shiftKey;return e.preventDefault(),Fa(t,o,!0),!0}return!1},W),n.registerCommand(Id,e=>{let t=R();if(he(t)){let r=t.getNodes();if(r.length>0)return e.preventDefault(),wa(r[0])?r[0].selectPrevious():r[0].selectNext(0,0),!0}if(!D(t))return!1;let o=e.shiftKey;return!!Ka(t,!1)&&(e.preventDefault(),Fa(t,o,!1),!0)},W),n.registerCommand($d,e=>{if(Dg(e.target))return!1;let t=R();if(D(t)){if((function(o){if(!o.isCollapsed())return!1;let{anchor:r}=o;if(r.offset!==0)return!1;let s=r.getNode();if(ln(s))return!1;let i=Ns(s);return i.getIndent()>0&&(i.is(s)||s.is(i.getFirstDescendant()))})(t))return e.preventDefault(),n.dispatchCommand(Ko,void 0);if(vg&&navigator.language==="ko-KR")return!1}else if(!he(t))return!1;return e.preventDefault(),n.dispatchCommand(Qr,!0)},W),n.registerCommand(Ld,e=>{if(Dg(e.target))return!1;let t=R();return!(!D(t)&&!he(t))&&(e.preventDefault(),n.dispatchCommand(Qr,!1))},W),n.registerCommand(Pd,e=>{let t=R();if(!D(t))return!1;if(hl(t),e!==null){if((vg||px||_x)&&hx)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(Ea,!1)}return n.dispatchCommand(wo,void 0)},W),n.registerCommand(is,()=>{let e=R();return!!D(e)&&(n.blur(),!0)},W),n.registerCommand(bd,e=>{let[,t]=jo(e);if(t.length>0){let r=Mg(e.clientX,e.clientY);if(r!==null){let{offset:s,node:i}=r,a=nt(i);if(a!==null){let l=Fn();if(B(a))l.anchor.set(a.getKey(),s,"text"),l.focus.set(a.getKey(),s,"text");else{let u=a.getParentOrThrow().getKey(),d=a.getIndexWithinParent()+1;l.anchor.set(u,d,"element"),l.focus.set(u,d,"element")}let c=Bt(l);Ge(c)}n.dispatchCommand(pl,t)}return e.preventDefault(),!0}let o=R();return!!D(o)},W),n.registerCommand(Dd,e=>{let[t]=jo(e),o=R();return!(t&&!D(o))},W),n.registerCommand(Ad,e=>{let[t]=jo(e),o=R();if(t&&!D(o))return!1;let r=Mg(e.clientX,e.clientY);if(r!==null){let s=nt(r.node);an(s)&&e.preventDefault()}return!0},W),n.registerCommand(Hd,()=>(Gr(),!0),W),n.registerCommand(Xr,e=>(Xa(n,Ve(e,ClipboardEvent)?e:null),!0),W),n.registerCommand(Od,e=>((async function(t,o){await Xa(o,Ve(t,ClipboardEvent)?t:null),o.update(()=>{let r=R();D(r)?r.removeText():he(r)&&r.getNodes().forEach(s=>s.remove())})})(e,n),!0),W),n.registerCommand(cs,e=>{let[,t,o]=jo(e);return t.length>0&&!o?(n.dispatchCommand(pl,t),!0):Un(e.target)&&of(e.target)?!1:R()!==null&&((function(r,s){r.preventDefault(),s.update(()=>{let i=R(),a=Ve(r,InputEvent)||Ve(r,KeyboardEvent)?null:r.clipboardData;a!=null&&i!==null&&qa(a,i,s)},{tag:Fd})})(e,n),!0)},W),n.registerCommand(as,e=>{let t=R();return D(t)&&hl(t),!1},W),n.registerCommand(ls,e=>{let t=R();return D(t)&&hl(t),!1},W))}var Cx=Z({conflictsWith:["@lexical/plain-text"],dependencies:[Og],name:"@lexical/rich-text",nodes:()=>[Xn,qn],register:bg});var at=_l,Rg=at.$createHeadingNode,kg=at.$createQuoteNode,KS=at.$isHeadingNode,BS=at.$isQuoteNode,WS=at.DRAG_DROP_PASTE,Ig=at.HeadingNode,$g=at.QuoteNode,US=at.RichTextExtension,zS=at.eventFiles,Lg=at.registerRichText;var Sl={};we(Sl,{$createListItemNode:()=>Re,$createListNode:()=>Oe,$getListDepth:()=>Rs,$handleListInsertParagraph:()=>Gg,$insertList:()=>Jo,$isListItemNode:()=>U,$isListNode:()=>K,$removeList:()=>Cl,CheckListExtension:()=>Dx,INSERT_CHECK_LIST_COMMAND:()=>jg,INSERT_ORDERED_LIST_COMMAND:()=>Xg,INSERT_UNORDERED_LIST_COMMAND:()=>qg,ListExtension:()=>th,ListItemNode:()=>Gt,ListNode:()=>hn,REMOVE_LIST_COMMAND:()=>Qg,UPDATE_LIST_START_COMMAND:()=>Vg,insertList:()=>vx,registerCheckList:()=>Jg,registerList:()=>Zg,registerListStrictIndentTransform:()=>eh,removeList:()=>Ax});function Yt(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Rs(n){let e=1,t=n.getParent();for(;t!=null;){if(U(t)){let o=t.getParent();if(K(o)){e++,t=o.getParent();continue}Yt(40)}return e}return e}function xl(n){let e=n.getParent();K(e)||Yt(40);let t=e;for(;t!==null;)t=t.getParent(),K(t)&&(e=t);return e}function zg(n){let e=[],t=n.getChildren().filter(U);for(let o=0;o<t.length;o++){let r=t[o],s=r.getFirstChild();K(s)?e=e.concat(zg(s)):e.push(r)}return e}function lt(n){return U(n)&&K(n.getFirstChild())}function Pg(n){return Re().append(n)}function Hg(n,e){return U(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function Jo(n){let e=R();if(e!==null){let t=e.getNodes();if(D(e)){let r=e.getStartEndPoints();r===null&&Yt(143);let[s]=r,i=s.getNode(),a=i.getParent();if($e(i)){let l=i.getFirstChild();if(l)t=l.selectStart().getNodes();else{let c=se();i.append(c),t=c.select().getNodes()}}else if(Hg(i,t)){let l=Oe(n);if($e(a)){i.replace(l);let c=Re();$(i)&&(c.setFormat(i.getFormatType()),c.setIndent(i.getIndent())),l.append(c)}else if(U(i)){let c=i.getParentOrThrow();gn(l,c.getChildren()),c.replace(l)}return}}let o=new Set;for(let r=0;r<t.length;r++){let s=t[r];if($(s)&&s.isEmpty()&&!U(s)&&!o.has(s.getKey())){wg(s,n);continue}let i=ko(s)?s.getParent():U(s)&&s.isEmpty()?s:null;for(;i!=null;){let a=i.getKey();if(K(i)){if(!o.has(a)){let l=Oe(n);gn(l,i.getChildren()),i.replace(l),o.add(a)}break}{let l=i.getParent();if($e(l)&&!o.has(a)){o.add(a),wg(i,n);break}i=l}}}}}function gn(n,e){n.splice(n.getChildrenSize(),0,e)}function wg(n,e){if(K(n))return n;let t=n.getPreviousSibling(),o=n.getNextSibling(),r=Re(),s;if(gn(r,n.getChildren()),K(t)&&e===t.getListType())t.append(r),K(o)&&e===o.getListType()&&(gn(t,o.getChildren()),o.remove()),s=t;else if(K(o)&&e===o.getListType())o.getFirstChildOrThrow().insertBefore(r),s=o;else{let a=Oe(e);a.append(r),n.replace(a),s=a}r.setFormat(n.getFormatType()),r.setIndent(n.getIndent());let i=R();return D(i)&&(s.getKey()===i.anchor.key&&i.anchor.set(r.getKey(),i.anchor.offset,"element"),s.getKey()===i.focus.key&&i.focus.set(r.getKey(),i.focus.offset,"element")),n.remove(),s}function Nl(n,e){let t=n.getLastChild(),o=e.getFirstChild();t&&o&&lt(t)&&lt(o)&&(Nl(t.getFirstChild(),o.getFirstChild()),o.remove());let r=e.getChildren();r.length>0&&n.append(...r),e.remove()}function Cl(){let n=R();if(D(n)){let e=new Set,t=n.getNodes(),o=n.anchor.getNode();if(Hg(o,t))e.add(xl(o));else for(let r=0;r<t.length;r++){let s=t[r];if(ko(s)){let i=wf(s,Gt);i!=null&&e.add(xl(i))}}for(let r of e){let s=r,i=zg(r);for(let a of i){let l=se().setTextStyle(n.style).setTextFormat(n.format);gn(l,a.getChildren()),s.insertAfter(l),s=l,a.__key===n.anchor.key&&Io(n.anchor,cn(De(l,"next"))),a.__key===n.focus.key&&Io(n.focus,cn(De(l,"next"))),a.remove()}r.remove()}}}function Yg(n){let e=n.getListType()!=="check",t=n.getStart();for(let o of n.getChildren())U(o)&&(o.getValue()!==t&&o.setValue(t),e&&o.getLatest().__checked!=null&&o.setChecked(void 0),K(o.getFirstChild())||t++)}function Sx(n){let e=new Set;if(lt(n)||e.has(n.getKey()))return;let t=n.getParent(),o=n.getNextSibling(),r=n.getPreviousSibling();if(lt(o)&&lt(r)){let s=r.getFirstChild();if(K(s)){s.append(n);let i=o.getFirstChild();K(i)&&(gn(s,i.getChildren()),o.remove(),e.add(o.getKey()))}}else if(lt(o)){let s=o.getFirstChild();if(K(s)){let i=s.getFirstChild();i!==null&&i.insertBefore(n)}}else if(lt(r)){let s=r.getFirstChild();K(s)&&s.append(n)}else if(K(t)){let s=Re().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),i=Oe(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());s.append(i),i.append(n),r?r.insertAfter(s):o?o.insertBefore(s):t.append(s)}}function Tx(n){if(lt(n))return;let e=n.getParent(),t=e?e.getParent():void 0;if(K(t?t.getParent():void 0)&&U(t)&&K(e)){let o=e?e.getFirstChild():void 0,r=e?e.getLastChild():void 0;if(n.is(o))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(r))t.insertAfter(n),e.isEmpty()&&t.remove();else{let s=e.getListType(),i=Re(),a=Oe(s);i.append(a),n.getPreviousSiblings().forEach(u=>a.append(u));let l=Re(),c=Oe(s);l.append(c),gn(c,n.getNextSiblings()),t.insertBefore(i),t.insertAfter(l),t.replace(n)}}}function Gg(n=!1){let e=R();if(!D(e)||!e.isCollapsed())return!1;let t=e.anchor.getNode(),o=null;if(U(t)&&t.getChildrenSize()===0)o=t;else if(B(t)){let c=t.getParent();U(c)&&c.getChildren().every(u=>B(u)&&u.getTextContent().trim()==="")&&(o=c)}if(o===null)return!1;let r=xl(o),s=o.getParent();K(s)||Yt(40);let i=s.getParent(),a;if($e(i))a=se(),r.insertAfter(a);else{if(!U(i))return!1;a=Re(),i.insertAfter(a)}a.setTextStyle(e.style).setTextFormat(e.format).select();let l=o.getNextSiblings();if(l.length>0){let c=n?(function(d,f){return d.getStart()+f.getIndexWithinParent()})(s,o):1,u=Oe(s.getListType(),c);if(U(a)){let d=Re();d.append(u),a.insertAfter(d)}else a.insertAfter(u);u.append(...l)}return(function(c){let u=c;for(;u.getNextSibling()==null&&u.getPreviousSibling()==null;){let d=u.getParent();if(d==null||!U(d)&&!K(d))break;u=d}u.remove()})(o),!0}var Gt=class extends ot{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;let t=e.getParent();K(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:ot,importDOM:Oa({li:()=>({conversion:Ex,priority:0})})})}constructor(e=1,t=void 0,o){super(o),this.__value=e===void 0?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,o){(function(i,a,l){let c=a.getParent();!K(c)||c.getListType()!=="check"||K(a.getFirstChild())?(i.removeAttribute("role"),i.removeAttribute("tabIndex"),i.removeAttribute("aria-checked")):(i.setAttribute("role","checkbox"),i.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||i.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,(function(i,a,l){let c=[],u=[],d=a.list,f=d?d.listitem:void 0,h;if(d&&d.nested&&(h=d.nested.listitem),f!==void 0&&c.push(...Uo(f)),d){let g=l.getParent(),p=K(g)&&g.getListType()==="check",m=l.getChecked();p&&!m||u.push(d.listitemUnchecked),p&&m||u.push(d.listitemChecked),p&&c.push(m?d.listitemChecked:d.listitemUnchecked)}if(h!==void 0){let g=Uo(h);l.getChildren().some(p=>K(p))?c.push(...g):u.push(...g)}u.length>0&&Ga(i,...u),c.length>0&&Ut(i,...c)})(t,o.theme,this);let r=e?e.__style:"",s=this.__style;r!==s&&(s===""?t.removeAttribute("style"):t.style.cssText=s),(function(i,a,l){let c=Ba(a.__textStyle);for(let u in c)i.style.setProperty(`--listitem-marker-${u}`,c[u]);if(l)for(let u in Ba(l.__textStyle))u in c||i.style.removeProperty(`--listitem-marker-${u}`)})(t,this,e)}updateDOM(e,t,o){let r=t;return this.updateListItemDOM(e,r,o),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),o=this.getFormatType();o&&(t.style.textAlign=o);let r=this.getDirection();return r&&(t.dir=r),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let o=e[t];if($(o)&&this.canMergeWith(o)){let r=o.getChildren();this.append(...r),o.remove()}else super.append(o)}return this}replace(e,t){if(U(e))return super.replace(e);this.setIndent(0);let o=this.getParentOrThrow();if(!K(o))return e;if(o.__first===this.getKey())o.insertBefore(e);else if(o.__last===this.getKey())o.insertAfter(e);else{let r=Oe(o.getListType()),s=this.getNextSibling();for(;s;){let i=s;s=s.getNextSibling(),r.append(i)}o.insertAfter(e),e.insertAfter(r)}return t&&($(e)||Yt(139),this.getChildren().forEach(r=>{e.append(r)})),this.remove(),o.getChildrenSize()===0&&o.remove(),e}insertAfter(e,t=!0){let o=this.getParentOrThrow();if(K(o)||Yt(39),U(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(o.insertAfter(e,t),r.length!==0){let s=Oe(o.getListType());r.forEach(i=>s.append(i)),e.insertAfter(s,t)}return e}remove(e){let t=this.getPreviousSibling(),o=this.getNextSibling();super.remove(e),t&&o&&lt(t)&&lt(o)&&(Nl(t.getFirstChild(),o.getFirstChild()),o.remove())}insertNewAfter(e,t=!0){let o=Re().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(o,t),o}collapseAtStart(e){let t=se();this.getChildren().forEach(i=>t.append(i));let o=this.getParentOrThrow(),r=o.getParentOrThrow(),s=U(r);if(o.getChildrenSize()===1)if(s)o.remove(),r.select();else{o.insertBefore(t),o.remove();let i=e.anchor,a=e.focus,l=t.getKey();i.type==="element"&&i.getNode().is(this)&&i.set(l,i.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else o.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=this.getLatest(),t,o=this.getParent();return K(o)&&(t=o.getListType()),t==="check"?!!e.__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(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),o=0;for(;U(t);)t=t.getParentOrThrow().getParentOrThrow(),o++;return o}setIndent(e){typeof e!="number"&&Yt(117),(e=Math.floor(e))>=0||Yt(199);let t=this.getIndent();for(;t!==e;)t<e?(Sx(this),t++):(Tx(this),t--);return this}canInsertAfter(e){return U(e)}canReplaceWith(e){return U(e)}canMergeWith(e){return U(e)||pd(e)}extractWithChild(e,t){if(!D(t))return!1;let o=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(o)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Oe("bullet")}canMergeWhenEmpty(){return!0}};function Ex(n){if(n.classList.contains("task-list-item")){for(let t of n.children)if(t.tagName==="INPUT")return Fg(t)}if(n.classList.contains("joplin-checkbox")){for(let t of n.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&t.children[0].tagName==="INPUT")return Fg(t.children[0])}let e=n.getAttribute("aria-checked");return{node:Re(e==="true"||e!=="false"&&void 0)}}function Fg(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:Re(n.hasAttribute("checked"))}}function Re(n){return Nt(new Gt(void 0,n))}function U(n){return n instanceof Gt}var hn=class extends ot{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){let o=t.getNextSibling();K(o)&&t.getListType()===o.getListType()&&Nl(t,o)})(e),Yg(e)},extends:ot,importDOM:Oa({ol:()=>({conversion:Bg,priority:0}),ul:()=>({conversion:Bg,priority:0})})})}constructor(e="number",t=1,o){super(o);let r=Mx[e]||e;this.__listType=r,this.__tag=r==="number"?"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=e==="number"?"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 o=this.__tag,r=document.createElement(o);return this.__start!==1&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,Kg(r,e.theme,this),r}updateDOM(e,t,o){return e.__tag!==this.__tag||e.__listType!==this.__listType||(Kg(t,o.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 Pe(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&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,o){let r=o;for(let s=0;s<o.length;s++){let i=o[s];U(i)||(r===o&&(r=[...o]),r[s]=Re().append(!$(i)||K(i)||i.isInline()?i:Kt(i.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return U(e)}};function Kg(n,e,t){let o=[],r=[],s=e.list;if(s!==void 0){let i=s[`${t.__tag}Depth`]||[],a=Rs(t)-1,l=a%i.length,c=i[l],u=s[t.__tag],d,f=s.nested,h=s.checklist;if(f!==void 0&&f.list&&(d=f.list),u!==void 0&&o.push(u),h!==void 0&&t.__listType==="check"&&o.push(h),c!==void 0){o.push(...Uo(c));for(let g=0;g<i.length;g++)g!==l&&r.push(t.__tag+g)}if(d!==void 0){let g=Uo(d);a>1?o.push(...g):r.push(...g)}}r.length>0&&Ga(n,...r),o.length>0&&Ut(n,...o)}function Ox(n){let e=[];for(let t=0;t<n.length;t++){let o=n[t];if(U(o)){e.push(o);let r=o.getChildren();r.length>1&&r.forEach(s=>{K(s)&&e.push(Pg(s))})}else e.push(Pg(o))}return e}function Bg(n){let e=n.nodeName.toLowerCase(),t=null;return e==="ol"?t=Oe("number",n.start):e==="ul"&&(t=(function(o){if(o.getAttribute("__lexicallisttype")==="check"||o.classList.contains("contains-task-list")||o.getAttribute("data-is-checklist")==="1")return!0;for(let r of o.childNodes)if(Pe(r)&&r.hasAttribute("aria-checked"))return!0;return!1})(n)?Oe("check"):Oe("bullet")),{after:Ox,node:t}}var Mx={ol:"number",ul:"bullet"};function Oe(n="number",e=1){return Nt(new hn(n,e))}function K(n){return n instanceof hn}var jg=Le("INSERT_CHECK_LIST_COMMAND");function Jg(n,e){let t=e&&e.disableTakeFocusOnClick||!1,o=s=>{(function(i,a){Wg(i,()=>{if(Pe(i.target)){let l=i.target,c=fs(l);c!=null&&c.isEditable()&&c.update(()=>{let u=nt(l);U(u)&&(a?(pa(Gd),pa(Yd)):l.focus(),u.toggleChecked())})}})})(s,t)},r=s=>{(function(i,a){Wg(i,()=>{i.preventDefault(),a&&i.stopPropagation()})})(s,t)};return Je(n.registerCommand(jg,()=>(Jo("check"),!0),ie),n.registerCommand(os,s=>Ug(s,n,!1),ie),n.registerCommand(ss,s=>Ug(s,n,!0),ie),n.registerCommand(is,()=>{if(yl()!=null){let s=n.getRootElement();return s?.focus(),!0}return!1},ie),n.registerCommand(as,s=>{let i=yl();return!(i==null||!n.isEditable())&&(n.update(()=>{let a=nt(i);U(a)&&(s.preventDefault(),a.toggleChecked())}),!0)},ie),n.registerCommand(rs,s=>n.getEditorState().read(()=>{let i=R();if(D(i)&&i.isCollapsed()){let{anchor:a}=i,l=a.type==="element";if(l||a.offset===0){let c=a.getNode(),u=be(c,d=>$(d)&&!d.isInline());if(U(u)){let d=u.getParent();if(K(d)&&d.getListType()==="check"&&(l||u.getFirstDescendant()===c)){let f=n.getElementByKey(u.__key);if(f!=null&&document.activeElement!==f)return f.focus(),s.preventDefault(),!0}}}}return!1}),ie),n.registerRootListener((s,i)=>{s!==null&&(s.addEventListener("click",o),s.addEventListener("pointerdown",r,{capture:!0}),s.addEventListener("mousedown",r,{capture:!0}),s.addEventListener("touchstart",r,{capture:!0,passive:!1})),i!==null&&(i.removeEventListener("click",o),i.removeEventListener("pointerdown",r,{capture:!0}),i.removeEventListener("mousedown",r,{capture:!0}),i.removeEventListener("touchstart",r,{capture:!0}))}))}function Wg(n,e){let t=n.target;if(!Pe(t))return;let o=t.firstChild;if(Pe(o)&&(o.tagName==="UL"||o.tagName==="OL"))return;let r=t.parentNode;if(!r||r.__lexicalListType!=="check")return;let s=null,i=null;if("clientX"in n)s=n.clientX;else if("touches"in n){let f=n.touches;f.length>0&&(s=f[0].clientX,i="touch")}if(s==null)return;let a=t.getBoundingClientRect(),l=s/Kf(t),c=window.getComputedStyle?window.getComputedStyle(t,"::before"):{width:"0px"},u=parseFloat(c.width),d=i==="touch"||n.pointerType==="touch"?32:0;(t.dir==="rtl"?l<a.right+d&&l>a.right-u-d:l>a.left-d&&l<a.left+u+d)&&e()}function yl(){let n=document.activeElement;return Pe(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function Ug(n,e,t){let o=yl();return o!=null&&e.update(()=>{let r=nt(o);if(!U(r))return;let s=(function(i,a){let l=a?i.getPreviousSibling():i.getNextSibling(),c=i;for(;l==null&&U(c);)c=c.getParentOrThrow().getParent(),c!=null&&(l=a?c.getPreviousSibling():c.getNextSibling());for(;U(l);){let u=a?l.getLastChild():l.getFirstChild();if(!K(u))return l;l=a?u.getLastChild():u.getFirstChild()}return null})(r,t);if(s!=null){s.selectStart();let i=e.getElementByKey(s.__key);i!=null&&(n.preventDefault(),setTimeout(()=>{i.focus()},0))}}),!1}var Vg=Le("UPDATE_LIST_START_COMMAND"),qg=Le("INSERT_UNORDERED_LIST_COMMAND"),Xg=Le("INSERT_ORDERED_LIST_COMMAND"),Qg=Le("REMOVE_LIST_COMMAND");function Zg(n,e){return Je(n.registerCommand(Xg,()=>(Jo("number"),!0),ie),n.registerCommand(Vg,t=>{let{listNodeKey:o,newStart:r}=t,s=Kn(o);return!!K(s)&&(s.getListType()==="number"&&(s.setStart(r),Yg(s)),!0)},ie),n.registerCommand(qg,()=>(Jo("bullet"),!0),ie),n.registerCommand(Qg,()=>(Cl(),!0),ie),n.registerCommand(wo,()=>Gg(!!(e&&e.restoreNumbering)),ie),n.registerNodeTransform(Gt,t=>{let o=t.getFirstChild();if(o){if(B(o)){let r=o.getStyle(),s=o.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==s&&t.setTextFormat(s)}}else{let r=R();D(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),n.registerNodeTransform(Wn,t=>{let o=t.getParent();if(U(o)&&t.is(o.getFirstChild())){let r=t.getStyle(),s=t.getFormat();r===o.getTextStyle()&&s===o.getTextFormat()||o.setTextStyle(r).setTextFormat(s)}}))}function eh(n){let e=t=>{let o=t.getParent();if(K(t.getFirstChild())||!K(o))return;let r=be(t,s=>U(s)&&K(s.getParent())&&U(s.getPreviousSibling()));if(r===null&&t.getIndent()>0)t.setIndent(0);else if(U(r)){let s=r.getPreviousSibling();if(U(s)){let i=(function(l){let c=l,u=c.getFirstChild();for(;K(u);){let d=u.getLastChild();if(!U(d))break;c=d,u=c.getFirstChild()}return c})(s),a=i.getParent();if(K(a)){let l=Rs(a);l+1<Rs(o)&&t.setIndent(l)}}}};return n.registerNodeTransform(hn,t=>{let o=[t];for(;o.length>0;){let r=o.shift();if(K(r)){for(let s of r.getChildren())if(U(s)){e(s);let i=s.getFirstChild();K(i)&&o.push(i)}}}})}function vx(n,e){n.update(()=>Jo(e))}function Ax(n){n.update(()=>Cl())}var th=Z({build:(n,e,t)=>Et(e),config:ye({hasStrictIndent:!1,shouldPreserveNumbering:!1}),name:"@lexical/list/List",nodes:()=>[hn,Gt],register(n,e,t){let o=t.getOutput();return Je(qe(()=>Zg(n,{restoreNumbering:o.shouldPreserveNumbering.value})),qe(()=>o.hasStrictIndent.value?eh(n):void 0))}}),Dx=Z({config:ye({disableTakeFocusOnClick:!1}),dependencies:[th],name:"@lexical/list/CheckList",register:Jg});var ne=Sl,VS=ne.$createListItemNode,qS=ne.$createListNode,XS=ne.$getListDepth,QS=ne.$handleListInsertParagraph,ZS=ne.$insertList,eT=ne.$isListItemNode,tT=ne.$isListNode,nT=ne.$removeList,oT=ne.CheckListExtension,rT=ne.INSERT_CHECK_LIST_COMMAND,nh=ne.INSERT_ORDERED_LIST_COMMAND,oh=ne.INSERT_UNORDERED_LIST_COMMAND,sT=ne.ListExtension,rh=ne.ListItemNode,sh=ne.ListNode,iT=ne.REMOVE_LIST_COMMAND,aT=ne.UPDATE_LIST_START_COMMAND,lT=ne.insertList,cT=ne.registerCheckList,ih=ne.registerList,uT=ne.registerListStrictIndentTransform,dT=ne.removeList;var vl={};we(vl,{$createAutoLinkNode:()=>ks,$createLinkNode:()=>pn,$isAutoLinkNode:()=>Me,$isLinkNode:()=>Xe,$toggleLink:()=>Vo,AutoLinkExtension:()=>Bx,AutoLinkNode:()=>Qn,ClickableLinkExtension:()=>$x,LinkExtension:()=>Ml,LinkNode:()=>jt,TOGGLE_LINK_COMMAND:()=>Is,createLinkMatcherWithRegExp:()=>Lx,formatUrl:()=>Tl,registerAutoLink:()=>_h,registerClickableLink:()=>fh,registerLink:()=>dh,toggleLink:()=>Wx});var bx=new Set(["http:","https:","mailto:","sms:","tel:"]),jt=class n extends ot{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new n(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},o){super(o);let{target:r=null,rel:s=null,title:i=null}=t;this.__url=e,this.__target=r,this.__rel=s,this.__title=i}createDOM(e){let t=document.createElement("a");return this.updateLinkDOM(null,t,e),Ut(t,e.theme.link),t}updateLinkDOM(e,t,o){if(Cs(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let r of["target","rel","title"]){let s=`__${r}`,i=this[s];e&&e[s]===i||(i?t[r]=i:t.removeAttribute(r))}}}updateDOM(e,t,o){return this.updateLinkDOM(e,t,o),!1}static importDOM(){return{a:e=>({conversion:kx,priority:1})}}static importJSON(e){return pn().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=Tl(e);try{let t=new URL(Tl(e));if(!bx.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let o=pn(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(o,t),o}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,o){if(!D(t))return!1;let r=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(s)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function ah(n){let e=Ft(n,"next");return[e,e.getFlipped()]}function lh(n,e){for(let t of e)if(t.origin.isAttached()){let o=cn(t);return void Io(n,o)}}function Rx(n){let e=R(),t=null,o=null;D(e)&&(t=ah(e.anchor),o=ah(e.focus));for(let r of De(n,"next")){let s=r.origin;if($(s)&&!s.isInline()){let i=s.getChildren();if(i.length>0){let a=rd(n);a.append(...i),s.append(a)}Ff(s,Yr(r),{$shouldSplit:()=>!1})}}if(n.isEmpty()){let r=n.getParent();n.remove(),r&&r.isEmpty()&&r.remove()}D(e)&&(lh(e.anchor,t),lh(e.focus,o),Bt(e))}function kx(n){let e=null;if(Cs(n)){let t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=pn(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function pn(n="",e){return Nt(new jt(n,e))}function Xe(n){return n instanceof jt}var Qn=class n extends jt{__isUnlinked;constructor(e="",t={},o){super(e,t,o),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new n(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,o){return super.updateDOM(e,t,o)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return ks().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let o=ks(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(o,t),o}};function ks(n="",e){return Nt(new Qn(n,e))}function Me(n){return n instanceof Qn}var Is=Le("TOGGLE_LINK_COMMAND");function ch(n,e){if(n.type==="element"){let t=n.getNode();return $(t)||(function(o,...r){let s=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",o);for(let a of r)i.append("v",a);throw s.search=i.toString(),Error(`Minified Lexical error #${o}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),t.getChildren()[n.offset+e]||null}return null}function Vo(n,e={}){let t;if(n&&typeof n=="object"){let{url:u,...d}=n;t=u,e={...d,...e}}else t=n;let{target:o,title:r}=e,s=e.rel===void 0?"noreferrer":e.rel,i=R();if(i===null||!D(i)&&!he(i))return;if(he(i)){let u=i.getNodes();return u.length===0?void 0:void u.forEach(d=>{if(t===null){let f=be(d,h=>!Me(h)&&Xe(h));f&&(f.insertBefore(d),f.getChildren().length===0&&f.remove())}else{let f=be(d,h=>!Me(h)&&Xe(h));if(f)f.setURL(t),o!==void 0&&f.setTarget(o),s!==void 0&&f.setRel(s);else{let h=pn(t,{rel:s,target:o});d.insertBefore(h),h.append(d)}}})}if(i.isCollapsed()&&t===null)for(let u of i.getNodes()){let d=be(u,f=>!Me(f)&&Xe(f));return void(d!==null&&(d.getChildren().forEach(f=>{d.insertBefore(f)}),d.remove()))}let a=i.extract();if(t===null){let u=new Set;return void a.forEach(d=>{let f=be(d,h=>!Me(h)&&Xe(h));if(f!==null){let h=f.getKey();if(u.has(h))return;(function(g,p){let m=new Set(p.filter(C=>g.isParentOf(C)).map(C=>C.getKey())),x=g.getChildren(),y=C=>m.has(C.getKey())||$(C)&&p.some(S=>g.isParentOf(S)&&C.isParentOf(S)),N=x.filter(y);if(N.length===x.length)return x.forEach(C=>g.insertBefore(C)),void g.remove();let T=x.findIndex(y),O=x.findLastIndex(y),E=T===0,A=O===x.length-1;if(E)N.forEach(C=>g.insertBefore(C));else if(A)for(let C=N.length-1;C>=0;C--)g.insertAfter(N[C]);else{for(let S=N.length-1;S>=0;S--)g.insertAfter(N[S]);let C=x.slice(O+1);if(C.length>0){let S=pn(g.getURL(),{rel:g.getRel(),target:g.getTarget(),title:g.getTitle()});N[N.length-1].insertAfter(S),C.forEach(k=>S.append(k))}}})(f,a),u.add(h)}})}let l=new Set,c=u=>{l.has(u.getKey())||(l.add(u.getKey()),u.setURL(t),o!==void 0&&u.setTarget(o),s!==void 0&&u.setRel(s),r!==void 0&&u.setTitle(r))};if(a.length===1){let u=a[0],d=be(u,Xe);if(d!==null)return c(d)}(function(u){let d=R();if(!D(d))return u();let f=Bt(d),h=f.isBackward(),g=ch(f.anchor,h?-1:0),p=ch(f.focus,h?0:-1),m=u();if(g||p){let x=R();if(D(x)){let y=x.clone();if(g){let N=g.getParent();N&&y.anchor.set(N.getKey(),g.getIndexWithinParent()+(h?1:0),"element")}if(p){let N=p.getParent();N&&y.focus.set(N.getKey(),p.getIndexWithinParent()+(h?0:1),"element")}Ge(Bt(y))}}})(()=>{let u=null;for(let d of a){if(!d.isAttached())continue;let f=be(d,Xe);if(f){c(f);continue}if($(d)){if(!d.isInline())continue;if(Xe(d)){if(!(Me(d)||u!==null&&u.getParentOrThrow().isParentOf(d))){c(d),u=d;continue}for(let g of d.getChildren())d.insertBefore(g);d.remove();continue}}let h=d.getPreviousSibling();Xe(h)&&h.is(u)?h.append(d):(u=pn(t,{rel:s,target:o,title:r}),d.insertAfter(u),u.append(d))}})}var Ix=/^\+?[0-9\s()-]{5,}$/;function Tl(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:Ix.test(n)?`tel:${n}`:`https://${n}`}function dh(n,e){return Je(n.registerNodeTransform(jt,Rx),qe(()=>n.registerCommand(Is,t=>{let o=e.validateUrl.peek(),r=e.attributes.peek();if(t===null)return Vo(null),!0;if(typeof t=="string")return!(o!==void 0&&!o(t))&&(Vo(t,r),!0);{let{url:s,target:i,rel:a,title:l}=t;return Vo(s,{...r,rel:a,target:i,title:l}),!0}},ie)),qe(()=>{let t=e.validateUrl.value;if(!t)return;let o=e.attributes.value;return n.registerCommand(cs,r=>{let s=R();if(!D(s)||s.isCollapsed()||!Ve(r,ClipboardEvent)||r.clipboardData===null)return!1;let i=r.clipboardData.getData("text");return!!t(i)&&!s.getNodes().some(a=>$(a))&&(n.dispatchCommand(Is,{...o,url:i}),r.preventDefault(),!0)},ie)}))}var Ml=Z({build:(n,e,t)=>Et(e),config:{attributes:void 0,validateUrl:void 0},mergeConfig(n,e){let t=Wt(n,e);return n.attributes&&(t.attributes=Wt(n.attributes,t.attributes)),t},name:"@lexical/link/Link",nodes:()=>[jt],register:(n,e,t)=>dh(n,t.getOutput())});function fh(n,e,t={}){let o=s=>{let i=s.target;if(!Un(i))return;let a=fs(i);if(a===null)return;let l=null,c=null;if(a.update(()=>{let f=nt(i);if(f!==null){let h=be(f,$);if(!e.disabled.peek())if(Xe(h))l=h.sanitizeUrl(h.getURL()),c=h.getTarget();else{let g=(function(p,m){let x=p;for(;x!=null;){if(m(x))return x;x=x.parentNode}return null})(i,Cs);g!==null&&(l=g.href,c=g.target)}}}),l===null||l==="")return;let u=n.getEditorState().read(R);if(D(u)&&!u.isCollapsed())return void s.preventDefault();let d=s.type==="auxclick"&&s.button===1;window.open(l,e.newTab.peek()||d||s.metaKey||s.ctrlKey||c==="_blank"?"_blank":"_self"),s.preventDefault()},r=s=>{s.button===1&&o(s)};return n.registerRootListener((s,i)=>{i!==null&&(i.removeEventListener("click",o),i.removeEventListener("mouseup",r)),s!==null&&(s.addEventListener("click",o,t),s.addEventListener("mouseup",r,t))})}var $x=Z({build:(n,e,t)=>Et(e),config:ye({disabled:!1,newTab:!1}),dependencies:[Ml],name:"@lexical/link/ClickableLink",register:(n,e,t)=>fh(n,t.getOutput())});function Lx(n,e=t=>t){return t=>{let o=n.exec(t);return o===null?null:{index:o.index,length:o[0].length,text:o[0],url:e(o[0])}}}function El(n,e){for(let t=0;t<e.length;t++){let o=e[t](n);if(o)return o}return null}var Px=/[.,;\s]/;function $s(n){return Px.test(n)}function gh(n){return $s(n[n.length-1])}function Ol(n){return $s(n[0])}function hh(n){let e=n.getPreviousSibling();return $(e)&&(e=e.getLastDescendant()),e===null||Ca(e)||B(e)&&gh(e.getTextContent())}function ph(n){let e=n.getNextSibling();return $(e)&&(e=e.getFirstDescendant()),e===null||Ca(e)||B(e)&&Ol(e.getTextContent())}function wx(n,e,t,o){return(n>0?$s(t[n-1]):hh(o[0]))?e<t.length?$s(t[e]):ph(o[o.length-1]):!1}function Fx(n,e,t){let o=[],r=[],s=[],i=0,a=0,l=[...n];for(;l.length>0;){let c=l[0],u=c.getTextContent().length,d=a;a+u<=e?(o.push(c),i+=u):d>=t?s.push(c):r.push(c),a+=u,l.shift()}return[i,o,r,s]}function Kx(n,e,t,o){let r=ks(o.url,o.attributes);if(n.length===1){let s,i=n[0];e===0?[s,i]=i.splitText(t):[,s,i]=i.splitText(e,t);let a=Kt(o.text);return a.setFormat(s.getFormat()),a.setDetail(s.getDetail()),a.setStyle(s.getStyle()),r.append(a),s.replace(r),i}if(n.length>1){let s=n[0],i,a=s.getTextContent().length;e===0?i=s:[,i]=s.splitText(e);let l=[],c;for(let h=1;h<n.length;h++){let g=n[h],p=g.getTextContent().length,m=a;if(m<t)if(a+p<=t)l.push(g);else{let[x,y]=g.splitText(t-m);l.push(x),c=y}a+=p}let u=R(),d=u?u.getNodes().find(B):void 0,f=Kt(i.getTextContent());return f.setFormat(i.getFormat()),f.setDetail(i.getDetail()),f.setStyle(i.getStyle()),r.append(f,...l),d&&d===i&&(D(u)?f.select(u.anchor.offset,u.focus.offset):he(u)&&f.select(0,f.getTextContent().length)),i.replace(r),c}}function uh(n,e,t){let o=n.getChildren(),r=o.length;for(let l=0;l<r;l++){let c=o[l];if(!B(c)||!c.isSimpleText())return qo(n),void t(null,n.getURL())}let s=n.getTextContent(),i=El(s,e);if(i===null||i.text!==s||!hh(n)||!ph(n))return qo(n),void t(null,n.getURL());let a=n.getURL();if(a!==i.url&&(n.setURL(i.url),t(i.url,a)),i.attributes){let l=n.getRel();l!==i.attributes.rel&&(n.setRel(i.attributes.rel||null),t(i.attributes.rel||null,l));let c=n.getTarget();c!==i.attributes.target&&(n.setTarget(i.attributes.target||null),t(i.attributes.target||null,c))}}function qo(n){let e=n.getChildren();for(let t=e.length-1;t>=0;t--)n.insertAfter(e[t]);return n.remove(),e.map(t=>t.getLatest())}var mh={changeHandlers:[],excludeParents:[],matchers:[]};function _h(n,e=mh){let{matchers:t,changeHandlers:o,excludeParents:r}=e,s=(i,a)=>{for(let l of o)l(i,a)};return Je(n.registerNodeTransform(Wn,i=>{let a=i.getParentOrThrow(),l=i.getPreviousSibling();if(Me(a)&&!a.getIsUnlinked())uh(a,t,s);else if(!Xe(a)&&!r.some(c=>c(a))){if(i.isSimpleText()&&(Ol(i.getTextContent())||!Me(l))){let c=(function(u){let d=[u],f=u.getNextSibling();for(;f!==null&&B(f)&&f.isSimpleText()&&(d.push(f),!/[\s]/.test(f.getTextContent()));)f=f.getNextSibling();return d})(i);(function(u,d,f){for(let y of u){let N=y.getParent();if(Me(N)&&!N.getIsUnlinked())return}let h=[...u],g=h.map(y=>y.getTextContent()).join(""),p,m=g,x=0;for(;(p=El(m,d))&&p!==null;){let y=p.index,N=y+p.length;if(wx(x+y,x+N,g,h)){let[T,,O,E]=Fx(h,x+y,x+N),A=!1;for(let S of O){let k=S.getParent();if(Me(k)&&!k.getIsUnlinked()){A=!0;break}}if(A){x+=N,m=m.substring(N);continue}let C=Kx(O,x+y-T,x+N-T,p);h=C?[C,...E]:E,f(p.url,null),x=0}else x+=N;m=m.substring(N)}})(c,t,s)}(function(c,u,d){let f=c.getParent(),h=c.getPreviousSibling(),g=c.getNextSibling(),p=c.getTextContent();if(!Me(f)||f.getIsUnlinked()){if(Me(h)&&!h.getIsUnlinked()&&h.is(c.getPreviousSibling())&&c.getParent()===h.getParent()){if(!Ol(p))return qo(h),void d(null,h.getURL());if(m=p,h.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(m):/^\.[a-zA-Z0-9]{1,}/.test(m)){let x=h.getTextContent()+p,y=El(x,u);y!==null&&y.text===x&&(h.append(c),uh(h,u,d),d(null,h.getURL()))}}var m;!Me(g)||g.getIsUnlinked()||gh(p)||g.is(c.getNextSibling())&&c.getParent()===g.getParent()&&(qo(g),d(null,g.getURL()))}})(i,t,s)}}),n.registerCommand(Is,i=>{let a=R();return i!==null||!D(a)||a.extract().forEach(l=>{let c=l.getParent();Me(c)&&(c.setIsUnlinked(!c.getIsUnlinked()),c.markDirty())}),!1},ie))}var Bx=Z({config:mh,dependencies:[Ml],mergeConfig(n,e){let t=Wt(n,e);for(let o of["matchers","changeHandlers","excludeParents"]){let r=e[o];Array.isArray(r)&&(t[o]=[...n[o],...r])}return t},name:"@lexical/link/AutoLink",nodes:[Qn],register:_h}),Wx=Vo;var _e=vl,mT=_e.$createAutoLinkNode,_T=_e.$createLinkNode,xT=_e.$isAutoLinkNode,yT=_e.$isLinkNode,NT=_e.$toggleLink,CT=_e.AutoLinkExtension,ST=_e.AutoLinkNode,TT=_e.ClickableLinkExtension,ET=_e.LinkExtension,xh=_e.LinkNode,yh=_e.TOGGLE_LINK_COMMAND,OT=_e.createLinkMatcherWithRegExp,MT=_e.formatUrl,vT=_e.registerAutoLink,AT=_e.registerClickableLink,DT=_e.registerLink,bT=_e.toggleLink;var Al={};we(Al,{HistoryExtension:()=>Ls,SharedHistoryExtension:()=>Hx,createEmptyHistoryState:()=>Sh,registerHistory:()=>Ch});function Ux(n,e,t,o,r){if(n===null||t.size===0&&o.size===0&&!r)return 0;let s=e._selection,i=n._selection;if(r)return 1;if(!(D(s)&&D(i)&&i.isCollapsed()&&s.isCollapsed()))return 0;let a=(function(x,y,N){let T=x._nodeMap,O=[];for(let E of y){let A=T.get(E);A!==void 0&&O.push(A)}for(let[E,A]of N){if(!A)continue;let C=T.get(E);C===void 0||ln(C)||O.push(C)}return O})(e,t,o);if(a.length===0)return 0;if(a.length>1){let x=e._nodeMap,y=x.get(s.anchor.key),N=x.get(i.anchor.key);return y&&N&&!n._nodeMap.has(y.__key)&&B(y)&&y.__text.length===1&&s.anchor.offset===1?2:0}let l=a[0],c=n._nodeMap.get(l.__key);if(!B(c)||!B(l)||c.__mode!==l.__mode)return 0;let u=c.__text,d=l.__text;if(u===d)return 0;let f=s.anchor,h=i.anchor;if(f.key!==h.key||f.type!=="text")return 0;let g=f.offset,p=h.offset,m=d.length-u.length;return m===1&&p===g-1?2:m===-1&&p===g+1?3:m===-1&&p===g?4:0}function zx(n,e){let t=Date.now(),o=0,r=Date.now(),s=0,i=null;return(a,l,c,u,d,f)=>{let h=Date.now();if(f.has(Td)&&(r=t,s=o,i=a),f.has(es))return o=0,t=h,2;f.has(Sd)&&i&&(t=r,o=s,a=i);let g=Ux(a,l,u,d,n.isComposing()),p=(()=>{let m=c===null||c.editor===n,x=f.has(kd);if(!x&&m&&f.has(ts))return 0;if(g===1)return 2;if(a===null)return 1;let y=l._selection;if(!(u.size>0||d.size>0))return y!==null?0:2;let N=typeof e=="number"?e:e.peek();return x===!1&&g!==0&&g===o&&h<t+N&&m||u.size===1&&(function(T,O,E){let A=O._nodeMap.get(T),C=E._nodeMap.get(T),S=O._selection,k=E._selection;return!(D(S)&&D(k)&&S.anchor.type==="element"&&S.focus.type==="element"&&k.anchor.type==="text"&&k.focus.type==="text"||!B(A)||!B(C)||A.__parent!==C.__parent)&&JSON.stringify(O.read(()=>A.exportJSON()))===JSON.stringify(E.read(()=>C.exportJSON()))})(Array.from(u)[0],a,l)?0:1})();return t=h,o=g,p}}function Nh(n){n.undoStack=[],n.redoStack=[],n.current=null}function Ch(n,e,t){let o=zx(n,t);return Je(n.registerCommand(Vd,()=>((function(s,i){let a=i.redoStack,l=i.undoStack;if(l.length!==0){let c=i.current,u=l.pop();c!==null&&(a.push(c),s.dispatchCommand($o,!0)),l.length===0&&s.dispatchCommand(Lo,!1),i.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:es})}})(n,e),!0),W),n.registerCommand(Bd,()=>((function(s,i){let a=i.redoStack,l=i.undoStack;if(a.length!==0){let c=i.current;c!==null&&(l.push(c),s.dispatchCommand(Lo,!0));let u=a.pop();a.length===0&&s.dispatchCommand($o,!1),i.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:es})}})(n,e),!0),W),n.registerCommand(Jr,()=>(Nh(e),!1),W),n.registerCommand(Cd,()=>(Nh(e),n.dispatchCommand($o,!1),n.dispatchCommand(Lo,!1),!0),W),n.registerUpdateListener(({editorState:s,prevEditorState:i,dirtyLeaves:a,dirtyElements:l,tags:c})=>{let u=e.current,d=e.redoStack,f=e.undoStack,h=u===null?null:u.editorState;if(u!==null&&s===h)return;let g=o(i,s,u,a,l,c);if(g===1)d.length!==0&&(e.redoStack=[],n.dispatchCommand($o,!1)),u!==null&&(f.push({...u}),n.dispatchCommand(Lo,!0));else if(g===2)return;e.current={editor:n,editorState:s}}))}function Sh(){return{current:null,redoStack:[],undoStack:[]}}var Ls=Z({build:(n,{delay:e,createInitialHistoryState:t,disabled:o})=>Et({delay:e,disabled:o,historyState:t(n)}),config:ye({createInitialHistoryState:Sh,delay:300,disabled:typeof window>"u"}),name:"@lexical/history/History",register:(n,e,t)=>{let o=t.getOutput();return qe(()=>o.disabled.value?void 0:Ch(n,o.historyState.value,o.delay))}}),Hx=Z({dependencies:[us(Ls,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0})],name:"@lexical/history/SharedHistory",register(n,e,t){let{output:o}=t.getDependency(Ls),r=(function(i){return i?Sg(i,Ls.name):null})(n._parentEditor);if(!r)return()=>{};let s=r.output;return qe(()=>Cg(()=>{o.delay.value=s.delay.value,o.historyState.value=s.historyState.value,o.disabled.value=s.disabled.value}))}});var Ps=Al,LT=Ps.HistoryExtension,PT=Ps.SharedHistoryExtension,Th=Ps.createEmptyHistoryState,Eh=Ps.registerHistory;var Yx=[{label:"B",type:"format-bold"},{label:"I",type:"format-italic"},{label:"U",type:"format-underline"},{label:"H2",type:"heading"},{label:"UL",type:"bullet-list"},{label:"OL",type:"number-list"},{label:"Quote",type:"blockquote"},{label:"Code",type:"format-code"}];function Oh(n,e){n.update(()=>{let t=R();D(t)&&yf(t,e)})}var Gx={"format-bold":n=>n.dispatchCommand(Tt,"bold"),"format-italic":n=>n.dispatchCommand(Tt,"italic"),"format-underline":n=>n.dispatchCommand(Tt,"underline"),"format-code":n=>n.dispatchCommand(Tt,"code"),heading:n=>Oh(n,()=>Rg("h2")),"bullet-list":n=>n.dispatchCommand(oh,void 0),"number-list":n=>n.dispatchCommand(nh,void 0),blockquote:n=>Oh(n,()=>kg())};function jx(n,e){let t=Gx[e.type];t&&t(n)}function Jx(n){let e=document.createElement("div");e.className="richtext-toolbar";for(let o of Yx){let r=document.createElement("button");r.type="button",r.className="richtext-toolbar-btn",r.textContent=o.label,r.addEventListener("click",s=>{s.preventDefault(),jx(n,o)}),e.appendChild(r)}let t=document.createElement("button");return t.type="button",t.className="richtext-toolbar-btn",t.textContent="Link",t.addEventListener("click",o=>{o.preventDefault();let r=prompt("Enter URL:");r&&n.dispatchCommand(yh,r)}),e.appendChild(t),e}function Vx(n){let e=n.getAttribute("data-field");if(!e)return;let t=n.closest(".richtext-wrap");if(!t)return;let o=t.querySelector(`input[name="${e}"]`);if(!o)return;let s=t.querySelector("template.richtext-initial")?.innerHTML??"",i={namespace:`richtext-${e}`,nodes:[Ig,$g,sh,rh,xh],onError:u=>{console.error("Lexical error:",u)},theme:{paragraph:"richtext-p",heading:{h2:"richtext-h2",h3:"richtext-h3"},text:{bold:"richtext-bold",italic:"richtext-italic",underline:"richtext-underline",code:"richtext-code"},list:{ul:"richtext-ul",ol:"richtext-ol",listitem:"richtext-li"},quote:"richtext-quote",link:"richtext-link"}},a=ds(i),l=Jx(a);n.parentElement?.insertBefore(l,n);let c=document.createElement("div");c.contentEditable="true",c.className="richtext-content",n.appendChild(c),a.setRootElement(c),Lg(a),ih(a),Eh(a,Th(),300),s&&a.update(()=>{let d=new DOMParser().parseFromString(s,"text/html"),f=Ts(a,d);Ce().clear(),zr(f)}),a.registerUpdateListener(({editorState:u})=>{u.read(()=>{let d=Ss(a);o.value=d})})}function Mh(){let n=document.querySelectorAll(".richtext-editor");for(let e of n)Vx(e)}Mh();var vh=document.querySelector(".delete-trigger"),Zn=document.getElementById("delete-dialog"),Ah=document.getElementById("delete-cancel"),Dh=document.getElementById("delete-confirm"),bh=document.getElementById("delete-form");vh&&Zn&&vh.addEventListener("click",()=>{typeof Zn.show=="function"&&Zn.show()});Ah&&Zn&&Ah.addEventListener("click",()=>{typeof Zn.close=="function"&&Zn.close()});Dh&&bh&&Dh.addEventListener("click",()=>{bh.submit()});var qx=document.querySelectorAll(".media-upload");for(let n of qx){let e=n.getAttribute("data-upload-endpoint"),t=n.querySelector('input[type="file"]'),o=n.querySelector('input[type="hidden"]'),r=n.querySelector(".media-preview");!e||!t||!o||t.addEventListener("change",async()=>{let s=t.files?.[0];if(!s)return;let i=new FormData;i.append("file",s);try{let l=await(await fetch(e,{method:"POST",body:i})).json(),c=l.id??l.filename??"";o.value=c,r&&(s.type.startsWith("image/")?r.innerHTML=`<img src="/media/${c}" alt="">`:r.innerHTML=`<span>${s.name}</span>`)}catch{r&&(r.innerHTML='<span style="color: var(--val-color-error);">Upload failed</span>')}})}})();
15
+ `?c.insertParagraph():u===" "?c.insertNodes([Wr()]):c.insertText(u)}}}else e.insertRawText(i)}function Va(n,e,t){n.dispatchCommand(Yd,{nodes:e,selection:t})||(t.insertNodes(e),(function(o){if(D(o)&&o.isCollapsed()){let r=o.anchor,s=null,i=Ft(r,"previous");if(i)if(Yr(i))s=i.origin;else{let a=ud(i,De(Ce(),"next").getFlipped());for(let l of a){if(B(l.origin)){s=l.origin;break}if($(l.origin)&&!l.origin.isInline())break}}if(s&&B(s)){let a=s.getFormat(),l=s.getStyle();o.format===a&&o.style===l||(o.format=a,o.style=l,o.dirty=!0)}}})(t))}function Vf(n,e,t,o=[]){let r=e===null||t.isSelected(e),s=$(t)&&t.excludeFromCopy("html"),i=t;e!==null&&B(i)&&(i=ys(e,i,"clone"));let a=$(i)?i.getChildren():[],l=(function(c){let u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&Os(58,d.name),$(c)){let f=u.children;Array.isArray(f)||Os(59,d.name)}return u})(i);B(i)&&i.getTextContentSize()===0&&(r=!1);for(let c=0;c<a.length;c++){let u=a[c],d=Vf(n,e,u,l.children);!r&&$(t)&&d&&t.extractWithChild(u,e,"clone")&&(r=!0)}if(r&&!s)o.push(l);else if(Array.isArray(l.children))for(let c=0;c<l.children.length;c++){let u=l.children[c];o.push(u)}return r}function qf(n,e){let t=[],o=Ce().getChildren();for(let r=0;r<o.length;r++)Vf(n,e,o[r],t);return{namespace:n._config.namespace,nodes:t}}function Xf(n){let e=[];for(let t=0;t<n.length;t++){let o=n[t],r=yd(o);B(r)&&Nf(r),e.push(r)}return e}var zn=null;async function Y_(n,e,t){if(zn!==null)return!1;if(e!==null)return new Promise((c,u)=>{n.update(()=>{c(Gf(n,e,t))})});let o=n.getRootElement(),r=n._window||window,s=r.document,i=va(r);if(o===null||i===null)return!1;let a=s.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(s.createTextNode("#")),o.append(a);let l=new Range;return l.setStart(a,0),l.setEnd(a,1),i.removeAllRanges(),i.addRange(l),new Promise((c,u)=>{let d=n.registerCommand(Qr,f=>(Ve(f,ClipboardEvent)&&(d(),zn!==null&&(r.clearTimeout(zn),zn=null),c(Gf(n,f,t))),!0),Xr);zn=r.setTimeout(()=>{d(),zn=null,c(!1)},50),s.execCommand("copy"),a.remove()})}function Gf(n,e,t){if(t===void 0){let r=va(n._window),s=R();if(!s||s.isCollapsed()||!r)return!1;let i=r.anchorNode,a=r.focusNode;if(i!==null&&a!==null&&!af(n,i,a))return!1;t=Zf(s)}e.preventDefault();let o=e.clipboardData;return o!==null&&(eg(o,t),!0)}var Qf=[["text/html",jf],["application/x-lexical-editor",Jf]];function Zf(n=R()){let e={"text/plain":n?n.getTextContent():""};if(n){let t=Ur();for(let[o,r]of Qf){let s=r(t,n);s!==null&&(e[o]=s)}}return e}function eg(n,e){for(let[t]of Qf)e[t]===void 0&&n.setData(t,"");for(let t in e){let o=e[t];o!==void 0&&n.setData(t,o)}}var it=qa,zC=it.$generateJSONFromSelectedNodes,HC=it.$generateNodesFromSerializedNodes,YC=it.$getClipboardDataFromSelection,GC=it.$getHtmlContent,jC=it.$getLexicalContent,JC=it.$insertDataTransferForPlainText,Xa=it.$insertDataTransferForRichText,VC=it.$insertGeneratedNodes,Qa=it.copyToClipboard,qC=it.setLexicalClipboardDataTransfer;var gl={};we(gl,{$createHorizontalRuleNode:()=>fl,$isDecoratorTextNode:()=>hg,$isHorizontalRuleNode:()=>Ng,AutoFocusExtension:()=>J_,ClearEditorExtension:()=>V_,DecoratorTextExtension:()=>tx,DecoratorTextNode:()=>jo,EditorStateExtension:()=>Ds,HorizontalRuleExtension:()=>fx,HorizontalRuleNode:()=>dn,INSERT_HORIZONTAL_RULE_COMMAND:()=>ux,InitialStateExtension:()=>xg,LexicalBuilder:()=>jn,NodeSelectionExtension:()=>ll,TabIndentationExtension:()=>gx,applyFormatFromStyle:()=>X_,applyFormatToDom:()=>Q_,batch:()=>ig,buildEditorFromExtensions:()=>sx,computed:()=>cg,configExtension:()=>ds,declarePeerDependency:()=>Zd,defineExtension:()=>Z,effect:()=>Ht,getExtensionDependencyFromEditor:()=>ax,getKnownTypesAndNodes:()=>q_,getPeerDependencyFromEditor:()=>yg,getPeerDependencyFromEditorOrThrow:()=>lx,namedSignals:()=>Rs,registerClearEditor:()=>fg,registerTabIndentation:()=>Sg,safeCast:()=>ye,shallowMergeConfig:()=>Wt,signal:()=>Gn,untracked:()=>rl,watchedSignal:()=>ul});var G_=Symbol.for("preact-signals");function bs(){if(zt>1)return void zt--;let n,e=!1;for(;Go!==void 0;){let t=Go;for(Go=void 0,sl++;t!==void 0;){let o=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&ag(t))try{t.c()}catch(r){e||(n=r,e=!0)}t=o}}if(sl=0,zt--,e)throw n}function ig(n){if(zt>0)return n();zt++;try{return n()}finally{bs()}}var V,Go;function rl(n){let e=V;V=void 0;try{return n()}finally{V=e}}var zt=0,sl=0,As=0;function tg(n){if(V===void 0)return;let e=n.n;return e===void 0||e.t!==V?(e={i:0,S:n,p:V.s,n:void 0,t:V,e:void 0,x:void 0,r:e},V.s!==void 0&&(V.s.n=e),V.s=e,n.n=e,32&V.f&&n.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=V.s,e.n=void 0,V.s.n=e,V.s=e),e):void 0}function Se(n,e){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function Gn(n,e){return new Se(n,e)}function ag(n){for(let e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function ng(n){for(let e=n.s;e!==void 0;e=e.n){let t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function lg(n){let e,t=n.s;for(;t!==void 0;){let o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}n.s=e}function un(n,e){Se.call(this,void 0),this.x=n,this.s=void 0,this.g=As-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function cg(n,e){return new un(n,e)}function ug(n){let e=n.u;if(n.u=void 0,typeof e=="function"){zt++;let t=V;V=void 0;try{e()}catch(o){throw n.f&=-2,n.f|=8,cl(n),o}finally{V=t,bs()}}}function cl(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,ug(n)}function j_(n){if(V!==this)throw new Error("Out-of-order effect");lg(this),V=n,this.f&=-2,8&this.f&&cl(this),bs()}function Yn(n,e){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}function Ht(n,e){let t=new Yn(n,e);try{t.c()}catch(r){throw t.d(),r}let o=t.d.bind(t);return o[Symbol.dispose]=o,o}function Rs(n,e={}){let t={};for(let o in n){let r=e[o],s=Gn(r===void 0?n[o]:r);t[o]=s}return t}Se.prototype.brand=G_,Se.prototype.h=function(){return!0},Se.prototype.S=function(n){let e=this.t;e!==n&&n.e===void 0&&(n.x=e,this.t=n,e!==void 0?e.e=n:rl(()=>{var t;(t=this.W)==null||t.call(this)}))},Se.prototype.U=function(n){if(this.t!==void 0){let e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t,t===void 0&&rl(()=>{var o;(o=this.Z)==null||o.call(this)}))}},Se.prototype.subscribe=function(n){return Ht(()=>{let e=this.value,t=V;V=void 0;try{n(e)}finally{V=t}},{name:"sub"})},Se.prototype.valueOf=function(){return this.value},Se.prototype.toString=function(){return this.value+""},Se.prototype.toJSON=function(){return this.value},Se.prototype.peek=function(){let n=V;V=void 0;try{return this.value}finally{V=n}},Object.defineProperty(Se.prototype,"value",{get(){let n=tg(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(sl>100)throw new Error("Cycle detected");this.v=n,this.i++,As++,zt++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{bs()}}}}),un.prototype=new Se,un.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===As))return!0;if(this.g=As,this.f|=1,this.i>0&&!ag(this))return this.f&=-2,!0;let n=V;try{ng(this),V=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return V=n,lg(this),this.f&=-2,!0},un.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Se.prototype.S.call(this,n)},un.prototype.U=function(n){if(this.t!==void 0&&(Se.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},un.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(un.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");let n=tg(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),Yn.prototype.c=function(){let n=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},Yn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ug(this),ng(this),zt++;let n=V;return V=this,j_.bind(this,n)},Yn.prototype.N=function(){2&this.f||(this.f|=2,this.o=Go,Go=this)},Yn.prototype.d=function(){this.f|=8,1&this.f||cl(this)},Yn.prototype.dispose=function(){this.d()};var J_=Z({build:(n,e,t)=>Rs(e),config:ye({defaultSelection:"rootEnd",disabled:!1}),name:"@lexical/extension/AutoFocus",register(n,e,t){let o=t.getOutput();return Ht(()=>o.disabled.value?void 0:n.registerRootListener(r=>{n.focus(()=>{let s=document.activeElement;r===null||s!==null&&r.contains(s)||r.focus({preventScroll:!0})},{defaultSelection:o.defaultSelection.peek()})}))}});function dg(){let n=Ce(),e=R(),t=se();n.clear(),n.append(t),e!==null&&t.select(),D(e)&&(e.format=0)}function fg(n,e=dg){return n.registerCommand(Vr,t=>(n.update(e),!0),W)}var V_=Z({build:(n,e,t)=>Rs(e),config:ye({$onClear:dg}),name:"@lexical/extension/ClearEditor",register(n,e,t){let{$onClear:o}=t.getOutput();return Ht(()=>fg(n,o.value))}});function q_(n){let e=new Set,t=new Set;for(let o of gg(n)){let r=typeof o=="function"?o:o.replace;e.add(r.getType()),t.add(r)}return{nodes:t,types:e}}function gg(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}var Za=Qd("format",{parse:n=>typeof n=="number"?n:0}),jo=class extends es{$config(){return this.config("decorator-text",{extends:es,stateConfigs:[{flat:!0,stateConfig:Za}]})}getFormat(){return zr(this,Za)}getFormatFlags(e,t){return Ra(this.getFormat(),e,t)}hasFormat(e){let t=Vd[e];return(this.getFormat()&t)!==0}setFormat(e){return Jr(this,Za,e)}toggleFormat(e){let t=this.getFormat(),o=Ra(t,e,null);return this.setFormat(o)}isInline(){return!0}createDOM(){return document.createElement("span")}updateDOM(){return!1}};function hg(n){return n instanceof jo}function X_(n,e,t){let o=e.fontWeight,r=e.textDecoration.split(" "),s=o==="700"||o==="bold",i=r.includes("line-through"),a=e.fontStyle==="italic",l=r.includes("underline"),c=e.verticalAlign;return s&&!n.hasFormat("bold")&&n.toggleFormat("bold"),i&&!n.hasFormat("strikethrough")&&n.toggleFormat("strikethrough"),a&&!n.hasFormat("italic")&&n.toggleFormat("italic"),l&&!n.hasFormat("underline")&&n.toggleFormat("underline"),c!=="sub"||n.hasFormat("subscript")||n.toggleFormat("subscript"),c!=="super"||n.hasFormat("superscript")||n.toggleFormat("superscript"),t&&!n.hasFormat(t)&&n.toggleFormat(t),n}function Q_(n,e,t=ex){for(let[o,r]of Object.entries(t))n.hasFormat(r)&&(e=Z_(e,o));return e}function Z_(n,e){let t=document.createElement(e);return t.appendChild(n),t}var ex={b:"bold",code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"},tx=Z({name:"@lexical/extension/DecoratorText",nodes:()=>[jo],register:(n,e,t)=>n.registerCommand(Tt,o=>{let r=R();if(he(r)||D(r))for(let s of r.getNodes())hg(s)&&s.toggleFormat(o);return!1},ie)});function ul(n,e){let t;return Gn(n(),{unwatched(){t&&(t(),t=void 0)},watched(){this.value=n(),t=e(this)}})}var Ds=Z({build:n=>ul(()=>n.getEditorState(),e=>n.registerUpdateListener(t=>{e.value=t.editorState})),name:"@lexical/extension/EditorState"});function q(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function pg(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){let t=n,o=e;for(let r in o)t[r]=pg(t[r],o[r]);return n}return e}var dl=0,il=1,mg=2,el=3,Ms=4,Hn=5,tl=6,Yo=7;function nl(n){return n.id===dl}function _g(n){return n.id===mg}function nx(n){return(function(e){return e.id===il})(n)||q(305,String(n.id),String(il)),Object.assign(n,{id:mg})}var ox=new Set,al=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:dl}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Wt;for(let o of this.configs)e=t(e,o);return e}init(e){let t=this.state;_g(t)||q(306,String(t.id));let o={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...o,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},s=(function(a,l,c){return Object.assign(a,{config:l,id:el,registerState:c})})(t,this.mergeConfigs(),o),i;this.state=s,this.extension.init&&(i=this.extension.init(e,s.config,o)),this.state=(function(a,l,c){return Object.assign(a,{id:Ms,initResult:l,registerState:c})})(s,i,r)}build(e){let t=this.state,o;t.id!==Ms&&q(307,String(t.id),String(Hn)),this.extension.build&&(o=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>o,getSignal:this.getSignal.bind(this)};this.state=(function(s,i,a){return Object.assign(s,{id:Hn,output:i,registerState:a})})(t,o,r)}register(e,t){this._signal=t;let o=this.state;o.id!==Hn&&q(308,String(o.id),String(Hn));let r=this.extension.register&&this.extension.register(e,o.config,o.registerState);return this.state=(function(s){return Object.assign(s,{id:tl})})(o),()=>{let s=this.state;s.id!==Yo&&q(309,String(o.id),String(Yo)),this.state=(function(i){return Object.assign(i,{id:Hn})})(s),r&&r()}}afterRegistration(e){let t=this.state,o;return t.id!==tl&&q(310,String(t.id),String(tl)),this.extension.afterRegistration&&(o=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(r){return Object.assign(r,{id:Yo})})(t),o}getSignal(){return this._signal===void 0&&q(311),this._signal}getInitResult(){this.extension.init===void 0&&q(312,this.extension.name);let e=this.state;return(function(t){return t.id>=Ms})(e)||q(313,String(e.id),String(Ms)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return(function(t){return t.id>=el})(e)||q(314,String(e.id),String(el)),{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 t===void 0&&q(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&q(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return(function(t){return t.id>=Yo})(e)||q(316,String(e.id),String(Yo)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||ox}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(t){return t.id>=Hn})(e)||q(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},og={tag:ns};function rx(){let n=Ce();n.isEmpty()&&n.append(se())}var xg=Z({config:ye({setOptions:og,updateOptions:og}),init:({$initialEditorState:n=rx})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},o){let r=o.getInitResult();if(!r.initialized){r.initialized=!0;let{$initialEditorState:s}=r;if(pd(s))n.setEditorState(s,t);else if(typeof s=="function")n.update(()=>{s(n)},e);else if(s&&(typeof s=="string"||typeof s=="object")){let i=n.parseEditorState(s);n.setEditorState(i,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Hd,Wn,Kd,qd,Wd]}),rg=Symbol.for("@lexical/extension/LexicalBuilder");function sx(...n){return jn.fromExtensions(n).buildEditor()}function sg(){}function ix(n){throw n}function vs(n){return Array.isArray(n)?n:[n]}var ol="0.41.0+prod.esm",jn=class n{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=ol,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(e){let t=[vs(xg)];for(let o of e)t.push(vs(o));return new n(t)}static maybeFromEditor(e){let t=e[rg];return t&&(t.PACKAGE_VERSION!==ol&&q(292,t.PACKAGE_VERSION,ol),t instanceof n||q(293)),t}static fromEditor(e){let t=n.maybeFromEditor(e);return t===void 0&&q(294),t}constructEditor(){let{$initialEditorState:e,onError:t,...o}=this.buildCreateEditorArgs(),r=Object.assign(fs({...o,...t?{onError:s=>{t(s,r)}}:{}}),{[rg]:this});for(let s of this.sortedExtensionReps())s.build(r);return r}buildEditor(){let e=sg;function t(){try{e()}finally{e=sg}}let o=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=rt(this.registerEditor(o),()=>o.setRootElement(null)),o}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&q(295,e.name),t}addEdge(e,t,o){let r=this.outgoingConfigEdges.get(e);r?r.set(t,o):this.outgoingConfigEdges.set(e,new Map([[t,o]]));let s=this.incomingEdges.get(t);s?s.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&q(296);let t=vs(e),[o]=t;typeof o.name!="string"&&q(297,typeof o.name);let r=this.extensionNameMap.get(o.name);if(r!==void 0&&r.extension!==o&&q(298,o.name),!r){r=new al(this,o),this.extensionNameMap.set(o.name,r);let s=this.conflicts.get(o.name);typeof s=="string"&&q(299,o.name,s);for(let i of o.conflictsWith||[])this.extensionNameMap.has(i)&&q(299,o.name,i),this.conflicts.set(i,o.name);for(let i of o.dependencies||[]){let a=vs(i);this.addEdge(o.name,a[0].name,a.slice(1)),this.addExtension(a)}for(let[i,a]of o.peerDependencies||[])this.addEdge(o.name,i,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(o,r)=>{let s=o.state;if(_g(s))return;let i=o.extension.name;var a;nl(s)||q(300,i,r||"[unknown]"),nl(a=s)||q(304,String(a.id),String(dl)),s=Object.assign(a,{id:il}),o.state=s;let l=this.outgoingConfigEdges.get(i);if(l)for(let c of l.keys()){let u=this.extensionNameMap.get(c);u&&t(u,i)}s=nx(s),o.state=s,e.push(o)};for(let o of this.extensionNameMap.values())nl(o.state)&&t(o);for(let o of e)for(let[r,s]of this.outgoingConfigEdges.get(o.extension.name)||[])if(s.length>0){let i=this.extensionNameMap.get(r);if(i)for(let a of s)i.configs.add(a)}for(let[o,...r]of this.roots)if(r.length>0){let s=this.extensionNameMap.get(o.name);s===void 0&&q(301,o.name);for(let i of r)s.configs.add(i)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),o=new AbortController,r=[()=>o.abort()],s=o.signal;for(let i of t){let a=i.register(e,s);a&&r.push(a)}for(let i of t){let a=i.afterRegistration(e);a&&r.push(a)}return rt(...r)}buildCreateEditorArgs(){let e={},t=new Set,o=new Map,r=new Map,s={},i={},a=this.sortedExtensionReps();for(let u of a){let{extension:d}=u;if(d.onError!==void 0&&(e.onError=d.onError),d.disableEvents!==void 0&&(e.disableEvents=d.disableEvents),d.parentEditor!==void 0&&(e.parentEditor=d.parentEditor),d.editable!==void 0&&(e.editable=d.editable),d.namespace!==void 0&&(e.namespace=d.namespace),d.$initialEditorState!==void 0&&(e.$initialEditorState=d.$initialEditorState),d.nodes)for(let f of gg(d)){if(typeof f!="function"){let h=o.get(f.replace);h&&q(302,d.name,f.replace.name,h.extension.name),o.set(f.replace,u)}t.add(f)}if(d.html){if(d.html.export)for(let[f,h]of d.html.export.entries())r.set(f,h);d.html.import&&Object.assign(s,d.html.import)}d.theme&&pg(i,d.theme)}Object.keys(i).length>0&&(e.theme=i),t.size&&(e.nodes=[...t]);let l=Object.keys(s).length>0,c=r.size>0;(l||c)&&(e.html={},l&&(e.html.import=s),c&&(e.html.export=r));for(let u of a)u.init(e);return e.onError||(e.onError=ix),e}};function ax(n,e){let t=jn.fromEditor(n).getExtensionRep(e);return t===void 0&&q(303,e.name),t.getExtensionDependency()}function yg(n,e){let t=jn.fromEditor(n).extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}function lx(n,e){let t=yg(n,e);return t===void 0&&q(291,e),t}var cx=new Set,ll=Z({build(n,e,t){let o=t.getDependency(Ds).output,r=Gn({watchedNodeKeys:new Map}),s=ul(()=>{},()=>Ht(()=>{let i=s.peek(),{watchedNodeKeys:a}=r.value,l,c=!1;o.value.read(()=>{if(R())for(let[u,d]of a.entries()){if(d.size===0){a.delete(u);continue}let f=Kn(u),h=f&&f.isSelected()||!1;c=c||h!==(!!i&&i.has(u)),h&&(l=l||new Set,l.add(u))}}),!c&&l&&i&&l.size===i.size||(s.value=l)}));return{watchNodeKey:function(i){let a=cg(()=>(s.value||cx).has(i)),{watchedNodeKeys:l}=r.peek(),c=l.get(i),u=c!==void 0;return c=c||new Set,c.add(a),u||(l.set(i,c),r.value={watchedNodeKeys:l}),a}}},dependencies:[Ds],name:"@lexical/extension/NodeSelection"}),ux=Le("INSERT_HORIZONTAL_RULE_COMMAND"),dn=class n extends es{static getType(){return"horizontalrule"}static clone(e){return new n(e.__key)}static importJSON(e){return fl().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:dx,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){let t=document.createElement("hr");return Wo(t,e.theme.hr),t}getTextContent(){return`
16
+ `}isInline(){return!1}updateDOM(){return!1}};function dx(){return{node:fl()}}function fl(){return ad(dn)}function Ng(n){return n instanceof dn}var fx=Z({dependencies:[Ds,ll],name:"@lexical/extension/HorizontalRule",nodes:()=>[dn],register(n,e,t){let{watchNodeKey:o}=t.getDependency(ll).output,r=Gn({nodeSelections:new Map}),s=n._config.theme.hrSelected??"selected";return rt(n.registerCommand(qr,i=>{if(Un(i.target)){let a=gd(i.target);if(Ng(a))return(function(l,c=!1){let u=R(),d=l.isSelected(),f=l.getKey(),h;c&&he(u)?h=u:(h=ld(),Ge(h)),d?h.delete(f):h.add(f)})(a,i.shiftKey),!0}return!1},ie),n.registerMutationListener(dn,(i,a)=>{ig(()=>{let l=!1,{nodeSelections:c}=r.peek();for(let[u,d]of i.entries())if(d==="destroyed")c.delete(u),l=!0;else{let f=c.get(u),h=n.getElementByKey(u);f?f.domNode.value=h:(l=!0,c.set(u,{domNode:Gn(h),selectedSignal:o(u)}))}l&&(r.value={nodeSelections:c})})}),Ht(()=>{let i=[];for(let{domNode:a,selectedSignal:l}of r.value.nodeSelections.values())i.push(Ht(()=>{let c=a.value;c&&(l.value?Wo(c,s):ps(c,s))}));return rt(...i)}))}});function Cg(n){return n.canBeEmpty()}function Sg(n,e,t=Cg){return rt(n.registerCommand(cs,o=>{let r=R();if(!D(r))return!1;o.preventDefault();let s=(function(i){if(i.getNodes().filter(f=>Bn(f)&&f.canIndent()).length>0)return!0;let a=i.anchor,l=i.focus,c=l.isBefore(a)?l:a,u=c.getNode(),d=Cs(u);if(d.canIndent()){let f=d.getKey(),h=Fn();if(h.anchor.set(f,0,"element"),h.focus.set(f,0,"element"),h=Bt(h),h.anchor.is(c))return!0}return!1})(r)?o.shiftKey?Bo:wo:os;return n.dispatchCommand(s,void 0)},W),n.registerCommand(wo,()=>{let o=typeof e=="number"?e:e?e.peek():null,r=R();if(!D(r))return!1;let s=typeof t=="function"?t:t.peek();return Ho(i=>{if(s(i)){let a=i.getIndent()+1;(!o||a<o)&&i.setIndent(a)}})},Xr))}var gx=Z({build:(n,e,t)=>Rs(e),config:ye({$canIndent:Cg,disabled:!1,maxIndent:null}),name:"@lexical/extension/TabIndentation",register(n,e,t){let{disabled:o,maxIndent:r,$canIndent:s}=t.getOutput();return Ht(()=>{if(!o.value)return Sg(n,r,s)})}});var z=gl,tS=z.$createHorizontalRuleNode,nS=z.$isDecoratorTextNode,oS=z.$isHorizontalRuleNode,rS=z.AutoFocusExtension,sS=z.ClearEditorExtension,iS=z.DecoratorTextExtension,aS=z.DecoratorTextNode,lS=z.EditorStateExtension,cS=z.HorizontalRuleExtension,uS=z.HorizontalRuleNode,dS=z.INSERT_HORIZONTAL_RULE_COMMAND,fS=z.InitialStateExtension,gS=z.LexicalBuilder,hS=z.NodeSelectionExtension,pS=z.TabIndentationExtension,mS=z.applyFormatFromStyle,_S=z.applyFormatToDom,Tg=z.batch,xS=z.buildEditorFromExtensions,yS=z.computed,NS=z.configExtension,CS=z.declarePeerDependency,SS=z.defineExtension,qe=z.effect,TS=z.getExtensionDependencyFromEditor,ES=z.getKnownTypesAndNodes,Eg=z.getPeerDependencyFromEditor,OS=z.getPeerDependencyFromEditorOrThrow,Et=z.namedSignals,MS=z.registerClearEditor,vS=z.registerTabIndentation,AS=z.safeCast,DS=z.shallowMergeConfig,bS=z.signal,RS=z.untracked,kS=z.watchedSignal;var hl={};we(hl,{DragonExtension:()=>hx,registerDragonSupport:()=>Og});function Og(n){let e=window.location.origin,t=o=>{if(o.origin!==e)return;let r=n.getRootElement();if(document.activeElement!==r)return;let s=o.data;if(typeof s=="string"){let i;try{i=JSON.parse(s)}catch{return}if(i&&i.protocol==="nuanria_messaging"&&i.type==="request"){let a=i.payload;if(a&&a.functionId==="makeChanges"){let l=a.args;if(l){let[c,u,d,f,h]=l;n.update(()=>{let g=R();if(D(g)){let p=g.anchor,m=p.getNode(),x=0,y=0;if(B(m)&&c>=0&&u>=0&&(x=c,y=c+u,g.setTextNodeRange(m,x,m,y)),x===y&&d===""||(g.insertRawText(d),m=p.getNode()),B(m)){x=f,y=f+h;let N=m.getTextContentSize();x=x>N?N:x,y=y>N?N:y,g.setTextNodeRange(m,x,m,y)}o.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}var hx=Z({build:(n,e,t)=>Et(e),config:ye({disabled:typeof window>"u"}),name:"@lexical/dragon",register:(n,e,t)=>qe(()=>t.getOutput().disabled.value?void 0:Og(n))});var Mg=hl,vg=Mg.DragonExtension,PS=Mg.registerDragonSupport;var xl={};we(xl,{$createHeadingNode:()=>Vn,$createQuoteNode:()=>_l,$isHeadingNode:()=>Tx,$isQuoteNode:()=>Cx,DRAG_DROP_PASTE:()=>ml,HeadingNode:()=>Xn,QuoteNode:()=>qn,RichTextExtension:()=>Ex,eventFiles:()=>Jo,registerRichText:()=>kg});function Ag(n,e){if(document.caretRangeFromPoint!==void 0){let t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){let t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}var fn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,px=fn&&"documentMode"in document?document.documentMode:null,mx=fn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),_x=!(!fn||!("InputEvent"in window)||px)&&"getTargetRanges"in new window.InputEvent("input"),xx=fn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Dg=fn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,yx=fn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Nx=fn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&mx&&!yx,ml=Le("DRAG_DROP_PASTE_FILE"),qn=class n extends ot{static getType(){return"quote"}static clone(e){return new n(e.__key)}createDOM(e){let t=document.createElement("blockquote");return Ut(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:Sx,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Pe(t)){this.isEmpty()&&t.append(document.createElement("br"));let o=this.getFormatType();o&&(t.style.textAlign=o);let r=this.getDirection();r&&(t.dir=r)}return{element:t}}static importJSON(e){return _l().updateFromJSON(e)}insertNewAfter(e,t){let o=se(),r=this.getDirection();return o.setDirection(r),this.insertAfter(o,t),o}collapseAtStart(){let e=se();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function _l(){return Nt(new qn)}function Cx(n){return n instanceof qn}var Xn=class n extends ot{__tag;static getType(){return"heading"}static clone(e){return new n(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,o=document.createElement(t),r=e.theme.heading;if(r!==void 0){let s=r[t];Ut(o,s)}return o}updateDOM(e,t,o){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Jn,priority:0}),h2:e=>({conversion:Jn,priority:0}),h3:e=>({conversion:Jn,priority:0}),h4:e=>({conversion:Jn,priority:0}),h5:e=>({conversion:Jn,priority:0}),h6:e=>({conversion:Jn,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&bg(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>bg(e)?{conversion:t=>({node:Vn("h1")}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if(Pe(t)){this.isEmpty()&&t.append(document.createElement("br"));let o=this.getFormatType();o&&(t.style.textAlign=o);let r=this.getDirection();r&&(t.dir=r)}return{element:t}}static importJSON(e){return Vn(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 o=e?e.anchor.offset:0,r=this.getLastDescendant(),s=!r||e&&e.anchor.key===r.getKey()&&o===r.getTextContentSize()||!e?se():Vn(this.getTag()),i=this.getDirection();if(s.setDirection(i),this.insertAfter(s,t),o===0&&!this.isEmpty()&&e){let a=se();a.select(),this.replace(a,!0)}return s}collapseAtStart(){let e=this.isEmpty()?se():Vn(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function bg(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function Jn(n){let e=n.nodeName.toLowerCase(),t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Vn(e),n.style!==null&&(ba(n,t),t.setFormat(n.style.textAlign))),{node:t}}function Sx(n){let e=_l();return n.style!==null&&(e.setFormat(n.style.textAlign),ba(n,e)),{node:e}}function Vn(n="h1"){return Nt(new Xn(n))}function Tx(n){return n instanceof Xn}function Jo(n){let e=null;if(Ve(n,DragEvent)?e=n.dataTransfer:Ve(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];let t=e.types,o=t.includes("Files"),r=t.includes("text/html")||t.includes("text/plain");return[o,Array.from(e.files),r]}function Rg(n){let e=nt(n);return an(e)}function pl(n){for(let e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function kg(n){return Je(n.registerCommand(qr,e=>{let t=R();return!!he(t)&&(t.clear(),!0)},W),n.registerCommand(Zr,e=>{let t=R();return D(t)?(t.deleteCharacter(e),!0):!!he(t)&&(t.deleteNodes(),!0)},W),n.registerCommand(Dd,e=>{let t=R();return!!D(t)&&(t.deleteWord(e),!0)},W),n.registerCommand(Ad,e=>{let t=R();return!!D(t)&&(t.deleteLine(e),!0)},W),n.registerCommand(Md,e=>{let t=R();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;let o=e.dataTransfer;if(o!=null)Xa(o,t,n);else if(D(t)){let r=e.data;return r&&t.insertText(r),!0}}return!0},W),n.registerCommand(zd,()=>{let e=R();return!!D(e)&&(e.removeText(),!0)},W),n.registerCommand(Tt,e=>{let t=R();return!!D(t)&&(t.formatText(e),!0)},W),n.registerCommand(Id,e=>{let t=R();if(!D(t)&&!he(t))return!1;let o=t.getNodes();for(let r of o){let s=be(r,i=>$(i)&&!i.isInline());s!==null&&s.setFormat(e)}return!0},W),n.registerCommand(Oa,e=>{let t=R();return!!D(t)&&(t.insertLineBreak(e),!0)},W),n.registerCommand(Fo,()=>{let e=R();return!!D(e)&&(e.insertParagraph(),!0)},W),n.registerCommand(os,()=>{let e=Wr(),t=R();return D(t)&&(e.setFormat(t.format),e.setStyle(t.style)),Hr([e]),!0},W),n.registerCommand(wo,()=>Ho(e=>{let t=e.getIndent();e.setIndent(t+1)}),W),n.registerCommand(Bo,()=>Ho(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),W),n.registerCommand(is,e=>{let t=R();if(he(t)){let o=t.getNodes();if(o.length>0)return e.preventDefault(),o[0].selectPrevious(),!0}else if(D(t)){let o=ya(t.focus,!0);if(!e.shiftKey&&an(o)&&!o.isIsolated()&&!o.isInline())return o.selectPrevious(),e.preventDefault(),!0}return!1},W),n.registerCommand(rs,e=>{let t=R();if(he(t)){let o=t.getNodes();if(o.length>0)return e.preventDefault(),o[0].selectNext(0,0),!0}else if(D(t)){if((function(r){let s=r.focus;return s.key==="root"&&s.offset===Ce().getChildrenSize()})(t))return e.preventDefault(),!0;let o=ya(t.focus,!1);if(!e.shiftKey&&an(o)&&!o.isIsolated()&&!o.isInline())return o.selectNext(),e.preventDefault(),!0}return!1},W),n.registerCommand(ss,e=>{let t=R();if(he(t)){let o=t.getNodes();if(o.length>0)return e.preventDefault(),Fa(o[0])?o[0].selectNext(0,0):o[0].selectPrevious(),!0}if(!D(t))return!1;if(Ba(t,!0)){let o=e.shiftKey;return e.preventDefault(),Ka(t,o,!0),!0}return!1},W),n.registerCommand(Ld,e=>{let t=R();if(he(t)){let r=t.getNodes();if(r.length>0)return e.preventDefault(),Fa(r[0])?r[0].selectPrevious():r[0].selectNext(0,0),!0}if(!D(t))return!1;let o=e.shiftKey;return!!Ba(t,!1)&&(e.preventDefault(),Ka(t,o,!1),!0)},W),n.registerCommand(Pd,e=>{if(Rg(e.target))return!1;let t=R();if(D(t)){if((function(o){if(!o.isCollapsed())return!1;let{anchor:r}=o;if(r.offset!==0)return!1;let s=r.getNode();if(ln(s))return!1;let i=Cs(s);return i.getIndent()>0&&(i.is(s)||s.is(i.getFirstDescendant()))})(t))return e.preventDefault(),n.dispatchCommand(Bo,void 0);if(Dg&&navigator.language==="ko-KR")return!1}else if(!he(t))return!1;return e.preventDefault(),n.dispatchCommand(Zr,!0)},W),n.registerCommand(wd,e=>{if(Rg(e.target))return!1;let t=R();return!(!D(t)&&!he(t))&&(e.preventDefault(),n.dispatchCommand(Zr,!1))},W),n.registerCommand(Fd,e=>{let t=R();if(!D(t))return!1;if(pl(t),e!==null){if((Dg||xx||Nx)&&_x)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(Oa,!1)}return n.dispatchCommand(Fo,void 0)},W),n.registerCommand(as,()=>{let e=R();return!!D(e)&&(n.blur(),!0)},W),n.registerCommand(kd,e=>{let[,t]=Jo(e);if(t.length>0){let r=Ag(e.clientX,e.clientY);if(r!==null){let{offset:s,node:i}=r,a=nt(i);if(a!==null){let l=Fn();if(B(a))l.anchor.set(a.getKey(),s,"text"),l.focus.set(a.getKey(),s,"text");else{let u=a.getParentOrThrow().getKey(),d=a.getIndexWithinParent()+1;l.anchor.set(u,d,"element"),l.focus.set(u,d,"element")}let c=Bt(l);Ge(c)}n.dispatchCommand(ml,t)}return e.preventDefault(),!0}let o=R();return!!D(o)},W),n.registerCommand(Rd,e=>{let[t]=Jo(e),o=R();return!(t&&!D(o))},W),n.registerCommand(bd,e=>{let[t]=Jo(e),o=R();if(t&&!D(o))return!1;let r=Ag(e.clientX,e.clientY);if(r!==null){let s=nt(r.node);an(s)&&e.preventDefault()}return!0},W),n.registerCommand(Gd,()=>(jr(),!0),W),n.registerCommand(Qr,e=>(Qa(n,Ve(e,ClipboardEvent)?e:null),!0),W),n.registerCommand(vd,e=>((async function(t,o){await Qa(o,Ve(t,ClipboardEvent)?t:null),o.update(()=>{let r=R();D(r)?r.removeText():he(r)&&r.getNodes().forEach(s=>s.remove())})})(e,n),!0),W),n.registerCommand(us,e=>{let[,t,o]=Jo(e);return t.length>0&&!o?(n.dispatchCommand(ml,t),!0):Un(e.target)&&sf(e.target)?!1:R()!==null&&((function(r,s){r.preventDefault(),s.update(()=>{let i=R(),a=Ve(r,InputEvent)||Ve(r,KeyboardEvent)?null:r.clipboardData;a!=null&&i!==null&&Xa(a,i,s)},{tag:Bd})})(e,n),!0)},W),n.registerCommand(ls,e=>{let t=R();return D(t)&&pl(t),!1},W),n.registerCommand(cs,e=>{let t=R();return D(t)&&pl(t),!1},W))}var Ex=Z({conflictsWith:["@lexical/plain-text"],dependencies:[vg],name:"@lexical/rich-text",nodes:()=>[Xn,qn],register:kg});var at=xl,Ig=at.$createHeadingNode,$g=at.$createQuoteNode,zS=at.$isHeadingNode,HS=at.$isQuoteNode,YS=at.DRAG_DROP_PASTE,Lg=at.HeadingNode,Pg=at.QuoteNode,GS=at.RichTextExtension,jS=at.eventFiles,wg=at.registerRichText;var Tl={};we(Tl,{$createListItemNode:()=>Re,$createListNode:()=>Oe,$getListDepth:()=>ks,$handleListInsertParagraph:()=>Jg,$insertList:()=>Vo,$isListItemNode:()=>U,$isListNode:()=>K,$removeList:()=>Sl,CheckListExtension:()=>kx,INSERT_CHECK_LIST_COMMAND:()=>Vg,INSERT_ORDERED_LIST_COMMAND:()=>Zg,INSERT_UNORDERED_LIST_COMMAND:()=>Qg,ListExtension:()=>oh,ListItemNode:()=>Gt,ListNode:()=>hn,REMOVE_LIST_COMMAND:()=>eh,UPDATE_LIST_START_COMMAND:()=>Xg,insertList:()=>bx,registerCheckList:()=>qg,registerList:()=>th,registerListStrictIndentTransform:()=>nh,removeList:()=>Rx});function Yt(n,...e){let t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",n);for(let r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ks(n){let e=1,t=n.getParent();for(;t!=null;){if(U(t)){let o=t.getParent();if(K(o)){e++,t=o.getParent();continue}Yt(40)}return e}return e}function yl(n){let e=n.getParent();K(e)||Yt(40);let t=e;for(;t!==null;)t=t.getParent(),K(t)&&(e=t);return e}function Yg(n){let e=[],t=n.getChildren().filter(U);for(let o=0;o<t.length;o++){let r=t[o],s=r.getFirstChild();K(s)?e=e.concat(Yg(s)):e.push(r)}return e}function lt(n){return U(n)&&K(n.getFirstChild())}function Fg(n){return Re().append(n)}function Gg(n,e){return U(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function Vo(n){let e=R();if(e!==null){let t=e.getNodes();if(D(e)){let r=e.getStartEndPoints();r===null&&Yt(143);let[s]=r,i=s.getNode(),a=i.getParent();if($e(i)){let l=i.getFirstChild();if(l)t=l.selectStart().getNodes();else{let c=se();i.append(c),t=c.select().getNodes()}}else if(Gg(i,t)){let l=Oe(n);if($e(a)){i.replace(l);let c=Re();$(i)&&(c.setFormat(i.getFormatType()),c.setIndent(i.getIndent())),l.append(c)}else if(U(i)){let c=i.getParentOrThrow();gn(l,c.getChildren()),c.replace(l)}return}}let o=new Set;for(let r=0;r<t.length;r++){let s=t[r];if($(s)&&s.isEmpty()&&!U(s)&&!o.has(s.getKey())){Kg(s,n);continue}let i=Io(s)?s.getParent():U(s)&&s.isEmpty()?s:null;for(;i!=null;){let a=i.getKey();if(K(i)){if(!o.has(a)){let l=Oe(n);gn(l,i.getChildren()),i.replace(l),o.add(a)}break}{let l=i.getParent();if($e(l)&&!o.has(a)){o.add(a),Kg(i,n);break}i=l}}}}}function gn(n,e){n.splice(n.getChildrenSize(),0,e)}function Kg(n,e){if(K(n))return n;let t=n.getPreviousSibling(),o=n.getNextSibling(),r=Re(),s;if(gn(r,n.getChildren()),K(t)&&e===t.getListType())t.append(r),K(o)&&e===o.getListType()&&(gn(t,o.getChildren()),o.remove()),s=t;else if(K(o)&&e===o.getListType())o.getFirstChildOrThrow().insertBefore(r),s=o;else{let a=Oe(e);a.append(r),n.replace(a),s=a}r.setFormat(n.getFormatType()),r.setIndent(n.getIndent());let i=R();return D(i)&&(s.getKey()===i.anchor.key&&i.anchor.set(r.getKey(),i.anchor.offset,"element"),s.getKey()===i.focus.key&&i.focus.set(r.getKey(),i.focus.offset,"element")),n.remove(),s}function Cl(n,e){let t=n.getLastChild(),o=e.getFirstChild();t&&o&&lt(t)&&lt(o)&&(Cl(t.getFirstChild(),o.getFirstChild()),o.remove());let r=e.getChildren();r.length>0&&n.append(...r),e.remove()}function Sl(){let n=R();if(D(n)){let e=new Set,t=n.getNodes(),o=n.anchor.getNode();if(Gg(o,t))e.add(yl(o));else for(let r=0;r<t.length;r++){let s=t[r];if(Io(s)){let i=Kf(s,Gt);i!=null&&e.add(yl(i))}}for(let r of e){let s=r,i=Yg(r);for(let a of i){let l=se().setTextStyle(n.style).setTextFormat(n.format);gn(l,a.getChildren()),s.insertAfter(l),s=l,a.__key===n.anchor.key&&$o(n.anchor,cn(De(l,"next"))),a.__key===n.focus.key&&$o(n.focus,cn(De(l,"next"))),a.remove()}r.remove()}}}function jg(n){let e=n.getListType()!=="check",t=n.getStart();for(let o of n.getChildren())U(o)&&(o.getValue()!==t&&o.setValue(t),e&&o.getLatest().__checked!=null&&o.setChecked(void 0),K(o.getFirstChild())||t++)}function Ox(n){let e=new Set;if(lt(n)||e.has(n.getKey()))return;let t=n.getParent(),o=n.getNextSibling(),r=n.getPreviousSibling();if(lt(o)&&lt(r)){let s=r.getFirstChild();if(K(s)){s.append(n);let i=o.getFirstChild();K(i)&&(gn(s,i.getChildren()),o.remove(),e.add(o.getKey()))}}else if(lt(o)){let s=o.getFirstChild();if(K(s)){let i=s.getFirstChild();i!==null&&i.insertBefore(n)}}else if(lt(r)){let s=r.getFirstChild();K(s)&&s.append(n)}else if(K(t)){let s=Re().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),i=Oe(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());s.append(i),i.append(n),r?r.insertAfter(s):o?o.insertBefore(s):t.append(s)}}function Mx(n){if(lt(n))return;let e=n.getParent(),t=e?e.getParent():void 0;if(K(t?t.getParent():void 0)&&U(t)&&K(e)){let o=e?e.getFirstChild():void 0,r=e?e.getLastChild():void 0;if(n.is(o))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(r))t.insertAfter(n),e.isEmpty()&&t.remove();else{let s=e.getListType(),i=Re(),a=Oe(s);i.append(a),n.getPreviousSiblings().forEach(u=>a.append(u));let l=Re(),c=Oe(s);l.append(c),gn(c,n.getNextSiblings()),t.insertBefore(i),t.insertAfter(l),t.replace(n)}}}function Jg(n=!1){let e=R();if(!D(e)||!e.isCollapsed())return!1;let t=e.anchor.getNode(),o=null;if(U(t)&&t.getChildrenSize()===0)o=t;else if(B(t)){let c=t.getParent();U(c)&&c.getChildren().every(u=>B(u)&&u.getTextContent().trim()==="")&&(o=c)}if(o===null)return!1;let r=yl(o),s=o.getParent();K(s)||Yt(40);let i=s.getParent(),a;if($e(i))a=se(),r.insertAfter(a);else{if(!U(i))return!1;a=Re(),i.insertAfter(a)}a.setTextStyle(e.style).setTextFormat(e.format).select();let l=o.getNextSiblings();if(l.length>0){let c=n?(function(d,f){return d.getStart()+f.getIndexWithinParent()})(s,o):1,u=Oe(s.getListType(),c);if(U(a)){let d=Re();d.append(u),a.insertAfter(d)}else a.insertAfter(u);u.append(...l)}return(function(c){let u=c;for(;u.getNextSibling()==null&&u.getPreviousSibling()==null;){let d=u.getParent();if(d==null||!U(d)&&!K(d))break;u=d}u.remove()})(o),!0}var Gt=class extends ot{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;let t=e.getParent();K(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:ot,importDOM:Ma({li:()=>({conversion:vx,priority:0})})})}constructor(e=1,t=void 0,o){super(o),this.__value=e===void 0?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,o){(function(i,a,l){let c=a.getParent();!K(c)||c.getListType()!=="check"||K(a.getFirstChild())?(i.removeAttribute("role"),i.removeAttribute("tabIndex"),i.removeAttribute("aria-checked")):(i.setAttribute("role","checkbox"),i.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||i.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,(function(i,a,l){let c=[],u=[],d=a.list,f=d?d.listitem:void 0,h;if(d&&d.nested&&(h=d.nested.listitem),f!==void 0&&c.push(...zo(f)),d){let g=l.getParent(),p=K(g)&&g.getListType()==="check",m=l.getChecked();p&&!m||u.push(d.listitemUnchecked),p&&m||u.push(d.listitemChecked),p&&c.push(m?d.listitemChecked:d.listitemUnchecked)}if(h!==void 0){let g=zo(h);l.getChildren().some(p=>K(p))?c.push(...g):u.push(...g)}u.length>0&&ja(i,...u),c.length>0&&Ut(i,...c)})(t,o.theme,this);let r=e?e.__style:"",s=this.__style;r!==s&&(s===""?t.removeAttribute("style"):t.style.cssText=s),(function(i,a,l){let c=Wa(a.__textStyle);for(let u in c)i.style.setProperty(`--listitem-marker-${u}`,c[u]);if(l)for(let u in Wa(l.__textStyle))u in c||i.style.removeProperty(`--listitem-marker-${u}`)})(t,this,e)}updateDOM(e,t,o){let r=t;return this.updateListItemDOM(e,r,o),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),o=this.getFormatType();o&&(t.style.textAlign=o);let r=this.getDirection();return r&&(t.dir=r),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let o=e[t];if($(o)&&this.canMergeWith(o)){let r=o.getChildren();this.append(...r),o.remove()}else super.append(o)}return this}replace(e,t){if(U(e))return super.replace(e);this.setIndent(0);let o=this.getParentOrThrow();if(!K(o))return e;if(o.__first===this.getKey())o.insertBefore(e);else if(o.__last===this.getKey())o.insertAfter(e);else{let r=Oe(o.getListType()),s=this.getNextSibling();for(;s;){let i=s;s=s.getNextSibling(),r.append(i)}o.insertAfter(e),e.insertAfter(r)}return t&&($(e)||Yt(139),this.getChildren().forEach(r=>{e.append(r)})),this.remove(),o.getChildrenSize()===0&&o.remove(),e}insertAfter(e,t=!0){let o=this.getParentOrThrow();if(K(o)||Yt(39),U(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(o.insertAfter(e,t),r.length!==0){let s=Oe(o.getListType());r.forEach(i=>s.append(i)),e.insertAfter(s,t)}return e}remove(e){let t=this.getPreviousSibling(),o=this.getNextSibling();super.remove(e),t&&o&&lt(t)&&lt(o)&&(Cl(t.getFirstChild(),o.getFirstChild()),o.remove())}insertNewAfter(e,t=!0){let o=Re().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(o,t),o}collapseAtStart(e){let t=se();this.getChildren().forEach(i=>t.append(i));let o=this.getParentOrThrow(),r=o.getParentOrThrow(),s=U(r);if(o.getChildrenSize()===1)if(s)o.remove(),r.select();else{o.insertBefore(t),o.remove();let i=e.anchor,a=e.focus,l=t.getKey();i.type==="element"&&i.getNode().is(this)&&i.set(l,i.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else o.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=this.getLatest(),t,o=this.getParent();return K(o)&&(t=o.getListType()),t==="check"?!!e.__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(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),o=0;for(;U(t);)t=t.getParentOrThrow().getParentOrThrow(),o++;return o}setIndent(e){typeof e!="number"&&Yt(117),(e=Math.floor(e))>=0||Yt(199);let t=this.getIndent();for(;t!==e;)t<e?(Ox(this),t++):(Mx(this),t--);return this}canInsertAfter(e){return U(e)}canReplaceWith(e){return U(e)}canMergeWith(e){return U(e)||_d(e)}extractWithChild(e,t){if(!D(t))return!1;let o=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(o)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Oe("bullet")}canMergeWhenEmpty(){return!0}};function vx(n){if(n.classList.contains("task-list-item")){for(let t of n.children)if(t.tagName==="INPUT")return Bg(t)}if(n.classList.contains("joplin-checkbox")){for(let t of n.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&t.children[0].tagName==="INPUT")return Bg(t.children[0])}let e=n.getAttribute("aria-checked");return{node:Re(e==="true"||e!=="false"&&void 0)}}function Bg(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:Re(n.hasAttribute("checked"))}}function Re(n){return Nt(new Gt(void 0,n))}function U(n){return n instanceof Gt}var hn=class extends ot{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){let o=t.getNextSibling();K(o)&&t.getListType()===o.getListType()&&Cl(t,o)})(e),jg(e)},extends:ot,importDOM:Ma({ol:()=>({conversion:Ug,priority:0}),ul:()=>({conversion:Ug,priority:0})})})}constructor(e="number",t=1,o){super(o);let r=Dx[e]||e;this.__listType=r,this.__tag=r==="number"?"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=e==="number"?"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 o=this.__tag,r=document.createElement(o);return this.__start!==1&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,Wg(r,e.theme,this),r}updateDOM(e,t,o){return e.__tag!==this.__tag||e.__listType!==this.__listType||(Wg(t,o.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 Pe(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&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,o){let r=o;for(let s=0;s<o.length;s++){let i=o[s];U(i)||(r===o&&(r=[...o]),r[s]=Re().append(!$(i)||K(i)||i.isInline()?i:Kt(i.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return U(e)}};function Wg(n,e,t){let o=[],r=[],s=e.list;if(s!==void 0){let i=s[`${t.__tag}Depth`]||[],a=ks(t)-1,l=a%i.length,c=i[l],u=s[t.__tag],d,f=s.nested,h=s.checklist;if(f!==void 0&&f.list&&(d=f.list),u!==void 0&&o.push(u),h!==void 0&&t.__listType==="check"&&o.push(h),c!==void 0){o.push(...zo(c));for(let g=0;g<i.length;g++)g!==l&&r.push(t.__tag+g)}if(d!==void 0){let g=zo(d);a>1?o.push(...g):r.push(...g)}}r.length>0&&ja(n,...r),o.length>0&&Ut(n,...o)}function Ax(n){let e=[];for(let t=0;t<n.length;t++){let o=n[t];if(U(o)){e.push(o);let r=o.getChildren();r.length>1&&r.forEach(s=>{K(s)&&e.push(Fg(s))})}else e.push(Fg(o))}return e}function Ug(n){let e=n.nodeName.toLowerCase(),t=null;return e==="ol"?t=Oe("number",n.start):e==="ul"&&(t=(function(o){if(o.getAttribute("__lexicallisttype")==="check"||o.classList.contains("contains-task-list")||o.getAttribute("data-is-checklist")==="1")return!0;for(let r of o.childNodes)if(Pe(r)&&r.hasAttribute("aria-checked"))return!0;return!1})(n)?Oe("check"):Oe("bullet")),{after:Ax,node:t}}var Dx={ol:"number",ul:"bullet"};function Oe(n="number",e=1){return Nt(new hn(n,e))}function K(n){return n instanceof hn}var Vg=Le("INSERT_CHECK_LIST_COMMAND");function qg(n,e){let t=e&&e.disableTakeFocusOnClick||!1,o=s=>{(function(i,a){zg(i,()=>{if(Pe(i.target)){let l=i.target,c=gs(l);c!=null&&c.isEditable()&&c.update(()=>{let u=nt(l);U(u)&&(a?(ma(Jd),ma(jd)):l.focus(),u.toggleChecked())})}})})(s,t)},r=s=>{(function(i,a){zg(i,()=>{i.preventDefault(),a&&i.stopPropagation()})})(s,t)};return Je(n.registerCommand(Vg,()=>(Vo("check"),!0),ie),n.registerCommand(rs,s=>Hg(s,n,!1),ie),n.registerCommand(is,s=>Hg(s,n,!0),ie),n.registerCommand(as,()=>{if(Nl()!=null){let s=n.getRootElement();return s?.focus(),!0}return!1},ie),n.registerCommand(ls,s=>{let i=Nl();return!(i==null||!n.isEditable())&&(n.update(()=>{let a=nt(i);U(a)&&(s.preventDefault(),a.toggleChecked())}),!0)},ie),n.registerCommand(ss,s=>n.getEditorState().read(()=>{let i=R();if(D(i)&&i.isCollapsed()){let{anchor:a}=i,l=a.type==="element";if(l||a.offset===0){let c=a.getNode(),u=be(c,d=>$(d)&&!d.isInline());if(U(u)){let d=u.getParent();if(K(d)&&d.getListType()==="check"&&(l||u.getFirstDescendant()===c)){let f=n.getElementByKey(u.__key);if(f!=null&&document.activeElement!==f)return f.focus(),s.preventDefault(),!0}}}}return!1}),ie),n.registerRootListener((s,i)=>{s!==null&&(s.addEventListener("click",o),s.addEventListener("pointerdown",r,{capture:!0}),s.addEventListener("mousedown",r,{capture:!0}),s.addEventListener("touchstart",r,{capture:!0,passive:!1})),i!==null&&(i.removeEventListener("click",o),i.removeEventListener("pointerdown",r,{capture:!0}),i.removeEventListener("mousedown",r,{capture:!0}),i.removeEventListener("touchstart",r,{capture:!0}))}))}function zg(n,e){let t=n.target;if(!Pe(t))return;let o=t.firstChild;if(Pe(o)&&(o.tagName==="UL"||o.tagName==="OL"))return;let r=t.parentNode;if(!r||r.__lexicalListType!=="check")return;let s=null,i=null;if("clientX"in n)s=n.clientX;else if("touches"in n){let f=n.touches;f.length>0&&(s=f[0].clientX,i="touch")}if(s==null)return;let a=t.getBoundingClientRect(),l=s/Wf(t),c=window.getComputedStyle?window.getComputedStyle(t,"::before"):{width:"0px"},u=parseFloat(c.width),d=i==="touch"||n.pointerType==="touch"?32:0;(t.dir==="rtl"?l<a.right+d&&l>a.right-u-d:l>a.left-d&&l<a.left+u+d)&&e()}function Nl(){let n=document.activeElement;return Pe(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function Hg(n,e,t){let o=Nl();return o!=null&&e.update(()=>{let r=nt(o);if(!U(r))return;let s=(function(i,a){let l=a?i.getPreviousSibling():i.getNextSibling(),c=i;for(;l==null&&U(c);)c=c.getParentOrThrow().getParent(),c!=null&&(l=a?c.getPreviousSibling():c.getNextSibling());for(;U(l);){let u=a?l.getLastChild():l.getFirstChild();if(!K(u))return l;l=a?u.getLastChild():u.getFirstChild()}return null})(r,t);if(s!=null){s.selectStart();let i=e.getElementByKey(s.__key);i!=null&&(n.preventDefault(),setTimeout(()=>{i.focus()},0))}}),!1}var Xg=Le("UPDATE_LIST_START_COMMAND"),Qg=Le("INSERT_UNORDERED_LIST_COMMAND"),Zg=Le("INSERT_ORDERED_LIST_COMMAND"),eh=Le("REMOVE_LIST_COMMAND");function th(n,e){return Je(n.registerCommand(Zg,()=>(Vo("number"),!0),ie),n.registerCommand(Xg,t=>{let{listNodeKey:o,newStart:r}=t,s=Kn(o);return!!K(s)&&(s.getListType()==="number"&&(s.setStart(r),jg(s)),!0)},ie),n.registerCommand(Qg,()=>(Vo("bullet"),!0),ie),n.registerCommand(eh,()=>(Sl(),!0),ie),n.registerCommand(Fo,()=>Jg(!!(e&&e.restoreNumbering)),ie),n.registerNodeTransform(Gt,t=>{let o=t.getFirstChild();if(o){if(B(o)){let r=o.getStyle(),s=o.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==s&&t.setTextFormat(s)}}else{let r=R();D(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),n.registerNodeTransform(Wn,t=>{let o=t.getParent();if(U(o)&&t.is(o.getFirstChild())){let r=t.getStyle(),s=t.getFormat();r===o.getTextStyle()&&s===o.getTextFormat()||o.setTextStyle(r).setTextFormat(s)}}))}function nh(n){let e=t=>{let o=t.getParent();if(K(t.getFirstChild())||!K(o))return;let r=be(t,s=>U(s)&&K(s.getParent())&&U(s.getPreviousSibling()));if(r===null&&t.getIndent()>0)t.setIndent(0);else if(U(r)){let s=r.getPreviousSibling();if(U(s)){let i=(function(l){let c=l,u=c.getFirstChild();for(;K(u);){let d=u.getLastChild();if(!U(d))break;c=d,u=c.getFirstChild()}return c})(s),a=i.getParent();if(K(a)){let l=ks(a);l+1<ks(o)&&t.setIndent(l)}}}};return n.registerNodeTransform(hn,t=>{let o=[t];for(;o.length>0;){let r=o.shift();if(K(r)){for(let s of r.getChildren())if(U(s)){e(s);let i=s.getFirstChild();K(i)&&o.push(i)}}}})}function bx(n,e){n.update(()=>Vo(e))}function Rx(n){n.update(()=>Sl())}var oh=Z({build:(n,e,t)=>Et(e),config:ye({hasStrictIndent:!1,shouldPreserveNumbering:!1}),name:"@lexical/list/List",nodes:()=>[hn,Gt],register(n,e,t){let o=t.getOutput();return Je(qe(()=>th(n,{restoreNumbering:o.shouldPreserveNumbering.value})),qe(()=>o.hasStrictIndent.value?nh(n):void 0))}}),kx=Z({config:ye({disableTakeFocusOnClick:!1}),dependencies:[oh],name:"@lexical/list/CheckList",register:qg});var ne=Tl,ZS=ne.$createListItemNode,eT=ne.$createListNode,tT=ne.$getListDepth,nT=ne.$handleListInsertParagraph,oT=ne.$insertList,rT=ne.$isListItemNode,sT=ne.$isListNode,iT=ne.$removeList,aT=ne.CheckListExtension,lT=ne.INSERT_CHECK_LIST_COMMAND,rh=ne.INSERT_ORDERED_LIST_COMMAND,sh=ne.INSERT_UNORDERED_LIST_COMMAND,cT=ne.ListExtension,ih=ne.ListItemNode,ah=ne.ListNode,uT=ne.REMOVE_LIST_COMMAND,dT=ne.UPDATE_LIST_START_COMMAND,fT=ne.insertList,gT=ne.registerCheckList,lh=ne.registerList,hT=ne.registerListStrictIndentTransform,pT=ne.removeList;var Al={};we(Al,{$createAutoLinkNode:()=>Is,$createLinkNode:()=>pn,$isAutoLinkNode:()=>Me,$isLinkNode:()=>Xe,$toggleLink:()=>qo,AutoLinkExtension:()=>zx,AutoLinkNode:()=>Qn,ClickableLinkExtension:()=>wx,LinkExtension:()=>vl,LinkNode:()=>jt,TOGGLE_LINK_COMMAND:()=>$s,createLinkMatcherWithRegExp:()=>Fx,formatUrl:()=>El,registerAutoLink:()=>yh,registerClickableLink:()=>hh,registerLink:()=>gh,toggleLink:()=>Hx});var Ix=new Set(["http:","https:","mailto:","sms:","tel:"]),jt=class n extends ot{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new n(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},o){super(o);let{target:r=null,rel:s=null,title:i=null}=t;this.__url=e,this.__target=r,this.__rel=s,this.__title=i}createDOM(e){let t=document.createElement("a");return this.updateLinkDOM(null,t,e),Ut(t,e.theme.link),t}updateLinkDOM(e,t,o){if(Ss(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let r of["target","rel","title"]){let s=`__${r}`,i=this[s];e&&e[s]===i||(i?t[r]=i:t.removeAttribute(r))}}}updateDOM(e,t,o){return this.updateLinkDOM(e,t,o),!1}static importDOM(){return{a:e=>({conversion:Lx,priority:1})}}static importJSON(e){return pn().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=El(e);try{let t=new URL(El(e));if(!Ix.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let o=pn(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(o,t),o}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,o){if(!D(t))return!1;let r=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(s)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function ch(n){let e=Ft(n,"next");return[e,e.getFlipped()]}function uh(n,e){for(let t of e)if(t.origin.isAttached()){let o=cn(t);return void $o(n,o)}}function $x(n){let e=R(),t=null,o=null;D(e)&&(t=ch(e.anchor),o=ch(e.focus));for(let r of De(n,"next")){let s=r.origin;if($(s)&&!s.isInline()){let i=s.getChildren();if(i.length>0){let a=id(n);a.append(...i),s.append(a)}Bf(s,Gr(r),{$shouldSplit:()=>!1})}}if(n.isEmpty()){let r=n.getParent();n.remove(),r&&r.isEmpty()&&r.remove()}D(e)&&(uh(e.anchor,t),uh(e.focus,o),Bt(e))}function Lx(n){let e=null;if(Ss(n)){let t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=pn(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function pn(n="",e){return Nt(new jt(n,e))}function Xe(n){return n instanceof jt}var Qn=class n extends jt{__isUnlinked;constructor(e="",t={},o){super(e,t,o),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new n(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,o){return super.updateDOM(e,t,o)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return Is().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let o=Is(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(o,t),o}};function Is(n="",e){return Nt(new Qn(n,e))}function Me(n){return n instanceof Qn}var $s=Le("TOGGLE_LINK_COMMAND");function dh(n,e){if(n.type==="element"){let t=n.getNode();return $(t)||(function(o,...r){let s=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",o);for(let a of r)i.append("v",a);throw s.search=i.toString(),Error(`Minified Lexical error #${o}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),t.getChildren()[n.offset+e]||null}return null}function qo(n,e={}){let t;if(n&&typeof n=="object"){let{url:u,...d}=n;t=u,e={...d,...e}}else t=n;let{target:o,title:r}=e,s=e.rel===void 0?"noreferrer":e.rel,i=R();if(i===null||!D(i)&&!he(i))return;if(he(i)){let u=i.getNodes();return u.length===0?void 0:void u.forEach(d=>{if(t===null){let f=be(d,h=>!Me(h)&&Xe(h));f&&(f.insertBefore(d),f.getChildren().length===0&&f.remove())}else{let f=be(d,h=>!Me(h)&&Xe(h));if(f)f.setURL(t),o!==void 0&&f.setTarget(o),s!==void 0&&f.setRel(s);else{let h=pn(t,{rel:s,target:o});d.insertBefore(h),h.append(d)}}})}if(i.isCollapsed()&&t===null)for(let u of i.getNodes()){let d=be(u,f=>!Me(f)&&Xe(f));return void(d!==null&&(d.getChildren().forEach(f=>{d.insertBefore(f)}),d.remove()))}let a=i.extract();if(t===null){let u=new Set;return void a.forEach(d=>{let f=be(d,h=>!Me(h)&&Xe(h));if(f!==null){let h=f.getKey();if(u.has(h))return;(function(g,p){let m=new Set(p.filter(C=>g.isParentOf(C)).map(C=>C.getKey())),x=g.getChildren(),y=C=>m.has(C.getKey())||$(C)&&p.some(S=>g.isParentOf(S)&&C.isParentOf(S)),N=x.filter(y);if(N.length===x.length)return x.forEach(C=>g.insertBefore(C)),void g.remove();let T=x.findIndex(y),O=x.findLastIndex(y),E=T===0,A=O===x.length-1;if(E)N.forEach(C=>g.insertBefore(C));else if(A)for(let C=N.length-1;C>=0;C--)g.insertAfter(N[C]);else{for(let S=N.length-1;S>=0;S--)g.insertAfter(N[S]);let C=x.slice(O+1);if(C.length>0){let S=pn(g.getURL(),{rel:g.getRel(),target:g.getTarget(),title:g.getTitle()});N[N.length-1].insertAfter(S),C.forEach(k=>S.append(k))}}})(f,a),u.add(h)}})}let l=new Set,c=u=>{l.has(u.getKey())||(l.add(u.getKey()),u.setURL(t),o!==void 0&&u.setTarget(o),s!==void 0&&u.setRel(s),r!==void 0&&u.setTitle(r))};if(a.length===1){let u=a[0],d=be(u,Xe);if(d!==null)return c(d)}(function(u){let d=R();if(!D(d))return u();let f=Bt(d),h=f.isBackward(),g=dh(f.anchor,h?-1:0),p=dh(f.focus,h?0:-1),m=u();if(g||p){let x=R();if(D(x)){let y=x.clone();if(g){let N=g.getParent();N&&y.anchor.set(N.getKey(),g.getIndexWithinParent()+(h?1:0),"element")}if(p){let N=p.getParent();N&&y.focus.set(N.getKey(),p.getIndexWithinParent()+(h?0:1),"element")}Ge(Bt(y))}}})(()=>{let u=null;for(let d of a){if(!d.isAttached())continue;let f=be(d,Xe);if(f){c(f);continue}if($(d)){if(!d.isInline())continue;if(Xe(d)){if(!(Me(d)||u!==null&&u.getParentOrThrow().isParentOf(d))){c(d),u=d;continue}for(let g of d.getChildren())d.insertBefore(g);d.remove();continue}}let h=d.getPreviousSibling();Xe(h)&&h.is(u)?h.append(d):(u=pn(t,{rel:s,target:o,title:r}),d.insertAfter(u),u.append(d))}})}var Px=/^\+?[0-9\s()-]{5,}$/;function El(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:Px.test(n)?`tel:${n}`:`https://${n}`}function gh(n,e){return Je(n.registerNodeTransform(jt,$x),qe(()=>n.registerCommand($s,t=>{let o=e.validateUrl.peek(),r=e.attributes.peek();if(t===null)return qo(null),!0;if(typeof t=="string")return!(o!==void 0&&!o(t))&&(qo(t,r),!0);{let{url:s,target:i,rel:a,title:l}=t;return qo(s,{...r,rel:a,target:i,title:l}),!0}},ie)),qe(()=>{let t=e.validateUrl.value;if(!t)return;let o=e.attributes.value;return n.registerCommand(us,r=>{let s=R();if(!D(s)||s.isCollapsed()||!Ve(r,ClipboardEvent)||r.clipboardData===null)return!1;let i=r.clipboardData.getData("text");return!!t(i)&&!s.getNodes().some(a=>$(a))&&(n.dispatchCommand($s,{...o,url:i}),r.preventDefault(),!0)},ie)}))}var vl=Z({build:(n,e,t)=>Et(e),config:{attributes:void 0,validateUrl:void 0},mergeConfig(n,e){let t=Wt(n,e);return n.attributes&&(t.attributes=Wt(n.attributes,t.attributes)),t},name:"@lexical/link/Link",nodes:()=>[jt],register:(n,e,t)=>gh(n,t.getOutput())});function hh(n,e,t={}){let o=s=>{let i=s.target;if(!Un(i))return;let a=gs(i);if(a===null)return;let l=null,c=null;if(a.update(()=>{let f=nt(i);if(f!==null){let h=be(f,$);if(!e.disabled.peek())if(Xe(h))l=h.sanitizeUrl(h.getURL()),c=h.getTarget();else{let g=(function(p,m){let x=p;for(;x!=null;){if(m(x))return x;x=x.parentNode}return null})(i,Ss);g!==null&&(l=g.href,c=g.target)}}}),l===null||l==="")return;let u=n.getEditorState().read(R);if(D(u)&&!u.isCollapsed())return void s.preventDefault();let d=s.type==="auxclick"&&s.button===1;window.open(l,e.newTab.peek()||d||s.metaKey||s.ctrlKey||c==="_blank"?"_blank":"_self"),s.preventDefault()},r=s=>{s.button===1&&o(s)};return n.registerRootListener((s,i)=>{i!==null&&(i.removeEventListener("click",o),i.removeEventListener("mouseup",r)),s!==null&&(s.addEventListener("click",o,t),s.addEventListener("mouseup",r,t))})}var wx=Z({build:(n,e,t)=>Et(e),config:ye({disabled:!1,newTab:!1}),dependencies:[vl],name:"@lexical/link/ClickableLink",register:(n,e,t)=>hh(n,t.getOutput())});function Fx(n,e=t=>t){return t=>{let o=n.exec(t);return o===null?null:{index:o.index,length:o[0].length,text:o[0],url:e(o[0])}}}function Ol(n,e){for(let t=0;t<e.length;t++){let o=e[t](n);if(o)return o}return null}var Kx=/[.,;\s]/;function Ls(n){return Kx.test(n)}function ph(n){return Ls(n[n.length-1])}function Ml(n){return Ls(n[0])}function mh(n){let e=n.getPreviousSibling();return $(e)&&(e=e.getLastDescendant()),e===null||Sa(e)||B(e)&&ph(e.getTextContent())}function _h(n){let e=n.getNextSibling();return $(e)&&(e=e.getFirstDescendant()),e===null||Sa(e)||B(e)&&Ml(e.getTextContent())}function Bx(n,e,t,o){return(n>0?Ls(t[n-1]):mh(o[0]))?e<t.length?Ls(t[e]):_h(o[o.length-1]):!1}function Wx(n,e,t){let o=[],r=[],s=[],i=0,a=0,l=[...n];for(;l.length>0;){let c=l[0],u=c.getTextContent().length,d=a;a+u<=e?(o.push(c),i+=u):d>=t?s.push(c):r.push(c),a+=u,l.shift()}return[i,o,r,s]}function Ux(n,e,t,o){let r=Is(o.url,o.attributes);if(n.length===1){let s,i=n[0];e===0?[s,i]=i.splitText(t):[,s,i]=i.splitText(e,t);let a=Kt(o.text);return a.setFormat(s.getFormat()),a.setDetail(s.getDetail()),a.setStyle(s.getStyle()),r.append(a),s.replace(r),i}if(n.length>1){let s=n[0],i,a=s.getTextContent().length;e===0?i=s:[,i]=s.splitText(e);let l=[],c;for(let h=1;h<n.length;h++){let g=n[h],p=g.getTextContent().length,m=a;if(m<t)if(a+p<=t)l.push(g);else{let[x,y]=g.splitText(t-m);l.push(x),c=y}a+=p}let u=R(),d=u?u.getNodes().find(B):void 0,f=Kt(i.getTextContent());return f.setFormat(i.getFormat()),f.setDetail(i.getDetail()),f.setStyle(i.getStyle()),r.append(f,...l),d&&d===i&&(D(u)?f.select(u.anchor.offset,u.focus.offset):he(u)&&f.select(0,f.getTextContent().length)),i.replace(r),c}}function fh(n,e,t){let o=n.getChildren(),r=o.length;for(let l=0;l<r;l++){let c=o[l];if(!B(c)||!c.isSimpleText())return Xo(n),void t(null,n.getURL())}let s=n.getTextContent(),i=Ol(s,e);if(i===null||i.text!==s||!mh(n)||!_h(n))return Xo(n),void t(null,n.getURL());let a=n.getURL();if(a!==i.url&&(n.setURL(i.url),t(i.url,a)),i.attributes){let l=n.getRel();l!==i.attributes.rel&&(n.setRel(i.attributes.rel||null),t(i.attributes.rel||null,l));let c=n.getTarget();c!==i.attributes.target&&(n.setTarget(i.attributes.target||null),t(i.attributes.target||null,c))}}function Xo(n){let e=n.getChildren();for(let t=e.length-1;t>=0;t--)n.insertAfter(e[t]);return n.remove(),e.map(t=>t.getLatest())}var xh={changeHandlers:[],excludeParents:[],matchers:[]};function yh(n,e=xh){let{matchers:t,changeHandlers:o,excludeParents:r}=e,s=(i,a)=>{for(let l of o)l(i,a)};return Je(n.registerNodeTransform(Wn,i=>{let a=i.getParentOrThrow(),l=i.getPreviousSibling();if(Me(a)&&!a.getIsUnlinked())fh(a,t,s);else if(!Xe(a)&&!r.some(c=>c(a))){if(i.isSimpleText()&&(Ml(i.getTextContent())||!Me(l))){let c=(function(u){let d=[u],f=u.getNextSibling();for(;f!==null&&B(f)&&f.isSimpleText()&&(d.push(f),!/[\s]/.test(f.getTextContent()));)f=f.getNextSibling();return d})(i);(function(u,d,f){for(let y of u){let N=y.getParent();if(Me(N)&&!N.getIsUnlinked())return}let h=[...u],g=h.map(y=>y.getTextContent()).join(""),p,m=g,x=0;for(;(p=Ol(m,d))&&p!==null;){let y=p.index,N=y+p.length;if(Bx(x+y,x+N,g,h)){let[T,,O,E]=Wx(h,x+y,x+N),A=!1;for(let S of O){let k=S.getParent();if(Me(k)&&!k.getIsUnlinked()){A=!0;break}}if(A){x+=N,m=m.substring(N);continue}let C=Ux(O,x+y-T,x+N-T,p);h=C?[C,...E]:E,f(p.url,null),x=0}else x+=N;m=m.substring(N)}})(c,t,s)}(function(c,u,d){let f=c.getParent(),h=c.getPreviousSibling(),g=c.getNextSibling(),p=c.getTextContent();if(!Me(f)||f.getIsUnlinked()){if(Me(h)&&!h.getIsUnlinked()&&h.is(c.getPreviousSibling())&&c.getParent()===h.getParent()){if(!Ml(p))return Xo(h),void d(null,h.getURL());if(m=p,h.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(m):/^\.[a-zA-Z0-9]{1,}/.test(m)){let x=h.getTextContent()+p,y=Ol(x,u);y!==null&&y.text===x&&(h.append(c),fh(h,u,d),d(null,h.getURL()))}}var m;!Me(g)||g.getIsUnlinked()||ph(p)||g.is(c.getNextSibling())&&c.getParent()===g.getParent()&&(Xo(g),d(null,g.getURL()))}})(i,t,s)}}),n.registerCommand($s,i=>{let a=R();return i!==null||!D(a)||a.extract().forEach(l=>{let c=l.getParent();Me(c)&&(c.setIsUnlinked(!c.getIsUnlinked()),c.markDirty())}),!1},ie))}var zx=Z({config:xh,dependencies:[vl],mergeConfig(n,e){let t=Wt(n,e);for(let o of["matchers","changeHandlers","excludeParents"]){let r=e[o];Array.isArray(r)&&(t[o]=[...n[o],...r])}return t},name:"@lexical/link/AutoLink",nodes:[Qn],register:yh}),Hx=qo;var _e=Al,NT=_e.$createAutoLinkNode,CT=_e.$createLinkNode,ST=_e.$isAutoLinkNode,TT=_e.$isLinkNode,ET=_e.$toggleLink,OT=_e.AutoLinkExtension,MT=_e.AutoLinkNode,vT=_e.ClickableLinkExtension,AT=_e.LinkExtension,Nh=_e.LinkNode,Ch=_e.TOGGLE_LINK_COMMAND,DT=_e.createLinkMatcherWithRegExp,bT=_e.formatUrl,RT=_e.registerAutoLink,kT=_e.registerClickableLink,IT=_e.registerLink,$T=_e.toggleLink;var Dl={};we(Dl,{HistoryExtension:()=>Ps,SharedHistoryExtension:()=>jx,createEmptyHistoryState:()=>Eh,registerHistory:()=>Th});function Yx(n,e,t,o,r){if(n===null||t.size===0&&o.size===0&&!r)return 0;let s=e._selection,i=n._selection;if(r)return 1;if(!(D(s)&&D(i)&&i.isCollapsed()&&s.isCollapsed()))return 0;let a=(function(x,y,N){let T=x._nodeMap,O=[];for(let E of y){let A=T.get(E);A!==void 0&&O.push(A)}for(let[E,A]of N){if(!A)continue;let C=T.get(E);C===void 0||ln(C)||O.push(C)}return O})(e,t,o);if(a.length===0)return 0;if(a.length>1){let x=e._nodeMap,y=x.get(s.anchor.key),N=x.get(i.anchor.key);return y&&N&&!n._nodeMap.has(y.__key)&&B(y)&&y.__text.length===1&&s.anchor.offset===1?2:0}let l=a[0],c=n._nodeMap.get(l.__key);if(!B(c)||!B(l)||c.__mode!==l.__mode)return 0;let u=c.__text,d=l.__text;if(u===d)return 0;let f=s.anchor,h=i.anchor;if(f.key!==h.key||f.type!=="text")return 0;let g=f.offset,p=h.offset,m=d.length-u.length;return m===1&&p===g-1?2:m===-1&&p===g+1?3:m===-1&&p===g?4:0}function Gx(n,e){let t=Date.now(),o=0,r=Date.now(),s=0,i=null;return(a,l,c,u,d,f)=>{let h=Date.now();if(f.has(Od)&&(r=t,s=o,i=a),f.has(ts))return o=0,t=h,2;f.has(Ed)&&i&&(t=r,o=s,a=i);let g=Yx(a,l,u,d,n.isComposing()),p=(()=>{let m=c===null||c.editor===n,x=f.has($d);if(!x&&m&&f.has(ns))return 0;if(g===1)return 2;if(a===null)return 1;let y=l._selection;if(!(u.size>0||d.size>0))return y!==null?0:2;let N=typeof e=="number"?e:e.peek();return x===!1&&g!==0&&g===o&&h<t+N&&m||u.size===1&&(function(T,O,E){let A=O._nodeMap.get(T),C=E._nodeMap.get(T),S=O._selection,k=E._selection;return!(D(S)&&D(k)&&S.anchor.type==="element"&&S.focus.type==="element"&&k.anchor.type==="text"&&k.focus.type==="text"||!B(A)||!B(C)||A.__parent!==C.__parent)&&JSON.stringify(O.read(()=>A.exportJSON()))===JSON.stringify(E.read(()=>C.exportJSON()))})(Array.from(u)[0],a,l)?0:1})();return t=h,o=g,p}}function Sh(n){n.undoStack=[],n.redoStack=[],n.current=null}function Th(n,e,t){let o=Gx(n,t);return Je(n.registerCommand(Xd,()=>((function(s,i){let a=i.redoStack,l=i.undoStack;if(l.length!==0){let c=i.current,u=l.pop();c!==null&&(a.push(c),s.dispatchCommand(Lo,!0)),l.length===0&&s.dispatchCommand(Po,!1),i.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:ts})}})(n,e),!0),W),n.registerCommand(Ud,()=>((function(s,i){let a=i.redoStack,l=i.undoStack;if(a.length!==0){let c=i.current;c!==null&&(l.push(c),s.dispatchCommand(Po,!0));let u=a.pop();a.length===0&&s.dispatchCommand(Lo,!1),i.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:ts})}})(n,e),!0),W),n.registerCommand(Vr,()=>(Sh(e),!1),W),n.registerCommand(Td,()=>(Sh(e),n.dispatchCommand(Lo,!1),n.dispatchCommand(Po,!1),!0),W),n.registerUpdateListener(({editorState:s,prevEditorState:i,dirtyLeaves:a,dirtyElements:l,tags:c})=>{let u=e.current,d=e.redoStack,f=e.undoStack,h=u===null?null:u.editorState;if(u!==null&&s===h)return;let g=o(i,s,u,a,l,c);if(g===1)d.length!==0&&(e.redoStack=[],n.dispatchCommand(Lo,!1)),u!==null&&(f.push({...u}),n.dispatchCommand(Po,!0));else if(g===2)return;e.current={editor:n,editorState:s}}))}function Eh(){return{current:null,redoStack:[],undoStack:[]}}var Ps=Z({build:(n,{delay:e,createInitialHistoryState:t,disabled:o})=>Et({delay:e,disabled:o,historyState:t(n)}),config:ye({createInitialHistoryState:Eh,delay:300,disabled:typeof window>"u"}),name:"@lexical/history/History",register:(n,e,t)=>{let o=t.getOutput();return qe(()=>o.disabled.value?void 0:Th(n,o.historyState.value,o.delay))}}),jx=Z({dependencies:[ds(Ps,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0})],name:"@lexical/history/SharedHistory",register(n,e,t){let{output:o}=t.getDependency(Ps),r=(function(i){return i?Eg(i,Ps.name):null})(n._parentEditor);if(!r)return()=>{};let s=r.output;return qe(()=>Tg(()=>{o.delay.value=s.delay.value,o.historyState.value=s.historyState.value,o.disabled.value=s.disabled.value}))}});var ws=Dl,KT=ws.HistoryExtension,BT=ws.SharedHistoryExtension,Oh=ws.createEmptyHistoryState,Mh=ws.registerHistory;var Jx=[{label:"B",type:"format-bold"},{label:"I",type:"format-italic"},{label:"U",type:"format-underline"},{label:"H2",type:"heading"},{label:"UL",type:"bullet-list"},{label:"OL",type:"number-list"},{label:"Quote",type:"blockquote"},{label:"Code",type:"format-code"}];function vh(n,e){n.update(()=>{let t=R();D(t)&&Cf(t,e)})}var Vx={"format-bold":n=>n.dispatchCommand(Tt,"bold"),"format-italic":n=>n.dispatchCommand(Tt,"italic"),"format-underline":n=>n.dispatchCommand(Tt,"underline"),"format-code":n=>n.dispatchCommand(Tt,"code"),heading:n=>vh(n,()=>Ig("h2")),"bullet-list":n=>n.dispatchCommand(sh,void 0),"number-list":n=>n.dispatchCommand(rh,void 0),blockquote:n=>vh(n,()=>$g())};function qx(n,e){let t=Vx[e.type];t&&t(n)}function Xx(n){let e=document.createElement("div");e.className="richtext-toolbar";for(let o of Jx){let r=document.createElement("button");r.type="button",r.className="richtext-toolbar-btn",r.textContent=o.label,r.addEventListener("click",s=>{s.preventDefault(),qx(n,o)}),e.appendChild(r)}let t=document.createElement("button");return t.type="button",t.className="richtext-toolbar-btn",t.textContent="Link",t.addEventListener("click",o=>{o.preventDefault();let r=prompt("Enter URL:");r&&n.dispatchCommand(Ch,r)}),e.appendChild(t),e}function Qx(n){let e=n.getAttribute("data-field");if(!e)return;let t=n.closest(".richtext-wrap");if(!t)return;let o=t.querySelector(`input[name="${e}"]`);if(!o)return;let s=t.querySelector("template.richtext-initial")?.innerHTML??"",i={namespace:`richtext-${e}`,nodes:[Lg,Pg,ah,ih,Nh],onError:u=>{console.error("Lexical error:",u)},theme:{paragraph:"richtext-p",heading:{h2:"richtext-h2",h3:"richtext-h3"},text:{bold:"richtext-bold",italic:"richtext-italic",underline:"richtext-underline",code:"richtext-code"},list:{ul:"richtext-ul",ol:"richtext-ol",listitem:"richtext-li"},quote:"richtext-quote",link:"richtext-link"}},a=fs(i),l=Xx(a);n.parentElement?.insertBefore(l,n);let c=document.createElement("div");c.contentEditable="true",c.className="richtext-content",n.appendChild(c),a.setRootElement(c),wg(a),lh(a),Mh(a,Oh(),300),s&&a.update(()=>{let d=new DOMParser().parseFromString(s,"text/html"),f=Es(a,d);Ce().clear(),Hr(f)}),a.registerUpdateListener(({editorState:u})=>{u.read(()=>{let d=Ts(a);o.value=d})})}function Ah(){let n=document.querySelectorAll(".richtext-editor");for(let e of n)Qx(e)}Ah();kl();var Dh=document.querySelector(".delete-trigger"),Zn=document.getElementById("delete-dialog"),bh=document.getElementById("delete-cancel"),Rh=document.getElementById("delete-confirm"),kh=document.getElementById("delete-form");Dh&&Zn&&Dh.addEventListener("click",()=>{typeof Zn.show=="function"&&Zn.show()});bh&&Zn&&bh.addEventListener("click",()=>{typeof Zn.close=="function"&&Zn.close()});Rh&&kh&&Rh.addEventListener("click",()=>{kh.submit()});var Zx=document.querySelectorAll(".media-upload");for(let n of Zx){let e=n.getAttribute("data-upload-endpoint"),t=n.querySelector('input[type="file"]'),o=n.querySelector('input[type="hidden"]'),r=n.querySelector(".media-preview");!e||!t||!o||t.addEventListener("change",async()=>{let s=t.files?.[0];if(!s)return;let i=new FormData;i.append("file",s);try{let l=await(await fetch(e,{method:"POST",body:i})).json(),c=l.id??l.filename??"";o.value=c,r&&(s.type.startsWith("image/")?r.innerHTML=`<img src="/media/${c}" alt="">`:r.innerHTML=`<span>${s.name}</span>`)}catch{r&&(r.innerHTML='<span style="color: var(--val-color-error);">Upload failed</span>')}})}})();