vdc-editor 0.1.271 → 0.1.272
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.
- package/lib/{BulkSpellChecker-C7Z5gYD0.mjs → BulkSpellChecker-CX2wLeM2.mjs} +2 -2
- package/lib/{BulkSpellChecker-C7Z5gYD0.mjs.map → BulkSpellChecker-CX2wLeM2.mjs.map} +1 -1
- package/lib/{index-DrFnGqHT.mjs → index-DeXtJEyW.mjs} +17 -11
- package/lib/{index-DrFnGqHT.mjs.map → index-DeXtJEyW.mjs.map} +1 -1
- package/lib/vdc-editor.mjs +1 -1
- package/lib/vdc-editor.umd.js +1 -1
- package/lib/vdc-editor.umd.js.map +1 -1
- package/package.json +1 -1
package/lib/vdc-editor.umd.js
CHANGED
|
@@ -327,7 +327,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Y=R,G=W),P===void 0&&(
|
|
|
327
327
|
3. "-" cannot repeat`);Gt.customSchemes.push([t,e])}function wK(){Gt.scanner=fK(Gt.customSchemes);for(let t=0;t<Gt.tokenQueue.length;t++)Gt.tokenQueue[t][1]({scanner:Gt.scanner});Gt.parser=mK(Gt.scanner.tokens);for(let t=0;t<Gt.pluginQueue.length;t++)Gt.pluginQueue[t][1]({scanner:Gt.scanner,parser:Gt.parser});return Gt.initialized=!0,Gt}function Bb(t){return Gt.initialized||wK(),gK(Gt.parser.start,t,w5(Gt.scanner.start,t))}Bb.scan=w5;function T5(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Mb(n),i=Bb(t),s=[];for(let a=0;a<i.length;a++){const l=i[a];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}function xK(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function CK(t){return new rt({key:new Et("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),s=e.some(c=>c.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=r,l=CO(n.doc,[...e]);if(_O(l).forEach(({newRange:c})=>{const f=Jw(r.doc,c,g=>g.isTextblock);let p,m;if(f.length>1?(p=f[0],m=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(p=f[0],m=r.doc.textBetween(p.pos,c.to,void 0," ")),p&&m){const g=m.split(" ").filter(x=>x!=="");if(g.length<=0)return!1;const b=g[g.length-1],v=p.pos+m.lastIndexOf(b);if(!b)return!1;const y=Bb(b).map(x=>x.toObject(t.defaultProtocol));if(!xK(y))return!1;y.filter(x=>x.isLink).map(x=>({...x,from:v+x.start+1,to:v+x.end+1})).filter(x=>r.schema.marks.code?!r.doc.rangeHasMark(x.from,x.to,r.schema.marks.code):!0).filter(x=>t.validate(x.value)).filter(x=>t.shouldAutoLink(x.value)).forEach(x=>{B0(x.from,x.to,r.doc).some(E=>E.mark.type===t.type)||a.addMark(x.from,x.to,t.type.create({href:x.href}))})}}),!!a.steps.length)return a}})}function EK(t){return new rt({key:new Et("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let a=r.target;const l=[];for(;a.nodeName!=="DIV";)l.push(a),a=a.parentNode;if(!l.find(m=>m.nodeName==="A"))return!1;const u=Nw(e.state,t.type.name),c=r.target,f=(i=c==null?void 0:c.href)!==null&&i!==void 0?i:u.href,p=(s=c==null?void 0:c.target)!==null&&s!==void 0?s:u.target;return c&&f?(window.open(f,p),!0):!1}}})}function kK(t){return new rt({key:new Et("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:s}=i,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const u=T5(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!u?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}const SK=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function xa(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(SK,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const _K=Hn.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){_5(t);return}_5(t.scheme,t.optionalSlashes)})},onDestroy(){yK()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!xa(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!xa(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!xa(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",yt(this.options.HTMLAttributes,t),0]:["a",yt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!xa(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!xa(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Yi({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=T5(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!xa(a,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(CK({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!xa(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(EK({type:this.type})),this.options.linkOnPaste&&t.push(kK({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),TK={class:"flex w-full max-w-sm items-center gap-1.5"},AK={class:"relative w-full max-w-sm items-center"},MK={class:"flex w-full max-w-sm items-center gap-1.5"},OK={class:"relative w-full max-w-sm items-center"},BK={class:"absolute start-0 inset-y-0 flex items-center justify-center px-2"},A5=o.defineComponent({__name:"LinkEditBlock",props:{editor:{}},emits:["onSetLink","onClickOutside"],setup(t,{emit:e}){const n=t,r=e,{t:i}=_t();let s=o.reactive({text:"",link:""});const a=o.ref(null),{focused:l}=et.useFocus(a),u=o.ref(!0),c=o.ref(null);et.onClickOutside(c,m=>r("onClickOutside",m)),o.watchEffect(()=>{const{href:m,target:g}=n.editor.getAttributes("link"),{from:b,to:v}=n.editor.state.selection,y=n.editor.state.doc.textBetween(b,v," ");s={link:m,text:y}});function f(){const m=p(s.link);r("onSetLink",m,s.text,u.value)}function p(m){if(!m)return m;const g=m.trim();return/^https?:\/\//i.test(g)||/^[a-zA-Z][a-zA-Z0-9+.\-]*:/i.test(g)?g:"http://"+g}return o.onMounted(()=>{l.value=!0}),(m,g)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"target",ref:c,class:"p-2 bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800 inside-toolbar"},[o.createElementVNode("form",{class:"flex flex-col gap-2",onSubmit:o.withModifiers(f,["prevent"])},[o.createVNode(o.unref(ac),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.link.dialog.text")),1)]),_:1}),o.createElementVNode("div",TK,[o.createElementVNode("div",AK,[o.createVNode(o.unref(fs),{modelValue:o.unref(s).text,"onUpdate:modelValue":g[0]||(g[0]=b=>o.unref(s).text=b),type:"text",required:"",placeholder:"텍스트"},null,8,["modelValue"])])]),o.createVNode(o.unref(ac),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.link.dialog.link")),1)]),_:1}),o.createElementVNode("div",MK,[o.createElementVNode("div",OK,[o.createVNode(o.unref(fs),{ref_key:"inputRef",ref:a,modelValue:o.unref(s).link,"onUpdate:modelValue":g[1]||(g[1]=b=>o.unref(s).link=b),type:"text",required:"",class:"pl-10"},null,8,["modelValue"]),o.createElementVNode("span",BK,[o.createVNode(o.unref(At),{class:"size-5 text-ed-muted-foreground",name:"Link"})])])]),o.createVNode(o.unref(gn),{class:"mt-2 self-end"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.link.dialog.button.apply")),1)]),_:1})],32)],512))}}),IK=o.defineComponent({__name:"LinkEditPopover",props:{editor:{},icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},shortcutKeys:{default:void 0},isActive:{type:Function,default:void 0},action:{type:Function,default:void 0}},setup(t){const e=t;function n(r,i,s){e.action&&e.action({link:r,text:i,openInNewTab:s})}return(r,i)=>(o.openBlock(),o.createBlock(o.unref(cs),null,{default:o.withCtx(({open:s})=>[o.createVNode(o.unref(da),{disabled:r.disabled},{default:o.withCtx(()=>[o.createVNode(Ge,{icon:r.icon,tooltip:r.tooltip,"is-active":r.isActive,"is-pressed":s,disabled:r.disabled},null,8,["icon","tooltip","is-active","is-pressed","disabled"])]),_:2},1032,["disabled"]),o.createVNode(o.unref(ds),{"as-child":"",class:"w-80",align:"start",side:"bottom"},{default:o.withCtx(()=>[o.createVNode(A5,{editor:r.editor,onOnSetLink:n},null,8,["editor"])]),_:1})]),_:1}))}}),Ib=_K.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){return["a",yt(this.options.HTMLAttributes,t,{class:"link"}),0]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),openOnClick:!0,button:({editor:e,t:n})=>({component:IK,componentProps:{action:r=>{const{link:i,text:s,openInNewTab:a}=r;e.chain().extendMarkRange("link").insertContent({type:"text",text:s,marks:[{type:"link",attrs:{href:i,target:a?"_blank":""}}]}).setLink({href:i}).focus().run()},isActive:()=>e.isActive("link")||!1,disabled:!e.can().setLink({href:""}),icon:"Link",tooltip:n("editor.link.tooltip")}})}},addProseMirrorPlugins(){return[new rt({props:{handleClick:(t,e)=>{const{schema:n,doc:r,tr:i}=t.state,s=Hd(r.resolve(e),n.marks.link);if(!s)return!1;const a=r.resolve(s.from),l=r.resolve(s.to),u=i.setSelection(new Ve(a,l));t.dispatch(u)}}})]}}),RK=Rt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",yt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:i}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):e4(n)?s.insertContentAt(i.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:a,dispatch:l})=>{var u;if(l){const{$to:c}=a.selection,f=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(Ve.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(Fe.create(a.doc,c.pos)):a.setSelection(Ve.create(a.doc,c.pos));else{const p=(u=c.parent.type.contentMatch.defaultType)===null||u===void 0?void 0:u.create();p&&(a.insert(f,p),a.setSelection(Ve.create(a.doc,f+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[o4({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}).extend({renderHTML(){return["div",yt(this.options.HTMLAttributes,{"data-type":this.name}),["hr"]]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:n})=>({component:Ge,componentProps:{action:()=>e.commands.setHorizontalRule(),disabled:!e.can().setHorizontalRule(),icon:"Minus",shortcutKeys:["mod","alt","S"],tooltip:n("editor.horizontalrule.tooltip")}})}},addKeyboardShortcuts(){return{"Mod-Alt-s":()=>this.editor.commands.setHorizontalRule()}}});var Qp=200,kn=function(){};kn.prototype.append=function(e){return e.length?(e=kn.from(e),!this.length&&e||e.length<Qp&&this.leafAppend(e)||this.length<Qp&&e.leafPrepend(this)||this.appendInner(e)):this},kn.prototype.prepend=function(e){return e.length?kn.from(e).append(this):this},kn.prototype.appendInner=function(e){return new LK(this,e)},kn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?kn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},kn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},kn.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},kn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,a){return i.push(e(s,a))},n,r),i},kn.from=function(e){return e instanceof kn?e:e&&e.length?new M5(e):kn.empty};var M5=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,a,l){for(var u=s;u<a;u++)if(i(this.values[u],l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,a,l){for(var u=s-1;u>=a;u--)if(i(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Qp)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Qp)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(kn);kn.empty=new M5([]);var LK=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.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,s,a){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(s,l),a)===!1||s>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,s)-l,a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,a){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(s,l)-l,a+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(i,l),s,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},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}(kn);const DK=500;class wo{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let a=e.tr,l,u,c=[],f=[];return this.items.forEach((p,m)=>{if(!p.step){i||(i=this.remapping(r,m+1),s=i.maps.length),s--,f.push(p);return}if(i){f.push(new Go(p.map));let g=p.step.map(i.slice(s)),b;g&&a.maybeStep(g).doc&&(b=a.mapping.maps[a.mapping.maps.length-1],c.push(new Go(b,void 0,void 0,c.length+f.length))),s--,b&&i.appendMap(b,s)}else a.maybeStep(p.step);if(p.selection)return l=i?p.selection.map(i.slice(s)):p.selection,u=new wo(this.items.slice(0,r).append(f.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:a,selection:l}}addTransform(e,n,r,i){let s=[],a=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let f=0;f<e.steps.length;f++){let p=e.steps[f].invert(e.docs[f]),m=new Go(e.mapping.maps[f],p,n),g;(g=u&&u.merge(m))&&(m=g,f?s.pop():l=l.slice(0,l.length-1)),s.push(m),n&&(a++,n=void 0),i||(u=m)}let c=a-r.depth;return c>VK&&(l=PK(l,c),a-=c),new wo(l.append(s),a)}remapping(e,n){let r=new mu;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new wo(this.items.append(e.map(n=>new Go(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},i);let u=n;this.items.forEach(m=>{let g=s.getMirror(--u);if(g==null)return;a=Math.min(a,g);let b=s.maps[g];if(m.step){let v=e.steps[g].invert(e.docs[g]),y=m.selection&&m.selection.map(s.slice(u+1,g));y&&l++,r.push(new Go(b,v,y))}else r.push(new Go(b))},i);let c=[];for(let m=n;m<a;m++)c.push(new Go(s.maps[m]));let f=this.items.slice(0,i).append(c).append(r),p=new wo(f,l);return p.emptyItemCount()>DK&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((a,l)=>{if(l>=e)i.push(a),a.selection&&s++;else if(a.step){let u=a.step.map(n.slice(r)),c=u&&u.getMap();if(r--,c&&n.appendMap(c,r),u){let f=a.selection&&a.selection.map(n.slice(r));f&&s++;let p=new Go(c.invert(),u,f),m,g=i.length-1;(m=i.length&&i[g].merge(p))?i[g]=m:i.push(p)}}else a.map&&r--},this.items.length,0),new wo(kn.from(i.reverse()),s)}}wo.empty=new wo(kn.empty,0);function PK(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class Go{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Go(n.getMap().invert(),n,this.selection)}}}class ws{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const VK=20;function FK(t,e,n,r){let i=n.getMeta(Ca),s;if(i)return i.historyState;n.getMeta(zK)&&(t=new ws(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(Ca))return a.getMeta(Ca).redo?new ws(t.done.addTransform(n,void 0,r,Np(e)),t.undone,O5(n.mapping.maps),t.prevTime,t.prevComposition):new ws(t.done,t.undone.addTransform(n,void 0,r,Np(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!a&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!$K(n,t.prevRanges)),c=a?Rb(t.prevRanges,n.mapping):O5(n.mapping.maps);return new ws(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,Np(e)),wo.empty,c,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new ws(t.done.rebased(n,s),t.undone.rebased(n,s),Rb(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new ws(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Rb(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function $K(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function O5(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,s,a)=>e.push(s,a));return e}function Rb(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function HK(t,e,n){let r=Np(e),i=Ca.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),u=new ws(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(a).setMeta(Ca,{redo:n,historyState:u})}let Lb=!1,B5=null;function Np(t){let e=t.plugins;if(B5!=e){Lb=!1,B5=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Lb=!0;break}}return Lb}const Ca=new Et("history"),zK=new Et("closeHistory");function UK(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new rt({key:Ca,state:{init(){return new ws(wo.empty,wo.empty,null,0,-1)},apply(e,n,r){return FK(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?R5:r=="historyRedo"?L5:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function I5(t,e){return(n,r)=>{let i=Ca.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=HK(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const R5=I5(!1,!0),L5=I5(!0,!0),WK=nt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>R5(t,e),redo:()=>({state:t,dispatch:e})=>L5(t,e)}},addProseMirrorPlugins(){return[UK(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()}}}),D5={HISTORY_TRANSACTION:"history$",ADD_TO_HISTORY_TRANSACTION:"addToHistory"},Db=WK.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),depth:10,button:({editor:e,t:n})=>["undo","redo"].map(i=>({component:Ge,componentProps:{action:()=>{i==="undo"&&e.commands.undo(),i==="redo"&&e.commands.redo()},shortcutKeys:i==="undo"?["mod","Z"]:["shift","mod","Z"],disabled:!e.can()[i](),icon:i==="undo"?"Undo2":"Redo2",tooltip:n(`editor.${i}.tooltip`)},buttonName:i}))}}}),{isFullscreen:Pb,toggleFullscreen:Vb}=yn(),jK=nt.create({name:"fullscreen",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:Ge,componentProps:{tooltip:Pb.value?r("editor.fullscreen.tooltip.exit"):r("editor.fullscreen.tooltip.fullscreen"),action:()=>Vb(),icon:Pb.value?"Minimize":"Maximize",isActive:()=>Pb.value}})}},addKeyboardShortcuts(){return{F11:()=>(Vb(),!0),"Mod-F11":()=>(Vb(),!0)}}}),qK=nt.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.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=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new rt({key:new Et("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const i=this.options.limit;if(i==null||i===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const a=s-i,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(l,u);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,u=s-r,c=l-u,f=l;return e.deleteRange(c,f),!(this.storage.characters({node:e.doc})>r)}})]}});function KK(t={}){return new rt({view(e){return new GK(e,t)}})}class GK{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=a=>{this[i](a)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.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),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,u=e.nodeAfter;if(l||u){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let f=c.getBoundingClientRect(),p=l?f.bottom:f.top;l&&u&&(p=(p+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:p-this.width/2,bottom:p+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let s,a;if(!i||i==document.body&&getComputedStyle(i).position=="static")s=-pageXOffset,a=-pageYOffset;else{let l=i.getBoundingClientRect();s=l.left-i.scrollLeft,a=l.top-i.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-a+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Jy(this.editorView.state.doc,a,this.editorView.dragging.slice);l!=null&&(a=l)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const XK=nt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[KK(this.options)]}}),YK=nt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new rt({key:new Et("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!n||!r)return at.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((u,c)=>{if(u.isText)return;if(!(i>=c&&i<=c+u.nodeSize-1))return!1;a+=1});let l=0;return t.descendants((u,c)=>{if(u.isText||!(i>=c&&i<=c+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(Wt.node(c,c+u.nodeSize,{class:this.options.className}))}),at.create(t,s)}}})]}});class sn extends je{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return sn.valid(r)?new sn(r):je.near(r)}content(){return Te.empty}eq(e){return e instanceof sn&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new sn(e.resolve(n.pos))}getBookmark(){return new Fb(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!JK(e)||!ZK(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&sn.valid(e))return e;let i=e.pos,s=null;for(let a=e.depth;;a--){let l=e.node(a);if(n>0?e.indexAfter(a)<l.childCount:e.index(a)>0){s=l.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=n;let u=e.doc.resolve(i);if(sn.valid(u))return u}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!Fe.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=a,i+=n;let l=e.doc.resolve(i);if(sn.valid(l))return l}return null}}}sn.prototype.visible=!1,sn.findFrom=sn.findGapCursorFrom,je.jsonID("gapcursor",sn);class Fb{constructor(e){this.pos=e}map(e){return new Fb(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return sn.valid(n)?new sn(n):je.near(n)}}function JK(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-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 ZK(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;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 QK(){return new rt({props:{decorations:nG,createSelectionBetween(t,e,n){return e.pos==n.pos&&sn.valid(n)?new sn(n):null},handleClick:eG,handleKeyDown:NK,handleDOMEvents:{beforeinput:tG}}})}const NK=v0({ArrowLeft:eh("horiz",-1),ArrowRight:eh("horiz",1),ArrowUp:eh("vert",-1),ArrowDown:eh("vert",1)});function eh(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let a=r.selection,l=e>0?a.$to:a.$from,u=a.empty;if(a instanceof Ve){if(!s.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=sn.findGapCursorFrom(l,e,u);return c?(i&&i(r.tr.setSelection(new sn(c))),!0):!1}}function eG(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!sn.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Fe.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new sn(r))),!0)}function tG(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof sn))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=ge.empty;for(let a=r.length-1;a>=0;a--)i=ge.from(r[a].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new Te(i,0,0));return s.setSelection(Ve.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function nG(t){if(!(t.selection instanceof sn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",at.create(t.doc,[Wt.widget(t.selection.head,e,{key:"gapcursor"})])}const rG=nt.create({name:"gapCursor",addProseMirrorPlugins(){return[QK()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ft(He(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),P5=Rt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",yt(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
328
328
|
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:l}=r.extensionManager,u=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:f})=>{if(f&&u&&a){const p=u.filter(m=>l.includes(m.type.name));c.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),oG=Rt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",yt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),V5=Rt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",yt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),F5=nt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new rt({key:new Et("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((a,l)=>{const u=r>=l&&r<=l+a.nodeSize,c=!a.isLeaf&&Gd(a);if((u||!this.options.showOnlyCurrent)&&c){const f=[this.options.emptyNodeClass];s&&f.push(this.options.emptyEditorClass);const p=Wt.node(l,l+a.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),at.create(t,i)}}})]}}),$5=Rt.create({name:"text",group:"inline"}),H5=Rt.create({name:"doc",topNode:!0,content:"block+"}),z5=H5.extend({content(){var e;return!!((e=this.editor)!=null&&e.options.extensions.find(n=>n.name==="columns"))?"(block|columns)+":"block+"}}),iG=nt.create({name:"selection",addProseMirrorPlugins(){const{editor:t}=this;return[new rt({key:new Et("selection"),props:{decorations(e){return e.selection.empty?null:at.create(e.doc,[Wt.inline(e.selection.from,e.selection.to,{class:"selection"})])}}})]}}),sG=t=>{const e=["size-small","size-medium","size-large"],n=["SizeS","SizeM","SizeL"];return e.map((r,i)=>({type:`video-${r}`,component:Ge,componentProps:{tooltip:`editor.${r.replace("-",".")}.tooltip`,icon:n[i],action:()=>t.commands.updateVideo({width:of[r]}),isActive:()=>t.isActive("video",{width:of[r]})}}))},aG=t=>[...sG(t),{type:"remove",component:Ge,componentProps:{tooltip:"editor.remove",icon:"Trash2",action:()=>{const{state:e,dispatch:n}=t.view;el(e,n)}}}],lG=(t,e,{editor:n,extension:r,t:i})=>{const{extensions:s=[]}=n.extensionManager,a={};for(const l of Object.keys(t)){const u=t[l];if(!u)continue;const c=[];for(const m of u){if(m==="divider"){const v=c[c.length-1];if((v==null?void 0:v.type)==="divider")continue;c.push({type:"divider",component:void 0,componentProps:{}});continue}const g=e.find(v=>v.type===m);if(g){c.push({...g,componentProps:{...g.componentProps,tooltip:g.componentProps.tooltip?i(g.componentProps.tooltip):void 0},componentSlots:g.componentSlots});continue}const b=s.find(v=>v.name===m);if(b){const{button:v}=b.options,y=v({editor:n,extension:b,t:i});c.push({type:m,component:y.component,componentProps:y.componentProps,componentSlots:y.componentSlots});continue}}const f=c[c.length-1],p=c[0];(f==null?void 0:f.type)==="divider"&&c.pop(),(p==null?void 0:p.type)==="divider"&&c.shift(),a[l]=c}return a},uG=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),cG=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var $b;const dG=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),fG=($b=String.fromCodePoint)!==null&&$b!==void 0?$b:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function pG(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=dG.get(t))!==null&&e!==void 0?e:t}var Sn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Sn||(Sn={}));const hG=32;var xs;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(xs||(xs={}));function Hb(t){return t>=Sn.ZERO&&t<=Sn.NINE}function mG(t){return t>=Sn.UPPER_A&&t<=Sn.UPPER_F||t>=Sn.LOWER_A&&t<=Sn.LOWER_F}function gG(t){return t>=Sn.UPPER_A&&t<=Sn.UPPER_Z||t>=Sn.LOWER_A&&t<=Sn.LOWER_Z||Hb(t)}function bG(t){return t===Sn.EQUALS||gG(t)}var _n;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(_n||(_n={}));var Cs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Cs||(Cs={}));class vG{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=_n.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Cs.Strict}startEntity(e){this.decodeMode=e,this.state=_n.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case _n.EntityStart:return e.charCodeAt(n)===Sn.NUM?(this.state=_n.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=_n.NamedEntity,this.stateNamedEntity(e,n));case _n.NumericStart:return this.stateNumericStart(e,n);case _n.NumericDecimal:return this.stateNumericDecimal(e,n);case _n.NumericHex:return this.stateNumericHex(e,n);case _n.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|hG)===Sn.LOWER_X?(this.state=_n.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=_n.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Hb(i)||mG(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(Hb(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Sn.SEMI)this.consumed+=1;else if(this.decodeMode===Cs.Strict)return 0;return this.emitCodePoint(pG(this.result),this.consumed),this.errors&&(e!==Sn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&xs.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=yG(r,i,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===Cs.Attribute&&(s===0||bG(a))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&xs.VALUE_LENGTH)>>14,s!==0){if(a===Sn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Cs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&xs.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~xs.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case _n.NamedEntity:return this.result!==0&&(this.decodeMode!==Cs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case _n.NumericDecimal:return this.emitNumericEntity(0,2);case _n.NumericHex:return this.emitNumericEntity(0,3);case _n.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case _n.EntityStart:return 0}}}function U5(t){let e="";const n=new vG(t,r=>e+=fG(r));return function(i,s){let a=0,l=0;for(;(l=i.indexOf("&",l))>=0;){e+=i.slice(a,l),n.startEntity(s);const c=n.write(i,l+1);if(c<0){a=l+n.end();break}a=l+c,l=c===0?a+1:a}const u=e+i.slice(a);return e="",u}}function yG(t,e,n,r){const i=(e&xs.BRANCH_LENGTH)>>7,s=e&xs.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=i?-1:t[n+u]-1}let a=n,l=a+i-1;for(;a<=l;){const u=a+l>>>1,c=t[u];if(c<r)a=u+1;else if(c>r)l=u-1;else return t[u+i]}return-1}const wG=U5(uG);U5(cG);function xG(t,e=Cs.Legacy){return wG(t,e)}var tn;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(tn||(tn={}));var Jr;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})(Jr||(Jr={}));const W5=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,CG=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,EG=new Map([[126,Jr.Element],[94,Jr.Start],[36,Jr.End],[42,Jr.Any],[33,Jr.Not],[124,Jr.Hyphen]]),kG=new Set(["has","not","matches","is","where","host","host-context"]);function SG(t){switch(t.type){case tn.Adjacent:case tn.Child:case tn.Descendant:case tn.Parent:case tn.Sibling:case tn.ColumnCombinator:return!0;default:return!1}}const _G=new Set(["contains","icontains"]);function TG(t,e,n){const r=parseInt(e,16)-65536;return r!==r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)}function Ic(t){return t.replace(CG,TG)}function zb(t){return t===39||t===34}function j5(t){return t===32||t===9||t===10||t===12||t===13}function AG(t){const e=[],n=q5(e,`${t}`,0);if(n<t.length)throw new Error(`Unmatched selector: ${t.slice(n)}`);return e}function q5(t,e,n){let r=[];function i(m){const g=e.slice(n+m).match(W5);if(!g)throw new Error(`Expected name, found ${e.slice(n)}`);const[b]=g;return n+=m+b.length,Ic(b)}function s(m){for(n+=m;n<e.length&&j5(e.charCodeAt(n));)n++}function a(){n+=1;const m=n;let g=1;for(;g>0&&n<e.length;n++)e.charCodeAt(n)===40&&!l(n)?g++:e.charCodeAt(n)===41&&!l(n)&&g--;if(g)throw new Error("Parenthesis not matched");return Ic(e.slice(m,n-1))}function l(m){let g=0;for(;e.charCodeAt(--m)===92;)g++;return(g&1)===1}function u(){if(r.length>0&&SG(r[r.length-1]))throw new Error("Did not expect successive traversals.")}function c(m){if(r.length>0&&r[r.length-1].type===tn.Descendant){r[r.length-1].type=m;return}u(),r.push({type:m})}function f(m,g){r.push({type:tn.Attribute,name:m,action:g,value:i(1),namespace:null,ignoreCase:"quirks"})}function p(){if(r.length&&r[r.length-1].type===tn.Descendant&&r.pop(),r.length===0)throw new Error("Empty sub-selector");t.push(r)}if(s(0),e.length===n)return n;e:for(;n<e.length;){const m=e.charCodeAt(n);switch(m){case 32:case 9:case 10:case 12:case 13:{(r.length===0||r[0].type!==tn.Descendant)&&(u(),r.push({type:tn.Descendant})),s(1);break}case 62:{c(tn.Child),s(1);break}case 60:{c(tn.Parent),s(1);break}case 126:{c(tn.Sibling),s(1);break}case 43:{c(tn.Adjacent),s(1);break}case 46:{f("class",Jr.Element);break}case 35:{f("id",Jr.Equals);break}case 91:{s(1);let g,b=null;e.charCodeAt(n)===124?g=i(1):e.startsWith("*|",n)?(b="*",g=i(2)):(g=i(0),e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==61&&(b=g,g=i(1))),s(0);let v=Jr.Exists;const y=EG.get(e.charCodeAt(n));if(y){if(v=y,e.charCodeAt(n+1)!==61)throw new Error("Expected `=`");s(2)}else e.charCodeAt(n)===61&&(v=Jr.Equals,s(1));let x="",E=null;if(v!=="exists"){if(zb(e.charCodeAt(n))){const _=e.charCodeAt(n);let T=n+1;for(;T<e.length&&(e.charCodeAt(T)!==_||l(T));)T+=1;if(e.charCodeAt(T)!==_)throw new Error("Attribute value didn't end");x=Ic(e.slice(n+1,T)),n=T+1}else{const _=n;for(;n<e.length&&(!j5(e.charCodeAt(n))&&e.charCodeAt(n)!==93||l(n));)n+=1;x=Ic(e.slice(_,n))}s(0);const C=e.charCodeAt(n)|32;C===115?(E=!1,s(1)):C===105&&(E=!0,s(1))}if(e.charCodeAt(n)!==93)throw new Error("Attribute selector didn't terminate");n+=1;const k={type:tn.Attribute,name:g,action:v,value:x,namespace:b,ignoreCase:E};r.push(k);break}case 58:{if(e.charCodeAt(n+1)===58){r.push({type:tn.PseudoElement,name:i(2).toLowerCase(),data:e.charCodeAt(n)===40?a():null});continue}const g=i(1).toLowerCase();let b=null;if(e.charCodeAt(n)===40)if(kG.has(g)){if(zb(e.charCodeAt(n+1)))throw new Error(`Pseudo-selector ${g} cannot be quoted`);if(b=[],n=q5(b,e,n+1),e.charCodeAt(n)!==41)throw new Error(`Missing closing parenthesis in :${g} (${e})`);n+=1}else{if(b=a(),_G.has(g)){const v=b.charCodeAt(0);v===b.charCodeAt(b.length-1)&&zb(v)&&(b=b.slice(1,-1))}b=Ic(b)}r.push({type:tn.Pseudo,name:g,data:b});break}case 44:{p(),r=[],s(1);break}default:{if(e.startsWith("/*",n)){const v=e.indexOf("*/",n+2);if(v<0)throw new Error("Comment was not terminated");n=v+2,r.length===0&&s(0);break}let g=null,b;if(m===42)n+=1,b="*";else if(m===124){if(b="",e.charCodeAt(n+1)===124){c(tn.ColumnCombinator),s(2);break}}else if(W5.test(e.slice(n)))b=i(0);else break e;e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==124&&(g=b,e.charCodeAt(n+1)===42?(b="*",n+=2):b=i(1)),r.push(b==="*"?{type:tn.Universal,namespace:g}:{type:tn.Tag,name:b,namespace:g})}}}return p(),n}function Ub(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\xA0/g," ").replace(/\xAD/g,"­")}var K5=t=>xG(t);function MG(t,e,n,r){if(typeof e=="function")return e({props:{...n,children:r},attrs:n,children:r,h:t.h,context:t});{let i=!0,s;if(e?e.toLowerCase()==="fragment"?(s=t.document.createDocumentFragment(),i=!1):s=t.document.createElement(e):s=t.document.createElement("div"),n&&i){const a=s;for(let[l,u]of Object.entries(n)){l=l.toString();const c=l.toLowerCase();c==="classname"?a.className=u:c==="on"?Object.entries(u).forEach(([f,p])=>{a.setAttribute(`on${f}`,String(p))}):u!==!1&&u!=null&&(u===!0?a.setAttribute(l,l):a.setAttribute(l,u.toString()))}}if(r)for(const a of r){const l=Array.isArray(a)?[...a]:[a];for(const u of l)u&&u!==!1&&u!=null&&(typeof u!="object"?s.appendChild(t.document.createTextNode(u.toString())):s.appendChild(u))}return s}}function G5(t,e,...n){return typeof t=="object"&&(t="fragment",n=t.children,e=t.attrs),Array.isArray(e)?(n=[e],e={}):e?e.attrs&&(e={...e.attrs,...e},delete e.attrs):e={},{tag:t,attrs:e,children:typeof n[0]=="string"?n:n.flat(Number.POSITIVE_INFINITY)}}function OG(t){return t.h=function(n,r,...i){const{tag:s,attrs:a,children:l}=G5(n,r,i);return MG(t,s,a,l)},t.h}var X5={};function BG(t){let e=X5[t];return e==null&&(e=AG(t),X5[t]=e),e}function IG(t,e,{debug:n=!1}={}){for(const r of BG(t)){const i=(s,a)=>{var u,c,f,p;let l=!1;for(const m of a){const{type:g,name:b,action:v,value:y,_ignoreCase:x=!0,data:E}=m;if(g==="attribute")v==="equals"?l=s.getAttribute(b)===y:v==="start"?l=!!((u=s.getAttribute(b))!=null&&u.startsWith(y)):v==="end"?l=!!((c=s.getAttribute(b))!=null&&c.endsWith(y)):v==="element"?b==="class"?l=s.classList.contains(y):l=!!((f=s.getAttribute(b))!=null&&f.includes(y)):v==="exists"?l=s.hasAttribute(b):v==="any"?l=!!((p=s.getAttribute(b))!=null&&p.includes(y)):console.warn("Unknown CSS selector action",v);else if(g==="tag")l=s.tagName===b.toUpperCase();else if(g==="universal")l=!0;else if(g==="pseudo"){if(b==="not"){let k=!0;E.forEach(C=>{i(s,C)||(k=!1)}),l=!k}}else console.warn("Unknown CSS selector type",g,t,a);if(!l)break}return l};if(i(e,r))return!0}return!1}var RG=Symbol.for("nodejs.util.inspect.custom"),Y5={fontWeight:"bold"},J5={fontStyle:"italic"},Z5={backgroundColor:"rgb(255, 250, 165)"},Q5={textDecorations:"underline"},Wb={textDecorations:"line-through"},LG={b:Y5,strong:Y5,em:J5,i:J5,mark:Z5,u:Q5,a:Q5,s:Wb,del:Wb,ins:Z5,strike:Wb};function N5(t){return t.toLowerCase().replace(/[^a-z0-9]+(.)/gi,(e,n)=>n.toUpperCase())}var Ei=class Em{constructor(){this.append=this.appendChild,this._parentNode=null,this._childNodes=[]}get nodeType(){return console.error("Subclasses should define nodeType!"),0}get nodeName(){return console.error("Subclasses should define nodeName!"),""}get nodeValue(){return null}cloneNode(e=!1){const n=new this.constructor;return e&&(n._childNodes=this._childNodes.map(r=>r.cloneNode(!0)),n._fixChildNodesParent()),n}_fixChildNodesParent(){this._childNodes.forEach(e=>e._parentNode=this)}insertBefore(e,n){if(e!==n){let r=n?this._childNodes.indexOf(n):0;r<0&&(r=0),this._childNodes.splice(r,0,e),this._fixChildNodesParent()}}appendChild(e){if(e!=null){if(e===this){console.warn("Cannot appendChild to self");return}if(e instanceof qb&&console.warn("No defined how to append a document to a node!",e),e instanceof jb)for(const n of[...e._childNodes])this.appendChild(n);else if(Array.isArray(e))for(const n of[...e])this.appendChild(n);else if(e instanceof Em)e.remove(),this._childNodes.push(e);else try{const n=typeof e=="string"?e:JSON.stringify(e,null,2);this._childNodes.push(new Fl(n))}catch(n){console.error(`The data ${e} to be added to ${this.render()} is problematic: ${n}`)}this._fixChildNodesParent()}}removeChild(e){const n=this._childNodes.indexOf(e);n>=0&&(e._parentNode=null,this._childNodes.splice(n,1),this._fixChildNodesParent())}remove(){var e;return(e=this==null?void 0:this.parentNode)==null||e.removeChild(this),this}replaceChildren(...e){this._childNodes=e.map(n=>typeof n=="string"?new Fl(n):n.remove()),this._fixChildNodesParent()}replaceWith(...e){const n=this._parentNode;if(n){const r=this._indexInParent();r>=0&&(e=e.map(i=>typeof i=="string"?new Fl(i):i.remove()),n._childNodes.splice(r,1,...e),this._parentNode=null,n._fixChildNodesParent())}}_indexInParent(){return this._parentNode?this._parentNode.childNodes.indexOf(this):-1}get parentNode(){return this._parentNode}get childNodes(){return this._childNodes||[]}get children(){return this._childNodes||[]}get firstChild(){return this._childNodes[0]}get lastChild(){return this._childNodes[this._childNodes.length-1]}get nextSibling(){const e=this._indexInParent();return e!=null&&this.parentNode.childNodes[e+1]||null}get previousSibling(){const e=this._indexInParent();return e>0&&this.parentNode.childNodes[e-1]||null}flatten(){const e=[];this instanceof xo&&e.push(this);for(const n of this._childNodes)e.push(...n.flatten());return e}flattenNodes(){const e=[];e.push(this);for(const n of this._childNodes)e.push(...n.flattenNodes());return e}render(){return""}get textContent(){return this._childNodes.map(e=>e.textContent).join("")}set textContent(e){this._childNodes=[],e&&this.appendChild(new Fl(e.toString()))}contains(e){return e===this?!0:this._childNodes.some(n=>n.contains(e))}get ownerDocument(){var e;return this.nodeType===Em.DOCUMENT_NODE||this.nodeType===Em.DOCUMENT_FRAGMENT_NODE?this:(e=this==null?void 0:this._parentNode)==null?void 0:e.ownerDocument}toString(){return`${this.nodeName}`}[RG](){return`${this.constructor.name} "${this.render()}"`}};Ei.ELEMENT_NODE=1,Ei.TEXT_NODE=3,Ei.CDATA_SECTION_NODE=4,Ei.PROCESSING_INSTRUCTION_NODE=7,Ei.COMMENT_NODE=8,Ei.DOCUMENT_NODE=9,Ei.DOCUMENT_TYPE_NODE=10,Ei.DOCUMENT_FRAGMENT_NODE=11;var Es=Ei,Fl=class extends Es{get nodeType(){return Es.TEXT_NODE}get nodeName(){return"#text"}get nodeValue(){return this._text||""}get textContent(){return this.nodeValue}constructor(t=""){super(),this._text=t}render(){var e;const t=(e=this.parentNode)==null?void 0:e.tagName;return t==="SCRIPT"||t==="STYLE"?this._text:Ub(this._text)}cloneNode(t=!1){const e=super.cloneNode(t);return e._text=this._text,e}},eE=class extends Es{getElementById(t){return this.flatten().find(e=>e._attributes.id===t)}getElementsByClassName(t){return this.flatten().filter(e=>e.classList.contains(t))}matches(t){return IG(t,this)}querySelectorAll(t){return this.flatten().filter(e=>e.matches(t))}querySelector(t){return this.flatten().find(e=>e.matches(t))}parent(t){var e;return this.matches(t)?this:this.parentNode==null?null:(e=this.parentNode)==null?void 0:e.parent(t)}handle(t,e){let n=0;for(const r of this.querySelectorAll(t))e(r,n++)}},xo=class extends eE{get nodeType(){return Es.ELEMENT_NODE}get nodeName(){return this._nodeName}constructor(t="div",e={}){super(),this._originalTagName=t,this._nodeName=(t||"").toUpperCase(),this._attributes=e||{}}cloneNode(t=!1){const e=super.cloneNode(t);return e._originalTagName=this._originalTagName,e._nodeName=this._nodeName,e._attributes=Object.assign({},this._attributes),e}get attributes(){return Object.entries(this._attributes).map(([t,e])=>({name:t,value:e}))}get attributesObject(){return{...this._attributes}}_findAttributeName(t){const e=t.toLowerCase();return Object.keys(this._attributes).find(n=>e===n.toLowerCase())||null}setAttribute(t,e){this.removeAttribute(t),this._attributes[t]=e,this._styles=void 0,this._dataset=void 0}getAttribute(t){const e=this._findAttributeName(t),n=e?this._attributes[e]:null;return n==null?null:typeof n=="string"?n:""}removeAttribute(t){this._findAttributeName(String(t))&&delete this._attributes[t]}hasAttribute(t){const e=this._findAttributeName(t);return e?this._attributes[e]!=null:!1}get style(){if(this._styles==null){const t={};let e=0;const n=this.getAttribute("style");if(n){let r;const i=/\s*([\w-]+)\s*:\s*((url\(.*?\)[^;]*|[^;]+))/gi;for(;r=i.exec(n);){++e;const s=r[1],a=r[2].trim();t[s]=a,t[N5(s)]=a}}this._styles={get length(){return e},getPropertyValue(r){return t[r]},...LG[this.tagName.toLowerCase()],...t}}return this._styles}get dataset(){if(this._dataset==null){const t={};for(const[e,n]of Object.entries(this._attributes))e.startsWith("data-")&&(t[e.slice(5)]=n,t[N5(e.slice(5))]=n);this._dataset=t}return this._dataset}get tagName(){return this._nodeName}setTagName(t){this._nodeName=t.toUpperCase()}get id(){return this._attributes.id||null}set id(t){t==null?delete this._attributes.id:this._attributes.id=t}get src(){return this._attributes.src}set src(t){t==null?delete this._attributes.src:this._attributes.src=t}getElementsByTagName(t){t=t.toUpperCase();const e=this.flatten();return t!=="*"?e.filter(n=>n.tagName===t):e}setInnerHTML(t){}get innerHTML(){return this._childNodes.map(t=>t.render(th)).join("")}set innerHTML(t){this.setInnerHTML(t)}get outerHTML(){return this.render(nh)}get className(){return this._attributes.class||""}set className(t){Array.isArray(t)?t=t.filter(e=>!!e).join(" "):typeof t=="object"&&(t=Object.entries(t).filter(([e,n])=>!!n).map(([e,n])=>e).join(" ")),this._attributes.class=t}get classList(){const t=String(this.className??"").trim().split(/\s+/g)||[];return{contains(e){return t.includes(e)},add:e=>{t.includes(e)||(t.push(e),this.className=t)},remove:e=>{const n=t.indexOf(e);n>=0&&(t.splice(n,1),this.className=t)}}}render(t=nh){return t(this._originalTagName||this.tagName,this._attributes,this._childNodes.map(e=>e.render(t)).join(""))}},tE=class I9 extends Es{get nodeName(){return super.nodeName}get nodeValue(){return super.nodeValue}get nodeType(){return I9.DOCUMENT_TYPE_NODE}render(){return"<!DOCTYPE html>"}},jb=class R9 extends eE{get nodeType(){return Es.DOCUMENT_FRAGMENT_NODE}get nodeName(){return"#document-fragment"}render(e=nh){return this._childNodes.map(n=>n.render(e)||[]).join("")}get innerHTML(){return this._childNodes.map(e=>e.render(th)).join("")}createElement(e,n={}){return new xo(e,n)}createDocumentFragment(){return new R9}createTextNode(e){return new Fl(e)}},qb=class extends jb{get nodeType(){return Es.DOCUMENT_NODE}get nodeName(){return"#document"}get documentElement(){return this.firstChild}render(t=nh){let e=super.render(t);return this.docType&&(e=this.docType.render()+e),e}},nE=class extends qb{constructor(t=!1){if(super(),this.docType=new tE,!t){const e=new xo("html"),n=new xo("body"),r=new xo("head"),i=new xo("title");e.appendChild(r),r.appendChild(i),e.appendChild(n),this.appendChild(e)}}get body(){let t=this.querySelector("body");if(!t){let e=this.querySelector("html");e||(e=new xo("html"),this.appendChild(e)),t=new xo("body"),e.appendChild(e)}return t}get title(){var t;return((t=this.querySelector("title"))==null?void 0:t.textContent)||""}set title(t){const e=this.querySelector("title");e&&(e.textContent=t)}get head(){let t=this.querySelector("head");if(!t){let e=this.querySelector("html");e||(e=new xo("html"),this.appendChild(e)),t=new xo("head"),e.insertBefore(e)}return t}};function DG(){return new qb}function PG(){return new nE}var rE=DG();OG({document:rE});var VG={},FG=VG.hasOwnProperty;function oE(t,e){return FG.call(t,e)}var iE=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","command"];function sE(t,e,n={},r){const i=!(typeof r=="string"&&r===""||Array.isArray(r)&&(r.length===0||r.length===1&&r[0]==="")||r==null),s=[];if(e=e.replace(/__/g,":"),e!=="noop"&&e!==""){e!=="cdata"?s.push(`<${e}`):s.push("<![CDATA[");for(let a in n)if(a&&oE(n,a)){const l=n[a];if(a==="html")continue;a.toLowerCase()==="classname"&&(a="class"),a=a.replace(/__/g,":"),l===!0?s.push(` ${a}`):a==="style"&&typeof l=="object"?s.push(` ${a}="${Object.keys(l).filter(u=>l[u]!=null).map(u=>{let c=l[u];return c=typeof c=="number"?`${c}px`:c,`${u.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${c}`}).join(";")}"`):l!==!1&&l!=null&&s.push(` ${a}="${Ub(l.toString())}"`)}if(e!=="cdata"){if(t&&!i)return s.push(" />"),s.join("");s.push(">")}if(!t&&iE.includes(e))return s.join("")}if(i){if(typeof r=="string")s.push(r);else if(r&&r.length>0){for(let a of r)if(a!=null&&a!==!1){Array.isArray(a)||(a=[a]);for(const l of a)l.startsWith("<")&&l.endsWith(">")||e==="script"||e==="style"?s.push(l):s.push(Ub(l.toString()))}}}return n.html&&s.push(n.html),e!=="noop"&&e!==""&&(e!=="cdata"?s.push(`</${e}>`):s.push("]]>")),s.join("")}function th(t,e,...n){const{tag:r,attrs:i,children:s}=G5(t,e,n);return sE(!1,r,i,s)}var nh=sE.bind(null,!1);th.firstLine="<!DOCTYPE html>",th.html=!0;var $G=/([^=\s]+)(\s*=\s*(("([^"]*)")|('([^']*)')|[^>\s]+))?/g,HG=/^<\/([^>\s]+)[^>]*>/m,zG=/^<([^>\s/]+)((\s+[^=>\s]+(\s*=\s*(("[^"]*")|('[^']*')|[^>\s]+))?)*)\s*(?:\/\s*)?>/m,UG=/\s*\/\s*>\s*$/m,WG=class{constructor(t={}){this.attrRe=$G,this.endTagRe=HG,this.startTagRe=zG,this.defaults={ignoreWhitespaceText:!1},t.scanner&&(this.scanner=t.scanner),this.options=Object.assign({},this.defaults,t)}parse(t){let e=!1,n,r,i;for(;t.length;){if(t.substring(0,4)==="<!--")n=t.indexOf("-->"),n!==-1?(this.scanner.comment(t.substring(4,n)),t=t.substring(n+3),e=!1):e=!0;else if(t.substring(0,2)==="</")r=this.endTagRe.exec(t),r?(t=RegExp.rightContext,e=!1,this.parseEndTag(RegExp.lastMatch,r[1])):e=!0;else if(t.charAt(0)==="<")if(r=this.startTagRe.exec(t),r){t=RegExp.rightContext,e=!1;const s=this.parseStartTag(RegExp.lastMatch,r[1],r);(s==="script"||s==="style")&&(n=t.search(new RegExp(`</${s}`,"i")),n!==-1?(this.scanner.characters(t.substring(0,n)),t=t.substring(n),e=!1):e=!0)}else e=!0;if(e){n=t.indexOf("<");let s=n;n===0&&(n=t.substring(1).indexOf("<"),s=s+1),n===-1?(i=t,t=""):(i=t.substring(0,s),t=t.substring(s)),(!this.options.ignoreWhitespaceText||!/^\s*$/.test(i))&&this.scanner.characters(i)}e=!0,r=null}}parseStartTag(t,e,n){const r=UG.test(t);let i=n[2];r&&(i=i.replace(/\s*\/\s*$/,""));const s=this.parseAttributes(e,i);return this.scanner.startElement(e,s,r,n[0]),e.toLocaleLowerCase()}parseEndTag(t,e){this.scanner.endElement(e)}parseAttributes(t,e){const n={};return e.replace(this.attrRe,(...r)=>{const[i,s,a,l,u,c,f,p]=r;n[s]=p??c??l??!0}),n}};function jG(t){if(typeof t!="string")throw console.error("parseHTML requires string, found",t),new Error("parseHTML requires string");const e=t.indexOf("<!")===0?new nE(!0):new jb,n=[e];return new WG({scanner:{startElement(i,s,a){if(i.toLowerCase()==="!doctype"){e.docType=new tE;return}for(const c in s)if(oE(s,c)){const f=s[c];typeof f=="string"&&(s[c]=K5(f))}const u=n[n.length-1];if(u){const c=rE.createElement(i,s);u.appendChild(c),iE.includes(i.toLowerCase())||a||n.push(c)}},endElement(i){n.pop()},characters(i){var a;i=K5(i);const s=n[n.length-1];((a=s==null?void 0:s.lastChild)==null?void 0:a.nodeType)===Es.TEXT_NODE?s.lastChild._text+=i:s&&s.appendChild(new Fl(i))},comment(i){}}}).parse(t),e}xo.prototype.setInnerHTML=function(t){const e=jG(t);this._childNodes=e._childNodes,this._fixChildNodesParent()};function qG(t,e,n){return Dr.fromSchema(e).serializeFragment(t.content,{document:PG()}).render()}function KG(t,e){const n=Lr.fromJSON(e,t);return qG(n,e)}function GG(t,e){const n=document.getElementById(t.attrs.id)??Kb.getElementById(t.attrs.id);if(!n)return null;const r=aE(n),{lastChild:i}=t,{childCount:s}=t,a=t.content.content.slice(0,s);if(!i)return!1;i.isText&&a.push(e.text("gg"));const l=KG(XG(t.type.create(t.attrs,a,t.marks)),e);return JG(l,t.attrs.id,!1)>r}function XG(t){return{type:"doc",content:[t.toJSON()]}}let YG=null,Kb=null;const Gb=new Map;function JG(t,e,n=!0){if(n&&Gb.has(t))return Gb.get(t);const r=Kb.getElementById("computeddiv");if(r){r.innerHTML=`<p> </p>${t}`;const i=Kb.getElementById(e),{height:s}=aE(i);return r.innerHTML=" ",n&&Gb.set(t,s),s}return 0}function aE(t){const e=window.getComputedStyle(t)||YG.contentWindow.getComputedStyle(t),n=e.getPropertyValue("margin-top"),r=e.getPropertyValue("margin-bottom"),i=parseFloat(n)+parseFloat(r),{height:s}=t.getBoundingClientRect();return{margin:i,height:i+t.offsetHeight+parseFloat(e.borderWidth)}}function Xb(){return Gr(10)}const Yb=o.defineComponent({__name:"ContextMenu",props:{dir:{},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const i=Lt(t,e);return(s,a)=>(o.openBlock(),o.createBlock(o.unref(zD),o.normalizeProps(o.guardReactiveProps(o.unref(i))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),Jb=o.defineComponent({__name:"ContextMenuContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},sticky:{},hideWhenDetached:{type:Boolean},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,i=o.computed(()=>{const{class:a,...l}=n;return l}),s=Lt(i,r);return(a,l)=>(o.openBlock(),o.createBlock(o.unref(WD),null,{default:o.withCtx(()=>[o.createVNode(o.unref(jD),o.mergeProps(o.unref(s),{class:o.unref(Se)("z-50 min-w-32 overflow-hidden rounded-md border bg-ed-popover p-1 text-ed-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Zb=o.defineComponent({__name:"ContextMenuItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,i=o.computed(()=>{const{class:a,...l}=n;return l}),s=Lt(i,r);return(a,l)=>(o.openBlock(),o.createBlock(o.unref(qD),o.mergeProps(o.unref(s),{class:o.unref(Se)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-ed-accent focus:text-ed-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n.inset&&"pl-8",n.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Qb=o.defineComponent({__name:"ContextMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const n=Qn(t);return(r,i)=>(o.openBlock(),o.createBlock(o.unref(UD),o.normalizeProps(o.guardReactiveProps(o.unref(n))),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16))}}),Rc=o.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const i=Lt(t,e);return(s,a)=>(o.openBlock(),o.createBlock(o.unref(BL),o.normalizeProps(o.guardReactiveProps(o.unref(i))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),Lc=o.defineComponent({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{},isOverlayTransparent:{type:Boolean}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,i=o.computed(()=>{const{isOverlayTransparent:a,class:l,...u}=n;return u}),s=Lt(i,r);return(a,l)=>(o.openBlock(),o.createBlock(o.unref(I1),null,{default:o.withCtx(()=>[o.createVNode(o.unref(F1),{class:o.normalizeClass(o.unref(Se)("fixed inset-0 z-[60] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a.isOverlayTransparent&&"bg-transparent"))},null,8,["class"]),o.createVNode(o.unref(eD),o.mergeProps(o.unref(s),{class:o.unref(Se)("fixed left-1/2 top-1/2 z-[60] grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-ed-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Nb=o.defineComponent({__name:"DialogFooter",props:{class:{}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(Se)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),rh=o.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=o.computed(()=>{const{class:i,...s}=e;return s}),r=Qn(n);return(i,s)=>(o.openBlock(),o.createBlock(o.unref(oD),o.mergeProps(o.unref(r),{class:o.unref(Se)("text-sm text-ed-muted-foreground",e.class)}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default")]),_:3},16,["class"]))}}),oh=o.defineComponent({__name:"DialogHeader",props:{class:{}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(Se)("flex flex-col gap-y-1.5 text-center sm:text-left",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),ih=o.defineComponent({__name:"DialogClose",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(o.openBlock(),o.createBlock(o.unref(nD),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),sh=o.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=o.computed(()=>{const{class:i,...s}=e;return s}),r=Qn(n);return(i,s)=>(o.openBlock(),o.createBlock(o.unref(rD),o.mergeProps(o.unref(r),{class:o.unref(Se)("text-lg font-semibold leading-none tracking-tight",e.class)}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default")]),_:3},16,["class"]))}}),ZG={class:"sr-only"},QG={class:"m-2.5 p-2.5 space-y-2.5 flex items-center gap-x-2"},NG=o.defineComponent({__name:"SuperInputDialogAlert",props:{open:{type:Boolean},title:{default:"확인"},message:{default:""},confirmText:{default:"확인"},closeText:{default:"Close"},iconName:{default:void 0}},emits:["close"],setup(t,{emit:e}){const n=t,r=e,{t:i}=_t(),s=yn(),a=o.computed(()=>n.message||i(s.textAlert.value||"editor.alert")),l=o.reactive({x:0,y:0}),u=o.ref(!1),c={x:0,y:0},f=()=>{r("close")},p=b=>{u.value=!0,c.x=b.clientX-l.x,c.y=b.clientY-l.y,document.addEventListener("mousemove",m),document.addEventListener("mouseup",g)},m=b=>{u.value&&(l.x=b.clientX-c.x,l.y=b.clientY-c.y)},g=()=>{u.value=!1,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)};return o.watch(()=>n.open,async b=>{if(b){await o.nextTick();const v=document.querySelector(".draggable-dialog");if(v){const{width:y,height:x}=v.getBoundingClientRect(),E=window.innerWidth,k=window.innerHeight;l.x=(E-y)/2+250,l.y=(k-x)/2-50}}},{immediate:!0}),o.onUnmounted(()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)}),(b,v)=>{const y=sh,x=ih,E=oh,k=rh,C=Nb,_=Lc,T=Rc;return o.openBlock(),o.createBlock(T,{open:b.open},{default:o.withCtx(()=>[o.createVNode(o.unref(I1),null,{default:o.withCtx(()=>[o.createVNode(o.unref(F1),{class:"!pointer-events-none bg-black/30"}),o.createVNode(_,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none","as-child":"",onOpenAutoFocus:v[0]||(v[0]=A=>{A.preventDefault()})},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:o.normalizeStyle({transform:`translate(${o.unref(l).x}px, ${o.unref(l).y}px)`,top:"0px",left:"0px"})},[o.createVNode(E,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:o.withModifiers(p,["prevent"])},{default:o.withCtx(()=>[o.createVNode(y,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.title),1)]),_:1}),o.createVNode(x,{class:"absolute right-3 top-3 text-white",onClick:f},{default:o.withCtx(()=>[o.createVNode(o.unref(xc),{class:"w-5 h-5"}),o.createElementVNode("span",ZG,o.toDisplayString(n.closeText),1)]),_:1})]),_:1}),o.createVNode(k),o.createElementVNode("div",QG,[b.iconName?(o.openBlock(),o.createBlock(o.unref(At),{key:0,name:b.iconName,class:"w-8 h-8 text-blue-500"},null,8,["name"])):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(o.unref(a)),1)]),o.createVNode(C,{class:"sm:justify-center pb-3.5 pt-1"},{default:o.withCtx(()=>[o.createVNode(gn,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:f},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.confirmText),1)]),_:1})]),_:1})],4)]),_:1})]),_:1})]),_:1},8,["open"])}}}),lE=nt.create({name:"invalidCharFocus",addOptions(){return{invalidChars:["{","}"]}},addCommands(){return{focusInvalidChar:()=>({state:t,dispatch:e,view:n})=>{let r=null;if(t.doc.descendants((s,a)=>{if(!s.isText)return!0;const l=s.text??"";for(let u=0;u<l.length;u++)if(this.options.invalidChars.includes(l[u])){const c=a+u+1;(r==null||c<r)&&(r=c)}return!0}),r==null)return!1;const i=t.tr.setSelection(Ve.create(t.doc,r));return e&&e(i.scrollIntoView()),n&&n.focus(),!0},hasInvalidChar:()=>({state:t})=>{let e=!1;return t.doc.descendants(n=>{if(!n.isText)return!0;const r=n.text??"";return this.options.invalidChars.some(i=>r.includes(i))?(e=!0,!1):!0}),e}}}}),ev=o.defineComponent({__name:"SimpleEditor",props:{modelValue:{default:""},parentEditor:{},isReadOnly:{type:Boolean},autofocus:{type:[String,Number,Boolean,null],default:"start"},spellcheckEnabled:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=n,s=o.inject("isMobile",!1),a=o.inject("minCharSuperInput",0),l=[H5,V5,$5,P5,F5.configure({placeholder:"수퍼를 입력하세요"}),lE],u=o.ref(r.spellcheckEnabled),c=o.computed(()=>{var I;return(I=r.parentEditor)==null?void 0:I.extensionManager.extensions.find(O=>O.name==="spellchecker")}),f=o.computed(()=>{var I,O,M,$,H,K,N;return tk.configure({proofreader:new Fk({api:(O=(I=c.value)==null?void 0:I.options.proofreader)==null?void 0:O.api,limit:($=(M=c.value)==null?void 0:M.options.proofreader)==null?void 0:$.limit,transfer:(K=(H=c.value)==null?void 0:H.options.proofreader)==null?void 0:K.transfer,enabled:u.value}),uiStrings:(N=c.value)==null?void 0:N.options.uiStrings})}),p=new Lo({enablePasteRules:!1,enableInputRules:!1,content:r.modelValue,extensions:l.concat(f.value),editable:!r.isReadOnly,autofocus:r.autofocus,onUpdate:({editor:I})=>{i("update:modelValue",I.getHTML())},parseOptions:{preserveWhitespace:"full"}});o.watch(()=>r.isReadOnly,I=>{var O;p.setEditable(!I),(O=p==null?void 0:p.commands)!=null&&O.setIsEnableSuggestion&&p.commands.setIsEnableSuggestion(!I)},{immediate:!0});function m(I){const{view:O}=p,{from:M}=O.state.selection;p.commands.insertContentAt(M,I),p.commands.focus()}function g(){var I;u.value=!u.value,p.commands.handleActiveSpellCheck(u.value),(I=p==null?void 0:p.commands)!=null&&I.setIsEnableSuggestion&&p.commands.setIsEnableSuggestion(u.value)}const{contentInner:b,measuredMinWidth:v,measure:y}=lf({minChars:a,fontSize:"",editor:p});o.watch(()=>r.modelValue,()=>{y(),p&&p.getHTML()!==r.modelValue&&p.commands.setContent(r.modelValue??"",!1)});const x=o.computed(()=>s?{}:{width:`${v.value}px`}),k=document.createElement("canvas").getContext("2d");function C(){if(!v.value||!(b.value instanceof Element)||!k)return;const I=p.getText({blockSeparator:`
|
|
329
329
|
`}),O=getComputedStyle(b.value);k.font=O.font;const M=20,$=()=>Math.max(0,(v.value||0)-M);function H(F,R){let W=1,P=F.length,G=0;for(;W<=P;){const Y=Math.floor((W+P)/2);k.measureText(F.slice(0,Y)).width<=R?(G=Y,W=Y+1):P=Y-1}return G}let K="";const N=[];for(const F of I){if(F===`
|
|
330
|
-
`){N.push(K),K="";continue}if(K+=F,k.measureText(K).width>$())for(;k.measureText(K).width>$();){const R=H(K,$());R<=0?(N.push(K.charAt(0)),K=K.slice(1)):(N.push(K.slice(0,R)),K=K.slice(R))}}return N.push(K),N.map(F=>`<p>${F}</p>`).join("")}const _=o.computed(()=>{var O,M,$;const I=($=(M=(O=r.parentEditor)==null?void 0:O.storage.superText.superInputModal)==null?void 0:M.props)==null?void 0:$.guidelineLeftOffset;return s.value||!I?{}:{backgroundImage:"linear-gradient(to right, #d1d5db 1px, transparent 1px)",backgroundSize:"1px 100%",backgroundRepeat:"no-repeat",backgroundPosition:rn(I)}}),{isScrolling:T,handleScroll:A}=Wl();return e({insertSpecialCharater:m,isChecked:u,toggleSpellCheck:g,wrapText:C,editor:p}),(I,O)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"contentInner",ref:b,style:o.normalizeStyle([o.unref(x),o.unref(_)]),onScroll:O[0]||(O[0]=(...M)=>o.unref(A)&&o.unref(A)(...M)),class:o.normalizeClass(o.unref(Se)("h-40 overflow-y-auto border focus-within:border-ed-input-focus rounded-[3px] p-2.5 relative",I.isReadOnly&&"border-none",o.unref(s)&&"h-auto min-h-20 max-h-44 border-ed-gray rounded-md px-4 py-2.5",o.unref(s)&&!o.unref(T)&&"scrollbar-thumb-transparent"))},[o.createVNode(o.unref(Zn),{id:"editor-panel",editor:o.unref(p),class:o.normalizeClass(o.unref(Se)("vdc-editor relative h-full"))},null,8,["editor","class"])],38))}}),eX={class:"sr-only"},tX={class:"grid m-2.5 p-2.5 gap-y-2.5 rounded border border-gray-200"},nX={class:"grid grid-cols-[70px,1fr] gap-x-2"},rX={class:"flex gap-x-7"},oX={class:"flex items-center space-x-2 text-xs font-normal [&>input[type='checkbox']]:h-[20px] [&>input[type='checkbox']]:w-[20px] [&>input[type='checkbox']]:!border-ed-border [&>input[type='checkbox']]:shadow"},iX=["checked"],sX={for:"spellcheck",class:"select-none whitespace-nowrap"},aX={class:"flex gap-x-1"},lX={class:"grid grid-cols-[70px,1fr] gap-x-2"},uX={class:"text-right text-sm p-2"},cX={class:"grid grid-cols-[70px,1fr] gap-x-2"},Dc=o.defineComponent({__name:"SuperInputDialog",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextElementId:{}},emits:["close","save"],setup(t,{emit:e}){var N,V;const n=e,r=t,{t:i}=_t(),s=o.ref(""),a=o.ref(""),l=o.ref(null),u=o.ref(!1),c=et.useLocalStorage("superInputModalPosition",null),f=o.reactive({x:0,y:0}),p=o.ref(!1),m={x:0,y:0},g=o.ref(!1),b=o.ref(!1),v=o.ref(!1),y=F=>{p.value=!0;const R=F.currentTarget.closest(".draggable-dialog").getBoundingClientRect();m.x=F.clientX-R.left,m.y=F.clientY-R.top,document.addEventListener("mousemove",x),document.addEventListener("mouseup",E)},x=F=>{p.value&&(f.x=F.clientX-m.x,f.y=F.clientY-m.y)},E=()=>{p.value=!1,c.value={x:f.x,y:f.y},document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",E)};o.watch(()=>r.open,async F=>{if(!F)return;b.value=!1,r.superTextInit&&(s.value=r.superTextInit,r.superTextElementId&&(a.value=r.superTextElementId)),await o.nextTick();const R=document.querySelector(".draggable-dialog");if(!R)return;R.getBoundingClientRect();const W=window.innerWidth,P=window.innerHeight;c.value&&c.value.x!==void 0&&c.value.y!==void 0?(f.x=c.value.x,f.y=c.value.y):(f.x=Math.max((W-R.offsetWidth)/2,0),f.y=Math.max((P-R.offsetHeight)/2,0))});const k=()=>{n("close"),s.value="",a.value="",u.value=!1},C=()=>{var R;if((R=l.value)==null?void 0:R.editor.commands.hasInvalidChar()){v.value=!0;return}s.value=l.value.wrapText(),a.value="",b.value?g.value=!0:n("close"),n("save",s.value),s.value=""},_=()=>{g.value=!1,n("close")},T=(V=(N=r.editor)==null?void 0:N.extensionManager.extensions.find(F=>F.name==="superText"))==null?void 0:V.options.specialCharModal,A=o.computed(()=>{var F,R,W;return(W=(R=(F=r.editor)==null?void 0:F.storage.superText.superInputModal)==null?void 0:R.props)==null?void 0:W.fontFamily}),I=et.useLocalStorage("recentSpecialChars",[]),O=F=>{if(!F)return;const R=(I.value??[]).filter(W=>W!==F);R.unshift(F),I.value=R.slice(0,5)},M=F=>{var R;(R=l.value)==null||R.insertSpecialCharater(F)},$=(F,R)=>{var W;R&&((W=l.value)==null||W.insertSpecialCharater(F),O(F))},H=o.computed(()=>{var F;return(F=l.value)==null?void 0:F.isChecked}),K=()=>{var F;(F=l.value)==null||F.toggleSpellCheck()};return o.onUnmounted(()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",E)}),o.watch(s,F=>{!r.superTextElementId||r.superTextElementId===""||(b.value=F!==(r.superTextInit??""))}),(F,R)=>{const W=sh,P=ih,G=oh,Y=rh,le=Nb,fe=Lc,ce=Rc,oe=NG;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(ce,{open:F.open},{default:o.withCtx(()=>[o.createVNode(o.unref(I1),null,{default:o.withCtx(()=>[o.createVNode(o.unref(F1),{class:"!pointer-events-none bg-black/30"}),o.createVNode(fe,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none max-w-max","as-child":""},{default:o.withCtx(()=>{var Oe;return[o.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:o.normalizeStyle({top:"0px",left:"0px",transform:`translate(${f.x}px, ${f.y}px)`,fontFamily:o.unref(A)})},[o.createVNode(G,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:o.withModifiers(y,["prevent"])},{default:o.withCtx(()=>[o.createVNode(W,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.superinput")),1)]),_:1}),o.createVNode(P,{class:"absolute right-3 top-3 text-white",onClick:k},{default:o.withCtx(()=>[o.createVNode(o.unref(xc),{class:"w-5 h-5"}),o.createElementVNode("span",eX,o.toDisplayString(F.$t("editor.close")),1)]),_:1})]),_:1}),o.createVNode(Y),o.createElementVNode("div",tX,[o.createElementVNode("div",nX,[R[5]||(R[5]=o.createElementVNode("label",null," ",-1)),o.createElementVNode("div",rX,[o.createVNode(gn,{class:"text-[#65558F] bg-[#ECE6F0] hover:bg-[#ECE6F0]/90 shadow text-xs rounded font-normal h-[25px] px-3",onClick:R[0]||(R[0]=X=>u.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.insert.symbol")),1)]),_:1}),o.createElementVNode("div",oX,[o.createElementVNode("input",{id:"spellcheck",type:"checkbox",class:"shrink-0",checked:o.unref(H),onChange:K},null,40,iX),o.createElementVNode("label",sX,o.toDisplayString(o.unref(i)("editor.menubar.menu.spellCheck")),1)]),o.createElementVNode("div",aX,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(I),X=>(o.openBlock(),o.createBlock(gn,{key:X,variant:"outline",size:"xs",class:"h-[25px] w-[25px] p-0",onClick:ee=>M(X)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(X),1)]),_:2},1032,["onClick"]))),128))])]),u.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent((Oe=o.unref(T))==null?void 0:Oe.component),o.mergeProps({key:0,"custom-class":"!z-[70] !pointer-events-auto","font-family":o.unref(A)},o.unref(T).props,{onSelectedChar:$,onClose:R[1]||(R[1]=X=>u.value=!1)}),null,16,["font-family"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",lX,[o.createElementVNode("label",uX,o.toDisplayString(o.unref(i)("editor.detail")),1),o.createVNode(ev,{ref_key:"simpleEditorRef",ref:l,modelValue:s.value,"onUpdate:modelValue":R[2]||(R[2]=X=>s.value=X),"parent-editor":F.editor,class:""},null,8,["modelValue","parent-editor"])]),o.createElementVNode("div",cX,[R[6]||(R[6]=o.createElementVNode("label",{class:"text-right text-sm p-2"},"ID",-1)),o.createVNode(fs,{modelValue:a.value,"onUpdate:modelValue":R[3]||(R[3]=X=>a.value=X),class:"rounded-none","default-value":a.value,disabled:""},null,8,["modelValue","default-value"])])]),o.createVNode(le,{class:"sm:justify-center pb-3.5 pt-1"},{default:o.withCtx(()=>[o.createVNode(gn,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:C},{default:o.withCtx(()=>[o.createVNode(o.unref(ob),{class:"w-5 h-5 mr-2"}),o.createTextVNode(" "+o.toDisplayString(o.unref(i)("editor.check")),1)]),_:1}),o.createVNode(gn,{as:"button",variant:"destructive",onClick:k},{default:o.withCtx(()=>[o.createVNode(o.unref(xc),{class:"w-5 h-5 mr-2"}),o.createTextVNode(" "+o.toDisplayString(F.$t("editor.close")),1)]),_:1})]),_:1})],4)]}),_:1})]),_:1})]),_:1},8,["open"]),o.createVNode(oe,{open:g.value,onClose:_},null,8,["open"]),o.createVNode(oe,{title:"Information",message:"{ 과 } 는 입력이 제한된 문자열 입니다.",iconName:"MessageCircleWarning",confirmText:"Ok",open:v.value,onClose:R[4]||(R[4]=Oe=>v.value=!1)},null,8,["open"])],64)}}}),tv=o.defineComponent({__name:"SelectContextMenu",props:{editor:{},mode:{},superTextStore:{},disabled:{type:Boolean},disableSuperInput:{type:Boolean}},setup(t,{expose:e}){const n=t,{t:r}=_t(),i=o.ref(!1),s=o.reactive({from:0,to:0,text:""}),a=o.inject("isEditable",o.ref(!0)),l=o.inject("canEditSuper",o.ref(!0)),u=o.computed(()=>n.mode===Ie.EDITOR||n.mode===Ie.PLAIN_TEXT||!l.value||n.disableSuperInput);function c(){if(!n.editor)return"";const{from:E,to:k}=n.editor.state.selection,C=n.editor.state.doc.cut(E,k),T=Dr.fromSchema(n.editor.schema).serializeFragment(C.content),A=document.createElement("div");return A.appendChild(T),A.innerHTML}const f=()=>{const{view:E}=n.editor,{from:k,to:C}=E.state.selection,_=c();s.text=_,s.from=k,s.to=C},p=()=>i.value=!i.value,m=()=>{u.value||(i.value=!0,f())},g=()=>i.value=!1,b=E=>{const k=n==null?void 0:n.superTextStore.addMoreSuperText(E);n.editor&&n.editor.commands.insertContentAt(s.from,{type:"superText",attrs:{"data-id":k,"data-text":E}}),i.value=!1,requestAnimationFrame(()=>{n.editor.commands.setTextSelection(s.from+1),n.editor.view.focus()})},v=o.ref(!1),y=async E=>{var k,C;if(E){const _=await((C=(k=n.editor).hasClipboard)==null?void 0:C.call(k));v.value=!!_}},x=()=>{if(u.value||!n.editor)return;const{view:E,state:k}=n.editor,{from:C,to:_}=k.selection;s.from=C,s.to=_,s.text="",E.dom.blur(),i.value=!0};return e({toggleDialog:p,openDialog:m,closeDialog:g}),(E,k)=>{const C=Dc,_=Qb,T=Zb,A=Jb,I=Yb;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(C,{open:i.value,editor:E.editor,"super-text-init":s.text,onClose:p,onSave:b},null,8,["open","editor","super-text-init"]),o.createVNode(I,{"onUpdate:open":y},{default:o.withCtx(()=>[o.createVNode(_,{as:"template",class:"relative",disabled:o.unref(u),onDblclick:o.withModifiers(x,["prevent","stop"])},{default:o.withCtx(()=>[o.renderSlot(E.$slots,"default")]),_:3},8,["disabled"]),o.createVNode(A,null,{default:o.withCtx(()=>[E.disableSuperInput?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(T,{key:0,onSelect:m},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.inputSuper")),1)]),_:1})),o.unref(a)?(o.openBlock(),o.createBlock(T,{key:1,onSelect:k[0]||(k[0]=O=>{var M;return(M=E.editor)==null?void 0:M.commands.cutContent()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.cut")),1)]),_:1})):o.createCommentVNode("",!0),o.unref(a)?(o.openBlock(),o.createBlock(T,{key:2,onSelect:k[1]||(k[1]=O=>{var M;return(M=E.editor)==null?void 0:M.commands.copyContent()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.copy")),1)]),_:1})):o.createCommentVNode("",!0),o.unref(a)?(o.openBlock(),o.createBlock(T,{key:3,disabled:!v.value,onSelect:k[2]||(k[2]=O=>{var M;return(M=E.editor)==null?void 0:M.commands.pasteContent()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.paste")),1)]),_:1},8,["disabled"])):o.createCommentVNode("",!0)]),_:1})]),_:3})],64)}}});var cr=(t=>(t.TOGGLE_SUPER_TEXT="toggle-super-text",t.SUPER_TEXT_UPDATE_POSITION="SUPER_TEXT_UPDATE_POSITION",t.RENDER_SUPER_TEXT="RENDER_SUPER_TEXT",t.SUPER_VIEW_PAGE="SUPER_VIEW_PAGE",t.INCREASE_DECREASE_FONTSIZE="increase-decrease-fontsize",t))(cr||{});const dX={id:"editor-panel",class:"flex relative w-full h-full"},fX=uo(o.defineComponent({__name:"PageNode",props:Qs,setup(t){const{state:e,page:n,superTextStore:r}=yn(),{size:i,pagination:s,margin:a}=n.value,l=o.ref(null),u=o.ref(t.node.attrs.viewSuperTextArea),c=o.computed(()=>u.value&&t.editor.storage.page.mode!=="editor"),f=o.computed(()=>t.editor.storage.page.mode===Ie.REPORT),{width:p,height:m}=i,g=o.computed(()=>s?`calc(${m} - ${(a==null?void 0:a.top)??0} - ${(a==null?void 0:a.bottom)??0}`:"max-content"),b=et.useEventBus(cr.SUPER_VIEW_PAGE);return o.watch(()=>t.node.attrs,v=>{b.emit(v.pageNumber)},{immediate:!0}),(v,y)=>{var E,k,C,_;const x=tv;return o.openBlock(),o.createBlock(o.unref(Zs),{id:v.node.attrs.id,ref_key:"containerRef",ref:l,"page-number":v.node.attrs.pageNumber,class:"overflow-hidden umo-page-node-view w-full border rounded-[3px] border-[#999999]",style:o.normalizeStyle({"--umo-page-margin-top":((E=o.unref(a))==null?void 0:E.top)??"0","--umo-page-margin-bottom":((k=o.unref(a))==null?void 0:k.bottom)??"0","--umo-page-margin-left":((C=o.unref(a))==null?void 0:C.left)??"0","--umo-page-margin-right":((_=o.unref(a))==null?void 0:_.right)??"0","--umo-page-width":o.unref(p),"--umo-page-height":o.unref(m),"--empty-node-left":"0px",left:100,"min-height":typeof o.unref(m)=="number"?`${o.unref(m)}px`:o.unref(m),height:f.value?typeof o.unref(m)=="number"?`${o.unref(m)}px`:o.unref(m):"auto"})},{default:o.withCtx(()=>[o.createElementVNode("div",dX,[o.createVNode(x,{mode:c.value?o.unref(Ie).REPORT:o.unref(Ie).EDITOR,editor:v.editor,"super-text-store":o.unref(r)},{default:o.withCtx(()=>[o.createVNode(o.unref(Y4),{class:"umo-page-node-content",style:o.normalizeStyle({height:g.value})},null,8,["style"])]),_:1},8,["mode","editor","super-text-store"])])]),_:1},8,["id","page-number","style"])}}}),[["__scopeId","data-v-7d55d7ea"]]);function uE(t,e){const n=t.storedMarks??(t.selection.$to.parentOffset&&t.selection.$from.marks());if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const pX=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:a}=e,{$from:l,$to:u}=s,c=i.extensionManager.attributes,f=ah(c,l.node().type.name,l.node().attrs);if(f.id=Xb(),f.extend&&(f.extend=!1),s instanceof Fe&&s.node.isBlock)return!l.parentOffset||!vr(a,l.pos)?!1:(r&&(t&&uE(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const p=u.parentOffset===u.parent.content.size;s instanceof Ve&&e.deleteSelection();const m=l.depth===0?void 0:Yw(l.node(-1).contentMatchAt(l.indexAfter(-1)));let g=p&&m?[{type:m,attrs:f}]:void 0,b=vr(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!b&&vr(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,g=m?[{type:m,attrs:f}]:void 0),b&&(g||(g=[{type:l.node().type,attrs:f}]),e.split(e.mapping.map(l.pos),1,g),m&&!p&&!l.parentOffset&&l.parent.type!==m)){const v=e.mapping.map(l.before()),y=e.doc.resolve(v);l.node(-1).canReplaceWith(y.index(),y.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&uE(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},hX=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var v;const s=bn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection instanceof Fe?n.selection.node:null;if(u!=null&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let y=ge.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let A=a.depth-x;A>=a.depth-3;A-=1)y=ge.from(a.node(A).copy(y));const E=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,k=ah(f,a.node().type.name,a.node().attrs),C=((v=s.contentMatch.defaultType)==null?void 0:v.createAndFill(k))??void 0;y=y.append(ge.from(s.createAndFill(null,C)??void 0));const _=a.before(a.depth-(x-1));e.replace(_,a.after(-E),new Te(y,4-x,0));let T=-1;e.doc.nodesBetween(_,e.doc.content.size,(A,I)=>{if(T>-1)return!1;A.isTextblock&&A.content.size===0&&(T=I+1)}),T>-1&&e.setSelection(Ve.near(e.doc.resolve(T))),e.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,m=ah(f,c.type.name,c.attrs),g=ah(f,a.node().type.name,a.node().attrs);m.id=Xb(),g.id=Xb(),e.delete(a.pos,l.pos);const b=p?[{type:s,attrs:m},{type:p,attrs:g}]:[{type:s,attrs:m}];if(!vr(e.doc,a.pos,2))return!1;if(r){const{selection:y,storedMarks:x}=n,{splittableMarks:E}=i.extensionManager,k=x??(y.$to.parentOffset&&y.$from.marks());if(e.split(a.pos,2,b).scrollIntoView(),!k||!r)return!0;const C=k.filter(_=>E.includes(_.type.name));e.ensureMarks(C)}return!0},mX=[Kf,qf,Gf,wg,Xf,us,Cg,Tl,kg,_g,Eg,ca,Al,gi,Sg,Tg,xg,Kr],gX=Rt.create({priority:200,name:`${Kr}`,content:"block*",group:`${Kr}`,isolating:!0,selectable:!1,draggable:!1,isLeaf:!0,addOptions(){return{SystemAttributes:{},nodesComputed:{},View:Ns(fX),types:[],slots:{}}},addAttributes(){return{HTMLAttributes:{},id:{default:Gr(10)},pageNumber:{default:1},force:{default:!1},viewSuperTextArea:{default:!0},slots:{default:this.options.slots,renderHTML:()=>({})}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["div",{...yt(e),"data-type":this.name},0]},addCommands(){return{splitBlock:pX,splitListItem:hX,autoPaging:(t=!0)=>({tr:e,state:n,dispatch:r,editor:i})=>(r&&e.setMeta("runState",t),!0),setPageBreak:()=>({tr:t,state:e,dispatch:n,editor:r})=>(n&&t.setMeta("splitPage",!0),!0),togglePagePlugin:t=>({tr:e,dispatch:n})=>(e.setMeta("disablePage",t),n&&n(e),!0)}},addGlobalAttributes(){return[{types:mX.concat(this.options.types||[]),attributes:{id:{default:null},extend:{default:!1}}}]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{empty:l,$anchor:u}=s,{pos:c,parent:f}=u,p=je.atStart(a).from===c;return!l||!p||!f.type.isTextblock||f.textContent.length?!1:r.clearNodes()}),()=>cE(r),()=>r.joinBackward(),()=>r.selectNodeBackward(),()=>r.command(({editor:i,tr:s})=>{const{selection:a,doc:l}=s,{$anchor:u}=a,{pos:c}=u;if(l.childCount===1)return!1;if(je.atEnd(l).from===c&&!u.parentOffset)return r.deleteNode(Kr);const f=ai(p=>p.type.name===Kr)(a);if(f){if(!f.node.firstChild)return r.deleteNode(Kr);const p=f.node.firstChild.type;if(f.start+je.atStart(f.node).from===c){const g=Ve.create(l,f.start-2,f.start-2),b=ai(v=>v.type.name===Kr)(g);if(b){const v=je.atEnd(b.node).from+b.start,y=Ve.create(l,v,v);if(p===b.node.lastChild.type){const{parent:x}=y.$anchor;return GG(x,i.schema)?s.setSelection(y):s.step(new hn(v,c,Te.empty)),!0}s.setSelection(y)}return!0}}return!1})]),Delete:()=>this.editor.commands.first(({commands:r})=>[()=>cE(r),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{$anchor:l}=s,u=l.node(),c=ai(f=>f.type.name===Tl)(s);return c&&c.start+je.atStart(c.node).from===l.pos&&c.node.childCount===1&&u.content.size===0?!0:r.joinForward()}),()=>r.selectNodeForward(),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{$anchor:l}=s,{pos:u}=l;if(a.childCount===1)return!1;if(je.atEnd(a).from===u)return r.deleteNode(Kr);const c=ai(f=>f.type.name===Kr)(s);if(c&&c.start+je.atEnd(c.node).from===u){const p=Ve.create(a,u+2,u+2),m=ai(g=>g.type.name===Kr)(p);if(m){const g=je.atStart(m.node).from+m.start,b=Ve.create(a,g,g);if(ai(y=>y.attrs.extend)(b))return i.step(new hn(u,g,Te.empty)),!0}}return!1})]),Tab:()=>this.editor.commands.first(({commands:r})=>[()=>!0]),"Mod-Enter":()=>this.editor.commands.setPageBreak()}},addNodeView(){return this.options.View}});function ah(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}const cE=t=>t.command(({tr:e})=>{const{selection:n,doc:r}=e,i=Jw(r,{from:n.from,to:n.to},s=>s.type.name===Tl);for(const s of i){const a=s.pos+s.node.nodeSize;if(n.from<s.pos||n.to>a)return!0}return t.deleteSelection()}),bX=nt.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),vX=["data-font"],yX=o.defineComponent({__name:"FontFamilyMenuButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},shortcutKeys:{default:void 0},maxHeight:{default:void 0},tooltip:{default:""},items:{default:()=>[]},customClass:{default:""},showDefaultDivider:{type:Boolean,default:!1}},setup(t){const e=t,n=o.computed(()=>e.editor.extensionStorage["base-kit"].mode===Ie.EDITOR),{t:r}=_t(),i=[{label:r("editor.fontFamily.gulim"),value:"Gulim"},{label:r("editor.fontFamily.dotum"),value:"Dotum"},{label:r("editor.fontFamily.gungsuh"),value:"Gungsuh"}],s=o.inject("fontFamily"),a=o.computed(()=>{const p=e.editor.extensionManager.extensions.find(g=>g.name==="fontFamily").options;let m=[];return kt.isEmpty(p.fontFamilyList)?m=i:m=p.fontFamilyList.filter(g=>g.enabled!==!1).map(g=>({label:g.label,value:g.value})),[{label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")},...m]}),l=o.computed(()=>{const p={label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")};return n.value?M0(e.editor.state,"textStyle").fontFamily||p.value:s.value||p.value}),u=et.useEventBus("fontFamily");function c(p){p.value===l.value||p.value===r("editor.fontFamily.default")?(e.editor.chain().focus().unsetFontFamily().run(),s.value=null):(s.value=p.value,e.editor.chain().focus().setFontFamily(p.value).run(),u.emit()),e.editor.commands.setForceCloseBubble(!0)}e.editor.on("selectionUpdate",({editor:p})=>{p.state.selection.empty&&e.editor.commands.resetForceCloseBubble()});const f=o.computed(()=>{var m,g;const p=((m=a.value[0])==null?void 0:m.label)||r("editor.fontFamily.default");return((g=a.value.find(b=>b.value===l.value))==null?void 0:g.label)||p});return(p,m)=>(o.openBlock(),o.createBlock(ya,{disabled:p.disabled,tooltip:p.tooltip,title:f.value,btn_class:`min-w-20 ${p.customClass}`,class:"inside-toolbar"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(g,b)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:b},[o.createVNode(o.unref(Dl),{checked:l.value===g.value,onClick:v=>c(g)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:"ml-1 h-full","data-font":g.label,style:o.normalizeStyle({fontFamily:g.value??void 0})},o.toDisplayString(g.label),13,vX)]),_:2},1032,["checked","onClick"]),g.label===o.unref(r)("editor.fontFamily.default")&&p.showDefaultDivider?(o.openBlock(),o.createBlock(o.unref(ab),{key:0})):o.createCommentVNode("",!0)],64))),128))]),_:1},8,["disabled","tooltip","title","btn_class"]))}}),dE=bX.extend({name:"fontFamily",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["textStyle"],fontFamilyList:[],button({editor:e,extension:n,t:r}){return{component:yX,componentProps:{editor:e,disabled:!e.can().setFontFamily(""),tooltip:r("editor.fontFamily.tooltip")}}}}},addGlobalAttributes(){return[{types:["paragraph","heading","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.style.fontFamily||null,renderHTML:t=>t.style?{style:`font-family: ${t.style}`}:{}},fontFamily:{default:null,parseHTML:t=>t.style.fontFamily.replace(/['"]/g,""),renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontFamily}}),wX={class:"flex gap-2"},xX=["disabled"],CX=uo(o.defineComponent({__name:"FontSizeIncreaseDecrease",props:{editor:Object},setup(t){const e=o.inject("fontSize"),n=o.computed(()=>e.value?parseInt(e.value)===parseInt(r1[0])||parseInt(e.value)<parseInt(r1[0]):!1),r=et.useEventBus(cr.INCREASE_DECREASE_FONTSIZE),i=s=>{r.emit(s)};return(s,a)=>{const l=pa,u=fa,c=ha;return o.openBlock(),o.createElementBlock("div",wX,[o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u,{"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(l,null,{default:o.withCtx(()=>[o.createElementVNode("button",{class:"btn",onClick:a[0]||(a[0]=f=>i(!0))},[o.createVNode(o.unref(At),{name:"Plus",class:"w-6 h-6"})])]),_:1}),o.createVNode(o.unref(ps),null,{default:o.withCtx(()=>a[2]||(a[2]=[o.createTextVNode(" 글꼴 크기 크게 ")])),_:1})]),_:1})]),_:1}),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u,{"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(l,null,{default:o.withCtx(()=>[o.createElementVNode("button",{class:"btn",onClick:a[1]||(a[1]=f=>i(!1)),disabled:o.unref(n)},[o.createVNode(o.unref(At),{name:"Minus",class:"w-6 h-6"})],8,xX)]),_:1}),o.createVNode(o.unref(ps),null,{default:o.withCtx(()=>a[3]||(a[3]=[o.createTextVNode(" 글꼴 크기 작게 ")])),_:1})]),_:1})]),_:1})])}}}),[["__scopeId","data-v-250d04b3"]]),EX=Hn.create({name:"fontSizeIncreaseDecrease",addOptions(){return{defaultSize:"14px",button({editor:t}){return{component:CX,componentProps:{editor:t}}}}},addAttributes(){return{size:{default:this.options.defaultSize,parseHTML:t=>t.style.fontSize||this.options.defaultSize,renderHTML:t=>t.size?{style:`font-size: ${t.size}`}:{}}}},addCommands(){return{setFontSizeIncreaseDecrease:t=>({commands:e})=>e.setMark("textStyle",{fontSize:t})}}}),nv=nt.create({name:"painter",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:Ge,componentProps:{action:()=>{e.commands.setPainter(e==null?void 0:e.state.selection.$head.marks())},icon:"PaintRoller",tooltip:r("editor.format")}})}},addCommands(){return{setPainter:t=>({view:{dispatch:e,state:{tr:n},dom:r}})=>{const a=`url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;return r.style.cursor=a,e(n.setMeta("painterAction",{type:"start",marks:t})),!0}}},addProseMirrorPlugins(){return[new rt({key:new Et("format-painter"),state:{init:()=>[],apply:(t,e)=>{const n=t.getMeta("painterAction");return n&&n.type==="start"?e=n.marks:n&&n.type==="end"&&(e=[]),e}},props:{handleDOMEvents:{mousedown(t,e){const n=this.getState(t.state);if(!n||n.length==0)return t.dom.style.cursor="",!1;const r=()=>{document.removeEventListener("mouseup",r);const{dispatch:i,state:{selection:s},dom:a}=t;let l=t.state.tr;a.style.cursor="",l=l.removeMark(s.from,s.to);for(const u of n)u.type.name!="link"&&(l=l.addMark(s.from,s.to,u));i(l.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",r),!0}}}})]}}),rv=()=>Gr(10),fE=new Et("attrkey"),kX=t=>new rt({key:fE,state:{init:()=>!1,apply:n=>n.getMeta("initSplit")},appendTransaction(n,r,i){const{tr:s}=i;let a=!1;const l=fE.getState(i);if(n.some(c=>c.getMeta("composition")))return null;if(l||n.some(c=>c.docChanged)){const c=[];i.doc.descendants((f,p,m,g)=>{const{attrs:b}=f,v=c.includes(b.id)?rv():b.id||rv();t.includes(f.type.name)&&(s.setNodeMarkup(p,void 0,{...b,id:v,"number-line":g+1}),a=!0),c.push(v)})}return a?s:null}}),pE=[Kf,qf,Gf,wg,Xf,us,Cg,Tl,kg,_g,Eg,ca,Al,gi,Sg,Tg,xg,Kr],SX=nt.create({name:"autoId",addGlobalAttributes(){return[{types:pE.concat(this.options.types||[]),attributes:{id:{default:rv()},extend:{default:!1},class:{default:null},"number-line":{default:null}}}]},addProseMirrorPlugins(){return[kX(pE.concat(this.options.types||[]))]}}),_X=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,TX=Rt.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",yt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[o4({find:_X,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),AX=["src","alt"],MX={key:0,class:"image-resizer"},OX=["onMousedown","onTouchstart"],BX=o.defineComponent({__name:"ImageView",props:{...Qs,selected:{type:Boolean,required:!0}},setup(t){const e=t,n={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"},r=o.inject("isMobile",!1),i=o.ref({width:Z4,height:Z4}),s=o.ref({width:0,height:0}),a=o.ref(!1),l=o.ref({x:0,y:0,w:0,h:0,dir:""}),u=o.computed(()=>{const{src:C,alt:_,width:T,height:A,flipX:I,flipY:O}=e.node.attrs,M=[];I&&M.push("rotateX(180deg)"),O&&M.push("rotateY(180deg)");const $=M.join(" ");return{src:C||void 0,alt:_||void 0,style:{width:i1(T)?`${T}px`:T,height:i1(A)?`${A}px`:A,transform:$||"none"}}});o.computed(()=>({width:o.unref(u).style.width==="100%"?"100%":void 0}));const c=o.ref(null),f=new ResizeObserver(C=>{for(const _ of C){const{width:T,height:A}=_.contentRect;s.value={width:T,height:A},e.updateAttributes({originWidth:T,originHeight:A})}});function p(){const{editor:C,getPos:_}=e;C.commands.setNodeSelection(_())}const m=kt.throttle(()=>{const{editor:C}=e;i.value.width=parseInt(getComputedStyle(C.view.dom).width,10)},Q4);function g(C,_){C.preventDefault(),C.stopPropagation();let T=0,A=0;const I=document.querySelector(".image-resizer");if(I&&(I.style.borderColor="#3b82f6"),"touches"in C&&C.touches.length>0)T=C.touches[0].clientX,A=C.touches[0].clientY;else if("clientX"in C)T=C.clientX,A=C.clientY;else return;const{width:O,height:M}=o.unref(s),$=O/M;let H=Number(e.node.attrs.width)||O,K=Number(e.node.attrs.height)||Math.round(H/$);const N=o.unref(i).width;H=Math.min(H>N?N:H,N),K=Math.round(H/$),Object.assign(l.value,{x:T,y:A,w:H,h:K,dir:_}),a.value=!0,y()}const b=kt.throttle(C=>{if(!o.unref(a))return;let _=0;if("touches"in C&&C.touches.length>0)_=C.touches[0].clientX;else if("clientX"in C)_=C.clientX;else return;const{x:T,w:A,dir:I}=o.unref(l),O=(_-T)*(/l/.test(I)?-1:1),M=UI(A+O,LI,o.unref(i).width);e.updateAttributes({width:M})},Q4),v=C=>{C.preventDefault(),C.stopPropagation();const _=document.querySelector(".image-resizer");_&&(_.style.borderColor=""),o.unref(a)&&(a.value=!1,Object.assign(l.value,{x:0,y:0,w:0,h:0,dir:""}),x(),p())};function y(){document.addEventListener("mousemove",b,!0),document.addEventListener("mouseup",v,!0),document.addEventListener("touchmove",b,!0),document.addEventListener("touchend",v,!0)}function x(){document.removeEventListener("mousemove",b,!0),document.removeEventListener("mouseup",v,!0),document.removeEventListener("touchmove",b,!0),document.removeEventListener("touchend",v,!0)}const E=new ResizeObserver(m),k=o.computed(()=>{const{textAlign:C}=e.node.attrs;return{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[C]||""});return o.onMounted(()=>{c.value&&f.observe(c.value),E.observe(e.editor.view.dom)}),o.onBeforeUnmount(()=>{x(),f.disconnect(),E.disconnect()}),(C,_)=>(o.openBlock(),o.createBlock(o.unref(Zs),{class:"node-image",style:o.normalizeStyle({"pointer-events":o.unref(r)&&t.selected?"none":"auto"})},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"image-view",style:o.normalizeStyle([{width:u.value.style.width,height:u.value.style.height},k.value])},[o.createElementVNode("div",{draggable:"true","data-drag-handle":"",class:o.normalizeClass([{"image-view__body--focused":t.selected,"image-view__body--resizing":a.value},"image-view__body"])},[o.createElementVNode("img",{ref_key:"imageRef",ref:c,src:u.value.src,alt:u.value.alt,class:"block w-full image-view__body__image",style:o.normalizeStyle([{transform:u.value.style.transform}]),onClick:p,onMousedown:_[0]||(_[0]=(...T)=>o.unref(af)&&o.unref(af)(...T))},null,44,AX),C.editor.view.editable?o.withDirectives((o.openBlock(),o.createElementBlock("div",MX,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.values(n),T=>(o.openBlock(),o.createElementBlock("span",{key:T,class:o.normalizeClass(o.unref(Se)(`image-resizer__handler--${T}`,"image-resizer__handler",o.unref(r)&&t.selected&&"pointer-events-auto")),onMousedown:A=>g(A,T),onTouchstart:o.withModifiers(A=>g(A,T),["prevent"])},null,42,OX))),128))],512)),[[o.vShow,t.selected||a.value]]):o.createCommentVNode("",!0)],2)],4)]),_:1},8,["style"]))}}),IX=uo(BX,[["__scopeId","data-v-db9342d0"]]),ov=TX.extend({group:"block",defining:!0,isolating:!0,addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),flipX:{default:!1},flipY:{default:!1},originWidth:{default:null},originHeight:{default:null},textAlign:{default:"left",parseHTML:e=>e.style.textAlign||e.getAttribute("textAlign")||null,renderHTML:e=>({textAlign:e.textAlign})},width:{default:"100%",parseHTML:e=>{const n=e.style.width||e.getAttribute("width")||null;return n&&n.endsWith("%")?n:n==null?null:parseInt(n,10)},renderHTML:e=>({width:e.width})},class:{default:"",parseHTML:e=>e.getAttribute("class")||"",renderHTML:e=>({class:e.class})},"data-memo":{default:"",parseHTML:e=>e.getAttribute("data-memo")||"",renderHTML:e=>({"data-memo":e["data-memo"]})}}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this)}},addNodeView(){return Ns(IX)},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),updateImage:e=>({commands:n,editor:r})=>n.updateAttributes(this.name,e)}},renderHTML({node:t,HTMLAttributes:e}){const{textAlign:n,flipX:r,flipY:i}=t.attrs,l=`${{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[n]||""} ${r||i?`transform: rotateX(${r?"180":"0"}deg) rotateY(${i?"180":"0"}deg);`:""}`;return["img",yt({height:"auto",style:l},this.options.HTMLAttributes,e)]},parseHTML(){return[{tag:"img[src]"}]},addProseMirrorPlugins(){return[new rt({props:{handleTextInput(t){const{selection:e}=t.state;return e instanceof Fe&&e.node.type.name==="image"},handlePaste(t){const{selection:e}=t.state;return e instanceof Fe&&e.node.type.name==="image"}}})]}}),RX=["paragraph","heading","list_item","todo_item"];function LX(t,e){const{selection:n,doc:r}=t;if(!n||!r||!(n instanceof Ve||n instanceof Vn))return t;const{from:i,to:s}=n,a=[],l=e&&e!==N4?e:null;return r.nodesBetween(i,s,(u,c)=>{const f=u.type;return RX.includes(f.name)?((u.attrs.lineHeight||null)!==l&&a.push({node:u,pos:c,nodeType:f}),f.name!=="list_item"&&f.name!=="todo_item"):!0}),a.length&&a.forEach(u=>{const{node:c,pos:f,nodeType:p}=u;let{attrs:m}=c;m={...m,lineHeight:l},t=t.setNodeMarkup(f,p,m,c.marks)}),t}function DX(t){return({state:e,dispatch:n})=>{const{selection:r}=e;let{tr:i}=e;return i=i.setSelection(r),i=LX(i,t),i.docChanged?(n&&n(i),!0):!1}}const PX=o.defineComponent({__name:"LineHeightDropdown",props:{editor:{},icon:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const{t:e}=_t();function n(l){return parseFloat(l.replace("%",""))/100}const r=o.computed(()=>{const c=s.editor.extensionManager.extensions.find(f=>f.name==="lineHeight").options.lineHeights.map(f=>({label:n(f),value:f}));return c.unshift({label:o.unref(e)("editor.default"),value:"default"}),c}),i=o.ref("default"),s=t;function a(l){l==="default"?s.editor.chain().focus().unsetLineHeight().run():s.editor.chain().focus().setLineHeight(l).run(),i.value=l}return(l,u)=>(o.openBlock(),o.createBlock(ya,{icon:l.icon,tooltip:l.tooltip,disabled:l.disabled,class:"inside-toolbar"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(c,f)=>(o.openBlock(),o.createBlock(o.unref(Dl),{key:f,checked:c.value===i.value,onClick:p=>a(c.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.label),1)]),_:2},1032,["checked","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),hE=nt.create({name:"lineHeight",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:["100%","115%","150%","200%","250%","300%"],defaultHeight:N4,button({editor:e,t:n}){return{component:PX,componentProps:{editor:e,icon:"LineHeight",tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight||this.options.defaultHeight,renderHTML:t=>t.lineHeight===this.options.defaultHeight||!t.lineHeight?{}:{style:`line-height: ${t.lineHeight}`}}}}]},addCommands(){return{setLineHeight:t=>DX(t),unsetLineHeight:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}}),VX=Rt.create({name:"column",content:"block+",isolating:!0,addAttributes(){return{position:{default:"",parseHTML:t=>t.getAttribute("data-position"),renderHTML:t=>({"data-position":t.position})}}},renderHTML({HTMLAttributes:t}){return["div",yt(t,{"data-type":"column"}),0]},parseHTML(){return[{tag:'div[data-type="column"]'}]}});var Ea=(t=>(t.SidebarLeft="sidebar-left",t.SidebarRight="sidebar-right",t.TwoColumn="two-column",t))(Ea||{});const iv=Rt.create({name:"columns",group:"columns",content:"column+",defining:!0,isolating:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),layout:"two-column"}},addAttributes(){return{layout:{default:"two-column"}}},addCommands(){return{setColumns:()=>({commands:t})=>(t.insertContent('<div data-type="columns"><div data-type="column" data-position="left"><p></p></div><div data-type="column" data-position="right"><p></p></div></div>'),!0),setLayout:t=>({commands:e})=>e.updateAttributes("columns",{layout:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-type":"columns",class:`layout-${t.layout}`},0]},parseHTML(){return[{tag:'div[data-type="columns"]'}]},addExtensions(){return[VX.configure(this.options.columnOptions)]}});function FX(t){let e=t;for(;e&&e!==document.body;){if(e.nodeType===1){const n=e;if(n.id==="editor-panel")return n}e=e.parentNode}return null}const lh=t=>{var n;if(!t)return!0;const e=document.createElement("div");return e.innerHTML=t,((n=e==null?void 0:e.textContent)==null?void 0:n.trim())===""},$X=t=>{if(!t)return"";const{from:e,to:n}=t.state.selection,r=t.state.doc.cut(e,n),s=Dr.fromSchema(t.schema).serializeFragment(r.content),a=document.createElement("div");return a.appendChild(s),a.innerHTML},HX=t=>/<\/?[a-z][\s\S]*>/i.test(t),mE=8;function zX(t,e){const n=o.ref(!1);let r=!1,i=null,s=null,a=null,l=null,u=0,c=0;function f(E){const k=E.cloneNode(!0);return k.style.position="fixed",k.style.pointerEvents="none",k.style.opacity="0.9",k.style.zIndex="9999",k.style.transform="translate(-50%, -50%)",k.style.left="0px",k.style.top="0px",document.body.appendChild(k),k}function p(){s&&s.parentElement&&s.parentElement.removeChild(s),s=null}function m(){try{if(typeof t.getPos=="function"){const E=t.getPos();if(typeof E=="number"&&E>=0)return E}}catch{}return null}function g(E,k){n.value||(l=m(),document.body.style.userSelect="none",document.body.style.touchAction="none",k&&(s=f(k),s.style.left=`${E.clientX}px`,s.style.top=`${E.clientY}px`),n.value=!0,r=!1,a=null)}function b(){i=null,l=null,a=null,r=!1,n.value=!1,p(),document.body.style.userSelect="",document.body.style.touchAction=""}function v(E){if(o.unref(e)||n.value)return;const k=E.changedTouches[0];i=k.identifier,u=k.clientX,c=k.clientY,r=!0,l=null,a=null}function y(E){var A;if(!r&&!n.value||i===null)return;const k=Array.from(E.changedTouches).find(I=>I.identifier===i);if(!k)return;const C=k.clientX-u,_=k.clientY-c,T=C*C+_*_;if(!n.value&&r&&T>=mE*mE){const I=E.currentTarget||E.target||null;g(k,I)}if(n.value){s&&(s.style.left=`${k.clientX}px`,s.style.top=`${k.clientY}px`);try{const I=(A=t.editor)==null?void 0:A.view;if(!I){a=null;return}const O=I.posAtCoords({left:k.clientX,top:k.clientY});O&&typeof O.pos=="number"?a=O.pos:a=null}catch{a=null}}}async function x(E){var k;if(n.value){if(document.body.style.userSelect="",document.body.style.touchAction="",p(),n.value=!1,l===null||a===null){b();return}const C=(k=t.editor)==null?void 0:k.view;if(!C){b();return}const _=C.state.doc.nodeAt(l);if(!_){b();return}const T=_.nodeSize,A=l,I=A+T,O=a;if(O>=A&&O<=I){b();return}let M=O;O>A&&(M=O-T);const $=C.state.doc.content.size;M<0&&(M=0),M>$&&(M=$);const H=_.type.create(_.attrs),K=C.state.tr;K.delete(A,I),K.insert(M,H),C.dispatch(K),b();return}if(r){b();return}}return{onTouchStart:v,onTouchMove:y,onTouchEnd:x}}function UX(...t){return dy(Sm(t))}const WX=["innerHTML"],jX=["book-mark-node-id","book-mark-content","node-id","element-id","line-id"],qX=o.defineComponent({__name:"SuperText",props:Qs,setup(t){const e=t,n=o.ref(!1),r=o.inject("isMobile",!1),i=o.computed(()=>e.editor.storage.superText.enable),s=et.useEventBus(cr.RENDER_SUPER_TEXT),{onTouchStart:a,onTouchMove:l,onTouchEnd:u}=zX(e,i),c=o.ref(null),f=o.ref(!1),p=()=>{f.value=!0},m=()=>{f.value=!1};o.watch(f,()=>{f.value&&_(c.value)});const g={mouseenter:C,mouseleave:_,dragstart:p,dragend:m},b={touchstart:a,touchmove:l,touchend:u,touchcancel:u},v=o.computed(()=>r?b:g),y=o.computed(()=>{const M=e.getPos(),$=e.editor.state.doc.resolve(M);for(let H=$.depth;H>0;H--){const K=$.node(H);if(K.type.name==="paragraph")return K}return null}),x=o.computed(()=>{var M;return((M=y.value)==null?void 0:M.attrs.id)||""}),E=o.inject("canEditSuper",o.ref(!0));function k(M){var F,R;if(lh(M)){T();return}const $=e.getPos(),H=(F=e.editor)==null?void 0:F.state.doc.nodeAt($),K=M.trim(),{[ot.ELEMENT_ID]:N,...V}=(H==null?void 0:H.attrs)||{};(R=e.editor)==null||R.view.dispatch(e.editor.state.tr.setNodeMarkup($,void 0,{...V,[ot.TEXT]:K})),requestAnimationFrame(()=>{e.editor.commands.setTextSelection($+1),e.editor.view.focus()})}function C(M){c.value=M;const $=e.node.attrs[ot.TEXT],H=e.node.attrs[ot.ID],N={lineId:M.target.querySelector(`[node-id="${H}"]`).getAttribute("line-id"),dataId:H,text:$};s.emit({action:"hover",payload:N})}function _(M){const $=e.node.attrs[ot.ID],K={lineId:M==null?void 0:M.target.querySelector(`[node-id="${$}"]`).getAttribute("line-id"),dataId:$,text:""};s.emit({action:"hover",payload:K}),c.value=null}function T(){const{getPos:M,node:$,editor:H}=e,K=M(),N=K+1;H.commands.deleteRange({from:K,to:N})}function A(){if(!E.value)return;const{attributes:M}=e.editor.options.editorProps;if(M&&M.id===ar.COMMENT){const $=document.getElementById(ar.COMMENT);if(($==null?void 0:$.getAttribute(ar.DISABLE_SUPER_INPUT))==="true")return}e.editor.view.dom.blur(),n.value=!0}function I(){e.editor.commands.setSuperTextContent(e.node.attrs[ot.TEXT],e.node.attrs[ot.POSITION]),e.editor.commands.toggleSuperInputMoblie()}o.watch(i,M=>{r&&(e.editor.setEditable(!M),M?e.editor.view.dom.classList.add("super-text-view-mode"):e.editor.view.dom.classList.remove("super-text-view-mode"))});const O=o.computed(()=>`{${e.node.attrs[ot.TEXT].replace(/<\/p>\s*<p>/g,"<br/>").replace(/<\/?p[^>]*>/g,"").trim()}}`);return(M,$)=>{const H=gn,K=Qb,N=Zb,V=Jb,F=Yb,R=Dc;return o.openBlock(),o.createBlock(o.unref(Zs),o.mergeProps({as:"span",class:o.unref(UX)("text-inherit super-text shrink-0 inline-flex items-center justify-center",o.unref(r)&&i.value&&"block"),"data-drag-handle":"",draggable:o.unref(E)},o.toHandlers(v.value)),{default:o.withCtx(()=>[o.unref(r)&&!i.value?(o.openBlock(),o.createElementBlock("button",{key:0,onClick:o.withModifiers(I,["stop"]),class:"w-6 inline-flex justify-center rounded text-ed-red-500 active:bg-ed-accent"},[o.createVNode(o.unref(At),{name:"fileEdit2",class:"w-5 h-5"})])):o.createCommentVNode("",!0),o.unref(r)&&i.value?(o.openBlock(),o.createElementBlock("div",{key:1,innerHTML:O.value,onClick:o.withModifiers(I,["stop"]),class:"super-text-view-mode-item"},null,8,WX)):o.createCommentVNode("",!0),o.unref(r)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(F,{key:2},{default:o.withCtx(()=>[o.createVNode(K,{as:"template",class:"relative",disabled:!o.unref(E)},{default:o.withCtx(()=>[o.createVNode(H,{class:o.normalizeClass([{"pointer-events-none":!o.unref(E)},"!p-0 !m-0 !h-fit"]),variant:"ghost",onDblclick:o.withModifiers(A,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(At),{name:"fileEdit"}),o.createElementVNode("div",{ref:"bookMarkRef","book-mark-node-id":e.node.attrs[o.unref(ot).ID],"book-mark-content":e.node.attrs[o.unref(ot).TEXT],"node-id":e.node.attrs[o.unref(ot).ID],"element-id":e.node.attrs[o.unref(ot).ELEMENT_ID],"line-id":x.value},null,8,jX)]),_:1},8,["class"])]),_:1},8,["disabled"]),o.createVNode(V,null,{default:o.withCtx(()=>[o.createVNode(N,{onSelect:$[0]||($[0]=W=>n.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(M.$t("editor.super.edit")),1)]),_:1}),o.createVNode(N,{onSelect:T},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(M.$t("editor.super.delete")),1)]),_:1})]),_:1})]),_:1})),o.unref(r)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(R,{key:3,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[o.unref(ot).TEXT],"super-text-element-id":e.node.attrs[o.unref(ot).ELEMENT_ID],onClose:$[1]||($[1]=W=>n.value=!1),onSave:k},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},16,["class","draggable"])}}}),KX=new rt({props:{handleKeyDown(t,e){var n;if(e.key==="Backspace"){const{state:r,dispatch:i}=t,{$from:s}=r.selection;if(s.parentOffset===1){const u=s.nodeAfter;if(u&&u.type.name==="superText"){const c=r.tr;c.delete(s.pos-1,s.pos);const f=r.schema.text("");return c.insert(s.pos-1,ge.from(f)),c.setSelection(Ve.create(c.doc,s.pos)),i(c),e.preventDefault(),!0}}const a=s.nodeBefore,l=s.nodeAfter;if(a&&a.isText&&((n=a.text)==null?void 0:n.length)===1&&l&&l.type.name==="superText"){const u=s.parent.childBefore(s.parentOffset-1).node;if(u&&u.type.name==="superText"){const c=r.tr;return c.delete(s.pos-1,s.pos),c.setSelection(Ve.create(c.doc,s.pos-1)),i(c),e.preventDefault(),!0}}}return!1}}}),GX=new rt({appendTransaction(t,e,n){const r=new Set;let i=n.tr,s=!1;return n.doc.descendants((a,l)=>{if(a.type.name===Pc){const u=a.attrs[ot.ID];if(!u||r.has(u)){const c=Gr();i=i.setNodeMarkup(l,void 0,{...a.attrs,[ot.ID]:c}),s=!0,r.add(c)}else r.add(u)}}),s?i:null}}),Pc="superText",gE={UPDATE:"superTextUpdate"},bE=Rt.create({name:"superText",inline:!0,group:"inline",selectable:!1,defining:!0,draggable:!0,addStorage(){return{enable:!0,isShowSuperInputMoblie:!1,view:!0,items:[],superInputModal:this.options.superInputModal,toggleSuperViewMobileCallBack:this.options.toggleSuperViewMobileCallBack,bottomSheetComponent:this.options.bottomSheetComponent,addToast:this.options.addToast,superTextContent:"",superTextPosition:""}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>n?[{component:Ge,componentProps:{action:()=>{t.commands.toggleSuperInputMoblie()},isActive:()=>{},icon:"fileEdit",title:e("editor.menubar.menu.insertSuper"),tooltip:e("editor.menubar.menu.insertSuper"),customClass:"whitespace-nowrap !bg-ed-blue active:!bg-ed-blue/90 !transition-none !text-white !font-normal rounded-[3px] h-[26px] ml-auto",customClassTooltip:"ml-auto"}}]:[{component:Ge,componentProps:{action:()=>t.commands.toggleSuperTextView(),isActive:()=>t.storage.superText.enable,title:e("editor.menubar.menu.superView"),customClass:`whitespace-nowrap !text-white !font-normal rounded-[3px] h-[26px]
|
|
330
|
+
`){N.push(K),K="";continue}if(K+=F,k.measureText(K).width>$())for(;k.measureText(K).width>$();){const R=H(K,$());R<=0?(N.push(K.charAt(0)),K=K.slice(1)):(N.push(K.slice(0,R)),K=K.slice(R))}}return N.push(K),N.map(F=>`<p>${F}</p>`).join("")}const _=o.computed(()=>{var O,M,$;const I=($=(M=(O=r.parentEditor)==null?void 0:O.storage.superText.superInputModal)==null?void 0:M.props)==null?void 0:$.guidelineLeftOffset;return s.value||!I?{}:{backgroundImage:"linear-gradient(to right, #d1d5db 1px, transparent 1px)",backgroundSize:"1px 100%",backgroundRepeat:"no-repeat",backgroundPosition:rn(I)}}),{isScrolling:T,handleScroll:A}=Wl();return e({insertSpecialCharater:m,isChecked:u,toggleSpellCheck:g,wrapText:C,editor:p}),(I,O)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"contentInner",ref:b,style:o.normalizeStyle([o.unref(x),o.unref(_)]),onScroll:O[0]||(O[0]=(...M)=>o.unref(A)&&o.unref(A)(...M)),class:o.normalizeClass(o.unref(Se)("h-40 overflow-y-auto border focus-within:border-ed-input-focus rounded-[3px] p-2.5 relative",I.isReadOnly&&"border-none",o.unref(s)&&"h-auto min-h-20 max-h-44 border-ed-gray rounded-md px-4 py-2.5",o.unref(s)&&!o.unref(T)&&"scrollbar-thumb-transparent"))},[o.createVNode(o.unref(Zn),{id:"editor-panel",editor:o.unref(p),class:o.normalizeClass(o.unref(Se)("vdc-editor relative h-full"))},null,8,["editor","class"])],38))}}),eX={class:"sr-only"},tX={class:"grid m-2.5 p-2.5 gap-y-2.5 rounded border border-gray-200"},nX={class:"grid grid-cols-[70px,1fr] gap-x-2"},rX={class:"flex gap-x-7"},oX={class:"flex items-center space-x-2 text-xs font-normal [&>input[type='checkbox']]:h-[20px] [&>input[type='checkbox']]:w-[20px] [&>input[type='checkbox']]:!border-ed-border [&>input[type='checkbox']]:shadow"},iX=["checked"],sX={for:"spellcheck",class:"select-none whitespace-nowrap"},aX={class:"flex gap-x-1"},lX={class:"grid grid-cols-[70px,1fr] gap-x-2"},uX={class:"text-right text-sm p-2"},cX={class:"grid grid-cols-[70px,1fr] gap-x-2"},Dc=o.defineComponent({__name:"SuperInputDialog",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextElementId:{}},emits:["close","save"],setup(t,{emit:e}){var N,V;const n=e,r=t,{t:i}=_t(),s=o.ref(""),a=o.ref(""),l=o.ref(null),u=o.ref(!1),c=et.useLocalStorage("superInputModalPosition",null),f=o.reactive({x:0,y:0}),p=o.ref(!1),m={x:0,y:0},g=o.ref(!1),b=o.ref(!1),v=o.ref(!1),y=F=>{p.value=!0;const R=F.currentTarget.closest(".draggable-dialog").getBoundingClientRect();m.x=F.clientX-R.left,m.y=F.clientY-R.top,document.addEventListener("mousemove",x),document.addEventListener("mouseup",E)},x=F=>{p.value&&(f.x=F.clientX-m.x,f.y=F.clientY-m.y)},E=()=>{p.value=!1,c.value={x:f.x,y:f.y},document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",E)};o.watch(()=>r.open,async F=>{if(!F)return;b.value=!1,r.superTextInit&&(s.value=r.superTextInit,r.superTextElementId&&(a.value=r.superTextElementId)),await o.nextTick();const R=document.querySelector(".draggable-dialog");if(!R)return;R.getBoundingClientRect();const W=window.innerWidth,P=window.innerHeight;c.value&&c.value.x!==void 0&&c.value.y!==void 0?(f.x=c.value.x,f.y=c.value.y):(f.x=Math.max((W-R.offsetWidth)/2,0),f.y=Math.max((P-R.offsetHeight)/2,0))});const k=()=>{n("close"),s.value="",a.value="",u.value=!1},C=()=>{var R;if((R=l.value)==null?void 0:R.editor.commands.hasInvalidChar()){v.value=!0;return}s.value=l.value.wrapText(),a.value="",b.value?g.value=!0:n("close"),n("save",s.value),s.value=""},_=()=>{g.value=!1,n("close")},T=(V=(N=r.editor)==null?void 0:N.extensionManager.extensions.find(F=>F.name==="superText"))==null?void 0:V.options.specialCharModal,A=o.computed(()=>{var F,R,W;return(W=(R=(F=r.editor)==null?void 0:F.storage.superText.superInputModal)==null?void 0:R.props)==null?void 0:W.fontFamily}),I=et.useLocalStorage("recentSpecialChars",[]),O=F=>{if(!F)return;const R=(I.value??[]).filter(W=>W!==F);R.unshift(F),I.value=R.slice(0,5)},M=F=>{var R;(R=l.value)==null||R.insertSpecialCharater(F)},$=(F,R)=>{var W;R&&((W=l.value)==null||W.insertSpecialCharater(F),O(F))},H=o.computed(()=>{var F;return(F=l.value)==null?void 0:F.isChecked}),K=()=>{var F;(F=l.value)==null||F.toggleSpellCheck()};return o.onUnmounted(()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",E)}),o.watch(s,F=>{!r.superTextElementId||r.superTextElementId===""||(b.value=F!==(r.superTextInit??""))}),(F,R)=>{const W=sh,P=ih,G=oh,Y=rh,le=Nb,fe=Lc,ce=Rc,oe=NG;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(ce,{open:F.open},{default:o.withCtx(()=>[o.createVNode(o.unref(I1),null,{default:o.withCtx(()=>[o.createVNode(o.unref(F1),{class:"!pointer-events-none bg-black/30"}),o.createVNode(fe,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none max-w-max","as-child":""},{default:o.withCtx(()=>{var Oe;return[o.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:o.normalizeStyle({top:"0px",left:"0px",transform:`translate(${f.x}px, ${f.y}px)`,fontFamily:o.unref(A)})},[o.createVNode(G,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:o.withModifiers(y,["prevent"])},{default:o.withCtx(()=>[o.createVNode(W,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.superinput")),1)]),_:1}),o.createVNode(P,{class:"absolute right-3 top-3 text-white",onClick:k},{default:o.withCtx(()=>[o.createVNode(o.unref(xc),{class:"w-5 h-5"}),o.createElementVNode("span",eX,o.toDisplayString(F.$t("editor.close")),1)]),_:1})]),_:1}),o.createVNode(Y),o.createElementVNode("div",tX,[o.createElementVNode("div",nX,[R[5]||(R[5]=o.createElementVNode("label",null," ",-1)),o.createElementVNode("div",rX,[o.createVNode(gn,{class:"text-[#65558F] bg-[#ECE6F0] hover:bg-[#ECE6F0]/90 shadow text-xs rounded font-normal h-[25px] px-3",onClick:R[0]||(R[0]=X=>u.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.insert.symbol")),1)]),_:1}),o.createElementVNode("div",oX,[o.createElementVNode("input",{id:"spellcheck",type:"checkbox",class:"shrink-0",checked:o.unref(H),onChange:K},null,40,iX),o.createElementVNode("label",sX,o.toDisplayString(o.unref(i)("editor.menubar.menu.spellCheck")),1)]),o.createElementVNode("div",aX,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(I),X=>(o.openBlock(),o.createBlock(gn,{key:X,variant:"outline",size:"xs",class:"h-[25px] w-[25px] p-0",onClick:ee=>M(X)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(X),1)]),_:2},1032,["onClick"]))),128))])]),u.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent((Oe=o.unref(T))==null?void 0:Oe.component),o.mergeProps({key:0,"custom-class":"!z-[70] !pointer-events-auto","font-family":o.unref(A)},o.unref(T).props,{onSelectedChar:$,onClose:R[1]||(R[1]=X=>u.value=!1)}),null,16,["font-family"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",lX,[o.createElementVNode("label",uX,o.toDisplayString(o.unref(i)("editor.detail")),1),o.createVNode(ev,{ref_key:"simpleEditorRef",ref:l,modelValue:s.value,"onUpdate:modelValue":R[2]||(R[2]=X=>s.value=X),"parent-editor":F.editor,class:""},null,8,["modelValue","parent-editor"])]),o.createElementVNode("div",cX,[R[6]||(R[6]=o.createElementVNode("label",{class:"text-right text-sm p-2"},"ID",-1)),o.createVNode(fs,{modelValue:a.value,"onUpdate:modelValue":R[3]||(R[3]=X=>a.value=X),class:"rounded-none","default-value":a.value,disabled:""},null,8,["modelValue","default-value"])])]),o.createVNode(le,{class:"sm:justify-center pb-3.5 pt-1"},{default:o.withCtx(()=>[o.createVNode(gn,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:C},{default:o.withCtx(()=>[o.createVNode(o.unref(ob),{class:"w-5 h-5 mr-2"}),o.createTextVNode(" "+o.toDisplayString(o.unref(i)("editor.check")),1)]),_:1}),o.createVNode(gn,{as:"button",variant:"destructive",onClick:k},{default:o.withCtx(()=>[o.createVNode(o.unref(xc),{class:"w-5 h-5 mr-2"}),o.createTextVNode(" "+o.toDisplayString(F.$t("editor.close")),1)]),_:1})]),_:1})],4)]}),_:1})]),_:1})]),_:1},8,["open"]),o.createVNode(oe,{open:g.value,onClose:_},null,8,["open"]),o.createVNode(oe,{title:"Information",message:"{ 과 } 는 입력이 제한된 문자열 입니다.",iconName:"MessageCircleWarning",confirmText:"Ok",open:v.value,onClose:R[4]||(R[4]=Oe=>v.value=!1)},null,8,["open"])],64)}}}),tv=o.defineComponent({__name:"SelectContextMenu",props:{editor:{},mode:{},superTextStore:{},disabled:{type:Boolean},disableSuperInput:{type:Boolean}},setup(t,{expose:e}){const n=t,{t:r}=_t(),i=o.ref(!1),s=o.reactive({from:0,to:0,text:""}),a=o.inject("isEditable",o.ref(!0)),l=o.inject("canEditSuper",o.ref(!0)),u=o.computed(()=>n.mode===Ie.EDITOR||n.mode===Ie.PLAIN_TEXT||!l.value||n.disableSuperInput);function c(){if(!n.editor)return"";const{from:E,to:k}=n.editor.state.selection,C=n.editor.state.doc.cut(E,k),T=Dr.fromSchema(n.editor.schema).serializeFragment(C.content),A=document.createElement("div");return A.appendChild(T),A.innerHTML}const f=()=>{const{view:E}=n.editor,{from:k,to:C}=E.state.selection,_=c();s.text=_,s.from=k,s.to=C},p=()=>i.value=!i.value,m=()=>{u.value||(i.value=!0,f())},g=()=>i.value=!1,b=E=>{const k=n==null?void 0:n.superTextStore.addMoreSuperText(E);n.editor&&n.editor.commands.insertContentAt(s.from,{type:"superText",attrs:{"data-id":k,"data-text":E}}),i.value=!1,requestAnimationFrame(()=>{n.editor.commands.setTextSelection(s.from+1),n.editor.view.focus()})},v=o.ref(!1),y=async E=>{var k,C;if(E){const _=await((C=(k=n.editor).hasClipboard)==null?void 0:C.call(k));v.value=!!_}},x=()=>{if(u.value||!n.editor)return;const{view:E,state:k}=n.editor,{from:C,to:_}=k.selection;s.from=C,s.to=_,s.text="",E.dom.blur(),i.value=!0};return e({toggleDialog:p,openDialog:m,closeDialog:g}),(E,k)=>{const C=Dc,_=Qb,T=Zb,A=Jb,I=Yb;return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(C,{open:i.value,editor:E.editor,"super-text-init":s.text,onClose:p,onSave:b},null,8,["open","editor","super-text-init"]),o.createVNode(I,{"onUpdate:open":y},{default:o.withCtx(()=>[o.createVNode(_,{as:"template",class:"relative",disabled:o.unref(u),onDblclick:o.withModifiers(x,["prevent","stop"])},{default:o.withCtx(()=>[o.renderSlot(E.$slots,"default")]),_:3},8,["disabled"]),o.createVNode(A,null,{default:o.withCtx(()=>[E.disableSuperInput?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(T,{key:0,onSelect:m},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.inputSuper")),1)]),_:1})),o.unref(a)?(o.openBlock(),o.createBlock(T,{key:1,onSelect:k[0]||(k[0]=O=>{var M;return(M=E.editor)==null?void 0:M.commands.cutContent()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.cut")),1)]),_:1})):o.createCommentVNode("",!0),o.unref(a)?(o.openBlock(),o.createBlock(T,{key:2,onSelect:k[1]||(k[1]=O=>{var M;return(M=E.editor)==null?void 0:M.commands.copyContent()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.copy")),1)]),_:1})):o.createCommentVNode("",!0),o.unref(a)?(o.openBlock(),o.createBlock(T,{key:3,disabled:!v.value,onSelect:k[2]||(k[2]=O=>{var M;return(M=E.editor)==null?void 0:M.commands.pasteContent()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("editor.paste")),1)]),_:1},8,["disabled"])):o.createCommentVNode("",!0)]),_:1})]),_:3})],64)}}});var cr=(t=>(t.TOGGLE_SUPER_TEXT="toggle-super-text",t.SUPER_TEXT_UPDATE_POSITION="SUPER_TEXT_UPDATE_POSITION",t.RENDER_SUPER_TEXT="RENDER_SUPER_TEXT",t.SUPER_VIEW_PAGE="SUPER_VIEW_PAGE",t.INCREASE_DECREASE_FONTSIZE="increase-decrease-fontsize",t))(cr||{});const dX={id:"editor-panel",class:"flex relative w-full h-full"},fX=uo(o.defineComponent({__name:"PageNode",props:Qs,setup(t){const{state:e,page:n,superTextStore:r}=yn(),{size:i,pagination:s,margin:a}=n.value,l=o.ref(null),u=o.ref(t.node.attrs.viewSuperTextArea),c=o.computed(()=>u.value&&t.editor.storage.page.mode!=="editor"),f=o.computed(()=>t.editor.storage.page.mode===Ie.REPORT),{width:p,height:m}=i,g=o.computed(()=>s?`calc(${m} - ${(a==null?void 0:a.top)??0} - ${(a==null?void 0:a.bottom)??0}`:"max-content"),b=et.useEventBus(cr.SUPER_VIEW_PAGE);return o.watch(()=>t.node.attrs,v=>{b.emit(v.pageNumber)},{immediate:!0}),(v,y)=>{var E,k,C,_;const x=tv;return o.openBlock(),o.createBlock(o.unref(Zs),{id:v.node.attrs.id,ref_key:"containerRef",ref:l,"page-number":v.node.attrs.pageNumber,class:"overflow-hidden umo-page-node-view w-full border rounded-[3px] border-[#999999]",style:o.normalizeStyle({"--umo-page-margin-top":((E=o.unref(a))==null?void 0:E.top)??"0","--umo-page-margin-bottom":((k=o.unref(a))==null?void 0:k.bottom)??"0","--umo-page-margin-left":((C=o.unref(a))==null?void 0:C.left)??"0","--umo-page-margin-right":((_=o.unref(a))==null?void 0:_.right)??"0","--umo-page-width":o.unref(p),"--umo-page-height":o.unref(m),"--empty-node-left":"0px",left:100,"min-height":typeof o.unref(m)=="number"?`${o.unref(m)}px`:o.unref(m),height:f.value?typeof o.unref(m)=="number"?`${o.unref(m)}px`:o.unref(m):"auto"})},{default:o.withCtx(()=>[o.createElementVNode("div",dX,[o.createVNode(x,{mode:c.value?o.unref(Ie).REPORT:o.unref(Ie).EDITOR,editor:v.editor,"super-text-store":o.unref(r)},{default:o.withCtx(()=>[o.createVNode(o.unref(Y4),{class:"umo-page-node-content",style:o.normalizeStyle({height:g.value})},null,8,["style"])]),_:1},8,["mode","editor","super-text-store"])])]),_:1},8,["id","page-number","style"])}}}),[["__scopeId","data-v-7d55d7ea"]]);function uE(t,e){const n=t.storedMarks??(t.selection.$to.parentOffset&&t.selection.$from.marks());if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const pX=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:a}=e,{$from:l,$to:u}=s,c=i.extensionManager.attributes,f=ah(c,l.node().type.name,l.node().attrs);if(f.id=Xb(),f.extend&&(f.extend=!1),s instanceof Fe&&s.node.isBlock)return!l.parentOffset||!vr(a,l.pos)?!1:(r&&(t&&uE(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const p=u.parentOffset===u.parent.content.size;s instanceof Ve&&e.deleteSelection();const m=l.depth===0?void 0:Yw(l.node(-1).contentMatchAt(l.indexAfter(-1)));let g=p&&m?[{type:m,attrs:f}]:void 0,b=vr(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!b&&vr(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,g=m?[{type:m,attrs:f}]:void 0),b&&(g||(g=[{type:l.node().type,attrs:f}]),e.split(e.mapping.map(l.pos),1,g),m&&!p&&!l.parentOffset&&l.parent.type!==m)){const v=e.mapping.map(l.before()),y=e.doc.resolve(v);l.node(-1).canReplaceWith(y.index(),y.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&uE(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},hX=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var v;const s=bn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection instanceof Fe?n.selection.node:null;if(u!=null&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let y=ge.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let A=a.depth-x;A>=a.depth-3;A-=1)y=ge.from(a.node(A).copy(y));const E=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,k=ah(f,a.node().type.name,a.node().attrs),C=((v=s.contentMatch.defaultType)==null?void 0:v.createAndFill(k))??void 0;y=y.append(ge.from(s.createAndFill(null,C)??void 0));const _=a.before(a.depth-(x-1));e.replace(_,a.after(-E),new Te(y,4-x,0));let T=-1;e.doc.nodesBetween(_,e.doc.content.size,(A,I)=>{if(T>-1)return!1;A.isTextblock&&A.content.size===0&&(T=I+1)}),T>-1&&e.setSelection(Ve.near(e.doc.resolve(T))),e.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,m=ah(f,c.type.name,c.attrs),g=ah(f,a.node().type.name,a.node().attrs);m.id=Xb(),g.id=Xb(),e.delete(a.pos,l.pos);const b=p?[{type:s,attrs:m},{type:p,attrs:g}]:[{type:s,attrs:m}];if(!vr(e.doc,a.pos,2))return!1;if(r){const{selection:y,storedMarks:x}=n,{splittableMarks:E}=i.extensionManager,k=x??(y.$to.parentOffset&&y.$from.marks());if(e.split(a.pos,2,b).scrollIntoView(),!k||!r)return!0;const C=k.filter(_=>E.includes(_.type.name));e.ensureMarks(C)}return!0},mX=[Kf,qf,Gf,wg,Xf,us,Cg,Tl,kg,_g,Eg,ca,Al,gi,Sg,Tg,xg,Kr],gX=Rt.create({priority:200,name:`${Kr}`,content:"block*",group:`${Kr}`,isolating:!0,selectable:!1,draggable:!1,isLeaf:!0,addOptions(){return{SystemAttributes:{},nodesComputed:{},View:Ns(fX),types:[],slots:{}}},addAttributes(){return{HTMLAttributes:{},id:{default:Gr(10)},pageNumber:{default:1},force:{default:!1},viewSuperTextArea:{default:!0},slots:{default:this.options.slots,renderHTML:()=>({})}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["div",{...yt(e),"data-type":this.name},0]},addCommands(){return{splitBlock:pX,splitListItem:hX,autoPaging:(t=!0)=>({tr:e,state:n,dispatch:r,editor:i})=>(r&&e.setMeta("runState",t),!0),setPageBreak:()=>({tr:t,state:e,dispatch:n,editor:r})=>(n&&t.setMeta("splitPage",!0),!0),togglePagePlugin:t=>({tr:e,dispatch:n})=>(e.setMeta("disablePage",t),n&&n(e),!0)}},addGlobalAttributes(){return[{types:mX.concat(this.options.types||[]),attributes:{id:{default:null},extend:{default:!1}}}]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{empty:l,$anchor:u}=s,{pos:c,parent:f}=u,p=je.atStart(a).from===c;return!l||!p||!f.type.isTextblock||f.textContent.length?!1:r.clearNodes()}),()=>cE(r),()=>r.joinBackward(),()=>r.selectNodeBackward(),()=>r.command(({editor:i,tr:s})=>{const{selection:a,doc:l}=s,{$anchor:u}=a,{pos:c}=u;if(l.childCount===1)return!1;if(je.atEnd(l).from===c&&!u.parentOffset)return r.deleteNode(Kr);const f=ai(p=>p.type.name===Kr)(a);if(f){if(!f.node.firstChild)return r.deleteNode(Kr);const p=f.node.firstChild.type;if(f.start+je.atStart(f.node).from===c){const g=Ve.create(l,f.start-2,f.start-2),b=ai(v=>v.type.name===Kr)(g);if(b){const v=je.atEnd(b.node).from+b.start,y=Ve.create(l,v,v);if(p===b.node.lastChild.type){const{parent:x}=y.$anchor;return GG(x,i.schema)?s.setSelection(y):s.step(new hn(v,c,Te.empty)),!0}s.setSelection(y)}return!0}}return!1})]),Delete:()=>this.editor.commands.first(({commands:r})=>[()=>cE(r),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{$anchor:l}=s,u=l.node(),c=ai(f=>f.type.name===Tl)(s);return c&&c.start+je.atStart(c.node).from===l.pos&&c.node.childCount===1&&u.content.size===0?!0:r.joinForward()}),()=>r.selectNodeForward(),()=>r.command(({tr:i})=>{const{selection:s,doc:a}=i,{$anchor:l}=s,{pos:u}=l;if(a.childCount===1)return!1;if(je.atEnd(a).from===u)return r.deleteNode(Kr);const c=ai(f=>f.type.name===Kr)(s);if(c&&c.start+je.atEnd(c.node).from===u){const p=Ve.create(a,u+2,u+2),m=ai(g=>g.type.name===Kr)(p);if(m){const g=je.atStart(m.node).from+m.start,b=Ve.create(a,g,g);if(ai(y=>y.attrs.extend)(b))return i.step(new hn(u,g,Te.empty)),!0}}return!1})]),Tab:()=>this.editor.commands.first(({commands:r})=>[()=>!0]),"Mod-Enter":()=>this.editor.commands.setPageBreak()}},addNodeView(){return this.options.View}});function ah(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}const cE=t=>t.command(({tr:e})=>{const{selection:n,doc:r}=e,i=Jw(r,{from:n.from,to:n.to},s=>s.type.name===Tl);for(const s of i){const a=s.pos+s.node.nodeSize;if(n.from<s.pos||n.to>a)return!0}return t.deleteSelection()}),bX=nt.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),vX=["data-font"],yX=o.defineComponent({__name:"FontFamilyMenuButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},shortcutKeys:{default:void 0},maxHeight:{default:void 0},tooltip:{default:""},items:{default:()=>[]},customClass:{default:""},showDefaultDivider:{type:Boolean,default:!1}},setup(t){const e=t,n=o.computed(()=>e.editor.extensionStorage["base-kit"].mode===Ie.EDITOR),{t:r}=_t(),i=[{label:r("editor.fontFamily.gulim"),value:"Gulim"},{label:r("editor.fontFamily.dotum"),value:"Dotum"},{label:r("editor.fontFamily.gungsuh"),value:"Gungsuh"}],s=o.inject("fontFamily"),a=o.computed(()=>{const p=e.editor.extensionManager.extensions.find(g=>g.name==="fontFamily").options;let m=[];return kt.isEmpty(p.fontFamilyList)?m=i:m=p.fontFamilyList.filter(g=>g.enabled!==!1).map(g=>({label:g.label,value:g.value})),[{label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")},...m]}),l=o.computed(()=>{const p={label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")};return n.value?M0(e.editor.state,"textStyle").fontFamily||p.value:s.value||p.value}),u=et.useEventBus("fontFamily");function c(p){p.value===l.value||p.value===r("editor.fontFamily.default")?(e.editor.chain().focus().unsetFontFamily().run(),s.value=null):(s.value=p.value,e.editor.chain().focus().setFontFamily(p.value).run(),u.emit()),e.editor.commands.setForceCloseBubble(!0)}e.editor.on("selectionUpdate",({editor:p})=>{p.state.selection.empty&&e.editor.commands.resetForceCloseBubble()});const f=o.computed(()=>{var m,g;const p=((m=a.value[0])==null?void 0:m.label)||r("editor.fontFamily.default");return((g=a.value.find(b=>b.value===l.value))==null?void 0:g.label)||p});return(p,m)=>(o.openBlock(),o.createBlock(ya,{disabled:p.disabled,tooltip:p.tooltip,title:f.value,btn_class:`min-w-20 ${p.customClass}`,class:"inside-toolbar"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(g,b)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:b},[o.createVNode(o.unref(Dl),{checked:l.value===g.value,onClick:v=>c(g)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:"ml-1 h-full","data-font":g.label,style:o.normalizeStyle({fontFamily:g.value??void 0})},o.toDisplayString(g.label),13,vX)]),_:2},1032,["checked","onClick"]),g.label===o.unref(r)("editor.fontFamily.default")&&p.showDefaultDivider?(o.openBlock(),o.createBlock(o.unref(ab),{key:0})):o.createCommentVNode("",!0)],64))),128))]),_:1},8,["disabled","tooltip","title","btn_class"]))}}),dE=bX.extend({name:"fontFamily",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["textStyle"],fontFamilyList:[],button({editor:e,extension:n,t:r}){return{component:yX,componentProps:{editor:e,disabled:!e.can().setFontFamily(""),tooltip:r("editor.fontFamily.tooltip")}}}}},addGlobalAttributes(){return[{types:["paragraph","heading","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.style.fontFamily||null,renderHTML:t=>t.style?{style:`font-family: ${t.style}`}:{}},fontFamily:{default:null,parseHTML:t=>t.style.fontFamily.replace(/['"]/g,""),renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontFamily}}),wX={class:"flex gap-2"},xX=["disabled"],CX=uo(o.defineComponent({__name:"FontSizeIncreaseDecrease",props:{editor:Object},setup(t){const e=o.inject("fontSize"),n=o.computed(()=>e.value?parseInt(e.value)===parseInt(r1[0])||parseInt(e.value)<parseInt(r1[0]):!1),r=et.useEventBus(cr.INCREASE_DECREASE_FONTSIZE),i=s=>{r.emit(s)};return(s,a)=>{const l=pa,u=fa,c=ha;return o.openBlock(),o.createElementBlock("div",wX,[o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u,{"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(l,null,{default:o.withCtx(()=>[o.createElementVNode("button",{class:"btn",onClick:a[0]||(a[0]=f=>i(!0))},[o.createVNode(o.unref(At),{name:"Plus",class:"w-6 h-6"})])]),_:1}),o.createVNode(o.unref(ps),null,{default:o.withCtx(()=>a[2]||(a[2]=[o.createTextVNode(" 글꼴 크기 크게 ")])),_:1})]),_:1})]),_:1}),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(u,{"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(l,null,{default:o.withCtx(()=>[o.createElementVNode("button",{class:"btn",onClick:a[1]||(a[1]=f=>i(!1)),disabled:o.unref(n)},[o.createVNode(o.unref(At),{name:"Minus",class:"w-6 h-6"})],8,xX)]),_:1}),o.createVNode(o.unref(ps),null,{default:o.withCtx(()=>a[3]||(a[3]=[o.createTextVNode(" 글꼴 크기 작게 ")])),_:1})]),_:1})]),_:1})])}}}),[["__scopeId","data-v-250d04b3"]]),EX=Hn.create({name:"fontSizeIncreaseDecrease",addOptions(){return{defaultSize:"14px",button({editor:t}){return{component:CX,componentProps:{editor:t}}}}},addAttributes(){return{size:{default:this.options.defaultSize,parseHTML:t=>t.style.fontSize||this.options.defaultSize,renderHTML:t=>t.size?{style:`font-size: ${t.size}`}:{}}}},addCommands(){return{setFontSizeIncreaseDecrease:t=>({commands:e})=>e.setMark("textStyle",{fontSize:t})}}}),nv=nt.create({name:"painter",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:Ge,componentProps:{action:()=>{e.commands.setPainter(e==null?void 0:e.state.selection.$head.marks())},icon:"PaintRoller",tooltip:r("editor.format")}})}},addCommands(){return{setPainter:t=>({view:{dispatch:e,state:{tr:n},dom:r}})=>{const a=`url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;return r.style.cursor=a,e(n.setMeta("painterAction",{type:"start",marks:t})),!0}}},addProseMirrorPlugins(){return[new rt({key:new Et("format-painter"),state:{init:()=>[],apply:(t,e)=>{const n=t.getMeta("painterAction");return n&&n.type==="start"?e=n.marks:n&&n.type==="end"&&(e=[]),e}},props:{handleDOMEvents:{mousedown(t,e){const n=this.getState(t.state);if(!n||n.length==0)return t.dom.style.cursor="",!1;const r=()=>{document.removeEventListener("mouseup",r);const{dispatch:i,state:{selection:s},dom:a}=t;let l=t.state.tr;a.style.cursor="",l=l.removeMark(s.from,s.to);for(const u of n)u.type.name!="link"&&(l=l.addMark(s.from,s.to,u));i(l.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",r),!0}}}})]}}),rv=()=>Gr(10),fE=new Et("attrkey"),kX=t=>new rt({key:fE,state:{init:()=>!1,apply:n=>n.getMeta("initSplit")},appendTransaction(n,r,i){const{tr:s}=i;let a=!1;const l=fE.getState(i);if(n.some(c=>c.getMeta("composition")))return null;if(l||n.some(c=>c.docChanged)){const c=[];i.doc.descendants((f,p,m,g)=>{const{attrs:b}=f,v=c.includes(b.id)?rv():b.id||rv();t.includes(f.type.name)&&(s.setNodeMarkup(p,void 0,{...b,id:v,"number-line":g+1}),a=!0),c.push(v)})}return a?s:null}}),pE=[Kf,qf,Gf,wg,Xf,us,Cg,Tl,kg,_g,Eg,ca,Al,gi,Sg,Tg,xg,Kr],SX=nt.create({name:"autoId",addGlobalAttributes(){return[{types:pE.concat(this.options.types||[]),attributes:{id:{default:rv()},extend:{default:!1},class:{default:null},"number-line":{default:null}}}]},addProseMirrorPlugins(){return[kX(pE.concat(this.options.types||[]))]}}),_X=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,TX=Rt.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",yt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[o4({find:_X,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),AX=["src","alt"],MX={key:0,class:"image-resizer"},OX=["onMousedown","onTouchstart"],BX=o.defineComponent({__name:"ImageView",props:{...Qs,selected:{type:Boolean,required:!0}},setup(t){const e=t,n={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"},r=o.inject("isMobile",!1),i=o.ref({width:Z4,height:Z4}),s=o.ref({width:0,height:0}),a=o.ref(!1),l=o.ref({x:0,y:0,w:0,h:0,dir:""}),u=o.computed(()=>{const{src:C,alt:_,width:T,height:A,flipX:I,flipY:O}=e.node.attrs,M=[];I&&M.push("rotateX(180deg)"),O&&M.push("rotateY(180deg)");const $=M.join(" ");return{src:C||void 0,alt:_||void 0,style:{width:i1(T)?`${T}px`:T,height:i1(A)?`${A}px`:A,transform:$||"none"}}});o.computed(()=>({width:o.unref(u).style.width==="100%"?"100%":void 0}));const c=o.ref(null),f=new ResizeObserver(C=>{for(const _ of C){const{width:T,height:A}=_.contentRect;s.value={width:T,height:A},e.updateAttributes({originWidth:T,originHeight:A})}});function p(){const{editor:C,getPos:_}=e;C.commands.setNodeSelection(_())}const m=kt.throttle(()=>{const{editor:C}=e;i.value.width=parseInt(getComputedStyle(C.view.dom).width,10)},Q4);function g(C,_){C.preventDefault(),C.stopPropagation();let T=0,A=0;const I=document.querySelector(".image-resizer");if(I&&(I.style.borderColor="#3b82f6"),"touches"in C&&C.touches.length>0)T=C.touches[0].clientX,A=C.touches[0].clientY;else if("clientX"in C)T=C.clientX,A=C.clientY;else return;const{width:O,height:M}=o.unref(s),$=O/M;let H=Number(e.node.attrs.width)||O,K=Number(e.node.attrs.height)||Math.round(H/$);const N=o.unref(i).width;H=Math.min(H>N?N:H,N),K=Math.round(H/$),Object.assign(l.value,{x:T,y:A,w:H,h:K,dir:_}),a.value=!0,y()}const b=kt.throttle(C=>{if(!o.unref(a))return;let _=0;if("touches"in C&&C.touches.length>0)_=C.touches[0].clientX;else if("clientX"in C)_=C.clientX;else return;const{x:T,w:A,dir:I}=o.unref(l),O=(_-T)*(/l/.test(I)?-1:1),M=UI(A+O,LI,o.unref(i).width);e.updateAttributes({width:M})},Q4),v=C=>{C.preventDefault(),C.stopPropagation();const _=document.querySelector(".image-resizer");_&&(_.style.borderColor=""),o.unref(a)&&(a.value=!1,Object.assign(l.value,{x:0,y:0,w:0,h:0,dir:""}),x(),p())};function y(){document.addEventListener("mousemove",b,!0),document.addEventListener("mouseup",v,!0),document.addEventListener("touchmove",b,!0),document.addEventListener("touchend",v,!0)}function x(){document.removeEventListener("mousemove",b,!0),document.removeEventListener("mouseup",v,!0),document.removeEventListener("touchmove",b,!0),document.removeEventListener("touchend",v,!0)}const E=new ResizeObserver(m),k=o.computed(()=>{const{textAlign:C}=e.node.attrs;return{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[C]||""});return o.onMounted(()=>{c.value&&f.observe(c.value),E.observe(e.editor.view.dom)}),o.onBeforeUnmount(()=>{x(),f.disconnect(),E.disconnect()}),(C,_)=>(o.openBlock(),o.createBlock(o.unref(Zs),{class:"node-image",style:o.normalizeStyle({"pointer-events":o.unref(r)&&t.selected?"none":"auto"})},{default:o.withCtx(()=>[o.createElementVNode("div",{class:"image-view",style:o.normalizeStyle([{width:u.value.style.width,height:u.value.style.height},k.value])},[o.createElementVNode("div",{draggable:"true","data-drag-handle":"",class:o.normalizeClass([{"image-view__body--focused":t.selected,"image-view__body--resizing":a.value},"image-view__body"])},[o.createElementVNode("img",{ref_key:"imageRef",ref:c,src:u.value.src,alt:u.value.alt,class:"block w-full image-view__body__image",style:o.normalizeStyle([{transform:u.value.style.transform}]),onClick:p,onMousedown:_[0]||(_[0]=(...T)=>o.unref(af)&&o.unref(af)(...T))},null,44,AX),C.editor.view.editable?o.withDirectives((o.openBlock(),o.createElementBlock("div",MX,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.values(n),T=>(o.openBlock(),o.createElementBlock("span",{key:T,class:o.normalizeClass(o.unref(Se)(`image-resizer__handler--${T}`,"image-resizer__handler",o.unref(r)&&t.selected&&"pointer-events-auto")),onMousedown:A=>g(A,T),onTouchstart:o.withModifiers(A=>g(A,T),["prevent"])},null,42,OX))),128))],512)),[[o.vShow,t.selected||a.value]]):o.createCommentVNode("",!0)],2)],4)]),_:1},8,["style"]))}}),IX=uo(BX,[["__scopeId","data-v-db9342d0"]]),ov=TX.extend({group:"inline",inline:!0,defining:!0,isolating:!0,addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),flipX:{default:!1},flipY:{default:!1},originWidth:{default:null},originHeight:{default:null},textAlign:{default:"left",parseHTML:e=>e.style.textAlign||e.getAttribute("textAlign")||null,renderHTML:e=>({textAlign:e.textAlign})},width:{default:"100%",parseHTML:e=>{const n=e.style.width||e.getAttribute("width")||null;return n&&n.endsWith("%")?n:n==null?null:parseInt(n,10)},renderHTML:e=>({width:e.width})},height:{default:"auto",parseHTML:e=>{const n=e.style.height||e.getAttribute("height")||null;return n==null?null:parseInt(n,10)},renderHTML:e=>({height:e.height})},class:{default:"",parseHTML:e=>e.getAttribute("class")||"",renderHTML:e=>({class:e.class})},"data-memo":{default:"",parseHTML:e=>e.getAttribute("data-memo")||"",renderHTML:e=>({"data-memo":e["data-memo"]})}}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this)}},addNodeView(){return Ns(IX)},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),updateImage:e=>({commands:n,editor:r})=>n.updateAttributes(this.name,e)}},renderHTML({node:t,HTMLAttributes:e}){const{textAlign:n,flipX:r,flipY:i}=t.attrs,l=`${{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[n]||""} ${r||i?`transform: rotateX(${r?"180":"0"}deg) rotateY(${i?"180":"0"}deg);`:""}`;return["img",yt(this.options.HTMLAttributes,e,{style:l})]},parseHTML(){return[{tag:"img[src]"}]},addProseMirrorPlugins(){return[new rt({props:{handleTextInput(t){const{selection:e}=t.state;return e instanceof Fe&&e.node.type.name==="image"},handlePaste(t){const{selection:e}=t.state;return e instanceof Fe&&e.node.type.name==="image"}}})]}}),RX=["paragraph","heading","list_item","todo_item"];function LX(t,e){const{selection:n,doc:r}=t;if(!n||!r||!(n instanceof Ve||n instanceof Vn))return t;const{from:i,to:s}=n,a=[],l=e&&e!==N4?e:null;return r.nodesBetween(i,s,(u,c)=>{const f=u.type;return RX.includes(f.name)?((u.attrs.lineHeight||null)!==l&&a.push({node:u,pos:c,nodeType:f}),f.name!=="list_item"&&f.name!=="todo_item"):!0}),a.length&&a.forEach(u=>{const{node:c,pos:f,nodeType:p}=u;let{attrs:m}=c;m={...m,lineHeight:l},t=t.setNodeMarkup(f,p,m,c.marks)}),t}function DX(t){return({state:e,dispatch:n})=>{const{selection:r}=e;let{tr:i}=e;return i=i.setSelection(r),i=LX(i,t),i.docChanged?(n&&n(i),!0):!1}}const PX=o.defineComponent({__name:"LineHeightDropdown",props:{editor:{},icon:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const{t:e}=_t();function n(l){return parseFloat(l.replace("%",""))/100}const r=o.computed(()=>{const c=s.editor.extensionManager.extensions.find(f=>f.name==="lineHeight").options.lineHeights.map(f=>({label:n(f),value:f}));return c.unshift({label:o.unref(e)("editor.default"),value:"default"}),c}),i=o.ref("default"),s=t;function a(l){l==="default"?s.editor.chain().focus().unsetLineHeight().run():s.editor.chain().focus().setLineHeight(l).run(),i.value=l}return(l,u)=>(o.openBlock(),o.createBlock(ya,{icon:l.icon,tooltip:l.tooltip,disabled:l.disabled,class:"inside-toolbar"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(c,f)=>(o.openBlock(),o.createBlock(o.unref(Dl),{key:f,checked:c.value===i.value,onClick:p=>a(c.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.label),1)]),_:2},1032,["checked","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),hE=nt.create({name:"lineHeight",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:["100%","115%","150%","200%","250%","300%"],defaultHeight:N4,button({editor:e,t:n}){return{component:PX,componentProps:{editor:e,icon:"LineHeight",tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight||this.options.defaultHeight,renderHTML:t=>t.lineHeight===this.options.defaultHeight||!t.lineHeight?{}:{style:`line-height: ${t.lineHeight}`}}}}]},addCommands(){return{setLineHeight:t=>DX(t),unsetLineHeight:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}}),VX=Rt.create({name:"column",content:"block+",isolating:!0,addAttributes(){return{position:{default:"",parseHTML:t=>t.getAttribute("data-position"),renderHTML:t=>({"data-position":t.position})}}},renderHTML({HTMLAttributes:t}){return["div",yt(t,{"data-type":"column"}),0]},parseHTML(){return[{tag:'div[data-type="column"]'}]}});var Ea=(t=>(t.SidebarLeft="sidebar-left",t.SidebarRight="sidebar-right",t.TwoColumn="two-column",t))(Ea||{});const iv=Rt.create({name:"columns",group:"columns",content:"column+",defining:!0,isolating:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),layout:"two-column"}},addAttributes(){return{layout:{default:"two-column"}}},addCommands(){return{setColumns:()=>({commands:t})=>(t.insertContent('<div data-type="columns"><div data-type="column" data-position="left"><p></p></div><div data-type="column" data-position="right"><p></p></div></div>'),!0),setLayout:t=>({commands:e})=>e.updateAttributes("columns",{layout:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-type":"columns",class:`layout-${t.layout}`},0]},parseHTML(){return[{tag:'div[data-type="columns"]'}]},addExtensions(){return[VX.configure(this.options.columnOptions)]}});function FX(t){let e=t;for(;e&&e!==document.body;){if(e.nodeType===1){const n=e;if(n.id==="editor-panel")return n}e=e.parentNode}return null}const lh=t=>{var n;if(!t)return!0;const e=document.createElement("div");return e.innerHTML=t,((n=e==null?void 0:e.textContent)==null?void 0:n.trim())===""},$X=t=>{if(!t)return"";const{from:e,to:n}=t.state.selection,r=t.state.doc.cut(e,n),s=Dr.fromSchema(t.schema).serializeFragment(r.content),a=document.createElement("div");return a.appendChild(s),a.innerHTML},HX=t=>/<\/?[a-z][\s\S]*>/i.test(t),mE=8;function zX(t,e){const n=o.ref(!1);let r=!1,i=null,s=null,a=null,l=null,u=0,c=0;function f(E){const k=E.cloneNode(!0);return k.style.position="fixed",k.style.pointerEvents="none",k.style.opacity="0.9",k.style.zIndex="9999",k.style.transform="translate(-50%, -50%)",k.style.left="0px",k.style.top="0px",document.body.appendChild(k),k}function p(){s&&s.parentElement&&s.parentElement.removeChild(s),s=null}function m(){try{if(typeof t.getPos=="function"){const E=t.getPos();if(typeof E=="number"&&E>=0)return E}}catch{}return null}function g(E,k){n.value||(l=m(),document.body.style.userSelect="none",document.body.style.touchAction="none",k&&(s=f(k),s.style.left=`${E.clientX}px`,s.style.top=`${E.clientY}px`),n.value=!0,r=!1,a=null)}function b(){i=null,l=null,a=null,r=!1,n.value=!1,p(),document.body.style.userSelect="",document.body.style.touchAction=""}function v(E){if(o.unref(e)||n.value)return;const k=E.changedTouches[0];i=k.identifier,u=k.clientX,c=k.clientY,r=!0,l=null,a=null}function y(E){var A;if(!r&&!n.value||i===null)return;const k=Array.from(E.changedTouches).find(I=>I.identifier===i);if(!k)return;const C=k.clientX-u,_=k.clientY-c,T=C*C+_*_;if(!n.value&&r&&T>=mE*mE){const I=E.currentTarget||E.target||null;g(k,I)}if(n.value){s&&(s.style.left=`${k.clientX}px`,s.style.top=`${k.clientY}px`);try{const I=(A=t.editor)==null?void 0:A.view;if(!I){a=null;return}const O=I.posAtCoords({left:k.clientX,top:k.clientY});O&&typeof O.pos=="number"?a=O.pos:a=null}catch{a=null}}}async function x(E){var k;if(n.value){if(document.body.style.userSelect="",document.body.style.touchAction="",p(),n.value=!1,l===null||a===null){b();return}const C=(k=t.editor)==null?void 0:k.view;if(!C){b();return}const _=C.state.doc.nodeAt(l);if(!_){b();return}const T=_.nodeSize,A=l,I=A+T,O=a;if(O>=A&&O<=I){b();return}let M=O;O>A&&(M=O-T);const $=C.state.doc.content.size;M<0&&(M=0),M>$&&(M=$);const H=_.type.create(_.attrs),K=C.state.tr;K.delete(A,I),K.insert(M,H),C.dispatch(K),b();return}if(r){b();return}}return{onTouchStart:v,onTouchMove:y,onTouchEnd:x}}function UX(...t){return dy(Sm(t))}const WX=["innerHTML"],jX=["book-mark-node-id","book-mark-content","node-id","element-id","line-id"],qX=o.defineComponent({__name:"SuperText",props:Qs,setup(t){const e=t,n=o.ref(!1),r=o.inject("isMobile",!1),i=o.computed(()=>e.editor.storage.superText.enable),s=et.useEventBus(cr.RENDER_SUPER_TEXT),{onTouchStart:a,onTouchMove:l,onTouchEnd:u}=zX(e,i),c=o.ref(null),f=o.ref(!1),p=()=>{f.value=!0},m=()=>{f.value=!1};o.watch(f,()=>{f.value&&_(c.value)});const g={mouseenter:C,mouseleave:_,dragstart:p,dragend:m},b={touchstart:a,touchmove:l,touchend:u,touchcancel:u},v=o.computed(()=>r?b:g),y=o.computed(()=>{const M=e.getPos(),$=e.editor.state.doc.resolve(M);for(let H=$.depth;H>0;H--){const K=$.node(H);if(K.type.name==="paragraph")return K}return null}),x=o.computed(()=>{var M;return((M=y.value)==null?void 0:M.attrs.id)||""}),E=o.inject("canEditSuper",o.ref(!0));function k(M){var F,R;if(lh(M)){T();return}const $=e.getPos(),H=(F=e.editor)==null?void 0:F.state.doc.nodeAt($),K=M.trim(),{[ot.ELEMENT_ID]:N,...V}=(H==null?void 0:H.attrs)||{};(R=e.editor)==null||R.view.dispatch(e.editor.state.tr.setNodeMarkup($,void 0,{...V,[ot.TEXT]:K})),requestAnimationFrame(()=>{e.editor.commands.setTextSelection($+1),e.editor.view.focus()})}function C(M){c.value=M;const $=e.node.attrs[ot.TEXT],H=e.node.attrs[ot.ID],N={lineId:M.target.querySelector(`[node-id="${H}"]`).getAttribute("line-id"),dataId:H,text:$};s.emit({action:"hover",payload:N})}function _(M){const $=e.node.attrs[ot.ID],K={lineId:M==null?void 0:M.target.querySelector(`[node-id="${$}"]`).getAttribute("line-id"),dataId:$,text:""};s.emit({action:"hover",payload:K}),c.value=null}function T(){const{getPos:M,node:$,editor:H}=e,K=M(),N=K+1;H.commands.deleteRange({from:K,to:N})}function A(){if(!E.value)return;const{attributes:M}=e.editor.options.editorProps;if(M&&M.id===ar.COMMENT){const $=document.getElementById(ar.COMMENT);if(($==null?void 0:$.getAttribute(ar.DISABLE_SUPER_INPUT))==="true")return}e.editor.view.dom.blur(),n.value=!0}function I(){e.editor.commands.setSuperTextContent(e.node.attrs[ot.TEXT],e.node.attrs[ot.POSITION]),e.editor.commands.toggleSuperInputMoblie()}o.watch(i,M=>{r&&(e.editor.setEditable(!M),M?e.editor.view.dom.classList.add("super-text-view-mode"):e.editor.view.dom.classList.remove("super-text-view-mode"))});const O=o.computed(()=>`{${e.node.attrs[ot.TEXT].replace(/<\/p>\s*<p>/g,"<br/>").replace(/<\/?p[^>]*>/g,"").trim()}}`);return(M,$)=>{const H=gn,K=Qb,N=Zb,V=Jb,F=Yb,R=Dc;return o.openBlock(),o.createBlock(o.unref(Zs),o.mergeProps({as:"span",class:o.unref(UX)("text-inherit super-text shrink-0 inline-flex items-center justify-center",o.unref(r)&&i.value&&"block"),"data-drag-handle":"",draggable:o.unref(E)},o.toHandlers(v.value)),{default:o.withCtx(()=>[o.unref(r)&&!i.value?(o.openBlock(),o.createElementBlock("button",{key:0,onClick:o.withModifiers(I,["stop"]),class:"w-6 inline-flex justify-center rounded text-ed-red-500 active:bg-ed-accent"},[o.createVNode(o.unref(At),{name:"fileEdit2",class:"w-5 h-5"})])):o.createCommentVNode("",!0),o.unref(r)&&i.value?(o.openBlock(),o.createElementBlock("div",{key:1,innerHTML:O.value,onClick:o.withModifiers(I,["stop"]),class:"super-text-view-mode-item"},null,8,WX)):o.createCommentVNode("",!0),o.unref(r)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(F,{key:2},{default:o.withCtx(()=>[o.createVNode(K,{as:"template",class:"relative",disabled:!o.unref(E)},{default:o.withCtx(()=>[o.createVNode(H,{class:o.normalizeClass([{"pointer-events-none":!o.unref(E)},"!p-0 !m-0 !h-fit"]),variant:"ghost",onDblclick:o.withModifiers(A,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(At),{name:"fileEdit"}),o.createElementVNode("div",{ref:"bookMarkRef","book-mark-node-id":e.node.attrs[o.unref(ot).ID],"book-mark-content":e.node.attrs[o.unref(ot).TEXT],"node-id":e.node.attrs[o.unref(ot).ID],"element-id":e.node.attrs[o.unref(ot).ELEMENT_ID],"line-id":x.value},null,8,jX)]),_:1},8,["class"])]),_:1},8,["disabled"]),o.createVNode(V,null,{default:o.withCtx(()=>[o.createVNode(N,{onSelect:$[0]||($[0]=W=>n.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(M.$t("editor.super.edit")),1)]),_:1}),o.createVNode(N,{onSelect:T},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(M.$t("editor.super.delete")),1)]),_:1})]),_:1})]),_:1})),o.unref(r)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(R,{key:3,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[o.unref(ot).TEXT],"super-text-element-id":e.node.attrs[o.unref(ot).ELEMENT_ID],onClose:$[1]||($[1]=W=>n.value=!1),onSave:k},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},16,["class","draggable"])}}}),KX=new rt({props:{handleKeyDown(t,e){var n;if(e.key==="Backspace"){const{state:r,dispatch:i}=t,{$from:s}=r.selection;if(s.parentOffset===1){const u=s.nodeAfter;if(u&&u.type.name==="superText"){const c=r.tr;c.delete(s.pos-1,s.pos);const f=r.schema.text("");return c.insert(s.pos-1,ge.from(f)),c.setSelection(Ve.create(c.doc,s.pos)),i(c),e.preventDefault(),!0}}const a=s.nodeBefore,l=s.nodeAfter;if(a&&a.isText&&((n=a.text)==null?void 0:n.length)===1&&l&&l.type.name==="superText"){const u=s.parent.childBefore(s.parentOffset-1).node;if(u&&u.type.name==="superText"){const c=r.tr;return c.delete(s.pos-1,s.pos),c.setSelection(Ve.create(c.doc,s.pos-1)),i(c),e.preventDefault(),!0}}}return!1}}}),GX=new rt({appendTransaction(t,e,n){const r=new Set;let i=n.tr,s=!1;return n.doc.descendants((a,l)=>{if(a.type.name===Pc){const u=a.attrs[ot.ID];if(!u||r.has(u)){const c=Gr();i=i.setNodeMarkup(l,void 0,{...a.attrs,[ot.ID]:c}),s=!0,r.add(c)}else r.add(u)}}),s?i:null}}),Pc="superText",gE={UPDATE:"superTextUpdate"},bE=Rt.create({name:"superText",inline:!0,group:"inline",selectable:!1,defining:!0,draggable:!0,addStorage(){return{enable:!0,isShowSuperInputMoblie:!1,view:!0,items:[],superInputModal:this.options.superInputModal,toggleSuperViewMobileCallBack:this.options.toggleSuperViewMobileCallBack,bottomSheetComponent:this.options.bottomSheetComponent,addToast:this.options.addToast,superTextContent:"",superTextPosition:""}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>n?[{component:Ge,componentProps:{action:()=>{t.commands.toggleSuperInputMoblie()},isActive:()=>{},icon:"fileEdit",title:e("editor.menubar.menu.insertSuper"),tooltip:e("editor.menubar.menu.insertSuper"),customClass:"whitespace-nowrap !bg-ed-blue active:!bg-ed-blue/90 !transition-none !text-white !font-normal rounded-[3px] h-[26px] ml-auto",customClassTooltip:"ml-auto"}}]:[{component:Ge,componentProps:{action:()=>t.commands.toggleSuperTextView(),isActive:()=>t.storage.superText.enable,title:e("editor.menubar.menu.superView"),customClass:`whitespace-nowrap !text-white !font-normal rounded-[3px] h-[26px]
|
|
331
331
|
${t.storage.superText.enable?"!bg-blue-500":"!bg-gray-600"}
|
|
332
332
|
`,tooltip:"수퍼 보기",customClassTooltip:"flex items-center justify-center"}}]}},addAttributes(){return{[ot.ID]:{default:null},[ot.TEXT]:{default:""},[ot.POSITION]:{default:"0"},[ot.ELEMENT_ID]:{default:""}}},addCommands(){return{toggleSuperTextView:()=>({editor:t})=>t.storage.superText.enable=!t.storage.superText.enable,toggleSuperInputMoblie:()=>({editor:t})=>t.storage.superText.bottomSheetComponent?t.storage.superText.isShowSuperInputMoblie=!t.storage.superText.isShowSuperInputMoblie:(console.error("Please configure bottomSheetComponent!"),!1),setSuperTextContent:(t,e)=>({editor:n})=>(n.storage.superText.superTextContent=t,n.storage.superText.superTextPosition=e,!!t)}},parseHTML(){return[{tag:"button.super-text"}]},renderHTML({HTMLAttributes:t}){return["button",yt(t,{class:"super-text"})]},addNodeView(){return Ns(qX)},addProseMirrorPlugins(){return[new rt({appendTransaction(t,e,n){let r=n.tr,i=!1;return n.doc.descendants((s,a)=>{if(s.type.name==="superText"){const l=s.attrs[ot.POSITION],u=String(a);l!==u&&(r=r.setNodeMarkup(a,void 0,{...s.attrs,[ot.POSITION]:u}),i=!0)}}),i?r:null}}),new rt({filterTransaction(t,e){return t.steps.some(r=>{if(r.toJSON&&r.toJSON().stepType==="replace"){const i=r.toJSON();return i.slice&&i.slice.content&&i.slice.content.some(s=>s.type===Pc)}return!1})&&t.setMeta(gE.UPDATE,!0),!0}}),KX,GX]}}),XX={class:"flex gap-x-2 items-center"},YX={class:"sr-only"},JX={class:"flex justify-end gap-x-2.5 flex-1"},ZX=["disabled"],vE=uo(o.defineComponent({__name:"SuperInputDialogMoblie",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextId:{},superTextElementId:{},isViewMode:{type:Boolean},title:{}},emits:["close","save","delete"],setup(t,{emit:e}){const n=e,r=t,{t:i}=_t(),s=o.ref(""),a=o.ref(!1),l=o.ref(r.isViewMode??!1),u=o.ref(!1);o.watch(()=>r.isViewMode,g=>{l.value=g,g||(s.value="")});const c=o.computed(()=>{var b;if(!s.value)return!0;const g=document.createElement("div");return g.innerHTML=s.value,((b=g==null?void 0:g.textContent)==null?void 0:b.trim())===""});o.watch(()=>r.open,()=>{r.open&&r.superTextInit&&(s.value=r.superTextInit)});const f=()=>{n("close"),a.value=!1,l.value=!0,u.value=!1},p=()=>{n("save",s.value),s.value="",l.value=!0,u.value=!1},m=()=>{u.value=!0,l.value=!1};return(g,b)=>{const v=sh,y=ih,x=oh,E=rh,k=Nb,C=Lc,_=Rc;return o.openBlock(),o.createBlock(_,{open:g.open},{default:o.withCtx(()=>[o.createVNode(C,{isOverlayTransparent:"",class:"p-2.5 gap-0 gap-y-2.5 border-none w-[calc(100%-40px)] !shadow-ed rounded-[5px]"},{default:o.withCtx(()=>[o.createVNode(x,{class:"text-left flex-row justify-between"},{default:o.withCtx(()=>[o.createVNode(v,{class:"text-base font-normal"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(g.title?g.title:o.unref(i)("editor.superinput")),1)]),_:1}),o.createElementVNode("div",XX,[o.withDirectives(o.createElementVNode("button",{onClick:m},[o.createVNode(o.unref(zg),{icon:"lucide:edit-2"})],512),[[o.vShow,l.value]]),o.createVNode(y,{class:"outline-none",onClick:f},{default:o.withCtx(()=>[o.createVNode(o.unref(xc),{class:"w-5 h-5"}),o.createElementVNode("span",YX,o.toDisplayString(o.unref(i)("editor.close")),1)]),_:1})])]),_:1}),o.createVNode(E,{class:"hidden"}),o.createVNode(ev,{isReadOnly:l.value,modelValue:s.value,"onUpdate:modelValue":b[0]||(b[0]=T=>s.value=T),"parent-editor":g.editor,"spellcheck-enabled":!1},null,8,["isReadOnly","modelValue","parent-editor"]),o.createVNode(k,{class:"flex-row justify-between"},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("button",{onClick:b[1]||(b[1]=T=>n("delete"))},o.toDisplayString(o.unref(i)("editor.delete")),513),[[o.vShow,u.value]]),o.withDirectives(o.createElementVNode("div",JX,[o.createElementVNode("button",{onClick:f},o.toDisplayString(o.unref(i)("editor.menubar.menu.cancel")),1),o.createElementVNode("button",{onClick:p,disabled:o.unref(c),class:o.normalizeClass({"cursor-not-allowed":o.unref(c)})},o.toDisplayString(o.unref(i)("editor.menubar.menu.save")),11,ZX)],512),[[o.vShow,u.value||!l.value]])]),_:1})]),_:1})]),_:1},8,["open"])}}}),[["__scopeId","data-v-2f4982a0"]]),QX=["innerHTML"],NX=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","line-id"],eY=o.defineComponent({__name:"ConfigPlan",props:Qs,setup(t){const e=t,n=o.ref(!1),r=o.ref(null),{selection:i,doc:s}=e.editor.state,a=o.inject("isMobile"),l=o.ref(!1),u=et.useEventBus(cr.RENDER_SUPER_TEXT),c=o.computed(()=>{var _,T;const x=s.resolve(i.from),E=x==null?void 0:x.node(-1),k=(_=E==null?void 0:E.attrs)==null?void 0:_.id,C=(T=E==null?void 0:E.attrs)==null?void 0:T.pageNumber;return{pageId:k,pageNumber:C}}),f=o.computed(()=>{const x=e.getPos(),E=e.editor.state.doc.resolve(x);for(let k=E.depth;k>0;k--){const C=E.node(k);if(C.type.name==="paragraph")return C}return null}),p=o.computed(()=>{var x;return((x=f.value)==null?void 0:x.attrs.id)||""});function m(x){e.updateAttributes({"data-text":x}),n.value=!1}function g(x){const E=e.node.attrs[ot.TEXT],k=e.node.attrs[ot.ID],_={lineId:x.target.querySelector(`[node-id="${k}"]`).getAttribute("line-id"),text:E};u.emit({action:"hover",payload:_})}function b(x){const E=e.node.attrs[ot.ID],C={lineId:x.target.querySelector(`[node-id="${E}"]`).getAttribute("line-id"),text:""};u.emit({action:"hover",payload:C})}function v(){const{getPos:x,node:E,editor:k}=e,C=x(),_=C+1;k.commands.deleteRange({from:C,to:_})}function y(){n.value=!0,a&&(l.value=!0)}return(x,E)=>{const k=gn,C=Qb,_=Zb,T=Jb,A=Yb,I=Dc;return o.openBlock(),o.createBlock(o.unref(Zs),{as:"span",class:o.normalizeClass(["w-fit text-inherit super-text align-middle",{"!leading-[9px] [&_*]:!leading-[9px]":o.unref(a)}]),"data-drag-handle":"",draggable:"true",contenteditable:"false"},{default:o.withCtx(()=>[o.createVNode(A,null,{default:o.withCtx(()=>[o.createVNode(C,{as:"template",class:"relative"},{default:o.withCtx(()=>[o.createVNode(k,{variant:"ghost",class:"!p-0 !m-0 !h-fit font-normal !text-ed-blue",onClick:y,onMouseenter:g,onMouseleave:b},{default:o.withCtx(()=>[o.createVNode(o.unref(At),{name:"plan",class:o.normalizeClass({"w-[18px] h-auto pr-1":o.unref(a)})},null,8,["class"]),E[3]||(E[3]=o.createTextVNode(" [")),o.createElementVNode("span",{class:"[&_*]:inline",innerHTML:e.node.attrs[o.unref(ot).TEXT]},null,8,QX),E[4]||(E[4]=o.createTextVNode("] ")),o.createElementVNode("div",{ref_key:"bookMarkRef",ref:r,"book-mark-node-id":e.node.attrs[o.unref(ot).ID],"page-id":c.value.pageId,"page-number":c.value.pageNumber,"book-mark-content":e.node.attrs[o.unref(ot).TEXT],"node-id":e.node.attrs[o.unref(ot).ID],"line-id":p.value},null,8,NX)]),_:1})]),_:1}),o.createVNode(T,null,{default:o.withCtx(()=>[o.createVNode(_,{onSelect:E[0]||(E[0]=O=>n.value=!0)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x.$t("editor.configPlan.edit")),1)]),_:1}),o.createVNode(_,{onSelect:v},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x.$t("editor.configPlan.delete")),1)]),_:1})]),_:1})]),_:1}),o.unref(a)?(o.openBlock(),o.createBlock(vE,{key:1,title:x.$t("editor.configPlan"),open:n.value,"is-view-mode":l.value,editor:e.editor,"super-text-init":e.node.attrs[o.unref(ot).TEXT],"super-text-id":e.node.attrs[o.unref(ot).ID],onClose:E[2]||(E[2]=O=>n.value=!1),onSave:m,onDelete:v},null,8,["title","open","is-view-mode","editor","super-text-init","super-text-id"])):(o.openBlock(),o.createBlock(I,{key:0,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[o.unref(ot).TEXT],"super-text-element-id":e.node.attrs[o.unref(ot).ELEMENT_ID],onClose:E[1]||(E[1]=O=>n.value=!1),onSave:m},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},8,["class"])}}}),yE=Rt.create({name:"configPlan",inline:!0,group:"inline",atom:!0,draggable:!0,addStorage(){return{isShowConfigPlanInput:!1}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>[...n?[{component:Ge,componentProps:{action:()=>{t.commands.toggleConfigPlanInput()},isActive:()=>{},icon:"plan",title:e("editor.insertConfigPlan"),tooltip:e("editor.insertConfigPlan"),customClass:"whitespace-nowrap !bg-ed-blue !text-white !font-normal rounded-[3px] h-[26px] gap-x-1 ml-auto",customClassTooltip:"ml-auto"}}]:[]]}},addAttributes(){return{"data-id":{default:null},"data-text":{default:""},"data-position":{default:"0"}}},addCommands(){return{toggleConfigPlanInput:()=>({editor:t})=>t.storage.configPlan.isShowConfigPlanInput=!t.storage.configPlan.isShowConfigPlanInput}},parseHTML(){return[{tag:"button.config-plan"}]},renderHTML({HTMLAttributes:t}){return["button",yt(t,{class:"config-plan"})]},addNodeView(){return Ns(eY)},addProseMirrorPlugins(){return[new rt({appendTransaction(t,e,n){let r=n.tr,i=!1;return n.doc.descendants((s,a)=>{if(s.type.name==="configPlan"){const l=s.attrs["data-position"],u=String(a);l!==u&&(r=r.setNodeMarkup(a,void 0,{...s.attrs,"data-position":u}),i=!0)}}),i?r:null}})]}});var sv,av;if(typeof WeakMap<"u"){let t=new WeakMap;sv=e=>t.get(e),av=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;sv=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},av=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var an=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,i=e/this.width|0;let s=r+1,a=i+1;for(let l=1;s<this.width&&this.map[e+l]==n;l++)s++;for(let l=1;a<this.height&&this.map[e+this.width*l]==n;l++)a++;return{left:r,top:i,right:s,bottom:a}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:i,top:s,bottom:a}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[s*this.width+(n<0?r-1:i)]:(n<0?s==0:a==this.height)?null:this.map[r+this.width*(n<0?s-1:a)]}rectBetween(t,e){const{left:n,right:r,top:i,bottom:s}=this.findCell(t),{left:a,right:l,top:u,bottom:c}=this.findCell(e);return{left:Math.min(n,a),top:Math.min(i,u),right:Math.max(r,l),bottom:Math.max(s,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){const s=r*this.width+i,a=this.map[s];n[a]||(n[a]=!0,!(i==t.left&&i&&this.map[s-1]==a||r==t.top&&r&&this.map[s-this.width]==a)&&e.push(a))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){const s=i+n.child(r).nodeSize;if(r==t){let a=e+t*this.width;const l=(t+1)*this.width;for(;a<l&&this.map[a]<i;)a++;return a==l?s-1:this.map[a]}i=s}}static get(t){return sv(t)||av(t,tY(t))}};function tY(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=nY(t),n=t.childCount,r=[];let i=0,s=null;const a=[];for(let c=0,f=e*n;c<f;c++)r[c]=0;for(let c=0,f=0;c<n;c++){const p=t.child(c);f++;for(let b=0;;b++){for(;i<r.length&&r[i]!=0;)i++;if(b==p.childCount)break;const v=p.child(b),{colspan:y,rowspan:x,colwidth:E}=v.attrs;for(let k=0;k<x;k++){if(k+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:f,n:x-k});break}const C=i+k*e;for(let _=0;_<y;_++){r[C+_]==0?r[C+_]=f:(s||(s=[])).push({type:"collision",row:c,pos:f,n:y-_});const T=E&&E[_];if(T){const A=(C+_)%e*2,I=a[A];I==null||I!=T&&a[A+1]==1?(a[A]=T,a[A+1]=1):I==T&&a[A+1]++}}}i+=y,f+=v.nodeSize}const m=(c+1)*e;let g=0;for(;i<m;)r[i++]==0&&g++;g&&(s||(s=[])).push({type:"missing",row:c,n:g}),f++}(e===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const l=new an(e,n,r,s);let u=!1;for(let c=0;!u&&c<a.length;c+=2)a[c]!=null&&a[c+1]<n&&(u=!0);return u&&rY(l,a,t),l}function nY(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let s=0;if(n)for(let a=0;a<r;a++){const l=t.child(a);for(let u=0;u<l.childCount;u++){const c=l.child(u);a+c.attrs.rowspan>r&&(s+=c.attrs.colspan)}}for(let a=0;a<i.childCount;a++){const l=i.child(a);s+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function rY(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const s=t.map[i];if(r[s])continue;r[s]=!0;const a=n.nodeAt(s);if(!a)throw new RangeError(`No cell with offset ${s} found`);let l=null;const u=a.attrs;for(let c=0;c<u.colspan;c++){const f=(i+c)%t.width,p=e[f*2];p!=null&&(!u.colwidth||u.colwidth[c]!=p)&&((l||(l=oY(u)))[c]=p)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function oY(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Wn(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}var ks=new Et("selectingCells");function $l(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function iY(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Co(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function uh(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=$l(e.$head)||sY(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function sY(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function lv(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function aY(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function uv(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function wE(t,e,n){const r=t.node(-1),i=an.get(r),s=t.start(-1),a=i.nextCell(t.pos-s,e,n);return a==null?null:t.node(0).resolve(s+a)}function ka(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function xE(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0)}return r}function lY(t,e,n){const r=Wn(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0}var zt=class Li extends je{constructor(e,n=e){const r=e.node(-1),i=an.get(r),s=e.start(-1),a=i.rectBetween(e.pos-s,n.pos-s),l=e.node(0),u=i.cellsInRect(a).filter(f=>f!=n.pos-s);u.unshift(n.pos-s);const c=u.map(f=>{const p=r.nodeAt(f);if(!p)throw RangeError(`No cell with offset ${f} found`);const m=s+f+1;return new t3(l.resolve(m),l.resolve(m+p.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(lv(r)&&lv(i)&&uv(r,i)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?Li.rowSelection(r,i):s&&this.isColSelection()?Li.colSelection(r,i):new Li(r,i)}return Ve.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=an.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},a=[];for(let u=i.top;u<i.bottom;u++){const c=[];for(let f=u*n.width+i.left,p=i.left;p<i.right;p++,f++){const m=n.map[f];if(s[m])continue;s[m]=!0;const g=n.findCell(m);let b=e.nodeAt(m);if(!b)throw RangeError(`No cell with offset ${m} found`);const v=i.left-g.left,y=g.right-i.right;if(v>0||y>0){let x=b.attrs;if(v>0&&(x=ka(x,0,v)),y>0&&(x=ka(x,x.colspan-y,y)),g.left<i.left){if(b=b.type.createAndFill(x),!b)throw RangeError(`Could not create cell with attrs ${JSON.stringify(x)}`)}else b=b.type.create(x,b.content)}if(g.top<i.top||g.bottom>i.bottom){const x={...b.attrs,rowspan:Math.min(g.bottom,i.bottom)-Math.max(g.top,i.top)};g.top<i.top?b=b.type.createAndFill(x):b=b.type.create(x,b.content)}c.push(b)}a.push(e.child(u).copy(ge.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:a;return new Te(ge.from(l),1,1)}replace(e,n=Te.empty){const r=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){const{$from:l,$to:u}=i[a],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(u.pos),a?Te.empty:n)}const s=je.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new Te(ge.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=an.get(n),i=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let a=0;a<s.length;a++)e(n.nodeAt(s[a]),i+s[a])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=an.get(r),s=e.start(-1),a=i.findCell(e.pos-s),l=i.findCell(n.pos-s),u=e.node(0);return a.top<=l.top?(a.top>0&&(e=u.resolve(s+i.map[a.left])),l.bottom<i.height&&(n=u.resolve(s+i.map[i.width*(i.height-1)+l.right-1]))):(l.top>0&&(n=u.resolve(s+i.map[l.left])),a.bottom<i.height&&(e=u.resolve(s+i.map[i.width*(i.height-1)+a.right-1]))),new Li(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=an.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(i,s)>0)return!1;const a=i+this.$anchorCell.nodeAfter.attrs.colspan,l=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,l)==n.width}eq(e){return e instanceof Li&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=an.get(r),s=e.start(-1),a=i.findCell(e.pos-s),l=i.findCell(n.pos-s),u=e.node(0);return a.left<=l.left?(a.left>0&&(e=u.resolve(s+i.map[a.top*i.width])),l.right<i.width&&(n=u.resolve(s+i.map[i.width*(l.top+1)-1]))):(l.left>0&&(n=u.resolve(s+i.map[l.top*i.width])),a.right<i.width&&(e=u.resolve(s+i.map[i.width*(a.top+1)-1]))),new Li(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Li(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Li(e.resolve(n),e.resolve(r))}getBookmark(){return new uY(this.$anchorCell.pos,this.$headCell.pos)}};zt.prototype.visible=!1,je.jsonID("cell",zt);var uY=class L9{constructor(e,n){this.anchor=e,this.head=n}map(e){return new L9(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&uv(n,r)?new zt(n,r):je.near(r,1)}};function cY(t){if(!(t.selection instanceof zt))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Wt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),at.create(t.doc,e)}function dY({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function fY({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){const s=t.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let i=e.depth;i>0;i--){const s=e.node(i);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function pY(t,e,n){const r=(e||t).selection,i=(e||t).doc;let s,a;if(r instanceof Fe&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")s=zt.create(i,r.from);else if(a=="row"){const l=i.resolve(r.from+1);s=zt.rowSelection(l,l)}else if(!n){const l=an.get(r.node),u=r.from+1,c=u+l.map[l.width*l.height-1];s=zt.create(i,u+1,c)}}else r instanceof Ve&&dY(r)?s=Ve.create(i,r.from):r instanceof Ve&&fY(r)&&(s=Ve.create(i,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var hY=new Et("fix-tables");function CE(t,e,n,r){const i=t.childCount,s=e.childCount;e:for(let a=0,l=0;a<s;a++){const u=e.child(a);for(let c=l,f=Math.min(i,a+3);c<f;c++)if(t.child(c)==u){l=c+1,n+=u.nodeSize;continue e}r(u,n),l<i&&t.child(l).sameMarkup(u)?CE(t.child(l),u,n+1,r):u.nodesBetween(0,u.content.size,r,n+1),n+=u.nodeSize}}function EE(t,e){let n;const r=(i,s)=>{i.type.spec.tableRole=="table"&&(n=mY(t,i,s,n))};return e?e.doc!=t.doc&&CE(e.doc,t.doc,0,r):t.doc.descendants(r),n}function mY(t,e,n,r){const i=an.get(e);if(!i.problems)return r;r||(r=t.tr);const s=[];for(let u=0;u<i.height;u++)s.push(0);for(let u=0;u<i.problems.length;u++){const c=i.problems[u];if(c.type=="collision"){const f=e.nodeAt(c.pos);if(!f)continue;const p=f.attrs;for(let m=0;m<p.rowspan;m++)s[c.row+m]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,ka(p,p.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const f=e.nodeAt(c.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...f.attrs,rowspan:f.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const f=e.nodeAt(c.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...f.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const f=r.mapping.map(n);r.delete(f,f+e.nodeSize)}}let a,l;for(let u=0;u<s.length;u++)s[u]&&(a==null&&(a=u),l=u);for(let u=0,c=n+1;u<i.height;u++){const f=e.child(u),p=c+f.nodeSize,m=s[u];if(m>0){let g="cell";f.firstChild&&(g=f.firstChild.type.spec.tableRole);const b=[];for(let y=0;y<m;y++){const x=Wn(t.schema)[g].createAndFill();x&&b.push(x)}const v=(u==0||a==u-1)&&l==u?c+1:p-1;r.insert(r.mapping.map(v),b)}c=p}return r.setMeta(hY,{fixTables:!0})}function Xo(t){const e=t.selection,n=uh(t),r=n.node(-1),i=n.start(-1),s=an.get(r);return{...e instanceof zt?s.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):s.findCell(n.pos-i),tableStart:i,map:s,table:r}}function kE(t,{map:e,tableStart:n,table:r},i){let s=i>0?-1:0;lY(e,r,i+s)&&(s=i==0||i==e.width?null:0);for(let a=0;a<e.height;a++){const l=a*e.width+i;if(i>0&&i<e.width&&e.map[l-1]==e.map[l]){const u=e.map[l],c=r.nodeAt(u);t.setNodeMarkup(t.mapping.map(n+u),null,xE(c.attrs,i-e.colCount(u))),a+=c.attrs.rowspan-1}else{const u=s==null?Wn(r.type.schema).cell:r.nodeAt(e.map[l+s]).type,c=e.positionAt(a,i,r);t.insert(t.mapping.map(n+c),u.createAndFill())}}return t}function gY(t,e){if(!Co(t))return!1;if(e){const n=Xo(t);e(kE(t.tr,n,n.left))}return!0}function bY(t,e){if(!Co(t))return!1;if(e){const n=Xo(t);e(kE(t.tr,n,n.right))}return!0}function vY(t,{map:e,table:n,tableStart:r},i){const s=t.mapping.maps.length;for(let a=0;a<e.height;){const l=a*e.width+i,u=e.map[l],c=n.nodeAt(u),f=c.attrs;if(i>0&&e.map[l-1]==u||i<e.width-1&&e.map[l+1]==u)t.setNodeMarkup(t.mapping.slice(s).map(r+u),null,ka(f,i-e.colCount(u)));else{const p=t.mapping.slice(s).map(r+u);t.delete(p,p+c.nodeSize)}a+=f.rowspan}}function yY(t,e){if(!Co(t))return!1;if(e){const n=Xo(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;vY(r,n,i),i!=n.left;i--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=an.get(s)}e(r)}return!0}function wY(t,e,n){var r;const i=Wn(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))==null?void 0:r.type)!=i)return!1;return!0}function SE(t,{map:e,tableStart:n,table:r},i){var s;let a=n;for(let c=0;c<i;c++)a+=r.child(c).nodeSize;const l=[];let u=i>0?-1:0;wY(e,r,i+u)&&(u=i==0||i==e.height?null:0);for(let c=0,f=e.width*i;c<e.width;c++,f++)if(i>0&&i<e.height&&e.map[f]==e.map[f-e.width]){const p=e.map[f],m=r.nodeAt(p).attrs;t.setNodeMarkup(n+p,null,{...m,rowspan:m.rowspan+1}),c+=m.colspan-1}else{const p=u==null?Wn(r.type.schema).cell:(s=r.nodeAt(e.map[f+u*e.width]))==null?void 0:s.type,m=p==null?void 0:p.createAndFill();m&&l.push(m)}return t.insert(a,Wn(r.type.schema).row.create(null,l)),t}function xY(t,e){if(!Co(t))return!1;if(e){const n=Xo(t);e(SE(t.tr,n,n.top))}return!0}function CY(t,e){if(!Co(t))return!1;if(e){const n=Xo(t);e(SE(t.tr,n,n.bottom))}return!0}function EY(t,{map:e,table:n,tableStart:r},i){let s=0;for(let c=0;c<i;c++)s+=n.child(c).nodeSize;const a=s+n.child(i).nodeSize,l=t.mapping.maps.length;t.delete(s+r,a+r);const u=new Set;for(let c=0,f=i*e.width;c<e.width;c++,f++){const p=e.map[f];if(!u.has(p)){if(u.add(p),i>0&&p==e.map[f-e.width]){const m=n.nodeAt(p).attrs;t.setNodeMarkup(t.mapping.slice(l).map(p+r),null,{...m,rowspan:m.rowspan-1}),c+=m.colspan-1}else if(i<e.height&&p==e.map[f+e.width]){const m=n.nodeAt(p),g=m.attrs,b=m.type.create({...g,rowspan:m.attrs.rowspan-1},m.content),v=e.positionAt(i+1,c,n);t.insert(t.mapping.slice(l).map(r+v),b),c+=g.colspan-1}}}}function kY(t,e){if(!Co(t))return!1;if(e){const n=Xo(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;EY(r,n,i),i!=n.top;i--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=an.get(n.table)}e(r)}return!0}function _E(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function SY({width:t,height:e,map:n},r){let i=r.top*t+r.left,s=i,a=(r.bottom-1)*t+r.left,l=i+(r.right-r.left-1);for(let u=r.top;u<r.bottom;u++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[l]==n[l+1])return!0;s+=t,l+=t}for(let u=r.left;u<r.right;u++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[a]==n[a+t])return!0;i++,a++}return!1}function TE(t,e){const n=t.selection;if(!(n instanceof zt)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Xo(t),{map:i}=r;if(SY(i,r))return!1;if(e){const s=t.tr,a={};let l=ge.empty,u,c;for(let f=r.top;f<r.bottom;f++)for(let p=r.left;p<r.right;p++){const m=i.map[f*i.width+p],g=r.table.nodeAt(m);if(!(a[m]||!g))if(a[m]=!0,u==null)u=m,c=g;else{_E(g)||(l=l.append(g.content));const b=s.mapping.map(m+r.tableStart);s.delete(b,b+g.nodeSize)}}if(u==null||c==null)return!0;if(s.setNodeMarkup(u+r.tableStart,null,{...xE(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),l.size){const f=u+1+c.content.size,p=_E(c)?u+1:f;s.replaceWith(p+r.tableStart,f+r.tableStart,l)}s.setSelection(new zt(s.doc.resolve(u+r.tableStart))),e(s)}return!0}function AE(t,e){const n=Wn(t.schema);return _Y(({node:r})=>n[r.type.spec.tableRole])(t,e)}function _Y(t){return(e,n)=>{var r;const i=e.selection;let s,a;if(i instanceof zt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;s=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{if(s=iY(i.$from),!s)return!1;a=(r=$l(i.$from))==null?void 0:r.pos}if(s==null||a==null||s.attrs.colspan==1&&s.attrs.rowspan==1)return!1;if(n){let l=s.attrs;const u=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const f=Xo(e),p=e.tr;for(let g=0;g<f.right-f.left;g++)u.push(c?{...l,colwidth:c&&c[g]?[c[g]]:null}:l);let m;for(let g=f.top;g<f.bottom;g++){let b=f.map.positionAt(g,f.left,f.table);g==f.top&&(b+=s.nodeSize);for(let v=f.left,y=0;v<f.right;v++,y++)v==f.left&&g==f.top||p.insert(m=p.mapping.map(b+f.tableStart,1),t({node:s,row:g,col:v}).createAndFill(u[y]))}p.setNodeMarkup(a,t({node:s,row:f.top,col:f.left}),u[0]),i instanceof zt&&p.setSelection(new zt(p.doc.resolve(i.$anchorCell.pos),m?p.doc.resolve(m):void 0)),n(p)}return!0}}function TY(t,e){return function(n,r){if(!Co(n))return!1;const i=uh(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof zt?n.selection.forEachCell((a,l)=>{a.attrs[t]!==e&&s.setNodeMarkup(l,null,{...a.attrs,[t]:e})}):s.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function AY(t){return function(e,n){if(!Co(e))return!1;if(n){const r=Wn(e.schema),i=Xo(e),s=e.tr,a=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=a.map(u=>i.table.nodeAt(u));for(let u=0;u<a.length;u++)l[u].type==r.header_cell&&s.setNodeMarkup(i.tableStart+a[u],r.cell,l[u].attrs);if(s.steps.length==0)for(let u=0;u<a.length;u++)s.setNodeMarkup(i.tableStart+a[u],r.header_cell,l[u].attrs);n(s)}return!0}}function ME(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const s=e.table.nodeAt(r[i]);if(s&&s.type!==n.header_cell)return!1}return!0}function Vc(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?AY(t):function(n,r){if(!Co(n))return!1;if(r){const i=Wn(n.schema),s=Xo(n),a=n.tr,l=ME("row",s,i),u=ME("column",s,i),f=(t==="column"?l:t==="row"?u:!1)?1:0,p=t=="column"?{left:0,top:f,right:1,bottom:s.map.height}:t=="row"?{left:f,top:0,right:s.map.width,bottom:1}:s,m=t=="column"?u?i.cell:i.header_cell:t=="row"?l?i.cell:i.header_cell:i.cell;s.map.cellsInRect(p).forEach(g=>{const b=g+s.tableStart,v=a.doc.nodeAt(b);v&&a.setNodeMarkup(b,m,v.attrs)}),r(a)}return!0}}Vc("row",{useDeprecatedLogic:!0}),Vc("column",{useDeprecatedLogic:!0});var MY=Vc("cell",{useDeprecatedLogic:!0});function OY(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const s=t.node(-1).child(r),a=s.lastChild;if(a)return i-1-a.nodeSize;i-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return i+1;i+=s.nodeSize}}return null}function OE(t){return function(e,n){if(!Co(e))return!1;const r=OY(uh(e),t);if(r==null)return!1;if(n){const i=e.doc.resolve(r);n(e.tr.setSelection(Ve.between(i,aY(i))).scrollIntoView())}return!0}}function BY(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function ch(t,e){const n=t.selection;if(!(n instanceof zt))return!1;if(e){const r=t.tr,i=Wn(t.schema).cell.createAndFill().content;n.forEachCell((s,a)=>{s.content.eq(i)||r.replace(r.mapping.map(a+1),r.mapping.map(a+s.nodeSize-1),new Te(i,0,0))}),r.docChanged&&e(r)}return!0}function IY(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),s=i.type.spec.tableRole,a=i.type.schema,l=[];if(s=="row")for(let u=0;u<e.childCount;u++){let c=e.child(u).content;const f=u?0:Math.max(0,n-1),p=u<e.childCount-1?0:Math.max(0,r-1);(f||p)&&(c=cv(Wn(a).row,new Te(c,f,p)).content),l.push(c)}else if(s=="cell"||s=="header_cell")l.push(n||r?cv(Wn(a).row,new Te(e,n,r)).content:e);else return null;return RY(a,l)}function RY(t,e){const n=[];for(let i=0;i<e.length;i++){const s=e[i];for(let a=s.childCount-1;a>=0;a--){const{rowspan:l,colspan:u}=s.child(a).attrs;for(let c=i;c<i+l;c++)n[c]=(n[c]||0)+u}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(ge.empty),n[i]<r){const s=Wn(t).cell.createAndFill(),a=[];for(let l=n[i];l<r;l++)a.push(s);e[i]=e[i].append(ge.from(a))}return{height:e.length,width:r,rows:e}}function cv(t,e){const n=t.createAndFill();return new zm(n).replace(0,n.content.size,e).doc}function LY({width:t,height:e,rows:n},r,i){if(t!=r){const s=[],a=[];for(let l=0;l<n.length;l++){const u=n[l],c=[];for(let f=s[l]||0,p=0;f<r;p++){let m=u.child(p%u.childCount);f+m.attrs.colspan>r&&(m=m.type.createChecked(ka(m.attrs,m.attrs.colspan,f+m.attrs.colspan-r),m.content)),c.push(m),f+=m.attrs.colspan;for(let g=1;g<m.attrs.rowspan;g++)s[l+g]=(s[l+g]||0)+m.attrs.colspan}a.push(ge.from(c))}n=a,t=r}if(e!=i){const s=[];for(let a=0,l=0;a<i;a++,l++){const u=[],c=n[l%e];for(let f=0;f<c.childCount;f++){let p=c.child(f);a+p.attrs.rowspan>i&&(p=p.type.create({...p.attrs,rowspan:Math.max(1,i-p.attrs.rowspan)},p.content)),u.push(p)}s.push(ge.from(u))}n=s,e=i}return{width:t,height:e,rows:n}}function DY(t,e,n,r,i,s,a){const l=t.doc.type.schema,u=Wn(l);let c,f;if(i>e.width)for(let p=0,m=0;p<e.height;p++){const g=n.child(p);m+=g.nodeSize;const b=[];let v;g.lastChild==null||g.lastChild.type==u.cell?v=c||(c=u.cell.createAndFill()):v=f||(f=u.header_cell.createAndFill());for(let y=e.width;y<i;y++)b.push(v);t.insert(t.mapping.slice(a).map(m-1+r),b)}if(s>e.height){const p=[];for(let b=0,v=(e.height-1)*e.width;b<Math.max(e.width,i);b++){const y=b>=e.width?!1:n.nodeAt(e.map[v+b]).type==u.header_cell;p.push(y?f||(f=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}const m=u.row.create(null,ge.from(p)),g=[];for(let b=e.height;b<s;b++)g.push(m);t.insert(t.mapping.slice(a).map(r+n.nodeSize-2),g)}return!!(c||f)}function BE(t,e,n,r,i,s,a,l){if(a==0||a==e.height)return!1;let u=!1;for(let c=i;c<s;c++){const f=a*e.width+c,p=e.map[f];if(e.map[f-e.width]==p){u=!0;const m=n.nodeAt(p),{top:g,left:b}=e.findCell(p);t.setNodeMarkup(t.mapping.slice(l).map(p+r),null,{...m.attrs,rowspan:a-g}),t.insert(t.mapping.slice(l).map(e.positionAt(a,b,n)),m.type.createAndFill({...m.attrs,rowspan:g+m.attrs.rowspan-a})),c+=m.attrs.colspan-1}}return u}function IE(t,e,n,r,i,s,a,l){if(a==0||a==e.width)return!1;let u=!1;for(let c=i;c<s;c++){const f=c*e.width+a,p=e.map[f];if(e.map[f-1]==p){u=!0;const m=n.nodeAt(p),g=e.colCount(p),b=t.mapping.slice(l).map(p+r);t.setNodeMarkup(b,null,ka(m.attrs,a-g,m.attrs.colspan-(a-g))),t.insert(b+m.nodeSize,m.type.createAndFill(ka(m.attrs,0,a-g))),c+=m.attrs.rowspan-1}}return u}function RE(t,e,n,r,i){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let a=an.get(s);const{top:l,left:u}=r,c=u+i.width,f=l+i.height,p=t.tr;let m=0;function g(){if(s=n?p.doc.nodeAt(n-1):p.doc,!s)throw new Error("No table found");a=an.get(s),m=p.mapping.maps.length}DY(p,a,s,n,c,f,m)&&g(),BE(p,a,s,n,u,c,l,m)&&g(),BE(p,a,s,n,u,c,f,m)&&g(),IE(p,a,s,n,l,f,u,m)&&g(),IE(p,a,s,n,l,f,c,m)&&g();for(let b=l;b<f;b++){const v=a.positionAt(b,u,s),y=a.positionAt(b,c,s);p.replace(p.mapping.slice(m).map(v+n),p.mapping.slice(m).map(y+n),new Te(i.rows[b-l],0,0))}g(),p.setSelection(new zt(p.doc.resolve(n+a.positionAt(l,u,s)),p.doc.resolve(n+a.positionAt(f-1,c-1,s)))),e(p)}var PY=v0({ArrowLeft:fh("horiz",-1),ArrowRight:fh("horiz",1),ArrowUp:fh("vert",-1),ArrowDown:fh("vert",1),"Shift-ArrowLeft":ph("horiz",-1),"Shift-ArrowRight":ph("horiz",1),"Shift-ArrowUp":ph("vert",-1),"Shift-ArrowDown":ph("vert",1),Backspace:ch,"Mod-Backspace":ch,Delete:ch,"Mod-Delete":ch});function dh(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function fh(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;if(s instanceof zt)return dh(n,r,je.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=LE(i,t,e);if(a==null)return!1;if(t=="horiz")return dh(n,r,je.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(a),u=wE(l,t,e);let c;return u?c=je.near(u,1):e<0?c=je.near(n.doc.resolve(l.before(-1)),-1):c=je.near(n.doc.resolve(l.after(-1)),1),dh(n,r,c)}}}function ph(t,e){return(n,r,i)=>{if(!i)return!1;const s=n.selection;let a;if(s instanceof zt)a=s;else{const u=LE(i,t,e);if(u==null)return!1;a=new zt(n.doc.resolve(u))}const l=wE(a.$headCell,t,e);return l?dh(n,r,new zt(a.$anchorCell,l)):!1}}function VY(t,e){const n=t.state.doc,r=$l(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new zt(r))),!0):!1}function FY(t,e,n){if(!Co(t.state))return!1;let r=IY(n);const i=t.state.selection;if(i instanceof zt){r||(r={width:1,height:1,rows:[ge.from(cv(Wn(t.state.schema).cell,n))]});const s=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),l=an.get(s).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=LY(r,l.right-l.left,l.bottom-l.top),RE(t.state,t.dispatch,a,l,r),!0}else if(r){const s=uh(t.state),a=s.start(-1);return RE(t.state,t.dispatch,a,an.get(s.node(-1)).findCell(s.pos-a),r),!0}else return!1}function $Y(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=DE(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof zt)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=$l(t.state.selection.$anchor))!=null&&((n=dv(t,e))==null?void 0:n.pos)!=i.pos)s(i,e),e.preventDefault();else if(!r)return;function s(u,c){let f=dv(t,c);const p=ks.getState(t.state)==null;if(!f||!uv(u,f))if(p)f=u;else return;const m=new zt(u,f);if(p||!t.state.selection.eq(m)){const g=t.state.tr.setSelection(m);p&&g.setMeta(ks,u.pos),t.dispatch(g)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",l),ks.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(ks,-1))}function l(u){const c=u,f=ks.getState(t.state);let p;if(f!=null)p=t.state.doc.resolve(f);else if(DE(t,c.target)!=r&&(p=dv(t,e),!p))return a();p&&s(p,c)}t.root.addEventListener("mouseup",a),t.root.addEventListener("dragstart",a),t.root.addEventListener("mousemove",l)}function LE(t,e,n){if(!(t.state.selection instanceof Ve))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const s=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=r.before(i),u=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?l:null}}return null}function DE(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function dv(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?$l(t.state.doc.resolve(n.pos)):null}var HY=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),fv(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,fv(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function fv(t,e,n,r,i,s){var a;let l=0,u=!0,c=e.firstChild;const f=t.firstChild;if(f){for(let p=0,m=0;p<f.childCount;p++){const{colspan:g,colwidth:b}=f.child(p).attrs;for(let v=0;v<g;v++,m++){const y=i==m?s:b&&b[v],x=y?y+"px":"";if(l+=y||r,y||(u=!1),c)c.style.width!=x&&(c.style.width=x),c=c.nextSibling;else{const E=document.createElement("col");E.style.width=x,e.appendChild(E)}}}for(;c;){const p=c.nextSibling;(a=c.parentNode)==null||a.removeChild(c),c=p}u?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var _r=new Et("tableColumnResizing");function zY({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=HY,lastColumnResizable:i=!0}={}){const s=new rt({key:_r,state:{init(a,l){var u,c;const f=(c=(u=s.spec)==null?void 0:u.props)==null?void 0:c.nodeViews,p=Wn(l.schema).table.name;return r&&f&&(f[p]=(m,g)=>new r(m,n,g)),new UY(-1,!1)},apply(a,l){return l.apply(a)}},props:{attributes:a=>{const l=_r.getState(a);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,l)=>{WY(a,l,t,i)},mouseleave:a=>{jY(a)},mousedown:(a,l)=>{qY(a,l,e,n)}},decorations:a=>{const l=_r.getState(a);if(l&&l.activeHandle>-1)return JY(a,l.activeHandle)},nodeViews:{}}});return s}var UY=class km{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(_r);if(r&&r.setHandle!=null)return new km(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new km(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return lv(e.doc.resolve(i))||(i=-1),new km(i,n.dragging)}return n}};function WY(t,e,n,r){if(!t.editable)return;const i=_r.getState(t.state);if(i&&!i.dragging){const s=GY(e.target);let a=-1;if(s){const{left:l,right:u}=s.getBoundingClientRect();e.clientX-l<=n?a=PE(t,e,"left",n):u-e.clientX<=n&&(a=PE(t,e,"right",n))}if(a!=i.activeHandle){if(!r&&a!==-1){const l=t.state.doc.resolve(a),u=l.node(-1),c=an.get(u),f=l.start(-1);if(c.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==c.width-1)return}FE(t,a)}}}function jY(t){if(!t.editable)return;const e=_r.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&FE(t,-1)}function qY(t,e,n,r){var i;if(!t.editable)return!1;const s=(i=t.dom.ownerDocument.defaultView)!=null?i:window,a=_r.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const l=t.state.doc.nodeAt(a.activeHandle),u=KY(t,a.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(_r,{setDragging:{startX:e.clientX,startWidth:u}}));function c(p){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f);const m=_r.getState(t.state);m!=null&&m.dragging&&(XY(t,m.activeHandle,VE(m.dragging,p,n)),t.dispatch(t.state.tr.setMeta(_r,{setDragging:null})))}function f(p){if(!p.which)return c(p);const m=_r.getState(t.state);if(m&&m.dragging){const g=VE(m.dragging,p,n);$E(t,m.activeHandle,g,r)}}return $E(t,a.activeHandle,u,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",f),e.preventDefault(),!0}function KY(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const s=t.domAtPos(e);let l=s.node.childNodes[s.offset].offsetWidth,u=n;if(r)for(let c=0;c<n;c++)r[c]&&(l-=r[c],u--);return l/u}function GY(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function PE(t,e,n,r){const i=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!s)return-1;const{pos:a}=s,l=$l(t.state.doc.resolve(a));if(!l)return-1;if(n=="right")return l.pos;const u=an.get(l.node(-1)),c=l.start(-1),f=u.map.indexOf(l.pos-c);return f%u.width==0?-1:c+u.map[f-1]}function VE(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function FE(t,e){t.dispatch(t.state.tr.setMeta(_r,{setHandle:e}))}function XY(t,e,n){const r=t.state.doc.resolve(e),i=r.node(-1),s=an.get(i),a=r.start(-1),l=s.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,u=t.state.tr;for(let c=0;c<s.height;c++){const f=c*s.width+l;if(c&&s.map[f]==s.map[f-s.width])continue;const p=s.map[f],m=i.nodeAt(p).attrs,g=m.colspan==1?0:l-s.colCount(p);if(m.colwidth&&m.colwidth[g]==n)continue;const b=m.colwidth?m.colwidth.slice():YY(m.colspan);b[g]=n,u.setNodeMarkup(a+p,null,{...m,colwidth:b})}u.docChanged&&t.dispatch(u)}function $E(t,e,n,r){const i=t.state.doc.resolve(e),s=i.node(-1),a=i.start(-1),l=an.get(s).colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;let u=t.domAtPos(i.start(-1)).node;for(;u&&u.nodeName!="TABLE";)u=u.parentNode;u&&fv(s,u.firstChild,u,r,l,n)}function YY(t){return Array(t).fill(0)}function JY(t,e){var n;const r=[],i=t.doc.resolve(e),s=i.node(-1);if(!s)return at.empty;const a=an.get(s),l=i.start(-1),u=a.colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;for(let c=0;c<a.height;c++){const f=u+c*a.width;if((u==a.width-1||a.map[f]!=a.map[f+1])&&(c==0||a.map[f]!=a.map[f-a.width])){const p=a.map[f],m=l+p+s.nodeAt(p).nodeSize-1,g=document.createElement("div");g.className="column-resize-handle",(n=_r.getState(t))!=null&&n.dragging&&r.push(Wt.node(l+p,l+p+s.nodeAt(p).nodeSize,{class:"column-resize-dragging"})),r.push(Wt.widget(m,g))}}return at.create(t.doc,r)}function ZY({allowTableNodeSelection:t=!1}={}){return new rt({key:ks,state:{init(){return null},apply(e,n){const r=e.getMeta(ks);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:i,pos:s}=e.mapping.mapResult(n);return i?null:s}},props:{decorations:cY,handleDOMEvents:{mousedown:$Y},createSelectionBetween(e){return ks.getState(e.state)!=null?e.state.selection:null},handleTripleClick:VY,handleKeyDown:PY,handlePaste:FY},appendTransaction(e,n,r){return pY(r,EE(r,n),t)}})}const QY=(t,e,n)=>{if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r||n===r.attrs.backgroundColor)return t;const i={...r.attrs,backgroundColor:n};return t.setNodeMarkup(e,r.type,i,r.marks)},NY=(t,e,n)=>{const{doc:r,selection:i}=t;return!r||!i||!(i instanceof zt)||i.forEachCell((s,a)=>{t=QY(t,a,n)}),t},HE=(t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;return n=n.setSelection(s),n=NY(n,e,t),n.docChanged?(i==null||i(n),!0):!1},eJ=nt.create({name:"tableCellBackground",addOptions(){return{types:["tableCell"],HTMLAttributes:{}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{parseHTML:t=>t.style.backgroundColor||"",renderHTML:t=>!t.backgroundColor||t.backgroundColor===""?{}:{style:`background-color: ${t.backgroundColor}`}}}}]},addCommands(){return{setTableCellBackground:t=>HE(t,this.options),unsetTableCellBackground:()=>HE("",this.options)}}}),tJ=Rt.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",yt(this.options.HTMLAttributes,t),0]}}),nJ=Rt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",yt(this.options.HTMLAttributes,t),0]}}),rJ=Rt.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",yt(this.options.HTMLAttributes,t),0]}});function pv(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function zE(t,e,n,r,i,s){var a;let l=0,u=!0,c=e.firstChild;const f=t.firstChild;if(f!==null)for(let p=0,m=0;p<f.childCount;p+=1){const{colspan:g,colwidth:b}=f.child(p).attrs;for(let v=0;v<g;v+=1,m+=1){const y=i===m?s:b&&b[v],x=y?`${y}px`:"";if(l+=y||r,y||(u=!1),c){if(c.style.width!==x){const[E,k]=pv(r,y);c.style.setProperty(E,k)}c=c.nextSibling}else{const E=document.createElement("col"),[k,C]=pv(r,y);E.style.setProperty(k,C),e.appendChild(E)}}}for(;c;){const p=c.nextSibling;(a=c.parentNode)===null||a===void 0||a.removeChild(c),c=p}u?(n.style.width=`${l}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${l}px`)}class oJ{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),zE(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,zE(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function iJ(t,e,n,r){let i=0,s=!0;const a=[],l=t.firstChild;if(!l)return{};for(let p=0,m=0;p<l.childCount;p+=1){const{colspan:g,colwidth:b}=l.child(p).attrs;for(let v=0;v<g;v+=1,m+=1){const y=n===m?r:b&&b[v];i+=y||e,y||(s=!1);const[x,E]=pv(e,y);a.push(["col",{style:`${x}: ${E}`}])}}const u=s?`${i}px`:"",c=s?"":`${i}px`;return{colgroup:["colgroup",{},...a],tableWidth:u,tableMinWidth:c}}function UE(t,e){return t.createAndFill()}function sJ(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function aJ(t,e,n,r,i){const s=sJ(t),a=[],l=[];for(let c=0;c<n;c+=1){const f=UE(s.cell);if(f&&l.push(f),r){const p=UE(s.header_cell);p&&a.push(p)}}const u=[];for(let c=0;c<e;c+=1)u.push(s.row.createChecked(null,r&&c===0?a:l));return s.table.createChecked(null,u)}function lJ(t){return t instanceof zt}const hh=({editor:t})=>{const{selection:e}=t.state;if(!lJ(e))return!1;let n=0;const r=Zw(e.ranges[0].$from,s=>s.type.name==="table");return r==null||r.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},uJ=Rt.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:oJ,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=iJ(t,this.options.cellMinWidth);return["table",yt(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:s})=>{const a=aJ(s.schema,t,e,n);if(i){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(Ve.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>gY(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>bY(t,e),deleteColumn:()=>({state:t,dispatch:e})=>yY(t,e),addRowBefore:()=>({state:t,dispatch:e})=>xY(t,e),addRowAfter:()=>({state:t,dispatch:e})=>CY(t,e),deleteRow:()=>({state:t,dispatch:e})=>kY(t,e),deleteTable:()=>({state:t,dispatch:e})=>BY(t,e),mergeCells:()=>({state:t,dispatch:e})=>TE(t,e),splitCell:()=>({state:t,dispatch:e})=>AE(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Vc("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Vc("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>MY(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>TE(t,e)?!0:AE(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>TY(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>OE(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>OE(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&EE(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=zt.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:hh,"Mod-Backspace":hh,Delete:hh,"Mod-Delete":hh}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[zY({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],ZY({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:ft(He(t,"tableRole",e))}}}),cJ=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,dJ=/CrOS/,fJ=/android|ipad|playbook|silk/i;function WE(t={}){let e=t.ua||typeof navigator<"u"&&navigator.userAgent;return e&&typeof e=="object"&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string"?!1:!!(cJ.test(e)&&!dJ.test(e)||t.tablet&&fJ.test(e)||t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.includes("Macintosh")&&e.includes("Safari"))}const pJ=["disabled"],hJ={"content-class":"table-grid-size-editor","content-style":"padding:0"},mJ={class:"flex flex-col flex-wrap gap-1 justify-between"},gJ=["onMouseover","onMousedown"],bJ={class:"text-center text-sm text-zinc-600 mt-2"},vJ=o.defineComponent({__name:"CreateTablePopover",props:{disabled:{type:Boolean,default:!1}},emits:["create-table"],setup(t,{emit:e}){const n=e,r=o.ref(!1),i=o.ref(!0),s=o.reactive({rows:WE()?nf:tf,cols:WE()?nf:tf}),a=o.reactive({rows:rf,cols:rf});function l(g,b){g===s.rows&&(s.rows=Math.min(g+1,nf)),b===s.cols&&(s.cols=Math.min(b+1,nf)),a.rows=g,a.cols=b}function u(g,b){n("create-table",{rows:g,cols:b,withHeaderRow:o.unref(i)}),c()}function c(){r.value=!1,i.value=!1,s.rows=tf,s.cols=tf,a.rows=rf,a.cols=rf}const f=o.inject("isMobile",!1),{isOpen:p}=hp({scrollEl:"tool-bar-format-scroll",ignoreSelector:"[data-radix-popper-content-wrapper]"}),m=o.computed(()=>f?{modal:!1,open:p.value,"onUpdate:open":g=>p.value=g}:{});return(g,b)=>(o.openBlock(),o.createBlock(o.unref(cs),o.normalizeProps(o.guardReactiveProps(o.unref(m))),{default:o.withCtx(()=>[o.createVNode(o.unref(da),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("button",{disabled:t.disabled,class:"m-0 p-0"},[o.renderSlot(g.$slots,"trigger")],8,pJ)]),_:3}),o.createVNode(o.unref(ds),{class:"w-full",align:"start",side:"bottom"},{default:o.withCtx(()=>[o.createElementVNode("div",hJ,[o.createElementVNode("div",mJ,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.rows,v=>(o.openBlock(),o.createElementBlock("div",{key:"r"+v,class:"flex gap-1"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.cols,y=>(o.openBlock(),o.createElementBlock("div",{key:"c"+y,class:o.normalizeClass([[y<=a.cols&&v<=a.rows&&"bg-ed-foreground border-ed-border","cursor-pointer"],"pa-1"]),onMouseover:x=>l(v,y),onMousedown:x=>u(v,y)},b[0]||(b[0]=[o.createElementVNode("div",{class:"w-4 h-4 p-1 border box-border"},null,-1)]),42,gJ))),128))]))),128))]),o.createElementVNode("div",bJ,o.toDisplayString(a.rows)+" x "+o.toDisplayString(a.cols),1)])]),_:1})]),_:3},16))}}),yJ={style:{display:"flex"}},wJ=o.defineComponent({__name:"TableActionButton",props:{editor:{},icon:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},color:{default:void 0},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t;function n(r){e.editor.isActive("table")||e.editor.chain().focus().insertTable({...r,withHeaderRow:!1}).run()}return(r,i)=>(o.openBlock(),o.createBlock(vJ,{disabled:r.editor.isActive("table"),onCreateTable:n},{trigger:o.withCtx(()=>[o.createElementVNode("div",yJ,[o.createVNode(Ge,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled,color:r.color,action:r.action,"is-active":r.isActive},null,8,["icon","tooltip","disabled","color","action","is-active"])])]),_:1},8,["disabled"]))}}),hv=uJ.extend({addStorage(){return{isTableMenuOpen:!1}},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toggleTableEditor:e=>({editor:n})=>n.storage.table?(n.storage.table.isTableEditorOpen=e,!0):!1}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:e,t:n})=>({component:wJ,componentProps:{icon:"Table",tooltip:n("editor.table.tooltip"),action:()=>{var i;const r=((i=e.storage.table)==null?void 0:i.isTableEditorOpen)??!1;e.commands.toggleTableEditor(!r)}}})}},addExtensions(){return[nJ.configure(this.options.tableRow),tJ.configure(this.options.tableHeader),rJ.configure(this.options.tableCell),eJ.configure(this.options.tableCellBackground)]}}),xJ={class:"flex items-center gap-2 px-2"},CJ=o.defineComponent({__name:"TextDropdown",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},maxHeight:{default:void 0},icon:{default:void 0},tooltip:{default:""}},setup(t){const e=t,{t:n}=_t(),r=o.computed(()=>[{name:"paragraph",label:n("editor.paragraph.tooltip"),iconName:"Paragraph",isActive:()=>e.editor.isActive("paragraph")&&!e.editor.isActive("orderedList")&&!e.editor.isActive("bulletList")&&!e.editor.isActive("taskList"),action:()=>e.editor.chain().focus().clearNodes().run()},{name:"heading1",label:n("editor.heading.h1.tooltip"),isActive:()=>e.editor.isActive("heading",{level:1}),iconName:"Heading1",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:1}).run()},{name:"heading2",label:n("editor.heading.h2.tooltip"),isActive:()=>e.editor.isActive("heading",{level:2}),iconName:"Heading2",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:2}).run()},{name:"heading3",label:n("editor.heading.h3.tooltip"),isActive:()=>e.editor.isActive("heading",{level:3}),iconName:"Heading3",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:3}).run()},{name:"bulletList",label:n("editor.bulletlist.tooltip"),isActive:()=>e.editor.isActive("bulletList"),iconName:"List",action:()=>e.editor.chain().focus().clearNodes().toggleBulletList().run()},{name:"numberedList",label:n("editor.orderedlist.tooltip"),isActive:()=>e.editor.isActive("orderedList"),iconName:"ListOrdered",action:()=>e.editor.chain().focus().clearNodes().toggleOrderedList().run()},{name:"taskList",label:n("editor.tasklist.tooltip"),isActive:()=>e.editor.isActive("taskList"),iconName:"ListTodo",action:()=>e.editor.chain().focus().clearNodes().toggleTaskList().run()},{name:"blockquote",label:n("editor.blockquote.tooltip"),isActive:()=>e.editor.isActive("blockquote"),iconName:"TextQuote",action:()=>e.editor.chain().focus().clearNodes().toggleBlockquote().run()},{name:"codeBlock",label:n("editor.codeblock.tooltip"),isActive:()=>e.editor.isActive("codeBlock"),iconName:"Code2",action:()=>e.editor.chain().focus().clearNodes().toggleCodeBlock().run()}]),i=o.computed(()=>r.value.filter(s=>s.isActive()).pop()??{label:n("editor.modify")});return(s,a)=>{var l;return o.openBlock(),o.createBlock(ya,{title:(l=i.value)==null?void 0:l.label,"side-offset":5},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(u,c)=>{var f;return o.openBlock(),o.createBlock(o.unref(Dl),{key:c,class:"cursor-pointer",checked:((f=u.isActive)==null?void 0:f.call(u))||!1,onClick:u.action},{default:o.withCtx(()=>[o.createElementVNode("div",xJ,[o.createVNode(o.unref(At),{name:u.iconName,class:"h3 w-3"},null,8,["name"]),o.createElementVNode("span",null,o.toDisplayString(u.label),1)])]),_:2},1032,["checked","onClick"])}),128))]),_:1},8,["title"])}}}),EJ=nt.create({name:"text-bubble",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:()=>({component:CJ,componentProps:{}})}}}),kJ=[{label:"복합 표현 - 요일과 시간대",examples:["다음 월요일 저녁","이번 토요일 오전"],pattern:"(이번|다음)?\\s?(월|화|수|목|금|토|일)요일(\\s?(오전|오후|저녁|밤|새벽))?"},{label:"시각 표현",examples:["오전 10시","오후 3시 30분","정오","자정","새벽 2시"],pattern:"((오전|오후|새벽|밤|저녁)\\s?\\d{1,2}(시(\\s?\\d{1,2}분)?)?|정오|자정)"},{label:"시간 표현 - 이른/늦은",examples:["이른 아침","늦은 밤"],pattern:"(이른\\s아침|늦은\\s밤)"},{label:"연도+월",examples:["2019년 6월","2025년12월","2024년 01월"],pattern:"\\d{4}년\\s?\\d{1,2}월"},{label:"오늘/내일/어제",examples:["오늘","내일","모레","어제","그제","그끄제"],pattern:"(오늘|내일|모레|어제|그제|그끄제)"},{label:"상대적 주 단위",examples:["이번 주","다음 주","지난 주"],pattern:"(이번|다음|지난)\\s?주"},{label:"상대적 월 단위",examples:["이번 달","다음 달","지난 달"],pattern:"(이번|다음|지난)\\s?달"},{label:"상대적 연도",examples:["올해","내년","작년","재작년","내후년"],pattern:"(올해|내년|작년|재작년|내후년)"},{label:"복합 표현 - 날짜와 시간대",examples:["1월 1일 오전","12월25일 저녁","다음 주 금요일 오전"],pattern:"(내년|올해|작년)?\\s?\\d{1,2}\\s?월\\s?\\d{1,2}\\s?일(\\s?(오전|오후|저녁|밤|새벽))?"},{label:"정확한 날짜",examples:["1월1일","1월 1일","12월 25일","01월 01일"],pattern:"\\d{1,2}\\s?월\\s?\\d{1,2}\\s?일"},{label:"요일",examples:["월요일","화요일","이번 금요일","다음 화요일"],pattern:"(이번|다음)?\\s?(월|화|수|목|금|토|일)요일"},{label:"시간대",examples:["오전","오후","저녁","밤","새벽"],pattern:"(오전|오후|저녁|밤|새벽)"},{label:"짧은 시간 표현",examples:["방금","조금 전","금방","곧","잠시 후"],pattern:"(방금|조금\\s전|금방|곧|잠시\\s후)"},{label:"연도",examples:["2015년","2024년","1998년"],pattern:"\\d{4}년"}],SJ=t=>{const e=[...t||[],...kJ.map(n=>n.pattern)].join("|");return new RegExp(e,"gu")},_J=nt.create({name:Jf,addOptions(){return{additionalTimeWords:[],enabled:!0}},addStorage(){return{cachedRegex:null,cachedAdditionalWords:null,enabled:this.options.enabled}},addProseMirrorPlugins(){return[new rt({props:{decorations:t=>{if(!this.storage.enabled)return at.empty;const e=[];return(this.storage.cachedAdditionalWords!==this.options.additionalTimeWords||!this.storage.cachedRegex)&&(this.storage.cachedAdditionalWords=this.options.additionalTimeWords,this.storage.cachedRegex=SJ(this.options.additionalTimeWords)),t.doc.descendants((n,r)=>{if(!n.isText)return;let i;const s=this.storage.cachedRegex;for(;i=s.exec(n.text||"");){const a=r+i.index,l=a+i[0].length;e.push(Wt.inline(a,l,{class:"time-highlight"}))}}),at.create(t.doc,e)}}})]},addCommands(){return{toggleTimeHighlight:()=>({editor:t})=>{const e=t.storage[Jf];return e.enabled=!e.enabled,t.view.dispatch(t.state.tr),!0}}}});function mv(t){const e=JSON.stringify(t),n=window.ReactNativeWebView;if(n){n.postMessage(e);return}console.warn("[clipboardBridge] no bridge found")}function TJ(){return new Promise(t=>{const e=window.receiveDriverData;window.receiveDriverData=n=>{var i;e&&e(n);let r;try{r=typeof n=="string"?JSON.parse(n):n}catch{return}(r==null?void 0:r.type)==="CLIPBOARD_STATE"&&t(!!((i=r.data)!=null&&i.hasClipboard))},mv({type:"REQUEST_CLIPBOARD_STATE"})})}function AJ(){return new Promise(t=>{const e=window.receiveDriverData;window.receiveDriverData=n=>{var i;e&&e(n);let r;try{r=typeof n=="string"?JSON.parse(n):n}catch{return}(r==null?void 0:r.type)==="PASTE_RESULT"&&t(((i=r.data)==null?void 0:i.text)??null)},mv({type:"PASTE"})})}function MJ(t,e){mv({type:"COPY",data:{html:t,text:e}})}async function OJ(t,e){try{const n=new ClipboardItem({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})});await navigator.clipboard.write([n])}catch(n){console.error("navigator clipboard write failed:",n)}}async function BJ(){try{if("read"in navigator.clipboard){const t=await navigator.clipboard.read();for(const e of t){if(e.types.includes("text/html"))return await(await e.getType("text/html")).text();if(e.types.includes("text/plain"))return await(await e.getType("text/plain")).text()}}}catch(t){console.warn("navigator clipboard read failed:",t)}}const IJ=nt.create({name:"clipboard",addCommands(){return{copyContent:()=>({editor:t,state:e})=>{const{from:n,to:r}=e.selection;return n===r?!1:((async()=>{try{const i=e.doc.slice(n,r),a=Dr.fromSchema(t.schema).serializeFragment(i.content),l=document.createElement("div");l.appendChild(a);const u=l.innerHTML,c=e.doc.textBetween(n,r,`
|
|
333
333
|
`);t.storage.deviceEnv.isMobile?MJ(u,c):await OJ(u,c)}catch(i){console.warn("[clipboard] copy failed",i)}})(),!0)},cutContent:()=>({editor:t})=>((async()=>{try{await t.commands.copyContent(),t.chain().focus().deleteSelection().run()}catch(e){console.warn("[clipboard] cut failed",e)}})(),!0),pasteContent:()=>({editor:t})=>((async()=>{try{t.chain().focus().run();const e=t.storage.deviceEnv.isMobile?await AJ():await BJ();if(!e)return;let n="",r="";if(HX(e)){n=e;const a=document.createElement("div");a.innerHTML=e,r=a.innerText}else r=e,n=e.replace(/\n/g,"<br>");const i=new DataTransfer;i.setData("text/html",n),i.setData("text/plain",r);const s=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(s,"clipboardData",{value:i}),t.view.dom.dispatchEvent(s)}catch(e){console.warn("Clipboard paste failed:",e)}})(),!0)}},onCreate(){const t=this.editor;t.hasClipboard=async()=>{try{return!!(t.storage.deviceEnv.isMobile?await TJ():await navigator.clipboard.readText())}catch(e){return console.warn("[clipboard] check failed",e),!1}}}}),RJ=nt.create({name:"deviceEnv",addOptions(){return{initial:!1,specialCharModal:void 0}},addStorage(){return{isMobile:this.options.initial,specialCharModal:this.options.specialCharModal,isForceCloseBubble:!1}},addCommands(){return{setIsMobile:t=>({editor:e})=>{var n;return e.storage.deviceEnv.isMobile=t,(n=e.storage.spellchecker)==null||n.spellchecker.setIsMobile(t),!0},setForceCloseBubble:t=>({editor:e})=>(e.storage.deviceEnv.isForceCloseBubble=t,!0),resetForceCloseBubble:()=>({editor:t})=>(t.storage.deviceEnv.isForceCloseBubble=!1,!0)}}}),mh=o.defineComponent({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=o.computed(()=>{const{class:r,...i}=e;return i});return(r,i)=>(o.openBlock(),o.createBlock(o.unref(fV),o.mergeProps({class:o.unref(Se)("mt-2 ring-offset-ed-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ed-ring focus-visible:ring-offset-2",e.class)},n.value),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),LJ={class:"flex items-center w-full p-3 my-3 hover:bg-ed-accent border border-ed-border text-ed-muted-foreground cursor-pointer rounded-sm transition-all"},DJ={key:0,class:"flex justify-center items-center gap-3 text-s"},PJ={key:1,class:"flex justify-between items-center w-full"},VJ={class:"flex justify-center items-center gap-3"},FJ={class:"text-sm"},$J={class:"flex items-center gap-2"},HJ=o.defineComponent({__name:"VideoUploader",props:{...Qs},setup(t){const e=t,n=o.inject("isEditable",o.ref(!0)),r=o.ref(""),i=o.ref(!1),s=o.ref(),{t:a}=_t();function l(p){var y;i.value=!0;const m=p.target,g=Array.from((m==null?void 0:m.files)||[]),b=(y=e.editor.extensionManager.extensions.find(x=>x.name==="videoUpload"))==null?void 0:y.options;if(!e.editor||e.editor.isDestroyed||g.length===0||typeof(b==null?void 0:b.upload)!="function")return;const v=g[0];b.upload(v).then(x=>{e.editor.chain().setVideo({src:x}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run(),i.value=!1})}function u(){e.editor.chain().setVideo({src:r.value,width:640}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run()}function c(){e.deleteNode()}function f(){var p;(p=s.value)==null||p.click()}return(p,m)=>(o.openBlock(),o.createBlock(o.unref(Zs),{as:"div","data-drag-handle":"",class:o.normalizeClass(o.unref(Se)(!o.unref(n)&&"pointer-events-none"))},{default:o.withCtx(()=>[o.createVNode(o.unref(cs),{"default-open":o.unref(n)},{default:o.withCtx(()=>[o.createVNode(o.unref(da),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",LJ,[i.value?(o.openBlock(),o.createElementBlock("div",DJ,[o.createVNode(o.unref(At),{class:"animate-spin w-6 h-6",name:"LoaderCircle"}),o.createElementVNode("span",null,o.toDisplayString(o.unref(a)("editor.video.dialog.uploading"))+"...",1)])):(o.openBlock(),o.createElementBlock("div",PJ,[o.createElementVNode("div",VJ,[o.createVNode(o.unref(At),{name:"Video",class:"w-6 h-6"}),o.createElementVNode("span",FJ,o.toDisplayString(o.unref(a)("editor.video.dialog.title")),1)]),o.createVNode(o.unref(At),{name:"Trash2",class:"hover:text-ed-foreground",onClick:o.withModifiers(c,["stop"])})]))])]),_:1}),o.createVNode(o.unref(ds),{"trap-focus":"",class:"w-full","on-open-auto-focus":g=>g.preventDefault()},{default:o.withCtx(()=>[o.createVNode(o.unref(Qf),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:o.withCtx(()=>[o.createVNode(o.unref(Nf),{class:"grid w-full grid-cols-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ml),{value:"upload"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("editor.video.dialog.tab.upload")),1)]),_:1}),o.createVNode(o.unref(Ml),{value:"link",disabled:i.value},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("editor.video.dialog.link")),1)]),_:1},8,["disabled"])]),_:1}),o.createVNode(o.unref(mh),{value:"upload"},{default:o.withCtx(()=>[o.createVNode(o.unref(gn),{class:"w-full mt-1",size:"sm",disabled:i.value,onClick:f},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("editor.video.dialog.tab.upload")),1)]),_:1},8,["disabled"]),o.createElementVNode("input",{ref_key:"fileInput",ref:s,type:"file",accept:"video/*",hidden:"",onChange:l},null,544)]),_:1}),o.createVNode(o.unref(mh),{value:"link"},{default:o.withCtx(()=>[o.createElementVNode("div",$J,[o.createVNode(o.unref(fs),{modelValue:r.value,"onUpdate:modelValue":m[0]||(m[0]=g=>r.value=g),type:"url",autofocus:"",required:"",placeholder:o.unref(a)("editor.video.dialog.placeholder")},null,8,["modelValue","placeholder"]),o.createVNode(o.unref(gn),{onClick:u},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("editor.video.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1},8,["default-open"])]),_:1},8,["class"]))}}),jE=Rt.create({name:nc,isolating:!0,defining:!0,group:"block",draggable:!0,selectable:!1,inline:!1,parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addCommands(){return{setVideoUpload:()=>({commands:t})=>t.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return Ns(HJ)},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("link video not found"),button:({editor:e,t:n})=>{var r,i;return{component:Ge,componentProps:{action:()=>e.commands.setVideoUpload(),isActive:()=>e.isActive("video")||!1,disabled:!((i=(r=e.can()).setVideo)!=null&&i.call(r,{})),icon:"Video",tooltip:n("editor.video.tooltip")}}}}}});function zJ(t){return t=t.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/"),t=t.replace("https://vimeo.com/","https://player.vimeo.com/video/"),/^https?:\/\/www.bilibili.com\/video\/.*/i.test(t)&&(t=t.replace(/\?.*$/i,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),t.includes("drive.google.com")&&(t=t.replace("/view","/preview")),t}function UJ(t){return t?t.includes("youtube.com/embed")||t.includes("player.vimeo.com")||t.includes("player.bilibili.com")||t.includes("drive.google.com"):!1}const qE=Rt.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,width:of["size-medium"],controls:!0,autoplay:!1,HTMLAttributes:{class:"iframe-wrapper",style:"display: flex;justify-content: center;"}}},addAttributes(){return{src:{default:null,renderHTML:({src:t})=>({src:t?zJ(t):null})},width:{default:this.options.width,renderHTML:({width:t})=>({width:rn(t)})},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},controls:{default:this.options.controls}}},parseHTML(){return[{tag:"video"},{tag:"iframe"}]},renderHTML({HTMLAttributes:t}){const{src:e,width:n,controls:r,allowfullscreen:i}=t??{},s=`max-width: ${rn(n)};`;return UJ(e)?["iframe",{src:e,style:s,...i&&{allowfullscreen:i}}]:["video",{src:e?e.replace(/\\/g,"/"):"",style:s,...r&&{controls:r}}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),updateVideo:t=>({commands:e})=>e.updateAttributes(this.name,t)}}}),Hl=new Et("upload-image"),WJ=()=>new rt({key:Hl,state:{init(){return at.empty},apply(t,e){e=e.map(t.mapping,t.doc);const n=t.getMeta(Hl);if(n!=null&&n.add){const r=n.add.map(({id:i,pos:s,src:a})=>{const l=jJ(a);return Wt.widget(s,l,{id:i,side:-1})});e=e.add(t.doc,r)}return n!=null&&n.remove&&n.remove.forEach(r=>{e=e.remove(e.find(void 0,void 0,i=>i.id===r))}),e}},props:{decorations(t){return this.getState(t)}}});function jJ(t){const e=document.createElement("div"),n=document.createElement("img");return n.setAttribute("class","opacity-50"),n.src=t,n.onload=()=>{e.setAttribute("class","img-placeholder")},e.appendChild(n),e}function qJ(t,e){var i;const r=Hl.getState(t).find(void 0,void 0,s=>s.id===e);return r.length?(i=r[0])==null?void 0:i.from:null}const KE=({validateFn:t,onUpload:e})=>async(n,r,i)=>{const s=[];for(const a of n){if(t&&!t(a))continue;const l=Gr(6),u=URL.createObjectURL(a);s.push({file:a,id:l,preview:u})}s.length!==0&&(r.dispatch(r.state.tr.setMeta(Hl,{add:s.map(({id:a,preview:l})=>({id:a,pos:i,src:l}))})),await Promise.all(s.map(async({file:a,id:l,preview:u})=>{var c,f;try{const p=await e(a),m=qJ(r.state,l);if(m===null)return;const{schema:g}=r.state,b=typeof p=="object"?u:p,v=(c=g.nodes.image)==null?void 0:c.create({src:b}),y=(f=g.nodes.paragraph)==null?void 0:f.create();if(!v||!y)return;r.dispatch(r.state.tr.replaceWith(m,m,v).insert(m+v.nodeSize,y).setMeta(Hl,{remove:[l]}))}catch{r.dispatch(r.state.tr.setMeta(Hl,{remove:[l]}))}})))},KJ=(t,e,n)=>{var i;const r=Array.from(((i=e.clipboardData)==null?void 0:i.files)||[]);if(r.length){e.preventDefault();const s=t.state.selection.from;return n(r,t,s+1),!0}return!1},GJ=(t,e,n,r)=>{var s;const i=Array.from(((s=e.dataTransfer)==null?void 0:s.files)||[]);if(!n&&i.length){e.preventDefault();const a=t.posAtCoords({left:e.clientX,top:e.clientY});if(a)return r(i,t,a.pos+1),!0}return!1},XJ={class:"flex items-center w-full p-3 my-3 transition-all border rounded-sm cursor-pointer hover:bg-ed-accent border-ed-border text-ed-muted-foreground"},YJ={class:"flex items-center justify-between w-full"},JJ={class:"flex items-center justify-center gap-3"},ZJ={class:"text-sm"},QJ={class:"flex items-center gap-2"},NJ=o.defineComponent({__name:"ImageUploader",props:{...Qs},setup(t){const e=t,n=o.ref(""),r=o.ref(),{t:i}=_t(),s=o.inject("isEditable",o.ref(!0));function a(f){var v,y;const p=(v=f==null?void 0:f.target)==null?void 0:v.files;if(!e.editor||e.editor.isDestroyed||p.length===0)return;const m=Array.from(p),g=(y=e.editor.extensionManager.extensions.find(x=>x.name==="imageUpload"))==null?void 0:y.options;KE({validateFn:x=>!0,onUpload:g.upload})(m,e.editor.view,e.getPos(),e.node.attrs.id)}function l(){e.editor.chain().setImage({src:n.value}).deleteRange({from:e.getPos(),to:e.getPos()}).insertContentAt(e.getPos()+1,{type:"paragraph"}).focus().run()}function u(){e.deleteNode()}function c(){var f;(f=r.value)==null||f.click()}return(f,p)=>(o.openBlock(),o.createBlock(o.unref(Zs),{id:f.node.attrs.id,"data-drag-handle":"",class:o.normalizeClass(o.unref(Se)(!o.unref(s)&&"pointer-events-none"))},{default:o.withCtx(()=>[o.createVNode(o.unref(cs),{"default-open":o.unref(s)},{default:o.withCtx(()=>[o.createVNode(o.unref(da),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",XJ,[o.createElementVNode("div",YJ,[o.createElementVNode("div",JJ,[o.createVNode(o.unref(At),{name:"ImageUp",class:"w-6 h-6"}),o.createElementVNode("span",ZJ,o.toDisplayString(o.unref(i)("editor.image.dialog.title")),1)]),o.createVNode(o.unref(At),{name:"Trash2",class:"hover:text-ed-foreground",onClick:o.withModifiers(u,["stop"])})])])]),_:1}),o.createVNode(o.unref(ds),{"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:o.withCtx(()=>[o.createVNode(o.unref(Qf),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:o.withCtx(()=>[o.createVNode(o.unref(Nf),{class:"grid w-full grid-cols-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ml),{value:"upload"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.image.dialog.tab.upload")),1)]),_:1}),o.createVNode(o.unref(Ml),{value:"link"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.image.dialog.tab.url")),1)]),_:1})]),_:1}),o.createVNode(o.unref(mh),{value:"upload"},{default:o.withCtx(()=>[o.createVNode(o.unref(gn),{class:"w-full mt-1",size:"sm",onClick:c},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.image.dialog.tab.upload")),1)]),_:1}),o.createElementVNode("input",{ref_key:"fileInput",ref:r,type:"file",accept:"image/*",multiple:"",hidden:"",onChange:a},null,544)]),_:1}),o.createVNode(o.unref(mh),{value:"link"},{default:o.withCtx(()=>[o.createElementVNode("div",QJ,[o.createVNode(o.unref(fs),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:o.unref(i)("editor.image.dialog.placeholder")},null,8,["modelValue","placeholder"]),o.createVNode(o.unref(gn),{onClick:l},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(i)("editor.image.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1},8,["default-open"])]),_:1},8,["id","class"]))}}),eZ=1,tZ=1e6,ki={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let gv=0;function nZ(){return gv=(gv+1)%Number.MAX_VALUE,gv.toString()}const bv=new Map;function GE(t){if(bv.has(t))return;const e=setTimeout(()=>{bv.delete(t),Fc({type:ki.REMOVE_TOAST,toastId:t})},tZ);bv.set(t,e)}const Eo=o.ref({toasts:[]});function Fc(t){switch(t.type){case ki.ADD_TOAST:Eo.value.toasts=[t.toast,...Eo.value.toasts].slice(0,eZ);break;case ki.UPDATE_TOAST:Eo.value.toasts=Eo.value.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e);break;case ki.DISMISS_TOAST:{const{toastId:e}=t;e?GE(e):Eo.value.toasts.forEach(n=>{GE(n.id)}),Eo.value.toasts=Eo.value.toasts.map(n=>n.id===e||e===void 0?{...n,open:!1}:n);break}case ki.REMOVE_TOAST:t.toastId===void 0?Eo.value.toasts=[]:Eo.value.toasts=Eo.value.toasts.filter(e=>e.id!==t.toastId);break}}function vv(){return{toasts:o.computed(()=>Eo.value.toasts),toast:rZ,dismiss:t=>Fc({type:ki.DISMISS_TOAST,toastId:t})}}function rZ(t){const e=nZ(),n=i=>Fc({type:ki.UPDATE_TOAST,toast:{...i,id:e}}),r=()=>Fc({type:ki.DISMISS_TOAST,toastId:e});return Fc({type:ki.ADD_TOAST,toast:{...t,id:e,open:!0,onOpenChange:i=>{i||r()}}}),{id:e,dismiss:r,update:n}}const oZ={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5},iZ=t=>`${(t/1024/1024).toFixed(2)}MB`,XE=Rt.create({name:gi,isolating:!0,defining:!0,group:"block",draggable:!1,selectable:!1,inline:!1,onCreate(){if(typeof this.options.upload!="function")throw new Error("Image upload function should be a function")},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addAttributes(){return{id:{default:Gr(6),parseHTML:t=>t.getAttribute("id"),renderHTML:t=>t.id?{id:t.id}:{}}}},addCommands(){return{setImageUpload:()=>({commands:t})=>t.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return Ns(NJ)},addOptions(){var t;return{...oZ,...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:e,extension:n,t:r})=>{var i,s;return{component:Ge,componentProps:{action:()=>e.commands.setImageUpload(),disabled:!((s=(i=e.can()).setImage)!=null&&s.call(i,{})),icon:"ImageUp",tooltip:r("editor.image.tooltip")}}}}},addProseMirrorPlugins(){const{toast:t}=vv(),{t:e}=_t(),r=KE({validateFn:i=>this.options.acceptMimes.includes(i.type)?i.size>this.options.maxSize?(t({description:`${e("editor.imageUpload.fileSizeTooBig")} ${iZ(this.options.maxSize)}.`,duration:2e3}),!1):!0:(t({description:e("editor.imageUpload.fileTypeNotSupported"),duration:2e3}),!1),onUpload:this.options.upload});return[new rt({props:{handlePaste:(i,s)=>!s.clipboardData||Array.from(s.clipboardData.items||[]).some(l=>l.type==="text/html")?!1:KJ(i,s,r),handleDrop:(i,s,a,l)=>!(s instanceof DragEvent)||!s.dataTransfer||!Array.from(s.dataTransfer.files||[]).some(f=>this.options.acceptMimes.includes(f.type))?!1:GJ(i,s,l,r)}}),WJ()]}}),sZ=nt.create({name:"searchHighlight",addGlobalAttributes(){return[{types:["textStyle"],attributes:{searchHighlight:{default:null,parseHTML:t=>{const e=t,n=e.style.color,r=e.style.backgroundColor;return!n||!r?null:{color:n,backgroundColor:r}},renderHTML:t=>{if(!t.searchHighlight)return{};const{color:e,backgroundColor:n}=t.searchHighlight;return{style:`color: ${e}; background-color: ${n}`}}}}}]}}),aZ=o.defineComponent({__name:"SpecialCharacterButton",props:{editor:r4},setup(t){const e=t,{t:n}=_t(),r=yn(),i=o.computed(()=>{var p;return(p=e.editor)==null?void 0:p.storage.specialCharacter.specialCharModal}),s=o.ref(!1);let a=null;function l(){const p=document.activeElement;if(p instanceof HTMLInputElement){a={type:"input",el:p};return}r.editorFocusedInstance.value&&(a={type:"editor"})}const u=()=>{if(!i.value||!i.value.component){console.error("Please configure specialCharModal!");return}s.value=!s.value};document.addEventListener("focusin",p=>{var b,v;if(!s.value)return;const m=p.target;if(m instanceof HTMLInputElement){a={type:"input",el:m};return}const g=r.editorFocusedInstance.value;(v=(b=g==null?void 0:g.view)==null?void 0:b.dom)!=null&&v.contains(m)&&(a={type:"editor"})});function c(p,m){const g=p.selectionStart??p.value.length,b=p.selectionEnd??p.value.length;p.value=p.value.slice(0,g)+m+p.value.slice(b);const v=g+m.length;p.setSelectionRange(v,v),p.dispatchEvent(new Event("input",{bubbles:!0})),p.focus()}const f=(p,m)=>{if(m){if((a==null?void 0:a.type)==="input"){c(a.el,p);return}if((a==null?void 0:a.type)==="editor"){const g=r.editorFocusedInstance.value;if(!g)return;const{view:b}=g,{from:v}=b.state.selection;g.commands.insertContentAt(v,p),g.commands.focus()}}};return(p,m)=>{const g=pa,b=ps,v=fa,y=ha;return o.openBlock(),o.createBlock(y,null,{default:o.withCtx(()=>[o.createVNode(v,{"delay-duration":0},{default:o.withCtx(()=>[o.createVNode(g,null,{default:o.withCtx(()=>[o.createVNode(gn,{class:"text-[#65558F] hover:bg-[#ECE6F0]/90 text-xs rounded-none font-normal h-[26px] px-3 border border-gray-300 bg-ed-gray-50 dark:bg-black dark:text-white dark:hover:bg-gray-700 transition-all",onPointerdown:l,onClick:u},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.insert.symbol")),1)]),_:1})]),_:1}),o.createVNode(b,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("editor.insert.symbol")),1)]),_:1})]),_:1}),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.unref(s)?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(i).component),o.mergeProps({key:0},o.unref(i).props,{"custom-class":"!z-[70] !pointer-events-auto",onClose:m[0]||(m[0]=x=>s.value=!1),onSelectedChar:f}),null,16)):o.createCommentVNode("",!0)]))]),_:1})}}}),lZ=nt.create({name:Zf,addOptions(){return{button:({editor:t})=>({component:aZ,componentProps:{editor:t}}),specialCharModal:void 0}},addStorage(){return{specialCharModal:this.options.specialCharModal}}}),YE=nt.create({name:"base-kit",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),timeHighlighter:{additionalTimeWords:[]},bubble:{list:VI,defaultBubbleList:aG,button:({editor:e,extension:n,t:r})=>{var l;const{list:i={},defaultBubbleList:s}=((l=n.options)==null?void 0:l.bubble)??{},a=(s==null?void 0:s(e))??[];return lG(i,a,{editor:e,extension:n,t:r})}}}},addExtensions(){var n,r,i;const{t}=_t(),e=[];this.options.placeholder!==!1&&e.push(F5.configure({placeholder:({node:s,pos:a})=>{var u;const l=(u=s==null?void 0:s.type)==null?void 0:u.name;return l==="heading"?`${t(`editor.heading.h${s.attrs.level}.tooltip`)}`:l==="table"||l==="codeBlock"?"":a===0?t("editor.content"):""},...this.options.placeholder})),this.options.focus!==!1&&e.push(YK.configure({className:"focus",...this.options.focus})),this.options.document!==!1&&(this.options.page?(e.push(z5.configure().extend({content:"page+"})),e.push(gX.configure({types:((r=(n=this.options.page)==null?void 0:n.nodesComputedOption)==null?void 0:r.types)??[],slots:o.useSlots()}))):e.push(z5.configure())),this.options.dropcursor!==!1&&e.push(XK.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&e.push(qK.configure(this.options.characterCount)),this.options.paragraph!==!1&&e.push(V5.configure(this.options.paragraph)),this.options.hardBreak!==!1&&e.push(P5.configure(this.options.hardBreak)),this.options.listItem!==!1&&e.push(oG.configure(this.options.listItem)),this.options.textStyle!==!1&&e.push(Lq.configure(this.options.textStyle)),this.options.imageUpload!==!1&&e.push(XE.configure(this.options.imageUpload)),this.options.video!==!1&&e.push(qE.configure(this.options.video)),this.options.videoUpload!==!1&&e.push(jE.configure(this.options.videoUpload)),this.options.history!==!1&&e.push(Db.configure(this.options.history)),this.options.fontFamily!==!1&&e.push(dE.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(o5.configure(this.options.fontSize)),this.options.mode!==Ie.EDITOR&&e.push(lZ.configure(this.options.specialCharacter)),this.options.mode!==Ie.EDITOR&&e.push(EX),this.options.superText!==!1&&this.options.mode!==Ie.PLAIN_TEXT&&this.options.mode!==Ie.EDITOR&&(typeof this.options.superText=="boolean"?e.push(bE.configure()):e.push(bE.configure(this.options.superText))),this.options.mode===Ie.EDITOR&&(this.options.image!==!1&&e.push(ov.configure()),e.push(n5.configure({spacer:!0}),_8,S8,T8,Ib,hv,A8,i5.configure({spacer:!0}),r5.configure({types:["heading","paragraph"],spacer:!0}),hE)),this.options.mode!==Ie.EDITOR&&this.options.configPlan!==!1&&this.options.mode!==Ie.PLAIN_TEXT&&(typeof this.options.configPlan=="boolean"?e.push(yE.configure()):e.push(yE.configure({specialCharModal:(i=this.options.configPlan)==null?void 0:i.specialCharModal}))),this.options.mode!==Ie.EDITOR&&this.options.mode!==Ie.PLAIN_TEXT&&e.push(SX),(this.options.mode===Ie.STRAIGHT||this.options.mode===Ie.REPORT||this.options.mode===Ie.EDITOR)&&this.options.timeHighlighter&&e.push(_J.configure(this.options.timeHighlighter)),this.options.invalidCharFocus!==!1&&e.push(lE.configure(this.options.invalidCharFocus)),this.options.disabled&&e.push(sZ),e.push(iG,$5.configure(),EJ.configure(),rG.configure(),iv,nv,lb,IJ,RJ.configure(this.options.deviceEnv),s5.configure({multicolor:!0}));for(const s in this.options.excludes)Object.prototype.hasOwnProperty.call(this.options.excludes,s)&&this.options.excludes[s]&&kt.remove(e,({name:l})=>l===s);return e},addStorage(){return{mode:this.options.mode}}}),JE=Hn.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",yt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),ZE=Hn.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",yt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),uZ=nt.create({name:"subAndSuperScript",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>{const i=n.options.subscript,s=n.options.superscript,a={component:Ge,componentProps:{action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",tooltip:r("editor.subscript.tooltip")}},l={component:Ge,componentProps:{action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",tooltip:r("editor.superscript.tooltip")}},u=[];return i!==!1&&u.push(a),s!==!1&&u.push(l),u}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(JE.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(ZE.configure(this.options.superscript)),t}}),cZ={class:"ml-1"},dZ=o.defineComponent({__name:"ActionMoreButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},maxHeight:{default:void 0},icon:{default:void 0},tooltip:{default:""},items:{default:()=>[]}},setup(t){const e=t,n=o.computed(()=>{const r=e.items.find(s=>s.isActive());return r&&!r.default?{...r,icon:r.icon?r.icon:e.icon}:{title:e.tooltip,icon:e.icon,isActive:()=>!1}});return(r,i)=>(o.openBlock(),o.createBlock(ya,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.items,(s,a)=>(o.openBlock(),o.createBlock(o.unref(Dl),{key:a,checked:n.value.title===s.title,disabled:s.disabled,class:"flex gap-3 items-center",onClick:s.action},{default:o.withCtx(()=>[s.icon?(o.openBlock(),o.createBlock(o.unref(At),{key:0,name:s.icon},null,8,["name"])):o.createCommentVNode("",!0),o.createElementVNode("span",cZ,o.toDisplayString(s.title),1),s.shortcutKeys?(o.openBlock(),o.createBlock(o.unref(t5),{key:1,class:"ml-auto"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(DC)(s.shortcutKeys)),1)]),_:2},1024)):o.createCommentVNode("",!0)]),_:2},1032,["checked","disabled","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),fZ=nt.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,extension:n,t:r}){const i=n.options.subscript,s=n.options.superscript,a={action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",title:r("editor.subscript.tooltip"),shortcutKeys:["mod","."]},l={action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",title:r("editor.superscript.tooltip"),shortcutKeys:["mod",","]},u=a1(e,"code"),c=[];if(i!==!1&&c.push(a),s!==!1&&c.push(l),u){const f={action:()=>e.commands.toggleCode(),isActive:()=>e.isActive("code")||!1,disabled:!e.can().toggleCode(),icon:"Code",title:r("editor.code.tooltip"),shortcutKeys:["mod","E"]};u&&c.push(f)}return{component:dZ,componentProps:{icon:"Type",tooltip:r("editor.moremark"),disabled:!e.isEditable||c.every(f=>f.disabled),items:c}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(JE.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(ZE.configure(this.options.superscript)),t}});var Sa=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(Sa||{});function pZ(t,e,n){return t<e?e:t>n?n:t}function hZ(t,e,n,r){const{doc:i,selection:s}=t;if(!i||!s||!(s instanceof Ve||s instanceof Vn))return t;const{from:a,to:l}=s;return i.nodesBetween(a,l,(u,c)=>{const f=u.type;return n.includes(f.name)?(t=mZ(t,c,e),!1):!L0(u.type.name,r.extensionManager.extensions)}),t}function mZ(t,e,n){if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r)return t;const a=pZ((r.attrs.indent||0)+n,0,7);if(a===r.attrs.indent)return t;const l={...r.attrs,indent:a};return t.setNodeMarkup(e,r.type,l,r.marks)}function QE({delta:t,types:e}){return({state:n,dispatch:r,editor:i})=>{const{selection:s}=n;let{tr:a}=n;return a=a.setSelection(s),a=hZ(a,t,e,i),a.docChanged?(r&&r(a),!0):!1}}const gZ=nt.create({name:"indent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:Sa.min,maxIndent:Sa.max,button({editor:e,t:n}){var s,a;const{selection:r}=e.state,i=r.$anchor.parent;return[{component:Ge,componentProps:{action:()=>{e.commands.indent()},disabled:((s=i==null?void 0:i.attrs)==null?void 0:s.indent)>=Sa.max||!e.can().indent(),shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")}},{component:Ge,componentProps:{action:()=>{e.commands.outdent()},shortcutKeys:["Shift","Tab"],disabled:((a=i==null?void 0:i.attrs)==null?void 0:a.indent)<=Sa.min||!e.can().outdent(),icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}]}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.getAttribute("data-indent");return(e?parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>QE({delta:Sa.more,types:this.options.types}),outdent:()=>QE({delta:Sa.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});function bZ(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:a,$position:l}=t,u=r&&!i,c=GO(n),f=new RegExp(`\\s${c}$`),p=a?"^":"",m=i?"":c,g=u?new RegExp(`${p}${c}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${p}(?:^)?${c}[^\\s${m}]*`,"gm"),b=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!b)return null;const v=l.pos-b.length,y=Array.from(b.matchAll(g)).pop();if(!y||y.input===void 0||y.index===void 0)return null;const x=y.input.slice(Math.max(0,y.index-1),y.index),E=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(x);if(s!==null&&!E)return null;const k=v+y.index;let C=k+y[0].length;return u&&f.test(b.slice(C-1,C+1))&&(y[0]+=" ",C+=1),k<l.pos&&C>=l.pos?{range:{from:k,to:C},query:y[0].slice(n.length),text:y[0]}:null}const vZ=new Et("suggestion");function yZ({pluginKey:t=vZ,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:s=[" "],startOfLine:a=!1,decorationTag:l="span",decorationClass:u="suggestion",command:c=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=bZ}){let b;const v=p==null?void 0:p(),y=new rt({key:t,view(){return{update:async(x,E)=>{var k,C,_,T,A,I,O;const M=(k=this.key)===null||k===void 0?void 0:k.getState(E),$=(C=this.key)===null||C===void 0?void 0:C.getState(x.state),H=M.active&&$.active&&M.range.from!==$.range.from,K=!M.active&&$.active,N=M.active&&!$.active,V=!K&&!N&&M.query!==$.query,F=K||H&&V,R=V||H,W=N||H&&V;if(!F&&!R&&!W)return;const P=W&&!F?M:$,G=x.dom.querySelector(`[data-decoration-id="${P.decorationId}"]`);b={editor:e,range:P.range,query:P.query,text:P.text,items:[],command:Y=>c({editor:e,range:P.range,props:Y}),decorationNode:G,clientRect:G?()=>{var Y;const{decorationId:le}=(Y=this.key)===null||Y===void 0?void 0:Y.getState(e.state),fe=x.dom.querySelector(`[data-decoration-id="${le}"]`);return(fe==null?void 0:fe.getBoundingClientRect())||null}:null},F&&((_=v==null?void 0:v.onBeforeStart)===null||_===void 0||_.call(v,b)),R&&((T=v==null?void 0:v.onBeforeUpdate)===null||T===void 0||T.call(v,b)),(R||F)&&(b.items=await f({editor:e,query:P.query})),W&&((A=v==null?void 0:v.onExit)===null||A===void 0||A.call(v,b)),R&&((I=v==null?void 0:v.onUpdate)===null||I===void 0||I.call(v,b)),F&&((O=v==null?void 0:v.onStart)===null||O===void 0||O.call(v,b))},destroy:()=>{var x;b&&((x=v==null?void 0:v.onExit)===null||x===void 0||x.call(v,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(x,E,k,C){const{isEditable:_}=e,{composing:T}=e.view,{selection:A}=x,{empty:I,from:O}=A,M={...E};if(M.composing=T,_&&(I||e.view.composing)){(O<E.range.from||O>E.range.to)&&!T&&!E.composing&&(M.active=!1);const $=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:a,$position:A.$from}),H=`id_${Math.floor(Math.random()*4294967295)}`;$&&m({editor:e,state:C,range:$.range,isActive:E.active})?(M.active=!0,M.decorationId=E.decorationId?E.decorationId:H,M.range=$.range,M.query=$.query,M.text=$.text):M.active=!1}else M.active=!1;return M.active||(M.decorationId=null,M.range={from:0,to:0},M.query=null,M.text=null),M}},props:{handleKeyDown(x,E){var k;const{active:C,range:_}=y.getState(x.state);return C&&((k=v==null?void 0:v.onKeyDown)===null||k===void 0?void 0:k.call(v,{view:x,event:E,range:_}))||!1},decorations(x){const{active:E,range:k,decorationId:C}=y.getState(x);return E?at.create(x.doc,[Wt.inline(k.from,k.to,{nodeName:l,class:u,"data-decoration-id":C})]):null}}});return y}const wZ=[{label:"优酷",value:"youku",icon:"Youku"},{label:"哔哩哔哩",value:"bilibili",icon:"BiliBili"},{label:"腾讯视频",value:"qqvideo",icon:"QQVideo"}],xZ=[{label:"高德地图",value:"amap",icon:"Gaode"},{label:"百度地图",value:"baidu_map",icon:"Baidu"}],CZ=[{label:"墨刀",value:"modao",icon:"Modao"},{label:"蓝湖",value:"lanhu",icon:"Lanhu"},{label:"Figma",value:"figma",icon:"Figma"},{label:"Canva",value:"canva",icon:"Canva"},{label:"ProcessOn",value:"processon",icon:"Processon"}],EZ=[{label:"CodePen",value:"codepen",icon:"Codepen"}],kZ=[{label:"金数据",value:"jinshuju",icon:"Jinshuju"}],SZ=[],_Z=[...wZ,...xZ,...CZ,...EZ,...kZ,...SZ];function TZ(t){const{t:e}=_t(),n=[{name:"format",title:e("editor.slash.format"),commands:[{name:"paragraph",label:e("editor.paragraph.tooltip"),aliases:["paragraph","zw"],iconName:"Paragraph",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading1",label:e("editor.heading.h1.tooltip"),aliases:["h1","bt","bt1"],iconName:"Heading1",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading2",label:e("editor.heading.h2.tooltip"),aliases:["h2","bt","bt2"],iconName:"Heading2",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setNode("heading",{level:2}).run()}},{name:"heading3",label:e("editor.heading.h3.tooltip"),aliases:["h3","bt","bt3","heading3"],iconName:"Heading3",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setNode("heading",{level:3}).run()}},{name:"bulletList",label:e("editor.bulletlist.tooltip"),aliases:["ul","yxlb","bulletList"],iconName:"List",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).toggleBulletList().run()}},{name:"numberedList",label:e("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).toggleOrderedList().run()}},{name:"codeBlock",label:e("editor.codeblock.tooltip"),iconName:"Code2",aliases:["codeBlock"],description:"Code block with syntax highlighting",shouldBeHidden:i=>i.isActive("columns"),action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setCodeBlock().run()}},{name:"blockquote",label:e("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setBlockquote().run()}},{name:"horizontalrule",label:e("editor.horizontalrule.tooltip"),aliases:["fgx","horizontalRule"],iconName:"Minus",action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setHorizontalRule().run()}},{name:"link",label:e("editor.link.tooltip"),aliases:["link","lianjie","lj"],iconName:"Link",action:({editor:i,range:s})=>{i.chain().deleteRange(s).extendMarkRange("link").insertContent({type:"text",text:"link",marks:[{type:"link",attrs:{href:"",target:"_blank"}}]}).setLink({href:""}).focus().run()}}]},{name:"insert",title:e("editor.slash.insert"),commands:[{name:"image",label:e("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:i=>i.isActive("columns"),action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setImageUpload().run()}},{name:"table",label:e("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:i=>i.isActive("columns"),action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}},{name:"video",label:e("editor.video.tooltip"),iconName:"Video",description:"Insert a video",aliases:["video","sp","shipin"],shouldBeHidden:i=>i.isActive("columns"),action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).setVideoUpload().run()}},{name:"taskList",label:e("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],action:({editor:i,range:s})=>{i.chain().focus().deleteRange(s).toggleTaskList().run()}},{name:"columns",label:e("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",aliases:["columns","cols","2cols"],shouldBeHidden:i=>i.isActive("columns"),action:({editor:i,range:s})=>{i.chain().deleteRange(s).setColumns().focus(i.state.selection.head-1).run()}}]}];if(a1(t,"iframes")){const i=_Z;n.push({name:"others",title:e("editor.slash.embed"),commands:i.map(s=>({name:s.value,label:s.label,iconName:s.icon,aliases:[s.value,s.label],shouldBeHidden:a=>a.isActive("columns"),action:({editor:a,range:l})=>{a.chain().deleteRange(l).focus().setIframe({src:"",service:s.value}).run()}}))})}return n}const AZ={key:0,class:"grid grid-cols-1 gap-0.5 min-w-48"},MZ={className:"text-neutral-500 text-[0.65rem] col-[1/-1] mx-2 mt-2 font-semibold tracking-wider select-none uppercase first:mt-0.5"},OZ=["onClick"],BZ=["src"],IZ={key:1,class:"p-3"},RZ={class:"text-xs text-gray-800 dark:text-gray-400"},LZ=o.defineComponent({__name:"CommandsList",props:{editor:{},items:{default:void 0},command:{type:Function,default:void 0}},setup(t,{expose:e}){const n=o.ref(0),r=o.ref(0),i=o.ref(null),{t:s}=_t(),a=o.ref([]),l=t;e({onKeyDown:u}),o.watch([()=>n.value,()=>r.value],async()=>{if(!i.value)return;await o.nextTick();const v=r.value*1e3+n.value,y=a.value[v];y&&y.scrollIntoView({behavior:"smooth",block:"nearest"})});function u({event:v}){return v.key==="ArrowUp"?(c(),!0):v.key==="ArrowDown"?(f(),!0):v.key==="Enter"?(p(),!0):!1}function c(){var x;if(!l.items.length)return!1;let v=n.value-1,y=r.value;v<0&&(y=r.value-1,v=((x=l.items[y])==null?void 0:x.commands.length)-1||0),y<0&&(y=l.items.length-1,v=l.items[y].commands.length-1),n.value=v,r.value=y}function f(){if(!l.items.length)return!1;const v=l.items[r.value].commands;let y=n.value+1,x=r.value;v.length-1<y&&(y=0,x=r.value+1),l.items.length-1<x&&(x=0),n.value=y,r.value=x}function p(){if(!l.items.length||r.value===-1||n.value===-1)return!1;m(r.value,n.value)}function m(v,y){const x=l.items[v].commands[y];l.command(x)}function g(v,y){m(v,y)}function b(v,y,x){a.value[v*1e3+y]=x}return(v,y)=>{var x;return o.openBlock(),o.createElementBlock("div",{ref_key:"scrollContainer",ref:i,class:"bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800 text-black max-h-[min(80vh,24rem)] overflow-auto flex-wrap mb-8 p-1"},[(x=v.items)!=null&&x.length?(o.openBlock(),o.createElementBlock("div",AZ,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(v.items,(E,k)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:E.title},[o.createElementVNode("div",MZ,o.toDisplayString(E.title),1),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(E.commands,(C,_)=>(o.openBlock(),o.createElementBlock("button",{ref_for:!0,ref:T=>b(k,_,T),key:_,class:o.normalizeClass(["flex items-center gap-3 px-2 py-1.5 text-sm text-neutral-800 dark:text-neutral-200 text-left w-full rounded-sm outline-none transition-colors",[r.value===k&&n.value===_?"bg-ed-accent text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200":"hover:bg-ed-accent hover:text-neutral-800 dark:hover:bg-neutral-900 dark:hover:text-neutral-200"]]),onClick:T=>g(k,_)},[C.iconUrl?(o.openBlock(),o.createElementBlock("img",{key:0,class:"w-6 h-6",src:C.iconUrl},null,8,BZ)):o.createCommentVNode("",!0),C.iconName?(o.openBlock(),o.createBlock(o.unref(At),{key:1,name:C.iconName,class:"mr-1 text-lg"},null,8,["name"])):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(C.label),1)],10,OZ))),128))],64))),128))])):(o.openBlock(),o.createElementBlock("div",IZ,[o.createElementVNode("span",RZ,o.toDisplayString(o.unref(s)("editor.slash.empty")),1)]))],512)}}}),_a="slashCommand";let Pt;const DZ=nt.create({name:_a,priority:200,onCreate(){Pt=Js("body",{interactive:!0,trigger:"manual",placement:"bottom-start",theme:"slash-command",maxWidth:"16rem",offset:[16,8],popperOptions:{strategy:"fixed",modifiers:[{name:"flip",enabled:!1}]}})},addProseMirrorPlugins(){return[yZ({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new Et(_a),allow:({state:t,range:e})=>{var c,f,p;const n=t.doc.resolve(e.from),r=n.depth===1,i=n.parent.type.name==="paragraph",s=((c=n.parent.textContent)==null?void 0:c.charAt(0))==="/",a=this.editor.isActive("column"),l=(p=n.parent.textContent)==null?void 0:p.substring((f=n.parent.textContent)==null?void 0:f.indexOf("/")),u=!(l!=null&&l.endsWith(" "));return(r&&i&&s||a&&i&&s)&&u},command:({editor:t,range:e,props:n})=>{const{view:r}=t;n.action({editor:t,range:e}),r.focus()},items:({query:t})=>TZ(this.editor).map(s=>({...s,commands:s.commands.filter(a=>{const l=a.label.toLowerCase().trim(),u=t.toLowerCase().trim();if(a.aliases){const c=a.aliases.map(m=>m.toLowerCase().trim()),f=l.match(u),p=c.some(m=>m.match(u));return f||p}return l.match(u)}).filter(a=>a.shouldBeHidden?!a.shouldBeHidden(this.editor):!0)})).filter(s=>s.commands.length>0).map(s=>({...s,commands:s.commands.map(a=>({...a,isEnabled:!0}))})),render:()=>{let t,e=null;return{onStart:n=>{var s;t=new J4(LZ,{props:n,editor:n.editor});const{view:r}=n.editor,i=()=>{if(!n.clientRect)return n.editor.storage[_a].rect;const a=n.clientRect();if(!a)return n.editor.storage[_a].rect;let l=a.y;if(t.element instanceof HTMLElement&&a.top+t.element.offsetHeight+40>window.innerHeight){const u=a.top+t.element.offsetHeight-window.innerHeight+40;l=a.y-u}return new DOMRect(a.x,l,a.width,a.height)};e=()=>{Pt==null||Pt[0].setProps({getReferenceClientRect:i})},(s=r.dom.parentElement)==null||s.addEventListener("scroll",e),t.element&&(Pt==null||Pt[0].setProps({getReferenceClientRect:i,appendTo:()=>document.body,content:t.element})),Pt==null||Pt[0].show()},onUpdate(n){var a;t.updateProps(n);const{view:r}=n.editor,i=()=>{if(!n.clientRect)return n.editor.storage[_a].rect;const l=n.clientRect();return l?new DOMRect(l.x,l.y,l.width,l.height):n.editor.storage[_a].rect},s=()=>{Pt==null||Pt[0].setProps({getReferenceClientRect:i})};(a=r.dom.parentElement)==null||a.addEventListener("scroll",s),n.editor.storage[_a].rect=n.clientRect?i():{width:0,height:0,left:0,top:0,right:0,bottom:0},Pt==null||Pt[0].setProps({getReferenceClientRect:i})},onKeyDown(n){var r;return n.event.key==="Escape"?(Pt==null||Pt[0].hide(),!0):(Pt!=null&&Pt[0].state.isShown||Pt==null||Pt[0].show(),(r=t.ref)==null?void 0:r.onKeyDown(n))},onExit(n){var r;if(Pt==null||Pt[0].hide(),e){const{view:i}=n.editor;(r=i.dom.parentElement)==null||r.removeEventListener("scroll",e)}t.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}}),PZ=o.defineComponent({__name:"AIButton",props:{editor:{},icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},shortcutKeys:{default:void 0},customClass:{default:""},loading:{type:Boolean,default:!1},tooltipOptions:{default:void 0},color:{default:void 0},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t,n=yn(),{toast:r}=vv();function i(){var a,l,u;const s=(l=(a=e.editor.extensionManager.extensions.find(c=>c.name==="AI"))==null?void 0:a.options)==null?void 0:l.completions;if(typeof s!="function"){r({title:"AI completions method is not set or is not a valid function",variant:"destructive"});return}if(s.constructor.name!=="AsyncFunction"){r({title:"AI completions method must be an asynchronous function",variant:"destructive"});return}n.state.AIMenu=!0,(u=e.editor)==null||u.commands.focus()}return(s,a)=>(o.openBlock(),o.createBlock(Ge,{action:i,title:"AI",disabled:s.disabled,icon:s.icon,tooltip:s.tooltip},null,8,["disabled","icon","tooltip"]))}}),VZ=Rt.create({name:"AI",group:"block",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:({editor:e,t:n})=>({component:PZ,componentProps:{icon:"Sparkles",tooltip:n("editor.AI.ask")}})}}});function FZ(t,e){const n=atob(t.split(",")[1]),r=new Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);const i=new Uint8Array(r);return new Blob([i],{type:e})}function $Z(t,e){return new File([t],e,{type:t.type})}const HZ=nt.create({name:"importWord",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({editor:e,extension:n,t:r})=>({component:Ge,componentProps:{action:()=>{var i;return(i=e.commands)==null?void 0:i.toggleImportWord()},disabled:!e.can().setHorizontalRule(),icon:"Word",tooltip:r("editor.importWord.tooltip")}})}},addCommands(){return{toggleImportWord:()=>({chain:t,editor:e})=>{const{toast:n}=vv(),{t:r}=_t();async function i(u){var g;const f=new DOMParser().parseFromString(u,"text/html"),p=f.querySelectorAll("img");if(!p.length)return f.body.innerHTML;if(a1(e,"image")){const b=(g=e.extensionManager.extensions.find(v=>v.name==="importWord"))==null?void 0:g.options;if(b&&typeof b.upload=="function"){const v=[];for(const x of p){const E=x.getAttribute("src"),k=FZ(E,"image/jpeg"),C=$Z(k,"image.jpeg");v.push(C)}const y=await b.upload(v);for(let x=0;x<p.length;x++){const E=p[x];E.setAttribute("src",y[x].src);const k=E.parentElement;(k==null?void 0:k.tagName)==="P"&&(k.insertAdjacentElement("beforebegin",E),!k.hasChildNodes()&&k.textContent===""&&k.remove())}return f.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),f.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),f.body.innerHTML}async function s(u){const c=await i(u);e.chain().setContent(c.toString(),!0).run(),n({title:r("editor.importWord.success")})}const{open:a,onChange:l}=et.useFileDialog({accept:".docx",reset:!0,multiple:!1});return a(),l(async u=>{const[c]=Array.from(u??[]);if(c){if(c.size>this.options.limit){n({title:r("editor.importWord.fileTooLarge"),variant:"destructive"});return}if(this.options.convert){const f=await this.options.convert(c);s(f)}else{const f=new FormData,p=JSON.stringify({collaboration_features:{comments:!0,user_id:"e3",track_changes:!0},formatting:{resets:"none",defaults:"inline",styles:"inline",comments:"basic"}});f.append("config",p),f.append("file",c),fetch("https://docx-converter.cke-cs.com/v2/convert/docx-html",{method:"POST",body:f}).then(m=>m.json()).then(async m=>{s(m.html)}).catch(m=>{n({title:r("editor.importWord.error"),variant:"destructive"}),console.error("Error:",m)})}}}),!1}}}}),yv=yn(),zZ=nt.create({name:"preview",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:Ge,componentProps:{icon:"Eye",action:()=>{yv.togglePreview()},tooltip:e("editor.preview.tooltip"),isActive:()=>yv.state.showPreview}})}},addCommands(){return{togglePreview:()=>()=>(yv.togglePreview(),!0)}}}),NE=yn(),UZ=(t,e,n)=>RegExp(e?t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):t,n?"gu":"gui");function WZ(t,e,n,r){const i=[],s=[];let a=[],l=0;if(!e)return{decorationsToReturn:at.empty,results:[]};t==null||t.descendants((u,c)=>{u.isText?a[l]?a[l]={text:a[l].text+u.text,pos:a[l].pos}:a[l]={text:`${u.text}`,pos:c}:l+=1}),a=a.filter(Boolean);for(const u of a){const{text:c,pos:f}=u,p=Array.from(c.matchAll(e)).filter(([m])=>m.trim());for(const m of p){if(m[0]==="")break;m.index!==void 0&&s.push({from:f+m.index,to:f+m.index+m[0].length})}}for(let u=0;u<s.length;u+=1){const c=s[u],f=u===r?`${n} ${n}-current`:n,p=Wt.inline(c.from,c.to,{class:f});i.push(p)}return{decorationsToReturn:at.create(t,i),results:s}}const jZ=(t,e,{state:n,dispatch:r})=>{if(!e[0])return;const{from:s,to:a}=e[0];r&&r(n.tr.insertText(t,s,a))},qZ=(t,e,n,r)=>{const i=e+1;if(!r[i])return null;const{from:s,to:a}=r[e],l=a-s-t.length+n,{from:u,to:c}=r[i];return r[i]={to:c-l,from:u-l},[l,r]},KZ=(t,e,{tr:n,dispatch:r})=>{let i=0,s=e.slice();if(s.length){for(let a=0;a<s.length;a+=1){const{from:l,to:u}=s[a];n.insertText(t,l,u);const c=qZ(t,a,i,s);c&&(i=c[0],s=c[1])}r&&r(n)}},GZ=new Et("findAndReplacePlugin"),XZ=nt.create({name:"findAndReplace",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),searchResultClass:"vdc-editor-search-result",disableRegex:!0,button:({editor:e,extension:n,t:r})=>({component:Ge,componentProps:{icon:"DocSearch",tooltip:r("editor.findAndReplace.tooltip"),action:()=>{NE.toggleFindAndReplace()},isActive:()=>NE.state.findAndReplace}})}},addStorage(){return{searchTerm:"",replaceTerm:"",results:[],lastSearchTerm:"",caseSensitive:!1,lastCaseSensitive:!1,resultIndex:0,lastResultIndex:0}},addCommands(){return{setSearchTerm:t=>({editor:e})=>(e.storage.findAndReplace.searchTerm=t,!1),setReplaceTerm:t=>({editor:e})=>(e.storage.findAndReplace.replaceTerm=t,!1),setCaseSensitive:t=>({editor:e})=>(e.storage.findAndReplace.caseSensitive=t,!1),resetIndex:()=>({editor:t})=>(t.storage.findAndReplace.resultIndex=0,!1),nextSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:n}=t.storage.findAndReplace,r=n+1;return e[r]?t.storage.findAndReplace.resultIndex=r:t.storage.findAndReplace.resultIndex=0,!1},previousSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:n}=t.storage.findAndReplace,r=n-1;return e[r]?t.storage.findAndReplace.resultIndex=r:t.storage.findAndReplace.resultIndex=e.length-1,!1},replace:()=>({editor:t,state:e,dispatch:n})=>{const{replaceTerm:r,results:i}=t.storage.findAndReplace;return jZ(r,i,{state:e,dispatch:n}),!1},replaceAll:()=>({editor:t,tr:e,dispatch:n})=>{const{replaceTerm:r,results:i}=t.storage.findAndReplace;return KZ(r,i,{tr:e,dispatch:n}),!1}}},addProseMirrorPlugins(){const t=this.editor,{searchResultClass:e,disableRegex:n}=this.options,r=a=>t.storage.findAndReplace.lastSearchTerm=a,i=a=>t.storage.findAndReplace.lastCaseSensitive=a,s=a=>t.storage.findAndReplace.lastResultIndex=a;return[new rt({key:GZ,state:{init:()=>at.empty,apply({doc:a,docChanged:l},u){const{searchTerm:c,lastSearchTerm:f,caseSensitive:p,lastCaseSensitive:m,resultIndex:g,lastResultIndex:b}=t.storage.findAndReplace;if(!l&&f===c&&m===p&&b===g)return u;if(r(c),i(p),s(g),!c)return t.storage.findAndReplace.results=[],at.empty;const{decorationsToReturn:v,results:y}=WZ(a,UZ(c,n,p),e,g);return t.storage.findAndReplace.results=y,v}},props:{decorations(a){return this.getState(a)}}})]}}),{togglePrinter:YZ,state:JZ}=yn(),ZZ=nt.create({name:"printer",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:Ge,componentProps:{tooltip:e("editor.printer.tooltip"),action:()=>YZ(),icon:"Printer",shortcutKeys:["mod","P"],isActive:()=>JZ.printer}})}}}),wv="spell-check";class QZ{constructor(e,n,r,i=1e3){Yt(this,"debouncedGetMatchAndSetDecorations",kt.debounce(this.getMatchAndSetDecorations.bind(this),300));Yt(this,"debouncedGetMatchAndSetDecorationsList",kt.debounce(this.getMatchAndSetDecorationsList.bind(this),300));Yt(this,"debouncedClickEventsListener",this.clickEventsListener.bind(this));Yt(this,"debouncedAcceptSuggestionEventsListener",this.acceptSuggestionListener.bind(this));Yt(this,"debouncedProofreadChangedNodes",kt.debounce(this.proofreadChangedNodes.bind(this),300));Yt(this,"proofreader");Yt(this,"uiStrings");Yt(this,"showSuggestionsEvent");Yt(this,"decorationSet");Yt(this,"editorView");Yt(this,"isInitialProofreadingDone",!1);Yt(this,"lastOriginalFrom",0);Yt(this,"lastClickedDecoration",null);Yt(this,"suggestionBox");Yt(this,"isEnableSuggestion");Yt(this,"isMobile");Yt(this,"limit",1e3);Yt(this,"_debouncedProofreadDoc",kt.debounce((e,n)=>{this.proofreadDoc(e),n&&n()},500));Yt(this,"_debouncedHandleEnterKey",kt.debounce((e,n,r)=>{this.handleEnterKey(e,n),r&&r()},500));this.proofreader=e,this.uiStrings=n,this.showSuggestionsEvent=r,this.decorationSet=at.empty,this.limit=i,this.suggestionBox=document.createElement("div"),this.suggestionBox.id="suggestions-box",this.suggestionBox.tabIndex=0,this.isEnableSuggestion=!0,this.isMobile=!1,this.hideSuggestionBox()}get completeProofreadingDone(){return this.isInitialProofreadingDone}getProofreader(){return this.proofreader}toggleIsEnabledSpellCheck(){this.proofreader.toggleIsEnabled()}setEnabledProofreadText(e){this.proofreader.setEnabled(e)}getIsEnabledSpellCheck(){return this.proofreader.getIsEnabled()}setDecorationSet(e){this.decorationSet=e}getDecorationSet(){return this.decorationSet}setEditorView(e){this.editorView=e}getEditorView(){return this.editorView}getSuggestionBox(){return this.suggestionBox}hideSuggestionBox(){this.suggestionBox.textContent="",this.suggestionBox.style.display="none"}setIsEnableSuggestion(e){if(this.isEnableSuggestion=e,this.isEnableSuggestion){this.addEventListenersToDecorations();return}this.hideSuggestionBox(),this.removeEventListenersFromDecorations()}setIsMobile(e){this.isMobile=e}getChangedNodesFromTransaction(e,n=!1,r=!1){const i=[],s=new Set;let a=!1;return e.steps.forEach(l=>{var p,m,g;const u=l;if(u.from===void 0||u.to===void 0||n&&u.structure)return;((m=(p=u.slice)==null?void 0:p.content[0])==null?void 0:m.type.name)===Pc&&(a=!0);const c=u.from-(r?1:0);let f=Math.max(u.to,u.from+(((g=u.slice)==null?void 0:g.size)||0))-(r?1:0);f>e.doc.content.size&&(f=e.doc.content.size),e.doc.nodesBetween(c,f,(b,v)=>{b&&(b.isText&&!s.has(v)&&(i.push({node:b,pos:v}),s.add(v)),b.type.name===Pc&&(a=!0))})}),{changedNodes:i,isChangedSuperText:a}}debouncedProofreadDoc(e,n){this._debouncedProofreadDoc(e,n)}isSuperTextAlone(e,n){let r=!1;return e.descendants((i,s,a)=>i===n?(a&&a.type.name==="paragraph"&&a.childCount===1&&a.firstChild===n&&(r=!0),!1):!0),r}proofreadDoc(e){let n=[],r=0;e==null||e.descendants((u,c)=>{if(u.isText){const f={text:u.text??"",from:c,to:c+u.nodeSize};return n[r]&&(f.text=n[r].text+f.text,f.from=n[r].from),n[r]=f,r+=1,!1}return u.type.name!==Pc}),n=n.filter(Boolean);let i="",s=1;for(const{text:u,from:c,to:f}of n){const p=c-s;p>0&&(i+=Array(p+1).join(`
|