"use strict";(globalThis.webpackChunkinfinity_hitab_client=globalThis.webpackChunkinfinity_hitab_client||[]).push([[3528],{13528:(t,e,o)=>{o.d(e,{bR:()=>b,jE:()=>M});var i,n,s=o(57268),r=o(29445),l=o(57522),a=o(32737),d=o(51935),c=Object.defineProperty,h=(t,e,o)=>(((t,e,o)=>{e in t?c(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o})(t,"symbol"!=typeof e?e+"":e,o),o);const u=Symbol(),p=(0,s.aZ)({name:"milkdown-node-container",setup:({node:t,view:e,getPos:o,decorations:i,ctx:n,as:r},l)=>((0,s.JJ)(u,{ctx:n,node:t,view:e,getPos:o,decorations:i}),()=>{var t,e;return(0,s.h)(r,{"data-view-container":!0},null==(e=(t=l.slots).default)?void 0:e.call(t))})});p.props=["ctx","editor","node","view","getPos","decorations","as"];const v=(0,s.aZ)({name:"milkdown-content",setup:({isInline:t})=>()=>t?(0,s.Wm)("span",{"data-view-content":!0},null):(0,s.Wm)("div",{"data-view-content":!0},null)});v.props=["isInline"];const m=(0,d.kP)("abcedfghicklmn",10);class f{constructor(t,e,o,s,r,l,a,d,c){h(this,"selectNode",null==(i=this.options)?void 0:i.selectNode),h(this,"deselectNode",null==(n=this.options)?void 0:n.deselectNode),this.ctx=t,this.component=e,this.addPortal=o,this.removePortalByKey=s,this.options=r,this.node=l,this.view=a,this.getPos=d,this.decorations=c,this.key=m();const u=r.as?r.as:this.isInlineOrMark?"span":"div";this.teleportDOM=document.createElement(u),this.renderPortal()}get isInlineOrMark(){return this.node instanceof a.vc||this.node.isInline}get dom(){return this.teleportDOM.firstElementChild||this.teleportDOM}get contentDOM(){return this.node instanceof a.NB&&this.node.isLeaf?null:this.teleportDOM.querySelector("[data-view-content]")||this.dom}renderPortal(){if(!this.teleportDOM)return;const t=this.component,e=this.options.as?this.options.as:this.isInlineOrMark?"span":"div",o=(0,s.aZ)({name:"milkdown-portal",setup:()=>()=>(0,s.Wm)(s.lR,{key:this.key,to:this.teleportDOM},{default:()=>[(0,s.Wm)(p,{as:e,ctx:this.ctx,node:this.node,view:this.view,getPos:this.getPos,decorations:this.decorations},{default:()=>[(0,s.Wm)(t,null,{default:()=>[(0,s.Wm)(v,{isInline:this.isInlineOrMark},null)]})]})]})});this.addPortal((0,r.Xl)(o),this.key);const i=k();i&&i.update()}destroy(){var t,e;null==(e=(t=this.options).destroy)||e.call(t),this.removePortalByKey(this.key)}ignoreMutation(t){return this.options.ignoreMutation?this.options.ignoreMutation(t):!this.dom||!this.contentDOM||(!!(this.node instanceof a.NB&&(this.node.isLeaf||this.node.isAtom))||"selection"!==t.type&&(this.contentDOM!==this.dom&&!this.contentDOM.contains(t.target)))}update(t,e,o){var i,n;if(this.options.update){const s=null==(n=(i=this.options).update)?void 0:n.call(i,t,e,o);if(null!=s)return s}return this.node.type===t.type&&(t===this.node&&this.decorations===e||(this.node=t,this.decorations=e),!0)}}const y=Symbol(),w=(0,s.aZ)({name:"milkdown-dom-root",setup:(t,{slots:e})=>{const o=(t=>{const e=(0,r.iH)(null),o=(0,s.f3)(y,(()=>{throw new Error})),i=(0,r.Xl)({});return(0,s.bv)((()=>{e.value&&t(e.value,o).create().then((t=>{i.editor=t})).catch((t=>{}))})),(0,s.Ah)((()=>{var t,e,o;const n=null==(t=i.editor)?void 0:t.action((t=>t.get(l.U7))),s=null==(e=i.editor)?void 0:e.action((t=>t.get(l.KP)));null==(o=null==s?void 0:s.firstChild)||o.remove(),null==n||n.destroy()})),{divRef:e,editorRef:i}})(t.editor);return t.editorRef&&(t.editorRef.value={get:()=>o.editorRef.editor,dom:()=>o.divRef.value}),()=>{var t;return(0,s.Wm)("div",{ref:o.divRef},[null==(t=e.default)?void 0:t.call(e)])}}});w.props=["editor","editorRef"];const g={instance:null},k=()=>g.instance,b=(0,s.aZ)({name:"milkdown-vue-root",setup:t=>{const e=(0,r.Um)([]),o=(0,s.FN)();(0,s.wF)((()=>{g.instance=o.ctx._})),(0,s.Ah)((()=>{g.instance=null}));const i=((t,e)=>(o,i={})=>n=>(s,r,l,a)=>new f(n,o,t,e,i,s,r,l,a))((0,r.Xl)(((t,o)=>{e.push([o,t])})),(0,r.Xl)((t=>{const o=e.findIndex((e=>e[0]===t));e.splice(o,1)})));return(0,s.JJ)(y,i),()=>{const o=e.map((([t,e])=>(0,s.Wm)(e,{key:t},null)));return(0,s.Wm)(w,{editorRef:t.editorRef,editor:t.editor},"function"==typeof(i=o)||"[object Object]"===Object.prototype.toString.call(i)&&!(0,s.lA)(i)?o:{default:()=>[o]});var i}}});b.props=["editor","editorRef"];const M=t=>(...e)=>t(...e)}}]);