const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('text', '', 'js/MarkdownContentEditor-CuiDXY1i.chunk.mjs'),window.OC.filePath('text', '', 'js/Wrapper-B2WhJG1q.chunk.mjs'),window.OC.filePath('text', '', 'js/NcColorPicker-CXHUHxQL.chunk.mjs'),window.OC.filePath('text', '', 'js/vue.runtime.esm-C7aVrvtW.chunk.mjs'),window.OC.filePath('text', '', 'js/index-Dtu68Mmq.chunk.mjs'),window.OC.filePath('text', '', 'js/modulepreload-polyfill-nb9XBeg7.chunk.mjs'),window.OC.filePath('text', '', 'js/emoji-picker-DlAAdvrL.chunk.mjs'),window.OC.filePath('text', '', 'js/_plugin-vue2_normalizer-wd1ZAbRr.chunk.mjs'),window.OC.filePath('text', '', 'js/index-DqP6CuPc.chunk.mjs'),window.OC.filePath('text', '', 'js/NcLoadingIcon-CHw5fok5.chunk.mjs'),window.OC.filePath('text', '', 'css/NcLoadingIcon-CFe6qyTF.chunk.css'),window.OC.filePath('text', '', 'js/NcCheckboxRadioSwitch-ip_mRd2T-kNk9kCSa.chunk.mjs'),window.OC.filePath('text', '', 'css/NcCheckboxRadioSwitch-ip_mRd2T-Bebqso8K.chunk.css'),window.OC.filePath('text', '', 'js/NcNoteCard-ChweF_5Q-DZCruKzr.chunk.mjs'),window.OC.filePath('text', '', 'js/index-DfiDB3im.chunk.mjs'),window.OC.filePath('text', '', 'css/NcNoteCard-ChweF_5Q-DY8mPymx.chunk.css'),window.OC.filePath('text', '', 'js/MediaHandler.provider-BJ1SsG4D.chunk.mjs'),window.OC.filePath('text', '', 'js/logger-Bu78VaEB.chunk.mjs'),window.OC.filePath('text', '', 'js/index-_QHNqdwt.chunk.mjs'),window.OC.filePath('text', '', 'css/NcColorPicker-DFRLSm3d.chunk.css'),window.OC.filePath('text', '', 'css/Wrapper-CfUdCMkY.chunk.css'),window.OC.filePath('text', '', 'js/MenuBar-D2fziTHe.chunk.mjs'),window.OC.filePath('text', '', 'css/MenuBar-DCHdWn4f.chunk.css'),window.OC.filePath('text', '', 'js/index-CHbIErrw.chunk.mjs'),window.OC.filePath('text', '', 'css/MarkdownContentEditor-BN-uFoRR.chunk.css'),window.OC.filePath('text', '', 'js/Editor-COCuKOj6.chunk.mjs'),window.OC.filePath('text', '', 'js/index-DRiraEpW.chunk.mjs'),window.OC.filePath('text', '', 'css/Editor-BBVTY_PD.chunk.css'),window.OC.filePath('text', '', 'js/PlainTableContentEditor-DqeIa1MO.chunk.mjs'),window.OC.filePath('text', '', 'css/PlainTableContentEditor-tn0RQdqM.chunk.css')])))=>i.map(i=>d[i]);
import{_ as y,s as A}from"./modulepreload-polyfill-nb9XBeg7.chunk.mjs";import{V as s}from"./vue.runtime.esm-C7aVrvtW.chunk.mjs";import{s as k}from"./index-DqP6CuPc.chunk.mjs";import{A as I,E as P,H as S,a as E,O as M,o as H,b as j}from"./MediaHandler.provider-BJ1SsG4D.chunk.mjs";import"./emoji-picker-DlAAdvrL.chunk.mjs";import"./index-Dtu68Mmq.chunk.mjs";import"./index-DfiDB3im.chunk.mjs";import"./logger-Bu78VaEB.chunk.mjs";import"./index-_QHNqdwt.chunk.mjs";const B="1.2";s.prototype.t=window.t,s.prototype.n=window.n,s.prototype.OCA=window.OCA,window.OCA.Text={...window.OCA.Text};class f{#t;#n;constructor(t,e){return this.#t=t,this.#n=e,this.#o(),this}#e(){return this.#t.$children[0]}onCreate(t=()=>{}){return this.#t.$on("create:content",e=>{t(e)}),this}onLoaded(t=()=>{}){return this.#t.$on("ready",()=>{t()}),this}onUpdate(t=()=>{}){return this.#t.$on("update:content",e=>{t(e)}),this}onOutlineToggle(t=()=>{}){return this.#t.$on("outline-toggled",e=>{t(e)}),this}onSearch(t=()=>{}){return A("text:editor:search-results",t),this}render(t){t.innerHTML="";const e=document.createElement("div");return t.appendChild(e),this.#t.$mount(e),this}destroy(){this.#t.$destroy(),this.#t.$el.innerHTML=""}setContent(t){return this.#t.$set(this.#n,"content",t),this.#e()?.setContent?.(t),this}getHTML(){return this.#e()?.editor?.getHTML()}setSearchQuery(t,e){(this.#e()?.$editor).commands.setSearchQuery(t,e)}searchNext(){(this.#e()?.$editor).commands.nextMatch()}searchPrevious(){(this.#e()?.$editor).commands.previousMatch()}async save(){return this.#e().save?.()}setShowOutline(t){return this.#t.$set(this.#n,"showOutlineOutside",t),this}setReadOnly(t){return this.#t.$set(this.#n,"readOnly",t),this}updateReadonlyBarProps(t){return this.#t.$set(this.#n,"readonlyBarProps",t),this}insertAtCursor(t){this.#e().$editor.chain().insertContent(t).focus().run()}focus(){this.#e().$editor.commands.focus()}debugYjs(){const t=this.#e().debugYjsData();console.warn(JSON.stringify(t,null," ")),console.warn(`%c%s
%c%s
%s`,"font-weight: bold;",'Editor Yjs debug data. Copy the object below that starts with "clientId".',"font-weight: normal; font-style: italic;",'- In Chrome, select "Copy" at the end of the line.','- In Firefox, right-click on the object and select "Copy object".')}#o(){window?._oc_debug&&(this.vm=this.#t,window.OCA.Text._debug=[...window.OCA.Text._debug??[],this])}}window.OCA.Text.apiVersion=B,window.OCA.Text.createEditor=async function({el:l,fileId:t=void 0,useSession:e=!0,filePath:c=void 0,shareToken:i=null,content:h="",readOnly:p=!1,autofocus:a=!0,readonlyBar:o={component:null,props:null},onCreate:O=({markdown:w})=>{},onLoaded:d=()=>{},onUpdate:v=({markdown:w})=>{},onOutlineToggle:C=w=>{},onFileInsert:g=void 0,onMentionSearch:T=void 0,onMentionInsert:_=void 0,openLinkHandler:b=void 0,onSearch:$=void 0}){const{default:w}=await y(async()=>{const{default:n}=await import("./MarkdownContentEditor-CuiDXY1i.chunk.mjs");return{default:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url),{default:L}=await y(async()=>{const{default:n}=await import("./Editor-COCuKOj6.chunk.mjs").then(u=>u.b);return{default:n}},__vite__mapDeps([25,5,6,3,14,13,9,10,15,26,4,18,2,7,8,11,12,16,17,19,21,22,1,20,27]),import.meta.url),r=s.observable({showOutlineOutside:!1,readonlyBarProps:o.props,readOnly:p,content:h}),m=t&&e,x=new s({provide(){return{[I]:g,[P]:!!m,[S]:m?!0:T,[E]:m?!0:_,[M]:{openLink:b||H},[j]:{resolve(n,u){return[{type:"image",url:n}]}}}},data(){return r},render:n=>{const u=o?.component?{readonlyBar:()=>n(o.component,{props:r.readonlyBarProps})}:{};return m?n(L,{props:{fileId:t,relativePath:c,shareToken:i,mime:"text/markdown",active:!0,autofocus:a,showOutlineOutside:r.showOutlineOutside},scopedSlots:u}):n(w,{props:{fileId:t,content:r.content,relativePath:c,shareToken:i,readOnly:r.readOnly,showOutlineOutside:r.showOutlineOutside},scopedSlots:u})},store:k});return new f(x,r).onCreate(O).onLoaded(d).onUpdate(v).onOutlineToggle(C).onSearch($).render(l)},window.OCA.Text.createTable=async function({el:l,content:t="",readOnly:e=!1,autofocus:c=!0,onCreate:i=({markdown:a})=>{},onLoaded:h=()=>{},onUpdate:p=({markdown:a})=>{}}){const{default:a}=await y(async()=>{const{default:d}=await import("./PlainTableContentEditor-DqeIa1MO.chunk.mjs");return{default:d}},__vite__mapDeps([28,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,23,1,20,29]),import.meta.url),o=s.observable({readOnly:e,content:t}),O=new s({data(){return o},render:d=>d(a,{props:{content:o.content,readOnly:o.readOnly,showOutlineOutside:!1}})});return new f(O,o).onCreate(i).onLoaded(h).onUpdate(p).render(l)};
//# sourceMappingURL=text-editor.mjs.map
