vdc-editor 0.1.166 → 0.1.167
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-BepxxsVU.mjs +657 -0
- package/lib/BulkSpellChecker-BepxxsVU.mjs.map +1 -0
- package/lib/index-BmB6XSVI.mjs +56613 -0
- package/lib/index-BmB6XSVI.mjs.map +1 -0
- 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
|
@@ -273,7 +273,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ee=P,ne=G),Z===void 0&
|
|
|
273
273
|
3. "-" cannot repeat`);qt.customSchemes.push([t,e])}function EW(){qt.scanner=mW(qt.customSchemes);for(let t=0;t<qt.tokenQueue.length;t++)qt.tokenQueue[t][1]({scanner:qt.scanner});qt.parser=vW(qt.scanner.tokens);for(let t=0;t<qt.pluginQueue.length;t++)qt.pluginQueue[t][1]({scanner:qt.scanner,parser:qt.parser});return qt.initialized=!0,qt}function Pg(t){return qt.initialized||EW(),yW(qt.parser.start,t,b8(qt.scanner.start,t))}Pg.scan=b8;function S8(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 Rg(n),o=Pg(t),s=[];for(let a=0;a<o.length;a++){const l=o[a];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}function SW(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function kW(t){return new Ne({key:new St("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),s=e.some(c=>c.getMeta("preventAutolink"));if(!o||s)return;const{tr:a}=r,l=hO(n.doc,[...e]);if(vO(l).forEach(({newRange:c})=>{const f=i4(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 w=Pg(b).map(x=>x.toObject(t.defaultProtocol));if(!SW(w))return!1;w.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=>{t0(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 _W(t){return new Ne({key:new St("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,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=l4(e.state,t.type.name),c=r.target,f=(o=c==null?void 0:c.href)!==null&&o!==void 0?o: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 TW(t){return new Ne({key:new St("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:s}=o,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const u=S8(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 AW=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function oa(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(AW,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const OW=Kn.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"){E8(t);return}E8(t.scheme,t.optionalSlashes)})},onDestroy(){CW()},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)=>!!oa(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=>!!oa(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=>!!oa(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",gt(this.options.HTMLAttributes,t),0]:["a",gt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!oa(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=>!!oa(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[zi({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=S8(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!oa(a,n),protocols:n,defaultProtocol:r}));o.length&&o.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(kW({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!oa(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(_W({type:this.type})),this.options.linkOnPaste&&t.push(TW({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),MW={class:"flex w-full max-w-sm items-center gap-1.5"},BW={class:"relative w-full max-w-sm items-center"},IW={class:"flex w-full max-w-sm items-center gap-1.5"},RW={class:"relative w-full max-w-sm items-center"},LW={class:"absolute start-0 inset-y-0 flex items-center justify-center px-2"},k8=i.defineComponent({__name:"LinkEditBlock",props:{editor:{}},emits:["onSetLink","onClickOutside"],setup(t,{emit:e}){const n=t,r=e,{t:o}=At();let s=i.reactive({text:"",link:""});const a=i.ref(null),{focused:l}=pt.useFocus(a),u=i.ref(!0),c=i.ref(null);pt.onClickOutside(c,m=>r("onClickOutside",m)),i.watchEffect(()=>{const{href:m,target:g}=n.editor.getAttributes("link"),{from:b,to:v}=n.editor.state.selection,w=n.editor.state.doc.textBetween(b,v," ");s={link:m,text:w}});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 i.onMounted(()=>{l.value=!0}),(m,g)=>(i.openBlock(),i.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"},[i.createElementVNode("form",{class:"flex flex-col gap-2",onSubmit:i.withModifiers(f,["prevent"])},[i.createVNode(i.unref(z1),null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.text")),1)]),_:1}),i.createElementVNode("div",MW,[i.createElementVNode("div",BW,[i.createVNode(i.unref(dl),{modelValue:i.unref(s).text,"onUpdate:modelValue":g[0]||(g[0]=b=>i.unref(s).text=b),type:"text",required:"",placeholder:"텍스트"},null,8,["modelValue"])])]),i.createVNode(i.unref(z1),null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.link")),1)]),_:1}),i.createElementVNode("div",IW,[i.createElementVNode("div",RW,[i.createVNode(i.unref(dl),{ref_key:"inputRef",ref:a,modelValue:i.unref(s).link,"onUpdate:modelValue":g[1]||(g[1]=b=>i.unref(s).link=b),type:"text",required:"",class:"pl-10"},null,8,["modelValue"]),i.createElementVNode("span",LW,[i.createVNode(i.unref(jt),{class:"size-5 text-ed-muted-foreground",name:"Link"})])])]),i.createVNode(i.unref(_n),{class:"mt-2 self-end"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.button.apply")),1)]),_:1})],32)],512))}}),PW=i.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,o,s){e.action&&e.action({link:r,text:o,openInNewTab:s})}return(r,o)=>(i.openBlock(),i.createBlock(i.unref(ul),null,{default:i.withCtx(({open:s})=>[i.createVNode(i.unref(fl),{disabled:r.disabled},{default:i.withCtx(()=>[i.createVNode(qe,{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"]),i.createVNode(i.unref(cl),{"as-child":"",class:"w-80",align:"start",side:"bottom"},{default:i.withCtx(()=>[i.createVNode(k8,{editor:r.editor,onOnSetLink:n},null,8,["editor"])]),_:1})]),_:1}))}}),Dg=OW.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){return["a",gt(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:PW,componentProps:{action:r=>{const{link:o,text:s,openInNewTab:a}=r;e.chain().extendMarkRange("link").insertContent({type:"text",text:s,marks:[{type:"link",attrs:{href:o,target:a?"_blank":""}}]}).setLink({href:o}).focus().run()},isActive:()=>e.isActive("link")||!1,disabled:!e.can().setLink({href:""}),icon:"Link",tooltip:n("editor.link.tooltip")}})}},addProseMirrorPlugins(){return[new Ne({props:{handleClick:(t,e)=>{const{schema:n,doc:r,tr:o}=t.state,s=md(r.resolve(e),n.marks.link);if(!s)return!1;const a=r.resolve(s.from),l=r.resolve(s.to),u=o.setSelection(new Be(a,l));t.dispatch(u)}}})]}}),DW=Bt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",gt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:o}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):u4(n)?s.insertContentAt(o.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(Be.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(Pe.create(a.doc,c.pos)):a.setSelection(Be.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(Be.create(a.doc,f+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[f4({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}).extend({renderHTML(){return["div",gt(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:qe,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 pp=200,yn=function(){};yn.prototype.append=function(e){return e.length?(e=yn.from(e),!this.length&&e||e.length<pp&&this.leafAppend(e)||this.length<pp&&e.leafPrepend(this)||this.appendInner(e)):this},yn.prototype.prepend=function(e){return e.length?yn.from(e).append(this):this},yn.prototype.appendInner=function(e){return new VW(this,e)},yn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?yn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},yn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},yn.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)},yn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(s,a){return o.push(e(s,a))},n,r),o},yn.from=function(e){return e instanceof yn?e:e&&e.length?new _8(e):yn.empty};var _8=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(o,s){return o==0&&s==this.length?this:new e(this.values.slice(o,s))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,s,a,l){for(var u=s;u<a;u++)if(o(this.values[u],l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(o,s,a,l){for(var u=s-1;u>=a;u--)if(o(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=pp)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=pp)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(yn);yn.empty=new _8([]);var VW=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,o,s,a){var l=this.left.length;if(o<l&&this.left.forEachInner(r,o,Math.min(s,l),a)===!1||s>l&&this.right.forEachInner(r,Math.max(o-l,0),Math.min(this.length,s)-l,a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,a){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(r,o-l,Math.max(s,l)-l,a+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(o,l),s,a)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var s=this.left.length;return o<=s?this.left.slice(r,o):r>=s?this.right.slice(r-s,o-s):this.left.slice(r,s).append(this.right.slice(0,o-s))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,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}(yn);const FW=500;class lo{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 o,s;n&&(o=this.remapping(r,this.items.length),s=o.maps.length);let a=e.tr,l,u,c=[],f=[];return this.items.forEach((p,m)=>{if(!p.step){o||(o=this.remapping(r,m+1),s=o.maps.length),s--,f.push(p);return}if(o){f.push(new Vo(p.map));let g=p.step.map(o.slice(s)),b;g&&a.maybeStep(g).doc&&(b=a.mapping.maps[a.mapping.maps.length-1],c.push(new Vo(b,void 0,void 0,c.length+f.length))),s--,b&&o.appendMap(b,s)}else a.maybeStep(p.step);if(p.selection)return l=o?p.selection.map(o.slice(s)):p.selection,u=new lo(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,o){let s=[],a=this.eventCount,l=this.items,u=!o&&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 Vo(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),o||(u=m)}let c=a-r.depth;return c>zW&&(l=$W(l,c),a-=c),new lo(l.append(s),a)}remapping(e,n){let r=new Zl;return this.items.forEach((o,s)=>{let a=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new lo(this.items.append(e.map(n=>new Vo(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},o);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]),w=m.selection&&m.selection.map(s.slice(u+1,g));w&&l++,r.push(new Vo(b,v,w))}else r.push(new Vo(b))},o);let c=[];for(let m=n;m<a;m++)c.push(new Vo(s.maps[m]));let f=this.items.slice(0,o).append(c).append(r),p=new lo(f,l);return p.emptyItemCount()>FW&&(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,o=[],s=0;return this.items.forEach((a,l)=>{if(l>=e)o.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 Vo(c.invert(),u,f),m,g=o.length-1;(m=o.length&&o[g].merge(p))?o[g]=m:o.push(p)}}else a.map&&r--},this.items.length,0),new lo(yn.from(o.reverse()),s)}}lo.empty=new lo(yn.empty,0);function $W(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class Vo{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Vo(n.getMap().invert(),n,this.selection)}}}class is{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const zW=20;function HW(t,e,n,r){let o=n.getMeta(ia),s;if(o)return o.historyState;n.getMeta(jW)&&(t=new is(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(ia))return a.getMeta(ia).redo?new is(t.done.addTransform(n,void 0,r,hp(e)),t.undone,T8(n.mapping.maps),t.prevTime,t.prevComposition):new is(t.done,t.undone.addTransform(n,void 0,r,hp(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||!UW(n,t.prevRanges)),c=a?Vg(t.prevRanges,n.mapping):T8(n.mapping.maps);return new is(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,hp(e)),lo.empty,c,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new is(t.done.rebased(n,s),t.undone.rebased(n,s),Vg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new is(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Vg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function UW(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(n=!0)}),n}function T8(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,s,a)=>e.push(s,a));return e}function Vg(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),s=e.map(t[r+1],-1);o<=s&&n.push(o,s)}return n}function WW(t,e,n){let r=hp(e),o=ia.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(),o,r),u=new is(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(a).setMeta(ia,{redo:n,historyState:u})}let Fg=!1,A8=null;function hp(t){let e=t.plugins;if(A8!=e){Fg=!1,A8=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Fg=!0;break}}return Fg}const ia=new St("history"),jW=new St("closeHistory");function qW(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ne({key:ia,state:{init(){return new is(lo.empty,lo.empty,null,0,-1)},apply(e,n,r){return HW(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?M8:r=="historyRedo"?B8:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function O8(t,e){return(n,r)=>{let o=ia.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let s=WW(o,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const M8=O8(!1,!0),B8=O8(!0,!0),KW=Ze.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>M8(t,e),redo:()=>({state:t,dispatch:e})=>B8(t,e)}},addProseMirrorPlugins(){return[qW(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()}}}),I8={HISTORY_TRANSACTION:"history$",ADD_TO_HISTORY_TRANSACTION:"addToHistory"},$g=KW.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),depth:10,button:({editor:e,t:n})=>["undo","redo"].map(o=>({component:qe,componentProps:{action:()=>{o==="undo"&&e.commands.undo(),o==="redo"&&e.commands.redo()},shortcutKeys:o==="undo"?["mod","Z"]:["shift","mod","Z"],disabled:!e.can()[o](),icon:o==="undo"?"Undo2":"Redo2",tooltip:n(`editor.${o}.tooltip`)}}))}}}),{isFullscreen:zg,toggleFullscreen:Hg}=vn(),GW=Ze.create({name:"fullscreen",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:qe,componentProps:{tooltip:zg.value?r("editor.fullscreen.tooltip.exit"):r("editor.fullscreen.tooltip.fullscreen"),action:()=>Hg(),icon:zg.value?"Minimize":"Maximize",isActive:()=>zg.value}})}},addKeyboardShortcuts(){return{F11:()=>(Hg(),!0),"Mod-F11":()=>(Hg(),!0)}}}),XW=Ze.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 Ne({key:new St("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit;if(o==null||o===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>o){const a=s-o,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} 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 o=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||o>r&&s>r&&s<=o)return!0;if(o>r&&s>r&&s>o||!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 YW(t={}){return new Ne({view(e){return new JW(e,t)}})}class JW{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(o=>{let s=a=>{this[o](a)};return e.dom.addEventListener(o,s),{name:o,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 o=this.editorView.dom.offsetParent;this.element||(this.element=o.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(!o||o==document.body&&getComputedStyle(o).position=="static")s=-pageXOffset,a=-pageYOffset;else{let l=o.getBoundingClientRect();s=l.left-o.scrollLeft,a=l.top-o.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),o=r&&r.type.spec.disableDropCursor,s=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=iy(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 ZW=Ze.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[YW(this.options)]}}),QW=Ze.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ne({key:new St("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,s=[];if(!n||!r)return ht.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((u,c)=>{if(u.isText)return;if(!(o>=c&&o<=c+u.nodeSize-1))return!1;a+=1});let l=0;return t.descendants((u,c)=>{if(u.isText||!(o>=c&&o<=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}))}),ht.create(t,s)}}})]}});class nn extends Ve{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return nn.valid(r)?new nn(r):Ve.near(r)}content(){return Ce.empty}eq(e){return e instanceof nn&&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 nn(e.resolve(n.pos))}getBookmark(){return new Ug(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!NW(e)||!ej(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&nn.valid(e))return e;let o=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;o+=n;let u=e.doc.resolve(o);if(nn.valid(u))return u}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!Pe.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=a,o+=n;let l=e.doc.resolve(o);if(nn.valid(l))return l}return null}}}nn.prototype.visible=!1,nn.findFrom=nn.findGapCursorFrom,Ve.jsonID("gapcursor",nn);class Ug{constructor(e){this.pos=e}map(e){return new Ug(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return nn.valid(n)?new nn(n):Ve.near(n)}}function NW(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 o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function ej(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 o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function tj(){return new Ne({props:{decorations:ij,createSelectionBetween(t,e,n){return e.pos==n.pos&&nn.valid(n)?new nn(n):null},handleClick:rj,handleKeyDown:nj,handleDOMEvents:{beforeinput:oj}}})}const nj=Hm({ArrowLeft:mp("horiz",-1),ArrowRight:mp("horiz",1),ArrowUp:mp("vert",-1),ArrowDown:mp("vert",1)});function mp(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let a=r.selection,l=e>0?a.$to:a.$from,u=a.empty;if(a instanceof Be){if(!s.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=nn.findGapCursorFrom(l,e,u);return c?(o&&o(r.tr.setSelection(new nn(c))),!0):!1}}function rj(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!nn.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Pe.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new nn(r))),!0)}function oj(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof nn))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 o=ce.empty;for(let a=r.length-1;a>=0;a--)o=ce.from(r[a].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new Ce(o,0,0));return s.setSelection(Be.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function ij(t){if(!(t.selection instanceof nn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ht.create(t.doc,[Wt.widget(t.selection.head,e,{key:"gapcursor"})])}const sj=Ze.create({name:"gapCursor",addProseMirrorPlugins(){return[tj()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=st(Re(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),aj=Bt.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",gt(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
274
274
|
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:l}=r.extensionManager,u=s||o.$to.parentOffset&&o.$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()}}}),lj=Bt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",gt(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)}}}),R8=Bt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",gt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),uj=Ze.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Ne({key:new St("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];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&&Cd(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});o.push(p)}return this.options.includeChildren}),ht.create(t,o)}}})]}}),L8=Bt.create({name:"text",group:"inline"}),P8=Bt.create({name:"doc",topNode:!0,content:"block+"}),D8=P8.extend({content(){var e;return!!((e=this.editor)!=null&&e.options.extensions.find(n=>n.name==="columns"))?"(block|columns)+":"block+"}}),cj=Ze.create({name:"selection",addProseMirrorPlugins(){const{editor:t}=this;return[new Ne({key:new St("selection"),props:{decorations(e){return e.selection.empty?null:ht.create(e.doc,[Wt.inline(e.selection.from,e.selection.to,{class:"selection"})])}}})]}}),dj=t=>{const e=["size-small","size-medium","size-large"],n=["SizeS","SizeM","SizeL"];return e.map((r,o)=>({type:`video-${r}`,component:qe,componentProps:{tooltip:`editor.${r.replace("-",".")}.tooltip`,icon:n[o],action:()=>t.commands.updateVideo({width:Ld[r]}),isActive:()=>t.isActive("video",{width:Ld[r]})}}))},fj=t=>[...dj(t),{type:"remove",component:qe,componentProps:{tooltip:"editor.remove",icon:"Trash2",action:()=>{const{state:e,dispatch:n}=t.view;du(e,n)}}}],pj=(t,e,{editor:n,extension:r,t:o})=>{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?o(g.componentProps.tooltip):void 0},componentSlots:g.componentSlots});continue}const b=s.find(v=>v.name===m);if(b){const{button:v}=b.options,w=v({editor:n,extension:b,t:o});c.push({type:m,component:w.component,componentProps:w.componentProps,componentSlots:w.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},hj=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))),mj=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Wg;const gj=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]]),bj=(Wg=String.fromCodePoint)!==null&&Wg!==void 0?Wg: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 vj(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=gj.get(t))!==null&&e!==void 0?e:t}var wn;(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"})(wn||(wn={}));const yj=32;var ss;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(ss||(ss={}));function jg(t){return t>=wn.ZERO&&t<=wn.NINE}function wj(t){return t>=wn.UPPER_A&&t<=wn.UPPER_F||t>=wn.LOWER_A&&t<=wn.LOWER_F}function xj(t){return t>=wn.UPPER_A&&t<=wn.UPPER_Z||t>=wn.LOWER_A&&t<=wn.LOWER_Z||jg(t)}function Cj(t){return t===wn.EQUALS||xj(t)}var xn;(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"})(xn||(xn={}));var as;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(as||(as={}));class Ej{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=xn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=as.Strict}startEntity(e){this.decodeMode=e,this.state=xn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case xn.EntityStart:return e.charCodeAt(n)===wn.NUM?(this.state=xn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=xn.NamedEntity,this.stateNamedEntity(e,n));case xn.NumericStart:return this.stateNumericStart(e,n);case xn.NumericDecimal:return this.stateNumericDecimal(e,n);case xn.NumericHex:return this.stateNumericHex(e,n);case xn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|yj)===wn.LOWER_X?(this.state=xn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=xn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,o){if(n!==r){const s=r-n;this.result=this.result*Math.pow(o,s)+Number.parseInt(e.substr(n,s),o),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const o=e.charCodeAt(n);if(jg(o)||wj(o))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const o=e.charCodeAt(n);if(jg(o))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(o,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===wn.SEMI)this.consumed+=1;else if(this.decodeMode===as.Strict)return 0;return this.emitCodePoint(vj(this.result),this.consumed),this.errors&&(e!==wn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let o=r[this.treeIndex],s=(o&ss.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=Sj(r,o,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===as.Attribute&&(s===0||Cj(a))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],s=(o&ss.VALUE_LENGTH)>>14,s!==0){if(a===wn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==as.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,o=(r[n]&ss.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[e]&~ss.VALUE_LENGTH:o[e+1],r),n===3&&this.emitCodePoint(o[e+2],r),r}end(){var e;switch(this.state){case xn.NamedEntity:return this.result!==0&&(this.decodeMode!==as.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case xn.NumericDecimal:return this.emitNumericEntity(0,2);case xn.NumericHex:return this.emitNumericEntity(0,3);case xn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case xn.EntityStart:return 0}}}function V8(t){let e="";const n=new Ej(t,r=>e+=bj(r));return function(o,s){let a=0,l=0;for(;(l=o.indexOf("&",l))>=0;){e+=o.slice(a,l),n.startEntity(s);const c=n.write(o,l+1);if(c<0){a=l+n.end();break}a=l+c,l=c===0?a+1:a}const u=e+o.slice(a);return e="",u}}function Sj(t,e,n,r){const o=(e&ss.BRANCH_LENGTH)>>7,s=e&ss.JUMP_TABLE;if(o===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=o?-1:t[n+u]-1}let a=n,l=a+o-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+o]}return-1}const kj=V8(hj);V8(mj);function _j(t,e=as.Legacy){return kj(t,e)}var Qt;(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"})(Qt||(Qt={}));var Hr;(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"})(Hr||(Hr={}));const F8=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,Tj=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,Aj=new Map([[126,Hr.Element],[94,Hr.Start],[36,Hr.End],[42,Hr.Any],[33,Hr.Not],[124,Hr.Hyphen]]),Oj=new Set(["has","not","matches","is","where","host","host-context"]);function Mj(t){switch(t.type){case Qt.Adjacent:case Qt.Child:case Qt.Descendant:case Qt.Parent:case Qt.Sibling:case Qt.ColumnCombinator:return!0;default:return!1}}const Bj=new Set(["contains","icontains"]);function Ij(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 ac(t){return t.replace(Tj,Ij)}function qg(t){return t===39||t===34}function $8(t){return t===32||t===9||t===10||t===12||t===13}function Rj(t){const e=[],n=z8(e,`${t}`,0);if(n<t.length)throw new Error(`Unmatched selector: ${t.slice(n)}`);return e}function z8(t,e,n){let r=[];function o(m){const g=e.slice(n+m).match(F8);if(!g)throw new Error(`Expected name, found ${e.slice(n)}`);const[b]=g;return n+=m+b.length,ac(b)}function s(m){for(n+=m;n<e.length&&$8(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 ac(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&&Mj(r[r.length-1]))throw new Error("Did not expect successive traversals.")}function c(m){if(r.length>0&&r[r.length-1].type===Qt.Descendant){r[r.length-1].type=m;return}u(),r.push({type:m})}function f(m,g){r.push({type:Qt.Attribute,name:m,action:g,value:o(1),namespace:null,ignoreCase:"quirks"})}function p(){if(r.length&&r[r.length-1].type===Qt.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!==Qt.Descendant)&&(u(),r.push({type:Qt.Descendant})),s(1);break}case 62:{c(Qt.Child),s(1);break}case 60:{c(Qt.Parent),s(1);break}case 126:{c(Qt.Sibling),s(1);break}case 43:{c(Qt.Adjacent),s(1);break}case 46:{f("class",Hr.Element);break}case 35:{f("id",Hr.Equals);break}case 91:{s(1);let g,b=null;e.charCodeAt(n)===124?g=o(1):e.startsWith("*|",n)?(b="*",g=o(2)):(g=o(0),e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==61&&(b=g,g=o(1))),s(0);let v=Hr.Exists;const w=Aj.get(e.charCodeAt(n));if(w){if(v=w,e.charCodeAt(n+1)!==61)throw new Error("Expected `=`");s(2)}else e.charCodeAt(n)===61&&(v=Hr.Equals,s(1));let x="",E=null;if(v!=="exists"){if(qg(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=ac(e.slice(n+1,T)),n=T+1}else{const _=n;for(;n<e.length&&(!$8(e.charCodeAt(n))&&e.charCodeAt(n)!==93||l(n));)n+=1;x=ac(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 S={type:Qt.Attribute,name:g,action:v,value:x,namespace:b,ignoreCase:E};r.push(S);break}case 58:{if(e.charCodeAt(n+1)===58){r.push({type:Qt.PseudoElement,name:o(2).toLowerCase(),data:e.charCodeAt(n)===40?a():null});continue}const g=o(1).toLowerCase();let b=null;if(e.charCodeAt(n)===40)if(Oj.has(g)){if(qg(e.charCodeAt(n+1)))throw new Error(`Pseudo-selector ${g} cannot be quoted`);if(b=[],n=z8(b,e,n+1),e.charCodeAt(n)!==41)throw new Error(`Missing closing parenthesis in :${g} (${e})`);n+=1}else{if(b=a(),Bj.has(g)){const v=b.charCodeAt(0);v===b.charCodeAt(b.length-1)&&qg(v)&&(b=b.slice(1,-1))}b=ac(b)}r.push({type:Qt.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(Qt.ColumnCombinator),s(2);break}}else if(F8.test(e.slice(n)))b=o(0);else break e;e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==124&&(g=b,e.charCodeAt(n+1)===42?(b="*",n+=2):b=o(1)),r.push(b==="*"?{type:Qt.Universal,namespace:g}:{type:Qt.Tag,name:b,namespace:g})}}}return p(),n}function Kg(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(/\xA0/g," ").replace(/\xAD/g,"­")}var H8=t=>_j(t);function Lj(t,e,n,r){if(typeof e=="function")return e({props:{...n,children:r},attrs:n,children:r,h:t.h,context:t});{let o=!0,s;if(e?e.toLowerCase()==="fragment"?(s=t.document.createDocumentFragment(),o=!1):s=t.document.createElement(e):s=t.document.createElement("div"),n&&o){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 U8(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 Pj(t){return t.h=function(n,r,...o){const{tag:s,attrs:a,children:l}=U8(n,r,o);return Lj(t,s,a,l)},t.h}var W8={};function Dj(t){let e=W8[t];return e==null&&(e=Rj(t),W8[t]=e),e}function Vj(t,e,{debug:n=!1}={}){for(const r of Dj(t)){const o=(s,a)=>{var u,c,f,p;let l=!1;for(const m of a){const{type:g,name:b,action:v,value:w,_ignoreCase:x=!0,data:E}=m;if(g==="attribute")v==="equals"?l=s.getAttribute(b)===w:v==="start"?l=!!((u=s.getAttribute(b))!=null&&u.startsWith(w)):v==="end"?l=!!((c=s.getAttribute(b))!=null&&c.endsWith(w)):v==="element"?b==="class"?l=s.classList.contains(w):l=!!((f=s.getAttribute(b))!=null&&f.includes(w)):v==="exists"?l=s.hasAttribute(b):v==="any"?l=!!((p=s.getAttribute(b))!=null&&p.includes(w)):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 S=!0;E.forEach(C=>{o(s,C)||(S=!1)}),l=!S}}else console.warn("Unknown CSS selector type",g,t,a);if(!l)break}return l};if(o(e,r))return!0}return!1}var Fj=Symbol.for("nodejs.util.inspect.custom"),j8={fontWeight:"bold"},q8={fontStyle:"italic"},K8={backgroundColor:"rgb(255, 250, 165)"},G8={textDecorations:"underline"},Gg={textDecorations:"line-through"},$j={b:j8,strong:j8,em:q8,i:q8,mark:K8,u:G8,a:G8,s:Gg,del:Gg,ins:K8,strike:Gg};function X8(t){return t.toLowerCase().replace(/[^a-z0-9]+(.)/gi,(e,n)=>n.toUpperCase())}var di=class Gh{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 Yg&&console.warn("No defined how to append a document to a node!",e),e instanceof Xg)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 Gh)e.remove(),this._childNodes.push(e);else try{const n=typeof e=="string"?e:JSON.stringify(e,null,2);this._childNodes.push(new Cl(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 Cl(n):n.remove()),this._fixChildNodesParent()}replaceWith(...e){const n=this._parentNode;if(n){const r=this._indexInParent();r>=0&&(e=e.map(o=>typeof o=="string"?new Cl(o):o.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 uo&&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 Cl(e.toString()))}contains(e){return e===this?!0:this._childNodes.some(n=>n.contains(e))}get ownerDocument(){var e;return this.nodeType===Gh.DOCUMENT_NODE||this.nodeType===Gh.DOCUMENT_FRAGMENT_NODE?this:(e=this==null?void 0:this._parentNode)==null?void 0:e.ownerDocument}toString(){return`${this.nodeName}`}[Fj](){return`${this.constructor.name} "${this.render()}"`}};di.ELEMENT_NODE=1,di.TEXT_NODE=3,di.CDATA_SECTION_NODE=4,di.PROCESSING_INSTRUCTION_NODE=7,di.COMMENT_NODE=8,di.DOCUMENT_NODE=9,di.DOCUMENT_TYPE_NODE=10,di.DOCUMENT_FRAGMENT_NODE=11;var ls=di,Cl=class extends ls{get nodeType(){return ls.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:Kg(this._text)}cloneNode(t=!1){const e=super.cloneNode(t);return e._text=this._text,e}},Y8=class extends ls{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 Vj(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++)}},uo=class extends Y8{get nodeType(){return ls.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 o=/\s*([\w-]+)\s*:\s*((url\(.*?\)[^;]*|[^;]+))/gi;for(;r=o.exec(n);){++e;const s=r[1],a=r[2].trim();t[s]=a,t[X8(s)]=a}}this._styles={get length(){return e},getPropertyValue(r){return t[r]},...$j[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[X8(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(gp)).join("")}set innerHTML(t){this.setInnerHTML(t)}get outerHTML(){return this.render(bp)}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=bp){return t(this._originalTagName||this.tagName,this._attributes,this._childNodes.map(e=>e.render(t)).join(""))}},J8=class S_ extends ls{get nodeName(){return super.nodeName}get nodeValue(){return super.nodeValue}get nodeType(){return S_.DOCUMENT_TYPE_NODE}render(){return"<!DOCTYPE html>"}},Xg=class k_ extends Y8{get nodeType(){return ls.DOCUMENT_FRAGMENT_NODE}get nodeName(){return"#document-fragment"}render(e=bp){return this._childNodes.map(n=>n.render(e)||[]).join("")}get innerHTML(){return this._childNodes.map(e=>e.render(gp)).join("")}createElement(e,n={}){return new uo(e,n)}createDocumentFragment(){return new k_}createTextNode(e){return new Cl(e)}},Yg=class extends Xg{get nodeType(){return ls.DOCUMENT_NODE}get nodeName(){return"#document"}get documentElement(){return this.firstChild}render(t=bp){let e=super.render(t);return this.docType&&(e=this.docType.render()+e),e}},Z8=class extends Yg{constructor(t=!1){if(super(),this.docType=new J8,!t){const e=new uo("html"),n=new uo("body"),r=new uo("head"),o=new uo("title");e.appendChild(r),r.appendChild(o),e.appendChild(n),this.appendChild(e)}}get body(){let t=this.querySelector("body");if(!t){let e=this.querySelector("html");e||(e=new uo("html"),this.appendChild(e)),t=new uo("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 uo("html"),this.appendChild(e)),t=new uo("head"),e.insertBefore(e)}return t}};function zj(){return new Yg}function Hj(){return new Z8}var Q8=zj();Pj({document:Q8});var Uj={},Wj=Uj.hasOwnProperty;function N8(t,e){return Wj.call(t,e)}var eE=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","command"];function tE(t,e,n={},r){const o=!(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&&N8(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}="${Kg(l.toString())}"`)}if(e!=="cdata"){if(t&&!o)return s.push(" />"),s.join("");s.push(">")}if(!t&&eE.includes(e))return s.join("")}if(o){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(Kg(l.toString()))}}}return n.html&&s.push(n.html),e!=="noop"&&e!==""&&(e!=="cdata"?s.push(`</${e}>`):s.push("]]>")),s.join("")}function gp(t,e,...n){const{tag:r,attrs:o,children:s}=U8(t,e,n);return tE(!1,r,o,s)}var bp=tE.bind(null,!1);gp.firstLine="<!DOCTYPE html>",gp.html=!0;var jj=/([^=\s]+)(\s*=\s*(("([^"]*)")|('([^']*)')|[^>\s]+))?/g,qj=/^<\/([^>\s]+)[^>]*>/m,Kj=/^<([^>\s/]+)((\s+[^=>\s]+(\s*=\s*(("[^"]*")|('[^']*')|[^>\s]+))?)*)\s*(?:\/\s*)?>/m,Gj=/\s*\/\s*>\s*$/m,Xj=class{constructor(t={}){this.attrRe=jj,this.endTagRe=qj,this.startTagRe=Kj,this.defaults={ignoreWhitespaceText:!1},t.scanner&&(this.scanner=t.scanner),this.options=Object.assign({},this.defaults,t)}parse(t){let e=!1,n,r,o;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?(o=t,t=""):(o=t.substring(0,s),t=t.substring(s)),(!this.options.ignoreWhitespaceText||!/^\s*$/.test(o))&&this.scanner.characters(o)}e=!0,r=null}}parseStartTag(t,e,n){const r=Gj.test(t);let o=n[2];r&&(o=o.replace(/\s*\/\s*$/,""));const s=this.parseAttributes(e,o);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[o,s,a,l,u,c,f,p]=r;n[s]=p??c??l??!0}),n}};function Yj(t){if(typeof t!="string")throw console.error("parseHTML requires string, found",t),new Error("parseHTML requires string");const e=t.indexOf("<!")===0?new Z8(!0):new Xg,n=[e];return new Xj({scanner:{startElement(o,s,a){if(o.toLowerCase()==="!doctype"){e.docType=new J8;return}for(const c in s)if(N8(s,c)){const f=s[c];typeof f=="string"&&(s[c]=H8(f))}const u=n[n.length-1];if(u){const c=Q8.createElement(o,s);u.appendChild(c),eE.includes(o.toLowerCase())||a||n.push(c)}},endElement(o){n.pop()},characters(o){var a;o=H8(o);const s=n[n.length-1];((a=s==null?void 0:s.lastChild)==null?void 0:a.nodeType)===ls.TEXT_NODE?s.lastChild._text+=o:s&&s.appendChild(new Cl(o))},comment(o){}}}).parse(t),e}uo.prototype.setInnerHTML=function(t){const e=Yj(t);this._childNodes=e._childNodes,this._fixChildNodesParent()};function Jj(t,e,n){return vo.fromSchema(e).serializeFragment(t.content,{document:Hj()}).render()}function Zj(t,e){const n=Zr.fromJSON(e,t);return Jj(n,e)}function Qj(t,e){const n=document.getElementById(t.attrs.id)??Jg.getElementById(t.attrs.id);if(!n)return null;const r=nE(n),{lastChild:o}=t,{childCount:s}=t,a=t.content.content.slice(0,s);if(!o)return!1;o.isText&&a.push(e.text("gg"));const l=Zj(Nj(t.type.create(t.attrs,a,t.marks)),e);return tq(l,t.attrs.id,!1)>r}function Nj(t){return{type:"doc",content:[t.toJSON()]}}let eq=null,Jg=null;const Zg=new Map;function tq(t,e,n=!0){if(n&&Zg.has(t))return Zg.get(t);const r=Jg.getElementById("computeddiv");if(r){r.innerHTML=`<p> </p>${t}`;const o=Jg.getElementById(e),{height:s}=nE(o);return r.innerHTML=" ",n&&Zg.set(t,s),s}return 0}function nE(t){const e=window.getComputedStyle(t)||eq.contentWindow.getComputedStyle(t),n=e.getPropertyValue("margin-top"),r=e.getPropertyValue("margin-bottom"),o=parseFloat(n)+parseFloat(r),{height:s}=t.getBoundingClientRect();return{margin:o,height:o+t.offsetHeight+parseFloat(e.borderWidth)}}function Qg(){return Ni(10)}const vp="paragraph",Ur="page",rE="Extend",El="Node",nq=El+rE,rq="CC",Ng="heading",yp="bulletList",eb="listItem",oE="taskList",oq="taskItem",wp="orderedList",us="table",tb="tableHeader",nb="tableRow",iq="tableCell",rb="column",sa="columns",ob="textBox",cs="image",ds="imageUpload",sq="iframe",aq="file",ib="codeBlock",sb="blockquote",lq="audio",uq="toc",iE="video",cq="horizontalrule",ab="pagination",dq=[us,wp,yp,oE],fq=[iE,cs],lc="link",pq="placeholder",hq="focus",mq="text",gq="text-bubble",bq="gapCursor",vq="dropCursor",yq="characterCount",wq="hardBreak",xq="textStyle",Cq="selection",sE="superText",lb="configPlan",Eq="fontSize",Sq="fontFamily",kq="bold",_q="italic",Tq="underline",Aq="strike",Oq="color",Mq="highlight",Bq="moreMark",Iq="textAlign",Rq="indent",Lq="lineHeight",Pq="painter",Dq="clear",xp="spellchecker",aE="fontSizeIncreaseDecrease",Vq=Object.freeze(Object.defineProperty({__proto__:null,AUDIO:lq,BLOCKQUOTE:sb,BOLD:kq,BULLETLIST:yp,CASSIE_BLOCK:El,CASSIE_BLOCK_EXTEND:nq,CC:rq,CHARACTER_COUNT:yq,CLEAR:Dq,CODE_BLOCK:ib,COLOR:Oq,COLUMN:rb,COLUMNS:sa,CONFIG_PLAN:lb,DROP_CURSOR:vq,EXTEND:rE,FILE:aq,FOCUS:hq,FONTSIZEINCREASEDECREASE:aE,FONT_FAMILY:Sq,FONT_SIZE:Eq,GAP_CURSOR:bq,HARD_BREAK:wq,HEADING:Ng,HIGHLIGHT:Mq,HORIZONTALRULE:cq,IFRAME:sq,IMAGE:cs,IMAGE_UPLOAD:ds,INDENT:Rq,ITALIC:_q,LINE_HEIGHT:Lq,LINK:lc,LISTITEM:eb,LIST_MEDIA:fq,LIST_TYPE:dq,MORE_MARK:Bq,ORDEREDLIST:wp,PAGE:Ur,PAGEBREAK:ab,PAINTER:Pq,PARAGRAPH:vp,PLACEHOLDER:pq,SELECTION:Cq,SPELLCHECKER:xp,STRIKE:Aq,SUPER_TEXT:sE,TABLE:us,TABLEHEADER:tb,TABLE_CELL:iq,TABLE_ROW:nb,TASKITEM:oq,TASKLIST:oE,TEXT:mq,TEXT_ALIGN:Iq,TEXT_BOX:ob,TEXT_BUBBLE:gq,TEXT_STYLE:xq,TOC:uq,UNDERLINE:Tq,VIDEO:iE},Symbol.toStringTag,{value:"Module"})),Cp=i.defineComponent({__name:"ContextMenu",props:{dir:{},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=Pt(t,e);return(s,a)=>(i.openBlock(),i.createBlock(i.unref(LL),i.normalizeProps(i.guardReactiveProps(i.unref(o))),{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default")]),_:3},16))}}),Ep=i.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,o=i.computed(()=>{const{class:a,...l}=n;return l}),s=Pt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(DL),null,{default:i.withCtx(()=>[i.createVNode(i.unref(VL),i.mergeProps(i.unref(s),{class:i.unref(Ae)("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:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Sp=i.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,o=i.computed(()=>{const{class:a,...l}=n;return l}),s=Pt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(FL),i.mergeProps(i.unref(s),{class:i.unref(Ae)("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:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),kp=i.defineComponent({__name:"ContextMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const n=Gn(t);return(r,o)=>(i.openBlock(),i.createBlock(i.unref(PL),i.normalizeProps(i.guardReactiveProps(i.unref(n))),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default")]),_:3},16))}}),_p=i.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=Pt(t,e);return(s,a)=>(i.openBlock(),i.createBlock(i.unref(SR),i.normalizeProps(i.guardReactiveProps(i.unref(o))),{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default")]),_:3},16))}}),Tp=i.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,o=i.computed(()=>{const{isOverlayTransparent:a,class:l,...u}=n;return u}),s=Pt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(J0),null,{default:i.withCtx(()=>[i.createVNode(i.unref(n1),{class:i.normalizeClass(i.unref(Ae)("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"]),i.createVNode(i.unref(GR),i.mergeProps(i.unref(s),{class:i.unref(Ae)("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:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),ub=i.defineComponent({__name:"DialogFooter",props:{class:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref(Ae)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",e.class))},[i.renderSlot(n.$slots,"default")],2))}}),Ap=i.defineComponent({__name:"DialogHeader",props:{class:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref(Ae)("flex flex-col gap-y-1.5 text-center sm:text-left",e.class))},[i.renderSlot(n.$slots,"default")],2))}}),Op=i.defineComponent({__name:"DialogClose",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createBlock(i.unref(YR),i.normalizeProps(i.guardReactiveProps(e)),{default:i.withCtx(()=>[i.renderSlot(n.$slots,"default")]),_:3},16))}}),Mp=i.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:o,...s}=e;return s}),r=Gn(n);return(o,s)=>(i.openBlock(),i.createBlock(i.unref(JR),i.mergeProps(i.unref(r),{class:i.unref(Ae)("text-lg font-semibold leading-none tracking-tight",e.class)}),{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default")]),_:3},16,["class"]))}}),Fq={class:"m-2.5 p-2.5 space-y-2.5"},$q=i.defineComponent({__name:"SuperInputDialogAlert",props:{open:{type:Boolean}},emits:["close"],setup(t,{emit:e}){const n=e,{t:r}=At(),o=vn(),s=t,a=i.computed(()=>r(o.textAlert.value||"editor.alert")),l=i.reactive({x:0,y:0}),u=i.ref(!1),c={x:0,y:0},f=()=>{n("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 i.watch(()=>s.open,async b=>{if(b){await i.nextTick();const v=document.querySelector(".draggable-dialog");if(v){const{width:w,height:x}=v.getBoundingClientRect(),E=window.innerWidth,S=window.innerHeight;l.x=(E-w)/2+250,l.y=(S-x)/2-50}}},{immediate:!0}),i.onUnmounted(()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)}),(b,v)=>{const w=Mp,x=Op,E=Ap,S=ub,C=Tp,_=_p;return i.openBlock(),i.createBlock(_,{open:b.open},{default:i.withCtx(()=>[i.createVNode(i.unref(J0),null,{default:i.withCtx(()=>[i.createVNode(i.unref(n1),{class:"!pointer-events-none bg-black/30"}),i.createVNode(C,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none","as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:i.normalizeStyle({transform:`translate(${i.unref(l).x}px, ${i.unref(l).y}px)`,top:"0px",left:"0px"})},[i.createVNode(E,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:i.withModifiers(p,["prevent"])},{default:i.withCtx(()=>[i.createVNode(w,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.alertConfirm")),1)]),_:1}),i.createVNode(x,{class:"absolute right-3 top-3 text-white",onClick:f},{default:i.withCtx(()=>[i.createVNode(i.unref(Pf),{class:"w-5 h-5"}),v[0]||(v[0]=i.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:1}),i.createElementVNode("div",Fq,i.toDisplayString(i.unref(a)),1),i.createVNode(S,{class:"sm:justify-center pb-3.5 pt-1"},{default:i.withCtx(()=>[i.createVNode(_n,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:f},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.alertYes")),1)]),_:1})]),_:1})],4)]),_:1})]),_:1})]),_:1},8,["open"])}}});function zq(t,e){return i.openBlock(),i.createElementBlock("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor"})])}const Hq=i.defineComponent({__name:"Checkbox",props:{defaultChecked:{type:Boolean},checked:{type:[Boolean,String]},disabled:{type:Boolean},required:{type:Boolean},name:{},value:{},id:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:checked"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{class:a,...l}=n;return l}),s=Pt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(tL),i.mergeProps(i.unref(s),{class:i.unref(Ae)("peer h-4 w-4 shrink-0 rounded-sm border border-ed-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ed-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-ed-primary data-[state=checked]:text-ed-primary-foreground",n.class)}),{default:i.withCtx(()=>[i.createVNode(i.unref(nL),{class:"flex h-full w-full items-center justify-center text-current"},{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default",{},()=>[i.createVNode(i.unref(zq),{class:"h-4 w-4"})])]),_:3})]),_:3},16,["class"]))}}),Uq=Ze.create({name:"lineLimit",addOptions(){return{maxChars:29,applyTo:["paragraph"]}},addCommands(){return{setLineLimit:t=>({commands:e})=>(this.options.maxChars=t,!0)}},addProseMirrorPlugins(){const t=this.options.maxChars,e=this.options.applyTo??["paragraph"];return[new Ne({appendTransaction:(n,r,o)=>{var m;const s=this.options.maxChars??t;if(!s||s<=0)return;const a=[];if(o.doc.descendants((g,b)=>(!g.isTextblock||!e.includes(g.type.name)||(g.textContent??"").length>s&&a.push({pos:b,node:g}),!0)),a.length===0)return;const l=o.selection.from,u=o.tr,{schema:c}=o,f=g=>{const b=[];for(let v=0;v<g.length;v+=s)b.push(g.slice(v,v+s));return b};let p=null;for(const g of a){const b=u.mapping.map(g.pos),v=u.doc.nodeAt(b);if(!v||!v.isTextblock||!e.includes(v.type.name))continue;const w=v.textContent??"";if(w.length<=s)continue;const x=f(w),E=b+v.nodeSize,S=u.doc.nodeAt(E);let C=[],_=b+v.nodeSize;if(S&&S.isTextblock){const L=(x[x.length-1]??"")+(S.textContent??""),R=f(L);C=x.slice(0,-1).concat(R),_=E+S.nodeSize}else C=x,_=b+v.nodeSize;const T=C.map(A=>c.nodes.paragraph.create(null,c.text(A)));if(l>=g.pos+1&&l<=g.pos+g.node.nodeSize-1){let L=l-(g.pos+1),R=0,M=0;for(let K=0;K<C.length;K++){const ae=C[K].length;if(L<=ae){R=K,M=L;break}L-=ae}let z=b;for(let K=0;K<R;K++)z+=2+(((m=C[K])==null?void 0:m.length)??0);p=z+1+M}u.replaceWith(b,_,ce.fromArray(T))}if(u.docChanged){if(p!==null){const g=Math.max(0,Math.min(p,u.doc.content.size));u.setSelection(Be.create(u.doc,g))}else{const g=u.mapping.map(l),b=Math.max(0,Math.min(g,u.doc.content.size));u.setSelection(Be.create(u.doc,b))}return u}}})]}}),lE=i.defineComponent({__name:"SimpleEditor",props:{modelValue:{default:""},parentEditor:{},isReadOnly:{type:Boolean}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.inject("isMobile",!1),a=i.inject("minCharSuperInput",0),l=[P8,R8,L8,Uq.configure({maxChars:a})],u=i.ref(!0),c=i.computed(()=>{var x;return(x=r.parentEditor)==null?void 0:x.extensionManager.extensions.find(E=>E.name==="spellchecker")}),f=i.computed(()=>{var x,E,S,C,_,T,A;return NE.configure({proofreader:new DS({api:(E=(x=c.value)==null?void 0:x.options.proofreader)==null?void 0:E.api,limit:(C=(S=c.value)==null?void 0:S.options.proofreader)==null?void 0:C.limit,transfer:(T=(_=c.value)==null?void 0:_.options.proofreader)==null?void 0:T.transfer,enabled:u.value}),uiStrings:(A=c.value)==null?void 0:A.options.uiStrings})}),p=new No({enablePasteRules:!1,enableInputRules:!1,content:r.modelValue,extensions:l.concat(f.value),editable:!r.isReadOnly,autofocus:!0,onUpdate:({editor:x})=>{o("update:modelValue",x.getHTML())},parseOptions:{preserveWhitespace:"full"}});i.watch(()=>r.isReadOnly,x=>{var E;p.setEditable(!x),(E=p==null?void 0:p.commands)!=null&&E.setIsEnableSuggestion&&p.commands.setIsEnableSuggestion(!x)},{immediate:!0});function m(x){const{view:E}=p,{from:S}=E.state.selection;p.commands.insertContentAt(S,x),p.commands.focus()}function g(){var x;u.value=!u.value,p.commands.handleActiveSpellCheck(u.value),(x=p==null?void 0:p.commands)!=null&&x.setIsEnableSuggestion&&p.commands.setIsEnableSuggestion(u.value)}const{contentInner:b,measuredMinWidth:v}=Dd({minChars:a,fontSize:""}),w=i.computed(()=>s?{}:{minWidth:`${v.value}px`});return e({insertSpecialCharater:m,isChecked:u,toggleSpellCheck:g}),(x,E)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"contentInner",ref:b,style:i.normalizeStyle(i.unref(w)),class:i.normalizeClass(i.unref(Ae)("h-40 overflow-y-auto border focus-within:border-ed-input-focus rounded-[3px] p-2.5",i.unref(s)&&"h-20 border-ed-gray rounded-[5px]",x.isReadOnly&&"border-none"))},[i.createVNode(i.unref(So),{id:"editor-panel",editor:i.unref(p),class:i.normalizeClass(i.unref(Ae)("vdc-editor relative h-full"))},null,8,["editor","class"])],6))}}),Wq={class:"grid m-2.5 p-2.5 gap-y-2.5 rounded border border-gray-200"},jq={class:"grid grid-cols-[70px,1fr] gap-x-2"},qq={class:"flex gap-x-7"},Kq={class:"flex items-center space-x-2 text-xs font-normal"},Gq={for:"spellcheck",class:"select-none whitespace-nowrap"},Xq={class:"flex gap-x-1"},Yq={class:"grid grid-cols-[70px,1fr] gap-x-2"},Jq={class:"text-right text-sm p-2"},Zq={class:"grid grid-cols-[70px,1fr] gap-x-2"},uc=i.defineComponent({__name:"SuperInputDialog",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextElementId:{}},emits:["close","save"],setup(t,{emit:e}){var z,K;const n=e,r=t,{t:o}=At(),s=i.ref(""),a=i.ref(""),l=i.ref(null),u=i.ref(!1),c=i.reactive({x:0,y:0}),f=i.ref(!1),p={x:0,y:0},m=i.ref(!1),g=i.ref(!1),b=ae=>{f.value=!0,p.x=ae.clientX-c.x,p.y=ae.clientY-c.y,document.addEventListener("mousemove",v),document.addEventListener("mouseup",w)},v=ae=>{f.value&&(c.x=ae.clientX-p.x,c.y=ae.clientY-p.y)},w=()=>{f.value=!1,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",w)};i.watch(()=>r.open,async ae=>{if(ae){g.value=!1,r.superTextInit&&(s.value=r.superTextInit,r.superTextElementId&&(a.value=r.superTextElementId)),await i.nextTick();const ie=document.querySelector(".draggable-dialog");if(ie){const{width:W,height:$}=ie.getBoundingClientRect(),P=window.innerHeight;c.x=0,c.y=(P-$)/2}}},{immediate:!0});const x=()=>{n("close"),s.value="",a.value="",u.value=!1},E=()=>{g.value?(m.value=!0,a.value=""):n("close"),n("save",s.value),s.value=""},S=()=>{m.value=!1,n("close")},C=(K=(z=r.editor)==null?void 0:z.extensionManager.extensions.find(ae=>ae.name==="superText"))==null?void 0:K.options.specialCharModal,_=pt.useLocalStorage("recentSpecialChars",[]),T=ae=>{if(!ae)return;const ie=(_.value??[]).filter(W=>W!==ae);ie.unshift(ae),_.value=ie.slice(0,5)},A=ae=>{var ie;(ie=l.value)==null||ie.insertSpecialCharater(ae)},L=(ae,ie)=>{var W;ie&&((W=l.value)==null||W.insertSpecialCharater(ae),T(ae))},R=i.computed(()=>{var ae;return(ae=l.value)==null?void 0:ae.isChecked}),M=()=>{var ae;(ae=l.value)==null||ae.toggleSpellCheck()};return i.onUnmounted(()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",w)}),i.watch(s,ae=>{!r.superTextElementId||r.superTextElementId===""||(g.value=ae!==(r.superTextInit??""))}),(ae,ie)=>{const W=Mp,$=Op,P=Ap,G=ub,Z=Tp,ne=_p,ee=$q;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(ne,{open:ae.open},{default:i.withCtx(()=>[i.createVNode(i.unref(J0),null,{default:i.withCtx(()=>[i.createVNode(i.unref(n1),{class:"!pointer-events-none bg-black/30"}),i.createVNode(Z,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none max-w-max","as-child":""},{default:i.withCtx(()=>{var xe,Ee,$e;return[i.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:i.normalizeStyle({transform:`translate(${c.x}px, ${c.y}px)`,top:"0px",left:"auto",right:"15px"})},[i.createVNode(P,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:i.withModifiers(b,["prevent"])},{default:i.withCtx(()=>[i.createVNode(W,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.superinput")),1)]),_:1}),i.createVNode($,{class:"absolute right-3 top-3 text-white",onClick:x},{default:i.withCtx(()=>[i.createVNode(i.unref(Pf),{class:"w-5 h-5"}),ie[4]||(ie[4]=i.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:1}),i.createElementVNode("div",Wq,[i.createElementVNode("div",jq,[ie[5]||(ie[5]=i.createElementVNode("label",null," ",-1)),i.createElementVNode("div",qq,[i.createVNode(_n,{class:"text-[#65558F] bg-[#ECE6F0] hover:bg-[#ECE6F0]/90 shadow text-xs rounded font-normal h-[25px] px-3",onClick:ie[0]||(ie[0]=Se=>u.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.insert.symbol")),1)]),_:1}),i.createElementVNode("div",Kq,[i.createVNode(Hq,{id:"spellcheck",checked:i.unref(R),class:"border-gray-300","onUpdate:checked":M},null,8,["checked"]),i.createElementVNode("label",Gq,i.toDisplayString(i.unref(o)("editor.menubar.menu.spellCheck")),1)]),i.createElementVNode("div",Xq,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(_),Se=>(i.openBlock(),i.createBlock(_n,{key:Se,variant:"outline",size:"xs",class:"h-[25px] w-[25px] p-0",onClick:he=>A(Se)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Se),1)]),_:2},1032,["onClick"]))),128))])]),u.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent((xe=i.unref(C))==null?void 0:xe.component),{key:0,"custom-class":"!z-[70] !pointer-events-auto",class:i.normalizeClass(($e=(Ee=i.unref(C))==null?void 0:Ee.componentProps)==null?void 0:$e.class),onSelectedChar:L,onClose:ie[1]||(ie[1]=Se=>u.value=!1)},null,40,["class"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Yq,[i.createElementVNode("label",Jq,i.toDisplayString(i.unref(o)("editor.detail")),1),i.createVNode(lE,{ref_key:"simpleEditorRef",ref:l,modelValue:s.value,"onUpdate:modelValue":ie[2]||(ie[2]=Se=>s.value=Se),"parent-editor":ae.editor,class:""},null,8,["modelValue","parent-editor"])]),i.createElementVNode("div",Zq,[ie[6]||(ie[6]=i.createElementVNode("label",{class:"text-right text-sm p-2"},"ID",-1)),i.createVNode(dl,{modelValue:a.value,"onUpdate:modelValue":ie[3]||(ie[3]=Se=>a.value=Se),class:"rounded-none","default-value":a.value,disabled:""},null,8,["modelValue","default-value"])])]),i.createVNode(G,{class:"sm:justify-center pb-3.5 pt-1"},{default:i.withCtx(()=>[i.createVNode(_n,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",onClick:E},{default:i.withCtx(()=>[i.createVNode(i.unref(lg),{class:"w-5 h-5 mr-2"}),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("editor.check")),1)]),_:1}),i.createVNode(_n,{as:"button",variant:"destructive",onClick:x},{default:i.withCtx(()=>[i.createVNode(i.unref(Pf),{class:"w-5 h-5 mr-2"}),ie[7]||(ie[7]=i.createTextVNode(" Close "))]),_:1})]),_:1})],4)]}),_:1})]),_:1})]),_:1},8,["open"]),i.createVNode(ee,{open:m.value,onClose:S},null,8,["open"])],64)}}}),cb=i.defineComponent({__name:"SelectContextMenu",props:{editor:{},mode:{},superTextStore:{},disabled:{type:Boolean},disableSuperInput:{type:Boolean}},setup(t,{expose:e}){const n=t,{t:r}=At(),o=i.ref(!1),s=i.reactive({from:0,to:0,text:""}),a=i.ref(!0);let l=0;const u=i.inject("isEditable",i.ref(!0)),c=i.inject("canEditSuper",i.ref(!0)),f=i.computed(()=>n.mode===Fe.EDITOR||n.mode===Fe.PLAIN_TEXT||!c.value||n.disableSuperInput);function p(){if(!n.editor)return"";const{from:S,to:C}=n.editor.state.selection,_=n.editor.state.doc.cut(S,C),A=vo.fromSchema(n.editor.schema).serializeFragment(_.content),L=document.createElement("div");return L.appendChild(A),L.innerHTML}const m=()=>{const{view:S}=n.editor,{from:C,to:_}=S.state.selection,T=p();s.text=T,s.from=C,s.to=_},g=()=>o.value=!o.value,b=()=>{f.value||(o.value=!0,m())},v=()=>o.value=!1,w=S=>{const C=n==null?void 0:n.superTextStore.addMoreSuperText(S);n.editor&&n.editor.commands.insertContentAt(s.from,{type:"superText",attrs:{"data-id":C,"data-text":S}}),o.value=!1,requestAnimationFrame(()=>{var T,A;const _=(T=n.editor)==null?void 0:T.view.dom.parentElement;_&&((A=n.editor)==null||A.view.focus(),_.scrollTop=l)})},x=async S=>{if(S)try{const C=await navigator.clipboard.readText();a.value=!C.trim()}catch{a.value=!0}},E=()=>{var A,L;if(f.value||!n.editor)return;const{view:S,state:C}=n.editor,{from:_,to:T}=C.selection;s.from=_,s.to=T,s.text="",l=((L=(A=n.editor)==null?void 0:A.view.dom.parentElement)==null?void 0:L.scrollTop)||0,S.dom.blur(),o.value=!0};return e({toggleDialog:g,openDialog:b,closeDialog:v}),(S,C)=>{const _=uc,T=kp,A=Sp,L=Ep,R=Cp;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(_,{open:o.value,editor:S.editor,"super-text-init":s.text,onClose:g,onSave:w},null,8,["open","editor","super-text-init"]),i.createVNode(R,{"onUpdate:open":x},{default:i.withCtx(()=>[i.createVNode(T,{as:"template",class:"relative",disabled:i.unref(f),onDblclick:i.withModifiers(E,["prevent","stop"])},{default:i.withCtx(()=>[i.renderSlot(S.$slots,"default")]),_:3},8,["disabled"]),i.createVNode(L,null,{default:i.withCtx(()=>[S.disableSuperInput?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(A,{key:0,onSelect:b},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.inputSuper")),1)]),_:1})),i.unref(u)?(i.openBlock(),i.createBlock(A,{key:1,onSelect:C[0]||(C[0]=M=>{var z;return(z=S.editor)==null?void 0:z.commands.cutContent()})},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.cut")),1)]),_:1})):i.createCommentVNode("",!0),i.unref(u)?(i.openBlock(),i.createBlock(A,{key:2,onSelect:C[1]||(C[1]=M=>{var z;return(z=S.editor)==null?void 0:z.commands.copyContent()})},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.copy")),1)]),_:1})):i.createCommentVNode("",!0),i.unref(u)?(i.openBlock(),i.createBlock(A,{key:3,disabled:a.value,onSelect:C[2]||(C[2]=M=>{var z;return(z=S.editor)==null?void 0:z.commands.pasteContent()})},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.paste")),1)]),_:1},8,["disabled"])):i.createCommentVNode("",!0)]),_:1})]),_:3})],64)}}});var ir=(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))(ir||{});const Qq={id:"editor-panel",class:"flex relative w-full h-full"},Nq=Rr(i.defineComponent({__name:"PageNode",props:zs,setup(t){const{state:e,page:n,superTextStore:r}=vn(),{size:o,pagination:s,margin:a}=n.value,l=i.ref(null),u=i.ref(t.node.attrs.viewSuperTextArea),c=i.computed(()=>u.value&&t.editor.storage.page.mode!=="editor"),f=i.computed(()=>t.editor.storage.page.mode===Fe.REPORT),{width:p,height:m}=o,g=i.computed(()=>s?`calc(${m} - ${(a==null?void 0:a.top)??0} - ${(a==null?void 0:a.bottom)??0}`:"max-content"),b=pt.useEventBus(ir.SUPER_VIEW_PAGE);return i.watch(()=>t.node.attrs,v=>{b.emit(v.pageNumber)},{immediate:!0}),(v,w)=>{var E,S,C,_;const x=cb;return i.openBlock(),i.createBlock(i.unref($s),{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:i.normalizeStyle({"--umo-page-margin-top":((E=i.unref(a))==null?void 0:E.top)??"0","--umo-page-margin-bottom":((S=i.unref(a))==null?void 0:S.bottom)??"0","--umo-page-margin-left":((C=i.unref(a))==null?void 0:C.left)??"0","--umo-page-margin-right":((_=i.unref(a))==null?void 0:_.right)??"0","--umo-page-width":i.unref(p),"--umo-page-height":i.unref(m),"--empty-node-left":"0px",left:100,"min-height":typeof i.unref(m)=="number"?`${i.unref(m)}px`:i.unref(m),height:f.value?typeof i.unref(m)=="number"?`${i.unref(m)}px`:i.unref(m):"auto"})},{default:i.withCtx(()=>[i.createElementVNode("div",Qq,[i.createVNode(x,{mode:c.value?i.unref(Fe).REPORT:i.unref(Fe).EDITOR,editor:v.editor,"super-text-store":i.unref(r)},{default:i.withCtx(()=>[i.createVNode(i.unref(rw),{class:"umo-page-node-content",style:i.normalizeStyle({height:g.value})},null,8,["style"])]),_:1},8,["mode","editor","super-text-store"])])]),_:1},8,["id","page-number","style"])}}}),[["__scopeId","data-v-b5bf1538"]]);function uE(t,e){const n=t.storedMarks??(t.selection.$to.parentOffset&&t.selection.$from.marks());if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}const eK=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:a}=e,{$from:l,$to:u}=s,c=o.extensionManager.attributes,f=Bp(c,l.node().type.name,l.node().attrs);if(f.id=Qg(),f.extend&&(f.extend=!1),s instanceof Pe&&s.node.isBlock)return!l.parentOffset||!pr(a,l.pos)?!1:(r&&(t&&uE(n,o.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 Be&&e.deleteSelection();const m=l.depth===0?void 0:o4(l.node(-1).contentMatchAt(l.indexAfter(-1)));let g=p&&m?[{type:m,attrs:f}]:void 0,b=pr(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!b&&pr(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()),w=e.doc.resolve(v);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&uE(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},tK=t=>({tr:e,state:n,dispatch:r,editor:o})=>{var v;const s=pn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection instanceof Pe?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=o.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 w=ce.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let A=a.depth-x;A>=a.depth-3;A-=1)w=ce.from(a.node(A).copy(w));const E=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,S=Bp(f,a.node().type.name,a.node().attrs),C=((v=s.contentMatch.defaultType)==null?void 0:v.createAndFill(S))??void 0;w=w.append(ce.from(s.createAndFill(null,C)??void 0));const _=a.before(a.depth-(x-1));e.replace(_,a.after(-E),new Ce(w,4-x,0));let T=-1;e.doc.nodesBetween(_,e.doc.content.size,(A,L)=>{if(T>-1)return!1;A.isTextblock&&A.content.size===0&&(T=L+1)}),T>-1&&e.setSelection(Be.near(e.doc.resolve(T))),e.scrollIntoView()}return!0}const p=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,m=Bp(f,c.type.name,c.attrs),g=Bp(f,a.node().type.name,a.node().attrs);m.id=Qg(),g.id=Qg(),e.delete(a.pos,l.pos);const b=p?[{type:s,attrs:m},{type:p,attrs:g}]:[{type:s,attrs:m}];if(!pr(e.doc,a.pos,2))return!1;if(r){const{selection:w,storedMarks:x}=n,{splittableMarks:E}=o.extensionManager,S=x??(w.$to.parentOffset&&w.$from.marks());if(e.split(a.pos,2,b).scrollIntoView(),!S||!r)return!0;const C=S.filter(_=>E.includes(_.type.name));e.ensureMarks(C)}return!0},nK=[Ng,vp,yp,eb,wp,us,nb,El,ob,sb,rb,sa,cs,ds,ib,ab,tb,Ur],rK=Bt.create({priority:200,name:`${Ur}`,content:"block*",group:`${Ur}`,isolating:!0,selectable:!1,draggable:!1,isLeaf:!0,addOptions(){return{SystemAttributes:{},nodesComputed:{},View:Hs(Nq),types:[],slots:{}}},addAttributes(){return{HTMLAttributes:{},id:{default:Ni(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",{...gt(e),"data-type":this.name},0]},addCommands(){return{splitBlock:eK,splitListItem:tK,autoPaging:(t=!0)=>({tr:e,state:n,dispatch:r,editor:o})=>(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:nK.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:o})=>{const{selection:s,doc:a}=o,{empty:l,$anchor:u}=s,{pos:c,parent:f}=u,p=Ve.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:o,tr:s})=>{const{selection:a,doc:l}=s,{$anchor:u}=a,{pos:c}=u;if(l.childCount===1)return!1;if(Ve.atEnd(l).from===c&&!u.parentOffset)return r.deleteNode(Ur);const f=Jo(p=>p.type.name===Ur)(a);if(f){if(!f.node.firstChild)return r.deleteNode(Ur);const p=f.node.firstChild.type;if(f.start+Ve.atStart(f.node).from===c){const g=Be.create(l,f.start-2,f.start-2),b=Jo(v=>v.type.name===Ur)(g);if(b){const v=Ve.atEnd(b.node).from+b.start,w=Be.create(l,v,v);if(p===b.node.lastChild.type){const{parent:x}=w.$anchor;return Qj(x,o.schema)?s.setSelection(w):s.step(new fn(v,c,Ce.empty)),!0}s.setSelection(w)}return!0}}return!1})]),Delete:()=>this.editor.commands.first(({commands:r})=>[()=>cE(r),()=>r.command(({tr:o})=>{const{selection:s,doc:a}=o,{$anchor:l}=s,u=l.node(),c=Jo(f=>f.type.name===El)(s);return c&&c.start+Ve.atStart(c.node).from===l.pos&&c.node.childCount===1&&u.content.size===0?!0:r.joinForward()}),()=>r.selectNodeForward(),()=>r.command(({tr:o})=>{const{selection:s,doc:a}=o,{$anchor:l}=s,{pos:u}=l;if(a.childCount===1)return!1;if(Ve.atEnd(a).from===u)return r.deleteNode(Ur);const c=Jo(f=>f.type.name===Ur)(s);if(c&&c.start+Ve.atEnd(c.node).from===u){const p=Be.create(a,u+2,u+2),m=Jo(g=>g.type.name===Ur)(p);if(m){const g=Ve.atStart(m.node).from+m.start,b=Be.create(a,g,g);if(Jo(w=>w.attrs.extend)(b))return o.step(new fn(u,g,Ce.empty)),!0}}return!1})]),Tab:()=>this.editor.commands.first(({commands:r})=>[()=>!0]),"Mod-Enter":()=>this.editor.commands.setPageBreak()}},addNodeView(){return this.options.View}});function Bp(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}const cE=t=>t.command(({tr:e})=>{const{selection:n,doc:r}=e,o=i4(r,{from:n.from,to:n.to},s=>s.type.name===El);for(const s of o){const a=s.pos+s.node.nodeSize;if(n.from<s.pos||n.to>a)return!0}return t.deleteSelection()}),oK=Ze.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()}}}),iK=["data-font"],sK=i.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:""}},setup(t){const e=t,n=i.computed(()=>e.editor.extensionStorage["base-kit"].mode===Fe.EDITOR),{t:r}=At(),o=[{label:r("editor.fontFamily.gulim"),value:"Gulim"},{label:r("editor.fontFamily.dotum"),value:"Dotum"},{label:r("editor.fontFamily.gungsuh"),value:"Gungsuh"}],s=i.inject("fontFamily"),a=i.computed(()=>{const p=e.editor.extensionManager.extensions.find(g=>g.name==="fontFamily").options;return tt.isEmpty(p.fontFamilyMap)&&(p.fontFamilyMap=o),[{label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")},...p.fontFamilyMap]}),l=i.computed(()=>{const p={label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")};return n.value?Nm(e.editor.state,"textStyle").fontFamily||p.value:s.value||p.value}),u=pt.useEventBus("fontFamily");function c(p){p.value===l.value||p.value===r("editor.fontFamily.default")?(e.editor.commands.unsetFontFamily(),s.value=null):(s.value=p.value,e.editor.commands.setFontFamily(p.value),u.emit())}const f=i.computed(()=>{var p;return(p=a.value.find(m=>m.value===l.value))==null?void 0:p.label});return(p,m)=>(i.openBlock(),i.createBlock(na,{disabled:p.disabled,tooltip:p.tooltip,title:f.value,btn_class:`min-w-24 ${p.customClass}`},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,(g,b)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:b},[i.createVNode(i.unref(yl),{checked:l.value===g.value,onClick:v=>c(g)},{default:i.withCtx(()=>[i.createElementVNode("span",{class:"ml-1 h-full","data-font":g.label,style:i.normalizeStyle({fontFamily:g.value??void 0})},i.toDisplayString(g.label),13,iK)]),_:2},1032,["checked","onClick"]),g.label===i.unref(r)("editor.fontFamily.default")?(i.openBlock(),i.createBlock(i.unref(dg),{key:0})):i.createCommentVNode("",!0)],64))),128))]),_:1},8,["disabled","tooltip","title","btn_class"]))}}),dE=oK.extend({name:"fontFamily",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["textStyle"],fontFamilyMap:[],button({editor:e,extension:n,t:r}){return{component:sK,componentProps:{editor:e,disabled:!e.can().setFontFamily(""),tooltip:r("editor.fontFamily.tooltip"),customClass:"border border-gray-300 rounded-none text-gray-500 px-2.5 h-[26px]"}}}}},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}}),aK={class:"flex gap-2"},lK=["disabled"],uK=Rr(i.defineComponent({__name:"FontSizeIncreaseDecrease",props:{editor:Object},setup(t){const e=i.inject("fontSize"),n=i.computed(()=>e.value?parseInt(e.value)===parseInt(S0[0])||parseInt(e.value)<parseInt(S0[0]):!1),r=pt.useEventBus(ir.INCREASE_DECREASE_FONTSIZE),o=s=>{r.emit(s)};return(s,a)=>{const l=hl,u=pl,c=ml;return i.openBlock(),i.createElementBlock("div",aK,[i.createVNode(c,null,{default:i.withCtx(()=>[i.createVNode(u,{"delay-duration":0},{default:i.withCtx(()=>[i.createVNode(l,null,{default:i.withCtx(()=>[i.createElementVNode("button",{class:"btn",onClick:a[0]||(a[0]=f=>o(!0))},[i.createVNode(i.unref(jt),{name:"Plus",class:"w-6 h-6"})])]),_:1}),i.createVNode(i.unref(Qs),null,{default:i.withCtx(()=>a[2]||(a[2]=[i.createTextVNode(" 글꼴 크기 크게 ")])),_:1})]),_:1})]),_:1}),i.createVNode(c,null,{default:i.withCtx(()=>[i.createVNode(u,{"delay-duration":0},{default:i.withCtx(()=>[i.createVNode(l,null,{default:i.withCtx(()=>[i.createElementVNode("button",{class:"btn",onClick:a[1]||(a[1]=f=>o(!1)),disabled:i.unref(n)},[i.createVNode(i.unref(jt),{name:"Minus",class:"w-6 h-6"})],8,lK)]),_:1}),i.createVNode(i.unref(Qs),null,{default:i.withCtx(()=>a[3]||(a[3]=[i.createTextVNode(" 글꼴 크기 작게 ")])),_:1})]),_:1})]),_:1})])}}}),[["__scopeId","data-v-3c0dcc2c"]]),cK=Kn.create({name:"fontSizeIncreaseDecrease",addOptions(){return{defaultSize:"14px",button({editor:t}){return{component:uK,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})}}}),db=Ze.create({name:"painter",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:qe,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 Ne({key:new St("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:o,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));o(l.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",r),!0}}}})]}}),fb=()=>Ni(10),fE=new St("attrkey"),dK=t=>new Ne({key:fE,state:{init:()=>!1,apply:n=>n.getMeta("initSplit")},appendTransaction(n,r,o){const{tr:s}=o;let a=!1;const l=fE.getState(o);if(n.some(c=>c.getMeta("composition")))return null;if(l||n.some(c=>c.docChanged)){const c=[];o.doc.descendants((f,p,m,g)=>{const{attrs:b}=f,v=c.includes(b.id)?fb():b.id||fb();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=[Ng,vp,yp,eb,wp,us,nb,El,ob,sb,rb,sa,cs,ds,ib,ab,tb,Ur],fK=Ze.create({name:"autoId",addGlobalAttributes(){return[{types:pE.concat(this.options.types||[]),attributes:{id:{default:fb()},extend:{default:!1},class:{default:null},"number-line":{default:null}}}]},addProseMirrorPlugins(){return[dK(pE.concat(this.options.types||[]))]}}),pK=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,hK=Bt.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",gt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[f4({find:pK,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),mK=["src","alt"],gK={key:0,class:"image-resizer"},bK=["onMousedown"],vK=i.defineComponent({__name:"ImageView",props:{...zs,selected:{type:Boolean,required:!0}},setup(t){const e=t,n={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"},r=i.ref({width:iw,height:iw}),o=i.ref({width:0,height:0}),s=i.ref(!1),a=i.ref({x:0,y:0,w:0,h:0,dir:""}),l=i.computed(()=>{const{src:C,alt:_,width:T,height:A,flipX:L,flipY:R}=e.node.attrs,M=[];L&&M.push("rotateX(180deg)"),R&&M.push("rotateY(180deg)");const z=M.join(" ");return{src:C||void 0,alt:_||void 0,style:{width:k0(T)?`${T}px`:T,height:k0(A)?`${A}px`:A,transform:z||"none"}}}),u=i.computed(()=>({width:i.unref(l).style.width==="100%"?"100%":void 0})),c=i.ref(null),f=new ResizeObserver(C=>{for(const _ of C){const{width:T,height:A}=_.contentRect;o.value={width:T,height:A},e.updateAttributes({originWidth:T,originHeight:A})}});function p(){const{editor:C,getPos:_}=e;C.commands.setNodeSelection(_())}const m=tt.throttle(()=>{const{editor:C}=e;r.value.width=parseInt(getComputedStyle(C.view.dom).width,10)},sw);function g(C,_){C.preventDefault(),C.stopPropagation();const{width:T,height:A}=i.unref(o),L=T/A;let R=Number(e.node.attrs.width)||T,M=Number(e.node.attrs.height)||Math.round(R/L);const z=i.unref(r).width;R=Math.min(R>z?z:R,z),M=Math.round(R/L),Object.assign(a.value,{x:C.clientX,y:C.clientY,w:R,h:M,dir:_}),s.value=!0,w()}const b=tt.throttle(C=>{if(!i.unref(s))return;const{x:_,y:T,w:A,dir:L}=i.unref(a),R=(C.clientX-_)*(/l/.test(L)?-1:1),M=PB(A+R,TB,i.unref(r).width);e.updateAttributes({width:M})},sw);function v(C){C.preventDefault(),C.stopPropagation(),i.unref(s)&&(s.value=!1,Object.assign(a.value,{x:0,y:0,w:0,h:0,dir:""}),x(),p())}function w(){document.addEventListener("mousemove",b,!0),document.addEventListener("mouseup",v,!0)}function x(){document.removeEventListener("mousemove",b,!0),document.removeEventListener("mouseup",v,!0)}const E=new ResizeObserver(m),S=i.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 i.onMounted(()=>{c.value&&f.observe(c.value),E.observe(e.editor.view.dom)}),i.onBeforeUnmount(()=>{x(),f.disconnect(),E.disconnect()}),(C,_)=>(i.openBlock(),i.createBlock(i.unref($s),{class:"node-image"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"image-view",style:i.normalizeStyle([l.value.style,S.value])},[i.createElementVNode("div",{draggable:"true","data-drag-handle":"",class:i.normalizeClass([{"image-view__body--focused":t.selected,"image-view__body--resizing":s.value},"image-view__body"]),style:i.normalizeStyle(u.value)},[i.createElementVNode("img",{ref_key:"imageRef",ref:c,src:l.value.src,alt:l.value.alt,class:"block w-full image-view__body__image",onClick:p},null,8,mK),C.editor.view.editable?i.withDirectives((i.openBlock(),i.createElementBlock("div",gK,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.values(n),T=>(i.openBlock(),i.createElementBlock("span",{key:T,class:i.normalizeClass([`image-resizer__handler--${T}`,"image-resizer__handler"]),onMousedown:A=>g(A,T)},null,42,bK))),128))],512)),[[i.vShow,t.selected||s.value]]):i.createCommentVNode("",!0)],6)],4)]),_:1}))}}),yK=Rr(vK,[["__scopeId","data-v-dbc7ca58"]]),pb=hK.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})}}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this)}},addNodeView(){return Hs(yK)},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:o}=t.attrs,l=`${{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[n]||""} ${r||o?`transform: rotateX(${r?"180":"0"}deg) rotateY(${o?"180":"0"}deg);`:""}`;return["img",gt({height:"auto",style:l},this.options.HTMLAttributes,e)]},parseHTML(){return[{tag:"img[src]"}]},addProseMirrorPlugins(){return[new Ne({props:{handleTextInput(t){const{selection:e}=t.state;return e instanceof Pe&&e.node.type.name==="image"},handlePaste(t){const{selection:e}=t.state;return e instanceof Pe&&e.node.type.name==="image"}}})]}}),wK=["paragraph","heading","list_item","todo_item"];function xK(t,e){const{selection:n,doc:r}=t;if(!n||!r||!(n instanceof Be||n instanceof In))return t;const{from:o,to:s}=n,a=[],l=e&&e!==aw?e:null;return r.nodesBetween(o,s,(u,c)=>{const f=u.type;return wK.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 CK(t){return({state:e,dispatch:n})=>{const{selection:r}=e;let{tr:o}=e;return o=o.setSelection(r),o=xK(o,t),o.docChanged?(n&&n(o),!0):!1}}const EK=i.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}=At();function n(l){return parseFloat(l.replace("%",""))/100}const r=i.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:i.unref(e)("editor.default"),value:"default"}),c}),o=i.ref("default"),s=t;function a(l){l==="default"?s.editor.commands.unsetLineHeight():s.editor.commands.setLineHeight(l),o.value=l}return(l,u)=>(i.openBlock(),i.createBlock(na,{icon:l.icon,tooltip:l.tooltip,disabled:l.disabled},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(c,f)=>(i.openBlock(),i.createBlock(i.unref(yl),{key:f,checked:c.value===o.value,onClick:p=>a(c.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.label),1)]),_:2},1032,["checked","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),hE=Ze.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:aw,button({editor:e,t:n}){return{component:EK,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=>CK(t),unsetLineHeight:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}}),SK=Bt.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",gt(t,{"data-type":"column"}),0]},parseHTML(){return[{tag:'div[data-type="column"]'}]}});var aa=(t=>(t.SidebarLeft="sidebar-left",t.SidebarRight="sidebar-right",t.TwoColumn="two-column",t))(aa||{});const hb=Bt.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[SK.configure(this.options.columnOptions)]}}),mE=i.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:o,...s}=e;return s}),r=Gn(n);return(o,s)=>(i.openBlock(),i.createBlock(i.unref(ZR),i.mergeProps(i.unref(r),{class:i.unref(Ae)("text-sm text-ed-muted-foreground",e.class)}),{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default")]),_:3},16,["class"]))}}),kK={class:"flex gap-x-2 items-center"},_K={class:"sr-only"},TK={class:"flex justify-end gap-x-2.5 flex-1"},AK=["disabled"],Ip=Rr(i.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:o}=At(),s=i.ref(""),a=i.ref(!1),l=i.ref(r.isViewMode??!1),u=i.ref(!1);i.watch(()=>r.isViewMode,g=>{l.value=g,g||(s.value="")});const c=i.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())===""});i.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=Mp,w=Op,x=Ap,E=mE,S=ub,C=Tp,_=_p;return i.openBlock(),i.createBlock(_,{open:g.open},{default:i.withCtx(()=>[i.createVNode(C,{isOverlayTransparent:"",class:"p-2.5 gap-0 gap-y-2.5 border-none w-[calc(100%-40px)] !shadow-ed rounded-[5px]"},{default:i.withCtx(()=>[i.createVNode(x,{class:"text-left flex-row justify-between"},{default:i.withCtx(()=>[i.createVNode(v,{class:"text-base font-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.title?g.title:i.unref(o)("editor.superinput")),1)]),_:1}),i.createElementVNode("div",kK,[i.withDirectives(i.createElementVNode("button",{onClick:m},[i.createVNode(i.unref(dC),{icon:"lucide:edit-2"})],512),[[i.vShow,l.value]]),i.createVNode(w,{class:"outline-none",onClick:f},{default:i.withCtx(()=>[i.createVNode(i.unref(Pf),{class:"w-5 h-5"}),i.createElementVNode("span",_K,i.toDisplayString(i.unref(o)("editor.close")),1)]),_:1})])]),_:1}),i.createVNode(E,{class:"hidden"}),i.createVNode(lE,{isReadOnly:l.value,modelValue:s.value,"onUpdate:modelValue":b[0]||(b[0]=T=>s.value=T),"parent-editor":g.editor},null,8,["isReadOnly","modelValue","parent-editor"]),i.createVNode(S,{class:"flex-row justify-between"},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("button",{onClick:b[1]||(b[1]=T=>n("delete"))},i.toDisplayString(i.unref(o)("editor.delete")),513),[[i.vShow,u.value]]),i.withDirectives(i.createElementVNode("div",TK,[i.createElementVNode("button",{onClick:f},i.toDisplayString(i.unref(o)("editor.menubar.menu.cancel")),1),i.createElementVNode("button",{onClick:p,disabled:i.unref(c),class:i.normalizeClass({"cursor-not-allowed":i.unref(c)})},i.toDisplayString(i.unref(o)("editor.menubar.menu.save")),11,AK)],512),[[i.vShow,u.value||!l.value]])]),_:1})]),_:1})]),_:1},8,["open"])}}}),[["__scopeId","data-v-8d87b310"]]);function OK(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 gE=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())===""},bE=8;function MK(t){const e=i.ref(!1);let n=!1,r=null,o=null,s=null,a=null,l=0,u=0;function c(x){const E=x.cloneNode(!0);return E.style.position="fixed",E.style.pointerEvents="none",E.style.opacity="0.9",E.style.zIndex="9999",E.style.transform="translate(-50%, -50%)",E.style.left="0px",E.style.top="0px",document.body.appendChild(E),E}function f(){o&&o.parentElement&&o.parentElement.removeChild(o),o=null}function p(){try{if(typeof t.getPos=="function"){const x=t.getPos();if(typeof x=="number"&&x>=0)return x}}catch{}return null}function m(x,E){e.value||(a=p(),document.body.style.userSelect="none",document.body.style.touchAction="none",E&&(o=c(E),o.style.left=`${x.clientX}px`,o.style.top=`${x.clientY}px`),e.value=!0,n=!1,s=null)}function g(){r=null,a=null,s=null,n=!1,e.value=!1,f(),document.body.style.userSelect="",document.body.style.touchAction=""}function b(x){if(e.value)return;const E=x.changedTouches[0];r=E.identifier,l=E.clientX,u=E.clientY,n=!0,a=null,s=null}function v(x){var T;if(!n&&!e.value||r===null)return;const E=Array.from(x.changedTouches).find(A=>A.identifier===r);if(!E)return;const S=E.clientX-l,C=E.clientY-u,_=S*S+C*C;if(!e.value&&n&&_>=bE*bE){const A=x.currentTarget||x.target||null;m(E,A)}if(e.value){o&&(o.style.left=`${E.clientX}px`,o.style.top=`${E.clientY}px`);try{const A=(T=t.editor)==null?void 0:T.view;if(!A){s=null;return}const L=A.posAtCoords({left:E.clientX,top:E.clientY});L&&typeof L.pos=="number"?s=L.pos:s=null}catch{s=null}}}async function w(x){var E;if(e.value){if(document.body.style.userSelect="",document.body.style.touchAction="",f(),e.value=!1,a===null||s===null){g();return}const S=(E=t.editor)==null?void 0:E.view;if(!S){g();return}const C=S.state.doc.nodeAt(a);if(!C){g();return}const _=C.nodeSize,T=a,A=T+_,L=s;if(L>=T&&L<=A){g();return}let R=L;L>T&&(R=L-_);const M=S.state.doc.content.size;R<0&&(R=0),R>M&&(R=M);const z=C.type.create(C.attrs),K=S.state.tr;K.delete(T,A),K.insert(R,z),S.dispatch(K),g();return}if(n){g();return}}return{onTouchStart:b,onTouchMove:v,onTouchEnd:w}}const BK=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","element-id","line-id"],IK=i.defineComponent({__name:"SuperText",props:zs,setup(t){const e=t,n=i.ref(!1),r=i.ref(null),{selection:o,doc:s}=e.editor.state,a=i.ref(!1),l=i.inject("isMobile",!1),u=pt.useEventBus(ir.RENDER_SUPER_TEXT),{onTouchStart:c,onTouchMove:f,onTouchEnd:p}=MK(e),m=i.computed(()=>{var M,z;const T=s.resolve(o.from),A=T==null?void 0:T.node(-1),L=(M=A==null?void 0:A.attrs)==null?void 0:M.id,R=(z=A==null?void 0:A.attrs)==null?void 0:z.pageNumber;return{pageId:L,pageNumber:R}}),g=i.computed(()=>{const T=e.getPos(),A=e.editor.state.doc.resolve(T);for(let L=A.depth;L>0;L--){const R=A.node(L);if(R.type.name==="paragraph")return R}return null}),b=i.computed(()=>{var T;return((T=g.value)==null?void 0:T.attrs.id)||""}),v=i.inject("canEditSuper",i.ref(!0));function w(T){var z,K,ae,ie;if(gE(T)){S();return}const A=e.getPos(),L=(z=e.editor)==null?void 0:z.state.doc.nodeAt(A),R=T.trim();if((((ae=(K=L==null?void 0:L.attrs)==null?void 0:K[ot.TEXT])==null?void 0:ae.trim())||"")!==R){const{[ot.ELEMENT_ID]:W,...$}=(L==null?void 0:L.attrs)||{};(ie=e.editor)==null||ie.view.dispatch(e.editor.state.tr.setNodeMarkup(A,void 0,{...$,[ot.TEXT]:R}))}requestAnimationFrame(()=>{e.editor.commands.setTextSelection(A+1),e.editor.view.focus()})}function x(T){const A=e.node.attrs[ot.TEXT],L=e.node.attrs[ot.ID],M={lineId:T.target.querySelector(`[node-id="${L}"]`).getAttribute("line-id"),dataId:L,text:A};u.emit({action:"hover",payload:M})}function E(T){const A=e.node.attrs[ot.ID],R={lineId:T.target.querySelector(`[node-id="${A}"]`).getAttribute("line-id"),dataId:A,text:""};u.emit({action:"hover",payload:R})}function S(){const{getPos:T,node:A,editor:L}=e,R=T(),M=R+1;L.commands.deleteRange({from:R,to:M})}function C(){if(!v.value)return;const{attributes:T}=e.editor.options.editorProps;if(T&&T.id===nr.COMMENT){const A=document.getElementById(nr.COMMENT);if((A==null?void 0:A.getAttribute(nr.DISABLE_SUPER_INPUT))==="true")return}e.editor.view.dom.blur(),n.value=!0}function _(){l&&(a.value=!0,C())}return(T,A)=>{const L=_n,R=kp,M=Sp,z=Ep,K=Cp,ae=uc;return i.openBlock(),i.createBlock(i.unref($s),{as:"span",class:i.normalizeClass(["w-fit text-inherit super-text align-middle",{"text-red-600 !leading-[13px]":i.unref(l)}]),"data-drag-handle":"",draggable:i.unref(v),contenteditable:"false",onPointerdown:A[3]||(A[3]=i.withModifiers(()=>{},["stop"])),onTouchstartPassive:i.unref(c),onTouchmovePassive:i.unref(f),onTouchendPassive:i.unref(p),onTouchcancelPassive:i.unref(p)},{default:i.withCtx(()=>[i.createVNode(K,null,{default:i.withCtx(()=>[i.createVNode(R,{as:"template",class:"relative",disabled:!i.unref(v)||i.unref(l)},{default:i.withCtx(()=>[i.createVNode(L,{class:i.normalizeClass([{"pointer-events-none":!i.unref(v)},"!p-0 !m-0 !h-fit"]),variant:"ghost",onDblclick:i.withModifiers(C,["stop"]),onClick:_,onMouseenter:x,onMouseleave:E},{default:i.withCtx(()=>[i.createVNode(i.unref(jt),{name:"fileEdit",class:i.normalizeClass({"w-[13px] h-auto":i.unref(l)})},null,8,["class"]),i.createElementVNode("div",{ref_key:"bookMarkRef",ref:r,"book-mark-node-id":e.node.attrs[i.unref(ot).ID],"page-id":m.value.pageId,"page-number":m.value.pageNumber,"book-mark-content":e.node.attrs[i.unref(ot).TEXT],"node-id":e.node.attrs[i.unref(ot).ID],"element-id":e.node.attrs[i.unref(ot).ELEMENT_ID],"line-id":b.value},null,8,BK)]),_:1},8,["class"])]),_:1},8,["disabled"]),i.createVNode(z,null,{default:i.withCtx(()=>[i.createVNode(M,{onSelect:A[0]||(A[0]=ie=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(T.$t("editor.super.edit")),1)]),_:1}),i.createVNode(M,{onSelect:S},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(T.$t("editor.super.delete")),1)]),_:1})]),_:1})]),_:1}),i.unref(l)?(i.openBlock(),i.createBlock(Ip,{key:1,open:n.value,"is-view-mode":a.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(ot).TEXT],"super-text-id":e.node.attrs[i.unref(ot).ID],"super-text-element-id":e.node.attrs[i.unref(ot).ELEMENT_ID],onClose:A[2]||(A[2]=ie=>n.value=!1),onSave:w,onDelete:S},null,8,["open","is-view-mode","editor","super-text-init","super-text-id","super-text-element-id"])):(i.openBlock(),i.createBlock(ae,{key:0,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(ot).TEXT],"super-text-element-id":e.node.attrs[i.unref(ot).ELEMENT_ID],onClose:A[1]||(A[1]=ie=>n.value=!1),onSave:w},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},8,["class","draggable","onTouchstartPassive","onTouchmovePassive","onTouchendPassive","onTouchcancelPassive"])}}}),RK=new Ne({props:{handleKeyDown(t,e){var n;if(e.key==="Backspace"){const{state:r,dispatch:o}=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,ce.from(f)),c.setSelection(Be.create(c.doc,s.pos)),o(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(Be.create(c.doc,s.pos-1)),o(c),e.preventDefault(),!0}}}return!1}}}),Rp="superText",vE={UPDATE:"superTextUpdate"},yE=Bt.create({name:"superText",inline:!0,group:"inline",selectable:!1,defining:!0,draggable:!0,addStorage(){return{enable:!0,isShowSuperInputMoblie:!1,view:!0,items:[],toggleSuperViewMobileCallBack:this.options.toggleSuperViewMobileCallBack}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>[...n?[{component:qe,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:qe,componentProps:{action:()=>t.commands.toggleSuperText(n),isActive:()=>t.storage.superText.enable,title:e("editor.menubar.menu.superView"),customClass:`whitespace-nowrap !text-white !font-normal rounded-[3px] h-[26px]
|
|
275
275
|
${n?"!bg-ed-blue":t.storage.superText.enable?"!bg-blue-700":"!bg-blue-500"}
|
|
276
|
-
`,tooltip:"수퍼 보기"}}]}},addAttributes(){return{[ot.ID]:{default:null},[ot.TEXT]:{default:""},[ot.POSITION]:{default:"0"},[ot.ELEMENT_ID]:{default:""}}},addCommands(){return{toggleSuperText:t=>({editor:e})=>t?e.storage.superText.toggleSuperViewMobileCallBack():e.storage.superText.enable=!e.storage.superText.enable,toggleSuperInputMoblie:()=>({editor:t})=>t.storage.superText.isShowSuperInputMoblie=!t.storage.superText.isShowSuperInputMoblie}},parseHTML(){return[{tag:"button.super-text"}]},renderHTML({HTMLAttributes:t}){return["button",gt(t,{class:"super-text"})]},addNodeView(){return Hs(IK)},addProseMirrorPlugins(){return[new Ne({appendTransaction(t,e,n){let r=n.tr,o=!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}),o=!0)}}),o?r:null}}),new Ne({filterTransaction(t,e){return t.steps.some(r=>{if(r.toJSON&&r.toJSON().stepType==="replace"){const o=r.toJSON();return o.slice&&o.slice.content&&o.slice.content.some(s=>s.type===Rp)}return!1})&&t.setMeta(vE.UPDATE,!0),!0}}),RK]}}),LK=["innerHTML"],PK=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","line-id"],DK=i.defineComponent({__name:"ConfigPlan",props:zs,setup(t){const e=t,n=i.ref(!1),r=i.ref(null),{selection:o,doc:s}=e.editor.state,a=i.inject("isMobile"),l=i.ref(!1),u=pt.useEventBus(ir.RENDER_SUPER_TEXT),c=i.computed(()=>{var _,T;const x=s.resolve(o.from),E=x==null?void 0:x.node(-1),S=(_=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:S,pageNumber:C}}),f=i.computed(()=>{const x=e.getPos(),E=e.editor.state.doc.resolve(x);for(let S=E.depth;S>0;S--){const C=E.node(S);if(C.type.name==="paragraph")return C}return null}),p=i.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],S=e.node.attrs[ot.ID],_={lineId:x.target.querySelector(`[node-id="${S}"]`).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:S}=e,C=x(),_=C+1;S.commands.deleteRange({from:C,to:_})}function w(){n.value=!0,a&&(l.value=!0)}return(x,E)=>{const S=_n,C=kp,_=Sp,T=Ep,A=Cp,L=uc;return i.openBlock(),i.createBlock(i.unref($s),{as:"span",class:i.normalizeClass(["w-fit text-inherit super-text align-middle",{"!leading-[9px] [&_*]:!leading-[9px]":i.unref(a)}]),"data-drag-handle":"",draggable:"true",contenteditable:"false"},{default:i.withCtx(()=>[i.createVNode(A,null,{default:i.withCtx(()=>[i.createVNode(C,{as:"template",class:"relative"},{default:i.withCtx(()=>[i.createVNode(S,{variant:"ghost",class:"!p-0 !m-0 !h-fit font-normal !text-ed-blue",onClick:w,onMouseenter:g,onMouseleave:b},{default:i.withCtx(()=>[i.createVNode(i.unref(jt),{name:"plan",class:i.normalizeClass({"w-[18px] h-auto pr-1":i.unref(a)})},null,8,["class"]),E[3]||(E[3]=i.createTextVNode(" [")),i.createElementVNode("span",{class:"[&_*]:inline",innerHTML:e.node.attrs[i.unref(ot).TEXT]},null,8,LK),E[4]||(E[4]=i.createTextVNode("] ")),i.createElementVNode("div",{ref_key:"bookMarkRef",ref:r,"book-mark-node-id":e.node.attrs[i.unref(ot).ID],"page-id":c.value.pageId,"page-number":c.value.pageNumber,"book-mark-content":e.node.attrs[i.unref(ot).TEXT],"node-id":e.node.attrs[i.unref(ot).ID],"line-id":p.value},null,8,PK)]),_:1})]),_:1}),i.createVNode(T,null,{default:i.withCtx(()=>[i.createVNode(_,{onSelect:E[0]||(E[0]=R=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.$t("editor.configPlan.edit")),1)]),_:1}),i.createVNode(_,{onSelect:v},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.$t("editor.configPlan.delete")),1)]),_:1})]),_:1})]),_:1}),i.unref(a)?(i.openBlock(),i.createBlock(Ip,{key:1,title:x.$t("editor.configPlan"),open:n.value,"is-view-mode":l.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(ot).TEXT],"super-text-id":e.node.attrs[i.unref(ot).ID],onClose:E[2]||(E[2]=R=>n.value=!1),onSave:m,onDelete:v},null,8,["title","open","is-view-mode","editor","super-text-init","super-text-id"])):(i.openBlock(),i.createBlock(L,{key:0,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(ot).TEXT],"super-text-element-id":e.node.attrs[i.unref(ot).ELEMENT_ID],onClose:E[1]||(E[1]=R=>n.value=!1),onSave:m},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},8,["class"])}}}),wE=Bt.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:qe,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",gt(t,{class:"config-plan"})]},addNodeView(){return Hs(DK)},addProseMirrorPlugins(){return[new Ne({appendTransaction(t,e,n){let r=n.tr,o=!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}),o=!0)}}),o?r:null}})]}});var mb,gb;if(typeof WeakMap<"u"){let t=new WeakMap;mb=e=>t.get(e),gb=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;mb=r=>{for(let o=0;o<t.length;o+=2)if(t[o]==r)return t[o+1]},gb=(r,o)=>(n==10&&(n=0),t[n++]=r,t[n++]=o)}var rn=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,o=e/this.width|0;let s=r+1,a=o+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:o,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:o,top:s,bottom:a}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[s*this.width+(n<0?r-1:o)]:(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:o,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(o,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 o=t.left;o<t.right;o++){const s=r*this.width+o,a=this.map[s];n[a]||(n[a]=!0,!(o==t.left&&o&&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,o=0;;r++){const s=o+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]<o;)a++;return a==l?s-1:this.map[a]}o=s}}static get(t){return mb(t)||gb(t,VK(t))}};function VK(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=FK(t),n=t.childCount,r=[];let o=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(;o<r.length&&r[o]!=0;)o++;if(b==p.childCount)break;const v=p.child(b),{colspan:w,rowspan:x,colwidth:E}=v.attrs;for(let S=0;S<x;S++){if(S+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:f,n:x-S});break}const C=o+S*e;for(let _=0;_<w;_++){r[C+_]==0?r[C+_]=f:(s||(s=[])).push({type:"collision",row:c,pos:f,n:w-_});const T=E&&E[_];if(T){const A=(C+_)%e*2,L=a[A];L==null||L!=T&&a[A+1]==1?(a[A]=T,a[A+1]=1):L==T&&a[A+1]++}}}o+=w,f+=v.nodeSize}const m=(c+1)*e;let g=0;for(;o<m;)r[o++]==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 rn(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&&$K(l,a,t),l}function FK(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=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<o.childCount;a++){const l=o.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 $K(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const s=t.map[o];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=(o+c)%t.width,p=e[f*2];p!=null&&(!u.colwidth||u.colwidth[c]!=p)&&((l||(l=zK(u)))[c]=p)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function zK(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Fn(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var fs=new St("selectingCells");function Sl(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 HK(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 Lp(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=Sl(e.$head)||UK(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function UK(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 bb(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function WK(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function vb(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function xE(t,e,n){const r=t.node(-1),o=rn.get(r),s=t.start(-1),a=o.nextCell(t.pos-s,e,n);return a==null?null:t.node(0).resolve(s+a)}function la(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(o=>o>0)||(r.colwidth=null)),r}function CE(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function jK(t,e,n){const r=Fn(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var Ft=class ki extends Ve{constructor(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.rectBetween(e.pos-s,n.pos-s),l=e.node(0),u=o.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 cy(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)),o=e.resolve(n.map(this.$headCell.pos));if(bb(r)&&bb(o)&&vb(r,o)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?ki.rowSelection(r,o):s&&this.isColSelection()?ki.colSelection(r,o):new ki(r,o)}return Be.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=rn.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},a=[];for(let u=o.top;u<o.bottom;u++){const c=[];for(let f=u*n.width+o.left,p=o.left;p<o.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=o.left-g.left,w=g.right-o.right;if(v>0||w>0){let x=b.attrs;if(v>0&&(x=la(x,0,v)),w>0&&(x=la(x,x.colspan-w,w)),g.left<o.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<o.top||g.bottom>o.bottom){const x={...b.attrs,rowspan:Math.min(g.bottom,o.bottom)-Math.max(g.top,o.top)};g.top<o.top?b=b.type.createAndFill(x):b=b.type.create(x,b.content)}c.push(b)}a.push(e.child(u).copy(ce.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:a;return new Ce(ce.from(l),1,1)}replace(e,n=Ce.empty){const r=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){const{$from:l,$to:u}=o[a],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(u.pos),a?Ce.empty:n)}const s=Ve.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new Ce(ce.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=rn.get(n),o=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let a=0;a<s.length;a++)e(n.nodeAt(s[a]),o+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,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.findCell(e.pos-s),l=o.findCell(n.pos-s),u=e.node(0);return a.top<=l.top?(a.top>0&&(e=u.resolve(s+o.map[a.left])),l.bottom<o.height&&(n=u.resolve(s+o.map[o.width*(o.height-1)+l.right-1]))):(l.top>0&&(n=u.resolve(s+o.map[l.left])),a.bottom<o.height&&(e=u.resolve(s+o.map[o.width*(o.height-1)+a.right-1]))),new ki(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=rn.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(o,s)>0)return!1;const a=o+this.$anchorCell.nodeAfter.attrs.colspan,l=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,l)==n.width}eq(e){return e instanceof ki&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.findCell(e.pos-s),l=o.findCell(n.pos-s),u=e.node(0);return a.left<=l.left?(a.left>0&&(e=u.resolve(s+o.map[a.top*o.width])),l.right<o.width&&(n=u.resolve(s+o.map[o.width*(l.top+1)-1]))):(l.left>0&&(n=u.resolve(s+o.map[l.top*o.width])),a.right<o.width&&(e=u.resolve(s+o.map[o.width*(a.top+1)-1]))),new ki(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new ki(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new ki(e.resolve(n),e.resolve(r))}getBookmark(){return new qK(this.$anchorCell.pos,this.$headCell.pos)}};Ft.prototype.visible=!1,Ve.jsonID("cell",Ft);var qK=class __{constructor(e,n){this.anchor=e,this.head=n}map(e){return new __(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&&vb(n,r)?new Ft(n,r):Ve.near(r,1)}};function KK(t){if(!(t.selection instanceof Ft))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Wt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),ht.create(t.doc,e)}function GK({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,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(o).type.spec.tableRole)}function XK({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const s=t.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let o=e.depth;o>0;o--){const s=e.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function YK(t,e,n){const r=(e||t).selection,o=(e||t).doc;let s,a;if(r instanceof Pe&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")s=Ft.create(o,r.from);else if(a=="row"){const l=o.resolve(r.from+1);s=Ft.rowSelection(l,l)}else if(!n){const l=rn.get(r.node),u=r.from+1,c=u+l.map[l.width*l.height-1];s=Ft.create(o,u+1,c)}}else r instanceof Be&&GK(r)?s=Be.create(o,r.from):r instanceof Be&&XK(r)&&(s=Be.create(o,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var JK=new St("fix-tables");function EE(t,e,n,r){const o=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(o,a+3);c<f;c++)if(t.child(c)==u){l=c+1,n+=u.nodeSize;continue e}r(u,n),l<o&&t.child(l).sameMarkup(u)?EE(t.child(l),u,n+1,r):u.nodesBetween(0,u.content.size,r,n+1),n+=u.nodeSize}}function SE(t,e){let n;const r=(o,s)=>{o.type.spec.tableRole=="table"&&(n=ZK(t,o,s,n))};return e?e.doc!=t.doc&&EE(e.doc,t.doc,0,r):t.doc.descendants(r),n}function ZK(t,e,n,r){const o=rn.get(e);if(!o.problems)return r;r||(r=t.tr);const s=[];for(let u=0;u<o.height;u++)s.push(0);for(let u=0;u<o.problems.length;u++){const c=o.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,la(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<o.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 w=0;w<m;w++){const x=Fn(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(JK,{fixTables:!0})}function Fo(t){const e=t.selection,n=Lp(t),r=n.node(-1),o=n.start(-1),s=rn.get(r);return{...e instanceof Ft?s.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):s.findCell(n.pos-o),tableStart:o,map:s,table:r}}function kE(t,{map:e,tableStart:n,table:r},o){let s=o>0?-1:0;jK(e,r,o+s)&&(s=o==0||o==e.width?null:0);for(let a=0;a<e.height;a++){const l=a*e.width+o;if(o>0&&o<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,CE(c.attrs,o-e.colCount(u))),a+=c.attrs.rowspan-1}else{const u=s==null?Fn(r.type.schema).cell:r.nodeAt(e.map[l+s]).type,c=e.positionAt(a,o,r);t.insert(t.mapping.map(n+c),u.createAndFill())}}return t}function QK(t,e){if(!co(t))return!1;if(e){const n=Fo(t);e(kE(t.tr,n,n.left))}return!0}function NK(t,e){if(!co(t))return!1;if(e){const n=Fo(t);e(kE(t.tr,n,n.right))}return!0}function eG(t,{map:e,table:n,tableStart:r},o){const s=t.mapping.maps.length;for(let a=0;a<e.height;){const l=a*e.width+o,u=e.map[l],c=n.nodeAt(u),f=c.attrs;if(o>0&&e.map[l-1]==u||o<e.width-1&&e.map[l+1]==u)t.setNodeMarkup(t.mapping.slice(s).map(r+u),null,la(f,o-e.colCount(u)));else{const p=t.mapping.slice(s).map(r+u);t.delete(p,p+c.nodeSize)}a+=f.rowspan}}function tG(t,e){if(!co(t))return!1;if(e){const n=Fo(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;eG(r,n,o),o!=n.left;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=rn.get(s)}e(r)}return!0}function nG(t,e,n){var r;const o=Fn(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)!=o)return!1;return!0}function _E(t,{map:e,tableStart:n,table:r},o){var s;let a=n;for(let c=0;c<o;c++)a+=r.child(c).nodeSize;const l=[];let u=o>0?-1:0;nG(e,r,o+u)&&(u=o==0||o==e.height?null:0);for(let c=0,f=e.width*o;c<e.width;c++,f++)if(o>0&&o<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?Fn(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,Fn(r.type.schema).row.create(null,l)),t}function rG(t,e){if(!co(t))return!1;if(e){const n=Fo(t);e(_E(t.tr,n,n.top))}return!0}function oG(t,e){if(!co(t))return!1;if(e){const n=Fo(t);e(_E(t.tr,n,n.bottom))}return!0}function iG(t,{map:e,table:n,tableStart:r},o){let s=0;for(let c=0;c<o;c++)s+=n.child(c).nodeSize;const a=s+n.child(o).nodeSize,l=t.mapping.maps.length;t.delete(s+r,a+r);const u=new Set;for(let c=0,f=o*e.width;c<e.width;c++,f++){const p=e.map[f];if(!u.has(p)){if(u.add(p),o>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(o<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(o+1,c,n);t.insert(t.mapping.slice(l).map(r+v),b),c+=g.colspan-1}}}}function sG(t,e){if(!co(t))return!1;if(e){const n=Fo(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;iG(r,n,o),o!=n.top;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=rn.get(n.table)}e(r)}return!0}function TE(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function aG({width:t,height:e,map:n},r){let o=r.top*t+r.left,s=o,a=(r.bottom-1)*t+r.left,l=o+(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[o]==n[o-t]||r.bottom<e&&n[a]==n[a+t])return!0;o++,a++}return!1}function AE(t,e){const n=t.selection;if(!(n instanceof Ft)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Fo(t),{map:o}=r;if(aG(o,r))return!1;if(e){const s=t.tr,a={};let l=ce.empty,u,c;for(let f=r.top;f<r.bottom;f++)for(let p=r.left;p<r.right;p++){const m=o.map[f*o.width+p],g=r.table.nodeAt(m);if(!(a[m]||!g))if(a[m]=!0,u==null)u=m,c=g;else{TE(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,{...CE(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=TE(c)?u+1:f;s.replaceWith(p+r.tableStart,f+r.tableStart,l)}s.setSelection(new Ft(s.doc.resolve(u+r.tableStart))),e(s)}return!0}function OE(t,e){const n=Fn(t.schema);return lG(({node:r})=>n[r.type.spec.tableRole])(t,e)}function lG(t){return(e,n)=>{var r;const o=e.selection;let s,a;if(o instanceof Ft){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;s=o.$anchorCell.nodeAfter,a=o.$anchorCell.pos}else{if(s=HK(o.$from),!s)return!1;a=(r=Sl(o.$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=Fo(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,w=0;v<f.right;v++,w++)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[w]))}p.setNodeMarkup(a,t({node:s,row:f.top,col:f.left}),u[0]),o instanceof Ft&&p.setSelection(new Ft(p.doc.resolve(o.$anchorCell.pos),m?p.doc.resolve(m):void 0)),n(p)}return!0}}function uG(t,e){return function(n,r){if(!co(n))return!1;const o=Lp(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof Ft?n.selection.forEachCell((a,l)=>{a.attrs[t]!==e&&s.setNodeMarkup(l,null,{...a.attrs,[t]:e})}):s.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function cG(t){return function(e,n){if(!co(e))return!1;if(n){const r=Fn(e.schema),o=Fo(e),s=e.tr,a=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),l=a.map(u=>o.table.nodeAt(u));for(let u=0;u<a.length;u++)l[u].type==r.header_cell&&s.setNodeMarkup(o.tableStart+a[u],r.cell,l[u].attrs);if(s.steps.length==0)for(let u=0;u<a.length;u++)s.setNodeMarkup(o.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 o=0;o<r.length;o++){const s=e.table.nodeAt(r[o]);if(s&&s.type!==n.header_cell)return!1}return!0}function cc(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?cG(t):function(n,r){if(!co(n))return!1;if(r){const o=Fn(n.schema),s=Fo(n),a=n.tr,l=ME("row",s,o),u=ME("column",s,o),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?o.cell:o.header_cell:t=="row"?l?o.cell:o.header_cell:o.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}}cc("row",{useDeprecatedLogic:!0}),cc("column",{useDeprecatedLogic:!0});var dG=cc("cell",{useDeprecatedLogic:!0});function fG(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const s=t.node(-1).child(r),a=s.lastChild;if(a)return o-1-a.nodeSize;o-=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),o=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return o+1;o+=s.nodeSize}}return null}function BE(t){return function(e,n){if(!co(e))return!1;const r=fG(Lp(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(Be.between(o,WK(o))).scrollIntoView())}return!0}}function pG(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 Pp(t,e){const n=t.selection;if(!(n instanceof Ft))return!1;if(e){const r=t.tr,o=Fn(t.schema).cell.createAndFill().content;n.forEachCell((s,a)=>{s.content.eq(o)||r.replace(r.mapping.map(a+1),r.mapping.map(a+s.nodeSize-1),new Ce(o,0,0))}),r.docChanged&&e(r)}return!0}function hG(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 o=e.child(0),s=o.type.spec.tableRole,a=o.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=yb(Fn(a).row,new Ce(c,f,p)).content),l.push(c)}else if(s=="cell"||s=="header_cell")l.push(n||r?yb(Fn(a).row,new Ce(e,n,r)).content:e);else return null;return mG(a,l)}function mG(t,e){const n=[];for(let o=0;o<e.length;o++){const s=e[o];for(let a=s.childCount-1;a>=0;a--){const{rowspan:l,colspan:u}=s.child(a).attrs;for(let c=o;c<o+l;c++)n[c]=(n[c]||0)+u}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(ce.empty),n[o]<r){const s=Fn(t).cell.createAndFill(),a=[];for(let l=n[o];l<r;l++)a.push(s);e[o]=e[o].append(ce.from(a))}return{height:e.length,width:r,rows:e}}function yb(t,e){const n=t.createAndFill();return new cm(n).replace(0,n.content.size,e).doc}function gG({width:t,height:e,rows:n},r,o){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(la(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(ce.from(c))}n=a,t=r}if(e!=o){const s=[];for(let a=0,l=0;a<o;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>o&&(p=p.type.create({...p.attrs,rowspan:Math.max(1,o-p.attrs.rowspan)},p.content)),u.push(p)}s.push(ce.from(u))}n=s,e=o}return{width:t,height:e,rows:n}}function bG(t,e,n,r,o,s,a){const l=t.doc.type.schema,u=Fn(l);let c,f;if(o>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 w=e.width;w<o;w++)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,o);b++){const w=b>=e.width?!1:n.nodeAt(e.map[v+b]).type==u.header_cell;p.push(w?f||(f=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}const m=u.row.create(null,ce.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 IE(t,e,n,r,o,s,a,l){if(a==0||a==e.height)return!1;let u=!1;for(let c=o;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 RE(t,e,n,r,o,s,a,l){if(a==0||a==e.width)return!1;let u=!1;for(let c=o;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,la(m.attrs,a-g,m.attrs.colspan-(a-g))),t.insert(b+m.nodeSize,m.type.createAndFill(la(m.attrs,0,a-g))),c+=m.attrs.rowspan-1}}return u}function LE(t,e,n,r,o){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let a=rn.get(s);const{top:l,left:u}=r,c=u+o.width,f=l+o.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=rn.get(s),m=p.mapping.maps.length}bG(p,a,s,n,c,f,m)&&g(),IE(p,a,s,n,u,c,l,m)&&g(),IE(p,a,s,n,u,c,f,m)&&g(),RE(p,a,s,n,l,f,u,m)&&g(),RE(p,a,s,n,l,f,c,m)&&g();for(let b=l;b<f;b++){const v=a.positionAt(b,u,s),w=a.positionAt(b,c,s);p.replace(p.mapping.slice(m).map(v+n),p.mapping.slice(m).map(w+n),new Ce(o.rows[b-l],0,0))}g(),p.setSelection(new Ft(p.doc.resolve(n+a.positionAt(l,u,s)),p.doc.resolve(n+a.positionAt(f-1,c-1,s)))),e(p)}var vG=Hm({ArrowLeft:Vp("horiz",-1),ArrowRight:Vp("horiz",1),ArrowUp:Vp("vert",-1),ArrowDown:Vp("vert",1),"Shift-ArrowLeft":Fp("horiz",-1),"Shift-ArrowRight":Fp("horiz",1),"Shift-ArrowUp":Fp("vert",-1),"Shift-ArrowDown":Fp("vert",1),Backspace:Pp,"Mod-Backspace":Pp,Delete:Pp,"Mod-Delete":Pp});function Dp(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Vp(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;if(s instanceof Ft)return Dp(n,r,Ve.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=PE(o,t,e);if(a==null)return!1;if(t=="horiz")return Dp(n,r,Ve.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(a),u=xE(l,t,e);let c;return u?c=Ve.near(u,1):e<0?c=Ve.near(n.doc.resolve(l.before(-1)),-1):c=Ve.near(n.doc.resolve(l.after(-1)),1),Dp(n,r,c)}}}function Fp(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;let a;if(s instanceof Ft)a=s;else{const u=PE(o,t,e);if(u==null)return!1;a=new Ft(n.doc.resolve(u))}const l=xE(a.$headCell,t,e);return l?Dp(n,r,new Ft(a.$anchorCell,l)):!1}}function yG(t,e){const n=t.state.doc,r=Sl(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Ft(r))),!0):!1}function wG(t,e,n){if(!co(t.state))return!1;let r=hG(n);const o=t.state.selection;if(o instanceof Ft){r||(r={width:1,height:1,rows:[ce.from(yb(Fn(t.state.schema).cell,n))]});const s=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),l=rn.get(s).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=gG(r,l.right-l.left,l.bottom-l.top),LE(t.state,t.dispatch,a,l,r),!0}else if(r){const s=Lp(t.state),a=s.start(-1);return LE(t.state,t.dispatch,a,rn.get(s.node(-1)).findCell(s.pos-a),r),!0}else return!1}function xG(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=DE(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof Ft)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=Sl(t.state.selection.$anchor))!=null&&((n=wb(t,e))==null?void 0:n.pos)!=o.pos)s(o,e),e.preventDefault();else if(!r)return;function s(u,c){let f=wb(t,c);const p=fs.getState(t.state)==null;if(!f||!vb(u,f))if(p)f=u;else return;const m=new Ft(u,f);if(p||!t.state.selection.eq(m)){const g=t.state.tr.setSelection(m);p&&g.setMeta(fs,u.pos),t.dispatch(g)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",l),fs.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(fs,-1))}function l(u){const c=u,f=fs.getState(t.state);let p;if(f!=null)p=t.state.doc.resolve(f);else if(DE(t,c.target)!=r&&(p=wb(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 PE(t,e,n){if(!(t.state.selection instanceof Be))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=r.before(o),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 wb(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Sl(t.state.doc.resolve(n.pos)):null}var CG=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")),xb(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,xb(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function xb(t,e,n,r,o,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 w=o==m?s:b&&b[v],x=w?w+"px":"";if(l+=w||r,w||(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 yr=new St("tableColumnResizing");function EG({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=CG,lastColumnResizable:o=!0}={}){const s=new Ne({key:yr,state:{init(a,l){var u,c;const f=(c=(u=s.spec)==null?void 0:u.props)==null?void 0:c.nodeViews,p=Fn(l.schema).table.name;return r&&f&&(f[p]=(m,g)=>new r(m,n,g)),new SG(-1,!1)},apply(a,l){return l.apply(a)}},props:{attributes:a=>{const l=yr.getState(a);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,l)=>{kG(a,l,t,o)},mouseleave:a=>{_G(a)},mousedown:(a,l)=>{TG(a,l,e,n)}},decorations:a=>{const l=yr.getState(a);if(l&&l.activeHandle>-1)return IG(a,l.activeHandle)},nodeViews:{}}});return s}var SG=class Xh{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(yr);if(r&&r.setHandle!=null)return new Xh(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Xh(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return bb(e.doc.resolve(o))||(o=-1),new Xh(o,n.dragging)}return n}};function kG(t,e,n,r){if(!t.editable)return;const o=yr.getState(t.state);if(o&&!o.dragging){const s=OG(e.target);let a=-1;if(s){const{left:l,right:u}=s.getBoundingClientRect();e.clientX-l<=n?a=VE(t,e,"left",n):u-e.clientX<=n&&(a=VE(t,e,"right",n))}if(a!=o.activeHandle){if(!r&&a!==-1){const l=t.state.doc.resolve(a),u=l.node(-1),c=rn.get(u),f=l.start(-1);if(c.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==c.width-1)return}$E(t,a)}}}function _G(t){if(!t.editable)return;const e=yr.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&$E(t,-1)}function TG(t,e,n,r){var o;if(!t.editable)return!1;const s=(o=t.dom.ownerDocument.defaultView)!=null?o:window,a=yr.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const l=t.state.doc.nodeAt(a.activeHandle),u=AG(t,a.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(yr,{setDragging:{startX:e.clientX,startWidth:u}}));function c(p){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f);const m=yr.getState(t.state);m!=null&&m.dragging&&(MG(t,m.activeHandle,FE(m.dragging,p,n)),t.dispatch(t.state.tr.setMeta(yr,{setDragging:null})))}function f(p){if(!p.which)return c(p);const m=yr.getState(t.state);if(m&&m.dragging){const g=FE(m.dragging,p,n);zE(t,m.activeHandle,g,r)}}return zE(t,a.activeHandle,u,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",f),e.preventDefault(),!0}function AG(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;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 OG(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function VE(t,e,n,r){const o=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!s)return-1;const{pos:a}=s,l=Sl(t.state.doc.resolve(a));if(!l)return-1;if(n=="right")return l.pos;const u=rn.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 FE(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function $E(t,e){t.dispatch(t.state.tr.setMeta(yr,{setHandle:e}))}function MG(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),s=rn.get(o),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=o.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():BG(m.colspan);b[g]=n,u.setNodeMarkup(a+p,null,{...m,colwidth:b})}u.docChanged&&t.dispatch(u)}function zE(t,e,n,r){const o=t.state.doc.resolve(e),s=o.node(-1),a=o.start(-1),l=rn.get(s).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;let u=t.domAtPos(o.start(-1)).node;for(;u&&u.nodeName!="TABLE";)u=u.parentNode;u&&xb(s,u.firstChild,u,r,l,n)}function BG(t){return Array(t).fill(0)}function IG(t,e){var n;const r=[],o=t.doc.resolve(e),s=o.node(-1);if(!s)return ht.empty;const a=rn.get(s),l=o.start(-1),u=a.colCount(o.pos-l)+o.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=yr.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 ht.create(t.doc,r)}function RG({allowTableNodeSelection:t=!1}={}){return new Ne({key:fs,state:{init(){return null},apply(e,n){const r=e.getMeta(fs);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:s}=e.mapping.mapResult(n);return o?null:s}},props:{decorations:KK,handleDOMEvents:{mousedown:xG},createSelectionBetween(e){return fs.getState(e.state)!=null?e.state.selection:null},handleTripleClick:yG,handleKeyDown:vG,handlePaste:wG},appendTransaction(e,n,r){return YK(r,SE(r,n),t)}})}const LG=(t,e,n)=>{if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r||n===r.attrs.backgroundColor)return t;const o={...r.attrs,backgroundColor:n};return t.setNodeMarkup(e,r.type,o,r.marks)},PG=(t,e,n)=>{const{doc:r,selection:o}=t;return!r||!o||!(o instanceof Ft)||o.forEachCell((s,a)=>{t=LG(t,a,n)}),t},HE=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=r;return n=n.setSelection(s),n=PG(n,e,t),n.docChanged?(o==null||o(n),!0):!1},DG=Ze.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)}}}),VG=Bt.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",gt(this.options.HTMLAttributes,t),0]}}),FG=Bt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",gt(this.options.HTMLAttributes,t),0]}}),$G=Bt.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",gt(this.options.HTMLAttributes,t),0]}});function Cb(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function UE(t,e,n,r,o,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 w=o===m?s:b&&b[v],x=w?`${w}px`:"";if(l+=w||r,w||(u=!1),c){if(c.style.width!==x){const[E,S]=Cb(r,w);c.style.setProperty(E,S)}c=c.nextSibling}else{const E=document.createElement("col"),[S,C]=Cb(r,w);E.style.setProperty(S,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 zG{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")),UE(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,UE(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function HG(t,e,n,r){let o=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 w=n===m?r:b&&b[v];o+=w||e,w||(s=!1);const[x,E]=Cb(e,w);a.push(["col",{style:`${x}: ${E}`}])}}const u=s?`${o}px`:"",c=s?"":`${o}px`;return{colgroup:["colgroup",{},...a],tableWidth:u,tableMinWidth:c}}function WE(t,e){return t.createAndFill()}function UG(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 WG(t,e,n,r,o){const s=UG(t),a=[],l=[];for(let c=0;c<n;c+=1){const f=WE(s.cell);if(f&&l.push(f),r){const p=WE(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 jG(t){return t instanceof Ft}const $p=({editor:t})=>{const{selection:e}=t.state;if(!jG(e))return!1;let n=0;const r=s4(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},qG=Bt.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:zG,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:o}=HG(t,this.options.cellMinWidth);return["table",gt(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:s})=>{const a=WG(s.schema,t,e,n);if(o){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(Be.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>QK(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>NK(t,e),deleteColumn:()=>({state:t,dispatch:e})=>tG(t,e),addRowBefore:()=>({state:t,dispatch:e})=>rG(t,e),addRowAfter:()=>({state:t,dispatch:e})=>oG(t,e),deleteRow:()=>({state:t,dispatch:e})=>sG(t,e),deleteTable:()=>({state:t,dispatch:e})=>pG(t,e),mergeCells:()=>({state:t,dispatch:e})=>AE(t,e),splitCell:()=>({state:t,dispatch:e})=>OE(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>cc("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>cc("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>dG(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>AE(t,e)?!0:OE(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>uG(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>BE(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>BE(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&SE(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=Ft.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:$p,"Mod-Backspace":$p,Delete:$p,"Mod-Delete":$p}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[EG({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],RG({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:st(Re(t,"tableRole",e))}}}),KG=["disabled"],GG={"content-class":"table-grid-size-editor","content-style":"padding:0"},XG={class:"flex flex-col flex-wrap gap-1 justify-between"},YG=["onMouseover","onMousedown"],JG={class:"text-center text-sm text-zinc-600 mt-2"},ZG=i.defineComponent({__name:"CreateTablePopover",props:{disabled:{type:Boolean,default:!1}},emits:["create-table"],setup(t,{emit:e}){const n=e,r=i.ref(!1),o=i.ref(!0),s=i.reactive({rows:Bu()?Id:Bd,cols:Bu()?Id:Bd}),a=i.reactive({rows:Rd,cols:Rd});function l(f,p){f===s.rows&&(s.rows=Math.min(f+1,Id)),p===s.cols&&(s.cols=Math.min(p+1,Id)),a.rows=f,a.cols=p}function u(f,p){n("create-table",{rows:f,cols:p,withHeaderRow:i.unref(o)}),c()}function c(){r.value=!1,o.value=!1,s.rows=Bd,s.cols=Bd,a.rows=Rd,a.cols=Rd}return(f,p)=>(i.openBlock(),i.createBlock(i.unref(ul),null,{default:i.withCtx(()=>[i.createVNode(i.unref(fl),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("button",{disabled:t.disabled,class:"m-0 p-0"},[i.renderSlot(f.$slots,"trigger")],8,KG)]),_:3}),i.createVNode(i.unref(cl),{class:"w-full",align:"start",side:"bottom"},{default:i.withCtx(()=>[i.createElementVNode("div",GG,[i.createElementVNode("div",XG,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.rows,m=>(i.openBlock(),i.createElementBlock("div",{key:"r"+m,class:"flex gap-1"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.cols,g=>(i.openBlock(),i.createElementBlock("div",{key:"c"+g,class:i.normalizeClass([[g<=a.cols&&m<=a.rows&&"bg-ed-foreground border-ed-border","cursor-pointer"],"pa-1"]),onMouseover:b=>l(m,g),onMousedown:b=>u(m,g)},p[0]||(p[0]=[i.createElementVNode("div",{class:"w-4 h-4 p-1 border box-border"},null,-1)]),42,YG))),128))]))),128))]),i.createElementVNode("div",JG,i.toDisplayString(a.rows)+" x "+i.toDisplayString(a.cols),1)])]),_:1})]),_:3}))}}),QG={style:{display:"flex"}},NG=i.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.disabled||e.editor.chain().focus().insertTable({...r,withHeaderRow:!1}).run()}return(r,o)=>(i.openBlock(),i.createBlock(ZG,{disabled:r.disabled,onCreateTable:n},{trigger:i.withCtx(()=>[i.createElementVNode("div",QG,[i.createVNode(qe,{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"]))}}),Eb=qG.extend({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:NG,componentProps:{disabled:e.isActive("table")||!1,icon:"Table",tooltip:n("editor.table.tooltip")}})}},addExtensions(){return[FG.configure(this.options.tableRow),VG.configure(this.options.tableHeader),$G.configure(this.options.tableCell),DG.configure(this.options.tableCellBackground)]}}),eX={class:"flex items-center gap-2 px-2"},tX=i.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}=At(),r=i.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()}]),o=i.computed(()=>r.value.filter(s=>s.isActive()).pop()??{label:n("editor.modify")});return(s,a)=>{var l;return i.openBlock(),i.createBlock(na,{title:(l=o.value)==null?void 0:l.label,"side-offset":5},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(u,c)=>{var f;return i.openBlock(),i.createBlock(i.unref(yl),{key:c,class:"cursor-pointer",checked:((f=u.isActive)==null?void 0:f.call(u))||!1,onClick:u.action},{default:i.withCtx(()=>[i.createElementVNode("div",eX,[i.createVNode(i.unref(jt),{name:u.iconName,class:"h3 w-3"},null,8,["name"]),i.createElementVNode("span",null,i.toDisplayString(u.label),1)])]),_:2},1032,["checked","onClick"])}),128))]),_:1},8,["title"])}}}),nX=Ze.create({name:"text-bubble",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:()=>({component:tX,componentProps:{}})}}}),rX=[{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}년"}],oX=t=>{const e=[...t||[],...rX.map(n=>n.pattern)].join("|");return new RegExp(e,"gu")},iX=Ze.create({name:"time-highlighter",addOptions(){return{additionalTimeWords:[]}},addStorage(){return{cachedRegex:null,cachedAdditionalWords:null}},addProseMirrorPlugins(){return[new Ne({props:{decorations:t=>{const e=[];return(this.storage.cachedAdditionalWords!==this.options.additionalTimeWords||!this.storage.cachedRegex)&&(this.storage.cachedAdditionalWords=this.options.additionalTimeWords,this.storage.cachedRegex=oX(this.options.additionalTimeWords)),t.doc.descendants((n,r)=>{if(!n.isText)return;let o;const s=this.storage.cachedRegex;for(;o=s.exec(n.text||"");){const a=r+o.index,l=a+o[0].length;e.push(Wt.inline(a,l,{class:"time-highlight"}))}}),ht.create(t.doc,e)}}})]}}),sX=Ze.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 o=t.tr.setSelection(Be.create(t.doc,r));return e&&e(o.scrollIntoView()),n&&n.focus(),!0}}}});function Sb(t){const e=JSON.stringify(t),n=window.ReactNativeWebView;if(n){n.postMessage(e);return}console.warn("[clipboardBridge] no bridge found")}function aX(){return Sb({type:"REQUEST_CLIPBOARD_STATE"}),new Promise(t=>{function e(n){const r=(n&&n.data)??(n&&n.nativeEvent&&n.nativeEvent.data);if(!r)return;let o;try{o=typeof r=="string"?JSON.parse(r):r}catch{return}o&&o.type==="CLIPBOARD_STATE"&&(window.removeEventListener("message",e),t(!!o.hasClipboard))}window.addEventListener("message",e)})}function lX(){return Sb({type:"PASTE"}),new Promise(t=>{function e(n){const r=(n&&n.data)??(n&&n.nativeEvent&&n.nativeEvent.data);if(!r)return;let o;try{o=typeof r=="string"?JSON.parse(r):r}catch{return}o&&o.type==="PASTE_RESULT"&&(window.removeEventListener("message",e),t(o.text??null))}window.addEventListener("message",e)})}function uX(t){Sb({type:"COPY",data:t})}const cX=Ze.create({name:"clipboard",addCommands(){return{copyContent:()=>({editor:t,state:e})=>{const{from:n,to:r}=e.selection;return n===r?!1:((async()=>{try{const o=e.doc.slice(n,r),a=vo.fromSchema(t.schema).serializeFragment(o.content),l=document.createElement("div");l.appendChild(a);const u=l.innerHTML;await uX(u)}catch(o){console.warn("[clipboard] copy failed",o)}})(),!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=await lX();if(!e)return;const n=typeof e=="string"&&/^\s*<([A-Za-z][\s\S]*>)/.test(e),r=new DataTransfer;if(n){r.setData("text/html",e);const s=document.createElement("div");s.innerHTML=e,r.setData("text/plain",s.innerText)}else r.setData("text/plain",e);const o=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(o,"clipboardData",{value:r}),t.view.dom.dispatchEvent(o)}catch(e){console.warn("Clipboard paste failed:",e)}})(),!0)}},onCreate(){const t=this.editor;t.hasClipboard=async()=>{try{return!!await aX()}catch(e){return console.warn("[clipboard] requestClipboardState failed",e),!1}}}}),jE=Ze.create({name:"base-kit",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),timeHighlighter:{additionalTimeWords:[]},bubble:{list:MB,defaultBubbleList:fj,button:({editor:e,extension:n,t:r})=>{var l;const{list:o={},defaultBubbleList:s}=((l=n.options)==null?void 0:l.bubble)??{},a=(s==null?void 0:s(e))??[];return pj(o,a,{editor:e,extension:n,t:r})}}}},addExtensions(){var n,r,o,s,a;const{t}=At(),e=[];this.options.placeholder!==!1&&e.push(uj.configure({placeholder:({node:l,pos:u})=>{var f;const c=(f=l==null?void 0:l.type)==null?void 0:f.name;return c==="heading"?`${t(`editor.heading.h${l.attrs.level}.tooltip`)}`:c==="table"||c==="codeBlock"?"":u===0?t("editor.content"):""},...this.options.placeholder})),this.options.focus!==!1&&e.push(QW.configure({className:"focus",...this.options.focus})),this.options.document!==!1&&(this.options.page?(e.push(D8.configure().extend({content:"page+"})),e.push(rK.configure({types:((r=(n=this.options.page)==null?void 0:n.nodesComputedOption)==null?void 0:r.types)??[],slots:i.useSlots()}))):e.push(D8.configure())),this.options.dropcursor!==!1&&e.push(ZW.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&e.push(XW.configure(this.options.characterCount)),this.options.paragraph!==!1&&e.push(R8.configure(this.options.paragraph)),this.options.hardBreak!==!1&&e.push(aj.configure(this.options.hardBreak)),this.options.listItem!==!1&&e.push(lj.configure(this.options.listItem)),this.options.textStyle!==!1&&e.push(LU.configure(this.options.textStyle)),this.options.history!==!1&&e.push($g.configure(this.options.history)),this.options.fontSize!==!1&&e.push(t8.configure(this.options.fontSize)),this.options.fontFamily!==!1&&e.push(dE.configure(this.options.fontFamily)),this.options.mode!==Fe.EDITOR&&e.push(cK),this.options.superText!==!1&&this.options.mode!==Fe.PLAIN_TEXT&&(typeof this.options.superText=="boolean"?e.push(yE.configure()):e.push(yE.configure({specialCharModal:(o=this.options.superText)==null?void 0:o.specialCharModal,toggleSuperViewMobileCallBack:(s=this.options.superText)==null?void 0:s.toggleSuperViewMobileCallBack}))),this.options.mode===Fe.EDITOR&&(this.options.image!==!1&&e.push(pb.configure()),e.push(NC.configure({spacer:!0}),EC,CC,SC,Dg,Eb)),this.options.mode!==Fe.EDITOR&&this.options.configPlan!==!1&&this.options.mode!==Fe.PLAIN_TEXT&&(typeof this.options.configPlan=="boolean"?e.push(wE.configure()):e.push(wE.configure({specialCharModal:(a=this.options.configPlan)==null?void 0:a.specialCharModal}))),this.options.mode!==Fe.EDITOR&&this.options.mode!==Fe.PLAIN_TEXT&&e.push(fK),(this.options.mode===Fe.STRAIGHT||this.options.mode===Fe.REPORT||this.options.mode===Fe.EDITOR)&&this.options.timeHighlighter&&e.push(iX.configure(this.options.timeHighlighter)),this.options.invalidCharFocus!==!1&&e.push(sX.configure(this.options.invalidCharFocus)),e.push(cj,L8.configure(),nX.configure(),sj.configure(),kC,n8.configure({spacer:!0}),e8.configure({types:["heading","paragraph"],spacer:!0}),hE,hb,db,fg,cX,r8.configure({multicolor:!0}));for(const l in this.options.excludes)Object.prototype.hasOwnProperty.call(this.options.excludes,l)&&this.options.excludes[l]&&tt.remove(e,({name:c})=>c===l);return e},addStorage(){return{mode:this.options.mode}}}),qE=Kn.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",gt(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()}}}),KE=Kn.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",gt(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()}}}),dX=Ze.create({name:"subAndSuperScript",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>{const o=n.options.subscript,s=n.options.superscript,a={component:qe,componentProps:{action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",tooltip:r("editor.subscript.tooltip")}},l={component:qe,componentProps:{action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",tooltip:r("editor.superscript.tooltip")}},u=[];return o!==!1&&u.push(a),s!==!1&&u.push(l),u}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(qE.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(KE.configure(this.options.superscript)),t}}),fX={class:"ml-1"},pX=i.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=i.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,o)=>(i.openBlock(),i.createBlock(na,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.items,(s,a)=>(i.openBlock(),i.createBlock(i.unref(yl),{key:a,checked:n.value.title===s.title,disabled:s.disabled,class:"flex gap-3 items-center",onClick:s.action},{default:i.withCtx(()=>[s.icon?(i.openBlock(),i.createBlock(i.unref(jt),{key:0,name:s.icon},null,8,["name"])):i.createCommentVNode("",!0),i.createElementVNode("span",fX,i.toDisplayString(s.title),1),s.shortcutKeys?(i.openBlock(),i.createBlock(i.unref(QC),{key:1,class:"ml-auto"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(V6)(s.shortcutKeys)),1)]),_:2},1024)):i.createCommentVNode("",!0)]),_:2},1032,["checked","disabled","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),hX=Ze.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,extension:n,t:r}){const o=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=T0(e,"code"),c=[];if(o!==!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:pX,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(qE.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(KE.configure(this.options.superscript)),t}});var ua=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(ua||{});function mX(t,e,n){return t<e?e:t>n?n:t}function gX(t,e,n,r){const{doc:o,selection:s}=t;if(!o||!s||!(s instanceof Be||s instanceof In))return t;const{from:a,to:l}=s;return o.nodesBetween(a,l,(u,c)=>{const f=u.type;return n.includes(f.name)?(t=bX(t,c,e),!1):!r0(u.type.name,r.extensionManager.extensions)}),t}function bX(t,e,n){if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r)return t;const a=mX((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 GE({delta:t,types:e}){return({state:n,dispatch:r,editor:o})=>{const{selection:s}=n;let{tr:a}=n;return a=a.setSelection(s),a=gX(a,t,e,o),a.docChanged?(r&&r(a),!0):!1}}const vX=Ze.create({name:"indent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:ua.min,maxIndent:ua.max,button({editor:e,t:n}){var s,a;const{selection:r}=e.state,o=r.$anchor.parent;return[{component:qe,componentProps:{action:()=>{e.commands.indent()},disabled:((s=o==null?void 0:o.attrs)==null?void 0:s.indent)>=ua.max||!e.can().indent(),shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")}},{component:qe,componentProps:{action:()=>{e.commands.outdent()},shortcutKeys:["Shift","Tab"],disabled:((a=o==null?void 0:o.attrs)==null?void 0:a.indent)<=ua.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:()=>GE({delta:ua.more,types:this.options.types}),outdent:()=>GE({delta:ua.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});function yX(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:l}=t,u=r&&!o,c=zO(n),f=new RegExp(`\\s${c}$`),p=a?"^":"",m=o?"":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,w=Array.from(b.matchAll(g)).pop();if(!w||w.input===void 0||w.index===void 0)return null;const x=w.input.slice(Math.max(0,w.index-1),w.index),E=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(x);if(s!==null&&!E)return null;const S=v+w.index;let C=S+w[0].length;return u&&f.test(b.slice(C-1,C+1))&&(w[0]+=" ",C+=1),S<l.pos&&C>=l.pos?{range:{from:S,to:C},query:w[0].slice(n.length),text:w[0]}:null}const wX=new St("suggestion");function xX({pluginKey:t=wX,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:s=[" "],startOfLine:a=!1,decorationTag:l="span",decorationClass:u="suggestion",command:c=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=yX}){let b;const v=p==null?void 0:p(),w=new Ne({key:t,view(){return{update:async(x,E)=>{var S,C,_,T,A,L,R;const M=(S=this.key)===null||S===void 0?void 0:S.getState(E),z=(C=this.key)===null||C===void 0?void 0:C.getState(x.state),K=M.active&&z.active&&M.range.from!==z.range.from,ae=!M.active&&z.active,ie=M.active&&!z.active,W=!ae&&!ie&&M.query!==z.query,$=ae||K&&W,P=W||K,G=ie||K&&W;if(!$&&!P&&!G)return;const Z=G&&!$?M:z,ne=x.dom.querySelector(`[data-decoration-id="${Z.decorationId}"]`);b={editor:e,range:Z.range,query:Z.query,text:Z.text,items:[],command:ee=>c({editor:e,range:Z.range,props:ee}),decorationNode:ne,clientRect:ne?()=>{var ee;const{decorationId:xe}=(ee=this.key)===null||ee===void 0?void 0:ee.getState(e.state),Ee=x.dom.querySelector(`[data-decoration-id="${xe}"]`);return(Ee==null?void 0:Ee.getBoundingClientRect())||null}:null},$&&((_=v==null?void 0:v.onBeforeStart)===null||_===void 0||_.call(v,b)),P&&((T=v==null?void 0:v.onBeforeUpdate)===null||T===void 0||T.call(v,b)),(P||$)&&(b.items=await f({editor:e,query:Z.query})),G&&((A=v==null?void 0:v.onExit)===null||A===void 0||A.call(v,b)),P&&((L=v==null?void 0:v.onUpdate)===null||L===void 0||L.call(v,b)),$&&((R=v==null?void 0:v.onStart)===null||R===void 0||R.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,S,C){const{isEditable:_}=e,{composing:T}=e.view,{selection:A}=x,{empty:L,from:R}=A,M={...E};if(M.composing=T,_&&(L||e.view.composing)){(R<E.range.from||R>E.range.to)&&!T&&!E.composing&&(M.active=!1);const z=g({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:A.$from}),K=`id_${Math.floor(Math.random()*4294967295)}`;z&&m({editor:e,state:C,range:z.range,isActive:E.active})?(M.active=!0,M.decorationId=E.decorationId?E.decorationId:K,M.range=z.range,M.query=z.query,M.text=z.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 S;const{active:C,range:_}=w.getState(x.state);return C&&((S=v==null?void 0:v.onKeyDown)===null||S===void 0?void 0:S.call(v,{view:x,event:E,range:_}))||!1},decorations(x){const{active:E,range:S,decorationId:C}=w.getState(x);return E?ht.create(x.doc,[Wt.inline(S.from,S.to,{nodeName:l,class:u,"data-decoration-id":C})]):null}}});return w}const CX=[{label:"优酷",value:"youku",icon:"Youku"},{label:"哔哩哔哩",value:"bilibili",icon:"BiliBili"},{label:"腾讯视频",value:"qqvideo",icon:"QQVideo"}],EX=[{label:"高德地图",value:"amap",icon:"Gaode"},{label:"百度地图",value:"baidu_map",icon:"Baidu"}],SX=[{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"}],kX=[{label:"CodePen",value:"codepen",icon:"Codepen"}],_X=[{label:"金数据",value:"jinshuju",icon:"Jinshuju"}],TX=[],AX=[...CX,...EX,...SX,...kX,..._X,...TX];function OX(t){const{t:e}=At(),n=[{name:"format",title:e("editor.slash.format"),commands:[{name:"paragraph",label:e("editor.paragraph.tooltip"),aliases:["paragraph","zw"],iconName:"Paragraph",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading1",label:e("editor.heading.h1.tooltip"),aliases:["h1","bt","bt1"],iconName:"Heading1",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading2",label:e("editor.heading.h2.tooltip"),aliases:["h2","bt","bt2"],iconName:"Heading2",action:({editor:o,range:s})=>{o.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:o,range:s})=>{o.chain().focus().deleteRange(s).setNode("heading",{level:3}).run()}},{name:"bulletList",label:e("editor.bulletlist.tooltip"),aliases:["ul","yxlb","bulletList"],iconName:"List",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleBulletList().run()}},{name:"numberedList",label:e("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleOrderedList().run()}},{name:"codeBlock",label:e("editor.codeblock.tooltip"),iconName:"Code2",aliases:["codeBlock"],description:"Code block with syntax highlighting",shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setCodeBlock().run()}},{name:"blockquote",label:e("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setBlockquote().run()}},{name:"horizontalrule",label:e("editor.horizontalrule.tooltip"),aliases:["fgx","horizontalRule"],iconName:"Minus",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHorizontalRule().run()}},{name:"link",label:e("editor.link.tooltip"),aliases:["link","lianjie","lj"],iconName:"Link",action:({editor:o,range:s})=>{o.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:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.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:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.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:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.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:o,range:s})=>{o.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:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().deleteRange(s).setColumns().focus(o.state.selection.head-1).run()}}]}];if(T0(t,"iframes")){const o=AX;n.push({name:"others",title:e("editor.slash.embed"),commands:o.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 MX={key:0,class:"grid grid-cols-1 gap-0.5 min-w-48"},BX={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"},IX=["onClick"],RX=["src"],LX={key:1,class:"p-3"},PX={class:"text-xs text-gray-800 dark:text-gray-100"},DX=i.defineComponent({__name:"CommandsList",props:{editor:{},items:{default:void 0},command:{type:Function,default:void 0}},setup(t,{expose:e}){const n=i.ref(0),r=i.ref(0),o=i.ref(null),{t:s}=At(),a=i.ref([]),l=t;e({onKeyDown:u}),i.watch([()=>n.value,()=>r.value],async()=>{if(!o.value)return;await i.nextTick();const v=r.value*1e3+n.value,w=a.value[v];w&&w.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,w=r.value;v<0&&(w=r.value-1,v=((x=l.items[w])==null?void 0:x.commands.length)-1||0),w<0&&(w=l.items.length-1,v=l.items[w].commands.length-1),n.value=v,r.value=w}function f(){if(!l.items.length)return!1;const v=l.items[r.value].commands;let w=n.value+1,x=r.value;v.length-1<w&&(w=0,x=r.value+1),l.items.length-1<x&&(x=0),n.value=w,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,w){const x=l.items[v].commands[w];l.command(x)}function g(v,w){m(v,w)}function b(v,w,x){a.value[v*1e3+w]=x}return(v,w)=>{var x;return i.openBlock(),i.createElementBlock("div",{ref_key:"scrollContainer",ref:o,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?(i.openBlock(),i.createElementBlock("div",MX,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(v.items,(E,S)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:E.title},[i.createElementVNode("div",BX,i.toDisplayString(E.title),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.commands,(C,_)=>(i.openBlock(),i.createElementBlock("button",{ref_for:!0,ref:T=>b(S,_,T),key:_,class:i.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===S&&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(S,_)},[C.iconUrl?(i.openBlock(),i.createElementBlock("img",{key:0,class:"w-6 h-6",src:C.iconUrl},null,8,RX)):i.createCommentVNode("",!0),C.iconName?(i.openBlock(),i.createBlock(i.unref(jt),{key:1,name:C.iconName,class:"mr-1 text-lg"},null,8,["name"])):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(C.label),1)],10,IX))),128))],64))),128))])):(i.openBlock(),i.createElementBlock("div",LX,[i.createElementVNode("span",PX,i.toDisplayString(i.unref(s)("editor.slash.empty")),1)]))],512)}}}),ca="slashCommand";let Rt;const VX=Ze.create({name:ca,priority:200,onCreate(){Rt=Fs("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[xX({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new St(ca),allow:({state:t,range:e})=>{var c,f,p;const n=t.doc.resolve(e.from),r=n.depth===1,o=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&&o&&s||a&&o&&s)&&u},command:({editor:t,range:e,props:n})=>{const{view:r}=t;n.action({editor:t,range:e}),r.focus()},items:({query:t})=>OX(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 ow(DX,{props:n,editor:n.editor});const{view:r}=n.editor,o=()=>{if(!n.clientRect)return n.editor.storage[ca].rect;const a=n.clientRect();if(!a)return n.editor.storage[ca].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=()=>{Rt==null||Rt[0].setProps({getReferenceClientRect:o})},(s=r.dom.parentElement)==null||s.addEventListener("scroll",e),t.element&&(Rt==null||Rt[0].setProps({getReferenceClientRect:o,appendTo:()=>document.body,content:t.element})),Rt==null||Rt[0].show()},onUpdate(n){var a;t.updateProps(n);const{view:r}=n.editor,o=()=>{if(!n.clientRect)return n.editor.storage[ca].rect;const l=n.clientRect();return l?new DOMRect(l.x,l.y,l.width,l.height):n.editor.storage[ca].rect},s=()=>{Rt==null||Rt[0].setProps({getReferenceClientRect:o})};(a=r.dom.parentElement)==null||a.addEventListener("scroll",s),n.editor.storage[ca].rect=n.clientRect?o():{width:0,height:0,left:0,top:0,right:0,bottom:0},Rt==null||Rt[0].setProps({getReferenceClientRect:o})},onKeyDown(n){var r;return n.event.key==="Escape"?(Rt==null||Rt[0].hide(),!0):(Rt!=null&&Rt[0].state.isShown||Rt==null||Rt[0].show(),(r=t.ref)==null?void 0:r.onKeyDown(n))},onExit(n){var r;if(Rt==null||Rt[0].hide(),e){const{view:o}=n.editor;(r=o.dom.parentElement)==null||r.removeEventListener("scroll",e)}t.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}});function FX(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}const XE=Bt.create({name:"video",group:"block",atom:!0,draggable:!0,addAttributes(){return{src:{default:null,renderHTML:({src:t})=>({src:t?FX(t):null})},width:{default:this.options.width,renderHTML:({width:t})=>({width:an(t)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"video"}]},renderHTML({HTMLAttributes:t}){const{src:e,width:n="100%"}=t??{};return["video",{src:e?e.replace(/\\/g,"/"):"",controls:!0,style:`max-width: ${an(n)}; height: auto;`}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),updateVideo:t=>({commands:e})=>e.updateAttributes(this.name,t)}},addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,width:Ld["size-medium"],HTMLAttributes:{class:"iframe-wrapper",style:"display: flex;justify-content: center;"}}}}),$X=1,zX=1e6,fi={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let kb=0;function HX(){return kb=(kb+1)%Number.MAX_VALUE,kb.toString()}const _b=new Map;function YE(t){if(_b.has(t))return;const e=setTimeout(()=>{_b.delete(t),dc({type:fi.REMOVE_TOAST,toastId:t})},zX);_b.set(t,e)}const fo=i.ref({toasts:[]});function dc(t){switch(t.type){case fi.ADD_TOAST:fo.value.toasts=[t.toast,...fo.value.toasts].slice(0,$X);break;case fi.UPDATE_TOAST:fo.value.toasts=fo.value.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e);break;case fi.DISMISS_TOAST:{const{toastId:e}=t;e?YE(e):fo.value.toasts.forEach(n=>{YE(n.id)}),fo.value.toasts=fo.value.toasts.map(n=>n.id===e||e===void 0?{...n,open:!1}:n);break}case fi.REMOVE_TOAST:t.toastId===void 0?fo.value.toasts=[]:fo.value.toasts=fo.value.toasts.filter(e=>e.id!==t.toastId);break}}function Tb(){return{toasts:i.computed(()=>fo.value.toasts),toast:UX,dismiss:t=>dc({type:fi.DISMISS_TOAST,toastId:t})}}function UX(t){const e=HX(),n=o=>dc({type:fi.UPDATE_TOAST,toast:{...o,id:e}}),r=()=>dc({type:fi.DISMISS_TOAST,toastId:e});return dc({type:fi.ADD_TOAST,toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}const WX=i.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=vn(),{toast:r}=Tb();function o(){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)=>(i.openBlock(),i.createBlock(qe,{action:o,title:"AI",disabled:s.disabled,icon:s.icon,tooltip:s.tooltip},null,8,["disabled","icon","tooltip"]))}}),jX=Bt.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:WX,componentProps:{icon:"Sparkles",tooltip:n("editor.AI.ask")}})}}});function qX(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 o=new Uint8Array(r);return new Blob([o],{type:e})}function KX(t,e){return new File([t],e,{type:t.type})}const GX=Ze.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:qe,componentProps:{action:()=>{var o;return(o=e.commands)==null?void 0:o.toggleImportWord()},disabled:!e.can().setHorizontalRule(),icon:"Word",tooltip:r("editor.importWord.tooltip")}})}},addCommands(){return{toggleImportWord:()=>({chain:t,editor:e})=>{const{toast:n}=Tb(),{t:r}=At();async function o(u){var g;const f=new DOMParser().parseFromString(u,"text/html"),p=f.querySelectorAll("img");if(!p.length)return f.body.innerHTML;if(T0(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"),S=qX(E,"image/jpeg"),C=KX(S,"image.jpeg");v.push(C)}const w=await b.upload(v);for(let x=0;x<p.length;x++){const E=p[x];E.setAttribute("src",w[x].src);const S=E.parentElement;(S==null?void 0:S.tagName)==="P"&&(S.insertAdjacentElement("beforebegin",E),!S.hasChildNodes()&&S.textContent===""&&S.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 o(u);e.chain().setContent(c.toString(),!0).run(),n({title:r("editor.importWord.success")})}const{open:a,onChange:l}=pt.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}}}}),zp=i.defineComponent({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:r,...o}=e;return o});return(r,o)=>(i.openBlock(),i.createBlock(i.unref(NP),i.mergeProps({class:i.unref(Ae)("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:i.withCtx(()=>[i.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),kl=new St("upload-image"),XX=()=>new Ne({key:kl,state:{init(){return ht.empty},apply(t,e){e=e.map(t.mapping,t.doc);const n=t.getMeta(kl);return n!=null&&n.add?n.add.forEach(({id:r,pos:o,src:s})=>{const a=YX(s),l=Wt.widget(o,a,{id:r});e=e.add(t.doc,[l])}):n!=null&&n.remove&&n.remove.forEach(r=>{e=e.remove(e.find(void 0,void 0,o=>o.id===r))}),e}},props:{decorations(t){return this.getState(t)}}});function YX(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 JX(t,e){var o;const r=kl.getState(t).find(void 0,void 0,s=>s.id===e);return r.length?(o=r[0])==null?void 0:o.from:null}const JE=({validateFn:t,onUpload:e})=>(n,r,o,s)=>{n.forEach(a=>{if(t&&!t(a))return;s||(s=Ni(6));const l=r.state.tr;l.selection.empty||l.deleteSelection();let u=null;r.state.doc.descendants((p,m)=>{p.type.name===ds&&p.attrs.id===s&&(u=m)});const c=URL.createObjectURL(a);l.setMeta(kl,{add:[{id:s,pos:o,src:c}]}),r.dispatch(l);const f=JX(r.state,s)||u;e(a).then(p=>{var w;const{schema:m}=r.state;if(f===null)throw new Error("Not found placeholderPos");const g=typeof p=="object"?c:p,b=(w=m.nodes.image)==null?void 0:w.create({src:g});if(!b)return;const v=r.state.tr.replaceWith(f,f,b).setMeta(kl,{remove:[s]});r.dispatch(v)},()=>{const p=r.state.tr.delete(o,o).setMeta(kl,{remove:[s]});r.dispatch(p)})})},ZX=(t,e,n)=>{var o;const r=Array.from(((o=e.clipboardData)==null?void 0:o.files)||[]);if(r.length){e.preventDefault();const s=t.state.selection.from;return n(r,t,s+1),!0}return!1},QX=(t,e,n,r)=>{var s;const o=Array.from(((s=e.dataTransfer)==null?void 0:s.files)||[]);if(!n&&o.length){e.preventDefault();const a=t.posAtCoords({left:e.clientX,top:e.clientY});if(a)return r(o,t,a.pos+1),!0}return!1},NX={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"},eY={class:"flex items-center justify-between w-full"},tY={class:"flex items-center justify-center gap-3"},nY={class:"text-sm"},rY={class:"flex items-center gap-2"},oY=i.defineComponent({__name:"ImageUploader",props:{...zs},setup(t){const e=t,n=i.ref(""),r=i.ref(),{t:o}=At(),s=i.inject("isEditable",i.ref(!0));function a(f){var v,w;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=p[0],g=(w=e.editor.extensionManager.extensions.find(x=>x.name==="imageUpload"))==null?void 0:w.options;JE({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()}).focus().run()}function u(){s.value&&e.deleteNode()}function c(){var f;(f=r.value)==null||f.click()}return(f,p)=>(i.openBlock(),i.createBlock(i.unref($s),{id:f.node.attrs.id,class:"p-0 m-0","data-drag-handle":""},{default:i.withCtx(()=>[i.createVNode(i.unref(ul),{"default-open":"",modal:""},{default:i.withCtx(()=>[i.createVNode(i.unref(fl),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",NX,[i.createElementVNode("div",eY,[i.createElementVNode("div",tY,[i.createVNode(i.unref(jt),{name:"ImageUp",class:"w-6 h-6"}),i.createElementVNode("span",nY,i.toDisplayString(i.unref(o)("editor.image.dialog.title")),1)]),i.createVNode(i.unref(jt),{name:"Trash2",class:"hover:text-ed-foreground",onClick:i.withModifiers(u,["stop"])})])])]),_:1}),i.unref(s)?(i.openBlock(),i.createBlock(i.unref(cl),{key:0,"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:i.withCtx(()=>[i.createVNode(i.unref(F1),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:i.withCtx(()=>[i.createVNode(i.unref($1),{class:"grid w-full grid-cols-2"},{default:i.withCtx(()=>[i.createVNode(i.unref($u),{value:"upload"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.upload")),1)]),_:1}),i.createVNode(i.unref($u),{value:"link"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.url")),1)]),_:1})]),_:1}),i.createVNode(i.unref(zp),{value:"upload"},{default:i.withCtx(()=>[i.createVNode(i.unref(_n),{class:"w-full mt-1",size:"sm",onClick:c},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.upload")),1)]),_:1}),i.createElementVNode("input",{ref_key:"fileInput",ref:r,type:"file",accept:"image/*",multiple:"",style:{display:"none"},onChange:a},null,544)]),_:1}),i.createVNode(i.unref(zp),{value:"link"},{default:i.withCtx(()=>[i.createElementVNode("div",rY,[i.createVNode(i.unref(dl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:i.unref(o)("editor.image.dialog.placeholder")},null,8,["modelValue","placeholder"]),i.createVNode(i.unref(_n),{onClick:l},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])):i.createCommentVNode("",!0)]),_:1})]),_:1},8,["id"]))}}),iY={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5},sY=t=>`${(t/1024/1024).toFixed(2)}MB`,aY=Bt.create({name:"imageUpload",isolating:!0,defining:!0,group:"block",draggable:!1,selectable:!0,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:Ni(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 Hs(oY)},addOptions(){var t;return{...iY,...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:e,extension:n,t:r})=>{var o,s;return{component:qe,componentProps:{action:()=>e.commands.setImageUpload(),disabled:!((s=(o=e.can()).setImage)!=null&&s.call(o,{})),icon:"ImageUp",tooltip:r("editor.image.tooltip")}}}}},addProseMirrorPlugins(){const{toast:t}=Tb(),{t:e}=At(),r=JE({validateFn:o=>this.options.acceptMimes.includes(o.type)?o.size>this.options.maxSize?(t({description:`${e("editor.imageUpload.fileSizeTooBig")} ${sY(this.options.maxSize)}.`,duration:2e3}),!1):!0:(t({description:e("editor.imageUpload.fileTypeNotSupported"),duration:2e3}),!1),onUpload:this.options.upload});return[new Ne({props:{handlePaste:(o,s)=>!s.clipboardData||Array.from(s.clipboardData.items||[]).some(l=>l.type==="text/html")?!1:ZX(o,s,r),handleDrop:(o,s,a,l)=>(!(s instanceof DragEvent)||!s.dataTransfer||QX(o,s,l,r),!1)}}),XX()]}}),lY={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"},uY={key:0,class:"flex justify-center items-center gap-3 text-s"},cY={key:1,class:"flex justify-between items-center w-full"},dY={class:"flex justify-center items-center gap-3"},fY={class:"text-sm"},pY={class:"flex items-center gap-2"},hY=i.defineComponent({__name:"VideoUploader",props:{...zs},setup(t){const e=t,n=i.ref(""),r=i.ref(!1),o=i.ref(),{t:s}=At();function a(f){var b,v;r.value=!0;const p=(b=f==null?void 0:f.target)==null?void 0:b.files;if(!e.editor||e.editor.isDestroyed||p.length===0)return;const m=p[0],g=(v=e.editor.extensionManager.extensions.find(w=>w.name==="videoUpload"))==null?void 0:v.options;g==null||g.upload([m]).then(w=>{e.editor.chain().setVideo({src:w[0].src,width:"100%"}).deleteRange({from:e.getPos(),to:e.getPos()}).focus().run(),r.value=!1})}function l(){e.editor.chain().setVideo({src:n.value,width:"100%"}).deleteRange({from:e.getPos(),to:e.getPos()}).focus().run()}function u(){e.deleteNode()}function c(){var f;(f=o.value)==null||f.click()}return(f,p)=>(i.openBlock(),i.createBlock(i.unref($s),{as:"div","data-drag-handle":""},{default:i.withCtx(()=>[i.createVNode(i.unref(ul),{"default-open":"",modal:""},{default:i.withCtx(()=>[i.createVNode(i.unref(fl),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",lY,[r.value?(i.openBlock(),i.createElementBlock("div",uY,[i.createVNode(i.unref(jt),{class:"animate-spin w-6 h-6",name:"LoaderCircle"}),i.createElementVNode("span",null,i.toDisplayString(i.unref(s)("editor.video.dialog.uploading"))+"...",1)])):(i.openBlock(),i.createElementBlock("div",cY,[i.createElementVNode("div",dY,[i.createVNode(i.unref(jt),{name:"Video",class:"w-6 h-6"}),i.createElementVNode("span",fY,i.toDisplayString(i.unref(s)("editor.video.dialog.title")),1)]),i.createVNode(i.unref(jt),{name:"Trash2",class:"hover:text-ed-foreground",onClick:i.withModifiers(u,["stop"])})]))])]),_:1}),i.createVNode(i.unref(cl),{"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:i.withCtx(()=>[i.createVNode(i.unref(F1),{"default-value":"upload",class:"w-[400px]","activation-mode":"manual"},{default:i.withCtx(()=>[i.createVNode(i.unref($1),{class:"grid w-full grid-cols-2"},{default:i.withCtx(()=>[i.createVNode(i.unref($u),{value:"upload"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1}),i.createVNode(i.unref($u),{value:"link"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.link")),1)]),_:1})]),_:1}),i.createVNode(i.unref(zp),{value:"upload"},{default:i.withCtx(()=>[i.createVNode(i.unref(_n),{class:"w-full mt-1",size:"sm",onClick:c},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1}),i.createElementVNode("input",{ref_key:"fileInput",ref:o,type:"file",accept:"video/*",multiple:"",style:{display:"none"},onChange:a},null,544)]),_:1}),i.createVNode(i.unref(zp),{value:"link"},{default:i.withCtx(()=>[i.createElementVNode("form",{onSubmit:i.withModifiers(l,["prevent"])},[i.createElementVNode("div",pY,[i.createVNode(i.unref(dl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:i.unref(s)("editor.video.dialog.placeholder")},null,8,["modelValue","placeholder"]),i.createVNode(i.unref(_n),{type:"submit"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.button.apply")),1)]),_:1})])],32)]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1})]),_:1}))}}),mY=Bt.create({name:"videoUpload",isolating:!0,defining:!0,group:"block",draggable:!0,selectable:!0,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 Hs(hY)},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:void 0,button:({editor:e,t:n})=>({component:qe,componentProps:{action:()=>e.commands.setVideoUpload(),isActive:()=>e.isActive("video")||!1,disabled:!e.can().setVideo({}),icon:"Video",tooltip:n("editor.video.tooltip")}})}}}),Ab=vn(),gY=Ze.create({name:"preview",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:qe,componentProps:{icon:"Eye",action:()=>{Ab.togglePreview()},tooltip:e("editor.preview.tooltip"),isActive:()=>Ab.state.showPreview}})}},addCommands(){return{togglePreview:()=>()=>(Ab.togglePreview(),!0)}}}),ZE=vn(),bY=(t,e,n)=>RegExp(e?t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):t,n?"gu":"gui");function vY(t,e,n,r){const o=[],s=[];let a=[],l=0;if(!e)return{decorationsToReturn:ht.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});o.push(p)}return{decorationsToReturn:ht.create(t,o),results:s}}const yY=(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))},wY=(t,e,n,r)=>{const o=e+1;if(!r[o])return null;const{from:s,to:a}=r[e],l=a-s-t.length+n,{from:u,to:c}=r[o];return r[o]={to:c-l,from:u-l},[l,r]},xY=(t,e,{tr:n,dispatch:r})=>{let o=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=wY(t,a,o,s);c&&(o=c[0],s=c[1])}r&&r(n)}},CY=new St("findAndReplacePlugin"),EY=Ze.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:qe,componentProps:{icon:"DocSearch",tooltip:r("editor.findAndReplace.tooltip"),action:()=>{ZE.toggleFindAndReplace()},isActive:()=>ZE.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:o}=t.storage.findAndReplace;return yY(r,o,{state:e,dispatch:n}),!1},replaceAll:()=>({editor:t,tr:e,dispatch:n})=>{const{replaceTerm:r,results:o}=t.storage.findAndReplace;return xY(r,o,{tr:e,dispatch:n}),!1}}},addProseMirrorPlugins(){const t=this.editor,{searchResultClass:e,disableRegex:n}=this.options,r=a=>t.storage.findAndReplace.lastSearchTerm=a,o=a=>t.storage.findAndReplace.lastCaseSensitive=a,s=a=>t.storage.findAndReplace.lastResultIndex=a;return[new Ne({key:CY,state:{init:()=>ht.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),o(p),s(g),!c)return t.storage.findAndReplace.results=[],ht.empty;const{decorationsToReturn:v,results:w}=vY(a,bY(c,n,p),e,g);return t.storage.findAndReplace.results=w,v}},props:{decorations(a){return this.getState(a)}}})]}}),{togglePrinter:SY,state:kY}=vn(),_Y=Ze.create({name:"printer",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:qe,componentProps:{tooltip:e("editor.printer.tooltip"),action:()=>SY(),icon:"Printer",shortcutKeys:["mod","P"],isActive:()=>kY.printer}})}}}),Ob="spell-check";class TY{constructor(e,n,r,o=1e3){Gt(this,"debouncedGetMatchAndSetDecorations",tt.debounce(this.getMatchAndSetDecorations.bind(this),300));Gt(this,"debouncedGetMatchAndSetDecorationsList",tt.debounce(this.getMatchAndSetDecorationsList.bind(this),300));Gt(this,"debouncedClickEventsListener",tt.debounce(this.clickEventsListener.bind(this),0));Gt(this,"debouncedAcceptSuggestionEventsListener",tt.debounce(this.acceptSuggestionListener.bind(this),0));Gt(this,"debouncedProofreadChangedNodes",tt.debounce(this.proofreadChangedNodes.bind(this),300));Gt(this,"proofreader");Gt(this,"uiStrings");Gt(this,"showSuggestionsEvent");Gt(this,"decorationSet");Gt(this,"editorView");Gt(this,"isInitialProofreadingDone",!1);Gt(this,"lastOriginalFrom",0);Gt(this,"lastClickedDecoration",null);Gt(this,"suggestionBox");Gt(this,"isEnableSuggestion");Gt(this,"isMobile");Gt(this,"limit",1e3);Gt(this,"_debouncedProofreadDoc",tt.debounce((e,n)=>{this.proofreadDoc(e),n&&n()},500));Gt(this,"_debouncedHandleEnterKey",tt.debounce((e,n,r)=>{this.handleEnterKey(e,n),r&&r()},500));this.proofreader=e,this.uiStrings=n,this.showSuggestionsEvent=r,this.decorationSet=ht.empty,this.limit=o,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 o=[],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)===Rp&&(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)&&(o.push({node:b,pos:v}),s.add(v)),b.type.name===Rp&&(a=!0))})}),{changedNodes:o,isChangedSuperText:a}}debouncedProofreadDoc(e,n){this._debouncedProofreadDoc(e,n)}isSuperTextAlone(e,n){let r=!1;return e.descendants((o,s,a)=>o===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!==Rp}),n=n.filter(Boolean);let o="",s=1;for(const{text:u,from:c,to:f}of n){const p=c-s;p>0&&(o+=Array(p+1).join(`
|
|
276
|
+
`,tooltip:"수퍼 보기"}}]}},addAttributes(){return{[ot.ID]:{default:null},[ot.TEXT]:{default:""},[ot.POSITION]:{default:"0"},[ot.ELEMENT_ID]:{default:""}}},addCommands(){return{toggleSuperText:t=>({editor:e})=>t?e.storage.superText.toggleSuperViewMobileCallBack():e.storage.superText.enable=!e.storage.superText.enable,toggleSuperInputMoblie:()=>({editor:t})=>t.storage.superText.isShowSuperInputMoblie=!t.storage.superText.isShowSuperInputMoblie}},parseHTML(){return[{tag:"button.super-text"}]},renderHTML({HTMLAttributes:t}){return["button",gt(t,{class:"super-text"})]},addNodeView(){return Hs(IK)},addProseMirrorPlugins(){return[new Ne({appendTransaction(t,e,n){let r=n.tr,o=!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}),o=!0)}}),o?r:null}}),new Ne({filterTransaction(t,e){return t.steps.some(r=>{if(r.toJSON&&r.toJSON().stepType==="replace"){const o=r.toJSON();return o.slice&&o.slice.content&&o.slice.content.some(s=>s.type===Rp)}return!1})&&t.setMeta(vE.UPDATE,!0),!0}}),RK]}}),LK=["innerHTML"],PK=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","line-id"],DK=i.defineComponent({__name:"ConfigPlan",props:zs,setup(t){const e=t,n=i.ref(!1),r=i.ref(null),{selection:o,doc:s}=e.editor.state,a=i.inject("isMobile"),l=i.ref(!1),u=pt.useEventBus(ir.RENDER_SUPER_TEXT),c=i.computed(()=>{var _,T;const x=s.resolve(o.from),E=x==null?void 0:x.node(-1),S=(_=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:S,pageNumber:C}}),f=i.computed(()=>{const x=e.getPos(),E=e.editor.state.doc.resolve(x);for(let S=E.depth;S>0;S--){const C=E.node(S);if(C.type.name==="paragraph")return C}return null}),p=i.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],S=e.node.attrs[ot.ID],_={lineId:x.target.querySelector(`[node-id="${S}"]`).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:S}=e,C=x(),_=C+1;S.commands.deleteRange({from:C,to:_})}function w(){n.value=!0,a&&(l.value=!0)}return(x,E)=>{const S=_n,C=kp,_=Sp,T=Ep,A=Cp,L=uc;return i.openBlock(),i.createBlock(i.unref($s),{as:"span",class:i.normalizeClass(["w-fit text-inherit super-text align-middle",{"!leading-[9px] [&_*]:!leading-[9px]":i.unref(a)}]),"data-drag-handle":"",draggable:"true",contenteditable:"false"},{default:i.withCtx(()=>[i.createVNode(A,null,{default:i.withCtx(()=>[i.createVNode(C,{as:"template",class:"relative"},{default:i.withCtx(()=>[i.createVNode(S,{variant:"ghost",class:"!p-0 !m-0 !h-fit font-normal !text-ed-blue",onClick:w,onMouseenter:g,onMouseleave:b},{default:i.withCtx(()=>[i.createVNode(i.unref(jt),{name:"plan",class:i.normalizeClass({"w-[18px] h-auto pr-1":i.unref(a)})},null,8,["class"]),E[3]||(E[3]=i.createTextVNode(" [")),i.createElementVNode("span",{class:"[&_*]:inline",innerHTML:e.node.attrs[i.unref(ot).TEXT]},null,8,LK),E[4]||(E[4]=i.createTextVNode("] ")),i.createElementVNode("div",{ref_key:"bookMarkRef",ref:r,"book-mark-node-id":e.node.attrs[i.unref(ot).ID],"page-id":c.value.pageId,"page-number":c.value.pageNumber,"book-mark-content":e.node.attrs[i.unref(ot).TEXT],"node-id":e.node.attrs[i.unref(ot).ID],"line-id":p.value},null,8,PK)]),_:1})]),_:1}),i.createVNode(T,null,{default:i.withCtx(()=>[i.createVNode(_,{onSelect:E[0]||(E[0]=R=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.$t("editor.configPlan.edit")),1)]),_:1}),i.createVNode(_,{onSelect:v},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.$t("editor.configPlan.delete")),1)]),_:1})]),_:1})]),_:1}),i.unref(a)?(i.openBlock(),i.createBlock(Ip,{key:1,title:x.$t("editor.configPlan"),open:n.value,"is-view-mode":l.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(ot).TEXT],"super-text-id":e.node.attrs[i.unref(ot).ID],onClose:E[2]||(E[2]=R=>n.value=!1),onSave:m,onDelete:v},null,8,["title","open","is-view-mode","editor","super-text-init","super-text-id"])):(i.openBlock(),i.createBlock(L,{key:0,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(ot).TEXT],"super-text-element-id":e.node.attrs[i.unref(ot).ELEMENT_ID],onClose:E[1]||(E[1]=R=>n.value=!1),onSave:m},null,8,["open","editor","super-text-init","super-text-element-id"]))]),_:1},8,["class"])}}}),wE=Bt.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:qe,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",gt(t,{class:"config-plan"})]},addNodeView(){return Hs(DK)},addProseMirrorPlugins(){return[new Ne({appendTransaction(t,e,n){let r=n.tr,o=!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}),o=!0)}}),o?r:null}})]}});var mb,gb;if(typeof WeakMap<"u"){let t=new WeakMap;mb=e=>t.get(e),gb=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;mb=r=>{for(let o=0;o<t.length;o+=2)if(t[o]==r)return t[o+1]},gb=(r,o)=>(n==10&&(n=0),t[n++]=r,t[n++]=o)}var rn=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,o=e/this.width|0;let s=r+1,a=o+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:o,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:o,top:s,bottom:a}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[s*this.width+(n<0?r-1:o)]:(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:o,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(o,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 o=t.left;o<t.right;o++){const s=r*this.width+o,a=this.map[s];n[a]||(n[a]=!0,!(o==t.left&&o&&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,o=0;;r++){const s=o+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]<o;)a++;return a==l?s-1:this.map[a]}o=s}}static get(t){return mb(t)||gb(t,VK(t))}};function VK(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=FK(t),n=t.childCount,r=[];let o=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(;o<r.length&&r[o]!=0;)o++;if(b==p.childCount)break;const v=p.child(b),{colspan:w,rowspan:x,colwidth:E}=v.attrs;for(let S=0;S<x;S++){if(S+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:f,n:x-S});break}const C=o+S*e;for(let _=0;_<w;_++){r[C+_]==0?r[C+_]=f:(s||(s=[])).push({type:"collision",row:c,pos:f,n:w-_});const T=E&&E[_];if(T){const A=(C+_)%e*2,L=a[A];L==null||L!=T&&a[A+1]==1?(a[A]=T,a[A+1]=1):L==T&&a[A+1]++}}}o+=w,f+=v.nodeSize}const m=(c+1)*e;let g=0;for(;o<m;)r[o++]==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 rn(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&&$K(l,a,t),l}function FK(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=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<o.childCount;a++){const l=o.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 $K(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const s=t.map[o];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=(o+c)%t.width,p=e[f*2];p!=null&&(!u.colwidth||u.colwidth[c]!=p)&&((l||(l=zK(u)))[c]=p)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function zK(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Fn(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var fs=new St("selectingCells");function Sl(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 HK(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 Lp(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=Sl(e.$head)||UK(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function UK(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 bb(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function WK(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function vb(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function xE(t,e,n){const r=t.node(-1),o=rn.get(r),s=t.start(-1),a=o.nextCell(t.pos-s,e,n);return a==null?null:t.node(0).resolve(s+a)}function la(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(o=>o>0)||(r.colwidth=null)),r}function CE(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function jK(t,e,n){const r=Fn(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var Ft=class ki extends Ve{constructor(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.rectBetween(e.pos-s,n.pos-s),l=e.node(0),u=o.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 cy(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)),o=e.resolve(n.map(this.$headCell.pos));if(bb(r)&&bb(o)&&vb(r,o)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?ki.rowSelection(r,o):s&&this.isColSelection()?ki.colSelection(r,o):new ki(r,o)}return Be.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=rn.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},a=[];for(let u=o.top;u<o.bottom;u++){const c=[];for(let f=u*n.width+o.left,p=o.left;p<o.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=o.left-g.left,w=g.right-o.right;if(v>0||w>0){let x=b.attrs;if(v>0&&(x=la(x,0,v)),w>0&&(x=la(x,x.colspan-w,w)),g.left<o.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<o.top||g.bottom>o.bottom){const x={...b.attrs,rowspan:Math.min(g.bottom,o.bottom)-Math.max(g.top,o.top)};g.top<o.top?b=b.type.createAndFill(x):b=b.type.create(x,b.content)}c.push(b)}a.push(e.child(u).copy(ce.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:a;return new Ce(ce.from(l),1,1)}replace(e,n=Ce.empty){const r=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){const{$from:l,$to:u}=o[a],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(u.pos),a?Ce.empty:n)}const s=Ve.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new Ce(ce.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=rn.get(n),o=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let a=0;a<s.length;a++)e(n.nodeAt(s[a]),o+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,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.findCell(e.pos-s),l=o.findCell(n.pos-s),u=e.node(0);return a.top<=l.top?(a.top>0&&(e=u.resolve(s+o.map[a.left])),l.bottom<o.height&&(n=u.resolve(s+o.map[o.width*(o.height-1)+l.right-1]))):(l.top>0&&(n=u.resolve(s+o.map[l.left])),a.bottom<o.height&&(e=u.resolve(s+o.map[o.width*(o.height-1)+a.right-1]))),new ki(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=rn.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(o,s)>0)return!1;const a=o+this.$anchorCell.nodeAfter.attrs.colspan,l=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,l)==n.width}eq(e){return e instanceof ki&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.findCell(e.pos-s),l=o.findCell(n.pos-s),u=e.node(0);return a.left<=l.left?(a.left>0&&(e=u.resolve(s+o.map[a.top*o.width])),l.right<o.width&&(n=u.resolve(s+o.map[o.width*(l.top+1)-1]))):(l.left>0&&(n=u.resolve(s+o.map[l.top*o.width])),a.right<o.width&&(e=u.resolve(s+o.map[o.width*(a.top+1)-1]))),new ki(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new ki(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new ki(e.resolve(n),e.resolve(r))}getBookmark(){return new qK(this.$anchorCell.pos,this.$headCell.pos)}};Ft.prototype.visible=!1,Ve.jsonID("cell",Ft);var qK=class __{constructor(e,n){this.anchor=e,this.head=n}map(e){return new __(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&&vb(n,r)?new Ft(n,r):Ve.near(r,1)}};function KK(t){if(!(t.selection instanceof Ft))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Wt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),ht.create(t.doc,e)}function GK({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,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(o).type.spec.tableRole)}function XK({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const s=t.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let o=e.depth;o>0;o--){const s=e.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function YK(t,e,n){const r=(e||t).selection,o=(e||t).doc;let s,a;if(r instanceof Pe&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")s=Ft.create(o,r.from);else if(a=="row"){const l=o.resolve(r.from+1);s=Ft.rowSelection(l,l)}else if(!n){const l=rn.get(r.node),u=r.from+1,c=u+l.map[l.width*l.height-1];s=Ft.create(o,u+1,c)}}else r instanceof Be&&GK(r)?s=Be.create(o,r.from):r instanceof Be&&XK(r)&&(s=Be.create(o,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var JK=new St("fix-tables");function EE(t,e,n,r){const o=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(o,a+3);c<f;c++)if(t.child(c)==u){l=c+1,n+=u.nodeSize;continue e}r(u,n),l<o&&t.child(l).sameMarkup(u)?EE(t.child(l),u,n+1,r):u.nodesBetween(0,u.content.size,r,n+1),n+=u.nodeSize}}function SE(t,e){let n;const r=(o,s)=>{o.type.spec.tableRole=="table"&&(n=ZK(t,o,s,n))};return e?e.doc!=t.doc&&EE(e.doc,t.doc,0,r):t.doc.descendants(r),n}function ZK(t,e,n,r){const o=rn.get(e);if(!o.problems)return r;r||(r=t.tr);const s=[];for(let u=0;u<o.height;u++)s.push(0);for(let u=0;u<o.problems.length;u++){const c=o.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,la(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<o.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 w=0;w<m;w++){const x=Fn(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(JK,{fixTables:!0})}function Fo(t){const e=t.selection,n=Lp(t),r=n.node(-1),o=n.start(-1),s=rn.get(r);return{...e instanceof Ft?s.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):s.findCell(n.pos-o),tableStart:o,map:s,table:r}}function kE(t,{map:e,tableStart:n,table:r},o){let s=o>0?-1:0;jK(e,r,o+s)&&(s=o==0||o==e.width?null:0);for(let a=0;a<e.height;a++){const l=a*e.width+o;if(o>0&&o<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,CE(c.attrs,o-e.colCount(u))),a+=c.attrs.rowspan-1}else{const u=s==null?Fn(r.type.schema).cell:r.nodeAt(e.map[l+s]).type,c=e.positionAt(a,o,r);t.insert(t.mapping.map(n+c),u.createAndFill())}}return t}function QK(t,e){if(!co(t))return!1;if(e){const n=Fo(t);e(kE(t.tr,n,n.left))}return!0}function NK(t,e){if(!co(t))return!1;if(e){const n=Fo(t);e(kE(t.tr,n,n.right))}return!0}function eG(t,{map:e,table:n,tableStart:r},o){const s=t.mapping.maps.length;for(let a=0;a<e.height;){const l=a*e.width+o,u=e.map[l],c=n.nodeAt(u),f=c.attrs;if(o>0&&e.map[l-1]==u||o<e.width-1&&e.map[l+1]==u)t.setNodeMarkup(t.mapping.slice(s).map(r+u),null,la(f,o-e.colCount(u)));else{const p=t.mapping.slice(s).map(r+u);t.delete(p,p+c.nodeSize)}a+=f.rowspan}}function tG(t,e){if(!co(t))return!1;if(e){const n=Fo(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;eG(r,n,o),o!=n.left;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=rn.get(s)}e(r)}return!0}function nG(t,e,n){var r;const o=Fn(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)!=o)return!1;return!0}function _E(t,{map:e,tableStart:n,table:r},o){var s;let a=n;for(let c=0;c<o;c++)a+=r.child(c).nodeSize;const l=[];let u=o>0?-1:0;nG(e,r,o+u)&&(u=o==0||o==e.height?null:0);for(let c=0,f=e.width*o;c<e.width;c++,f++)if(o>0&&o<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?Fn(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,Fn(r.type.schema).row.create(null,l)),t}function rG(t,e){if(!co(t))return!1;if(e){const n=Fo(t);e(_E(t.tr,n,n.top))}return!0}function oG(t,e){if(!co(t))return!1;if(e){const n=Fo(t);e(_E(t.tr,n,n.bottom))}return!0}function iG(t,{map:e,table:n,tableStart:r},o){let s=0;for(let c=0;c<o;c++)s+=n.child(c).nodeSize;const a=s+n.child(o).nodeSize,l=t.mapping.maps.length;t.delete(s+r,a+r);const u=new Set;for(let c=0,f=o*e.width;c<e.width;c++,f++){const p=e.map[f];if(!u.has(p)){if(u.add(p),o>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(o<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(o+1,c,n);t.insert(t.mapping.slice(l).map(r+v),b),c+=g.colspan-1}}}}function sG(t,e){if(!co(t))return!1;if(e){const n=Fo(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;iG(r,n,o),o!=n.top;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=rn.get(n.table)}e(r)}return!0}function TE(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function aG({width:t,height:e,map:n},r){let o=r.top*t+r.left,s=o,a=(r.bottom-1)*t+r.left,l=o+(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[o]==n[o-t]||r.bottom<e&&n[a]==n[a+t])return!0;o++,a++}return!1}function AE(t,e){const n=t.selection;if(!(n instanceof Ft)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Fo(t),{map:o}=r;if(aG(o,r))return!1;if(e){const s=t.tr,a={};let l=ce.empty,u,c;for(let f=r.top;f<r.bottom;f++)for(let p=r.left;p<r.right;p++){const m=o.map[f*o.width+p],g=r.table.nodeAt(m);if(!(a[m]||!g))if(a[m]=!0,u==null)u=m,c=g;else{TE(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,{...CE(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=TE(c)?u+1:f;s.replaceWith(p+r.tableStart,f+r.tableStart,l)}s.setSelection(new Ft(s.doc.resolve(u+r.tableStart))),e(s)}return!0}function OE(t,e){const n=Fn(t.schema);return lG(({node:r})=>n[r.type.spec.tableRole])(t,e)}function lG(t){return(e,n)=>{var r;const o=e.selection;let s,a;if(o instanceof Ft){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;s=o.$anchorCell.nodeAfter,a=o.$anchorCell.pos}else{if(s=HK(o.$from),!s)return!1;a=(r=Sl(o.$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=Fo(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,w=0;v<f.right;v++,w++)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[w]))}p.setNodeMarkup(a,t({node:s,row:f.top,col:f.left}),u[0]),o instanceof Ft&&p.setSelection(new Ft(p.doc.resolve(o.$anchorCell.pos),m?p.doc.resolve(m):void 0)),n(p)}return!0}}function uG(t,e){return function(n,r){if(!co(n))return!1;const o=Lp(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof Ft?n.selection.forEachCell((a,l)=>{a.attrs[t]!==e&&s.setNodeMarkup(l,null,{...a.attrs,[t]:e})}):s.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function cG(t){return function(e,n){if(!co(e))return!1;if(n){const r=Fn(e.schema),o=Fo(e),s=e.tr,a=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),l=a.map(u=>o.table.nodeAt(u));for(let u=0;u<a.length;u++)l[u].type==r.header_cell&&s.setNodeMarkup(o.tableStart+a[u],r.cell,l[u].attrs);if(s.steps.length==0)for(let u=0;u<a.length;u++)s.setNodeMarkup(o.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 o=0;o<r.length;o++){const s=e.table.nodeAt(r[o]);if(s&&s.type!==n.header_cell)return!1}return!0}function cc(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?cG(t):function(n,r){if(!co(n))return!1;if(r){const o=Fn(n.schema),s=Fo(n),a=n.tr,l=ME("row",s,o),u=ME("column",s,o),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?o.cell:o.header_cell:t=="row"?l?o.cell:o.header_cell:o.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}}cc("row",{useDeprecatedLogic:!0}),cc("column",{useDeprecatedLogic:!0});var dG=cc("cell",{useDeprecatedLogic:!0});function fG(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const s=t.node(-1).child(r),a=s.lastChild;if(a)return o-1-a.nodeSize;o-=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),o=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return o+1;o+=s.nodeSize}}return null}function BE(t){return function(e,n){if(!co(e))return!1;const r=fG(Lp(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(Be.between(o,WK(o))).scrollIntoView())}return!0}}function pG(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 Pp(t,e){const n=t.selection;if(!(n instanceof Ft))return!1;if(e){const r=t.tr,o=Fn(t.schema).cell.createAndFill().content;n.forEachCell((s,a)=>{s.content.eq(o)||r.replace(r.mapping.map(a+1),r.mapping.map(a+s.nodeSize-1),new Ce(o,0,0))}),r.docChanged&&e(r)}return!0}function hG(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 o=e.child(0),s=o.type.spec.tableRole,a=o.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=yb(Fn(a).row,new Ce(c,f,p)).content),l.push(c)}else if(s=="cell"||s=="header_cell")l.push(n||r?yb(Fn(a).row,new Ce(e,n,r)).content:e);else return null;return mG(a,l)}function mG(t,e){const n=[];for(let o=0;o<e.length;o++){const s=e[o];for(let a=s.childCount-1;a>=0;a--){const{rowspan:l,colspan:u}=s.child(a).attrs;for(let c=o;c<o+l;c++)n[c]=(n[c]||0)+u}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(ce.empty),n[o]<r){const s=Fn(t).cell.createAndFill(),a=[];for(let l=n[o];l<r;l++)a.push(s);e[o]=e[o].append(ce.from(a))}return{height:e.length,width:r,rows:e}}function yb(t,e){const n=t.createAndFill();return new cm(n).replace(0,n.content.size,e).doc}function gG({width:t,height:e,rows:n},r,o){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(la(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(ce.from(c))}n=a,t=r}if(e!=o){const s=[];for(let a=0,l=0;a<o;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>o&&(p=p.type.create({...p.attrs,rowspan:Math.max(1,o-p.attrs.rowspan)},p.content)),u.push(p)}s.push(ce.from(u))}n=s,e=o}return{width:t,height:e,rows:n}}function bG(t,e,n,r,o,s,a){const l=t.doc.type.schema,u=Fn(l);let c,f;if(o>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 w=e.width;w<o;w++)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,o);b++){const w=b>=e.width?!1:n.nodeAt(e.map[v+b]).type==u.header_cell;p.push(w?f||(f=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}const m=u.row.create(null,ce.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 IE(t,e,n,r,o,s,a,l){if(a==0||a==e.height)return!1;let u=!1;for(let c=o;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 RE(t,e,n,r,o,s,a,l){if(a==0||a==e.width)return!1;let u=!1;for(let c=o;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,la(m.attrs,a-g,m.attrs.colspan-(a-g))),t.insert(b+m.nodeSize,m.type.createAndFill(la(m.attrs,0,a-g))),c+=m.attrs.rowspan-1}}return u}function LE(t,e,n,r,o){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let a=rn.get(s);const{top:l,left:u}=r,c=u+o.width,f=l+o.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=rn.get(s),m=p.mapping.maps.length}bG(p,a,s,n,c,f,m)&&g(),IE(p,a,s,n,u,c,l,m)&&g(),IE(p,a,s,n,u,c,f,m)&&g(),RE(p,a,s,n,l,f,u,m)&&g(),RE(p,a,s,n,l,f,c,m)&&g();for(let b=l;b<f;b++){const v=a.positionAt(b,u,s),w=a.positionAt(b,c,s);p.replace(p.mapping.slice(m).map(v+n),p.mapping.slice(m).map(w+n),new Ce(o.rows[b-l],0,0))}g(),p.setSelection(new Ft(p.doc.resolve(n+a.positionAt(l,u,s)),p.doc.resolve(n+a.positionAt(f-1,c-1,s)))),e(p)}var vG=Hm({ArrowLeft:Vp("horiz",-1),ArrowRight:Vp("horiz",1),ArrowUp:Vp("vert",-1),ArrowDown:Vp("vert",1),"Shift-ArrowLeft":Fp("horiz",-1),"Shift-ArrowRight":Fp("horiz",1),"Shift-ArrowUp":Fp("vert",-1),"Shift-ArrowDown":Fp("vert",1),Backspace:Pp,"Mod-Backspace":Pp,Delete:Pp,"Mod-Delete":Pp});function Dp(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Vp(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;if(s instanceof Ft)return Dp(n,r,Ve.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=PE(o,t,e);if(a==null)return!1;if(t=="horiz")return Dp(n,r,Ve.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(a),u=xE(l,t,e);let c;return u?c=Ve.near(u,1):e<0?c=Ve.near(n.doc.resolve(l.before(-1)),-1):c=Ve.near(n.doc.resolve(l.after(-1)),1),Dp(n,r,c)}}}function Fp(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;let a;if(s instanceof Ft)a=s;else{const u=PE(o,t,e);if(u==null)return!1;a=new Ft(n.doc.resolve(u))}const l=xE(a.$headCell,t,e);return l?Dp(n,r,new Ft(a.$anchorCell,l)):!1}}function yG(t,e){const n=t.state.doc,r=Sl(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Ft(r))),!0):!1}function wG(t,e,n){if(!co(t.state))return!1;let r=hG(n);const o=t.state.selection;if(o instanceof Ft){r||(r={width:1,height:1,rows:[ce.from(yb(Fn(t.state.schema).cell,n))]});const s=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),l=rn.get(s).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=gG(r,l.right-l.left,l.bottom-l.top),LE(t.state,t.dispatch,a,l,r),!0}else if(r){const s=Lp(t.state),a=s.start(-1);return LE(t.state,t.dispatch,a,rn.get(s.node(-1)).findCell(s.pos-a),r),!0}else return!1}function xG(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=DE(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof Ft)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=Sl(t.state.selection.$anchor))!=null&&((n=wb(t,e))==null?void 0:n.pos)!=o.pos)s(o,e),e.preventDefault();else if(!r)return;function s(u,c){let f=wb(t,c);const p=fs.getState(t.state)==null;if(!f||!vb(u,f))if(p)f=u;else return;const m=new Ft(u,f);if(p||!t.state.selection.eq(m)){const g=t.state.tr.setSelection(m);p&&g.setMeta(fs,u.pos),t.dispatch(g)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",l),fs.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(fs,-1))}function l(u){const c=u,f=fs.getState(t.state);let p;if(f!=null)p=t.state.doc.resolve(f);else if(DE(t,c.target)!=r&&(p=wb(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 PE(t,e,n){if(!(t.state.selection instanceof Be))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=r.before(o),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 wb(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Sl(t.state.doc.resolve(n.pos)):null}var CG=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")),xb(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,xb(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function xb(t,e,n,r,o,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 w=o==m?s:b&&b[v],x=w?w+"px":"";if(l+=w||r,w||(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 yr=new St("tableColumnResizing");function EG({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=CG,lastColumnResizable:o=!0}={}){const s=new Ne({key:yr,state:{init(a,l){var u,c;const f=(c=(u=s.spec)==null?void 0:u.props)==null?void 0:c.nodeViews,p=Fn(l.schema).table.name;return r&&f&&(f[p]=(m,g)=>new r(m,n,g)),new SG(-1,!1)},apply(a,l){return l.apply(a)}},props:{attributes:a=>{const l=yr.getState(a);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,l)=>{kG(a,l,t,o)},mouseleave:a=>{_G(a)},mousedown:(a,l)=>{TG(a,l,e,n)}},decorations:a=>{const l=yr.getState(a);if(l&&l.activeHandle>-1)return IG(a,l.activeHandle)},nodeViews:{}}});return s}var SG=class Xh{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(yr);if(r&&r.setHandle!=null)return new Xh(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Xh(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return bb(e.doc.resolve(o))||(o=-1),new Xh(o,n.dragging)}return n}};function kG(t,e,n,r){if(!t.editable)return;const o=yr.getState(t.state);if(o&&!o.dragging){const s=OG(e.target);let a=-1;if(s){const{left:l,right:u}=s.getBoundingClientRect();e.clientX-l<=n?a=VE(t,e,"left",n):u-e.clientX<=n&&(a=VE(t,e,"right",n))}if(a!=o.activeHandle){if(!r&&a!==-1){const l=t.state.doc.resolve(a),u=l.node(-1),c=rn.get(u),f=l.start(-1);if(c.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==c.width-1)return}$E(t,a)}}}function _G(t){if(!t.editable)return;const e=yr.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&$E(t,-1)}function TG(t,e,n,r){var o;if(!t.editable)return!1;const s=(o=t.dom.ownerDocument.defaultView)!=null?o:window,a=yr.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const l=t.state.doc.nodeAt(a.activeHandle),u=AG(t,a.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(yr,{setDragging:{startX:e.clientX,startWidth:u}}));function c(p){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f);const m=yr.getState(t.state);m!=null&&m.dragging&&(MG(t,m.activeHandle,FE(m.dragging,p,n)),t.dispatch(t.state.tr.setMeta(yr,{setDragging:null})))}function f(p){if(!p.which)return c(p);const m=yr.getState(t.state);if(m&&m.dragging){const g=FE(m.dragging,p,n);zE(t,m.activeHandle,g,r)}}return zE(t,a.activeHandle,u,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",f),e.preventDefault(),!0}function AG(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;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 OG(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function VE(t,e,n,r){const o=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!s)return-1;const{pos:a}=s,l=Sl(t.state.doc.resolve(a));if(!l)return-1;if(n=="right")return l.pos;const u=rn.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 FE(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function $E(t,e){t.dispatch(t.state.tr.setMeta(yr,{setHandle:e}))}function MG(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),s=rn.get(o),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=o.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():BG(m.colspan);b[g]=n,u.setNodeMarkup(a+p,null,{...m,colwidth:b})}u.docChanged&&t.dispatch(u)}function zE(t,e,n,r){const o=t.state.doc.resolve(e),s=o.node(-1),a=o.start(-1),l=rn.get(s).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;let u=t.domAtPos(o.start(-1)).node;for(;u&&u.nodeName!="TABLE";)u=u.parentNode;u&&xb(s,u.firstChild,u,r,l,n)}function BG(t){return Array(t).fill(0)}function IG(t,e){var n;const r=[],o=t.doc.resolve(e),s=o.node(-1);if(!s)return ht.empty;const a=rn.get(s),l=o.start(-1),u=a.colCount(o.pos-l)+o.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=yr.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 ht.create(t.doc,r)}function RG({allowTableNodeSelection:t=!1}={}){return new Ne({key:fs,state:{init(){return null},apply(e,n){const r=e.getMeta(fs);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:s}=e.mapping.mapResult(n);return o?null:s}},props:{decorations:KK,handleDOMEvents:{mousedown:xG},createSelectionBetween(e){return fs.getState(e.state)!=null?e.state.selection:null},handleTripleClick:yG,handleKeyDown:vG,handlePaste:wG},appendTransaction(e,n,r){return YK(r,SE(r,n),t)}})}const LG=(t,e,n)=>{if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r||n===r.attrs.backgroundColor)return t;const o={...r.attrs,backgroundColor:n};return t.setNodeMarkup(e,r.type,o,r.marks)},PG=(t,e,n)=>{const{doc:r,selection:o}=t;return!r||!o||!(o instanceof Ft)||o.forEachCell((s,a)=>{t=LG(t,a,n)}),t},HE=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=r;return n=n.setSelection(s),n=PG(n,e,t),n.docChanged?(o==null||o(n),!0):!1},DG=Ze.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)}}}),VG=Bt.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",gt(this.options.HTMLAttributes,t),0]}}),FG=Bt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",gt(this.options.HTMLAttributes,t),0]}}),$G=Bt.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",gt(this.options.HTMLAttributes,t),0]}});function Cb(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function UE(t,e,n,r,o,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 w=o===m?s:b&&b[v],x=w?`${w}px`:"";if(l+=w||r,w||(u=!1),c){if(c.style.width!==x){const[E,S]=Cb(r,w);c.style.setProperty(E,S)}c=c.nextSibling}else{const E=document.createElement("col"),[S,C]=Cb(r,w);E.style.setProperty(S,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 zG{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")),UE(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,UE(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function HG(t,e,n,r){let o=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 w=n===m?r:b&&b[v];o+=w||e,w||(s=!1);const[x,E]=Cb(e,w);a.push(["col",{style:`${x}: ${E}`}])}}const u=s?`${o}px`:"",c=s?"":`${o}px`;return{colgroup:["colgroup",{},...a],tableWidth:u,tableMinWidth:c}}function WE(t,e){return t.createAndFill()}function UG(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 WG(t,e,n,r,o){const s=UG(t),a=[],l=[];for(let c=0;c<n;c+=1){const f=WE(s.cell);if(f&&l.push(f),r){const p=WE(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 jG(t){return t instanceof Ft}const $p=({editor:t})=>{const{selection:e}=t.state;if(!jG(e))return!1;let n=0;const r=s4(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},qG=Bt.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:zG,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:o}=HG(t,this.options.cellMinWidth);return["table",gt(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:s})=>{const a=WG(s.schema,t,e,n);if(o){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(Be.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>QK(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>NK(t,e),deleteColumn:()=>({state:t,dispatch:e})=>tG(t,e),addRowBefore:()=>({state:t,dispatch:e})=>rG(t,e),addRowAfter:()=>({state:t,dispatch:e})=>oG(t,e),deleteRow:()=>({state:t,dispatch:e})=>sG(t,e),deleteTable:()=>({state:t,dispatch:e})=>pG(t,e),mergeCells:()=>({state:t,dispatch:e})=>AE(t,e),splitCell:()=>({state:t,dispatch:e})=>OE(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>cc("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>cc("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>dG(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>AE(t,e)?!0:OE(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>uG(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>BE(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>BE(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&SE(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=Ft.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:$p,"Mod-Backspace":$p,Delete:$p,"Mod-Delete":$p}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[EG({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],RG({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:st(Re(t,"tableRole",e))}}}),KG=["disabled"],GG={"content-class":"table-grid-size-editor","content-style":"padding:0"},XG={class:"flex flex-col flex-wrap gap-1 justify-between"},YG=["onMouseover","onMousedown"],JG={class:"text-center text-sm text-zinc-600 mt-2"},ZG=i.defineComponent({__name:"CreateTablePopover",props:{disabled:{type:Boolean,default:!1}},emits:["create-table"],setup(t,{emit:e}){const n=e,r=i.ref(!1),o=i.ref(!0),s=i.reactive({rows:Bu()?Id:Bd,cols:Bu()?Id:Bd}),a=i.reactive({rows:Rd,cols:Rd});function l(f,p){f===s.rows&&(s.rows=Math.min(f+1,Id)),p===s.cols&&(s.cols=Math.min(p+1,Id)),a.rows=f,a.cols=p}function u(f,p){n("create-table",{rows:f,cols:p,withHeaderRow:i.unref(o)}),c()}function c(){r.value=!1,o.value=!1,s.rows=Bd,s.cols=Bd,a.rows=Rd,a.cols=Rd}return(f,p)=>(i.openBlock(),i.createBlock(i.unref(ul),null,{default:i.withCtx(()=>[i.createVNode(i.unref(fl),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("button",{disabled:t.disabled,class:"m-0 p-0"},[i.renderSlot(f.$slots,"trigger")],8,KG)]),_:3}),i.createVNode(i.unref(cl),{class:"w-full",align:"start",side:"bottom"},{default:i.withCtx(()=>[i.createElementVNode("div",GG,[i.createElementVNode("div",XG,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.rows,m=>(i.openBlock(),i.createElementBlock("div",{key:"r"+m,class:"flex gap-1"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.cols,g=>(i.openBlock(),i.createElementBlock("div",{key:"c"+g,class:i.normalizeClass([[g<=a.cols&&m<=a.rows&&"bg-ed-foreground border-ed-border","cursor-pointer"],"pa-1"]),onMouseover:b=>l(m,g),onMousedown:b=>u(m,g)},p[0]||(p[0]=[i.createElementVNode("div",{class:"w-4 h-4 p-1 border box-border"},null,-1)]),42,YG))),128))]))),128))]),i.createElementVNode("div",JG,i.toDisplayString(a.rows)+" x "+i.toDisplayString(a.cols),1)])]),_:1})]),_:3}))}}),QG={style:{display:"flex"}},NG=i.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.disabled||e.editor.chain().focus().insertTable({...r,withHeaderRow:!1}).run()}return(r,o)=>(i.openBlock(),i.createBlock(ZG,{disabled:r.disabled,onCreateTable:n},{trigger:i.withCtx(()=>[i.createElementVNode("div",QG,[i.createVNode(qe,{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"]))}}),Eb=qG.extend({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:NG,componentProps:{disabled:e.isActive("table")||!1,icon:"Table",tooltip:n("editor.table.tooltip")}})}},addExtensions(){return[FG.configure(this.options.tableRow),VG.configure(this.options.tableHeader),$G.configure(this.options.tableCell),DG.configure(this.options.tableCellBackground)]}}),eX={class:"flex items-center gap-2 px-2"},tX=i.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}=At(),r=i.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()}]),o=i.computed(()=>r.value.filter(s=>s.isActive()).pop()??{label:n("editor.modify")});return(s,a)=>{var l;return i.openBlock(),i.createBlock(na,{title:(l=o.value)==null?void 0:l.label,"side-offset":5},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(u,c)=>{var f;return i.openBlock(),i.createBlock(i.unref(yl),{key:c,class:"cursor-pointer",checked:((f=u.isActive)==null?void 0:f.call(u))||!1,onClick:u.action},{default:i.withCtx(()=>[i.createElementVNode("div",eX,[i.createVNode(i.unref(jt),{name:u.iconName,class:"h3 w-3"},null,8,["name"]),i.createElementVNode("span",null,i.toDisplayString(u.label),1)])]),_:2},1032,["checked","onClick"])}),128))]),_:1},8,["title"])}}}),nX=Ze.create({name:"text-bubble",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:()=>({component:tX,componentProps:{}})}}}),rX=[{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}년"}],oX=t=>{const e=[...t||[],...rX.map(n=>n.pattern)].join("|");return new RegExp(e,"gu")},iX=Ze.create({name:"time-highlighter",addOptions(){return{additionalTimeWords:[]}},addStorage(){return{cachedRegex:null,cachedAdditionalWords:null}},addProseMirrorPlugins(){return[new Ne({props:{decorations:t=>{const e=[];return(this.storage.cachedAdditionalWords!==this.options.additionalTimeWords||!this.storage.cachedRegex)&&(this.storage.cachedAdditionalWords=this.options.additionalTimeWords,this.storage.cachedRegex=oX(this.options.additionalTimeWords)),t.doc.descendants((n,r)=>{if(!n.isText)return;let o;const s=this.storage.cachedRegex;for(;o=s.exec(n.text||"");){const a=r+o.index,l=a+o[0].length;e.push(Wt.inline(a,l,{class:"time-highlight"}))}}),ht.create(t.doc,e)}}})]}}),sX=Ze.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 o=t.tr.setSelection(Be.create(t.doc,r));return e&&e(o.scrollIntoView()),n&&n.focus(),!0}}}});function Sb(t){const e=JSON.stringify(t),n=window.ReactNativeWebView;if(n){n.postMessage(e);return}console.warn("[clipboardBridge] no bridge found")}function aX(){return Sb({type:"REQUEST_CLIPBOARD_STATE"}),new Promise(t=>{function e(n){const r=n.data;if(!r)return;let o;try{o=typeof r=="string"?JSON.parse(r):r}catch{return}o&&o.type==="CLIPBOARD_STATE"&&(window.removeEventListener("message",e),t(!!o.hasClipboard))}window.addEventListener("message",e)})}function lX(){return Sb({type:"PASTE"}),new Promise(t=>{function e(n){const r=n.data;if(!r)return;let o;try{o=typeof r=="string"?JSON.parse(r):r}catch{return}o&&o.type==="PASTE_RESULT"&&(window.removeEventListener("message",e),t(o.text??null))}window.addEventListener("message",e)})}function uX(t){Sb({type:"COPY",data:t})}const cX=Ze.create({name:"clipboard",addCommands(){return{copyContent:()=>({editor:t,state:e})=>{const{from:n,to:r}=e.selection;return n===r?!1:((async()=>{try{const o=e.doc.slice(n,r),a=vo.fromSchema(t.schema).serializeFragment(o.content),l=document.createElement("div");l.appendChild(a);const u=l.innerHTML;await uX(u)}catch(o){console.warn("[clipboard] copy failed",o)}})(),!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=await lX();if(!e)return;const n=typeof e=="string"&&/^\s*<([A-Za-z][\s\S]*>)/.test(e),r=new DataTransfer;if(n){r.setData("text/html",e);const s=document.createElement("div");s.innerHTML=e,r.setData("text/plain",s.innerText)}else r.setData("text/plain",e);const o=new ClipboardEvent("paste",{bubbles:!0,cancelable:!0});Object.defineProperty(o,"clipboardData",{value:r}),t.view.dom.dispatchEvent(o)}catch(e){console.warn("Clipboard paste failed:",e)}})(),!0)}},onCreate(){const t=this.editor;t.hasClipboard=async()=>{try{return!!await aX()}catch(e){return console.warn("[clipboard] requestClipboardState failed",e),!1}}}}),jE=Ze.create({name:"base-kit",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),timeHighlighter:{additionalTimeWords:[]},bubble:{list:MB,defaultBubbleList:fj,button:({editor:e,extension:n,t:r})=>{var l;const{list:o={},defaultBubbleList:s}=((l=n.options)==null?void 0:l.bubble)??{},a=(s==null?void 0:s(e))??[];return pj(o,a,{editor:e,extension:n,t:r})}}}},addExtensions(){var n,r,o,s,a;const{t}=At(),e=[];this.options.placeholder!==!1&&e.push(uj.configure({placeholder:({node:l,pos:u})=>{var f;const c=(f=l==null?void 0:l.type)==null?void 0:f.name;return c==="heading"?`${t(`editor.heading.h${l.attrs.level}.tooltip`)}`:c==="table"||c==="codeBlock"?"":u===0?t("editor.content"):""},...this.options.placeholder})),this.options.focus!==!1&&e.push(QW.configure({className:"focus",...this.options.focus})),this.options.document!==!1&&(this.options.page?(e.push(D8.configure().extend({content:"page+"})),e.push(rK.configure({types:((r=(n=this.options.page)==null?void 0:n.nodesComputedOption)==null?void 0:r.types)??[],slots:i.useSlots()}))):e.push(D8.configure())),this.options.dropcursor!==!1&&e.push(ZW.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&e.push(XW.configure(this.options.characterCount)),this.options.paragraph!==!1&&e.push(R8.configure(this.options.paragraph)),this.options.hardBreak!==!1&&e.push(aj.configure(this.options.hardBreak)),this.options.listItem!==!1&&e.push(lj.configure(this.options.listItem)),this.options.textStyle!==!1&&e.push(LU.configure(this.options.textStyle)),this.options.history!==!1&&e.push($g.configure(this.options.history)),this.options.fontSize!==!1&&e.push(t8.configure(this.options.fontSize)),this.options.fontFamily!==!1&&e.push(dE.configure(this.options.fontFamily)),this.options.mode!==Fe.EDITOR&&e.push(cK),this.options.superText!==!1&&this.options.mode!==Fe.PLAIN_TEXT&&(typeof this.options.superText=="boolean"?e.push(yE.configure()):e.push(yE.configure({specialCharModal:(o=this.options.superText)==null?void 0:o.specialCharModal,toggleSuperViewMobileCallBack:(s=this.options.superText)==null?void 0:s.toggleSuperViewMobileCallBack}))),this.options.mode===Fe.EDITOR&&(this.options.image!==!1&&e.push(pb.configure()),e.push(NC.configure({spacer:!0}),EC,CC,SC,Dg,Eb)),this.options.mode!==Fe.EDITOR&&this.options.configPlan!==!1&&this.options.mode!==Fe.PLAIN_TEXT&&(typeof this.options.configPlan=="boolean"?e.push(wE.configure()):e.push(wE.configure({specialCharModal:(a=this.options.configPlan)==null?void 0:a.specialCharModal}))),this.options.mode!==Fe.EDITOR&&this.options.mode!==Fe.PLAIN_TEXT&&e.push(fK),(this.options.mode===Fe.STRAIGHT||this.options.mode===Fe.REPORT||this.options.mode===Fe.EDITOR)&&this.options.timeHighlighter&&e.push(iX.configure(this.options.timeHighlighter)),this.options.invalidCharFocus!==!1&&e.push(sX.configure(this.options.invalidCharFocus)),e.push(cj,L8.configure(),nX.configure(),sj.configure(),kC,n8.configure({spacer:!0}),e8.configure({types:["heading","paragraph"],spacer:!0}),hE,hb,db,fg,cX,r8.configure({multicolor:!0}));for(const l in this.options.excludes)Object.prototype.hasOwnProperty.call(this.options.excludes,l)&&this.options.excludes[l]&&tt.remove(e,({name:c})=>c===l);return e},addStorage(){return{mode:this.options.mode}}}),qE=Kn.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",gt(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()}}}),KE=Kn.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",gt(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()}}}),dX=Ze.create({name:"subAndSuperScript",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>{const o=n.options.subscript,s=n.options.superscript,a={component:qe,componentProps:{action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",tooltip:r("editor.subscript.tooltip")}},l={component:qe,componentProps:{action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",tooltip:r("editor.superscript.tooltip")}},u=[];return o!==!1&&u.push(a),s!==!1&&u.push(l),u}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(qE.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(KE.configure(this.options.superscript)),t}}),fX={class:"ml-1"},pX=i.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=i.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,o)=>(i.openBlock(),i.createBlock(na,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.items,(s,a)=>(i.openBlock(),i.createBlock(i.unref(yl),{key:a,checked:n.value.title===s.title,disabled:s.disabled,class:"flex gap-3 items-center",onClick:s.action},{default:i.withCtx(()=>[s.icon?(i.openBlock(),i.createBlock(i.unref(jt),{key:0,name:s.icon},null,8,["name"])):i.createCommentVNode("",!0),i.createElementVNode("span",fX,i.toDisplayString(s.title),1),s.shortcutKeys?(i.openBlock(),i.createBlock(i.unref(QC),{key:1,class:"ml-auto"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(V6)(s.shortcutKeys)),1)]),_:2},1024)):i.createCommentVNode("",!0)]),_:2},1032,["checked","disabled","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),hX=Ze.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,extension:n,t:r}){const o=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=T0(e,"code"),c=[];if(o!==!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:pX,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(qE.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(KE.configure(this.options.superscript)),t}});var ua=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(ua||{});function mX(t,e,n){return t<e?e:t>n?n:t}function gX(t,e,n,r){const{doc:o,selection:s}=t;if(!o||!s||!(s instanceof Be||s instanceof In))return t;const{from:a,to:l}=s;return o.nodesBetween(a,l,(u,c)=>{const f=u.type;return n.includes(f.name)?(t=bX(t,c,e),!1):!r0(u.type.name,r.extensionManager.extensions)}),t}function bX(t,e,n){if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r)return t;const a=mX((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 GE({delta:t,types:e}){return({state:n,dispatch:r,editor:o})=>{const{selection:s}=n;let{tr:a}=n;return a=a.setSelection(s),a=gX(a,t,e,o),a.docChanged?(r&&r(a),!0):!1}}const vX=Ze.create({name:"indent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:ua.min,maxIndent:ua.max,button({editor:e,t:n}){var s,a;const{selection:r}=e.state,o=r.$anchor.parent;return[{component:qe,componentProps:{action:()=>{e.commands.indent()},disabled:((s=o==null?void 0:o.attrs)==null?void 0:s.indent)>=ua.max||!e.can().indent(),shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")}},{component:qe,componentProps:{action:()=>{e.commands.outdent()},shortcutKeys:["Shift","Tab"],disabled:((a=o==null?void 0:o.attrs)==null?void 0:a.indent)<=ua.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:()=>GE({delta:ua.more,types:this.options.types}),outdent:()=>GE({delta:ua.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}});function yX(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:l}=t,u=r&&!o,c=zO(n),f=new RegExp(`\\s${c}$`),p=a?"^":"",m=o?"":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,w=Array.from(b.matchAll(g)).pop();if(!w||w.input===void 0||w.index===void 0)return null;const x=w.input.slice(Math.max(0,w.index-1),w.index),E=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(x);if(s!==null&&!E)return null;const S=v+w.index;let C=S+w[0].length;return u&&f.test(b.slice(C-1,C+1))&&(w[0]+=" ",C+=1),S<l.pos&&C>=l.pos?{range:{from:S,to:C},query:w[0].slice(n.length),text:w[0]}:null}const wX=new St("suggestion");function xX({pluginKey:t=wX,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:s=[" "],startOfLine:a=!1,decorationTag:l="span",decorationClass:u="suggestion",command:c=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=yX}){let b;const v=p==null?void 0:p(),w=new Ne({key:t,view(){return{update:async(x,E)=>{var S,C,_,T,A,L,R;const M=(S=this.key)===null||S===void 0?void 0:S.getState(E),z=(C=this.key)===null||C===void 0?void 0:C.getState(x.state),K=M.active&&z.active&&M.range.from!==z.range.from,ae=!M.active&&z.active,ie=M.active&&!z.active,W=!ae&&!ie&&M.query!==z.query,$=ae||K&&W,P=W||K,G=ie||K&&W;if(!$&&!P&&!G)return;const Z=G&&!$?M:z,ne=x.dom.querySelector(`[data-decoration-id="${Z.decorationId}"]`);b={editor:e,range:Z.range,query:Z.query,text:Z.text,items:[],command:ee=>c({editor:e,range:Z.range,props:ee}),decorationNode:ne,clientRect:ne?()=>{var ee;const{decorationId:xe}=(ee=this.key)===null||ee===void 0?void 0:ee.getState(e.state),Ee=x.dom.querySelector(`[data-decoration-id="${xe}"]`);return(Ee==null?void 0:Ee.getBoundingClientRect())||null}:null},$&&((_=v==null?void 0:v.onBeforeStart)===null||_===void 0||_.call(v,b)),P&&((T=v==null?void 0:v.onBeforeUpdate)===null||T===void 0||T.call(v,b)),(P||$)&&(b.items=await f({editor:e,query:Z.query})),G&&((A=v==null?void 0:v.onExit)===null||A===void 0||A.call(v,b)),P&&((L=v==null?void 0:v.onUpdate)===null||L===void 0||L.call(v,b)),$&&((R=v==null?void 0:v.onStart)===null||R===void 0||R.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,S,C){const{isEditable:_}=e,{composing:T}=e.view,{selection:A}=x,{empty:L,from:R}=A,M={...E};if(M.composing=T,_&&(L||e.view.composing)){(R<E.range.from||R>E.range.to)&&!T&&!E.composing&&(M.active=!1);const z=g({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:A.$from}),K=`id_${Math.floor(Math.random()*4294967295)}`;z&&m({editor:e,state:C,range:z.range,isActive:E.active})?(M.active=!0,M.decorationId=E.decorationId?E.decorationId:K,M.range=z.range,M.query=z.query,M.text=z.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 S;const{active:C,range:_}=w.getState(x.state);return C&&((S=v==null?void 0:v.onKeyDown)===null||S===void 0?void 0:S.call(v,{view:x,event:E,range:_}))||!1},decorations(x){const{active:E,range:S,decorationId:C}=w.getState(x);return E?ht.create(x.doc,[Wt.inline(S.from,S.to,{nodeName:l,class:u,"data-decoration-id":C})]):null}}});return w}const CX=[{label:"优酷",value:"youku",icon:"Youku"},{label:"哔哩哔哩",value:"bilibili",icon:"BiliBili"},{label:"腾讯视频",value:"qqvideo",icon:"QQVideo"}],EX=[{label:"高德地图",value:"amap",icon:"Gaode"},{label:"百度地图",value:"baidu_map",icon:"Baidu"}],SX=[{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"}],kX=[{label:"CodePen",value:"codepen",icon:"Codepen"}],_X=[{label:"金数据",value:"jinshuju",icon:"Jinshuju"}],TX=[],AX=[...CX,...EX,...SX,...kX,..._X,...TX];function OX(t){const{t:e}=At(),n=[{name:"format",title:e("editor.slash.format"),commands:[{name:"paragraph",label:e("editor.paragraph.tooltip"),aliases:["paragraph","zw"],iconName:"Paragraph",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading1",label:e("editor.heading.h1.tooltip"),aliases:["h1","bt","bt1"],iconName:"Heading1",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading2",label:e("editor.heading.h2.tooltip"),aliases:["h2","bt","bt2"],iconName:"Heading2",action:({editor:o,range:s})=>{o.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:o,range:s})=>{o.chain().focus().deleteRange(s).setNode("heading",{level:3}).run()}},{name:"bulletList",label:e("editor.bulletlist.tooltip"),aliases:["ul","yxlb","bulletList"],iconName:"List",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleBulletList().run()}},{name:"numberedList",label:e("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleOrderedList().run()}},{name:"codeBlock",label:e("editor.codeblock.tooltip"),iconName:"Code2",aliases:["codeBlock"],description:"Code block with syntax highlighting",shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setCodeBlock().run()}},{name:"blockquote",label:e("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setBlockquote().run()}},{name:"horizontalrule",label:e("editor.horizontalrule.tooltip"),aliases:["fgx","horizontalRule"],iconName:"Minus",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHorizontalRule().run()}},{name:"link",label:e("editor.link.tooltip"),aliases:["link","lianjie","lj"],iconName:"Link",action:({editor:o,range:s})=>{o.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:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.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:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.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:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.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:o,range:s})=>{o.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:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().deleteRange(s).setColumns().focus(o.state.selection.head-1).run()}}]}];if(T0(t,"iframes")){const o=AX;n.push({name:"others",title:e("editor.slash.embed"),commands:o.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 MX={key:0,class:"grid grid-cols-1 gap-0.5 min-w-48"},BX={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"},IX=["onClick"],RX=["src"],LX={key:1,class:"p-3"},PX={class:"text-xs text-gray-800 dark:text-gray-100"},DX=i.defineComponent({__name:"CommandsList",props:{editor:{},items:{default:void 0},command:{type:Function,default:void 0}},setup(t,{expose:e}){const n=i.ref(0),r=i.ref(0),o=i.ref(null),{t:s}=At(),a=i.ref([]),l=t;e({onKeyDown:u}),i.watch([()=>n.value,()=>r.value],async()=>{if(!o.value)return;await i.nextTick();const v=r.value*1e3+n.value,w=a.value[v];w&&w.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,w=r.value;v<0&&(w=r.value-1,v=((x=l.items[w])==null?void 0:x.commands.length)-1||0),w<0&&(w=l.items.length-1,v=l.items[w].commands.length-1),n.value=v,r.value=w}function f(){if(!l.items.length)return!1;const v=l.items[r.value].commands;let w=n.value+1,x=r.value;v.length-1<w&&(w=0,x=r.value+1),l.items.length-1<x&&(x=0),n.value=w,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,w){const x=l.items[v].commands[w];l.command(x)}function g(v,w){m(v,w)}function b(v,w,x){a.value[v*1e3+w]=x}return(v,w)=>{var x;return i.openBlock(),i.createElementBlock("div",{ref_key:"scrollContainer",ref:o,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?(i.openBlock(),i.createElementBlock("div",MX,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(v.items,(E,S)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:E.title},[i.createElementVNode("div",BX,i.toDisplayString(E.title),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.commands,(C,_)=>(i.openBlock(),i.createElementBlock("button",{ref_for:!0,ref:T=>b(S,_,T),key:_,class:i.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===S&&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(S,_)},[C.iconUrl?(i.openBlock(),i.createElementBlock("img",{key:0,class:"w-6 h-6",src:C.iconUrl},null,8,RX)):i.createCommentVNode("",!0),C.iconName?(i.openBlock(),i.createBlock(i.unref(jt),{key:1,name:C.iconName,class:"mr-1 text-lg"},null,8,["name"])):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(C.label),1)],10,IX))),128))],64))),128))])):(i.openBlock(),i.createElementBlock("div",LX,[i.createElementVNode("span",PX,i.toDisplayString(i.unref(s)("editor.slash.empty")),1)]))],512)}}}),ca="slashCommand";let Rt;const VX=Ze.create({name:ca,priority:200,onCreate(){Rt=Fs("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[xX({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new St(ca),allow:({state:t,range:e})=>{var c,f,p;const n=t.doc.resolve(e.from),r=n.depth===1,o=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&&o&&s||a&&o&&s)&&u},command:({editor:t,range:e,props:n})=>{const{view:r}=t;n.action({editor:t,range:e}),r.focus()},items:({query:t})=>OX(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 ow(DX,{props:n,editor:n.editor});const{view:r}=n.editor,o=()=>{if(!n.clientRect)return n.editor.storage[ca].rect;const a=n.clientRect();if(!a)return n.editor.storage[ca].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=()=>{Rt==null||Rt[0].setProps({getReferenceClientRect:o})},(s=r.dom.parentElement)==null||s.addEventListener("scroll",e),t.element&&(Rt==null||Rt[0].setProps({getReferenceClientRect:o,appendTo:()=>document.body,content:t.element})),Rt==null||Rt[0].show()},onUpdate(n){var a;t.updateProps(n);const{view:r}=n.editor,o=()=>{if(!n.clientRect)return n.editor.storage[ca].rect;const l=n.clientRect();return l?new DOMRect(l.x,l.y,l.width,l.height):n.editor.storage[ca].rect},s=()=>{Rt==null||Rt[0].setProps({getReferenceClientRect:o})};(a=r.dom.parentElement)==null||a.addEventListener("scroll",s),n.editor.storage[ca].rect=n.clientRect?o():{width:0,height:0,left:0,top:0,right:0,bottom:0},Rt==null||Rt[0].setProps({getReferenceClientRect:o})},onKeyDown(n){var r;return n.event.key==="Escape"?(Rt==null||Rt[0].hide(),!0):(Rt!=null&&Rt[0].state.isShown||Rt==null||Rt[0].show(),(r=t.ref)==null?void 0:r.onKeyDown(n))},onExit(n){var r;if(Rt==null||Rt[0].hide(),e){const{view:o}=n.editor;(r=o.dom.parentElement)==null||r.removeEventListener("scroll",e)}t.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}});function FX(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}const XE=Bt.create({name:"video",group:"block",atom:!0,draggable:!0,addAttributes(){return{src:{default:null,renderHTML:({src:t})=>({src:t?FX(t):null})},width:{default:this.options.width,renderHTML:({width:t})=>({width:an(t)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"video"}]},renderHTML({HTMLAttributes:t}){const{src:e,width:n="100%"}=t??{};return["video",{src:e?e.replace(/\\/g,"/"):"",controls:!0,style:`max-width: ${an(n)}; height: auto;`}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),updateVideo:t=>({commands:e})=>e.updateAttributes(this.name,t)}},addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,width:Ld["size-medium"],HTMLAttributes:{class:"iframe-wrapper",style:"display: flex;justify-content: center;"}}}}),$X=1,zX=1e6,fi={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let kb=0;function HX(){return kb=(kb+1)%Number.MAX_VALUE,kb.toString()}const _b=new Map;function YE(t){if(_b.has(t))return;const e=setTimeout(()=>{_b.delete(t),dc({type:fi.REMOVE_TOAST,toastId:t})},zX);_b.set(t,e)}const fo=i.ref({toasts:[]});function dc(t){switch(t.type){case fi.ADD_TOAST:fo.value.toasts=[t.toast,...fo.value.toasts].slice(0,$X);break;case fi.UPDATE_TOAST:fo.value.toasts=fo.value.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e);break;case fi.DISMISS_TOAST:{const{toastId:e}=t;e?YE(e):fo.value.toasts.forEach(n=>{YE(n.id)}),fo.value.toasts=fo.value.toasts.map(n=>n.id===e||e===void 0?{...n,open:!1}:n);break}case fi.REMOVE_TOAST:t.toastId===void 0?fo.value.toasts=[]:fo.value.toasts=fo.value.toasts.filter(e=>e.id!==t.toastId);break}}function Tb(){return{toasts:i.computed(()=>fo.value.toasts),toast:UX,dismiss:t=>dc({type:fi.DISMISS_TOAST,toastId:t})}}function UX(t){const e=HX(),n=o=>dc({type:fi.UPDATE_TOAST,toast:{...o,id:e}}),r=()=>dc({type:fi.DISMISS_TOAST,toastId:e});return dc({type:fi.ADD_TOAST,toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}const WX=i.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=vn(),{toast:r}=Tb();function o(){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)=>(i.openBlock(),i.createBlock(qe,{action:o,title:"AI",disabled:s.disabled,icon:s.icon,tooltip:s.tooltip},null,8,["disabled","icon","tooltip"]))}}),jX=Bt.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:WX,componentProps:{icon:"Sparkles",tooltip:n("editor.AI.ask")}})}}});function qX(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 o=new Uint8Array(r);return new Blob([o],{type:e})}function KX(t,e){return new File([t],e,{type:t.type})}const GX=Ze.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:qe,componentProps:{action:()=>{var o;return(o=e.commands)==null?void 0:o.toggleImportWord()},disabled:!e.can().setHorizontalRule(),icon:"Word",tooltip:r("editor.importWord.tooltip")}})}},addCommands(){return{toggleImportWord:()=>({chain:t,editor:e})=>{const{toast:n}=Tb(),{t:r}=At();async function o(u){var g;const f=new DOMParser().parseFromString(u,"text/html"),p=f.querySelectorAll("img");if(!p.length)return f.body.innerHTML;if(T0(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"),S=qX(E,"image/jpeg"),C=KX(S,"image.jpeg");v.push(C)}const w=await b.upload(v);for(let x=0;x<p.length;x++){const E=p[x];E.setAttribute("src",w[x].src);const S=E.parentElement;(S==null?void 0:S.tagName)==="P"&&(S.insertAdjacentElement("beforebegin",E),!S.hasChildNodes()&&S.textContent===""&&S.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 o(u);e.chain().setContent(c.toString(),!0).run(),n({title:r("editor.importWord.success")})}const{open:a,onChange:l}=pt.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}}}}),zp=i.defineComponent({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:r,...o}=e;return o});return(r,o)=>(i.openBlock(),i.createBlock(i.unref(NP),i.mergeProps({class:i.unref(Ae)("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:i.withCtx(()=>[i.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),kl=new St("upload-image"),XX=()=>new Ne({key:kl,state:{init(){return ht.empty},apply(t,e){e=e.map(t.mapping,t.doc);const n=t.getMeta(kl);return n!=null&&n.add?n.add.forEach(({id:r,pos:o,src:s})=>{const a=YX(s),l=Wt.widget(o,a,{id:r});e=e.add(t.doc,[l])}):n!=null&&n.remove&&n.remove.forEach(r=>{e=e.remove(e.find(void 0,void 0,o=>o.id===r))}),e}},props:{decorations(t){return this.getState(t)}}});function YX(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 JX(t,e){var o;const r=kl.getState(t).find(void 0,void 0,s=>s.id===e);return r.length?(o=r[0])==null?void 0:o.from:null}const JE=({validateFn:t,onUpload:e})=>(n,r,o,s)=>{n.forEach(a=>{if(t&&!t(a))return;s||(s=Ni(6));const l=r.state.tr;l.selection.empty||l.deleteSelection();let u=null;r.state.doc.descendants((p,m)=>{p.type.name===ds&&p.attrs.id===s&&(u=m)});const c=URL.createObjectURL(a);l.setMeta(kl,{add:[{id:s,pos:o,src:c}]}),r.dispatch(l);const f=JX(r.state,s)||u;e(a).then(p=>{var w;const{schema:m}=r.state;if(f===null)throw new Error("Not found placeholderPos");const g=typeof p=="object"?c:p,b=(w=m.nodes.image)==null?void 0:w.create({src:g});if(!b)return;const v=r.state.tr.replaceWith(f,f,b).setMeta(kl,{remove:[s]});r.dispatch(v)},()=>{const p=r.state.tr.delete(o,o).setMeta(kl,{remove:[s]});r.dispatch(p)})})},ZX=(t,e,n)=>{var o;const r=Array.from(((o=e.clipboardData)==null?void 0:o.files)||[]);if(r.length){e.preventDefault();const s=t.state.selection.from;return n(r,t,s+1),!0}return!1},QX=(t,e,n,r)=>{var s;const o=Array.from(((s=e.dataTransfer)==null?void 0:s.files)||[]);if(!n&&o.length){e.preventDefault();const a=t.posAtCoords({left:e.clientX,top:e.clientY});if(a)return r(o,t,a.pos+1),!0}return!1},NX={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"},eY={class:"flex items-center justify-between w-full"},tY={class:"flex items-center justify-center gap-3"},nY={class:"text-sm"},rY={class:"flex items-center gap-2"},oY=i.defineComponent({__name:"ImageUploader",props:{...zs},setup(t){const e=t,n=i.ref(""),r=i.ref(),{t:o}=At(),s=i.inject("isEditable",i.ref(!0));function a(f){var v,w;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=p[0],g=(w=e.editor.extensionManager.extensions.find(x=>x.name==="imageUpload"))==null?void 0:w.options;JE({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()}).focus().run()}function u(){s.value&&e.deleteNode()}function c(){var f;(f=r.value)==null||f.click()}return(f,p)=>(i.openBlock(),i.createBlock(i.unref($s),{id:f.node.attrs.id,class:"p-0 m-0","data-drag-handle":""},{default:i.withCtx(()=>[i.createVNode(i.unref(ul),{"default-open":"",modal:""},{default:i.withCtx(()=>[i.createVNode(i.unref(fl),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",NX,[i.createElementVNode("div",eY,[i.createElementVNode("div",tY,[i.createVNode(i.unref(jt),{name:"ImageUp",class:"w-6 h-6"}),i.createElementVNode("span",nY,i.toDisplayString(i.unref(o)("editor.image.dialog.title")),1)]),i.createVNode(i.unref(jt),{name:"Trash2",class:"hover:text-ed-foreground",onClick:i.withModifiers(u,["stop"])})])])]),_:1}),i.unref(s)?(i.openBlock(),i.createBlock(i.unref(cl),{key:0,"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:i.withCtx(()=>[i.createVNode(i.unref(F1),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:i.withCtx(()=>[i.createVNode(i.unref($1),{class:"grid w-full grid-cols-2"},{default:i.withCtx(()=>[i.createVNode(i.unref($u),{value:"upload"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.upload")),1)]),_:1}),i.createVNode(i.unref($u),{value:"link"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.url")),1)]),_:1})]),_:1}),i.createVNode(i.unref(zp),{value:"upload"},{default:i.withCtx(()=>[i.createVNode(i.unref(_n),{class:"w-full mt-1",size:"sm",onClick:c},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.upload")),1)]),_:1}),i.createElementVNode("input",{ref_key:"fileInput",ref:r,type:"file",accept:"image/*",multiple:"",style:{display:"none"},onChange:a},null,544)]),_:1}),i.createVNode(i.unref(zp),{value:"link"},{default:i.withCtx(()=>[i.createElementVNode("div",rY,[i.createVNode(i.unref(dl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:i.unref(o)("editor.image.dialog.placeholder")},null,8,["modelValue","placeholder"]),i.createVNode(i.unref(_n),{onClick:l},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])):i.createCommentVNode("",!0)]),_:1})]),_:1},8,["id"]))}}),iY={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5},sY=t=>`${(t/1024/1024).toFixed(2)}MB`,aY=Bt.create({name:"imageUpload",isolating:!0,defining:!0,group:"block",draggable:!1,selectable:!0,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:Ni(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 Hs(oY)},addOptions(){var t;return{...iY,...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:e,extension:n,t:r})=>{var o,s;return{component:qe,componentProps:{action:()=>e.commands.setImageUpload(),disabled:!((s=(o=e.can()).setImage)!=null&&s.call(o,{})),icon:"ImageUp",tooltip:r("editor.image.tooltip")}}}}},addProseMirrorPlugins(){const{toast:t}=Tb(),{t:e}=At(),r=JE({validateFn:o=>this.options.acceptMimes.includes(o.type)?o.size>this.options.maxSize?(t({description:`${e("editor.imageUpload.fileSizeTooBig")} ${sY(this.options.maxSize)}.`,duration:2e3}),!1):!0:(t({description:e("editor.imageUpload.fileTypeNotSupported"),duration:2e3}),!1),onUpload:this.options.upload});return[new Ne({props:{handlePaste:(o,s)=>!s.clipboardData||Array.from(s.clipboardData.items||[]).some(l=>l.type==="text/html")?!1:ZX(o,s,r),handleDrop:(o,s,a,l)=>(!(s instanceof DragEvent)||!s.dataTransfer||QX(o,s,l,r),!1)}}),XX()]}}),lY={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"},uY={key:0,class:"flex justify-center items-center gap-3 text-s"},cY={key:1,class:"flex justify-between items-center w-full"},dY={class:"flex justify-center items-center gap-3"},fY={class:"text-sm"},pY={class:"flex items-center gap-2"},hY=i.defineComponent({__name:"VideoUploader",props:{...zs},setup(t){const e=t,n=i.ref(""),r=i.ref(!1),o=i.ref(),{t:s}=At();function a(f){var b,v;r.value=!0;const p=(b=f==null?void 0:f.target)==null?void 0:b.files;if(!e.editor||e.editor.isDestroyed||p.length===0)return;const m=p[0],g=(v=e.editor.extensionManager.extensions.find(w=>w.name==="videoUpload"))==null?void 0:v.options;g==null||g.upload([m]).then(w=>{e.editor.chain().setVideo({src:w[0].src,width:"100%"}).deleteRange({from:e.getPos(),to:e.getPos()}).focus().run(),r.value=!1})}function l(){e.editor.chain().setVideo({src:n.value,width:"100%"}).deleteRange({from:e.getPos(),to:e.getPos()}).focus().run()}function u(){e.deleteNode()}function c(){var f;(f=o.value)==null||f.click()}return(f,p)=>(i.openBlock(),i.createBlock(i.unref($s),{as:"div","data-drag-handle":""},{default:i.withCtx(()=>[i.createVNode(i.unref(ul),{"default-open":"",modal:""},{default:i.withCtx(()=>[i.createVNode(i.unref(fl),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",lY,[r.value?(i.openBlock(),i.createElementBlock("div",uY,[i.createVNode(i.unref(jt),{class:"animate-spin w-6 h-6",name:"LoaderCircle"}),i.createElementVNode("span",null,i.toDisplayString(i.unref(s)("editor.video.dialog.uploading"))+"...",1)])):(i.openBlock(),i.createElementBlock("div",cY,[i.createElementVNode("div",dY,[i.createVNode(i.unref(jt),{name:"Video",class:"w-6 h-6"}),i.createElementVNode("span",fY,i.toDisplayString(i.unref(s)("editor.video.dialog.title")),1)]),i.createVNode(i.unref(jt),{name:"Trash2",class:"hover:text-ed-foreground",onClick:i.withModifiers(u,["stop"])})]))])]),_:1}),i.createVNode(i.unref(cl),{"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:i.withCtx(()=>[i.createVNode(i.unref(F1),{"default-value":"upload",class:"w-[400px]","activation-mode":"manual"},{default:i.withCtx(()=>[i.createVNode(i.unref($1),{class:"grid w-full grid-cols-2"},{default:i.withCtx(()=>[i.createVNode(i.unref($u),{value:"upload"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1}),i.createVNode(i.unref($u),{value:"link"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.link")),1)]),_:1})]),_:1}),i.createVNode(i.unref(zp),{value:"upload"},{default:i.withCtx(()=>[i.createVNode(i.unref(_n),{class:"w-full mt-1",size:"sm",onClick:c},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1}),i.createElementVNode("input",{ref_key:"fileInput",ref:o,type:"file",accept:"video/*",multiple:"",style:{display:"none"},onChange:a},null,544)]),_:1}),i.createVNode(i.unref(zp),{value:"link"},{default:i.withCtx(()=>[i.createElementVNode("form",{onSubmit:i.withModifiers(l,["prevent"])},[i.createElementVNode("div",pY,[i.createVNode(i.unref(dl),{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:i.unref(s)("editor.video.dialog.placeholder")},null,8,["modelValue","placeholder"]),i.createVNode(i.unref(_n),{type:"submit"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.button.apply")),1)]),_:1})])],32)]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1})]),_:1}))}}),mY=Bt.create({name:"videoUpload",isolating:!0,defining:!0,group:"block",draggable:!0,selectable:!0,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 Hs(hY)},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:void 0,button:({editor:e,t:n})=>({component:qe,componentProps:{action:()=>e.commands.setVideoUpload(),isActive:()=>e.isActive("video")||!1,disabled:!e.can().setVideo({}),icon:"Video",tooltip:n("editor.video.tooltip")}})}}}),Ab=vn(),gY=Ze.create({name:"preview",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:qe,componentProps:{icon:"Eye",action:()=>{Ab.togglePreview()},tooltip:e("editor.preview.tooltip"),isActive:()=>Ab.state.showPreview}})}},addCommands(){return{togglePreview:()=>()=>(Ab.togglePreview(),!0)}}}),ZE=vn(),bY=(t,e,n)=>RegExp(e?t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):t,n?"gu":"gui");function vY(t,e,n,r){const o=[],s=[];let a=[],l=0;if(!e)return{decorationsToReturn:ht.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});o.push(p)}return{decorationsToReturn:ht.create(t,o),results:s}}const yY=(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))},wY=(t,e,n,r)=>{const o=e+1;if(!r[o])return null;const{from:s,to:a}=r[e],l=a-s-t.length+n,{from:u,to:c}=r[o];return r[o]={to:c-l,from:u-l},[l,r]},xY=(t,e,{tr:n,dispatch:r})=>{let o=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=wY(t,a,o,s);c&&(o=c[0],s=c[1])}r&&r(n)}},CY=new St("findAndReplacePlugin"),EY=Ze.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:qe,componentProps:{icon:"DocSearch",tooltip:r("editor.findAndReplace.tooltip"),action:()=>{ZE.toggleFindAndReplace()},isActive:()=>ZE.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:o}=t.storage.findAndReplace;return yY(r,o,{state:e,dispatch:n}),!1},replaceAll:()=>({editor:t,tr:e,dispatch:n})=>{const{replaceTerm:r,results:o}=t.storage.findAndReplace;return xY(r,o,{tr:e,dispatch:n}),!1}}},addProseMirrorPlugins(){const t=this.editor,{searchResultClass:e,disableRegex:n}=this.options,r=a=>t.storage.findAndReplace.lastSearchTerm=a,o=a=>t.storage.findAndReplace.lastCaseSensitive=a,s=a=>t.storage.findAndReplace.lastResultIndex=a;return[new Ne({key:CY,state:{init:()=>ht.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),o(p),s(g),!c)return t.storage.findAndReplace.results=[],ht.empty;const{decorationsToReturn:v,results:w}=vY(a,bY(c,n,p),e,g);return t.storage.findAndReplace.results=w,v}},props:{decorations(a){return this.getState(a)}}})]}}),{togglePrinter:SY,state:kY}=vn(),_Y=Ze.create({name:"printer",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:qe,componentProps:{tooltip:e("editor.printer.tooltip"),action:()=>SY(),icon:"Printer",shortcutKeys:["mod","P"],isActive:()=>kY.printer}})}}}),Ob="spell-check";class TY{constructor(e,n,r,o=1e3){Gt(this,"debouncedGetMatchAndSetDecorations",tt.debounce(this.getMatchAndSetDecorations.bind(this),300));Gt(this,"debouncedGetMatchAndSetDecorationsList",tt.debounce(this.getMatchAndSetDecorationsList.bind(this),300));Gt(this,"debouncedClickEventsListener",tt.debounce(this.clickEventsListener.bind(this),0));Gt(this,"debouncedAcceptSuggestionEventsListener",tt.debounce(this.acceptSuggestionListener.bind(this),0));Gt(this,"debouncedProofreadChangedNodes",tt.debounce(this.proofreadChangedNodes.bind(this),300));Gt(this,"proofreader");Gt(this,"uiStrings");Gt(this,"showSuggestionsEvent");Gt(this,"decorationSet");Gt(this,"editorView");Gt(this,"isInitialProofreadingDone",!1);Gt(this,"lastOriginalFrom",0);Gt(this,"lastClickedDecoration",null);Gt(this,"suggestionBox");Gt(this,"isEnableSuggestion");Gt(this,"isMobile");Gt(this,"limit",1e3);Gt(this,"_debouncedProofreadDoc",tt.debounce((e,n)=>{this.proofreadDoc(e),n&&n()},500));Gt(this,"_debouncedHandleEnterKey",tt.debounce((e,n,r)=>{this.handleEnterKey(e,n),r&&r()},500));this.proofreader=e,this.uiStrings=n,this.showSuggestionsEvent=r,this.decorationSet=ht.empty,this.limit=o,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 o=[],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)===Rp&&(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)&&(o.push({node:b,pos:v}),s.add(v)),b.type.name===Rp&&(a=!0))})}),{changedNodes:o,isChangedSuperText:a}}debouncedProofreadDoc(e,n){this._debouncedProofreadDoc(e,n)}isSuperTextAlone(e,n){let r=!1;return e.descendants((o,s,a)=>o===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!==Rp}),n=n.filter(Boolean);let o="",s=1;for(const{text:u,from:c,to:f}of n){const p=c-s;p>0&&(o+=Array(p+1).join(`
|
|
277
277
|
`)),s=f,o+=u}const a=dw(o,this.limit),l=this.getMatchAndSetDecorationsList(a.map(u=>({text:u.text,originalFrom:u.offset+1})));this.editorView&&this.dispatch(this.editorView.state.tr.setMeta($n.LOADING_TRANSACTION,!0)),l.then(()=>{this.editorView&&this.dispatch(this.editorView.state.tr.setMeta($n.LOADING_TRANSACTION,!1))}),this.isInitialProofreadingDone=!0}async proofreadChangedNodes(e){const n=this.isMobile?1:2,o=e.reduce((s,a)=>{if(s.length===0)return s.push({changedNode:a,time:1}),s;const l=s[s.length-1];return a.pos===l.changedNode.pos+l.changedNode.node.nodeSize+n*l.time?(l.changedNode.node.text+=a.node.text,l.time+=1):s.push({changedNode:a,time:1}),s},[]).map(({changedNode:s})=>{var c;const a=((c=s.node)==null?void 0:c.textContent)||"",l=s.pos;return dw(a,this.limit).map(f=>({text:f.text,originalFrom:l+f.offset}))});this.debouncedGetMatchAndSetDecorationsList(o.flat())}async getMatchAndSetDecorationsList(e){const n=e.map(r=>this.getMatchAndSetDecorations(r.text,r.originalFrom));await Promise.all(n)}async getMatchAndSetDecorations(e,n){const r=await this.proofreader.proofreadText(this.proofreader.normalizeTextForLanguage(e)),o=[];for(const l of r){const u=l.startIndex+n,c=u+l.length,f=await this.proofreader.getSuggestions(l.wrongWord),p={length:l.length,wrongWord:l.wrongWord,suggestions:f};o.push(Wt.inline(u,c,{class:"spell-error",nodeName:"span",[Ob]:JSON.stringify(p)}))}const s=this.decorationSet.find(n,n+e.length);let a=this.decorationSet.remove(s);this.editorView&&(a=a.add(this.editorView.state.doc,o)),this.setDecorationSet(a),this.editorView&&this.dispatch(this.editorView.state.tr.setMeta($n.SPELLCHECKER_TRANSACTION,!0)),this.addEventListenersToDecorations()}removeEventListenersFromDecorations(){var r;const e=(r=this.editorView)==null?void 0:r.domAtPos(this.lastOriginalFrom).node,n=(e==null?void 0:e.querySelectorAll("span.spell-error"))||[];n.length&&n.forEach(o=>{o.removeEventListener("click",this.debouncedClickEventsListener)})}addEventListenersToDecorations(){var e;if(this.isEnableSuggestion)try{const n=(e=this.editorView)==null?void 0:e.domAtPos(this.lastOriginalFrom).node,r=(n==null?void 0:n.querySelectorAll("span.spell-error"))||[];if(!r.length)return;r.forEach(o=>{o.addEventListener("click",this.debouncedClickEventsListener)})}catch{}}addEventListenersToSuggestionBox(){const e=this.suggestionBox.querySelectorAll("li");e.length&&e.forEach(n=>{n.addEventListener("mousedown",this.debouncedAcceptSuggestionEventsListener)})}dispatch(e){this.editorView&&this.editorView.dispatch(e)}findChangedTextNodes(e,n,r,o){if(!e.isBlock)return!1;if(!e.isTextblock)return e.descendants((u,c)=>{this.findChangedTextNodes(u,c,r,o)}),!1;const[s,a]=[n,n+e.nodeSize];if(!(s<=r&&o<=a))return;const l={node:e,pos:n};this.onNodeChanged(l.node.textContent,l.pos+1)}onNodeChanged(e,n){n!==this.lastOriginalFrom?this.getMatchAndSetDecorations(e,n):this.debouncedGetMatchAndSetDecorations(e,n),this.lastOriginalFrom=n}async clickEventsListener(e){var c,f;if(!e.target)return;let n=e.target;for(;n&&!n.classList.contains("spell-error");)n=n.parentElement;if(!n||!n.classList.contains("spell-error"))return;this.lastClickedDecoration=n;const r=(c=n.getAttribute(Ob))==null?void 0:c.trim();if(!r){console.error("No match string provided",{spellCheckerAttributes:r});return}const{length:o,wrongWord:s,suggestions:a}=JSON.parse(r),l=((f=this.editorView)==null?void 0:f.posAtDOM(n,0))??0,u=l+o;if(this.editorView){this.addSuggestionsList(a,l,u),this.suggestionBox.style.display="";const p=OK(n);if(!p)return;const m=n.getBoundingClientRect(),g=p.getBoundingClientRect(),b=window.getComputedStyle(p).padding,v=m.left-g.left+3-parseInt(b),w=m.top-g.top+30-parseInt(b);this.suggestionBox.style.left=v+"px",this.suggestionBox.style.top=w+"px",this.showSuggestionsEvent&&this.showSuggestionsEvent(this.proofreader.normalizeTextForLanguage(s))}return this.addEventListenersToSuggestionBox(),!1}acceptSuggestionListener(e){var s;if(!e||!e.target)return;e.preventDefault(),e.stopPropagation();const n=e.target;let r=0,o=0;if(this.lastClickedDecoration&&this.editorView){const a=(s=this.lastClickedDecoration.getAttribute(Ob))==null?void 0:s.trim();if(a){const{length:l}=JSON.parse(a);r=this.editorView.posAtDOM(this.lastClickedDecoration,0),o=r+l}}this.editorView&&r>=0&&o>r&&(this.dispatch(this.editorView.state.tr.setMeta($n.ACCEPT_SUGGESTION,!0)),this.dispatch(this.editorView.state.tr.insertText(n.textContent||"",r,o))),this.hideSuggestionBox(),this.lastClickedDecoration&&(this.lastClickedDecoration.removeEventListener("click",this.debouncedClickEventsListener),this.lastClickedDecoration=null)}addSuggestionsList(e,n,r){if(this.suggestionBox.textContent="",e.length>0){const o=document.createElement("ul");o.className="suggestion-list",e.forEach(s=>{const a=document.createElement("li");a.innerText=s,a.dataset.from=n+"",a.dataset.to=r+"",o.appendChild(a)}),this.suggestionBox.appendChild(o)}if(e.length===0){const o=document.createElement("b"),s=this.uiStrings&&this.uiStrings.noSuggestions?this.uiStrings.noSuggestions:"No suggestions found";o.textContent=s,this.suggestionBox.appendChild(o)}}isUndoRedo(e,n){return e.getMeta(I8.ADD_TO_HISTORY_TRANSACTION)===!1||e.getMeta($n.APPENDED)===!0||n.isUndoRedoOperation}handleUndoRedo(e,n){var s;const r=(s=e.getMeta(I8.HISTORY_TRANSACTION))==null?void 0:s.redo;if(n.isUndoRedoOperation=!1,r)return this.debouncedProofreadDoc(e.doc),this.getDecorationSet();const{changedNodes:o}=this.getChangedNodesFromTransaction(e,!0);return o.length===0?this.getDecorationSet():o.length===1?(this.debouncedProofreadChangedNodes(o),this.getDecorationSet()):(this.debouncedProofreadDoc(e.doc),this.getDecorationSet())}isTextContentChangedOrDeleted(e){let n=!1;return{isTextContentChanged:e.steps.some(o=>{var a,l;const s=(a=o.toJSON)==null?void 0:a.call(o);return(s==null?void 0:s.stepType)==="replace"&&((l=s==null?void 0:s.slice)!=null&&l.content)?s.slice.content.some(u=>u.type==="paragraph"&&u.content&&u.content.length>0):(s==null?void 0:s.stepType)==="replace"&&(!s.slice||!s.slice.content||s.slice.content.length===0)?(n=!0,s.from!==s.to):!1}),isDeleteAction:n}}handleEnterKey(e,n){if(n)return this.debouncedProofreadDoc(e.doc),this.getDecorationSet();const r=e.getMeta($n.APPENDED_TRANSACTION);if(!r)return this.getDecorationSet();const s=r.steps[0].to,a=r.before.nodeAt(s-1);if(!(a!=null&&a.isText))return this.getDecorationSet();let l=0;return r.before.descendants((c,f)=>{c.textContent===(a==null?void 0:a.textContent)&&(l=f)}),l+((a==null?void 0:a.nodeSize)||0)===s?this.getDecorationSet():(this.debouncedProofreadDoc(e.doc),this.getDecorationSet())}handleEnterKeyDebounced(e,n,r){this._debouncedHandleEnterKey(e,n,r)}}const QE=vn(),$n={SPELLCHECKER_TRANSACTION:"spellcheckerTransaction",IS_ACTIVE_SPELLCHECK:"isActiveSpellCheck",LOADING_TRANSACTION:"loading",PREVENT_UPDATE:"preventUpdate",APPENDED:"appended",APPENDED_TRANSACTION:"appendedTransaction",ACCEPT_SUGGESTION:"acceptSuggestion",SKIP_SPELLCHECK:"skipSpellcheck",UI_EVENT:"uiEvent"},AY={DROP:"drop"},NE=Ze.create({name:"spellchecker",addOptions(){return{proofreader:void 0,uiStrings:{noSuggestions:""},button:({editor:t,t:e,isMobile:n})=>({component:qe,componentProps:{action:()=>t.commands.handleActiveSpellCheck(),isActive:()=>{var r,o,s,a;return((a=(s=(o=(r=t==null?void 0:t.extensionStorage)==null?void 0:r.spellchecker)==null?void 0:o.spellchecker)==null?void 0:s.proofreader)==null?void 0:a.enabled)||!1},icon:"SpellCheck",tooltip:"맞춤법 검사",title:n?e("editor.menubar.menu.spelling"):""}})}},addStorage(){return{didPaste:!1,spellchecker:void 0,isUndoRedoOperation:!1,pendingSpellCheck:!1,enterKeyPressed:!1}},addCommands(){return{checkSpelling:()=>({tr:t})=>(this.storage.spellchecker.proofreadDoc(t.doc),!0),selectAll:()=>({state:t,dispatch:e})=>(ZA(t,e),!0),copy:()=>()=>(document.execCommand("copy"),!0),handleActiveSpellCheck:(t=!0)=>({editor:e})=>{const n=e.extensionStorage.spellchecker.spellchecker;return n.toggleIsEnabledSpellCheck(),e.view.dispatch(e.state.tr.setMeta($n.IS_ACTIVE_SPELLCHECK,n.getIsEnabledSpellCheck())),t&&QE.setSpellCheck(n.getIsEnabledSpellCheck()),!0},setIsEnableSuggestion:t=>()=>(this.storage.spellchecker.setIsEnableSuggestion(t),!0),setIsMobile:t=>()=>(this.storage.spellchecker.setIsMobile(t),!0)}},addProseMirrorPlugins(){return[new Ne({key:new St("skipMarkPlugin"),view:e=>{const n=e.dispatch;return e.dispatch=r=>(r.steps.some(s=>s instanceof jo||s instanceof Qr)&&r.setMeta($n.SKIP_SPELLCHECK,!0),n.call(e,r)),{}}}),new Ne({key:new St("spellcheckerPlugin"),props:{decorations(e){return this.getState(e)},handlePaste:()=>{this.storage.didPaste=!0},handleClick:()=>{this.storage.spellchecker.hideSuggestionBox()},handleKeyDown:(e,n)=>((n.ctrlKey||n.metaKey)&&(n.key==="z"||n.key==="y")&&(this.storage.isUndoRedoOperation=!0,this.storage.pendingSpellCheck=!0),this.storage.enterKeyPressed&&(this.storage.pendingSpellCheck=!0),n.key==="Enter"&&(this.storage.enterKeyPressed=!0),!1)},state:{init:(e,n)=>{var o,s;const r=new TY(this.options.proofreader,this.options.uiStrings,this.options.onShowSuggestionsEvent,(o=this.options.proofreader)==null?void 0:o.limit);return this.storage.spellchecker=r,r.setDecorationSet(ht.create(n.doc,[])),QE.setSpellCheck(r.getIsEnabledSpellCheck()),(s=this.options.proofreader)!=null&&s.enabled&&r.proofreadDoc(n.doc),r.getDecorationSet()},apply:(e,n)=>{var s;if(e.getMeta($n.SKIP_SPELLCHECK))return n;const r=this.storage.spellchecker,o=e.getMeta($n.IS_ACTIVE_SPELLCHECK);if(o!==void 0)return o?r.proofreadDoc(e.doc):r.setDecorationSet(ht.empty),r.getDecorationSet();if(e.getMeta($n.SPELLCHECKER_TRANSACTION))return r.getDecorationSet();if(e.docChanged&&e.doc.nodeSize){const l=r.getDecorationSet().map(e.mapping,e.doc);if(r.setDecorationSet(l),e.getMeta($n.UI_EVENT)===AY.DROP)return r.debouncedProofreadDoc(e.doc),r.getDecorationSet();if(r.isUndoRedo(e,this.storage))return r.handleUndoRedo(e,this.storage);const{isTextContentChanged:u,isDeleteAction:c}=r.isTextContentChangedOrDeleted(e);if(c){const{changedNodes:g}=r.getChangedNodesFromTransaction(e,!1,!0);return g.length>0&&r.debouncedProofreadChangedNodes([g[0]]),r.getDecorationSet()}if(this.storage.enterKeyPressed)return r.handleEnterKeyDebounced(e,this.storage.pendingSpellCheck,()=>{this.storage.enterKeyPressed=!1,this.storage.pendingSpellCheck=!1}),r.getDecorationSet();if(this.storage.pendingSpellCheck||u)return r.debouncedProofreadDoc(e.doc,()=>{this.storage.pendingSpellCheck=!1}),r.getDecorationSet();if(e.getMeta(vE.UPDATE)||e.updated===0&&((s=e.steps[0])==null?void 0:s.structure)===!0)return r.getDecorationSet();if(e.getMeta($n.PREVENT_UPDATE)===!0&&e.before.textContent.length===0)return r.debouncedProofreadDoc(e.doc),r.getDecorationSet();this.storage.didPaste&&(this.storage.didPaste=!1);const{changedNodes:p,isChangedSuperText:m}=r.getChangedNodesFromTransaction(e);if(m)return r.debouncedProofreadDoc(e.doc),r.getDecorationSet();p.length>0&&r.debouncedProofreadChangedNodes(p)}return r.getDecorationSet()}},view:()=>({update:e=>{var r,o;const n=this.storage.spellchecker;n.setEditorView(e),(o=(r=e==null?void 0:e.dom)==null?void 0:r.parentNode)==null||o.appendChild(n.getSuggestionBox())}})})]}});function eS(t,e){return function(){return t.apply(e,arguments)}}const{toString:OY}=Object.prototype,{getPrototypeOf:Mb}=Object,Hp=(t=>e=>{const n=OY.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),po=t=>(t=t.toLowerCase(),e=>Hp(e)===t),Up=t=>e=>typeof e===t,{isArray:_l}=Array,fc=Up("undefined");function MY(t){return t!==null&&!fc(t)&&t.constructor!==null&&!fc(t.constructor)&&wr(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const tS=po("ArrayBuffer");function BY(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&tS(t.buffer),e}const IY=Up("string"),wr=Up("function"),nS=Up("number"),Wp=t=>t!==null&&typeof t=="object",RY=t=>t===!0||t===!1,jp=t=>{if(Hp(t)!=="object")return!1;const e=Mb(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},LY=po("Date"),PY=po("File"),DY=po("Blob"),VY=po("FileList"),FY=t=>Wp(t)&&wr(t.pipe),$Y=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||wr(t.append)&&((e=Hp(t))==="formdata"||e==="object"&&wr(t.toString)&&t.toString()==="[object FormData]"))},zY=po("URLSearchParams"),[HY,UY,WY,jY]=["ReadableStream","Request","Response","Headers"].map(po),qY=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function pc(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),_l(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),a=s.length;let l;for(r=0;r<a;r++)l=s[r],e.call(null,t[l],l,t)}}function rS(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const da=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,oS=t=>!fc(t)&&t!==da;function Bb(){const{caseless:t}=oS(this)&&this||{},e={},n=(r,o)=>{const s=t&&rS(e,o)||o;jp(e[s])&&jp(r)?e[s]=Bb(e[s],r):jp(r)?e[s]=Bb({},r):_l(r)?e[s]=r.slice():e[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&pc(arguments[r],n);return e}const KY=(t,e,n,{allOwnKeys:r}={})=>(pc(e,(o,s)=>{n&&wr(o)?t[s]=eS(o,n):t[s]=o},{allOwnKeys:r}),t),GY=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),XY=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},YY=(t,e,n,r)=>{let o,s,a;const l={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)a=o[s],(!r||r(a,t,e))&&!l[a]&&(e[a]=t[a],l[a]=!0);t=n!==!1&&Mb(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},JY=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},ZY=t=>{if(!t)return null;if(_l(t))return t;let e=t.length;if(!nS(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},QY=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Mb(Uint8Array)),NY=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=r.next())&&!o.done;){const s=o.value;e.call(t,s[0],s[1])}},eJ=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},tJ=po("HTMLFormElement"),nJ=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),iS=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),rJ=po("RegExp"),sS=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};pc(n,(o,s)=>{let a;(a=e(o,s,t))!==!1&&(r[s]=a||o)}),Object.defineProperties(t,r)},oJ=t=>{sS(t,(e,n)=>{if(wr(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(wr(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},iJ=(t,e)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return _l(t)?r(t):r(String(t).split(e)),n},sJ=()=>{},aJ=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function lJ(t){return!!(t&&wr(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const uJ=t=>{const e=new Array(10),n=(r,o)=>{if(Wp(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const s=_l(r)?[]:{};return pc(r,(a,l)=>{const u=n(a,o+1);!fc(u)&&(s[l]=u)}),e[o]=void 0,s}}return r};return n(t,0)},cJ=po("AsyncFunction"),dJ=t=>t&&(Wp(t)||wr(t))&&wr(t.then)&&wr(t.catch),aS=((t,e)=>t?setImmediate:e?((n,r)=>(da.addEventListener("message",({source:o,data:s})=>{o===da&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),da.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",wr(da.postMessage)),fJ=typeof queueMicrotask<"u"?queueMicrotask.bind(da):typeof process<"u"&&process.nextTick||aS,re={isArray:_l,isArrayBuffer:tS,isBuffer:MY,isFormData:$Y,isArrayBufferView:BY,isString:IY,isNumber:nS,isBoolean:RY,isObject:Wp,isPlainObject:jp,isReadableStream:HY,isRequest:UY,isResponse:WY,isHeaders:jY,isUndefined:fc,isDate:LY,isFile:PY,isBlob:DY,isRegExp:rJ,isFunction:wr,isStream:FY,isURLSearchParams:zY,isTypedArray:QY,isFileList:VY,forEach:pc,merge:Bb,extend:KY,trim:qY,stripBOM:GY,inherits:XY,toFlatObject:YY,kindOf:Hp,kindOfTest:po,endsWith:JY,toArray:ZY,forEachEntry:NY,matchAll:eJ,isHTMLForm:tJ,hasOwnProperty:iS,hasOwnProp:iS,reduceDescriptors:sS,freezeMethods:oJ,toObjectSet:iJ,toCamelCase:nJ,noop:sJ,toFiniteNumber:aJ,findKey:rS,global:da,isContextDefined:oS,isSpecCompliantForm:lJ,toJSONObject:uJ,isAsyncFn:cJ,isThenable:dJ,setImmediate:aS,asap:fJ};function nt(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}re.inherits(nt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:re.toJSONObject(this.config),code:this.code,status:this.status}}});const lS=nt.prototype,uS={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{uS[t]={value:t}}),Object.defineProperties(nt,uS),Object.defineProperty(lS,"isAxiosError",{value:!0}),nt.from=(t,e,n,r,o,s)=>{const a=Object.create(lS);return re.toFlatObject(t,a,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),nt.call(a,t.message,e,n,r,o),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const pJ=null;function Ib(t){return re.isPlainObject(t)||re.isArray(t)}function cS(t){return re.endsWith(t,"[]")?t.slice(0,-2):t}function dS(t,e,n){return t?t.concat(e).map(function(o,s){return o=cS(o),!n&&s?"["+o+"]":o}).join(n?".":""):e}function hJ(t){return re.isArray(t)&&!t.some(Ib)}const mJ=re.toFlatObject(re,{},null,function(e){return/^is[A-Z]/.test(e)});function qp(t,e,n){if(!re.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=re.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,w){return!re.isUndefined(w[v])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&re.isSpecCompliantForm(e);if(!re.isFunction(o))throw new TypeError("visitor must be a function");function c(b){if(b===null)return"";if(re.isDate(b))return b.toISOString();if(!u&&re.isBlob(b))throw new nt("Blob is not supported. Use a Buffer instead.");return re.isArrayBuffer(b)||re.isTypedArray(b)?u&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function f(b,v,w){let x=b;if(b&&!w&&typeof b=="object"){if(re.endsWith(v,"{}"))v=r?v:v.slice(0,-2),b=JSON.stringify(b);else if(re.isArray(b)&&hJ(b)||(re.isFileList(b)||re.endsWith(v,"[]"))&&(x=re.toArray(b)))return v=cS(v),x.forEach(function(S,C){!(re.isUndefined(S)||S===null)&&e.append(a===!0?dS([v],C,s):a===null?v:v+"[]",c(S))}),!1}return Ib(b)?!0:(e.append(dS(w,v,s),c(b)),!1)}const p=[],m=Object.assign(mJ,{defaultVisitor:f,convertValue:c,isVisitable:Ib});function g(b,v){if(!re.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+v.join("."));p.push(b),re.forEach(b,function(x,E){(!(re.isUndefined(x)||x===null)&&o.call(e,x,re.isString(E)?E.trim():E,v,m))===!0&&g(x,v?v.concat(E):[E])}),p.pop()}}if(!re.isObject(t))throw new TypeError("data must be an object");return g(t),e}function fS(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Rb(t,e){this._pairs=[],t&&qp(t,this,e)}const pS=Rb.prototype;pS.append=function(e,n){this._pairs.push([e,n])},pS.toString=function(e){const n=e?function(r){return e.call(this,r,fS)}:fS;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function gJ(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function hS(t,e,n){if(!e)return t;const r=n&&n.encode||gJ;re.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(e,n):s=re.isURLSearchParams(e)?e.toString():new Rb(e,n).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class mS{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){re.forEach(this.handlers,function(r){r!==null&&e(r)})}}const gS={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},bJ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Rb,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Lb=typeof window<"u"&&typeof document<"u",Pb=typeof navigator=="object"&&navigator||void 0,vJ=Lb&&(!Pb||["ReactNative","NativeScript","NS"].indexOf(Pb.product)<0),yJ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wJ=Lb&&window.location.href||"http://localhost",zn={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Lb,hasStandardBrowserEnv:vJ,hasStandardBrowserWebWorkerEnv:yJ,navigator:Pb,origin:wJ},Symbol.toStringTag,{value:"Module"})),...bJ};function xJ(t,e){return qp(t,new zn.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return zn.isNode&&re.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function CJ(t){return re.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function EJ(t){const e={},n=Object.keys(t);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],e[s]=t[s];return e}function bS(t){function e(n,r,o,s){let a=n[s++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),u=s>=n.length;return a=!a&&re.isArray(o)?o.length:a,u?(re.hasOwnProp(o,a)?o[a]=[o[a],r]:o[a]=r,!l):((!o[a]||!re.isObject(o[a]))&&(o[a]=[]),e(n,r,o[a],s)&&re.isArray(o[a])&&(o[a]=EJ(o[a])),!l)}if(re.isFormData(t)&&re.isFunction(t.entries)){const n={};return re.forEachEntry(t,(r,o)=>{e(CJ(r),o,n,0)}),n}return null}function SJ(t,e,n){if(re.isString(t))try{return(e||JSON.parse)(t),re.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const hc={transitional:gS,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=re.isObject(e);if(s&&re.isHTMLForm(e)&&(e=new FormData(e)),re.isFormData(e))return o?JSON.stringify(bS(e)):e;if(re.isArrayBuffer(e)||re.isBuffer(e)||re.isStream(e)||re.isFile(e)||re.isBlob(e)||re.isReadableStream(e))return e;if(re.isArrayBufferView(e))return e.buffer;if(re.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return xJ(e,this.formSerializer).toString();if((l=re.isFileList(e))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return qp(l?{"files[]":e}:e,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),SJ(e)):e}],transformResponse:[function(e){const n=this.transitional||hc.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(re.isResponse(e)||re.isReadableStream(e))return e;if(e&&re.isString(e)&&(r&&!this.responseType||o)){const a=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(l){if(a)throw l.name==="SyntaxError"?nt.from(l,nt.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:zn.classes.FormData,Blob:zn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};re.forEach(["delete","get","head","post","put","patch"],t=>{hc.headers[t]={}});const kJ=re.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_J=t=>{const e={};let n,r,o;return t&&t.split(`
|
|
278
278
|
`).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||e[n]&&kJ[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},vS=Symbol("internals");function mc(t){return t&&String(t).trim().toLowerCase()}function Kp(t){return t===!1||t==null?t:re.isArray(t)?t.map(Kp):String(t)}function TJ(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const AJ=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Db(t,e,n,r,o){if(re.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!re.isString(e)){if(re.isString(r))return e.indexOf(r)!==-1;if(re.isRegExp(r))return r.test(e)}}function OJ(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function MJ(t,e){const n=re.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,s,a){return this[r].call(this,e,o,s,a)},configurable:!0})})}let sr=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function s(l,u,c){const f=mc(u);if(!f)throw new Error("header name must be a non-empty string");const p=re.findKey(o,f);(!p||o[p]===void 0||c===!0||c===void 0&&o[p]!==!1)&&(o[p||u]=Kp(l))}const a=(l,u)=>re.forEach(l,(c,f)=>s(c,f,u));if(re.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(re.isString(e)&&(e=e.trim())&&!AJ(e))a(_J(e),n);else if(re.isHeaders(e))for(const[l,u]of e.entries())s(u,l,r);else e!=null&&s(n,e,r);return this}get(e,n){if(e=mc(e),e){const r=re.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return TJ(o);if(re.isFunction(n))return n.call(this,o,r);if(re.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=mc(e),e){const r=re.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||Db(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function s(a){if(a=mc(a),a){const l=re.findKey(r,a);l&&(!n||Db(r,r[l],l,n))&&(delete r[l],o=!0)}}return re.isArray(e)?e.forEach(s):s(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!e||Db(this,this[s],s,e,!0))&&(delete this[s],o=!0)}return o}normalize(e){const n=this,r={};return re.forEach(this,(o,s)=>{const a=re.findKey(r,s);if(a){n[a]=Kp(o),delete n[s];return}const l=e?OJ(s):String(s).trim();l!==s&&delete n[s],n[l]=Kp(o),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return re.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&re.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
279
279
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[vS]=this[vS]={accessors:{}}).accessors,o=this.prototype;function s(a){const l=mc(a);r[l]||(MJ(o,a),r[l]=!0)}return re.isArray(e)?e.forEach(s):s(e),this}};sr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),re.reduceDescriptors(sr.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),re.freezeMethods(sr);function Vb(t,e){const n=this||hc,r=e||n,o=sr.from(r.headers);let s=r.data;return re.forEach(t,function(l){s=l.call(n,s,o.normalize(),e?e.status:void 0)}),o.normalize(),s}function yS(t){return!!(t&&t.__CANCEL__)}function Tl(t,e,n){nt.call(this,t??"canceled",nt.ERR_CANCELED,e,n),this.name="CanceledError"}re.inherits(Tl,nt,{__CANCEL__:!0});function wS(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new nt("Request failed with status code "+n.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function BJ(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function IJ(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,s=0,a;return e=e!==void 0?e:1e3,function(u){const c=Date.now(),f=r[s];a||(a=c),n[o]=u,r[o]=c;let p=s,m=0;for(;p!==o;)m+=n[p++],p=p%t;if(o=(o+1)%t,o===s&&(s=(s+1)%t),c-a<e)return;const g=f&&c-f;return g?Math.round(m*1e3/g):void 0}}function RJ(t,e){let n=0,r=1e3/e,o,s;const a=(c,f=Date.now())=>{n=f,o=null,s&&(clearTimeout(s),s=null),t.apply(null,c)};return[(...c)=>{const f=Date.now(),p=f-n;p>=r?a(c,f):(o=c,s||(s=setTimeout(()=>{s=null,a(o)},r-p)))},()=>o&&a(o)]}const Gp=(t,e,n=3)=>{let r=0;const o=IJ(50,250);return RJ(s=>{const a=s.loaded,l=s.lengthComputable?s.total:void 0,u=a-r,c=o(u),f=a<=l;r=a;const p={loaded:a,total:l,progress:l?a/l:void 0,bytes:u,rate:c||void 0,estimated:c&&l&&f?(l-a)/c:void 0,event:s,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(p)},n)},xS=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},CS=t=>(...e)=>re.asap(()=>t(...e)),LJ=zn.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,zn.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(zn.origin),zn.navigator&&/(msie|trident)/i.test(zn.navigator.userAgent)):()=>!0,PJ=zn.hasStandardBrowserEnv?{write(t,e,n,r,o,s){const a=[t+"="+encodeURIComponent(e)];re.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),re.isString(r)&&a.push("path="+r),re.isString(o)&&a.push("domain="+o),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function DJ(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function VJ(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ES(t,e,n){let r=!DJ(e);return t&&(r||n==!1)?VJ(t,e):e}const SS=t=>t instanceof sr?{...t}:t;function fa(t,e){e=e||{};const n={};function r(c,f,p,m){return re.isPlainObject(c)&&re.isPlainObject(f)?re.merge.call({caseless:m},c,f):re.isPlainObject(f)?re.merge({},f):re.isArray(f)?f.slice():f}function o(c,f,p,m){if(re.isUndefined(f)){if(!re.isUndefined(c))return r(void 0,c,p,m)}else return r(c,f,p,m)}function s(c,f){if(!re.isUndefined(f))return r(void 0,f)}function a(c,f){if(re.isUndefined(f)){if(!re.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function l(c,f,p){if(p in e)return r(c,f);if(p in t)return r(void 0,c)}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(c,f,p)=>o(SS(c),SS(f),p,!0)};return re.forEach(Object.keys(Object.assign({},t,e)),function(f){const p=u[f]||o,m=p(t[f],e[f],f);re.isUndefined(m)&&p!==l||(n[f]=m)}),n}const kS=t=>{const e=fa({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:a,auth:l}=e;e.headers=a=sr.from(a),e.url=hS(ES(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(re.isFormData(n)){if(zn.hasStandardBrowserEnv||zn.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){const[c,...f]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...f].join("; "))}}if(zn.hasStandardBrowserEnv&&(r&&re.isFunction(r)&&(r=r(e)),r||r!==!1&&LJ(e.url))){const c=o&&s&&PJ.read(s);c&&a.set(o,c)}return e},FJ=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=kS(t);let s=o.data;const a=sr.from(o.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:c}=o,f,p,m,g,b;function v(){g&&g(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,!0),w.timeout=o.timeout;function x(){if(!w)return;const S=sr.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),_={data:!l||l==="text"||l==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:S,config:t,request:w};wS(function(A){n(A),v()},function(A){r(A),v()},_),w=null}"onloadend"in w?w.onloadend=x:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(x)},w.onabort=function(){w&&(r(new nt("Request aborted",nt.ECONNABORTED,t,w)),w=null)},w.onerror=function(){r(new nt("Network Error",nt.ERR_NETWORK,t,w)),w=null},w.ontimeout=function(){let C=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||gS;o.timeoutErrorMessage&&(C=o.timeoutErrorMessage),r(new nt(C,_.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,t,w)),w=null},s===void 0&&a.setContentType(null),"setRequestHeader"in w&&re.forEach(a.toJSON(),function(C,_){w.setRequestHeader(_,C)}),re.isUndefined(o.withCredentials)||(w.withCredentials=!!o.withCredentials),l&&l!=="json"&&(w.responseType=o.responseType),c&&([m,b]=Gp(c,!0),w.addEventListener("progress",m)),u&&w.upload&&([p,g]=Gp(u),w.upload.addEventListener("progress",p),w.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(f=S=>{w&&(r(!S||S.type?new Tl(null,t,w):S),w.abort(),w=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const E=BJ(o.url);if(E&&zn.protocols.indexOf(E)===-1){r(new nt("Unsupported protocol "+E+":",nt.ERR_BAD_REQUEST,t));return}w.send(s||null)})},$J=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const s=function(c){if(!o){o=!0,l();const f=c instanceof Error?c:this.reason;r.abort(f instanceof nt?f:new Tl(f instanceof Error?f.message:f))}};let a=e&&setTimeout(()=>{a=null,s(new nt(`timeout ${e} of ms exceeded`,nt.ETIMEDOUT))},e);const l=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),t=null)};t.forEach(c=>c.addEventListener("abort",s));const{signal:u}=r;return u.unsubscribe=()=>re.asap(l),u}},zJ=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},HJ=async function*(t,e){for await(const n of UJ(t))yield*zJ(n,e)},UJ=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},_S=(t,e,n,r)=>{const o=HJ(t,e);let s=0,a,l=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await o.next();if(c){l(),u.close();return}let p=f.byteLength;if(n){let m=s+=p;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw l(c),c}},cancel(u){return l(u),o.return()}},{highWaterMark:2})},Xp=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",TS=Xp&&typeof ReadableStream=="function",WJ=Xp&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),AS=(t,...e)=>{try{return!!t(...e)}catch{return!1}},jJ=TS&&AS(()=>{let t=!1;const e=new Request(zn.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),OS=64*1024,Fb=TS&&AS(()=>re.isReadableStream(new Response("").body)),Yp={stream:Fb&&(t=>t.body)};Xp&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Yp[e]&&(Yp[e]=re.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new nt(`Response type '${e}' is not supported`,nt.ERR_NOT_SUPPORT,r)})})})(new Response);const qJ=async t=>{if(t==null)return 0;if(re.isBlob(t))return t.size;if(re.isSpecCompliantForm(t))return(await new Request(zn.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(re.isArrayBufferView(t)||re.isArrayBuffer(t))return t.byteLength;if(re.isURLSearchParams(t)&&(t=t+""),re.isString(t))return(await WJ(t)).byteLength},KJ=async(t,e)=>{const n=re.toFiniteNumber(t.getContentLength());return n??qJ(e)},$b={http:pJ,xhr:FJ,fetch:Xp&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:s,timeout:a,onDownloadProgress:l,onUploadProgress:u,responseType:c,headers:f,withCredentials:p="same-origin",fetchOptions:m}=kS(t);c=c?(c+"").toLowerCase():"text";let g=$J([o,s&&s.toAbortSignal()],a),b;const v=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let w;try{if(u&&jJ&&n!=="get"&&n!=="head"&&(w=await KJ(f,r))!==0){let _=new Request(e,{method:"POST",body:r,duplex:"half"}),T;if(re.isFormData(r)&&(T=_.headers.get("content-type"))&&f.setContentType(T),_.body){const[A,L]=xS(w,Gp(CS(u)));r=_S(_.body,OS,A,L)}}re.isString(p)||(p=p?"include":"omit");const x="credentials"in Request.prototype;b=new Request(e,{...m,signal:g,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:x?p:void 0});let E=await fetch(b);const S=Fb&&(c==="stream"||c==="response");if(Fb&&(l||S&&v)){const _={};["status","statusText","headers"].forEach(R=>{_[R]=E[R]});const T=re.toFiniteNumber(E.headers.get("content-length")),[A,L]=l&&xS(T,Gp(CS(l),!0))||[];E=new Response(_S(E.body,OS,A,()=>{L&&L(),v&&v()}),_)}c=c||"text";let C=await Yp[re.findKey(Yp,c)||"text"](E,t);return!S&&v&&v(),await new Promise((_,T)=>{wS(_,T,{data:C,headers:sr.from(E.headers),status:E.status,statusText:E.statusText,config:t,request:b})})}catch(x){throw v&&v(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new nt("Network Error",nt.ERR_NETWORK,t,b),{cause:x.cause||x}):nt.from(x,x&&x.code,t,b)}})};re.forEach($b,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const MS=t=>`- ${t}`,GJ=t=>re.isFunction(t)||t===null||t===!1,BS={getAdapter:t=>{t=re.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let s=0;s<e;s++){n=t[s];let a;if(r=n,!GJ(n)&&(r=$b[(a=String(n)).toLowerCase()],r===void 0))throw new nt(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+s]=r}if(!r){const s=Object.entries(o).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
|