/*!
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
*/
import{Editor as e}from"../../core/dist/index.js";import{CommandManager as t,Extendable as r,Extension as n,InputRule as a,MappablePosition as i,Mark as o,Node as s,NodePos as l,PasteRule as u,ResizableNodeView as d,callOrReturn as p,canInsertNode as v,combineTransactionSteps as c,commands as h,createAtomBlockMarkdownSpec as g,createBlockMarkdownSpec as m,createChainableState as S,createDocument as w,createInlineMarkdownSpec as x,createMappablePosition as C,createNodeFromContent as f,createStyleTag as N,defaultBlockAt as y,deleteProps as E,elementFromString as j,extensions as P,findChildrenInRange as V,findDuplicates as D,findParentNode as b,findParentNodeClosestToPos as k,flattenExtensions as q,fromString as A,getAttributes as F,getAttributesFromExtensions as O,getChangedRanges as M,getExtensionField as T,getHTMLFromFragment as W,getMarkAttributes as $,getMarkRange as _,getMarkType as z,getMarksBetween as B,getNodeAtPosition as G,getNodeAttributes as H,getNodeType as I,getRenderedAttributes as J,getSchemaByResolvedExtensions as K,getSchemaTypeByName as L,getSchemaTypeNameByName as Q,getSplittedAttributes as R,getText as U,getTextBetween as X,getTextContentFromNodes as Y,getTextSerializersFromSchema as Z,getUpdatedPosition as ee,injectExtensionAttributesToParseRule as te,inputRulesPlugin as re,isActive as ne,isAndroid as ae,isAtEndOfNode as ie,isAtStartOfNode as oe,isEmptyObject as se,isExtensionRulesEnabled as le,isFunction as ue,isList as de,isMacOS as pe,isMarkActive as ve,isNodeActive as ce,isNodeEmpty as he,isNodeSelection as ge,isNumber as me,isPlainObject as Se,isRegExp as we,isSafari as xe,isTextSelection as Ce,isiOS as fe,markInputRule as Ne,markPasteRule as ye,markdown as Ee,mergeAttributes as je,mergeDeep as Pe,minMax as Ve,nodeInputRule as De,objectIncludes as be,parseAttributes as ke,parseIndentedBlocks as qe,pasteRulesPlugin as Ae,removeDuplicates as Fe,renderNestedMarkdownContent as Oe,resolveExtensions as Me,resolveFocusPosition as Te,selectionToInsertionEnd as We,serializeAttributes as $e,sortExtensions as _e,splitExtensions as ze,textblockTypeInputRule as Be,updateMarkViewAttributes as Ge,wrappingInputRule as He}from"../../core/dist/index.js";import{shallowRef as Ie,onMounted as Je,onBeforeUnmount as Ke,defineComponent as Le,h as Qe,ref as Re,getCurrentInstance as Ue,watchEffect as Xe,nextTick as Ye,unref as Ze,markRaw as et,customRef as tt}from"vue";function rt(e){return tt((t,r)=>({get:()=>(t(),e),set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{r()})})}}))}var nt=class extends e{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=rt(this.view.state),this.reactiveExtensionStorage=rt(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),et(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 r=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(e){const t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},at=Le({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=Re(),r=Ue();return Xe(()=>{const n=e.editor;n&&n.options.element&&t.value&&Ye(()=>{var e;if(!t.value||!(null==(e=n.view.dom)?void 0:e.parentNode))return;const a=Ze(t.value);t.value.append(...n.view.dom.parentNode.childNodes),n.contentComponent=r.ctx._,r&&(n.appContext={...r.appContext,provides:r.provides}),n.setOptions({element:a}),n.createNodeViews()})}),Ke(()=>{const t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:t}},render(){return Qe("div",{ref:e=>{this.rootEl=e}})}});Le({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return Qe(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),Le({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,t;return Qe(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},null==(t=(e=this.$slots).default)?void 0:t.call(e))}});var it=(e={})=>{const t=Ie();return Je(()=>{t.value=new nt(e)}),Ke(()=>{var e,r,n,a;const i=null==(r=null==(e=t.value)?void 0:e.view.dom)?void 0:r.parentNode,o=null==i?void 0:i.cloneNode(!0);null==(n=null==i?void 0:i.parentNode)||n.replaceChild(o,i),null==(a=t.value)||a.destroy()}),t};Le({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return Qe(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}});export{t as CommandManager,nt as Editor,at as EditorContent,r as Extendable,n as Extension,a as InputRule,i as MappablePosition,o as Mark,s as Node,l as NodePos,u as PasteRule,d as ResizableNodeView,p as callOrReturn,v as canInsertNode,c as combineTransactionSteps,h as commands,g as createAtomBlockMarkdownSpec,m as createBlockMarkdownSpec,S as createChainableState,w as createDocument,x as createInlineMarkdownSpec,C as createMappablePosition,f as createNodeFromContent,N as createStyleTag,y as defaultBlockAt,E as deleteProps,j as elementFromString,P as extensions,V as findChildrenInRange,D as findDuplicates,b as findParentNode,k as findParentNodeClosestToPos,q as flattenExtensions,A as fromString,F as getAttributes,O as getAttributesFromExtensions,M as getChangedRanges,T as getExtensionField,W as getHTMLFromFragment,$ as getMarkAttributes,_ as getMarkRange,z as getMarkType,B as getMarksBetween,G as getNodeAtPosition,H as getNodeAttributes,I as getNodeType,J as getRenderedAttributes,K as getSchemaByResolvedExtensions,L as getSchemaTypeByName,Q as getSchemaTypeNameByName,R as getSplittedAttributes,U as getText,X as getTextBetween,Y as getTextContentFromNodes,Z as getTextSerializersFromSchema,ee as getUpdatedPosition,te as injectExtensionAttributesToParseRule,re as inputRulesPlugin,ne as isActive,ae as isAndroid,ie as isAtEndOfNode,oe as isAtStartOfNode,se as isEmptyObject,le as isExtensionRulesEnabled,ue as isFunction,de as isList,pe as isMacOS,ve as isMarkActive,ce as isNodeActive,he as isNodeEmpty,ge as isNodeSelection,me as isNumber,Se as isPlainObject,we as isRegExp,xe as isSafari,Ce as isTextSelection,fe as isiOS,Ne as markInputRule,ye as markPasteRule,Ee as markdown,je as mergeAttributes,Pe as mergeDeep,Ve as minMax,De as nodeInputRule,be as objectIncludes,ke as parseAttributes,qe as parseIndentedBlocks,Ae as pasteRulesPlugin,Fe as removeDuplicates,Oe as renderNestedMarkdownContent,Me as resolveExtensions,Te as resolveFocusPosition,We as selectionToInsertionEnd,$e as serializeAttributes,_e as sortExtensions,ze as splitExtensions,Be as textblockTypeInputRule,Ge as updateMarkViewAttributes,it as useEditor,He as wrappingInputRule};