@creatorsn/powereditor3 0.2.1 → 0.2.3

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.
@@ -22142,8 +22142,29 @@ function il(n, e = "language-") {
22142
22142
  return i && i.replace(e, "") || null;
22143
22143
  }
22144
22144
  function _T(n) {
22145
- return n ? (typeof n.innerText == "string" ? n.innerText : n.textContent || "").replace(/\r\n?/g, `
22146
- `) : "";
22145
+ if (!n)
22146
+ return "";
22147
+ const e = [], t = /* @__PURE__ */ new Set(["DIV", "P"]), r = (i) => {
22148
+ if (!i)
22149
+ return;
22150
+ if (i.nodeType === Node.TEXT_NODE) {
22151
+ e.push(i.nodeValue || "");
22152
+ return;
22153
+ }
22154
+ if (i.nodeType !== Node.ELEMENT_NODE)
22155
+ return;
22156
+ if (i.tagName === "BR") {
22157
+ e.push(`
22158
+ `);
22159
+ return;
22160
+ }
22161
+ const o = e.length;
22162
+ Array.from(i.childNodes).forEach(r), t.has(i.tagName) && e.length > o && e[e.length - 1] !== `
22163
+ ` && e.push(`
22164
+ `);
22165
+ };
22166
+ return r(n), e.join("").replace(/\r\n?/g, `
22167
+ `).replace(/\n$/, "");
22147
22168
  }
22148
22169
  const yT = lT.extend({
22149
22170
  transformPastedHTML(n) {
@@ -57083,6 +57104,7 @@ const Lp = /* @__PURE__ */ on(_me, [["render", xme]]), kme = {
57083
57104
  tmpHeight: 0,
57084
57105
  lock: !0
57085
57106
  },
57107
+ imgStatus: "init",
57086
57108
  previewImg: {
57087
57109
  scalePercent: "100",
57088
57110
  show: !1
@@ -57131,7 +57153,7 @@ const Lp = /* @__PURE__ */ on(_me, [["render", xme]]), kme = {
57131
57153
  return this.node.attrs.src;
57132
57154
  },
57133
57155
  interceptImage(n = "") {
57134
- return this.statusInfo.tmpSrc = this.node.attrs.src, this.statusInfo.tmpHeight = this.$refs.image.$el.clientHeight, this.updateAttributes({
57156
+ return this.statusInfo.tmpSrc = this.node.attrs.src, this.updateAttributes({
57135
57157
  src: n
57136
57158
  }), this.statusInfo.tmpSrc;
57137
57159
  },
@@ -57159,6 +57181,14 @@ const Lp = /* @__PURE__ */ on(_me, [["render", xme]]), kme = {
57159
57181
  };
57160
57182
  this.imgInterceptor && this.imgInterceptor(n);
57161
57183
  },
57184
+ imgLoaded(n) {
57185
+ var o;
57186
+ const e = (o = this.$el) == null ? void 0 : o.clientWidth, { naturalWidth: t, naturalHeight: r } = n, i = (t || 0) / (r || 1e-6);
57187
+ this.statusInfo.tmpHeight = e / i, this.imgStatus = "loaded";
57188
+ },
57189
+ imgError() {
57190
+ this.imgStatus = "error";
57191
+ },
57162
57192
  preview(n = "readonly") {
57163
57193
  this.editor.isEditable && n !== "editable" || !this.editor.isEditable && n !== "readonly" || this.node.attrs.src && this.thisImgPreview && (this.previewImg.show = !0);
57164
57194
  },
@@ -57177,7 +57207,9 @@ function Eme(n, e, t, r, i, o) {
57177
57207
  return t.node ? (He(), rn(m, {
57178
57208
  key: 0,
57179
57209
  class: tt(["power-editor-image-container", [{ dark: i.thisTheme === "dark" }]]),
57180
- style: ut({ "justify-content": t.node.attrs.alignCenter ? "center" : "flex-start" })
57210
+ style: ut({
57211
+ "justify-content": t.node.attrs.alignCenter ? "center" : "flex-start"
57212
+ })
57181
57213
  }, {
57182
57214
  default: ie(() => [
57183
57215
  ae(l, {
@@ -57200,8 +57232,12 @@ function Eme(n, e, t, r, i, o) {
57200
57232
  src: t.node.attrs.src ? t.node.attrs.src : i.statusInfo.tmpSrc ? i.statusInfo.tmpSrc : "",
57201
57233
  ref: "image",
57202
57234
  onlazy: i.thisLazyLoad,
57203
- style: ut([{ width: "100%", height: "auto" }, { height: !t.node.attrs.src && i.statusInfo.show ? i.statusInfo.tmpHeight + "px" : "" }])
57204
- }, null, 8, ["src", "onlazy", "style"]),
57235
+ style: ut([{ width: "100%", height: "auto" }, {
57236
+ height: i.imgStatus === "error" ? i.statusInfo.tmpHeight + "px" : ""
57237
+ }]),
57238
+ onLoad: o.imgLoaded,
57239
+ onError: o.imgError
57240
+ }, null, 8, ["src", "onlazy", "style", "onLoad", "onError"]),
57205
57241
  Ut(X("div", Sme, [
57206
57242
  ae(a, {
57207
57243
  modelValue: i.statusInfo.progress,
@@ -57235,7 +57271,10 @@ function Eme(n, e, t, r, i, o) {
57235
57271
  ae(c, {
57236
57272
  src: t.node.attrs.src,
57237
57273
  class: "power-editor-preview-img",
57238
- style: ut({ scale: i.previewImg.scalePercent + "%", cursor: i.previewImg.scalePercent < 150 ? "zoom-in" : "zoom-out" }),
57274
+ style: ut({
57275
+ scale: i.previewImg.scalePercent + "%",
57276
+ cursor: i.previewImg.scalePercent < 150 ? "zoom-in" : "zoom-out"
57277
+ }),
57239
57278
  onClickCapture: e[6] || (e[6] = (b) => i.previewImg.scalePercent < 100 ? o.setScale(b, 100) : i.previewImg.scalePercent < 150 ? o.setScale(b, 150) : o.setScale(b, 100))
57240
57279
  }, null, 8, ["src", "style"])
57241
57280
  ]),
@@ -140,8 +140,11 @@ ${t}
140
140
  `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(dC,this.editor.getAttributes(u_)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=Jr({find:d_,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Jr({find:d_,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(u_)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),hC=/^\s*(\[([( |x])?\])\s$/,fC=xt.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",$e(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const r=e.parseChildren(n.nestedTokens);t.push(...r)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const i=`- [${(t=n.attrs)!=null&&t.checked?"x":" "}] `;return Xu(n,e,i)},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=d=>{var m,b;a.ariaLabel=((b=(m=this.options.a11y)==null?void 0:m.checkboxLabel)==null?void 0:b.call(m,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};c(n),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:m}=d.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:b})=>{const f=t();if(typeof f!="number")return!1;const y=b.doc.nodeAt(f);return b.setNodeMarkup(f,void 0,{...y==null?void 0:y.attrs,checked:m}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,m)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,m])=>{i.setAttribute(d,m)}),i.dataset.checked=n.attrs.checked,a.checked=n.attrs.checked,o.append(a,s),i.append(o,l),Object.entries(e).forEach(([d,m])=>{i.setAttribute(d,m)});let u=new Set(Object.keys(e));return{dom:i,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;i.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d);const m=r.extensionManager.attributes,b=fs(d,m),f=new Set(Object.keys(b)),y=this.options.HTMLAttributes;return u.forEach(w=>{f.has(w)||(w in y?i.setAttribute(w,y[w]):i.removeAttribute(w))}),Object.entries(b).forEach(([w,k])=>{k==null?w in y?i.setAttribute(w,y[w]):i.removeAttribute(w):i.setAttribute(w,k)}),u=f,!0}}}},addInputRules(){return[Jr({find:hC,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),pC=xt.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",$e(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
141
141
  `):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=o=>{const s=Zu(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:t.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},t);return s?[{type:"taskList",raw:s.raw,items:s.items}]:t.blockTokens(o)},i=Zu(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,s)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:t.inlineTokens(o.mainContent),nestedTokens:s}),customNestedParser:r},t);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Je.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(e_.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(t_.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(a_.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(h_.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(fC.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(pC.configure(this.options.taskList)),n}});var Rl="&nbsp;",V0=" ",mC=xt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",$e(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];if(t.length===1&&t[0].type==="image")return e.parseChildren([t[0]]);const r=e.parseInline(t);return t.length===1&&t[0].type==="text"&&(t[0].raw===Rl||t[0].text===Rl||t[0].raw===V0||t[0].text===V0)&&r.length===1&&r[0].type==="text"&&(r[0].text===Rl||r[0].text===V0)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(n,e,t)=>{var r,i;if(!n)return"";const o=Array.isArray(n.content)?n.content:[];if(o.length===0){const s=Array.isArray((r=t==null?void 0:t.previousNode)==null?void 0:r.content)?t.previousNode.content:[];return((i=t==null?void 0:t.previousNode)==null?void 0:i.type)==="paragraph"&&s.length===0?Rl:""}return e.renderChildren(o)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),gC=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,bC=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,_C=zn.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",$e(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ai({find:gC,type:this.type})]},addPasteRules(){return[ei({find:bC,type:this.type})]}}),yC=xt.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),f_=zn.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",$e(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!i)return;const o=i[2].trim();return{type:"underline",raw:i[0],text:o,tokens:t.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),vC=f_;function wC(n={}){return new at({view(e){return new xC(e,n)}})}class xC{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,a=o.height/i.offsetHeight;if(t){let d=e.nodeBefore,m=e.nodeAfter;if(d||m){let b=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(b){let f=b.getBoundingClientRect(),y=d?f.bottom:f.top;d&&m&&(y=(y+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let w=this.width/2*a;r={left:f.left,right:f.right,top:y-w,bottom:y+w}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),m=this.width/2*s;r={left:d.left-m,right:d.left+m,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=l.getBoundingClientRect(),m=d.width/l.offsetWidth,b=d.height/l.offsetHeight;c=d.left-l.scrollLeft*m,u=d.top-l.scrollTop*b}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-u)/a+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=im(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Dt extends Be{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return Dt.valid(r)?new Dt(r):Be.near(r)}content(){return ve.empty}eq(e){return e instanceof Dt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Dt(e.resolve(t.pos))}getBookmark(){return new U0(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!kC(e)||!SC(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&Dt.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(t>0?e.indexAfter(s)<a.childCount:e.index(s)>0){o=a.child(t>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=t;let l=e.doc.resolve(i);if(Dt.valid(l))return l}for(;;){let s=t>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!Te.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=s,i+=t;let a=e.doc.resolve(i);if(Dt.valid(a))return a}return null}}}Dt.prototype.visible=!1,Dt.findFrom=Dt.findGapCursorFrom,Be.jsonID("gapcursor",Dt);class U0{constructor(e){this.pos=e}map(e){return new U0(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Dt.valid(t)?new Dt(t):Be.near(t)}}function kC(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function SC(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function CC(){return new at({props:{decorations:MC,createSelectionBetween(n,e,t){return e.pos==t.pos&&Dt.valid(t)?new Dt(t):null},handleClick:TC,handleKeyDown:EC,handleDOMEvents:{beforeinput:AC}}})}const EC=Du({ArrowLeft:Il("horiz",-1),ArrowRight:Il("horiz",1),ArrowUp:Il("vert",-1),ArrowDown:Il("vert",1)});function Il(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof Ee){if(!o.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=Dt.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new Dt(c))),!0):!1}}function TC(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!Dt.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&Te.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new Dt(r))),!0)}function AC(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof Dt))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=se.empty;for(let s=r.length-1;s>=0;s--)i=se.from(r[s].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new ve(i,0,0));return o.setSelection(Ee.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function MC(n){if(!(n.selection instanceof Dt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ht.create(n.doc,[qt.widget(n.selection.head,e,{key:"gapcursor"})])}var Ol=200,Ut=function(){};Ut.prototype.append=function(e){return e.length?(e=Ut.from(e),!this.length&&e||e.length<Ol&&this.leafAppend(e)||this.length<Ol&&e.leafPrepend(this)||this.appendInner(e)):this},Ut.prototype.prepend=function(e){return e.length?Ut.from(e).append(this):this},Ut.prototype.appendInner=function(e){return new NC(this,e)},Ut.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ut.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ut.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ut.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Ut.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i},Ut.from=function(e){return e instanceof Ut?e:e&&e.length?new p_(e):Ut.empty};var p_=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ol)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ol)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ut);Ut.empty=new p_([]);var NC=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ut);const DC=500;class Gn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((d,m)=>{if(!d.step){i||(i=this.remapping(r,m+1),o=i.maps.length),o--,u.push(d);return}if(i){u.push(new ir(d.map));let b=d.step.map(i.slice(o)),f;b&&s.maybeStep(b).doc&&(f=s.mapping.maps[s.mapping.maps.length-1],c.push(new ir(f,void 0,void 0,c.length+u.length))),o--,f&&i.appendMap(f,o)}else s.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(o)):d.selection,l=new Gn(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,t,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),m=new ir(e.mapping.maps[u],d,t),b;(b=l&&l.merge(m))&&(m=b,u?o.pop():a=a.slice(0,a.length-1)),o.push(m),t&&(s++,t=void 0),i||(l=m)}let c=s-r.depth;return c>IC&&(a=RC(a,c),s-=c),new Gn(a.append(o),s)}remapping(e,t){let r=new Qo;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new Gn(this.items.append(e.map(t=>new ir(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(m=>{m.selection&&a--},i);let l=t;this.items.forEach(m=>{let b=o.getMirror(--l);if(b==null)return;s=Math.min(s,b);let f=o.maps[b];if(m.step){let y=e.steps[b].invert(e.docs[b]),w=m.selection&&m.selection.map(o.slice(l+1,b));w&&a++,r.push(new ir(f,y,w))}else r.push(new ir(f))},i);let c=[];for(let m=t;m<s;m++)c.push(new ir(o.maps[m]));let u=this.items.slice(0,i).append(c).append(r),d=new Gn(u,a);return d.emptyItemCount()>DC&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(t.slice(r)),c=l&&l.getMap();if(r--,c&&t.appendMap(c,r),l){let u=s.selection&&s.selection.map(t.slice(r));u&&o++;let d=new ir(c.invert(),l,u),m,b=i.length-1;(m=i.length&&i[b].merge(d))?i[b]=m:i.push(d)}}else s.map&&r--},this.items.length,0),new Gn(Ut.from(i.reverse()),o)}}Gn.empty=new Gn(Ut.empty,0);function RC(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class ir{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new ir(t.getMap().invert(),t,this.selection)}}}class si{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const IC=20;function OC(n,e,t,r){let i=t.getMeta(Pi),o;if(i)return i.historyState;t.getMeta(BC)&&(n=new si(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(Pi))return s.getMeta(Pi).redo?new si(n.done.addTransform(t,void 0,r,Ll(e)),n.undone,m_(t.mapping.maps),n.prevTime,n.prevComposition):new si(n.done,n.undone.addTransform(t,void 0,r,Ll(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=t.getMeta("composition"),l=n.prevTime==0||!s&&n.prevComposition!=a&&(n.prevTime<(t.time||0)-r.newGroupDelay||!LC(t,n.prevRanges)),c=s?G0(n.prevRanges,t.mapping):m_(t.mapping.maps);return new si(n.done.addTransform(t,l?e.selection.getBookmark():void 0,r,Ll(e)),Gn.empty,c,t.time,a??n.prevComposition)}else return(o=t.getMeta("rebased"))?new si(n.done.rebased(t,o),n.undone.rebased(t,o),G0(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new si(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),G0(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function LC(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function m_(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function G0(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function PC(n,e,t){let r=Ll(e),i=Pi.get(e).spec.config,o=(t?n.undone:n.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(t?n.done:n.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new si(t?a:o.remaining,t?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Pi,{redo:t,historyState:l})}let $0=!1,g_=null;function Ll(n){let e=n.plugins;if(g_!=e){$0=!1,g_=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){$0=!0;break}}return $0}const Pi=new dt("history"),BC=new dt("closeHistory");function FC(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new at({key:Pi,state:{init(){return new si(Gn.empty,Gn.empty,null,0,-1)},apply(e,t,r){return OC(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?__:r=="historyRedo"?y_:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function b_(n,e){return(t,r)=>{let i=Pi.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=PC(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const __=b_(!1,!0),y_=b_(!0,!0);Je.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc;if(((n==null?void 0:n.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new at({key:new dt("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const i=this.options.limit,o=this.options.autoTrim;if(i==null||i===0||o===!1){n=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const a=s-i,l=0,c=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(l,c);return n=!0,u}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=o-r,c=a-l,u=a;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}});var zC=Je.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[wC(this.options)]}});Je.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new at({key:new dt("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:i}=e,o=[];if(!t||!r)return ht.create(n,[]);let s=0;this.options.mode==="deepest"&&n.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;s+=1});let a=0;return n.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";o.push(qt.node(c,c+l.nodeSize,{class:this.options.className}))}),ht.create(n,o)}}})]}});var qC=Je.create({name:"gapCursor",addProseMirrorPlugins(){return[CC()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=Xe(Me(n,"allowGapCursor",t)))!=null?e:null}}});function v_(n){const{editor:e,placeholder:t,dataAttribute:r,pos:i,node:o,isEmptyDoc:s,hasAnchor:a,classes:{emptyNode:l,emptyEditor:c}}=n,u=[l];return s&&u.push(c),qt.node(i,i+o.nodeSize,{class:u.join(" "),[r]:typeof t=="function"?t({editor:e,node:o,pos:i,hasAnchor:a}):t})}function HC(n){const e=getComputedStyle(n),t=`${e.overflow} ${e.overflowY} ${e.overflowX}`;return/auto|scroll|overlay/.test(t)}function VC(n){let e=n;for(;e;){if(HC(e))return e;const t=e.parentElement;if(!t){const r=e.getRootNode();if(r instanceof ShadowRoot){e=r.host;continue}return window}e=t}return window}function UC(n){return n===window?{top:0,bottom:window.innerHeight}:n.getBoundingClientRect()}function GC({doc:n,view:e,scrollContainer:t}){const r=e.dom.getBoundingClientRect(),i=t?UC(t):{top:0,bottom:window.innerHeight},o=Math.max(r.top,i.top),s=Math.min(r.bottom,i.bottom);if(o>=s)return{top:0,bottom:n.content.size};const l=getComputedStyle(e.dom).direction==="rtl"?Math.max(r.right-2,r.left+2):r.left+2,c=e.posAtCoords({left:l,top:o+2}),u=e.posAtCoords({left:l,top:s-2});return{top:c?c.pos:0,bottom:u?u.pos:n.content.size}}function $C(n,e){let t=null;return{call:(...o)=>{t||(n(...o),t=setTimeout(()=>{t=null},e))},cancel:()=>{t&&(clearTimeout(t),t=null)}}}var w_="placeholder";function WC(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var Ds=new dt("tiptap__placeholder"),KC=Je.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:w_,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const n=this.options.dataAttribute?`data-${WC(this.options.dataAttribute)}`:`data-${w_}`;return[new at({state:{init(){return{topPos:null,bottomPos:null}},apply(e,t){const r=e.getMeta(Ds);return r!=null&&r.positions?{topPos:r.positions.top,bottomPos:r.positions.bottom}:e.docChanged?{topPos:t.topPos!==null?e.mapping.map(t.topPos):null,bottomPos:t.bottomPos!==null?e.mapping.map(t.bottomPos):null}:t}},key:Ds,view(e){const t=VC(e.dom),r=()=>{const a=GC({view:e,doc:e.state.doc,scrollContainer:t}),l=Ds.getState(e.state);if(l.topPos===a.top&&l.bottomPos===a.bottom)return;const c=e.state.tr.setMeta(Ds,{positions:a}).setMeta("tiptap__viewportUpdate",!0);e.dispatch(c)},{call:i,cancel:o}=$C(r,250),s=t;return s.addEventListener("scroll",i,{passive:!0}),r(),{update(a,l){e.state.doc.content.size!==l.doc.content.size&&r()},destroy:()=>{o(),s.removeEventListener("scroll",i)}}},props:{decorations:({doc:e,selection:t})=>{var r,i;if(!(this.editor.isEditable||!this.options.showOnlyWhenEditable))return null;const{anchor:s}=t,a=[],l=this.editor.isEmpty;if(this.options.showOnlyCurrent&&!this.options.includeChildren){const u=e.resolve(s);if(u.depth>0){const d=u.node(1),m=u.before(1);if(d.type.isTextblock&&gs(d)){const b=s>=m&&s<=m+d.nodeSize,f=v_({node:d,dataAttribute:n,hasAnchor:b,placeholder:this.options.placeholder,classes:{emptyEditor:this.options.emptyEditorClass,emptyNode:this.options.emptyNodeClass},editor:this.editor,isEmptyDoc:l,pos:u.before(1)});a.push(f)}}}else{const u=Ds.getState(this.editor.state),d=(r=u.topPos)!=null?r:0,m=(i=u.bottomPos)!=null?i:e.content.size;e.nodesBetween(d,m,(b,f)=>{const y=s>=f&&s<=f+b.nodeSize,w=!b.isLeaf&&gs(b);if(!b.type.isTextblock)return this.options.includeChildren;if((y||!this.options.showOnlyCurrent)&&w){const k=v_({classes:{emptyEditor:this.options.emptyEditorClass,emptyNode:this.options.emptyNodeClass},editor:this.editor,isEmptyDoc:l,dataAttribute:n,hasAnchor:y,placeholder:this.options.placeholder,node:b,pos:f});a.push(k)}return this.options.includeChildren})}return ht.create(e,a)}}})]}});Je.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new at({key:new dt("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||m1(t.selection)||n.view.dragging?null:ht.create(t.doc,[qt.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});var jC="skipTrailingNode";function x_({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||(e==null?void 0:e.type)===n}var QC=Je.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new dt(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:n.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new at({key:e,appendTransaction:(i,o,s)=>{const{doc:a,tr:l,schema:c}=s,u=e.getState(s),d=a.content.size,m=c.nodes[t];if(!i.some(b=>b.getMeta(jC))&&u)return l.insert(d,m.create())},state:{init:(i,o)=>{const s=o.tr.doc.lastChild;return!x_({node:s,types:r})},apply:(i,o)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return o;const s=i.doc.lastChild;return!x_({node:s,types:r})}}})]}}),YC=Je.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>__(n,e),redo:()=>({state:n,dispatch:e})=>y_(n,e)}},addProseMirrorPlugins(){return[FC(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ZC=Je.create({name:"starterKit",addExtensions(){var n,e,t,r;const i=[];return this.options.bold!==!1&&i.push(h7.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(a7.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(e_.configure(this.options.bulletList)),this.options.code!==!1&&i.push(m7.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(Lb.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(_7.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(zC.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(qC.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(y7.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(v7.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(YC.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(w7.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(E7.configure(this.options.italic)),this.options.listItem!==!1&&i.push(t_.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(a_.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&i.push(Zb.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(h_.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(mC.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(_C.configure(this.options.strike)),this.options.text!==!1&&i.push(yC.configure(this.options.text)),this.options.underline!==!1&&i.push(f_.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&i.push(QC.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),k_=ZC,XC=Je.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>{const e=n.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:n})).some(t=>t):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(e=>n.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:n=>({editor:e,commands:t})=>this.options.alignments.includes(n)?e.isActive({textAlign:n})?t.unsetTextAlign():t.setTextAlign(n):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),JC=XC,eE=20,S_=(n,e=0)=>{const t=[];return!n.children.length||e>eE||Array.from(n.children).forEach(r=>{r.tagName==="SPAN"?t.push(r):r.children.length&&t.push(...S_(r,e+1))}),t},tE=n=>{if(!n.children.length)return;const e=S_(n);e&&e.forEach(t=>{var r,i;const o=t.getAttribute("style"),s=(i=(r=t.parentElement)==null?void 0:r.closest("span"))==null?void 0:i.getAttribute("style");t.setAttribute("style",`${s};${o}`)})},C_=zn.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:n=>n.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&tE(n),{}):!1}]},renderHTML({HTMLAttributes:n}){return["span",$e(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleTextStyle:n=>({commands:e})=>e.toggleMark(this.name,n),removeEmptyTextStyle:()=>({tr:n})=>{const{selection:e}=n;return n.doc.nodesBetween(e.from,e.to,(t,r)=>{if(t.isTextblock)return!0;t.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||n.removeMark(r,r+t.nodeSize,this.type)}),!0}}}}),nE=Je.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:n=>{var e;const t=(e=ho(n,"background-color"))!=null?e:n.style.backgroundColor;return t==null?void 0:t.replace(/['"]+/g,"")},renderHTML:n=>n.backgroundColor?{style:`background-color: ${n.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:n=>({chain:e})=>e().setMark("textStyle",{backgroundColor:n}).run(),unsetBackgroundColor:()=>({chain:n})=>n().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),E_=Je.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:n=>{var e;const t=(e=ho(n,"color"))!=null?e:n.style.color;return t==null?void 0:t.replace(/['"]+/g,"")},renderHTML:n=>n.color?{style:`color: ${n.color}`}:{}}}}]},addCommands(){return{setColor:n=>({chain:e})=>e().setMark("textStyle",{color:n}).run(),unsetColor:()=>({chain:n})=>n().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),rE=Je.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:n=>{var e;return(e=ho(n,"font-family"))!=null?e:n.style.fontFamily},renderHTML:n=>n.fontFamily?{style:`font-family: ${n.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:n=>({chain:e})=>e().setMark("textStyle",{fontFamily:n}).run(),unsetFontFamily:()=>({chain:n})=>n().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),iE=Je.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:n=>{var e;return(e=ho(n,"font-size"))!=null?e:n.style.fontSize},renderHTML:n=>n.fontSize?{style:`font-size: ${n.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:n=>({chain:e})=>e().setMark("textStyle",{fontSize:n}).run(),unsetFontSize:()=>({chain:n})=>n().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),oE=Je.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:n=>{var e;return(e=ho(n,"line-height"))!=null?e:n.style.lineHeight},renderHTML:n=>n.lineHeight?{style:`line-height: ${n.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:n=>({chain:e})=>e().setMark("textStyle",{lineHeight:n}).run(),unsetLineHeight:()=>({chain:n})=>n().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});Je.create({name:"textStyleKit",addExtensions(){const n=[];return this.options.backgroundColor!==!1&&n.push(nE.configure(this.options.backgroundColor)),this.options.color!==!1&&n.push(E_.configure(this.options.color)),this.options.fontFamily!==!1&&n.push(rE.configure(this.options.fontFamily)),this.options.fontSize!==!1&&n.push(iE.configure(this.options.fontSize)),this.options.lineHeight!==!1&&n.push(oE.configure(this.options.lineHeight)),this.options.textStyle!==!1&&n.push(C_.configure(this.options.textStyle)),n}});var sE=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,aE=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,lE=zn.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||ho(n,"background-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",$e(this.options.HTMLAttributes,n),0]},renderMarkdown:(n,e)=>`==${e.renderChildren(n)}==`,parseMarkdown:(n,e)=>e.applyMark("highlight",e.parseInline(n.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:n=>n.indexOf("=="),tokenize(n,e,t){const i=/^(==)([^=]+)(==)/.exec(n);if(i){const o=i[2].trim(),s=t.inlineTokens(o);return{type:"highlight",raw:i[0],text:o,tokens:s}}}},addCommands(){return{setHighlight:n=>({commands:e})=>e.setMark(this.name,n),toggleHighlight:n=>({commands:e})=>e.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Ai({find:sE,type:this.type})]},addPasteRules(){return[ei({find:aE,type:this.type})]}}),cE=lE,uE=zn.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(n){return n!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sub",$e(this.options.HTMLAttributes,n),0]},addCommands(){return{setSubscript:()=>({commands:n})=>n.setMark(this.name),toggleSubscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSubscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),dE=uE,hE=zn.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(n){return n!=="super"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sup",$e(this.options.HTMLAttributes,n),0]},addCommands(){return{setSuperscript:()=>({commands:n})=>n.setMark(this.name),toggleSuperscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSuperscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),fE=hE,pE=KC,T_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function or(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var W0,A_;function mE(){if(A_)return W0;A_=1;var n={exports:{}};function e(N){return N instanceof Map?N.clear=N.delete=N.set=function(){throw new Error("map is read-only")}:N instanceof Set&&(N.add=N.clear=N.delete=function(){throw new Error("set is read-only")}),Object.freeze(N),Object.getOwnPropertyNames(N).forEach(function(ee){var J=N[ee];typeof J=="object"&&!Object.isFrozen(J)&&e(J)}),N}n.exports=e,n.exports.default=e;class t{constructor(ee){ee.data===void 0&&(ee.data={}),this.data=ee.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(N){return N.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function i(N,...ee){const J=Object.create(null);for(const De in N)J[De]=N[De];return ee.forEach(function(De){for(const ct in De)J[ct]=De[ct]}),J}const o="</span>",s=N=>!!N.scope||N.sublanguage&&N.language,a=(N,{prefix:ee})=>{if(N.includes(".")){const J=N.split(".");return[`${ee}${J.shift()}`,...J.map((De,ct)=>`${De}${"_".repeat(ct+1)}`)].join(" ")}return`${ee}${N}`};class l{constructor(ee,J){this.buffer="",this.classPrefix=J.classPrefix,ee.walk(this)}addText(ee){this.buffer+=r(ee)}openNode(ee){if(!s(ee))return;let J="";ee.sublanguage?J=`language-${ee.language}`:J=a(ee.scope,{prefix:this.classPrefix}),this.span(J)}closeNode(ee){s(ee)&&(this.buffer+=o)}value(){return this.buffer}span(ee){this.buffer+=`<span class="${ee}">`}}const c=(N={})=>{const ee={children:[]};return Object.assign(ee,N),ee};class u{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ee){this.top.children.push(ee)}openNode(ee){const J=c({scope:ee});this.add(J),this.stack.push(J)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ee){return this.constructor._walk(ee,this.rootNode)}static _walk(ee,J){return typeof J=="string"?ee.addText(J):J.children&&(ee.openNode(J),J.children.forEach(De=>this._walk(ee,De)),ee.closeNode(J)),ee}static _collapse(ee){typeof ee!="string"&&ee.children&&(ee.children.every(J=>typeof J=="string")?ee.children=[ee.children.join("")]:ee.children.forEach(J=>{u._collapse(J)}))}}class d extends u{constructor(ee){super(),this.options=ee}addKeyword(ee,J){ee!==""&&(this.openNode(J),this.addText(ee),this.closeNode())}addText(ee){ee!==""&&this.add(ee)}addSublanguage(ee,J){const De=ee.root;De.sublanguage=!0,De.language=J,this.add(De)}toHTML(){return new l(this,this.options).value()}finalize(){return!0}}function m(N){return N?typeof N=="string"?N:N.source:null}function b(N){return w("(?=",N,")")}function f(N){return w("(?:",N,")*")}function y(N){return w("(?:",N,")?")}function w(...N){return N.map(J=>m(J)).join("")}function k(N){const ee=N[N.length-1];return typeof ee=="object"&&ee.constructor===Object?(N.splice(N.length-1,1),ee):{}}function E(...N){return"("+(k(N).capture?"":"?:")+N.map(De=>m(De)).join("|")+")"}function S(N){return new RegExp(N.toString()+"|").exec("").length-1}function D(N,ee){const J=N&&N.exec(ee);return J&&J.index===0}const R=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(N,{joinWith:ee}){let J=0;return N.map(De=>{J+=1;const ct=J;let we=m(De),me="";for(;we.length>0;){const _e=R.exec(we);if(!_e){me+=we;break}me+=we.substring(0,_e.index),we=we.substring(_e.index+_e[0].length),_e[0][0]==="\\"&&_e[1]?me+="\\"+String(Number(_e[1])+ct):(me+=_e[0],_e[0]==="("&&J++)}return me}).map(De=>`(${De})`).join(ee)}const q=/\b\B/,H="[a-zA-Z]\\w*",U="[a-zA-Z_]\\w*",F="\\b\\d+(\\.\\d+)?",j="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Y="\\b(0b[01]+)",ne="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",$=(N={})=>{const ee=/^#![ ]*\//;return N.binary&&(N.begin=w(ee,/.*\b/,N.binary,/\b.*/)),i({scope:"meta",begin:ee,end:/$/,relevance:0,"on:begin":(J,De)=>{J.index!==0&&De.ignoreMatch()}},N)},Q={begin:"\\\\[\\s\\S]",relevance:0},ie={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Q]},re={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Q]},ue={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},X=function(N,ee,J={}){const De=i({scope:"comment",begin:N,end:ee,contains:[]},J);De.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const ct=E("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return De.contains.push({begin:w(/[ ]+/,"(",ct,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),De},te=X("//","$"),fe=X("/\\*","\\*/"),be=X("#","$"),Ce={scope:"number",begin:F,relevance:0},qe={scope:"number",begin:j,relevance:0},pt={scope:"number",begin:Y,relevance:0},We={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Q,{begin:/\[/,end:/\]/,relevance:0,contains:[Q]}]}]},Ke={scope:"title",begin:H,relevance:0},mt={scope:"title",begin:U,relevance:0},Fe={begin:"\\.\\s*"+U,relevance:0};var Ye=Object.freeze({__proto__:null,MATCH_NOTHING_RE:q,IDENT_RE:H,UNDERSCORE_IDENT_RE:U,NUMBER_RE:F,C_NUMBER_RE:j,BINARY_NUMBER_RE:Y,RE_STARTERS_RE:ne,SHEBANG:$,BACKSLASH_ESCAPE:Q,APOS_STRING_MODE:ie,QUOTE_STRING_MODE:re,PHRASAL_WORDS_MODE:ue,COMMENT:X,C_LINE_COMMENT_MODE:te,C_BLOCK_COMMENT_MODE:fe,HASH_COMMENT_MODE:be,NUMBER_MODE:Ce,C_NUMBER_MODE:qe,BINARY_NUMBER_MODE:pt,REGEXP_MODE:We,TITLE_MODE:Ke,UNDERSCORE_TITLE_MODE:mt,METHOD_GUARD:Fe,END_SAME_AS_BEGIN:function(N){return Object.assign(N,{"on:begin":(ee,J)=>{J.data._beginMatch=ee[1]},"on:end":(ee,J)=>{J.data._beginMatch!==ee[1]&&J.ignoreMatch()}})}});function lt(N,ee){N.input[N.index-1]==="."&&ee.ignoreMatch()}function St(N,ee){N.className!==void 0&&(N.scope=N.className,delete N.className)}function yt(N,ee){ee&&N.beginKeywords&&(N.begin="\\b("+N.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",N.__beforeBegin=lt,N.keywords=N.keywords||N.beginKeywords,delete N.beginKeywords,N.relevance===void 0&&(N.relevance=0))}function tt(N,ee){Array.isArray(N.illegal)&&(N.illegal=E(...N.illegal))}function $t(N,ee){if(N.match){if(N.begin||N.end)throw new Error("begin & end are not supported with match");N.begin=N.match,delete N.match}}function bc(N,ee){N.relevance===void 0&&(N.relevance=1)}const _c=(N,ee)=>{if(!N.beforeMatch)return;if(N.starts)throw new Error("beforeMatch cannot be used with starts");const J=Object.assign({},N);Object.keys(N).forEach(De=>{delete N[De]}),N.keywords=J.keywords,N.begin=w(J.beforeMatch,b(J.begin)),N.starts={relevance:0,contains:[Object.assign(J,{endsParent:!0})]},N.relevance=0,delete J.beforeMatch},yc=["of","and","for","in","not","or","if","then","parent","list","value"],$i="keyword";function Eo(N,ee,J=$i){const De=Object.create(null);return typeof N=="string"?ct(J,N.split(" ")):Array.isArray(N)?ct(J,N):Object.keys(N).forEach(function(we){Object.assign(De,Eo(N[we],ee,we))}),De;function ct(we,me){ee&&(me=me.map(_e=>_e.toLowerCase())),me.forEach(function(_e){const Le=_e.split("|");De[Le[0]]=[we,Ef(Le[0],Le[1])]})}}function Ef(N,ee){return ee?Number(ee):Tf(N)?0:1}function Tf(N){return yc.includes(N.toLowerCase())}const cn={},tn=N=>{console.error(N)},lr=(N,...ee)=>{console.log(`WARN: ${N}`,...ee)},cr=(N,ee)=>{cn[`${N}/${ee}`]||(console.log(`Deprecated as of ${N}. ${ee}`),cn[`${N}/${ee}`]=!0)},Wi=new Error;function vc(N,ee,{key:J}){let De=0;const ct=N[J],we={},me={};for(let _e=1;_e<=ee.length;_e++)me[_e+De]=ct[_e],we[_e+De]=!0,De+=S(ee[_e-1]);N[J]=me,N[J]._emit=we,N[J]._multi=!0}function On(N){if(Array.isArray(N.begin)){if(N.skip||N.excludeBegin||N.returnBegin)throw tn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Wi;if(typeof N.beginScope!="object"||N.beginScope===null)throw tn("beginScope must be object"),Wi;vc(N,N.begin,{key:"beginScope"}),N.begin=L(N.begin,{joinWith:""})}}function To(N){if(Array.isArray(N.end)){if(N.skip||N.excludeEnd||N.returnEnd)throw tn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Wi;if(typeof N.endScope!="object"||N.endScope===null)throw tn("endScope must be object"),Wi;vc(N,N.end,{key:"endScope"}),N.end=L(N.end,{joinWith:""})}}function wc(N){N.scope&&typeof N.scope=="object"&&N.scope!==null&&(N.beginScope=N.scope,delete N.scope)}function Af(N){wc(N),typeof N.beginScope=="string"&&(N.beginScope={_wrap:N.beginScope}),typeof N.endScope=="string"&&(N.endScope={_wrap:N.endScope}),On(N),To(N)}function Ws(N){function ee(me,_e){return new RegExp(m(me),"m"+(N.case_insensitive?"i":"")+(N.unicodeRegex?"u":"")+(_e?"g":""))}class J{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(_e,Le){Le.position=this.position++,this.matchIndexes[this.matchAt]=Le,this.regexes.push([Le,_e]),this.matchAt+=S(_e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const _e=this.regexes.map(Le=>Le[1]);this.matcherRe=ee(L(_e,{joinWith:"|"}),!0),this.lastIndex=0}exec(_e){this.matcherRe.lastIndex=this.lastIndex;const Le=this.matcherRe.exec(_e);if(!Le)return null;const V=Le.findIndex((W,Mo)=>Mo>0&&W!==void 0),nt=this.matchIndexes[V];return Le.splice(0,V),Object.assign(Le,nt)}}class De{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(_e){if(this.multiRegexes[_e])return this.multiRegexes[_e];const Le=new J;return this.rules.slice(_e).forEach(([V,nt])=>Le.addRule(V,nt)),Le.compile(),this.multiRegexes[_e]=Le,Le}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(_e,Le){this.rules.push([_e,Le]),Le.type==="begin"&&this.count++}exec(_e){const Le=this.getMatcher(this.regexIndex);Le.lastIndex=this.lastIndex;let V=Le.exec(_e);if(this.resumingScanAtSamePosition()&&!(V&&V.index===this.lastIndex)){const nt=this.getMatcher(0);nt.lastIndex=this.lastIndex+1,V=nt.exec(_e)}return V&&(this.regexIndex+=V.position+1,this.regexIndex===this.count&&this.considerAll()),V}}function ct(me){const _e=new De;return me.contains.forEach(Le=>_e.addRule(Le.begin,{rule:Le,type:"begin"})),me.terminatorEnd&&_e.addRule(me.terminatorEnd,{type:"end"}),me.illegal&&_e.addRule(me.illegal,{type:"illegal"}),_e}function we(me,_e){const Le=me;if(me.isCompiled)return Le;[St,$t,Af,_c].forEach(nt=>nt(me,_e)),N.compilerExtensions.forEach(nt=>nt(me,_e)),me.__beforeBegin=null,[yt,tt,bc].forEach(nt=>nt(me,_e)),me.isCompiled=!0;let V=null;return typeof me.keywords=="object"&&me.keywords.$pattern&&(me.keywords=Object.assign({},me.keywords),V=me.keywords.$pattern,delete me.keywords.$pattern),V=V||/\w+/,me.keywords&&(me.keywords=Eo(me.keywords,N.case_insensitive)),Le.keywordPatternRe=ee(V,!0),_e&&(me.begin||(me.begin=/\B|\b/),Le.beginRe=ee(Le.begin),!me.end&&!me.endsWithParent&&(me.end=/\B|\b/),me.end&&(Le.endRe=ee(Le.end)),Le.terminatorEnd=m(Le.end)||"",me.endsWithParent&&_e.terminatorEnd&&(Le.terminatorEnd+=(me.end?"|":"")+_e.terminatorEnd)),me.illegal&&(Le.illegalRe=ee(me.illegal)),me.contains||(me.contains=[]),me.contains=[].concat(...me.contains.map(function(nt){return Mf(nt==="self"?me:nt)})),me.contains.forEach(function(nt){we(nt,Le)}),me.starts&&we(me.starts,_e),Le.matcher=ct(Le),Le}if(N.compilerExtensions||(N.compilerExtensions=[]),N.contains&&N.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return N.classNameAliases=i(N.classNameAliases||{}),we(N)}function Ao(N){return N?N.endsWithParent||Ao(N.starts):!1}function Mf(N){return N.variants&&!N.cachedVariants&&(N.cachedVariants=N.variants.map(function(ee){return i(N,{variants:null},ee)})),N.cachedVariants?N.cachedVariants:Ao(N)?i(N,{starts:N.starts?i(N.starts):null}):Object.isFrozen(N)?i(N):N}var Nf="11.6.0";class Df extends Error{constructor(ee,J){super(ee),this.name="HTMLInjectionError",this.html=J}}const ci=r,vt=i,C=Symbol("nomatch"),M=7;var O=function(N){const ee=Object.create(null),J=Object.create(null),De=[];let ct=!0;const we="Could not find the language '{}', did you forget to load/include a language module?",me={disableAutodetect:!0,name:"Plain text",contains:[]};let _e={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function Le(pe){return _e.noHighlightRe.test(pe)}function V(pe){let Pe=pe.className+" ";Pe+=pe.parentNode?pe.parentNode.className:"";const Ge=_e.languageDetectRe.exec(Pe);if(Ge){const it=rn(Ge[1]);return it||(lr(we.replace("{}",Ge[1])),lr("Falling back to no-highlight mode for this block.",pe)),it?Ge[1]:"no-highlight"}return Pe.split(/\s+/).find(it=>Le(it)||rn(it))}function nt(pe,Pe,Ge){let it="",It="";typeof Pe=="object"?(it=pe,Ge=Pe.ignoreIllegals,It=Pe.language):(cr("10.7.0","highlight(lang, code, ...args) has been deprecated."),cr("10.7.0",`Please use highlight(code, options) instead.
142
142
  https://github.com/highlightjs/highlight.js/issues/2277`),It=pe,it=Pe),Ge===void 0&&(Ge=!0);const vn={code:it,language:It};Rr("before:highlight",vn);const Ln=vn.result?vn.result:W(vn.language,vn.code,Ge);return Ln.code=vn.code,Rr("after:highlight",Ln),Ln}function W(pe,Pe,Ge,it){const It=Object.create(null);function vn(xe,Ne){return xe.keywords[Ne]}function Ln(){if(!He.keywords){Ft.addText(gt);return}let xe=0;He.keywordPatternRe.lastIndex=0;let Ne=He.keywordPatternRe.exec(gt),K="";for(;Ne;){K+=gt.substring(xe,Ne.index);const Ie=At.case_insensitive?Ne[0].toLowerCase():Ne[0],Ct=vn(He,Ie);if(Ct){const[Ht,Pf]=Ct;if(Ft.addText(K),K="",It[Ie]=(It[Ie]||0)+1,It[Ie]<=M&&(Fo+=Pf),Ht.startsWith("_"))K+=Ne[0];else{const Bf=At.classNameAliases[Ht]||Ht;Ft.addKeyword(Ne[0],Bf)}}else K+=Ne[0];xe=He.keywordPatternRe.lastIndex,Ne=He.keywordPatternRe.exec(gt)}K+=gt.substring(xe),Ft.addText(K)}function Lo(){if(gt==="")return;let xe=null;if(typeof He.subLanguage=="string"){if(!ee[He.subLanguage]){Ft.addText(gt);return}xe=W(He.subLanguage,gt,!0,Zs[He.subLanguage]),Zs[He.subLanguage]=xe._top}else xe=No(gt,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(Fo+=xe.relevance),Ft.addSublanguage(xe._emitter,xe.language)}function on(){He.subLanguage!=null?Lo():Ln(),gt=""}function Ze(xe,Ne){let K=1;const Ie=Ne.length-1;for(;K<=Ie;){if(!xe._emit[K]){K++;continue}const Ct=At.classNameAliases[xe[K]]||xe[K],Ht=Ne[K];Ct?Ft.addKeyword(Ht,Ct):(gt=Ht,Ln(),gt=""),K++}}function ji(xe,Ne){return xe.scope&&typeof xe.scope=="string"&&Ft.openNode(At.classNameAliases[xe.scope]||xe.scope),xe.beginScope&&(xe.beginScope._wrap?(Ft.addKeyword(gt,At.classNameAliases[xe.beginScope._wrap]||xe.beginScope._wrap),gt=""):xe.beginScope._multi&&(Ze(xe.beginScope,Ne),gt="")),He=Object.create(xe,{parent:{value:He}}),He}function pn(xe,Ne,K){let Ie=D(xe.endRe,K);if(Ie){if(xe["on:end"]){const Ct=new t(xe);xe["on:end"](Ne,Ct),Ct.isMatchIgnored&&(Ie=!1)}if(Ie){for(;xe.endsParent&&xe.parent;)xe=xe.parent;return xe}}if(xe.endsWithParent)return pn(xe.parent,Ne,K)}function Rf(xe){return He.matcher.regexIndex===0?(gt+=xe[0],1):(zo=!0,0)}function If(xe){const Ne=xe[0],K=xe.rule,Ie=new t(K),Ct=[K.__beforeBegin,K["on:begin"]];for(const Ht of Ct)if(Ht&&(Ht(xe,Ie),Ie.isMatchIgnored))return Rf(Ne);return K.skip?gt+=Ne:(K.excludeBegin&&(gt+=Ne),on(),!K.returnBegin&&!K.excludeBegin&&(gt=Ne)),ji(K,xe),K.returnBegin?0:Ne.length}function Of(xe){const Ne=xe[0],K=Pe.substring(xe.index),Ie=pn(He,xe,K);if(!Ie)return C;const Ct=He;He.endScope&&He.endScope._wrap?(on(),Ft.addKeyword(Ne,He.endScope._wrap)):He.endScope&&He.endScope._multi?(on(),Ze(He.endScope,xe)):Ct.skip?gt+=Ne:(Ct.returnEnd||Ct.excludeEnd||(gt+=Ne),on(),Ct.excludeEnd&&(gt=Ne));do He.scope&&Ft.closeNode(),!He.skip&&!He.subLanguage&&(Fo+=He.relevance),He=He.parent;while(He!==Ie.parent);return Ie.starts&&ji(Ie.starts,xe),Ct.returnEnd?0:Ne.length}function Lf(){const xe=[];for(let Ne=He;Ne!==At;Ne=Ne.parent)Ne.scope&&xe.unshift(Ne.scope);xe.forEach(Ne=>Ft.openNode(Ne))}let Po={};function Bo(xe,Ne){const K=Ne&&Ne[0];if(gt+=xe,K==null)return on(),0;if(Po.type==="begin"&&Ne.type==="end"&&Po.index===Ne.index&&K===""){if(gt+=Pe.slice(Ne.index,Ne.index+1),!ct){const Ie=new Error(`0 width match regex (${pe})`);throw Ie.languageName=pe,Ie.badRule=Po.rule,Ie}return 1}if(Po=Ne,Ne.type==="begin")return If(Ne);if(Ne.type==="illegal"&&!Ge){const Ie=new Error('Illegal lexeme "'+K+'" for mode "'+(He.scope||"<unnamed>")+'"');throw Ie.mode=He,Ie}else if(Ne.type==="end"){const Ie=Of(Ne);if(Ie!==C)return Ie}if(Ne.type==="illegal"&&K==="")return 1;if(di>1e5&&di>Ne.index*3)throw new Error("potential infinite loop, way more iterations than matches");return gt+=K,K.length}const At=rn(pe);if(!At)throw tn(we.replace("{}",pe)),new Error('Unknown language: "'+pe+'"');const Cc=Ws(At);let Ys="",He=it||Cc;const Zs={},Ft=new _e.__emitter(_e);Lf();let gt="",Fo=0,Ir=0,di=0,zo=!1;try{for(He.matcher.considerAll();;){di++,zo?zo=!1:He.matcher.considerAll(),He.matcher.lastIndex=Ir;const xe=He.matcher.exec(Pe);if(!xe)break;const Ne=Pe.substring(Ir,xe.index),K=Bo(Ne,xe);Ir=xe.index+K}return Bo(Pe.substring(Ir)),Ft.closeAllNodes(),Ft.finalize(),Ys=Ft.toHTML(),{language:pe,value:Ys,relevance:Fo,illegal:!1,_emitter:Ft,_top:He}}catch(xe){if(xe.message&&xe.message.includes("Illegal"))return{language:pe,value:ci(Pe),illegal:!0,relevance:0,_illegalBy:{message:xe.message,index:Ir,context:Pe.slice(Ir-100,Ir+100),mode:xe.mode,resultSoFar:Ys},_emitter:Ft};if(ct)return{language:pe,value:ci(Pe),illegal:!1,relevance:0,errorRaised:xe,_emitter:Ft,_top:He};throw xe}}function Mo(pe){const Pe={value:ci(pe),illegal:!1,relevance:0,_top:me,_emitter:new _e.__emitter(_e)};return Pe._emitter.addText(pe),Pe}function No(pe,Pe){Pe=Pe||_e.languages||Object.keys(ee);const Ge=Mo(pe),it=Pe.filter(rn).filter(Io).map(on=>W(on,pe,!1));it.unshift(Ge);const It=it.sort((on,Ze)=>{if(on.relevance!==Ze.relevance)return Ze.relevance-on.relevance;if(on.language&&Ze.language){if(rn(on.language).supersetOf===Ze.language)return 1;if(rn(Ze.language).supersetOf===on.language)return-1}return 0}),[vn,Ln]=It,Lo=vn;return Lo.secondBest=Ln,Lo}function Ks(pe,Pe,Ge){const it=Pe&&J[Pe]||Ge;pe.classList.add("hljs"),pe.classList.add(`language-${it}`)}function Do(pe){let Pe=null;const Ge=V(pe);if(Le(Ge))return;if(Rr("before:highlightElement",{el:pe,language:Ge}),pe.children.length>0&&(_e.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(pe)),_e.throwUnescapedHTML))throw new Df("One of your code blocks includes unescaped HTML.",pe.innerHTML);Pe=pe;const it=Pe.textContent,It=Ge?nt(it,{language:Ge,ignoreIllegals:!0}):No(it);pe.innerHTML=It.value,Ks(pe,Ge,It.language),pe.result={language:It.language,re:It.relevance,relevance:It.relevance},It.secondBest&&(pe.secondBest={language:It.secondBest.language,relevance:It.secondBest.relevance}),Rr("after:highlightElement",{el:pe,result:It,text:it})}function xc(pe){_e=vt(_e,pe)}const js=()=>{ui(),cr("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function kc(){ui(),cr("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ki=!1;function ui(){if(document.readyState==="loading"){Ki=!0;return}document.querySelectorAll(_e.cssSelector).forEach(Do)}function Ro(){Ki&&ui()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",Ro,!1);function ze(pe,Pe){let Ge=null;try{Ge=Pe(N)}catch(it){if(tn("Language definition for '{}' could not be registered.".replace("{}",pe)),ct)tn(it);else throw it;Ge=me}Ge.name||(Ge.name=pe),ee[pe]=Ge,Ge.rawDefinition=Pe.bind(null,N),Ge.aliases&&jn(Ge.aliases,{languageName:pe})}function nn(pe){delete ee[pe];for(const Pe of Object.keys(J))J[Pe]===pe&&delete J[Pe]}function Rt(){return Object.keys(ee)}function rn(pe){return pe=(pe||"").toLowerCase(),ee[pe]||ee[J[pe]]}function jn(pe,{languageName:Pe}){typeof pe=="string"&&(pe=[pe]),pe.forEach(Ge=>{J[Ge.toLowerCase()]=Pe})}function Io(pe){const Pe=rn(pe);return Pe&&!Pe.disableAutodetect}function Qs(pe){pe["before:highlightBlock"]&&!pe["before:highlightElement"]&&(pe["before:highlightElement"]=Pe=>{pe["before:highlightBlock"](Object.assign({block:Pe.el},Pe))}),pe["after:highlightBlock"]&&!pe["after:highlightElement"]&&(pe["after:highlightElement"]=Pe=>{pe["after:highlightBlock"](Object.assign({block:Pe.el},Pe))})}function Oo(pe){Qs(pe),De.push(pe)}function Rr(pe,Pe){const Ge=pe;De.forEach(function(it){it[Ge]&&it[Ge](Pe)})}function Sc(pe){return cr("10.7.0","highlightBlock will be removed entirely in v12.0"),cr("10.7.0","Please use highlightElement now."),Do(pe)}Object.assign(N,{highlight:nt,highlightAuto:No,highlightAll:ui,highlightElement:Do,highlightBlock:Sc,configure:xc,initHighlighting:js,initHighlightingOnLoad:kc,registerLanguage:ze,unregisterLanguage:nn,listLanguages:Rt,getLanguage:rn,registerAliases:jn,autoDetection:Io,inherit:vt,addPlugin:Oo}),N.debugMode=function(){ct=!1},N.safeMode=function(){ct=!0},N.versionString=Nf,N.regex={concat:w,lookahead:b,either:E,optional:y,anyNumberOfTimes:f};for(const pe in Ye)typeof Ye[pe]=="object"&&n.exports(Ye[pe]);return Object.assign(N,Ye),N}({});return W0=O,O.HighlightJS=O,O.default=O,W0}var gE=mE();const Rn=or(gE);function M_(n,e=[]){return n.flatMap(t=>{const r=[...e,...t.properties?t.properties.className:[]];return t.children?M_(t.children,r):{text:t.value,classes:r}})}function N_(n){return n.value||n.children||[]}function bE(n){return!!Rn.getLanguage(n)}function D_({doc:n,name:e,lowlight:t,defaultLanguage:r}){const i=[];return Bu(n,o=>o.type.name===e).forEach(o=>{var s;let a=o.pos+1;const l=o.node.attrs.language||r,c=t.listLanguages(),u=l&&(c.includes(l)||bE(l)||(s=t.registered)!=null&&s.call(t,l))?N_(t.highlight(l,o.node.textContent)):N_(t.highlightAuto(o.node.textContent));M_(u).forEach(d=>{const m=a+d.text.length;if(d.classes.length){const b=qt.inline(a,m,{class:d.classes.join(" ")});i.push(b)}a=m})}),ht.create(n,i)}function _E(n){return typeof n=="function"}function yE({name:n,lowlight:e,defaultLanguage:t}){if(!["highlight","highlightAuto","listLanguages"].every(i=>_E(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new at({key:new dt("lowlight"),state:{init:(i,{doc:o})=>D_({doc:o,name:n,lowlight:e,defaultLanguage:t}),apply:(i,o,s,a)=>{const l=s.selection.$head.parent.type.name,c=a.selection.$head.parent.type.name,u=Bu(s.doc,m=>m.type.name===n),d=Bu(a.doc,m=>m.type.name===n);return i.docChanged&&([l,c].includes(n)||d.length!==u.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&u.some(b=>b.pos>=m.from&&b.pos+b.node.nodeSize<=m.to)))?D_({doc:i.doc,name:n,lowlight:e,defaultLanguage:t}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var vE=Lb.extend({addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){var n;return[...((n=this.parent)==null?void 0:n.call(this))||[],yE({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),wE=vE;const Gt=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},xE={components:{NodeViewWrapper:Mi,NodeViewContent:O1},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{thisTheme:this.editor.storage.defaultStorage.theme,status:{copy:!1},timer:{copy:null}}},watch:{"editor.storage.defaultStorage.theme"(n){this.thisTheme=n}},computed:{actionButtonBackground(){return this.thisTheme==="dark"?"rgba(36, 36, 36, 1)":"rgba(255, 255, 255, 1)"},languages(){let n=this.extension.options.lowlight.listLanguages(),e=[];for(let t=0;t<n.length;t++)e.push({key:n[t],text:n[t][0].toUpperCase()+n[t].slice(1).toLowerCase()});return e.unshift({key:"auto",text:"Default"}),e},selectedLanguage:{get(){let n=this.languages.find(e=>e.key===this.node.attrs.language);return n?[n]:[this.languages[0]]},set(n){n.length!==0&&this.updateAttributes({language:n[0].key})}}},mounted(){},methods:{copyCode(){if(this.status.copy)return;this.status.copy=!0;let n=this.node.textContent,e=document.createElement("textarea");e.value=n,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),this.timer.copy=setTimeout(()=>{this.status.copy=!1},3e3)}}},kE={contenteditable:"false",class:"power-editor-code-block-banner"},SE={class:"power-editor-code-block-banner-left-block"},CE={class:"power-editor-code-block-language"},EE={class:"power-editor-code-block-banner-right-block"},TE={key:0,contenteditable:"false",class:"power-editor-code-block-line-number-block"},AE=["title"];function ME(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("fv-DropDown"),l=v.resolveComponent("node-view-content"),c=v.resolveComponent("node-view-wrapper");return v.openBlock(),v.createBlock(c,{class:v.normalizeClass(["power-editor-code-block",[{dark:i.thisTheme==="dark"}]])},{default:v.withCtx(()=>[v.createElementVNode("div",kE,[v.createElementVNode("div",SE,[v.createElementVNode("p",CE,v.toDisplayString(t.node.attrs.language||"auto"),1)]),v.createElementVNode("div",EE,[v.withDirectives(v.createVNode(a,{modelValue:o.selectedLanguage,"onUpdate:modelValue":e[0]||(e[0]=u=>o.selectedLanguage=u),placeholder:"Select language",theme:i.thisTheme,options:o.languages,"max-height":"300px",style:{width:"120px",height:"25px"}},{"drop-carrier":v.withCtx(u=>[v.createVNode(s,{theme:u.theme,icon:"ChevronDown",background:o.actionButtonBackground,"font-size":"10",class:"power-editor-code-block-action-btn",title:o.selectedLanguage[0].text||"Select language","border-radius":"6",style:{width:"80px",float:"right"}},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(o.selectedLanguage[0].text||"Default"),1)]),_:2},1032,["theme","background","title"])]),_:1},8,["modelValue","theme","options"]),[[v.vShow,t.editor.storage.defaultStorage.codeBlockLanguagesBox]]),v.createVNode(s,{theme:i.thisTheme,background:o.actionButtonBackground,"font-size":"10",class:"power-editor-code-block-action-btn",title:i.status.copy?"Copied":"Copy","border-radius":"6",onClick:o.copyCode},{default:v.withCtx(()=>[v.createElementVNode("i",{class:v.normalizeClass(["ms-Icon",[`ms-Icon--${i.status.copy?"Accept":"Set"}`]])},null,2)]),_:1},8,["theme","background","title","onClick"])])]),v.createElementVNode("pre",{class:v.normalizeClass(["power-editor-code-block-pre",[{lineNumber:t.editor.storage.defaultStorage.codeBlockLineNumbers}]])},[v.createElementVNode("code",null,[v.createVNode(l)])],2),t.editor.storage.defaultStorage.codeBlockLineNumbers?(v.openBlock(),v.createElementBlock("div",TE,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(t.node.textContent.split(`
143
- `),(u,d)=>(v.openBlock(),v.createElementBlock("div",{key:d,class:"power-editor-code-block-line-number-item",title:d+1},v.toDisplayString(d+1),9,AE))),128))])):v.createCommentVNode("",!0)]),_:1},8,["class"])}const NE=Gt(xE,[["render",ME]]);function Pl(n,e="language-"){var o,s,a;if(!n)return null;const t=((o=n.getAttribute)==null?void 0:o.call(n,"data-language"))||((s=n.getAttribute)==null?void 0:s.call(n,"language"))||((a=n.getAttribute)==null?void 0:a.call(n,"lang"));if(t)return t;if(!e)return null;const i=[...n.classList||[]].find(l=>l.startsWith(e));return i&&i.replace(e,"")||null}function DE(n){return n?(typeof n.innerText=="string"?n.innerText:n.textContent||"").replace(/\r\n?/g,`
144
- `):""}const RE=wE.extend({transformPastedHTML(n){if(!n||typeof DOMParser>"u")return n;const t=new DOMParser().parseFromString(n,"text/html"),{languageClassPrefix:r}=this.options;return t.querySelectorAll("[hidden], [aria-hidden='true'], script, style, meta, link").forEach(i=>i.remove()),t.querySelectorAll("pre").forEach(i=>{var d;const o=(d=i.querySelector("pre code"))==null?void 0:d.closest("pre");if(!o||o===i)return;const s=o.querySelector("code"),a=DE(s||o),l=Pl(s,r)||Pl(o,r),c=t.createElement("pre"),u=t.createElement("code");l&&r&&u.classList.add(`${r}${l}`),u.textContent=a,c.appendChild(u),i.replaceWith(c)}),t.querySelectorAll("pre").forEach(i=>{const o=i.querySelector("code"),s=Pl(o,r)||Pl(i,r);s&&o&&r&&![...o.classList].some(a=>a.startsWith(r))&&o.classList.add(`${r}${s}`)}),t.body.innerHTML},addNodeView(){return ti(NE)}});function Bl(n){return n==="left"||n==="right"||n==="center"?n:null}function IE(n){const e=(n.style.textAlign||"").trim().toLowerCase(),t=(n.getAttribute("align")||"").trim().toLowerCase();return Bl(e||t)}function OE(n){return Bl(n==null?void 0:n.align)}function R_(){return{default:null,parseHTML:n=>IE(n),renderHTML:n=>n.align?{style:`text-align: ${n.align}`}:{}}}var I_=xt.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{var e,t;const r=n.getAttribute("colwidth"),i=r?r.split(",").map(o=>parseInt(o,10)):null;if(!i){const o=(e=n.closest("table"))==null?void 0:e.querySelectorAll("colgroup > col"),s=Array.from(((t=n.parentElement)==null?void 0:t.children)||[]).indexOf(n);if(s&&s>-1&&o&&o[s]){const a=o[s].getAttribute("width");return a?[parseInt(a,10)]:null}}return i}},align:R_()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:n}){return["td",$e(this.options.HTMLAttributes,n),0]}}),O_=xt.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}},align:R_()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:n}){return["th",$e(this.options.HTMLAttributes,n),0]}}),L_=xt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:n}){return["tr",$e(this.options.HTMLAttributes,n),0]}});function K0(n,e){return e?["width",`${Math.max(e,n)}px`]:["min-width",`${n}px`]}function P_(n,e,t,r,i,o){var s;let a=0,l=!0,c=e.firstChild;const u=n.firstChild;if(u!==null)for(let m=0,b=0;m<u.childCount;m+=1){const{colspan:f,colwidth:y}=u.child(m).attrs;for(let w=0;w<f;w+=1,b+=1){const k=i===b?o:y&&y[w],E=k?`${k}px`:"";if(a+=k||r,k||(l=!1),c){if(c.style.width!==E){const[S,D]=K0(r,k);c.style.setProperty(S,D)}c=c.nextSibling}else{const S=document.createElement("col"),[D,R]=K0(r,k);S.style.setProperty(D,R),e.appendChild(S)}}}for(;c;){const m=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=m}const d=n.attrs.style&&typeof n.attrs.style=="string"&&/\bwidth\s*:/i.test(n.attrs.style);l&&!d?(t.style.width=`${a}px`,t.style.minWidth=""):(t.style.width="",t.style.minWidth=`${a}px`)}var LE=class{constructor(n,e){this.node=n,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),n.attrs.style&&(this.table.style.cssText=n.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),P_(n,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(n){return n.type!==this.node.type?!1:(this.node=n,P_(n,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(n){const e=n.target,t=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(t&&!r&&(n.type==="attributes"||n.type==="childList"||n.type==="characterData"))}};function PE(n,e,t,r){let i=0,o=!0;const s=[],a=n.firstChild;if(!a)return{};for(let d=0,m=0;d<a.childCount;d+=1){const{colspan:b,colwidth:f}=a.child(d).attrs;for(let y=0;y<b;y+=1,m+=1){const w=t===m?r:f&&f[y];i+=w||e,w||(o=!1);const[k,E]=K0(e,w);s.push(["col",{style:`${k}: ${E}`}])}}const l=o?`${i}px`:"",c=o?"":`${i}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}}function B_(n,e){return n.createAndFill()}function BE(n){if(n.cached.tableNodeTypes)return n.cached.tableNodeTypes;const e={};return Object.keys(n.nodes).forEach(t=>{const r=n.nodes[t];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),n.cached.tableNodeTypes=e,e}function FE(n,e,t,r,i){const o=BE(n),s=[],a=[];for(let c=0;c<t;c+=1){const u=B_(o.cell);if(u&&a.push(u),r){const d=B_(o.header_cell);d&&s.push(d)}}const l=[];for(let c=0;c<e;c+=1)l.push(o.row.createChecked(null,r&&c===0?s:a));return o.table.createChecked(null,l)}function zE(n){return n instanceof ft}var Fl=({editor:n})=>{const{selection:e}=n.state;if(!zE(e))return!1;let t=0;const r=n1(e.ranges[0].$from,o=>o.type.name==="table");return r==null||r.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(t+=1)}),t===e.ranges.length?(n.commands.deleteTable(),!0):!1},qE="";function HE(n){return(n||"").replace(/\s+/g," ").trim()}function VE(n,e,t={}){var r;const i=(r=t.cellLineSeparator)!=null?r:qE;if(!n||!n.content||n.content.length===0)return"";const o=[];n.content.forEach(y=>{const w=[];y.content&&y.content.forEach(k=>{let E="";k.content&&Array.isArray(k.content)&&k.content.length>1?E=k.content.map(q=>e.renderChildren(q)).join(i):E=k.content?e.renderChildren(k.content):"";const S=HE(E),D=k.type==="tableHeader",R=OE(k.attrs);w.push({text:S,isHeader:D,align:R})}),o.push(w)});const s=o.reduce((y,w)=>Math.max(y,w.length),0);if(s===0)return"";const a=new Array(s).fill(0);o.forEach(y=>{var w;for(let k=0;k<s;k+=1){const S=(((w=y[k])==null?void 0:w.text)||"").length;S>a[k]&&(a[k]=S),a[k]<3&&(a[k]=3)}});const l=(y,w)=>y+" ".repeat(Math.max(0,w-y.length)),c=o[0],u=c.some(y=>y.isHeader),d=new Array(s).fill(null);o.forEach(y=>{var w;for(let k=0;k<s;k+=1)!d[k]&&((w=y[k])!=null&&w.align)&&(d[k]=y[k].align)});let m=`
143
+ `),(u,d)=>(v.openBlock(),v.createElementBlock("div",{key:d,class:"power-editor-code-block-line-number-item",title:d+1},v.toDisplayString(d+1),9,AE))),128))])):v.createCommentVNode("",!0)]),_:1},8,["class"])}const NE=Gt(xE,[["render",ME]]);function Pl(n,e="language-"){var o,s,a;if(!n)return null;const t=((o=n.getAttribute)==null?void 0:o.call(n,"data-language"))||((s=n.getAttribute)==null?void 0:s.call(n,"language"))||((a=n.getAttribute)==null?void 0:a.call(n,"lang"));if(t)return t;if(!e)return null;const i=[...n.classList||[]].find(l=>l.startsWith(e));return i&&i.replace(e,"")||null}function DE(n){if(!n)return"";const e=[],t=new Set(["DIV","P"]),r=i=>{if(!i)return;if(i.nodeType===Node.TEXT_NODE){e.push(i.nodeValue||"");return}if(i.nodeType!==Node.ELEMENT_NODE)return;if(i.tagName==="BR"){e.push(`
144
+ `);return}const o=e.length;Array.from(i.childNodes).forEach(r),t.has(i.tagName)&&e.length>o&&e[e.length-1]!==`
145
+ `&&e.push(`
146
+ `)};return r(n),e.join("").replace(/\r\n?/g,`
147
+ `).replace(/\n$/,"")}const RE=wE.extend({transformPastedHTML(n){if(!n||typeof DOMParser>"u")return n;const t=new DOMParser().parseFromString(n,"text/html"),{languageClassPrefix:r}=this.options;return t.querySelectorAll("[hidden], [aria-hidden='true'], script, style, meta, link").forEach(i=>i.remove()),t.querySelectorAll("pre").forEach(i=>{var d;const o=(d=i.querySelector("pre code"))==null?void 0:d.closest("pre");if(!o||o===i)return;const s=o.querySelector("code"),a=DE(s||o),l=Pl(s,r)||Pl(o,r),c=t.createElement("pre"),u=t.createElement("code");l&&r&&u.classList.add(`${r}${l}`),u.textContent=a,c.appendChild(u),i.replaceWith(c)}),t.querySelectorAll("pre").forEach(i=>{const o=i.querySelector("code"),s=Pl(o,r)||Pl(i,r);s&&o&&r&&![...o.classList].some(a=>a.startsWith(r))&&o.classList.add(`${r}${s}`)}),t.body.innerHTML},addNodeView(){return ti(NE)}});function Bl(n){return n==="left"||n==="right"||n==="center"?n:null}function IE(n){const e=(n.style.textAlign||"").trim().toLowerCase(),t=(n.getAttribute("align")||"").trim().toLowerCase();return Bl(e||t)}function OE(n){return Bl(n==null?void 0:n.align)}function R_(){return{default:null,parseHTML:n=>IE(n),renderHTML:n=>n.align?{style:`text-align: ${n.align}`}:{}}}var I_=xt.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{var e,t;const r=n.getAttribute("colwidth"),i=r?r.split(",").map(o=>parseInt(o,10)):null;if(!i){const o=(e=n.closest("table"))==null?void 0:e.querySelectorAll("colgroup > col"),s=Array.from(((t=n.parentElement)==null?void 0:t.children)||[]).indexOf(n);if(s&&s>-1&&o&&o[s]){const a=o[s].getAttribute("width");return a?[parseInt(a,10)]:null}}return i}},align:R_()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:n}){return["td",$e(this.options.HTMLAttributes,n),0]}}),O_=xt.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}},align:R_()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:n}){return["th",$e(this.options.HTMLAttributes,n),0]}}),L_=xt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:n}){return["tr",$e(this.options.HTMLAttributes,n),0]}});function K0(n,e){return e?["width",`${Math.max(e,n)}px`]:["min-width",`${n}px`]}function P_(n,e,t,r,i,o){var s;let a=0,l=!0,c=e.firstChild;const u=n.firstChild;if(u!==null)for(let m=0,b=0;m<u.childCount;m+=1){const{colspan:f,colwidth:y}=u.child(m).attrs;for(let w=0;w<f;w+=1,b+=1){const k=i===b?o:y&&y[w],E=k?`${k}px`:"";if(a+=k||r,k||(l=!1),c){if(c.style.width!==E){const[S,D]=K0(r,k);c.style.setProperty(S,D)}c=c.nextSibling}else{const S=document.createElement("col"),[D,R]=K0(r,k);S.style.setProperty(D,R),e.appendChild(S)}}}for(;c;){const m=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=m}const d=n.attrs.style&&typeof n.attrs.style=="string"&&/\bwidth\s*:/i.test(n.attrs.style);l&&!d?(t.style.width=`${a}px`,t.style.minWidth=""):(t.style.width="",t.style.minWidth=`${a}px`)}var LE=class{constructor(n,e){this.node=n,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),n.attrs.style&&(this.table.style.cssText=n.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),P_(n,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(n){return n.type!==this.node.type?!1:(this.node=n,P_(n,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(n){const e=n.target,t=this.dom.contains(e),r=this.contentDOM.contains(e);return!!(t&&!r&&(n.type==="attributes"||n.type==="childList"||n.type==="characterData"))}};function PE(n,e,t,r){let i=0,o=!0;const s=[],a=n.firstChild;if(!a)return{};for(let d=0,m=0;d<a.childCount;d+=1){const{colspan:b,colwidth:f}=a.child(d).attrs;for(let y=0;y<b;y+=1,m+=1){const w=t===m?r:f&&f[y];i+=w||e,w||(o=!1);const[k,E]=K0(e,w);s.push(["col",{style:`${k}: ${E}`}])}}const l=o?`${i}px`:"",c=o?"":`${i}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}}function B_(n,e){return n.createAndFill()}function BE(n){if(n.cached.tableNodeTypes)return n.cached.tableNodeTypes;const e={};return Object.keys(n.nodes).forEach(t=>{const r=n.nodes[t];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),n.cached.tableNodeTypes=e,e}function FE(n,e,t,r,i){const o=BE(n),s=[],a=[];for(let c=0;c<t;c+=1){const u=B_(o.cell);if(u&&a.push(u),r){const d=B_(o.header_cell);d&&s.push(d)}}const l=[];for(let c=0;c<e;c+=1)l.push(o.row.createChecked(null,r&&c===0?s:a));return o.table.createChecked(null,l)}function zE(n){return n instanceof ft}var Fl=({editor:n})=>{const{selection:e}=n.state;if(!zE(e))return!1;let t=0;const r=n1(e.ranges[0].$from,o=>o.type.name==="table");return r==null||r.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(t+=1)}),t===e.ranges.length?(n.commands.deleteTable(),!0):!1},qE="";function HE(n){return(n||"").replace(/\s+/g," ").trim()}function VE(n,e,t={}){var r;const i=(r=t.cellLineSeparator)!=null?r:qE;if(!n||!n.content||n.content.length===0)return"";const o=[];n.content.forEach(y=>{const w=[];y.content&&y.content.forEach(k=>{let E="";k.content&&Array.isArray(k.content)&&k.content.length>1?E=k.content.map(q=>e.renderChildren(q)).join(i):E=k.content?e.renderChildren(k.content):"";const S=HE(E),D=k.type==="tableHeader",R=OE(k.attrs);w.push({text:S,isHeader:D,align:R})}),o.push(w)});const s=o.reduce((y,w)=>Math.max(y,w.length),0);if(s===0)return"";const a=new Array(s).fill(0);o.forEach(y=>{var w;for(let k=0;k<s;k+=1){const S=(((w=y[k])==null?void 0:w.text)||"").length;S>a[k]&&(a[k]=S),a[k]<3&&(a[k]=3)}});const l=(y,w)=>y+" ".repeat(Math.max(0,w-y.length)),c=o[0],u=c.some(y=>y.isHeader),d=new Array(s).fill(null);o.forEach(y=>{var w;for(let k=0;k<s;k+=1)!d[k]&&((w=y[k])!=null&&w.align)&&(d[k]=y[k].align)});let m=`
145
148
  `;const b=new Array(s).fill(0).map((y,w)=>u&&c[w]&&c[w].text||"");return m+=`| ${b.map((y,w)=>l(y,a[w])).join(" | ")} |
146
149
  `,m+=`| ${a.map((y,w)=>{const k=Math.max(3,y),E=d[w];return E==="left"?`:${"-".repeat(k)}`:E==="right"?`${"-".repeat(k)}:`:E==="center"?`:${"-".repeat(k)}:`:"-".repeat(k)}).join(" | ")} |
147
150
  `,(u?o.slice(1):o).forEach(y=>{m+=`| ${new Array(s).fill(0).map((w,k)=>l(y[k]&&y[k].text||"",a[k])).join(" | ")} |
@@ -197,7 +200,7 @@ ${t}</tr>`}},table(n,e){return{prefix:`
197
200
  </table>
198
201
  `}},mentionItem(n,e){return`\`@${n.attrs.value}\``},embedblock(n,e){return`
199
202
  <video src="${n.attrs.src}" width="800px" height="600px" controls="controls"></video>
200
- `},text(n,e){let t=n.text,r=n.marks;Array.isArray(r)||(r=[]);for(let i of r)this[i.type]?t=this[i.type](t,i):console.warn(`Unknown mark type: ${i.type}`);return t},bold(n){return`**${n}**`},italic(n){return`*${n}*`},strike(n){return`~~${n}~~`},subscript(n){return`~${n}~`},superscript(n){return`^${n}^`},link(n,e){return`[${n}](${e.attrs.href})`},highlight(n){return`==${n}==`},code(n){return`\`${n}\``}};class hM{constructor(e={},t={}){this.flags={inline:!1,inlineWrapper:!1,heading:!1,bulletList:!1,orderedList:!1,blockquote:!1,powerTaskItem:!1,powerTaskList:!1,tableHeader:!1,tableCell:!1,tableRow:!1,table:!1},this.flags=Object.assign(this.flags,t),this.DecNodeFuncs=dM;for(let r in e)this.DecNodeFuncs.hasOwnProperty(r)&&console.warn(`Decoder already has a function named ${r}, the function will be overwritten.`),this.DecNodeFuncs[r]=e[r]}decode(e){e=JSON.parse(JSON.stringify(e));let t="";Array.isArray(e.content)||(e.content=[]);for(let r of e.content)t+=this.renderNode(r);return t}renderNode(e){e.parent?e.flags=Object.assign({},e.parent.flags):e.flags=Object.assign({},this.flags);let t=e.type;if(t==="text")return this.DecNodeFuncs.text(e);e.flags.hasOwnProperty(t)&&(e.flags[t]!==!1?e.flags[t]+=1:e.flags[t]=1),t==="paragraph"&&(e.flags.inlineWrapper=!0,e.flags.inline=!0);let r="",i=e.content;Array.isArray(i)||(i=[]);for(let s of i)s.parent=e,s.childIdx=i.indexOf(s),r+=this.renderNode(s);if(!this.DecNodeFuncs.hasOwnProperty(t))return console.warn(`Unknown node type: ${t}`),r;let o=this.DecNodeFuncs[t](e,e.flags);return typeof o=="string"?o+r:o.prefix+r+o.suffix}}let fM={Bold:{en:"Bold",cn:"粗体"},Italic:{en:"Italic",cn:"斜体"},Strikethrough:{en:"Strikethrough",cn:"删除线"},Underline:{en:"Underline",cn:"下划线"},"Block Quote":{en:"Block Quote",cn:"引用"},"Horizontal Rule":{en:"Horizontal Rule",cn:"水平线"},Header:{en:"Header",cn:"标题"},Task:{en:"Task",cn:"任务清单"},ClearFormatting:{en:"Clear Formatting",cn:"清除格式"},BulletedList:{en:"Bulleted List",cn:"项目符号"},NumberedList:{en:"Numbered List",cn:"编号"},DetailsList:{en:"Details List",cn:"详细列表"},AlignLeft:{en:"Align Left",cn:"左对齐"},AlignCenter:{en:"Align Center",cn:"居中"},AlignRight:{en:"Align Right",cn:"右对齐"},AlignJustify:{en:"Align Justify",cn:"两端对齐"},IncreaseIndent:{en:"Increase Indent",cn:"增加缩进"},DecreaseIndent:{en:"Decrease Indent",cn:"减少缩进"},Color:{en:"Color",cn:"颜色"},Draw:{en:"Draw",cn:"绘图"},Emoji:{en:"Emoji",cn:"表情"},Table:{en:"Table",cn:"表格"},Code:{en:"Code",cn:"代码"},"Code Block":{en:"Code Block",cn:"代码块"},Equation:{en:"Equation",cn:"公式"},Image:{en:"Image",cn:"图片"},Link:{en:"Link",cn:"链接"},Embed:{en:"Embed",cn:"嵌入"},Undo:{en:"Undo",cn:"撤销"},Redo:{en:"Redo",cn:"重做"},Save:{en:"Save",cn:"保存"},Cancel:{en:"Cancel",cn:"取消"},TextField:{en:"Text Field",cn:"文本框"},"Write a caption...":{en:"Write a caption...",cn:"输入标题..."},removeColor:{en:"Remove Color",cn:"清除颜色"},removeHighlight:{en:"Remove Highlight",cn:"清除高亮"},Row:{en:"Row",cn:"行"},Column:{en:"Column",cn:"列"},"Delete Column":{en:"Delete Column",cn:"删除列"},"Delete Row":{en:"Delete Row",cn:"删除行"},"Add Row Before":{en:"Add Row Before",cn:"在上方插入行"},"Add Row After":{en:"Add Row After",cn:"在下方插入行"},"Add Column Before":{en:"Add Column Before",cn:"在左侧插入列"},"Add Column After":{en:"Add Column After",cn:"在右侧插入列"},"Merge Cells":{en:"Merge Cells",cn:"合并单元格"},"Split Cell":{en:"Split Cell",cn:"拆分单元格"},Headers:{en:"Headers",cn:"标题"},Heading:{en:"Heading",cn:"标题"},"Text Color":{en:"Text Color",cn:"文本颜色"},Foreground:{en:"Foreground",cn:"前景色"},"Highlight Background":{en:"Highlight Background",cn:"高亮色"},purple:{en:"purple",cn:"紫色"},red:{en:"red",cn:"红色"},orange:{en:"orange",cn:"橙色"},yellow:{en:"yellow",cn:"黄色"},blue:{en:"blue",cn:"蓝色"},teal:{en:"teal",cn:"青色"},green:{en:"green",cn:"绿色"},Random:{en:"Random",cn:"随机"},"People and Fantasy":{en:"People and Fantasy",cn:"人物与范例"},"Animals & Nature":{en:"Animals & Nature",cn:"动物与自然"},"Food & Drink":{en:"Food & Drink",cn:"食物与饮料"},"Activity and Sports":{en:"Activity and Sports",cn:"活动与体育"},"Travel & Places":{en:"Travel & Places",cn:"旅行与地点"},Objects:{en:"Objects",cn:"物件"},Symbols:{en:"Symbols",cn:"符号"},Flags:{en:"Flags",cn:"旗帜"},"Fill the Form":{en:"Fill the Form",cn:"填写表单"},Caption:{en:"Caption",cn:"标题"},"Insert Embed Url...":{en:"Insert Embed Url...",cn:"插入嵌入链接..."},Insert:{en:"Insert",cn:"插入"},"Insert Embed":{en:"Insert Embed",cn:"插入嵌入"},"Insert Image":{en:"Insert Image",cn:"插入图片"},Method:{en:"Method",cn:"方法"},"Choose Local Image as Base64 (multiple).":{en:"Choose Local Image as Base64 (multiple).",cn:"选择本地图片为Base64 (支持多个)"},"Insert Image Url.":{en:"Insert Image Url.",cn:"插入图片链接"},"Insert Link Url...":{en:"Insert Link Url...",cn:"插入链接..."},"Insert Link":{en:"Insert Link",cn:"插入链接"},Newline:{en:"Newline",cn:"换行"},"Format Painter":{en:"Format Painter",cn:"格式刷"},Done:{en:"Done",cn:"完成"},gray:{en:"Gray",cn:"灰色"},pink:{en:"Pink",cn:"粉色"},rose:{en:"Rose",cn:"玫瑰色"},fresh_blue:{en:"Fresh Blue",cn:"鲜艳蓝"},ice_blue:{en:"Ice Blue",cn:"冰蓝色"},dark_blue:{en:"Dark Blue",cn:"深蓝色"},fresh_green:{en:"Fresh Green",cn:"鲜艳绿"},light_green:{en:"Light Green",cn:"浅绿色"},light_yellow:{en:"Light Yellow",cn:"浅黄色"},light_red:{en:"Light Red",cn:"浅红色"},light_purple:{en:"Light Purple",cn:"浅紫色"},light_orange:{en:"Light Orange",cn:"浅橙色"}};const In=(n,e="en")=>{let t=fM[n];return t?t[e]:n},pM={emits:["container-dblclick","container-click","update:width","update:alignCenter","update:caption"],props:{width:{default:100},editor:{default:()=>({})},caption:{default:""},alignCenter:{default:!0},foreground:{default:""},node:{default:()=>({})},getPos:{default:()=>{}},theme:{default:"light"}},data(){return{thisCaption:this.caption?this.caption.toString():"",thisAlignCenter:this.alignCenter,elWidthStart:0,elWidthEnd:0,active:!1,moveable:!1,direction:1,disX:0,currentWidth:this.normalizeWidthValue(this.width),outsideEvent:n=>{let e=n.target,t=!1;for(;e&&e.tagName&&e.tagName.toLowerCase()!="body";){if(e==this.$el){t=!0;break}e=e.parentNode}t||(this.show.captionBox=!1)},show:{captionBox:!1}}},watch:{width(n){this.currentWidth=this.normalizeWidthValue(n)},currentWidth(n){this.$emit("update:width",n)},alignCenter(n){this.thisAlignCenter=n},thisAlignCenter(n){this.$emit("update:alignCenter",n)},caption(n){this.thisCaption=n?n.toString():""},thisCaption(n){this.$emit("update:caption",n)}},mounted(){this.Init(),this.outSideClickInit()},methods:{Init(){let n=e=>(e.clientX-this.disX)*this.direction+this.elWidthStart*1;window.addEventListener("mousemove",e=>{this.moveable&&(this.elWidthEnd=n(e))}),window.addEventListener("touchmove",e=>{e=e.targetTouches[0],this.moveable&&(this.elWidthEnd=n(e))}),window.addEventListener("mouseup",e=>(this.active=!1,this.moveable&&this.stop(),e)),window.addEventListener("touchup",e=>(this.active=!1,this.moveable&&this.stop(),e))},forward(n,e=1){this.active=!0,this.moveable=!0,this.disX=n.clientX,this.direction=e,this.elWidthStart=this.$el.clientWidth,this.elWidthEnd=this.elWidthStart},stop(){this.active=!1,this.moveable=!1,this.elWidthEnd<50&&(this.elWidthEnd=50),this.currentWidth=`${this.elWidthEnd}px`},outSideClickInit(){window.addEventListener("click",this.outsideEvent)},normalizeWidthValue(n){const e=n==null?void 0:n.toString().trim();return e?e.includes("%")||e.includes("px")||e.includes("vw")||e.includes("vh")||e.includes("rem")||e.includes("em")||e.includes("auto")||e.includes("calc(")?e:`${e}%`:"100%"},getTitle(n){return In(n,this.editor.storage.defaultStorage.language)},showCaptionBox(){this.editor.isEditable&&(this.show.captionBox=!0,this.$nextTick(()=>{this.$refs.caption.focus()}))},newline(){this.editor.isEditable&&(this.editor.commands.focus(),this.editor.commands.insertContentAt(this.getPos()+this.node.nodeSize-1,"<br>"))}},beforeUnmount(){window.removeEventListener("click",this.outsideEvent)}},mM={class:"power-editor-media-control-btn-block"},gM={class:"power-editor-media-control-btn-block bottom"},bM={class:"power-editor-media-mask-block"};function _M(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("fv-text-box");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["power-editor-media-container",[{dark:t.theme==="dark"},{"active-effects":i.active}]]),style:v.normalizeStyle({width:i.moveable?`${i.elWidthEnd}px`:o.normalizeWidthValue(i.currentWidth)})},[v.withDirectives(v.createElementVNode("div",{class:"power-editor-media-control-resize-block",onMousedown:e[0]||(e[0]=l=>o.forward(l,-1)),onMouseup:e[1]||(e[1]=(...l)=>o.stop&&o.stop(...l)),onTouchstart:e[2]||(e[2]=l=>o.forward(l.targetTouches[0],-1)),onTouchend:e[3]||(e[3]=(...l)=>o.stop&&o.stop(...l))},e[19]||(e[19]=[v.createElementVNode("i",null,null,-1)]),544),[[v.vShow,t.alignCenter&&(t.editor.isEditable||t.editor.storage.defaultStorage.showControlOnReadonly)]]),v.createElementVNode("div",{class:"power-editor-media-slot-container",onDblclick:e[4]||(e[4]=l=>n.$emit("container-dblclick",l)),onClick:e[5]||(e[5]=l=>n.$emit("container-click",l))},[v.renderSlot(n.$slots,"default",{},()=>[e[20]||(e[20]=v.createTextVNode(" Media Container "))])],32),v.withDirectives(v.createElementVNode("div",{class:"power-editor-media-control-resize-block sec",onMousedown:e[6]||(e[6]=(...l)=>o.forward&&o.forward(...l)),onMouseup:e[7]||(e[7]=(...l)=>o.stop&&o.stop(...l)),onTouchstart:e[8]||(e[8]=l=>o.forward(l.targetTouches[0])),onTouchend:e[9]||(e[9]=(...l)=>o.stop&&o.stop(...l))},e[21]||(e[21]=[v.createElementVNode("i",null,null,-1)]),544),[[v.vShow,t.editor.isEditable||t.editor.storage.defaultStorage.showControlOnReadonly]]),v.withDirectives(v.createElementVNode("div",{draggable:"true","data-drag-handle":"",class:"power-editor-media-drag-btn",onMousedown:e[10]||(e[10]=l=>i.active=!0),onMouseup:e[11]||(e[11]=l=>i.active=!1),onTouchstart:e[12]||(e[12]=l=>i.active=!0),onTouchend:e[13]||(e[13]=l=>i.active=!1)},e[22]||(e[22]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--GripperDotsVertical"},null,-1)]),544),[[v.vShow,t.editor.isEditable]]),v.withDirectives(v.createElementVNode("div",mM,[v.withDirectives(v.createVNode(s,{class:"power-editor-media-cmd-btn",background:t.theme==="dark"?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.0)","border-radius":6,theme:t.theme,fontSize:"10",title:o.getTitle("Caption"),onClick:o.showCaptionBox},{default:v.withCtx(()=>e[23]||(e[23]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--TextField"},null,-1)])),_:1,__:[23]},8,["background","theme","title","onClick"]),[[v.vShow,t.editor.isEditable]]),v.createVNode(s,{class:"power-editor-media-cmd-btn",background:t.theme==="dark"?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.0)","border-radius":6,theme:t.theme,fontSize:"10",title:o.getTitle("AlignLeft"),onClick:e[14]||(e[14]=l=>i.thisAlignCenter=!1)},{default:v.withCtx(()=>e[24]||(e[24]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--AlignLeft"},null,-1)])),_:1,__:[24]},8,["background","theme","title"]),v.createVNode(s,{class:"power-editor-media-cmd-btn",background:t.theme==="dark"?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.0)","border-radius":6,theme:t.theme,fontSize:"10",title:o.getTitle("AlignCenter"),onClick:e[15]||(e[15]=l=>i.thisAlignCenter=!0)},{default:v.withCtx(()=>e[25]||(e[25]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--AlignCenter"},null,-1)])),_:1,__:[25]},8,["background","theme","title"])],512),[[v.vShow,t.editor.isEditable||t.editor.storage.defaultStorage.showControlOnReadonly]]),v.withDirectives(v.createElementVNode("div",gM,[v.createVNode(s,{class:"power-editor-media-cmd-btn",background:t.theme==="dark"?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.0)","border-radius":6,theme:t.theme,icon:"ReturnKeySm",fontSize:"10",title:o.getTitle("TextField"),style:{width:"60px"},onClick:o.newline},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(o.getTitle("Newline")),1)]),_:1},8,["background","theme","title","onClick"])],512),[[v.vShow,t.editor.isEditable]]),v.withDirectives(v.createElementVNode("div",bM,null,512),[[v.vShow,i.active]]),v.withDirectives(v.createElementVNode("p",{class:"power-editor-media-container-caption",onClick:e[16]||(e[16]=(...l)=>o.showCaptionBox&&o.showCaptionBox(...l))},v.toDisplayString(i.thisCaption),513),[[v.vShow,i.thisCaption!==""&&!i.show.captionBox]]),v.withDirectives(v.createVNode(a,{modelValue:i.thisCaption,"onUpdate:modelValue":e[17]||(e[17]=l=>i.thisCaption=l),theme:t.theme,class:"power-editor-media-caption-block",placeholder:o.getTitle("Write a caption..."),ref:"caption",background:"transparent",underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)","focus-border-color":t.foreground,onKeyup:e[18]||(e[18]=v.withKeys(()=>{i.show.captionBox=!1,o.newline()},["enter"]))},null,8,["modelValue","theme","placeholder","focus-border-color"]),[[v.vShow,i.show.captionBox]])],6)}const Bh=Gt(pM,[["render",_M]]),yM={components:{NodeViewWrapper:Mi,mediaContainer:Bh},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{statusInfo:{show:!1,progress:0,loading:!1,info:"",tmpSrc:"",tmpHeight:0,lock:!0},previewImg:{scalePercent:"100",show:!1},thisTheme:this.editor.storage.defaultStorage.theme,thisLazyLoad:this.editor.storage.defaultStorage.imgLazyLoad,thisForeground:this.editor.storage.defaultStorage.foreground,thisImgPreview:this.editor.storage.defaultStorage.imgPreview,imgInterceptor:this.editor.storage.defaultStorage.imgInterceptor}},watch:{"node.attrs.src"(){this.imgInterceptorFunc()},"editor.storage.defaultStorage.theme"(n){this.thisTheme=n},"editor.storage.defaultStorage.imgLazyLoad"(n){this.thisLazyLoad=n},"editor.storage.defaultStorage.imgPreview"(n){this.thisImgPreview=n},"editor.storage.defaultStorage.foreground"(n){this.thisForeground=n},"editor.storage.defaultStorage.imgInterceptor"(n){this.imgInterceptor=n,this.imgInterceptorFunc()}},mounted(){this.imgInterceptorFunc()},methods:{showStatus(n){this.statusInfo.show=n},updateStatus(n,e,t=""){this.statusInfo.loading=n,this.statusInfo.progress=e,this.statusInfo.info=t},getImage(){return this.node.attrs.src},interceptImage(n=""){return this.statusInfo.tmpSrc=this.node.attrs.src,this.statusInfo.tmpHeight=this.$refs.image.$el.clientHeight,this.updateAttributes({src:n}),this.statusInfo.tmpSrc},updateImage(n){this.updateAttributes({src:n})},updateLock(n){this.statusInfo.lock=n},imgInterceptorFunc(){let n={node:this.node,extension:this.extension,getPos:this.getPos,updateAttributes:this.updateAttributes,deleteNode:this.deleteNode,showStatus:this.showStatus,updateStatus:this.updateStatus,getImage:this.getImage,interceptImage:this.interceptImage,updateImage:this.updateImage,updateLock:this.updateLock};this.imgInterceptor&&this.imgInterceptor(n)},preview(n="readonly"){this.editor.isEditable&&n!=="editable"||!this.editor.isEditable&&n!=="readonly"||this.node.attrs.src&&this.thisImgPreview&&(this.previewImg.show=!0)},scale(n,e){n.stopPropagation&&n.stopPropagation();let t=parseInt(this.previewImg.scalePercent);t+=e,t<50?t=50:t>200&&(t=200),this.previewImg.scalePercent=t.toString()},setScale(n,e){n.stopPropagation&&n.stopPropagation(),e<50?e=50:e>200&&(e=200),this.previewImg.scalePercent=e.toString()}}},vM={class:"power-editor-image-status-container"},wM={class:"power-editor-preview-img-container"};function xM(n,e,t,r,i,o){const s=v.resolveComponent("fv-image"),a=v.resolveComponent("fv-progress-ring"),l=v.resolveComponent("media-container"),c=v.resolveComponent("fv-img"),u=v.resolveComponent("fv-button"),d=v.resolveComponent("fv-text-box"),m=v.resolveComponent("node-view-wrapper");return t.node?(v.openBlock(),v.createBlock(m,{key:0,class:v.normalizeClass(["power-editor-image-container",[{dark:i.thisTheme==="dark"}]]),style:v.normalizeStyle({"justify-content":t.node.attrs.alignCenter?"center":"flex-start"})},{default:v.withCtx(()=>[v.createVNode(l,{width:t.node.attrs.width,"onUpdate:width":e[1]||(e[1]=b=>t.node.attrs.width=b),caption:t.node.attrs.caption,alignCenter:t.node.attrs.alignCenter,"onUpdate:alignCenter":e[2]||(e[2]=b=>t.node.attrs.alignCenter=b),editor:t.editor,theme:i.thisTheme,foreground:i.thisForeground,node:t.node,getPos:t.getPos,"onUpdate:caption":e[3]||(e[3]=b=>t.updateAttributes({caption:b})),onContainerDblclick:e[4]||(e[4]=b=>o.preview("editable")),onContainerClick:e[5]||(e[5]=b=>o.preview("readonly"))},{default:v.withCtx(()=>[v.createVNode(s,{src:t.node.attrs.src?t.node.attrs.src:i.statusInfo.tmpSrc?i.statusInfo.tmpSrc:"",ref:"image",onlazy:i.thisLazyLoad,style:v.normalizeStyle([{width:"100%",height:"auto"},{height:!t.node.attrs.src&&i.statusInfo.show?i.statusInfo.tmpHeight+"px":""}])},null,8,["src","onlazy","style"]),v.withDirectives(v.createElementVNode("div",vM,[v.createVNode(a,{modelValue:i.statusInfo.progress,"onUpdate:modelValue":e[0]||(e[0]=b=>i.statusInfo.progress=b),loading:i.statusInfo.loading,r:"20",borderWidth:"3",color:i.thisTheme==="dark"?"white":"black",background:i.thisTheme==="dark"?"rgba(0, 0, 0, 0.3)":"rgba(255, 255, 255, 0.3)"},null,8,["modelValue","loading","color","background"]),v.withDirectives(v.createElementVNode("p",{class:"power-editor-image-status-title"},v.toDisplayString(i.statusInfo.info),513),[[v.vShow,i.statusInfo.info]])],512),[[v.vShow,i.statusInfo.show]]),v.createElementVNode("div",{class:v.normalizeClass(["power-editor-image-selection-mask",[{selected:t.selected}]]),style:v.normalizeStyle({"--selected-bg":i.thisForeground})},null,6)]),_:1},8,["width","caption","alignCenter","editor","theme","foreground","node","getPos"]),v.createVNode(v.Transition,{name:"show-preview"},{default:v.withCtx(()=>[v.withDirectives(v.createElementVNode("div",{class:"power-editor-image-preview-block",onClick:e[12]||(e[12]=b=>i.previewImg.show=!1)},[v.createElementVNode("div",wM,[v.createVNode(c,{src:t.node.attrs.src,class:"power-editor-preview-img",style:v.normalizeStyle({scale:i.previewImg.scalePercent+"%",cursor:i.previewImg.scalePercent<150?"zoom-in":"zoom-out"}),onClickCapture:e[6]||(e[6]=b=>i.previewImg.scalePercent<100?o.setScale(b,100):i.previewImg.scalePercent<150?o.setScale(b,150):o.setScale(b,100))},null,8,["src","style"])]),v.createElementVNode("div",{class:"power-editor-preview-tool-bar",onClick:e[11]||(e[11]=b=>b.stopPropagation())},[v.createVNode(u,{class:"power-editor-preview-img-btn",theme:"dark",disabled:i.previewImg.scalePercent<=50,background:"rgba(36, 36, 36, 0.3)",onClick:e[7]||(e[7]=b=>o.scale(b,-50))},{default:v.withCtx(()=>e[13]||(e[13]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--CalculatorSubtract"},null,-1)])),_:1,__:[13]},8,["disabled"]),v.createVNode(d,{modelValue:i.previewImg.scalePercent,theme:"dark",underline:"","border-color":"rgba(120, 120, 120, 0.1)","focus-border-color":i.thisForeground,"border-width":2,"is-box-shadow":!0,suffix:"%",style:{width:"80px",height:"35px"},onDebounceInput:e[8]||(e[8]=b=>o.setScale(b,b))},null,8,["modelValue","focus-border-color"]),v.createVNode(u,{class:"power-editor-preview-img-btn",theme:"dark",disabled:i.previewImg.scalePercent>=200,background:"rgba(36, 36, 36, 0.3)","border-color":"transparent",onClick:e[9]||(e[9]=b=>o.scale(b,50))},{default:v.withCtx(()=>e[14]||(e[14]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--CalculatorAddition"},null,-1)])),_:1,__:[14]},8,["disabled"]),v.createVNode(u,{class:"power-editor-preview-img-btn",theme:"dark",background:"rgba(36, 36, 36, 0.3)",onClick:e[10]||(e[10]=b=>i.previewImg.show=!1)},{default:v.withCtx(()=>e[15]||(e[15]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--BackToWindow"},null,-1)])),_:1,__:[15]})])],512),[[v.vShow,i.previewImg.show]])]),_:1})]),_:1},8,["class","style"])):v.createCommentVNode("",!0)}const kM=Gt(yM,[["render",xM]]),SM=xt.create({name:"imageblock",group:"block",draggable:!0,atom:!0,addAttributes(){return{src:{default:""},width:{default:"100%"},caption:{default:""},alignCenter:{default:!0}}},parseHTML(){return[{tag:"img[src]"}]},renderHTML({HTMLAttributes:n}){return["img",$e(this.options.HTMLAttributes,n)]},addNodeView(){return ti(kM)}}),CM={components:{NodeViewWrapper:Mi,mediaContainer:Bh},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{width:0,thisTheme:this.editor.storage.defaultStorage.theme,thisForeground:this.editor.storage.defaultStorage.foreground,timer:{}}},watch:{"editor.storage.defaultStorage.theme"(n){this.thisTheme=n},"editor.storage.defaultStorage.foreground"(n){this.thisForeground=n}},mounted(){this.timerInit()},methods:{timerInit(){this.timer=setInterval(()=>{this.width=this.$refs.media.$el.clientWidth},300)}},beforeUnmount(){clearInterval(this.timer)}},EM=["src"];function TM(n,e,t,r,i,o){const s=v.resolveComponent("media-container"),a=v.resolveComponent("node-view-wrapper");return t.node?(v.openBlock(),v.createBlock(a,{key:0,class:"power-editor-embed-container",style:v.normalizeStyle({"justify-content":t.node.attrs.alignCenter?"center":"flex-start"})},{default:v.withCtx(()=>[v.createVNode(s,{width:t.node.attrs.width,"onUpdate:width":e[0]||(e[0]=l=>t.node.attrs.width=l),caption:t.node.attrs.caption,alignCenter:t.node.attrs.alignCenter,"onUpdate:alignCenter":e[1]||(e[1]=l=>t.node.attrs.alignCenter=l),editor:t.editor,theme:i.thisTheme,foreground:i.thisForeground,node:t.node,getPos:t.getPos,ref:"media","onUpdate:caption":e[2]||(e[2]=l=>t.updateAttributes({caption:l}))},{default:v.withCtx(()=>[v.createElementVNode("iframe",{src:t.node.attrs.src,frameborder:"0",allowfullscreen:"",style:v.normalizeStyle([{width:"100%",height:"auto"},{height:`${i.width/1.778}px`}])},null,12,EM)]),_:1},8,["width","caption","alignCenter","editor","theme","foreground","node","getPos"])]),_:1},8,["style"])):v.createCommentVNode("",!0)}const AM=Gt(CM,[["render",TM]]),MM=xt.create({name:"embedblock",group:"block",draggable:!0,atom:!0,addAttributes(){return{src:{default:""},width:{default:"100%"},caption:{default:""},alignCenter:{default:!0}}},parseHTML(){return[{tag:"embed-block"}]},renderHTML({HTMLAttributes:n}){return["embed-block",$e(n)]},addNodeView(){return ti(AM)}});function Jl({find:n,type:e,getAttributes:t}){return new v1({find:n,handler({match:r,chain:i,range:o}){const s=Xe(t,void 0,r);if(s===!1||s===null)return null;if(r.input){const{from:a,to:l}=o;s.powerContent?i().deleteRange(o).insertContentAt(a,[{type:e.name,attrs:s,content:s.powerContent}]):i().deleteRange(o).insertContentAt(a,[{type:e.name,attrs:s}])}}})}const NM=/^-(\[([ |x])\])\s$/,DM=/^-(\s*)(\[([ |x])\])\s+(.*)/g,RM=xt.create({name:"powerTaskList",group:"block list",content:"powerTaskItem+",parseHTML(){return[{tag:'ul[data-type="powerTaskList"]',priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",$e(n,{"data-type":this.name}),0]},addCommands(){return{togglePowerTaskList:()=>({commands:n})=>n.toggleList("powerTaskList","powerTaskItem"),setPowerTaskList:()=>({editor:n,commands:e})=>{if(!n.isActive("powerTaskList"))return e.toggleList("powerTaskList","powerTaskItem")}}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.togglePowerTaskList()}},addInputRules(){return[Jr({find:NM,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x",theme:this.editor.storage.defaultStorage.theme})})]},addPasteRules(){return[Jl({find:DM,type:this.type,getAttributes:n=>({powerContent:[{type:"powerTaskItem",content:[{type:"paragraph",content:[{type:"text",text:n[4]}]}],attrs:{checked:n[3]==="x",theme:this.editor.storage.defaultStorage.theme}}]})})]}}),IM={components:{NodeViewWrapper:Mi,NodeViewContent:O1},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{thisTheme:this.editor.storage.defaultStorage.theme,thisForeground:this.editor.storage.defaultStorage.foreground,timer:{}}},watch:{"editor.storage.defaultStorage.theme"(n){this.thisTheme=n},"editor.storage.defaultStorage.foreground"(n){this.thisForeground=n}},mounted(){},methods:{preventEnter(n){console.log(n)},updateValue(n){this.updateAttributes({checked:n})}},beforeUnmount(){clearInterval(this.timer)}};function OM(n,e,t,r,i,o){const s=v.resolveComponent("fv-check-box"),a=v.resolveComponent("node-view-content"),l=v.resolveComponent("node-view-wrapper");return t.node?(v.openBlock(),v.createBlock(l,{key:0,as:"li",class:"power-editor-task-item-container"},{default:v.withCtx(()=>[v.createVNode(s,{modelValue:t.node.attrs.checked,"onUpdate:modelValue":e[0]||(e[0]=c=>t.node.attrs.checked=c),theme:i.thisTheme,disabled:!t.editor.isEditable,background:i.thisForeground,contenteditable:"false",onClick:o.updateValue},null,8,["modelValue","theme","disabled","background","onClick"]),v.createVNode(a,{ref:"n",class:"power-editor-task-item-content"},null,512)]),_:1})):v.createCommentVNode("",!0)}const LM=Gt(IM,[["render",OM]]),PM=/^\s*(\[([ |x])\])\s$/,BM=/^(\s*)(\[([ |x])\])\s+(.*)/g,FM=xt.create({name:"powerTaskItem",group:"block",content:"paragraph block*",draggable:!0,addAttributes(){return{value:{default:""},checked:{default:!1},placeholder:{default:"To-Do"}}},parseHTML(){return[{tag:'li[data-type="powerTaskItem"]',priority:51}]},renderHTML({HTMLAttributes:n}){return["li",$e(this.options.HTMLAttributes,n,{"data-type":"powerTaskItem"}),0]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem("powerTaskItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("powerTaskItem")};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem("powerTaskItem")}:n},addNodeView(){return ti(LM)},addInputRules(){return[Jr({find:PM,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x",theme:this.editor.storage.defaultStorage.theme})})]},addPasteRules(){return[Jl({find:BM,type:this.type,getAttributes:n=>({powerContent:[{type:"paragraph",content:[{type:"text",text:n[4]}]}],checked:n[3]==="x",theme:this.editor.storage.defaultStorage.theme})})]}});var Fh,pv;function zM(){if(pv)return Fh;pv=1;var n=[],e=function(a){return typeof a>"u"},t=/\s*(\.\d+|\d+(?:\.\d+)?)(%|deg)?\s*/,r=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,i=new RegExp("^(rgb|hsl|hsv)a?\\("+t.source+"[, ]"+t.source+"[, ]"+t.source+"(?:[,/]"+t.source+")?\\)$","i");function o(a,l,c){if(a==="%")return 100;if(a==="deg"||c&&l===0)return 360;if(!a)return 255}function s(a){if(Array.isArray(a)){if(typeof a[0]=="string"&&typeof s[a[0]]=="function")return new s[a[0]](a.slice(1,a.length));if(a.length===4)return new s.RGB(a[0]/255,a[1]/255,a[2]/255,a[3]/255)}else if(typeof a=="string"){var l=a.toLowerCase();s.namedColors[l]&&(a="#"+s.namedColors[l]),l==="transparent"&&(a="rgba(0,0,0,0)");var c=a.match(i);if(c){var u=c[1].toUpperCase(),d=u[0]==="H";if(e(s[u]))throw new Error("color."+u+" is not installed.");let f=e(c[8])?1:void 0;return f===void 0&&(c[9]==="%"?f=parseFloat(c[8])/100:f=parseFloat(c[8])),new s[u](parseFloat(c[2])/o(c[3],0,d),parseFloat(c[4])/o(c[5],1,d),parseFloat(c[6])/o(c[7],2,d),f)}a.length<6&&(a=a.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,"$1$1$2$2$3$3$4$4"));var m=a.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])?$/i);if(m)return new s.RGB(parseInt(m[1],16)/255,parseInt(m[2],16)/255,parseInt(m[3],16)/255,m[4]?parseInt(m[4],16)/255:1);if(s.CMYK){var b=a.match(new RegExp("^cmyk\\("+r.source+","+r.source+","+r.source+","+r.source+"\\)$","i"));if(b)return new s.CMYK(parseFloat(b[1])/100,parseFloat(b[2])/100,parseFloat(b[3])/100,parseFloat(b[4])/100)}}else if(typeof a=="object"&&a.isColor)return a;return!1}return s.namedColors={},s.installColorSpace=function(a,l,c){s[a]=function(f){var y=Array.isArray(f)?f:arguments;l.forEach(function(w,k){var E=y[k];if(w==="alpha")this._alpha=isNaN(E)||E>1?1:E<0?0:E;else{if(isNaN(E))throw new Error("["+a+"]: Invalid color: ("+l.join(",")+")");w==="hue"?this._hue=E<0?E-Math.floor(E):E%1:this["_"+w]=E<0?0:E>1?1:E}},this)},s[a].propertyNames=l;var u=s[a].prototype;["valueOf","hex","hexa","css","cssa"].forEach(function(f){u[f]=u[f]||(a==="RGB"?u.hex:function(){return this.rgb()[f]()})}),u.isColor=!0,u.equals=function(f,y){e(y)&&(y=1e-10),f=f[a.toLowerCase()]();for(var w=0;w<l.length;w=w+1)if(Math.abs(this["_"+l[w]]-f["_"+l[w]])>y)return!1;return!0},u.toJSON=function(){return[a].concat(l.map(function(f){return this["_"+f]},this))};for(var d in c)if(Object.prototype.hasOwnProperty.call(c,d)){var m=d.match(/^from(.*)$/);m?s[m[1].toUpperCase()].prototype[a.toLowerCase()]=c[d]:u[d]=c[d]}u[a.toLowerCase()]=function(){return this},u.toString=function(){return"["+a+" "+l.map(function(f){return this["_"+f]},this).join(", ")+"]"},l.forEach(function(f){var y=f==="black"?"k":f.charAt(0);u[f]=u[y]=function(w,k){return typeof w>"u"?this["_"+f]:k?new this.constructor(l.map(function(E){return this["_"+E]+(f===E?w:0)},this)):new this.constructor(l.map(function(E){return f===E?w:this["_"+E]},this))}});function b(f,y){var w={};w[y.toLowerCase()]=function(){return this.rgb()[y.toLowerCase()]()},s[y].propertyNames.forEach(function(E){var S=E==="black"?"k":E.charAt(0);w[E]=w[S]=function(D,R){return this[y.toLowerCase()]()[E](D,R)}});for(var k in w)Object.prototype.hasOwnProperty.call(w,k)&&s[f].prototype[k]===void 0&&(s[f].prototype[k]=w[k])}return n.forEach(function(f){b(a,f),b(f,a)}),n.push(a),s},s.pluginList=[],s.use=function(a){return s.pluginList.indexOf(a)===-1&&(this.pluginList.push(a),a(s)),s},s.installMethod=function(a,l){return n.forEach(function(c){s[c].prototype[a]=l}),this},s.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var a=(Math.round(255*this._red)*65536+Math.round(255*this._green)*256+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-a.length)+a},hexa:function(){var a=Math.round(this._alpha*255).toString(16);return this.hex()+"00".substr(0,2-a.length)+a},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}}),Fh=s,Fh}var zh,mv;function gv(){return mv||(mv=1,zh=function(e){e.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var t=function(s){return s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92},r=t(this._red),i=t(this._green),o=t(this._blue);return new e.XYZ(r*.4124564+i*.3575761+o*.1804375,r*.2126729+i*.7151522+o*.072175,r*.0193339+i*.119192+o*.9503041,this._alpha)},rgb:function(){var t=this._x,r=this._y,i=this._z,o=function(s){return s>.0031308?1.055*Math.pow(s,1/2.4)-.055:12.92*s};return new e.RGB(o(t*3.2404542+r*-1.5371385+i*-.4985314),o(t*-.969266+r*1.8760108+i*.041556),o(t*.0556434+r*-.2040259+i*1.0572252),this._alpha)},lab:function(){var t=function(s){return s>.008856?Math.pow(s,.3333333333333333):7.787037*s+.13793103448275862},r=t(this._x/95.047),i=t(this._y/100),o=t(this._z/108.883);return new e.LAB(116*i-16,500*(r-i),200*(i-o),this._alpha)}})}),zh}var qh,bv;function qM(){return bv||(bv=1,qh=function(e){e.use(gv()),e.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var t=function(s){var a=Math.pow(s,3);return a>.008856?a:(s-.13793103448275862)/7.87},r=(this._l+16)/116,i=this._a/500+r,o=r-this._b/200;return new e.XYZ(t(i)*95.047,t(r)*100,t(o)*108.883,this._alpha)}})}),qh}var Hh,_v;function yv(){return _v||(_v=1,Hh=function(e){e.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var t=this._hue,r=this._saturation,i=this._value,o=Math.min(5,Math.floor(t*6)),s=t*6-o,a=i*(1-r),l=i*(1-s*r),c=i*(1-(1-s)*r),u,d,m;switch(o){case 0:u=i,d=c,m=a;break;case 1:u=l,d=i,m=a;break;case 2:u=a,d=i,m=c;break;case 3:u=a,d=l,m=i;break;case 4:u=c,d=a,m=i;break;case 5:u=i,d=a,m=l;break}return new e.RGB(u,d,m,this._alpha)},hsl:function(){var t=(2-this._saturation)*this._value,r=this._saturation*this._value,i=t<=1?t:2-t,o;return i<1e-9?o=0:o=r/i,new e.HSL(this._hue,o,t/2,this._alpha)},fromRgb:function(){var t=this._red,r=this._green,i=this._blue,o=Math.max(t,r,i),s=Math.min(t,r,i),a=o-s,l,c=o===0?0:a/o,u=o;if(a===0)l=0;else switch(o){case t:l=(r-i)/a/6+(r<i?1:0);break;case r:l=(i-t)/a/6+1/3;break;case i:l=(t-r)/a/6+2/3;break}return new e.HSV(l,c,u,this._alpha)}})}),Hh}var Vh,vv;function wo(){return vv||(vv=1,Vh=function(e){e.use(yv()),e.installColorSpace("HSL",["hue","saturation","lightness","alpha"],{hsv:function(){var t=this._lightness*2,r=this._saturation*(t<=1?t:2-t),i;return t+r<1e-9?i=0:i=2*r/(t+r),new e.HSV(this._hue,i,(t+r)/2,this._alpha)},rgb:function(){return this.hsv().rgb()},fromRgb:function(){return this.hsv().hsl()}})}),Vh}var Uh,wv;function HM(){return wv||(wv=1,Uh=function(e){e.installColorSpace("CMYK",["cyan","magenta","yellow","black","alpha"],{rgb:function(){return new e.RGB(1-this._cyan*(1-this._black)-this._black,1-this._magenta*(1-this._black)-this._black,1-this._yellow*(1-this._black)-this._black,this._alpha)},fromRgb:function(){var t=this._red,r=this._green,i=this._blue,o=1-t,s=1-r,a=1-i,l=1;return t||r||i?(l=Math.min(o,Math.min(s,a)),o=(o-l)/(1-l),s=(s-l)/(1-l),a=(a-l)/(1-l)):l=1,new e.CMYK(o,s,a,l,this._alpha)}})}),Uh}var Gh,xv;function VM(){return xv||(xv=1,Gh=function(e){e.namedColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}}),Gh}var $h,kv;function UM(){return kv||(kv=1,$h=function(e){e.installMethod("clearer",function(t){return this.alpha(isNaN(t)?-.1:-t,!0)})}),$h}var Wh,Sv;function Cv(){return Sv||(Sv=1,Wh=function(e){function t(r){return r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}e.installMethod("luminance",function(){var r=this.rgb();return .2126*t(r._red)+.7152*t(r._green)+.0722*t(r._blue)})}),Wh}var Kh,Ev;function GM(){return Ev||(Ev=1,Kh=function(e){e.use(Cv()),e.installMethod("contrast",function(t){var r=this.luminance(),i=t.luminance();return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)})}),Kh}var jh,Tv;function $M(){return Tv||(Tv=1,jh=function(e){e.use(wo()),e.installMethod("darken",function(t){return this.lightness(isNaN(t)?-.1:-t,!0)})}),jh}var Qh,Av;function WM(){return Av||(Av=1,Qh=function(e){e.use(wo()),e.installMethod("desaturate",function(t){return this.saturation(isNaN(t)?-.1:-t,!0)})}),Qh}var Yh,Mv;function KM(){return Mv||(Mv=1,Yh=function(e){function t(){var r=this.rgb(),i=r._red*.3+r._green*.59+r._blue*.11;return new e.RGB(i,i,i,r._alpha)}e.installMethod("greyscale",t).installMethod("grayscale",t)}),Yh}var Zh,Nv;function Dv(){return Nv||(Nv=1,Zh=function(e){e.installMethod("isDark",function(){var t=this.rgb(),r=(t._red*255*299+t._green*255*587+t._blue*255*114)/1e3;return r<128})}),Zh}var Xh,Rv;function jM(){return Rv||(Rv=1,Xh=function(e){e.use(Dv()),e.installMethod("isLight",function(){return!this.isDark()})}),Xh}var Jh,Iv;function QM(){return Iv||(Iv=1,Jh=function(e){e.use(wo()),e.installMethod("lighten",function(t){return this.lightness(isNaN(t)?.1:t,!0)})}),Jh}var ef,Ov;function YM(){return Ov||(Ov=1,ef=function(e){e.installMethod("mix",function(t,r){t=e(t).rgb(),r=1-(isNaN(r)?.5:r);var i=r*2-1,o=this._alpha-t._alpha,s=((i*o===-1?i:(i+o)/(1+i*o))+1)/2,a=1-s,l=this.rgb();return new e.RGB(l._red*s+t._red*a,l._green*s+t._green*a,l._blue*s+t._blue*a,l._alpha*r+t._alpha*(1-r))})}),ef}var tf,Lv;function ZM(){return Lv||(Lv=1,tf=function(e){e.installMethod("negate",function(){var t=this.rgb();return new e.RGB(1-t._red,1-t._green,1-t._blue,this._alpha)})}),tf}var nf,Pv;function XM(){return Pv||(Pv=1,nf=function(e){e.installMethod("opaquer",function(t){return this.alpha(isNaN(t)?.1:t,!0)})}),nf}var rf,Bv;function JM(){return Bv||(Bv=1,rf=function(e){e.use(wo()),e.installMethod("rotate",function(t){return this.hue((t||0)/360,!0)})}),rf}var of,Fv;function eN(){return Fv||(Fv=1,of=function(e){e.use(wo()),e.installMethod("saturate",function(t){return this.saturation(isNaN(t)?.1:t,!0)})}),of}var sf,zv;function tN(){return zv||(zv=1,sf=function(e){e.installMethod("toAlpha",function(t){var r=this.rgb(),i=t(t).rgb(),o=1e-10,s=new t.RGB(0,0,0,r._alpha),a=["_red","_green","_blue"];return a.forEach(function(l){r[l]<o?s[l]=r[l]:r[l]>i[l]?s[l]=(r[l]-i[l])/(1-i[l]):r[l]>i[l]?s[l]=(i[l]-r[l])/i[l]:s[l]=0}),s._red>s._green?s._red>s._blue?r._alpha=s._red:r._alpha=s._blue:s._green>s._blue?r._alpha=s._green:r._alpha=s._blue,r._alpha<o||(a.forEach(function(l){r[l]=(r[l]-i[l])/r._alpha+i[l]}),r._alpha*=s._alpha),r})}),sf}var af,qv;function nN(){return qv||(qv=1,af=zM().use(gv()).use(qM()).use(yv()).use(wo()).use(HM()).use(VM()).use(UM()).use(GM()).use($M()).use(WM()).use(KM()).use(Dv()).use(jM()).use(QM()).use(Cv()).use(YM()).use(ZM()).use(XM()).use(JM()).use(eN()).use(tN())),af}var rN=nN();const ec=or(rN);var tc={exports:{}},iN=tc.exports,Hv;function oN(){return Hv||(Hv=1,function(n,e){(function(r,i){n.exports=i()})(typeof self<"u"?self:iN,function(){return function(){var t={};(function(){t.d=function(A,h){for(var p in h)t.o(h,p)&&!t.o(A,p)&&Object.defineProperty(A,p,{enumerable:!0,get:h[p]})}})(),function(){t.o=function(A,h){return Object.prototype.hasOwnProperty.call(A,h)}}();var r={};t.d(r,{default:function(){return CP}});var i=function A(h,p){this.position=void 0;var g="KaTeX parse error: "+h,_,x=p&&p.loc;if(x&&x.start<=x.end){var T=x.lexer.input;_=x.start;var I=x.end;_===T.length?g+=" at end of input: ":g+=" at position "+(_+1)+": ";var P=T.slice(_,I).replace(/[^]/g,"$&̲"),z;_>15?z="…"+T.slice(_-15,_):z=T.slice(0,_);var G;I+15<T.length?G=T.slice(I,I+15)+"…":G=T.slice(I),g+=z+P+G}var Z=new Error(g);return Z.name="ParseError",Z.__proto__=A.prototype,Z.position=_,Z};i.prototype.__proto__=Error.prototype;var o=i,s=function(h,p){return h.indexOf(p)!==-1},a=function(h,p){return h===void 0?p:h},l=/([A-Z])/g,c=function(h){return h.replace(l,"-$1").toLowerCase()},u={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},d=/[&><"']/g;function m(A){return String(A).replace(d,function(h){return u[h]})}var b=function A(h){return h.type==="ordgroup"||h.type==="color"?h.body.length===1?A(h.body[0]):h:h.type==="font"?A(h.body):h},f=function(h){var p=b(h);return p.type==="mathord"||p.type==="textord"||p.type==="atom"},y=function(h){if(!h)throw new Error("Expected non-null, but got "+String(h));return h},w=function(h){var p=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(h);return p!=null?p[1]:"_relative"},k={contains:s,deflt:a,escape:m,hyphenate:c,getBaseElem:b,isCharacterBox:f,protocolFromUrl:w},E=function(){function A(p){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,p=p||{},this.displayMode=k.deflt(p.displayMode,!1),this.output=k.deflt(p.output,"htmlAndMathml"),this.leqno=k.deflt(p.leqno,!1),this.fleqn=k.deflt(p.fleqn,!1),this.throwOnError=k.deflt(p.throwOnError,!0),this.errorColor=k.deflt(p.errorColor,"#cc0000"),this.macros=p.macros||{},this.minRuleThickness=Math.max(0,k.deflt(p.minRuleThickness,0)),this.colorIsTextColor=k.deflt(p.colorIsTextColor,!1),this.strict=k.deflt(p.strict,"warn"),this.trust=k.deflt(p.trust,!1),this.maxSize=Math.max(0,k.deflt(p.maxSize,1/0)),this.maxExpand=Math.max(0,k.deflt(p.maxExpand,1e3)),this.globalGroup=k.deflt(p.globalGroup,!1)}var h=A.prototype;return h.reportNonstrict=function(g,_,x){var T=this.strict;if(typeof T=="function"&&(T=T(g,_,x)),!(!T||T==="ignore")){if(T===!0||T==="error")throw new o("LaTeX-incompatible input and strict mode is set to 'error': "+(_+" ["+g+"]"),x);T==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(_+" ["+g+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+T+"': "+_+" ["+g+"]"))}},h.useStrictBehavior=function(g,_,x){var T=this.strict;if(typeof T=="function")try{T=T(g,_,x)}catch{T="error"}return!T||T==="ignore"?!1:T===!0||T==="error"?!0:T==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(_+" ["+g+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+T+"': "+_+" ["+g+"]")),!1)},h.isTrusted=function(g){g.url&&!g.protocol&&(g.protocol=k.protocolFromUrl(g.url));var _=typeof this.trust=="function"?this.trust(g):this.trust;return!!_},A}(),S=function(){function A(p,g,_){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=p,this.size=g,this.cramped=_}var h=A.prototype;return h.sup=function(){return Y[ne[this.id]]},h.sub=function(){return Y[$[this.id]]},h.fracNum=function(){return Y[Q[this.id]]},h.fracDen=function(){return Y[ie[this.id]]},h.cramp=function(){return Y[re[this.id]]},h.text=function(){return Y[ue[this.id]]},h.isTight=function(){return this.size>=2},A}(),D=0,R=1,L=2,q=3,H=4,U=5,F=6,j=7,Y=[new S(D,0,!1),new S(R,0,!0),new S(L,1,!1),new S(q,1,!0),new S(H,2,!1),new S(U,2,!0),new S(F,3,!1),new S(j,3,!0)],ne=[H,U,H,U,F,j,F,j],$=[U,U,U,U,j,j,j,j],Q=[L,q,H,U,F,j,F,j],ie=[q,q,U,U,j,j,j,j],re=[R,R,q,q,U,U,j,j],ue=[D,R,L,q,L,q,L,q],X={DISPLAY:Y[D],TEXT:Y[L],SCRIPT:Y[H],SCRIPTSCRIPT:Y[F]},te=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function fe(A){for(var h=0;h<te.length;h++)for(var p=te[h],g=0;g<p.blocks.length;g++){var _=p.blocks[g];if(A>=_[0]&&A<=_[1])return p.name}return null}var be=[];te.forEach(function(A){return A.blocks.forEach(function(h){return be.push.apply(be,h)})});function Ce(A){for(var h=0;h<be.length;h+=2)if(A>=be[h]&&A<=be[h+1])return!0;return!1}var qe=80,pt=function(h,p){return"M95,"+(622+h+p)+`
203
+ `},text(n,e){let t=n.text,r=n.marks;Array.isArray(r)||(r=[]);for(let i of r)this[i.type]?t=this[i.type](t,i):console.warn(`Unknown mark type: ${i.type}`);return t},bold(n){return`**${n}**`},italic(n){return`*${n}*`},strike(n){return`~~${n}~~`},subscript(n){return`~${n}~`},superscript(n){return`^${n}^`},link(n,e){return`[${n}](${e.attrs.href})`},highlight(n){return`==${n}==`},code(n){return`\`${n}\``}};class hM{constructor(e={},t={}){this.flags={inline:!1,inlineWrapper:!1,heading:!1,bulletList:!1,orderedList:!1,blockquote:!1,powerTaskItem:!1,powerTaskList:!1,tableHeader:!1,tableCell:!1,tableRow:!1,table:!1},this.flags=Object.assign(this.flags,t),this.DecNodeFuncs=dM;for(let r in e)this.DecNodeFuncs.hasOwnProperty(r)&&console.warn(`Decoder already has a function named ${r}, the function will be overwritten.`),this.DecNodeFuncs[r]=e[r]}decode(e){e=JSON.parse(JSON.stringify(e));let t="";Array.isArray(e.content)||(e.content=[]);for(let r of e.content)t+=this.renderNode(r);return t}renderNode(e){e.parent?e.flags=Object.assign({},e.parent.flags):e.flags=Object.assign({},this.flags);let t=e.type;if(t==="text")return this.DecNodeFuncs.text(e);e.flags.hasOwnProperty(t)&&(e.flags[t]!==!1?e.flags[t]+=1:e.flags[t]=1),t==="paragraph"&&(e.flags.inlineWrapper=!0,e.flags.inline=!0);let r="",i=e.content;Array.isArray(i)||(i=[]);for(let s of i)s.parent=e,s.childIdx=i.indexOf(s),r+=this.renderNode(s);if(!this.DecNodeFuncs.hasOwnProperty(t))return console.warn(`Unknown node type: ${t}`),r;let o=this.DecNodeFuncs[t](e,e.flags);return typeof o=="string"?o+r:o.prefix+r+o.suffix}}let fM={Bold:{en:"Bold",cn:"粗体"},Italic:{en:"Italic",cn:"斜体"},Strikethrough:{en:"Strikethrough",cn:"删除线"},Underline:{en:"Underline",cn:"下划线"},"Block Quote":{en:"Block Quote",cn:"引用"},"Horizontal Rule":{en:"Horizontal Rule",cn:"水平线"},Header:{en:"Header",cn:"标题"},Task:{en:"Task",cn:"任务清单"},ClearFormatting:{en:"Clear Formatting",cn:"清除格式"},BulletedList:{en:"Bulleted List",cn:"项目符号"},NumberedList:{en:"Numbered List",cn:"编号"},DetailsList:{en:"Details List",cn:"详细列表"},AlignLeft:{en:"Align Left",cn:"左对齐"},AlignCenter:{en:"Align Center",cn:"居中"},AlignRight:{en:"Align Right",cn:"右对齐"},AlignJustify:{en:"Align Justify",cn:"两端对齐"},IncreaseIndent:{en:"Increase Indent",cn:"增加缩进"},DecreaseIndent:{en:"Decrease Indent",cn:"减少缩进"},Color:{en:"Color",cn:"颜色"},Draw:{en:"Draw",cn:"绘图"},Emoji:{en:"Emoji",cn:"表情"},Table:{en:"Table",cn:"表格"},Code:{en:"Code",cn:"代码"},"Code Block":{en:"Code Block",cn:"代码块"},Equation:{en:"Equation",cn:"公式"},Image:{en:"Image",cn:"图片"},Link:{en:"Link",cn:"链接"},Embed:{en:"Embed",cn:"嵌入"},Undo:{en:"Undo",cn:"撤销"},Redo:{en:"Redo",cn:"重做"},Save:{en:"Save",cn:"保存"},Cancel:{en:"Cancel",cn:"取消"},TextField:{en:"Text Field",cn:"文本框"},"Write a caption...":{en:"Write a caption...",cn:"输入标题..."},removeColor:{en:"Remove Color",cn:"清除颜色"},removeHighlight:{en:"Remove Highlight",cn:"清除高亮"},Row:{en:"Row",cn:"行"},Column:{en:"Column",cn:"列"},"Delete Column":{en:"Delete Column",cn:"删除列"},"Delete Row":{en:"Delete Row",cn:"删除行"},"Add Row Before":{en:"Add Row Before",cn:"在上方插入行"},"Add Row After":{en:"Add Row After",cn:"在下方插入行"},"Add Column Before":{en:"Add Column Before",cn:"在左侧插入列"},"Add Column After":{en:"Add Column After",cn:"在右侧插入列"},"Merge Cells":{en:"Merge Cells",cn:"合并单元格"},"Split Cell":{en:"Split Cell",cn:"拆分单元格"},Headers:{en:"Headers",cn:"标题"},Heading:{en:"Heading",cn:"标题"},"Text Color":{en:"Text Color",cn:"文本颜色"},Foreground:{en:"Foreground",cn:"前景色"},"Highlight Background":{en:"Highlight Background",cn:"高亮色"},purple:{en:"purple",cn:"紫色"},red:{en:"red",cn:"红色"},orange:{en:"orange",cn:"橙色"},yellow:{en:"yellow",cn:"黄色"},blue:{en:"blue",cn:"蓝色"},teal:{en:"teal",cn:"青色"},green:{en:"green",cn:"绿色"},Random:{en:"Random",cn:"随机"},"People and Fantasy":{en:"People and Fantasy",cn:"人物与范例"},"Animals & Nature":{en:"Animals & Nature",cn:"动物与自然"},"Food & Drink":{en:"Food & Drink",cn:"食物与饮料"},"Activity and Sports":{en:"Activity and Sports",cn:"活动与体育"},"Travel & Places":{en:"Travel & Places",cn:"旅行与地点"},Objects:{en:"Objects",cn:"物件"},Symbols:{en:"Symbols",cn:"符号"},Flags:{en:"Flags",cn:"旗帜"},"Fill the Form":{en:"Fill the Form",cn:"填写表单"},Caption:{en:"Caption",cn:"标题"},"Insert Embed Url...":{en:"Insert Embed Url...",cn:"插入嵌入链接..."},Insert:{en:"Insert",cn:"插入"},"Insert Embed":{en:"Insert Embed",cn:"插入嵌入"},"Insert Image":{en:"Insert Image",cn:"插入图片"},Method:{en:"Method",cn:"方法"},"Choose Local Image as Base64 (multiple).":{en:"Choose Local Image as Base64 (multiple).",cn:"选择本地图片为Base64 (支持多个)"},"Insert Image Url.":{en:"Insert Image Url.",cn:"插入图片链接"},"Insert Link Url...":{en:"Insert Link Url...",cn:"插入链接..."},"Insert Link":{en:"Insert Link",cn:"插入链接"},Newline:{en:"Newline",cn:"换行"},"Format Painter":{en:"Format Painter",cn:"格式刷"},Done:{en:"Done",cn:"完成"},gray:{en:"Gray",cn:"灰色"},pink:{en:"Pink",cn:"粉色"},rose:{en:"Rose",cn:"玫瑰色"},fresh_blue:{en:"Fresh Blue",cn:"鲜艳蓝"},ice_blue:{en:"Ice Blue",cn:"冰蓝色"},dark_blue:{en:"Dark Blue",cn:"深蓝色"},fresh_green:{en:"Fresh Green",cn:"鲜艳绿"},light_green:{en:"Light Green",cn:"浅绿色"},light_yellow:{en:"Light Yellow",cn:"浅黄色"},light_red:{en:"Light Red",cn:"浅红色"},light_purple:{en:"Light Purple",cn:"浅紫色"},light_orange:{en:"Light Orange",cn:"浅橙色"}};const In=(n,e="en")=>{let t=fM[n];return t?t[e]:n},pM={emits:["container-dblclick","container-click","update:width","update:alignCenter","update:caption"],props:{width:{default:100},editor:{default:()=>({})},caption:{default:""},alignCenter:{default:!0},foreground:{default:""},node:{default:()=>({})},getPos:{default:()=>{}},theme:{default:"light"}},data(){return{thisCaption:this.caption?this.caption.toString():"",thisAlignCenter:this.alignCenter,elWidthStart:0,elWidthEnd:0,active:!1,moveable:!1,direction:1,disX:0,currentWidth:this.normalizeWidthValue(this.width),outsideEvent:n=>{let e=n.target,t=!1;for(;e&&e.tagName&&e.tagName.toLowerCase()!="body";){if(e==this.$el){t=!0;break}e=e.parentNode}t||(this.show.captionBox=!1)},show:{captionBox:!1}}},watch:{width(n){this.currentWidth=this.normalizeWidthValue(n)},currentWidth(n){this.$emit("update:width",n)},alignCenter(n){this.thisAlignCenter=n},thisAlignCenter(n){this.$emit("update:alignCenter",n)},caption(n){this.thisCaption=n?n.toString():""},thisCaption(n){this.$emit("update:caption",n)}},mounted(){this.Init(),this.outSideClickInit()},methods:{Init(){let n=e=>(e.clientX-this.disX)*this.direction+this.elWidthStart*1;window.addEventListener("mousemove",e=>{this.moveable&&(this.elWidthEnd=n(e))}),window.addEventListener("touchmove",e=>{e=e.targetTouches[0],this.moveable&&(this.elWidthEnd=n(e))}),window.addEventListener("mouseup",e=>(this.active=!1,this.moveable&&this.stop(),e)),window.addEventListener("touchup",e=>(this.active=!1,this.moveable&&this.stop(),e))},forward(n,e=1){this.active=!0,this.moveable=!0,this.disX=n.clientX,this.direction=e,this.elWidthStart=this.$el.clientWidth,this.elWidthEnd=this.elWidthStart},stop(){this.active=!1,this.moveable=!1,this.elWidthEnd<50&&(this.elWidthEnd=50),this.currentWidth=`${this.elWidthEnd}px`},outSideClickInit(){window.addEventListener("click",this.outsideEvent)},normalizeWidthValue(n){const e=n==null?void 0:n.toString().trim();return e?e.includes("%")||e.includes("px")||e.includes("vw")||e.includes("vh")||e.includes("rem")||e.includes("em")||e.includes("auto")||e.includes("calc(")?e:`${e}%`:"100%"},getTitle(n){return In(n,this.editor.storage.defaultStorage.language)},showCaptionBox(){this.editor.isEditable&&(this.show.captionBox=!0,this.$nextTick(()=>{this.$refs.caption.focus()}))},newline(){this.editor.isEditable&&(this.editor.commands.focus(),this.editor.commands.insertContentAt(this.getPos()+this.node.nodeSize-1,"<br>"))}},beforeUnmount(){window.removeEventListener("click",this.outsideEvent)}},mM={class:"power-editor-media-control-btn-block"},gM={class:"power-editor-media-control-btn-block bottom"},bM={class:"power-editor-media-mask-block"};function _M(n,e,t,r,i,o){const s=v.resolveComponent("fv-button"),a=v.resolveComponent("fv-text-box");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["power-editor-media-container",[{dark:t.theme==="dark"},{"active-effects":i.active}]]),style:v.normalizeStyle({width:i.moveable?`${i.elWidthEnd}px`:o.normalizeWidthValue(i.currentWidth)})},[v.withDirectives(v.createElementVNode("div",{class:"power-editor-media-control-resize-block",onMousedown:e[0]||(e[0]=l=>o.forward(l,-1)),onMouseup:e[1]||(e[1]=(...l)=>o.stop&&o.stop(...l)),onTouchstart:e[2]||(e[2]=l=>o.forward(l.targetTouches[0],-1)),onTouchend:e[3]||(e[3]=(...l)=>o.stop&&o.stop(...l))},e[19]||(e[19]=[v.createElementVNode("i",null,null,-1)]),544),[[v.vShow,t.alignCenter&&(t.editor.isEditable||t.editor.storage.defaultStorage.showControlOnReadonly)]]),v.createElementVNode("div",{class:"power-editor-media-slot-container",onDblclick:e[4]||(e[4]=l=>n.$emit("container-dblclick",l)),onClick:e[5]||(e[5]=l=>n.$emit("container-click",l))},[v.renderSlot(n.$slots,"default",{},()=>[e[20]||(e[20]=v.createTextVNode(" Media Container "))])],32),v.withDirectives(v.createElementVNode("div",{class:"power-editor-media-control-resize-block sec",onMousedown:e[6]||(e[6]=(...l)=>o.forward&&o.forward(...l)),onMouseup:e[7]||(e[7]=(...l)=>o.stop&&o.stop(...l)),onTouchstart:e[8]||(e[8]=l=>o.forward(l.targetTouches[0])),onTouchend:e[9]||(e[9]=(...l)=>o.stop&&o.stop(...l))},e[21]||(e[21]=[v.createElementVNode("i",null,null,-1)]),544),[[v.vShow,t.editor.isEditable||t.editor.storage.defaultStorage.showControlOnReadonly]]),v.withDirectives(v.createElementVNode("div",{draggable:"true","data-drag-handle":"",class:"power-editor-media-drag-btn",onMousedown:e[10]||(e[10]=l=>i.active=!0),onMouseup:e[11]||(e[11]=l=>i.active=!1),onTouchstart:e[12]||(e[12]=l=>i.active=!0),onTouchend:e[13]||(e[13]=l=>i.active=!1)},e[22]||(e[22]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--GripperDotsVertical"},null,-1)]),544),[[v.vShow,t.editor.isEditable]]),v.withDirectives(v.createElementVNode("div",mM,[v.withDirectives(v.createVNode(s,{class:"power-editor-media-cmd-btn",background:t.theme==="dark"?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.0)","border-radius":6,theme:t.theme,fontSize:"10",title:o.getTitle("Caption"),onClick:o.showCaptionBox},{default:v.withCtx(()=>e[23]||(e[23]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--TextField"},null,-1)])),_:1,__:[23]},8,["background","theme","title","onClick"]),[[v.vShow,t.editor.isEditable]]),v.createVNode(s,{class:"power-editor-media-cmd-btn",background:t.theme==="dark"?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.0)","border-radius":6,theme:t.theme,fontSize:"10",title:o.getTitle("AlignLeft"),onClick:e[14]||(e[14]=l=>i.thisAlignCenter=!1)},{default:v.withCtx(()=>e[24]||(e[24]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--AlignLeft"},null,-1)])),_:1,__:[24]},8,["background","theme","title"]),v.createVNode(s,{class:"power-editor-media-cmd-btn",background:t.theme==="dark"?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.0)","border-radius":6,theme:t.theme,fontSize:"10",title:o.getTitle("AlignCenter"),onClick:e[15]||(e[15]=l=>i.thisAlignCenter=!0)},{default:v.withCtx(()=>e[25]||(e[25]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--AlignCenter"},null,-1)])),_:1,__:[25]},8,["background","theme","title"])],512),[[v.vShow,t.editor.isEditable||t.editor.storage.defaultStorage.showControlOnReadonly]]),v.withDirectives(v.createElementVNode("div",gM,[v.createVNode(s,{class:"power-editor-media-cmd-btn",background:t.theme==="dark"?"rgba(0, 0, 0, 0.8)":"rgba(255, 255, 255, 0.0)","border-radius":6,theme:t.theme,icon:"ReturnKeySm",fontSize:"10",title:o.getTitle("TextField"),style:{width:"60px"},onClick:o.newline},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(o.getTitle("Newline")),1)]),_:1},8,["background","theme","title","onClick"])],512),[[v.vShow,t.editor.isEditable]]),v.withDirectives(v.createElementVNode("div",bM,null,512),[[v.vShow,i.active]]),v.withDirectives(v.createElementVNode("p",{class:"power-editor-media-container-caption",onClick:e[16]||(e[16]=(...l)=>o.showCaptionBox&&o.showCaptionBox(...l))},v.toDisplayString(i.thisCaption),513),[[v.vShow,i.thisCaption!==""&&!i.show.captionBox]]),v.withDirectives(v.createVNode(a,{modelValue:i.thisCaption,"onUpdate:modelValue":e[17]||(e[17]=l=>i.thisCaption=l),theme:t.theme,class:"power-editor-media-caption-block",placeholder:o.getTitle("Write a caption..."),ref:"caption",background:"transparent",underline:"","border-width":2,"is-box-shadow":!0,"border-color":"rgba(200, 200, 200, 0.1)","focus-border-color":t.foreground,onKeyup:e[18]||(e[18]=v.withKeys(()=>{i.show.captionBox=!1,o.newline()},["enter"]))},null,8,["modelValue","theme","placeholder","focus-border-color"]),[[v.vShow,i.show.captionBox]])],6)}const Bh=Gt(pM,[["render",_M]]),yM={components:{NodeViewWrapper:Mi,mediaContainer:Bh},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{statusInfo:{show:!1,progress:0,loading:!1,info:"",tmpSrc:"",tmpHeight:0,lock:!0},imgStatus:"init",previewImg:{scalePercent:"100",show:!1},thisTheme:this.editor.storage.defaultStorage.theme,thisLazyLoad:this.editor.storage.defaultStorage.imgLazyLoad,thisForeground:this.editor.storage.defaultStorage.foreground,thisImgPreview:this.editor.storage.defaultStorage.imgPreview,imgInterceptor:this.editor.storage.defaultStorage.imgInterceptor}},watch:{"node.attrs.src"(){this.imgInterceptorFunc()},"editor.storage.defaultStorage.theme"(n){this.thisTheme=n},"editor.storage.defaultStorage.imgLazyLoad"(n){this.thisLazyLoad=n},"editor.storage.defaultStorage.imgPreview"(n){this.thisImgPreview=n},"editor.storage.defaultStorage.foreground"(n){this.thisForeground=n},"editor.storage.defaultStorage.imgInterceptor"(n){this.imgInterceptor=n,this.imgInterceptorFunc()}},mounted(){this.imgInterceptorFunc()},methods:{showStatus(n){this.statusInfo.show=n},updateStatus(n,e,t=""){this.statusInfo.loading=n,this.statusInfo.progress=e,this.statusInfo.info=t},getImage(){return this.node.attrs.src},interceptImage(n=""){return this.statusInfo.tmpSrc=this.node.attrs.src,this.updateAttributes({src:n}),this.statusInfo.tmpSrc},updateImage(n){this.updateAttributes({src:n})},updateLock(n){this.statusInfo.lock=n},imgInterceptorFunc(){let n={node:this.node,extension:this.extension,getPos:this.getPos,updateAttributes:this.updateAttributes,deleteNode:this.deleteNode,showStatus:this.showStatus,updateStatus:this.updateStatus,getImage:this.getImage,interceptImage:this.interceptImage,updateImage:this.updateImage,updateLock:this.updateLock};this.imgInterceptor&&this.imgInterceptor(n)},imgLoaded(n){var o;const e=(o=this.$el)==null?void 0:o.clientWidth,{naturalWidth:t,naturalHeight:r}=n,i=(t||0)/(r||1e-6);this.statusInfo.tmpHeight=e/i,this.imgStatus="loaded"},imgError(){this.imgStatus="error"},preview(n="readonly"){this.editor.isEditable&&n!=="editable"||!this.editor.isEditable&&n!=="readonly"||this.node.attrs.src&&this.thisImgPreview&&(this.previewImg.show=!0)},scale(n,e){n.stopPropagation&&n.stopPropagation();let t=parseInt(this.previewImg.scalePercent);t+=e,t<50?t=50:t>200&&(t=200),this.previewImg.scalePercent=t.toString()},setScale(n,e){n.stopPropagation&&n.stopPropagation(),e<50?e=50:e>200&&(e=200),this.previewImg.scalePercent=e.toString()}}},vM={class:"power-editor-image-status-container"},wM={class:"power-editor-preview-img-container"};function xM(n,e,t,r,i,o){const s=v.resolveComponent("fv-image"),a=v.resolveComponent("fv-progress-ring"),l=v.resolveComponent("media-container"),c=v.resolveComponent("fv-img"),u=v.resolveComponent("fv-button"),d=v.resolveComponent("fv-text-box"),m=v.resolveComponent("node-view-wrapper");return t.node?(v.openBlock(),v.createBlock(m,{key:0,class:v.normalizeClass(["power-editor-image-container",[{dark:i.thisTheme==="dark"}]]),style:v.normalizeStyle({"justify-content":t.node.attrs.alignCenter?"center":"flex-start"})},{default:v.withCtx(()=>[v.createVNode(l,{width:t.node.attrs.width,"onUpdate:width":e[1]||(e[1]=b=>t.node.attrs.width=b),caption:t.node.attrs.caption,alignCenter:t.node.attrs.alignCenter,"onUpdate:alignCenter":e[2]||(e[2]=b=>t.node.attrs.alignCenter=b),editor:t.editor,theme:i.thisTheme,foreground:i.thisForeground,node:t.node,getPos:t.getPos,"onUpdate:caption":e[3]||(e[3]=b=>t.updateAttributes({caption:b})),onContainerDblclick:e[4]||(e[4]=b=>o.preview("editable")),onContainerClick:e[5]||(e[5]=b=>o.preview("readonly"))},{default:v.withCtx(()=>[v.createVNode(s,{src:t.node.attrs.src?t.node.attrs.src:i.statusInfo.tmpSrc?i.statusInfo.tmpSrc:"",ref:"image",onlazy:i.thisLazyLoad,style:v.normalizeStyle([{width:"100%",height:"auto"},{height:i.imgStatus==="error"?i.statusInfo.tmpHeight+"px":""}]),onLoad:o.imgLoaded,onError:o.imgError},null,8,["src","onlazy","style","onLoad","onError"]),v.withDirectives(v.createElementVNode("div",vM,[v.createVNode(a,{modelValue:i.statusInfo.progress,"onUpdate:modelValue":e[0]||(e[0]=b=>i.statusInfo.progress=b),loading:i.statusInfo.loading,r:"20",borderWidth:"3",color:i.thisTheme==="dark"?"white":"black",background:i.thisTheme==="dark"?"rgba(0, 0, 0, 0.3)":"rgba(255, 255, 255, 0.3)"},null,8,["modelValue","loading","color","background"]),v.withDirectives(v.createElementVNode("p",{class:"power-editor-image-status-title"},v.toDisplayString(i.statusInfo.info),513),[[v.vShow,i.statusInfo.info]])],512),[[v.vShow,i.statusInfo.show]]),v.createElementVNode("div",{class:v.normalizeClass(["power-editor-image-selection-mask",[{selected:t.selected}]]),style:v.normalizeStyle({"--selected-bg":i.thisForeground})},null,6)]),_:1},8,["width","caption","alignCenter","editor","theme","foreground","node","getPos"]),v.createVNode(v.Transition,{name:"show-preview"},{default:v.withCtx(()=>[v.withDirectives(v.createElementVNode("div",{class:"power-editor-image-preview-block",onClick:e[12]||(e[12]=b=>i.previewImg.show=!1)},[v.createElementVNode("div",wM,[v.createVNode(c,{src:t.node.attrs.src,class:"power-editor-preview-img",style:v.normalizeStyle({scale:i.previewImg.scalePercent+"%",cursor:i.previewImg.scalePercent<150?"zoom-in":"zoom-out"}),onClickCapture:e[6]||(e[6]=b=>i.previewImg.scalePercent<100?o.setScale(b,100):i.previewImg.scalePercent<150?o.setScale(b,150):o.setScale(b,100))},null,8,["src","style"])]),v.createElementVNode("div",{class:"power-editor-preview-tool-bar",onClick:e[11]||(e[11]=b=>b.stopPropagation())},[v.createVNode(u,{class:"power-editor-preview-img-btn",theme:"dark",disabled:i.previewImg.scalePercent<=50,background:"rgba(36, 36, 36, 0.3)",onClick:e[7]||(e[7]=b=>o.scale(b,-50))},{default:v.withCtx(()=>e[13]||(e[13]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--CalculatorSubtract"},null,-1)])),_:1,__:[13]},8,["disabled"]),v.createVNode(d,{modelValue:i.previewImg.scalePercent,theme:"dark",underline:"","border-color":"rgba(120, 120, 120, 0.1)","focus-border-color":i.thisForeground,"border-width":2,"is-box-shadow":!0,suffix:"%",style:{width:"80px",height:"35px"},onDebounceInput:e[8]||(e[8]=b=>o.setScale(b,b))},null,8,["modelValue","focus-border-color"]),v.createVNode(u,{class:"power-editor-preview-img-btn",theme:"dark",disabled:i.previewImg.scalePercent>=200,background:"rgba(36, 36, 36, 0.3)","border-color":"transparent",onClick:e[9]||(e[9]=b=>o.scale(b,50))},{default:v.withCtx(()=>e[14]||(e[14]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--CalculatorAddition"},null,-1)])),_:1,__:[14]},8,["disabled"]),v.createVNode(u,{class:"power-editor-preview-img-btn",theme:"dark",background:"rgba(36, 36, 36, 0.3)",onClick:e[10]||(e[10]=b=>i.previewImg.show=!1)},{default:v.withCtx(()=>e[15]||(e[15]=[v.createElementVNode("i",{class:"ms-Icon ms-Icon--BackToWindow"},null,-1)])),_:1,__:[15]})])],512),[[v.vShow,i.previewImg.show]])]),_:1})]),_:1},8,["class","style"])):v.createCommentVNode("",!0)}const kM=Gt(yM,[["render",xM]]),SM=xt.create({name:"imageblock",group:"block",draggable:!0,atom:!0,addAttributes(){return{src:{default:""},width:{default:"100%"},caption:{default:""},alignCenter:{default:!0}}},parseHTML(){return[{tag:"img[src]"}]},renderHTML({HTMLAttributes:n}){return["img",$e(this.options.HTMLAttributes,n)]},addNodeView(){return ti(kM)}}),CM={components:{NodeViewWrapper:Mi,mediaContainer:Bh},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{width:0,thisTheme:this.editor.storage.defaultStorage.theme,thisForeground:this.editor.storage.defaultStorage.foreground,timer:{}}},watch:{"editor.storage.defaultStorage.theme"(n){this.thisTheme=n},"editor.storage.defaultStorage.foreground"(n){this.thisForeground=n}},mounted(){this.timerInit()},methods:{timerInit(){this.timer=setInterval(()=>{this.width=this.$refs.media.$el.clientWidth},300)}},beforeUnmount(){clearInterval(this.timer)}},EM=["src"];function TM(n,e,t,r,i,o){const s=v.resolveComponent("media-container"),a=v.resolveComponent("node-view-wrapper");return t.node?(v.openBlock(),v.createBlock(a,{key:0,class:"power-editor-embed-container",style:v.normalizeStyle({"justify-content":t.node.attrs.alignCenter?"center":"flex-start"})},{default:v.withCtx(()=>[v.createVNode(s,{width:t.node.attrs.width,"onUpdate:width":e[0]||(e[0]=l=>t.node.attrs.width=l),caption:t.node.attrs.caption,alignCenter:t.node.attrs.alignCenter,"onUpdate:alignCenter":e[1]||(e[1]=l=>t.node.attrs.alignCenter=l),editor:t.editor,theme:i.thisTheme,foreground:i.thisForeground,node:t.node,getPos:t.getPos,ref:"media","onUpdate:caption":e[2]||(e[2]=l=>t.updateAttributes({caption:l}))},{default:v.withCtx(()=>[v.createElementVNode("iframe",{src:t.node.attrs.src,frameborder:"0",allowfullscreen:"",style:v.normalizeStyle([{width:"100%",height:"auto"},{height:`${i.width/1.778}px`}])},null,12,EM)]),_:1},8,["width","caption","alignCenter","editor","theme","foreground","node","getPos"])]),_:1},8,["style"])):v.createCommentVNode("",!0)}const AM=Gt(CM,[["render",TM]]),MM=xt.create({name:"embedblock",group:"block",draggable:!0,atom:!0,addAttributes(){return{src:{default:""},width:{default:"100%"},caption:{default:""},alignCenter:{default:!0}}},parseHTML(){return[{tag:"embed-block"}]},renderHTML({HTMLAttributes:n}){return["embed-block",$e(n)]},addNodeView(){return ti(AM)}});function Jl({find:n,type:e,getAttributes:t}){return new v1({find:n,handler({match:r,chain:i,range:o}){const s=Xe(t,void 0,r);if(s===!1||s===null)return null;if(r.input){const{from:a,to:l}=o;s.powerContent?i().deleteRange(o).insertContentAt(a,[{type:e.name,attrs:s,content:s.powerContent}]):i().deleteRange(o).insertContentAt(a,[{type:e.name,attrs:s}])}}})}const NM=/^-(\[([ |x])\])\s$/,DM=/^-(\s*)(\[([ |x])\])\s+(.*)/g,RM=xt.create({name:"powerTaskList",group:"block list",content:"powerTaskItem+",parseHTML(){return[{tag:'ul[data-type="powerTaskList"]',priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",$e(n,{"data-type":this.name}),0]},addCommands(){return{togglePowerTaskList:()=>({commands:n})=>n.toggleList("powerTaskList","powerTaskItem"),setPowerTaskList:()=>({editor:n,commands:e})=>{if(!n.isActive("powerTaskList"))return e.toggleList("powerTaskList","powerTaskItem")}}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.togglePowerTaskList()}},addInputRules(){return[Jr({find:NM,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x",theme:this.editor.storage.defaultStorage.theme})})]},addPasteRules(){return[Jl({find:DM,type:this.type,getAttributes:n=>({powerContent:[{type:"powerTaskItem",content:[{type:"paragraph",content:[{type:"text",text:n[4]}]}],attrs:{checked:n[3]==="x",theme:this.editor.storage.defaultStorage.theme}}]})})]}}),IM={components:{NodeViewWrapper:Mi,NodeViewContent:O1},props:{editor:{type:Object},node:{type:Object},decorations:{type:Array},selected:{type:Boolean},extension:{type:Object},getPos:{type:Function},updateAttributes:{type:Function},deleteNode:{type:Function}},data(){return{thisTheme:this.editor.storage.defaultStorage.theme,thisForeground:this.editor.storage.defaultStorage.foreground,timer:{}}},watch:{"editor.storage.defaultStorage.theme"(n){this.thisTheme=n},"editor.storage.defaultStorage.foreground"(n){this.thisForeground=n}},mounted(){},methods:{preventEnter(n){console.log(n)},updateValue(n){this.updateAttributes({checked:n})}},beforeUnmount(){clearInterval(this.timer)}};function OM(n,e,t,r,i,o){const s=v.resolveComponent("fv-check-box"),a=v.resolveComponent("node-view-content"),l=v.resolveComponent("node-view-wrapper");return t.node?(v.openBlock(),v.createBlock(l,{key:0,as:"li",class:"power-editor-task-item-container"},{default:v.withCtx(()=>[v.createVNode(s,{modelValue:t.node.attrs.checked,"onUpdate:modelValue":e[0]||(e[0]=c=>t.node.attrs.checked=c),theme:i.thisTheme,disabled:!t.editor.isEditable,background:i.thisForeground,contenteditable:"false",onClick:o.updateValue},null,8,["modelValue","theme","disabled","background","onClick"]),v.createVNode(a,{ref:"n",class:"power-editor-task-item-content"},null,512)]),_:1})):v.createCommentVNode("",!0)}const LM=Gt(IM,[["render",OM]]),PM=/^\s*(\[([ |x])\])\s$/,BM=/^(\s*)(\[([ |x])\])\s+(.*)/g,FM=xt.create({name:"powerTaskItem",group:"block",content:"paragraph block*",draggable:!0,addAttributes(){return{value:{default:""},checked:{default:!1},placeholder:{default:"To-Do"}}},parseHTML(){return[{tag:'li[data-type="powerTaskItem"]',priority:51}]},renderHTML({HTMLAttributes:n}){return["li",$e(this.options.HTMLAttributes,n,{"data-type":"powerTaskItem"}),0]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem("powerTaskItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("powerTaskItem")};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem("powerTaskItem")}:n},addNodeView(){return ti(LM)},addInputRules(){return[Jr({find:PM,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x",theme:this.editor.storage.defaultStorage.theme})})]},addPasteRules(){return[Jl({find:BM,type:this.type,getAttributes:n=>({powerContent:[{type:"paragraph",content:[{type:"text",text:n[4]}]}],checked:n[3]==="x",theme:this.editor.storage.defaultStorage.theme})})]}});var Fh,pv;function zM(){if(pv)return Fh;pv=1;var n=[],e=function(a){return typeof a>"u"},t=/\s*(\.\d+|\d+(?:\.\d+)?)(%|deg)?\s*/,r=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,i=new RegExp("^(rgb|hsl|hsv)a?\\("+t.source+"[, ]"+t.source+"[, ]"+t.source+"(?:[,/]"+t.source+")?\\)$","i");function o(a,l,c){if(a==="%")return 100;if(a==="deg"||c&&l===0)return 360;if(!a)return 255}function s(a){if(Array.isArray(a)){if(typeof a[0]=="string"&&typeof s[a[0]]=="function")return new s[a[0]](a.slice(1,a.length));if(a.length===4)return new s.RGB(a[0]/255,a[1]/255,a[2]/255,a[3]/255)}else if(typeof a=="string"){var l=a.toLowerCase();s.namedColors[l]&&(a="#"+s.namedColors[l]),l==="transparent"&&(a="rgba(0,0,0,0)");var c=a.match(i);if(c){var u=c[1].toUpperCase(),d=u[0]==="H";if(e(s[u]))throw new Error("color."+u+" is not installed.");let f=e(c[8])?1:void 0;return f===void 0&&(c[9]==="%"?f=parseFloat(c[8])/100:f=parseFloat(c[8])),new s[u](parseFloat(c[2])/o(c[3],0,d),parseFloat(c[4])/o(c[5],1,d),parseFloat(c[6])/o(c[7],2,d),f)}a.length<6&&(a=a.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,"$1$1$2$2$3$3$4$4"));var m=a.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])?$/i);if(m)return new s.RGB(parseInt(m[1],16)/255,parseInt(m[2],16)/255,parseInt(m[3],16)/255,m[4]?parseInt(m[4],16)/255:1);if(s.CMYK){var b=a.match(new RegExp("^cmyk\\("+r.source+","+r.source+","+r.source+","+r.source+"\\)$","i"));if(b)return new s.CMYK(parseFloat(b[1])/100,parseFloat(b[2])/100,parseFloat(b[3])/100,parseFloat(b[4])/100)}}else if(typeof a=="object"&&a.isColor)return a;return!1}return s.namedColors={},s.installColorSpace=function(a,l,c){s[a]=function(f){var y=Array.isArray(f)?f:arguments;l.forEach(function(w,k){var E=y[k];if(w==="alpha")this._alpha=isNaN(E)||E>1?1:E<0?0:E;else{if(isNaN(E))throw new Error("["+a+"]: Invalid color: ("+l.join(",")+")");w==="hue"?this._hue=E<0?E-Math.floor(E):E%1:this["_"+w]=E<0?0:E>1?1:E}},this)},s[a].propertyNames=l;var u=s[a].prototype;["valueOf","hex","hexa","css","cssa"].forEach(function(f){u[f]=u[f]||(a==="RGB"?u.hex:function(){return this.rgb()[f]()})}),u.isColor=!0,u.equals=function(f,y){e(y)&&(y=1e-10),f=f[a.toLowerCase()]();for(var w=0;w<l.length;w=w+1)if(Math.abs(this["_"+l[w]]-f["_"+l[w]])>y)return!1;return!0},u.toJSON=function(){return[a].concat(l.map(function(f){return this["_"+f]},this))};for(var d in c)if(Object.prototype.hasOwnProperty.call(c,d)){var m=d.match(/^from(.*)$/);m?s[m[1].toUpperCase()].prototype[a.toLowerCase()]=c[d]:u[d]=c[d]}u[a.toLowerCase()]=function(){return this},u.toString=function(){return"["+a+" "+l.map(function(f){return this["_"+f]},this).join(", ")+"]"},l.forEach(function(f){var y=f==="black"?"k":f.charAt(0);u[f]=u[y]=function(w,k){return typeof w>"u"?this["_"+f]:k?new this.constructor(l.map(function(E){return this["_"+E]+(f===E?w:0)},this)):new this.constructor(l.map(function(E){return f===E?w:this["_"+E]},this))}});function b(f,y){var w={};w[y.toLowerCase()]=function(){return this.rgb()[y.toLowerCase()]()},s[y].propertyNames.forEach(function(E){var S=E==="black"?"k":E.charAt(0);w[E]=w[S]=function(D,R){return this[y.toLowerCase()]()[E](D,R)}});for(var k in w)Object.prototype.hasOwnProperty.call(w,k)&&s[f].prototype[k]===void 0&&(s[f].prototype[k]=w[k])}return n.forEach(function(f){b(a,f),b(f,a)}),n.push(a),s},s.pluginList=[],s.use=function(a){return s.pluginList.indexOf(a)===-1&&(this.pluginList.push(a),a(s)),s},s.installMethod=function(a,l){return n.forEach(function(c){s[c].prototype[a]=l}),this},s.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var a=(Math.round(255*this._red)*65536+Math.round(255*this._green)*256+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-a.length)+a},hexa:function(){var a=Math.round(this._alpha*255).toString(16);return this.hex()+"00".substr(0,2-a.length)+a},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}}),Fh=s,Fh}var zh,mv;function gv(){return mv||(mv=1,zh=function(e){e.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var t=function(s){return s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92},r=t(this._red),i=t(this._green),o=t(this._blue);return new e.XYZ(r*.4124564+i*.3575761+o*.1804375,r*.2126729+i*.7151522+o*.072175,r*.0193339+i*.119192+o*.9503041,this._alpha)},rgb:function(){var t=this._x,r=this._y,i=this._z,o=function(s){return s>.0031308?1.055*Math.pow(s,1/2.4)-.055:12.92*s};return new e.RGB(o(t*3.2404542+r*-1.5371385+i*-.4985314),o(t*-.969266+r*1.8760108+i*.041556),o(t*.0556434+r*-.2040259+i*1.0572252),this._alpha)},lab:function(){var t=function(s){return s>.008856?Math.pow(s,.3333333333333333):7.787037*s+.13793103448275862},r=t(this._x/95.047),i=t(this._y/100),o=t(this._z/108.883);return new e.LAB(116*i-16,500*(r-i),200*(i-o),this._alpha)}})}),zh}var qh,bv;function qM(){return bv||(bv=1,qh=function(e){e.use(gv()),e.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var t=function(s){var a=Math.pow(s,3);return a>.008856?a:(s-.13793103448275862)/7.87},r=(this._l+16)/116,i=this._a/500+r,o=r-this._b/200;return new e.XYZ(t(i)*95.047,t(r)*100,t(o)*108.883,this._alpha)}})}),qh}var Hh,_v;function yv(){return _v||(_v=1,Hh=function(e){e.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var t=this._hue,r=this._saturation,i=this._value,o=Math.min(5,Math.floor(t*6)),s=t*6-o,a=i*(1-r),l=i*(1-s*r),c=i*(1-(1-s)*r),u,d,m;switch(o){case 0:u=i,d=c,m=a;break;case 1:u=l,d=i,m=a;break;case 2:u=a,d=i,m=c;break;case 3:u=a,d=l,m=i;break;case 4:u=c,d=a,m=i;break;case 5:u=i,d=a,m=l;break}return new e.RGB(u,d,m,this._alpha)},hsl:function(){var t=(2-this._saturation)*this._value,r=this._saturation*this._value,i=t<=1?t:2-t,o;return i<1e-9?o=0:o=r/i,new e.HSL(this._hue,o,t/2,this._alpha)},fromRgb:function(){var t=this._red,r=this._green,i=this._blue,o=Math.max(t,r,i),s=Math.min(t,r,i),a=o-s,l,c=o===0?0:a/o,u=o;if(a===0)l=0;else switch(o){case t:l=(r-i)/a/6+(r<i?1:0);break;case r:l=(i-t)/a/6+1/3;break;case i:l=(t-r)/a/6+2/3;break}return new e.HSV(l,c,u,this._alpha)}})}),Hh}var Vh,vv;function wo(){return vv||(vv=1,Vh=function(e){e.use(yv()),e.installColorSpace("HSL",["hue","saturation","lightness","alpha"],{hsv:function(){var t=this._lightness*2,r=this._saturation*(t<=1?t:2-t),i;return t+r<1e-9?i=0:i=2*r/(t+r),new e.HSV(this._hue,i,(t+r)/2,this._alpha)},rgb:function(){return this.hsv().rgb()},fromRgb:function(){return this.hsv().hsl()}})}),Vh}var Uh,wv;function HM(){return wv||(wv=1,Uh=function(e){e.installColorSpace("CMYK",["cyan","magenta","yellow","black","alpha"],{rgb:function(){return new e.RGB(1-this._cyan*(1-this._black)-this._black,1-this._magenta*(1-this._black)-this._black,1-this._yellow*(1-this._black)-this._black,this._alpha)},fromRgb:function(){var t=this._red,r=this._green,i=this._blue,o=1-t,s=1-r,a=1-i,l=1;return t||r||i?(l=Math.min(o,Math.min(s,a)),o=(o-l)/(1-l),s=(s-l)/(1-l),a=(a-l)/(1-l)):l=1,new e.CMYK(o,s,a,l,this._alpha)}})}),Uh}var Gh,xv;function VM(){return xv||(xv=1,Gh=function(e){e.namedColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}}),Gh}var $h,kv;function UM(){return kv||(kv=1,$h=function(e){e.installMethod("clearer",function(t){return this.alpha(isNaN(t)?-.1:-t,!0)})}),$h}var Wh,Sv;function Cv(){return Sv||(Sv=1,Wh=function(e){function t(r){return r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}e.installMethod("luminance",function(){var r=this.rgb();return .2126*t(r._red)+.7152*t(r._green)+.0722*t(r._blue)})}),Wh}var Kh,Ev;function GM(){return Ev||(Ev=1,Kh=function(e){e.use(Cv()),e.installMethod("contrast",function(t){var r=this.luminance(),i=t.luminance();return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)})}),Kh}var jh,Tv;function $M(){return Tv||(Tv=1,jh=function(e){e.use(wo()),e.installMethod("darken",function(t){return this.lightness(isNaN(t)?-.1:-t,!0)})}),jh}var Qh,Av;function WM(){return Av||(Av=1,Qh=function(e){e.use(wo()),e.installMethod("desaturate",function(t){return this.saturation(isNaN(t)?-.1:-t,!0)})}),Qh}var Yh,Mv;function KM(){return Mv||(Mv=1,Yh=function(e){function t(){var r=this.rgb(),i=r._red*.3+r._green*.59+r._blue*.11;return new e.RGB(i,i,i,r._alpha)}e.installMethod("greyscale",t).installMethod("grayscale",t)}),Yh}var Zh,Nv;function Dv(){return Nv||(Nv=1,Zh=function(e){e.installMethod("isDark",function(){var t=this.rgb(),r=(t._red*255*299+t._green*255*587+t._blue*255*114)/1e3;return r<128})}),Zh}var Xh,Rv;function jM(){return Rv||(Rv=1,Xh=function(e){e.use(Dv()),e.installMethod("isLight",function(){return!this.isDark()})}),Xh}var Jh,Iv;function QM(){return Iv||(Iv=1,Jh=function(e){e.use(wo()),e.installMethod("lighten",function(t){return this.lightness(isNaN(t)?.1:t,!0)})}),Jh}var ef,Ov;function YM(){return Ov||(Ov=1,ef=function(e){e.installMethod("mix",function(t,r){t=e(t).rgb(),r=1-(isNaN(r)?.5:r);var i=r*2-1,o=this._alpha-t._alpha,s=((i*o===-1?i:(i+o)/(1+i*o))+1)/2,a=1-s,l=this.rgb();return new e.RGB(l._red*s+t._red*a,l._green*s+t._green*a,l._blue*s+t._blue*a,l._alpha*r+t._alpha*(1-r))})}),ef}var tf,Lv;function ZM(){return Lv||(Lv=1,tf=function(e){e.installMethod("negate",function(){var t=this.rgb();return new e.RGB(1-t._red,1-t._green,1-t._blue,this._alpha)})}),tf}var nf,Pv;function XM(){return Pv||(Pv=1,nf=function(e){e.installMethod("opaquer",function(t){return this.alpha(isNaN(t)?.1:t,!0)})}),nf}var rf,Bv;function JM(){return Bv||(Bv=1,rf=function(e){e.use(wo()),e.installMethod("rotate",function(t){return this.hue((t||0)/360,!0)})}),rf}var of,Fv;function eN(){return Fv||(Fv=1,of=function(e){e.use(wo()),e.installMethod("saturate",function(t){return this.saturation(isNaN(t)?.1:t,!0)})}),of}var sf,zv;function tN(){return zv||(zv=1,sf=function(e){e.installMethod("toAlpha",function(t){var r=this.rgb(),i=t(t).rgb(),o=1e-10,s=new t.RGB(0,0,0,r._alpha),a=["_red","_green","_blue"];return a.forEach(function(l){r[l]<o?s[l]=r[l]:r[l]>i[l]?s[l]=(r[l]-i[l])/(1-i[l]):r[l]>i[l]?s[l]=(i[l]-r[l])/i[l]:s[l]=0}),s._red>s._green?s._red>s._blue?r._alpha=s._red:r._alpha=s._blue:s._green>s._blue?r._alpha=s._green:r._alpha=s._blue,r._alpha<o||(a.forEach(function(l){r[l]=(r[l]-i[l])/r._alpha+i[l]}),r._alpha*=s._alpha),r})}),sf}var af,qv;function nN(){return qv||(qv=1,af=zM().use(gv()).use(qM()).use(yv()).use(wo()).use(HM()).use(VM()).use(UM()).use(GM()).use($M()).use(WM()).use(KM()).use(Dv()).use(jM()).use(QM()).use(Cv()).use(YM()).use(ZM()).use(XM()).use(JM()).use(eN()).use(tN())),af}var rN=nN();const ec=or(rN);var tc={exports:{}},iN=tc.exports,Hv;function oN(){return Hv||(Hv=1,function(n,e){(function(r,i){n.exports=i()})(typeof self<"u"?self:iN,function(){return function(){var t={};(function(){t.d=function(A,h){for(var p in h)t.o(h,p)&&!t.o(A,p)&&Object.defineProperty(A,p,{enumerable:!0,get:h[p]})}})(),function(){t.o=function(A,h){return Object.prototype.hasOwnProperty.call(A,h)}}();var r={};t.d(r,{default:function(){return CP}});var i=function A(h,p){this.position=void 0;var g="KaTeX parse error: "+h,_,x=p&&p.loc;if(x&&x.start<=x.end){var T=x.lexer.input;_=x.start;var I=x.end;_===T.length?g+=" at end of input: ":g+=" at position "+(_+1)+": ";var P=T.slice(_,I).replace(/[^]/g,"$&̲"),z;_>15?z="…"+T.slice(_-15,_):z=T.slice(0,_);var G;I+15<T.length?G=T.slice(I,I+15)+"…":G=T.slice(I),g+=z+P+G}var Z=new Error(g);return Z.name="ParseError",Z.__proto__=A.prototype,Z.position=_,Z};i.prototype.__proto__=Error.prototype;var o=i,s=function(h,p){return h.indexOf(p)!==-1},a=function(h,p){return h===void 0?p:h},l=/([A-Z])/g,c=function(h){return h.replace(l,"-$1").toLowerCase()},u={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},d=/[&><"']/g;function m(A){return String(A).replace(d,function(h){return u[h]})}var b=function A(h){return h.type==="ordgroup"||h.type==="color"?h.body.length===1?A(h.body[0]):h:h.type==="font"?A(h.body):h},f=function(h){var p=b(h);return p.type==="mathord"||p.type==="textord"||p.type==="atom"},y=function(h){if(!h)throw new Error("Expected non-null, but got "+String(h));return h},w=function(h){var p=/^\s*([^\\/#]*?)(?::|&#0*58|&#x0*3a)/i.exec(h);return p!=null?p[1]:"_relative"},k={contains:s,deflt:a,escape:m,hyphenate:c,getBaseElem:b,isCharacterBox:f,protocolFromUrl:w},E=function(){function A(p){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,p=p||{},this.displayMode=k.deflt(p.displayMode,!1),this.output=k.deflt(p.output,"htmlAndMathml"),this.leqno=k.deflt(p.leqno,!1),this.fleqn=k.deflt(p.fleqn,!1),this.throwOnError=k.deflt(p.throwOnError,!0),this.errorColor=k.deflt(p.errorColor,"#cc0000"),this.macros=p.macros||{},this.minRuleThickness=Math.max(0,k.deflt(p.minRuleThickness,0)),this.colorIsTextColor=k.deflt(p.colorIsTextColor,!1),this.strict=k.deflt(p.strict,"warn"),this.trust=k.deflt(p.trust,!1),this.maxSize=Math.max(0,k.deflt(p.maxSize,1/0)),this.maxExpand=Math.max(0,k.deflt(p.maxExpand,1e3)),this.globalGroup=k.deflt(p.globalGroup,!1)}var h=A.prototype;return h.reportNonstrict=function(g,_,x){var T=this.strict;if(typeof T=="function"&&(T=T(g,_,x)),!(!T||T==="ignore")){if(T===!0||T==="error")throw new o("LaTeX-incompatible input and strict mode is set to 'error': "+(_+" ["+g+"]"),x);T==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(_+" ["+g+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+T+"': "+_+" ["+g+"]"))}},h.useStrictBehavior=function(g,_,x){var T=this.strict;if(typeof T=="function")try{T=T(g,_,x)}catch{T="error"}return!T||T==="ignore"?!1:T===!0||T==="error"?!0:T==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(_+" ["+g+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+T+"': "+_+" ["+g+"]")),!1)},h.isTrusted=function(g){g.url&&!g.protocol&&(g.protocol=k.protocolFromUrl(g.url));var _=typeof this.trust=="function"?this.trust(g):this.trust;return!!_},A}(),S=function(){function A(p,g,_){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=p,this.size=g,this.cramped=_}var h=A.prototype;return h.sup=function(){return Y[ne[this.id]]},h.sub=function(){return Y[$[this.id]]},h.fracNum=function(){return Y[Q[this.id]]},h.fracDen=function(){return Y[ie[this.id]]},h.cramp=function(){return Y[re[this.id]]},h.text=function(){return Y[ue[this.id]]},h.isTight=function(){return this.size>=2},A}(),D=0,R=1,L=2,q=3,H=4,U=5,F=6,j=7,Y=[new S(D,0,!1),new S(R,0,!0),new S(L,1,!1),new S(q,1,!0),new S(H,2,!1),new S(U,2,!0),new S(F,3,!1),new S(j,3,!0)],ne=[H,U,H,U,F,j,F,j],$=[U,U,U,U,j,j,j,j],Q=[L,q,H,U,F,j,F,j],ie=[q,q,U,U,j,j,j,j],re=[R,R,q,q,U,U,j,j],ue=[D,R,L,q,L,q,L,q],X={DISPLAY:Y[D],TEXT:Y[L],SCRIPT:Y[H],SCRIPTSCRIPT:Y[F]},te=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function fe(A){for(var h=0;h<te.length;h++)for(var p=te[h],g=0;g<p.blocks.length;g++){var _=p.blocks[g];if(A>=_[0]&&A<=_[1])return p.name}return null}var be=[];te.forEach(function(A){return A.blocks.forEach(function(h){return be.push.apply(be,h)})});function Ce(A){for(var h=0;h<be.length;h+=2)if(A>=be[h]&&A<=be[h+1])return!0;return!1}var qe=80,pt=function(h,p){return"M95,"+(622+h+p)+`
201
204
  c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
202
205
  c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
203
206
  c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
@@ -33,6 +33,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
33
33
  tmpHeight: number;
34
34
  lock: boolean;
35
35
  };
36
+ imgStatus: string;
36
37
  previewImg: {
37
38
  scalePercent: string;
38
39
  show: boolean;
@@ -50,6 +51,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
50
51
  updateImage(src: any): void;
51
52
  updateLock(lock: any): void;
52
53
  imgInterceptorFunc(): void;
54
+ imgLoaded(event: any): void;
55
+ imgError(): void;
53
56
  preview(mode?: string): void;
54
57
  scale(event: any, rate: any): void;
55
58
  setScale(event: any, rate: any): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@creatorsn/powereditor3",
3
3
  "private": false,
4
- "version": "0.2.1",
4
+ "version": "0.2.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -28,7 +28,7 @@
28
28
  "preview": "vite preview"
29
29
  },
30
30
  "dependencies": {
31
- "@creatorsn/vfluent3": "^0.3.68",
31
+ "@creatorsn/vfluent3": "^0.3.75",
32
32
  "@tiptap/core": "3.23.6",
33
33
  "@tiptap/extension-bubble-menu": "3.23.6",
34
34
  "@tiptap/extension-code-block": "3.23.6",