/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../core/dist/index.js"),t=require("vue");function o(e){return t.customRef((t,o)=>({get:()=>(t(),e),set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{o()})})}}))}var s=class extends e.Editor{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=o(this.view.state),this.reactiveExtensionStorage=o(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),t.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){const o=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=o),o}unregisterPlugin(e){const t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},r=t.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const o=t.ref(),s=t.getCurrentInstance();return t.watchEffect(()=>{const r=e.editor;r&&r.options.element&&o.value&&t.nextTick(()=>{var e;if(!o.value||!(null==(e=r.view.dom)?void 0:e.parentNode))return;const n=t.unref(o.value);o.value.append(...r.view.dom.parentNode.childNodes),r.contentComponent=s.ctx._,s&&(r.appContext={...s.appContext,provides:s.provides}),r.setOptions({element:n}),r.createNodeViews()})}),t.onBeforeUnmount(()=>{const t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:o}},render(){return t.h("div",{ref:e=>{this.rootEl=e}})}});t.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return t.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),t.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,o;return t.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},null==(o=(e=this.$slots).default)?void 0:o.call(e))}});t.defineComponent({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return t.h(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}}),exports.CommandManager=e.CommandManager,exports.Extendable=e.Extendable,exports.Extension=e.Extension,exports.InputRule=e.InputRule,exports.MappablePosition=e.MappablePosition,exports.Mark=e.Mark,exports.Node=e.Node,exports.NodePos=e.NodePos,exports.PasteRule=e.PasteRule,exports.ResizableNodeView=e.ResizableNodeView,exports.callOrReturn=e.callOrReturn,exports.canInsertNode=e.canInsertNode,exports.combineTransactionSteps=e.combineTransactionSteps,exports.commands=e.commands,exports.createAtomBlockMarkdownSpec=e.createAtomBlockMarkdownSpec,exports.createBlockMarkdownSpec=e.createBlockMarkdownSpec,exports.createChainableState=e.createChainableState,exports.createDocument=e.createDocument,exports.createInlineMarkdownSpec=e.createInlineMarkdownSpec,exports.createMappablePosition=e.createMappablePosition,exports.createNodeFromContent=e.createNodeFromContent,exports.createStyleTag=e.createStyleTag,exports.defaultBlockAt=e.defaultBlockAt,exports.deleteProps=e.deleteProps,exports.elementFromString=e.elementFromString,exports.extensions=e.extensions,exports.findChildrenInRange=e.findChildrenInRange,exports.findDuplicates=e.findDuplicates,exports.findParentNode=e.findParentNode,exports.findParentNodeClosestToPos=e.findParentNodeClosestToPos,exports.flattenExtensions=e.flattenExtensions,exports.fromString=e.fromString,exports.getAttributes=e.getAttributes,exports.getAttributesFromExtensions=e.getAttributesFromExtensions,exports.getChangedRanges=e.getChangedRanges,exports.getExtensionField=e.getExtensionField,exports.getHTMLFromFragment=e.getHTMLFromFragment,exports.getMarkAttributes=e.getMarkAttributes,exports.getMarkRange=e.getMarkRange,exports.getMarkType=e.getMarkType,exports.getMarksBetween=e.getMarksBetween,exports.getNodeAtPosition=e.getNodeAtPosition,exports.getNodeAttributes=e.getNodeAttributes,exports.getNodeType=e.getNodeType,exports.getRenderedAttributes=e.getRenderedAttributes,exports.getSchemaByResolvedExtensions=e.getSchemaByResolvedExtensions,exports.getSchemaTypeByName=e.getSchemaTypeByName,exports.getSchemaTypeNameByName=e.getSchemaTypeNameByName,exports.getSplittedAttributes=e.getSplittedAttributes,exports.getText=e.getText,exports.getTextBetween=e.getTextBetween,exports.getTextContentFromNodes=e.getTextContentFromNodes,exports.getTextSerializersFromSchema=e.getTextSerializersFromSchema,exports.getUpdatedPosition=e.getUpdatedPosition,exports.injectExtensionAttributesToParseRule=e.injectExtensionAttributesToParseRule,exports.inputRulesPlugin=e.inputRulesPlugin,exports.isActive=e.isActive,exports.isAndroid=e.isAndroid,exports.isAtEndOfNode=e.isAtEndOfNode,exports.isAtStartOfNode=e.isAtStartOfNode,exports.isEmptyObject=e.isEmptyObject,exports.isExtensionRulesEnabled=e.isExtensionRulesEnabled,exports.isFunction=e.isFunction,exports.isList=e.isList,exports.isMacOS=e.isMacOS,exports.isMarkActive=e.isMarkActive,exports.isNodeActive=e.isNodeActive,exports.isNodeEmpty=e.isNodeEmpty,exports.isNodeSelection=e.isNodeSelection,exports.isNumber=e.isNumber,exports.isPlainObject=e.isPlainObject,exports.isRegExp=e.isRegExp,exports.isSafari=e.isSafari,exports.isTextSelection=e.isTextSelection,exports.isiOS=e.isiOS,exports.markInputRule=e.markInputRule,exports.markPasteRule=e.markPasteRule,exports.markdown=e.markdown,exports.mergeAttributes=e.mergeAttributes,exports.mergeDeep=e.mergeDeep,exports.minMax=e.minMax,exports.nodeInputRule=e.nodeInputRule,exports.objectIncludes=e.objectIncludes,exports.parseAttributes=e.parseAttributes,exports.parseIndentedBlocks=e.parseIndentedBlocks,exports.pasteRulesPlugin=e.pasteRulesPlugin,exports.removeDuplicates=e.removeDuplicates,exports.renderNestedMarkdownContent=e.renderNestedMarkdownContent,exports.resolveExtensions=e.resolveExtensions,exports.resolveFocusPosition=e.resolveFocusPosition,exports.selectionToInsertionEnd=e.selectionToInsertionEnd,exports.serializeAttributes=e.serializeAttributes,exports.sortExtensions=e.sortExtensions,exports.splitExtensions=e.splitExtensions,exports.textblockTypeInputRule=e.textblockTypeInputRule,exports.updateMarkViewAttributes=e.updateMarkViewAttributes,exports.wrappingInputRule=e.wrappingInputRule,exports.Editor=s,exports.EditorContent=r,exports.useEditor=(e={})=>{const o=t.shallowRef();return t.onMounted(()=>{o.value=new s(e)}),t.onBeforeUnmount(()=>{var e,t,s,r;const n=null==(t=null==(e=o.value)?void 0:e.view.dom)?void 0:t.parentNode,i=null==n?void 0:n.cloneNode(!0);null==(s=null==n?void 0:n.parentNode)||s.replaceChild(i,n),null==(r=o.value)||r.destroy()}),o};