@gis_victory/curd-form 0.0.27 → 0.0.28

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.
@@ -31,7 +31,7 @@ const qS = {
31
31
  setup(e, { emit: t }) {
32
32
  const n = e;
33
33
  let r = n.modelValue;
34
- const i = n.item.type === "multiple-select" || n.item.type === "checkbox" || n.item.searchFormType === "multiple-select" || n.item.searchFormType === "checkbox";
34
+ const i = n.item.type === "multi-select" || n.item.type === "checkbox" || n.item.searchFormType === "multi-select" || n.item.searchFormType === "checkbox";
35
35
  i && typeof r == "string" && r && (r = r.split(","));
36
36
  const o = Oe(r);
37
37
  Oe([]);
@@ -1,4 +1,4 @@
1
- (function(qt,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue"),require("element-plus"),require("@gis_victory/gismap")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","@gis_victory/gismap"],g):(qt=typeof globalThis<"u"?globalThis:qt||self,g(qt.CurdForm={},qt.Vue,qt.ElementPlus,qt.GisMap))})(this,(function(qt,g,B,iu){"use strict";const QE={name:"FormItem"},ou=g.defineComponent({...QE,props:{modelValue:{type:[String,Number,Array,Boolean,null],default:()=>""},item:{type:Object,default:()=>({})},dropdownOptions:{type:Array,default:()=>[]},currentOperationType:{type:String,default:"default"},headers:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e;let r=n.modelValue;const i=n.item.type==="multiple-select"||n.item.type==="checkbox"||n.item.searchFormType==="multiple-select"||n.item.searchFormType==="checkbox";i&&typeof r=="string"&&r&&(r=r.split(","));const o=g.ref(r);g.ref([]);const a=t,s=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),l=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1});return g.watch(o,c=>{let d=c;i&&Array.isArray(c)&&(d=c.join(",")),a("update:modelValue",d)}),g.watch(()=>n.modelValue,c=>{let d=c;i&&typeof c=="string"&&c&&(d=c.split(",")),o.value=d}),(c,d)=>e.item.searchFormType==="select"||e.item.type==="select"?(g.openBlock(),g.createBlock(g.unref(B.ElSelect),{key:0,modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=u=>o.value=u),placeholder:e.item.placeholder||"请选择",disabled:s.value,readonly:l.value,clearable:""},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElOption),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="multi-select"||e.item.type==="multi-select"?(g.openBlock(),g.createBlock(g.unref(B.ElSelect),{key:1,modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=u=>o.value=u),placeholder:e.item.placeholder||"请选择",multiple:"",disabled:s.value,readonly:l.value,clearable:""},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElOption),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="date"||e.item.type==="date"?(g.openBlock(),g.createBlock(g.unref(B.ElDatePicker),{key:2,modelValue:o.value,"onUpdate:modelValue":d[2]||(d[2]=u=>o.value=u),type:"date","value-format":"YYYY-MM-DD",placeholder:e.item.placeholder||"请选择日期",disabled:s.value,readonly:l.value,clearable:"",style:{width:"100%"}},null,8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="daterange"||e.item.type==="daterange"?(g.openBlock(),g.createBlock(g.unref(B.ElDatePicker),{key:3,modelValue:o.value,"onUpdate:modelValue":d[3]||(d[3]=u=>o.value=u),type:"daterange","value-format":"yyyy-MM-dd",placeholder:e.item.placeholder||"请选择日期范围",disabled:s.value,readonly:l.value,clearable:""},null,8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="checkbox"||e.item.type==="checkbox"?(g.openBlock(),g.createBlock(g.unref(B.ElCheckboxGroup),{key:4,modelValue:o.value,"onUpdate:modelValue":d[4]||(d[4]=u=>o.value=u),disabled:s.value,readonly:l.value},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElCheckbox),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled","readonly"])):e.item.searchFormType==="radio"||e.item.type==="radio"?(g.openBlock(),g.createBlock(g.unref(B.ElRadioGroup),{key:5,modelValue:o.value,"onUpdate:modelValue":d[5]||(d[5]=u=>o.value=u),disabled:s.value,readonly:l.value},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElRadio),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled","readonly"])):e.item.searchFormType==="textarea"||e.item.type==="textarea"?(g.openBlock(),g.createBlock(g.unref(B.ElInput),{key:6,modelValue:o.value,"onUpdate:modelValue":d[6]||(d[6]=u=>o.value=u),type:"textarea",placeholder:e.item.placeholder||"请输入",disabled:s.value,readonly:l.value,clearable:""},null,8,["modelValue","placeholder","disabled","readonly"])):(g.openBlock(),g.createBlock(g.unref(B.ElInput),{key:7,modelValue:o.value,"onUpdate:modelValue":d[7]||(d[7]=u=>o.value=u),placeholder:e.item.placeholder||"请输入",disabled:s.value,readonly:l.value,clearable:""},null,8,["modelValue","placeholder","disabled","readonly"]))}});var ZE=g.defineComponent({name:"CircleClose",__name:"circle-close",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),g.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),XE=ZE,JE=g.defineComponent({name:"Delete",__name:"delete",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),au=JE,eS=g.defineComponent({name:"Document",__name:"document",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),su=eS,tS=g.defineComponent({name:"Download",__name:"download",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"})]))}}),nS=tS,rS=g.defineComponent({name:"EditPen",__name:"edit-pen",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64z"})]))}}),iS=rS,oS=g.defineComponent({name:"Files",__name:"files",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M128 384v448h768V384zm-32-64h832a32 32 0 0 1 32 32v512a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V352a32 32 0 0 1 32-32m64-128h704v64H160zm96-128h512v64H256z"})]))}}),lu=oS,aS=g.defineComponent({name:"Headset",__name:"headset",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M896 529.152V512a384 384 0 1 0-768 0v17.152A128 128 0 0 1 320 640v128a128 128 0 1 1-256 0V512a448 448 0 1 1 896 0v256a128 128 0 1 1-256 0V640a128 128 0 0 1 192-110.848M896 640a64 64 0 0 0-128 0v128a64 64 0 0 0 128 0zm-768 0v128a64 64 0 0 0 128 0V640a64 64 0 1 0-128 0"})]))}}),sS=aS,lS=g.defineComponent({name:"Menu",__name:"menu",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"})]))}}),cS=lS,dS=g.defineComponent({name:"MoreFilled",__name:"more-filled",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"})]))}}),uS=dS,pS=g.defineComponent({name:"Plus",__name:"plus",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),mS=pS,hS=g.defineComponent({name:"VideoCamera",__name:"video-camera",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M704 768V256H128v512zm64-416 192-96v512l-192-96v128a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 71.552v176.896l128 64V359.552zM192 320h192v64H192z"})]))}}),_S=hS,gS=g.defineComponent({name:"ZoomIn",__name:"zoom-in",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),cu=gS;const fS=(e,t)=>{let n=[];if(e)try{n=JSON.parse(e)}catch(r){console.log(r)}return Array.isArray(n)?n.map(r=>({...r,url:ES(r,t)})):[]},ES=(e,t)=>{if(e==null||t==null)return null;{let n=[];return(e.fileName||e.filename)&&n.push(`fileName=${e.fileName||e.filename}`),(e.floderName||e.flodername)&&n.push(`floderName=${e.floderName||e.flodername}`),e.position&&n.push(`position=${e.position}`),`${t}&${n.join("&")}`}},SS={class:"custom-upload-file"},bS=["src"],yS={class:"file-actions"},CS=["onClick"],vS=["onClick"],TS={class:"file-name"},NS={class:"file-actions"},OS=["onClick"],RS=["onClick"],AS={name:"FormItemUpLoad"},wS=g.defineComponent({...AS,props:{modelValue:{type:[String,Number,Array,Boolean,null],default:()=>""},item:{type:Object,default:()=>({})},currentOperationType:{type:String,default:"default"},upload:{type:String,default:""},download:{type:String,default:""},headers:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=g.ref(n.modelValue),i=g.ref([]),o=g.ref(!1),a=g.ref([]),s=g.ref(""),l=t,c=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),d=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),u=(E,C)=>{},p=E=>{const C=i.value.filter(v=>v.uid!==E.uid);i.value=C,_(C)},m=(E,C,v)=>{B.ElMessage.error("文件上传失败")},h=(E,C,v)=>{E.success?(C.filename=E.data?.filename,C.position=E.data?.position,C.floder=E.data?.floder,B.ElMessage.success("文件上传成功"),_(v)):B.ElMessage.error(E.message||"文件上传失败")},_=E=>{if(!E||E.length===0){r.value="[]";return}const C=E.map(v=>v.response?{fileName:v.response.data?.fileName,position:v.response.data?.position,floderName:v.response.data?.floderName}:{fileName:v.fileName,position:v.position,floderName:v.floderName});r.value=JSON.stringify(C)},f=E=>{const C=b(E.name||E.fileName),v=E.url||(E.response?.data?.position?n.download+"/"+E.response.data.position:"");C==="image"?(a.value=[v],o.value=!0):window.open(v,"_blank")},b=E=>{if(!E)return"other";const C=E.toLowerCase().split(".").pop()||"",v=["jpg","jpeg","png","gif","bmp","webp","svg"],N="pdf",w=["doc","docx","xls","xlsx","ppt","pptx","txt"],O=["mp4","avi","mov","wmv","flv","mkv"],L=["mp3","wav","flac","aac","ogg"];return v.includes(C)?"image":C===N?"pdf":w.includes(C)?"document":O.includes(C)?"video":L.includes(C)?"audio":"other"},S=E=>{switch(b(E)){case"pdf":return su;case"document":return su;case"video":return _S;case"audio":return sS;case"image":return lu;default:return lu}},y=E=>{switch(b(E)){case"pdf":return"#f56c6c";case"document":return"#409eff";case"video":return"#67c23a";case"audio":return"#e6a23c";default:return"#909399"}};return g.watch(r,E=>{l("update:modelValue",E)}),g.watch(()=>n.modelValue,E=>{let C=E;r.value=C}),g.onMounted(()=>{if((n.item.type==="upload"||n.item.showMethod==="upload")&&n.modelValue&&n.modelValue!==""){i.value=fS(n.modelValue,n.download)||[],a.value=i.value.map(E=>E.url),s.value=a.value[0]||"";debugger}}),(E,C)=>e.currentOperationType=="column"?(g.openBlock(),g.createBlock(g.unref(B.ElImage),{key:0,src:s.value,"preview-src-list":a.value,"initial-index":0,fit:"cover","preview-teleported":"",style:{width:"100%",height:"100%"}},null,8,["src","preview-src-list"])):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createVNode(g.unref(B.ElUpload),{"file-list":i.value,"onUpdate:fileList":C[0]||(C[0]=v=>i.value=v),action:e.upload,name:"uploadFile",headers:e.headers,accept:e.item.uploadAllowFormat||"image/*",limit:e.item.uploadCountLimit?Number(e.item.uploadCountLimit):0,"list-type":"picture-card","on-exceed":u,"on-success":h,"on-error":m,disabled:c.value,readonly:d.value,class:g.normalizeClass(["upload-small",{"upload-hidden":c.value}]),"on-preview":f,style:{width:"100%"}},{file:g.withCtx(({file:v})=>[g.createElementVNode("div",SS,[b(v.name||v.fileName)==="image"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createElementVNode("img",{src:v.url,class:"upload-image"},null,8,bS),g.createElementVNode("div",yS,[g.createElementVNode("span",{class:"file-action",onClick:N=>f(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(cu))]),_:1})],8,CS),c.value?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("span",{key:0,class:"file-action",onClick:N=>p(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(au))]),_:1})],8,vS))])],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createVNode(g.unref(B.ElIcon),{size:32,color:y(v.name||v.fileName)},{default:g.withCtx(()=>[(g.openBlock(),g.createBlock(g.resolveDynamicComponent(S(v.name||v.fileName))))]),_:2},1032,["color"]),g.createElementVNode("span",TS,g.toDisplayString(v.name||v.fileName),1),g.createElementVNode("div",NS,[g.createElementVNode("span",{class:"file-action",onClick:N=>f(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(cu))]),_:1})],8,OS),c.value?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("span",{key:0,class:"file-action",onClick:N=>p(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(au))]),_:1})],8,RS))])],64))])]),default:g.withCtx(()=>[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(mS))]),_:1})]),_:1},8,["file-list","action","headers","accept","limit","disabled","readonly","class"]),o.value?(g.openBlock(),g.createBlock(g.unref(B.ElImageViewer),{key:0,"url-list":a.value,"show-progress":"","initial-index":0,onClose:C[1]||(C[1]=v=>o.value=!1)},null,8,["url-list"])):g.createCommentVNode("",!0)],64))}}),Rr=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Ws=Rr(wS,[["__scopeId","data-v-75a84e05"]]);var xS=Object.defineProperty,du=e=>{throw TypeError(e)},IS=(e,t,n)=>t in e?xS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t,n)=>IS(e,typeof t!="symbol"?t+"":t,n),uu=(e,t,n)=>t.has(e)||du("Cannot "+n),fi=(e,t,n)=>(uu(e,t,"read from private field"),t.get(e)),DS=(e,t,n)=>t.has(e)?du("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),kS=(e,t,n,r)=>(uu(e,t,"write to private field"),t.set(e,n),n);function Ke(e){this.content=e}Ke.prototype={constructor:Ke,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new Ke(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Ke(n)},addToStart:function(e,t){return new Ke([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ke(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new Ke(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Ke.from(e),e.size?new Ke(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Ke.from(e),e.size?new Ke(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ke.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Ke.from=function(e){if(e instanceof Ke)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ke(t)};function pu(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=pu(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function mu(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),s=t.child(--o),l=a.nodeSize;if(a==s){n-=l,r-=l;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let c=0,d=Math.min(a.text.length,s.text.length);for(;c<d&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let c=mu(a.content,s.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class M{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,s=0;s<n;a++){let l=this.content[a],c=s+l.nodeSize;if(c>t&&r(l,i+s,o||null,a)!==!1&&l.content.size){let d=s+1;l.nodesBetween(Math.max(0,t-d),Math.min(l.content.size,n-d),r,i+d)}s=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(s,l)=>{let c=s.isText?s.text.slice(Math.max(t,l)-l,n-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&r&&(a?a=!1:o+=r),o+=c},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new M(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let s=this.content[o],l=a+s.nodeSize;l>t&&((a<t||l>n)&&(s.isText?s=s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s=s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=l}return new M(r,i)}cutByIndex(t,n){return t==n?M.empty:t==0&&n==this.content.length?this:new M(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new M(i,o)}addToStart(t){return new M([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new M(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return pu(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return mu(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Io(0,t);if(t==this.size)return Io(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?Io(r+1,a):Io(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return M.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new M(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return M.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new M(n||t,r)}static from(t){if(!t)return M.empty;if(t instanceof M)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new M([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}M.empty=new M([],0);const Ks={index:0,offset:0};function Io(e,t){return Ks.index=e,Ks.offset=t,Ks}function Do(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Do(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Do(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let Ie=class Jd{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Do(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Jd.none;if(t instanceof Jd)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Ie.none=[];class ko extends Error{}class ${constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=_u(this.content,t+this.openStart,n);return r&&new $(r,this.openStart,this.openEnd)}removeBetween(t,n){return new $(hu(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return $.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new $(M.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new $(t,r,i)}}$.empty=new $(M.empty,0,0);function hu(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:s}=e.findIndex(n);if(i==t||o.isText){if(s!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(hu(o.content,t-i-1,n-i-1)))}function _u(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return e.cut(0,t).append(n).append(e.cut(t));let s=_u(a.content,t-o-1,n);return s&&e.replaceChild(i,a.copy(s))}function MS(e,t,n){if(n.openStart>e.depth)throw new ko("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ko("Inconsistent open depths");return gu(e,t,n,0)}function gu(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=gu(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,s=a.content;return Jn(a,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:a,end:s}=LS(n,e);return Jn(o,Eu(e,a,s,t,r))}else return Jn(o,Mo(e,t,r))}function fu(e,t){if(!t.type.compatibleContent(e.type))throw new ko("Cannot join "+t.type.name+" onto "+e.type.name)}function Qs(e,t,n){let r=e.node(n);return fu(r,t.node(n)),r}function Xn(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Ei(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Xn(e.nodeAfter,r),o++));for(let s=o;s<a;s++)Xn(i.child(s),r);t&&t.depth==n&&t.textOffset&&Xn(t.nodeBefore,r)}function Jn(e,t){return e.type.checkContent(t),e.copy(t)}function Eu(e,t,n,r,i){let o=e.depth>i&&Qs(e,t,i+1),a=r.depth>i&&Qs(n,r,i+1),s=[];return Ei(null,e,i,s),o&&a&&t.index(i)==n.index(i)?(fu(o,a),Xn(Jn(o,Eu(e,t,n,r,i+1)),s)):(o&&Xn(Jn(o,Mo(e,t,i+1)),s),Ei(t,n,i,s),a&&Xn(Jn(a,Mo(n,r,i+1)),s)),Ei(r,null,i,s),new M(s)}function Mo(e,t,n){let r=[];if(Ei(null,e,n,r),e.depth>n){let i=Qs(e,t,n+1);Xn(Jn(i,Mo(e,t,n+1)),r)}return Ei(t,null,n,r),new M(r)}function LS(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)r=t.node(i).copy(M.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}class Si{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Ie.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Lo(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:s,offset:l}=a.content.findIndex(o),c=o-l;if(r.push(a,s,i+l),!c||(a=a.child(s),a.isText))break;o=c-1,i+=l+1}return new Si(n,r,o)}static resolveCached(t,n){let r=Su.get(t);if(r)for(let o=0;o<r.elts.length;o++){let a=r.elts[o];if(a.pos==n)return a}else Su.set(t,r=new PS);let i=r.elts[r.i]=Si.resolve(t,n);return r.i=(r.i+1)%FS,i}}class PS{constructor(){this.elts=[],this.i=0}}const FS=12,Su=new WeakMap;class Lo{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const BS=Object.create(null);let un=class eu{constructor(t,n,r,i=Ie.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||M.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Do(this.attrs,n||t.defaultAttrs||BS)&&Ie.sameSet(this.marks,r||Ie.none)}copy(t=null){return t==this.content?this:new eu(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new eu(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return $.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),s=i.start(a),l=i.node(a).content.cut(i.pos-s,o.pos-s);return new $(l,i.depth-a,o.depth-a)}replace(t,n,r){return MS(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Si.resolveCached(this,t)}resolveNoCache(t){return Si.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),bu(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=M.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=Ie.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!Ie.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=M.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};un.prototype.text=void 0;class Po extends un{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):bu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Po(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Po(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function bu(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class er{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new US(t,n);if(r.next==null)return er.empty;let i=yu(r);r.next&&r.err("Unexpected trailing text");let o=qS(YS(i));return jS(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,s){let l=a.matchFragment(t,r);if(l&&(!n||l.validEnd))return M.from(s.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:d,next:u}=a.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let p=o(u,s.concat(d));if(p)return p}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:l}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!i.type||l.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
1
+ (function(qt,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue"),require("element-plus"),require("@gis_victory/gismap")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus","@gis_victory/gismap"],g):(qt=typeof globalThis<"u"?globalThis:qt||self,g(qt.CurdForm={},qt.Vue,qt.ElementPlus,qt.GisMap))})(this,(function(qt,g,B,iu){"use strict";const QE={name:"FormItem"},ou=g.defineComponent({...QE,props:{modelValue:{type:[String,Number,Array,Boolean,null],default:()=>""},item:{type:Object,default:()=>({})},dropdownOptions:{type:Array,default:()=>[]},currentOperationType:{type:String,default:"default"},headers:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e;let r=n.modelValue;const i=n.item.type==="multi-select"||n.item.type==="checkbox"||n.item.searchFormType==="multi-select"||n.item.searchFormType==="checkbox";i&&typeof r=="string"&&r&&(r=r.split(","));const o=g.ref(r);g.ref([]);const a=t,s=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),l=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1});return g.watch(o,c=>{let d=c;i&&Array.isArray(c)&&(d=c.join(",")),a("update:modelValue",d)}),g.watch(()=>n.modelValue,c=>{let d=c;i&&typeof c=="string"&&c&&(d=c.split(",")),o.value=d}),(c,d)=>e.item.searchFormType==="select"||e.item.type==="select"?(g.openBlock(),g.createBlock(g.unref(B.ElSelect),{key:0,modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=u=>o.value=u),placeholder:e.item.placeholder||"请选择",disabled:s.value,readonly:l.value,clearable:""},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElOption),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="multi-select"||e.item.type==="multi-select"?(g.openBlock(),g.createBlock(g.unref(B.ElSelect),{key:1,modelValue:o.value,"onUpdate:modelValue":d[1]||(d[1]=u=>o.value=u),placeholder:e.item.placeholder||"请选择",multiple:"",disabled:s.value,readonly:l.value,clearable:""},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElOption),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="date"||e.item.type==="date"?(g.openBlock(),g.createBlock(g.unref(B.ElDatePicker),{key:2,modelValue:o.value,"onUpdate:modelValue":d[2]||(d[2]=u=>o.value=u),type:"date","value-format":"YYYY-MM-DD",placeholder:e.item.placeholder||"请选择日期",disabled:s.value,readonly:l.value,clearable:"",style:{width:"100%"}},null,8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="daterange"||e.item.type==="daterange"?(g.openBlock(),g.createBlock(g.unref(B.ElDatePicker),{key:3,modelValue:o.value,"onUpdate:modelValue":d[3]||(d[3]=u=>o.value=u),type:"daterange","value-format":"yyyy-MM-dd",placeholder:e.item.placeholder||"请选择日期范围",disabled:s.value,readonly:l.value,clearable:""},null,8,["modelValue","placeholder","disabled","readonly"])):e.item.searchFormType==="checkbox"||e.item.type==="checkbox"?(g.openBlock(),g.createBlock(g.unref(B.ElCheckboxGroup),{key:4,modelValue:o.value,"onUpdate:modelValue":d[4]||(d[4]=u=>o.value=u),disabled:s.value,readonly:l.value},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElCheckbox),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled","readonly"])):e.item.searchFormType==="radio"||e.item.type==="radio"?(g.openBlock(),g.createBlock(g.unref(B.ElRadioGroup),{key:5,modelValue:o.value,"onUpdate:modelValue":d[5]||(d[5]=u=>o.value=u),disabled:s.value,readonly:l.value},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(e.dropdownOptions,u=>(g.openBlock(),g.createBlock(g.unref(B.ElRadio),{key:u.id,label:u.name,value:u.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled","readonly"])):e.item.searchFormType==="textarea"||e.item.type==="textarea"?(g.openBlock(),g.createBlock(g.unref(B.ElInput),{key:6,modelValue:o.value,"onUpdate:modelValue":d[6]||(d[6]=u=>o.value=u),type:"textarea",placeholder:e.item.placeholder||"请输入",disabled:s.value,readonly:l.value,clearable:""},null,8,["modelValue","placeholder","disabled","readonly"])):(g.openBlock(),g.createBlock(g.unref(B.ElInput),{key:7,modelValue:o.value,"onUpdate:modelValue":d[7]||(d[7]=u=>o.value=u),placeholder:e.item.placeholder||"请输入",disabled:s.value,readonly:l.value,clearable:""},null,8,["modelValue","placeholder","disabled","readonly"]))}});var ZE=g.defineComponent({name:"CircleClose",__name:"circle-close",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),g.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),XE=ZE,JE=g.defineComponent({name:"Delete",__name:"delete",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),au=JE,eS=g.defineComponent({name:"Document",__name:"document",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),su=eS,tS=g.defineComponent({name:"Download",__name:"download",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"})]))}}),nS=tS,rS=g.defineComponent({name:"EditPen",__name:"edit-pen",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64z"})]))}}),iS=rS,oS=g.defineComponent({name:"Files",__name:"files",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M128 384v448h768V384zm-32-64h832a32 32 0 0 1 32 32v512a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V352a32 32 0 0 1 32-32m64-128h704v64H160zm96-128h512v64H256z"})]))}}),lu=oS,aS=g.defineComponent({name:"Headset",__name:"headset",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M896 529.152V512a384 384 0 1 0-768 0v17.152A128 128 0 0 1 320 640v128a128 128 0 1 1-256 0V512a448 448 0 1 1 896 0v256a128 128 0 1 1-256 0V640a128 128 0 0 1 192-110.848M896 640a64 64 0 0 0-128 0v128a64 64 0 0 0 128 0zm-768 0v128a64 64 0 0 0 128 0V640a64 64 0 1 0-128 0"})]))}}),sS=aS,lS=g.defineComponent({name:"Menu",__name:"menu",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"})]))}}),cS=lS,dS=g.defineComponent({name:"MoreFilled",__name:"more-filled",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"})]))}}),uS=dS,pS=g.defineComponent({name:"Plus",__name:"plus",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),mS=pS,hS=g.defineComponent({name:"VideoCamera",__name:"video-camera",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"M704 768V256H128v512zm64-416 192-96v512l-192-96v128a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 71.552v176.896l128 64V359.552zM192 320h192v64H192z"})]))}}),_S=hS,gS=g.defineComponent({name:"ZoomIn",__name:"zoom-in",setup(e){return(t,n)=>(g.openBlock(),g.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[g.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),cu=gS;const fS=(e,t)=>{let n=[];if(e)try{n=JSON.parse(e)}catch(r){console.log(r)}return Array.isArray(n)?n.map(r=>({...r,url:ES(r,t)})):[]},ES=(e,t)=>{if(e==null||t==null)return null;{let n=[];return(e.fileName||e.filename)&&n.push(`fileName=${e.fileName||e.filename}`),(e.floderName||e.flodername)&&n.push(`floderName=${e.floderName||e.flodername}`),e.position&&n.push(`position=${e.position}`),`${t}&${n.join("&")}`}},SS={class:"custom-upload-file"},bS=["src"],yS={class:"file-actions"},CS=["onClick"],vS=["onClick"],TS={class:"file-name"},NS={class:"file-actions"},OS=["onClick"],RS=["onClick"],AS={name:"FormItemUpLoad"},wS=g.defineComponent({...AS,props:{modelValue:{type:[String,Number,Array,Boolean,null],default:()=>""},item:{type:Object,default:()=>({})},currentOperationType:{type:String,default:"default"},upload:{type:String,default:""},download:{type:String,default:""},headers:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=g.ref(n.modelValue),i=g.ref([]),o=g.ref(!1),a=g.ref([]),s=g.ref(""),l=t,c=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),d=g.computed(()=>{switch(n.currentOperationType){case"default":return!1;case"details":return!0;case"add":return n.item.createFormStatus=="disabled";case"edit":return n.item.updateFormStatus=="disabled"}return!1}),u=(E,C)=>{},p=E=>{const C=i.value.filter(v=>v.uid!==E.uid);i.value=C,_(C)},m=(E,C,v)=>{B.ElMessage.error("文件上传失败")},h=(E,C,v)=>{E.success?(C.filename=E.data?.filename,C.position=E.data?.position,C.floder=E.data?.floder,B.ElMessage.success("文件上传成功"),_(v)):B.ElMessage.error(E.message||"文件上传失败")},_=E=>{if(!E||E.length===0){r.value="[]";return}const C=E.map(v=>v.response?{fileName:v.response.data?.fileName,position:v.response.data?.position,floderName:v.response.data?.floderName}:{fileName:v.fileName,position:v.position,floderName:v.floderName});r.value=JSON.stringify(C)},f=E=>{const C=b(E.name||E.fileName),v=E.url||(E.response?.data?.position?n.download+"/"+E.response.data.position:"");C==="image"?(a.value=[v],o.value=!0):window.open(v,"_blank")},b=E=>{if(!E)return"other";const C=E.toLowerCase().split(".").pop()||"",v=["jpg","jpeg","png","gif","bmp","webp","svg"],N="pdf",w=["doc","docx","xls","xlsx","ppt","pptx","txt"],O=["mp4","avi","mov","wmv","flv","mkv"],L=["mp3","wav","flac","aac","ogg"];return v.includes(C)?"image":C===N?"pdf":w.includes(C)?"document":O.includes(C)?"video":L.includes(C)?"audio":"other"},S=E=>{switch(b(E)){case"pdf":return su;case"document":return su;case"video":return _S;case"audio":return sS;case"image":return lu;default:return lu}},y=E=>{switch(b(E)){case"pdf":return"#f56c6c";case"document":return"#409eff";case"video":return"#67c23a";case"audio":return"#e6a23c";default:return"#909399"}};return g.watch(r,E=>{l("update:modelValue",E)}),g.watch(()=>n.modelValue,E=>{let C=E;r.value=C}),g.onMounted(()=>{if((n.item.type==="upload"||n.item.showMethod==="upload")&&n.modelValue&&n.modelValue!==""){i.value=fS(n.modelValue,n.download)||[],a.value=i.value.map(E=>E.url),s.value=a.value[0]||"";debugger}}),(E,C)=>e.currentOperationType=="column"?(g.openBlock(),g.createBlock(g.unref(B.ElImage),{key:0,src:s.value,"preview-src-list":a.value,"initial-index":0,fit:"cover","preview-teleported":"",style:{width:"100%",height:"100%"}},null,8,["src","preview-src-list"])):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createVNode(g.unref(B.ElUpload),{"file-list":i.value,"onUpdate:fileList":C[0]||(C[0]=v=>i.value=v),action:e.upload,name:"uploadFile",headers:e.headers,accept:e.item.uploadAllowFormat||"image/*",limit:e.item.uploadCountLimit?Number(e.item.uploadCountLimit):0,"list-type":"picture-card","on-exceed":u,"on-success":h,"on-error":m,disabled:c.value,readonly:d.value,class:g.normalizeClass(["upload-small",{"upload-hidden":c.value}]),"on-preview":f,style:{width:"100%"}},{file:g.withCtx(({file:v})=>[g.createElementVNode("div",SS,[b(v.name||v.fileName)==="image"?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createElementVNode("img",{src:v.url,class:"upload-image"},null,8,bS),g.createElementVNode("div",yS,[g.createElementVNode("span",{class:"file-action",onClick:N=>f(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(cu))]),_:1})],8,CS),c.value?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("span",{key:0,class:"file-action",onClick:N=>p(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(au))]),_:1})],8,vS))])],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createVNode(g.unref(B.ElIcon),{size:32,color:y(v.name||v.fileName)},{default:g.withCtx(()=>[(g.openBlock(),g.createBlock(g.resolveDynamicComponent(S(v.name||v.fileName))))]),_:2},1032,["color"]),g.createElementVNode("span",TS,g.toDisplayString(v.name||v.fileName),1),g.createElementVNode("div",NS,[g.createElementVNode("span",{class:"file-action",onClick:N=>f(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(cu))]),_:1})],8,OS),c.value?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("span",{key:0,class:"file-action",onClick:N=>p(v)},[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(au))]),_:1})],8,RS))])],64))])]),default:g.withCtx(()=>[g.createVNode(g.unref(B.ElIcon),null,{default:g.withCtx(()=>[g.createVNode(g.unref(mS))]),_:1})]),_:1},8,["file-list","action","headers","accept","limit","disabled","readonly","class"]),o.value?(g.openBlock(),g.createBlock(g.unref(B.ElImageViewer),{key:0,"url-list":a.value,"show-progress":"","initial-index":0,onClose:C[1]||(C[1]=v=>o.value=!1)},null,8,["url-list"])):g.createCommentVNode("",!0)],64))}}),Rr=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Ws=Rr(wS,[["__scopeId","data-v-75a84e05"]]);var xS=Object.defineProperty,du=e=>{throw TypeError(e)},IS=(e,t,n)=>t in e?xS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t,n)=>IS(e,typeof t!="symbol"?t+"":t,n),uu=(e,t,n)=>t.has(e)||du("Cannot "+n),fi=(e,t,n)=>(uu(e,t,"read from private field"),t.get(e)),DS=(e,t,n)=>t.has(e)?du("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),kS=(e,t,n,r)=>(uu(e,t,"write to private field"),t.set(e,n),n);function Ke(e){this.content=e}Ke.prototype={constructor:Ke,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new Ke(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Ke(n)},addToStart:function(e,t){return new Ke([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ke(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new Ke(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Ke.from(e),e.size?new Ke(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Ke.from(e),e.size?new Ke(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ke.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Ke.from=function(e){if(e instanceof Ke)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ke(t)};function pu(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=pu(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function mu(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=e.child(--i),s=t.child(--o),l=a.nodeSize;if(a==s){n-=l,r-=l;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let c=0,d=Math.min(a.text.length,s.text.length);for(;c<d&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let c=mu(a.content,s.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class M{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let a=0,s=0;s<n;a++){let l=this.content[a],c=s+l.nodeSize;if(c>t&&r(l,i+s,o||null,a)!==!1&&l.content.size){let d=s+1;l.nodesBetween(Math.max(0,t-d),Math.min(l.content.size,n-d),r,i+d)}s=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",a=!0;return this.nodesBetween(t,n,(s,l)=>{let c=s.isText?s.text.slice(Math.max(t,l)-l,n-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&r&&(a?a=!1:o+=r),o+=c},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new M(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,a=0;a<n;o++){let s=this.content[o],l=a+s.nodeSize;l>t&&((a<t||l>n)&&(s.isText?s=s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s=s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=l}return new M(r,i)}cutByIndex(t,n){return t==n?M.empty:t==0&&n==this.content.length?this:new M(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new M(i,o)}addToStart(t){return new M([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new M(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return pu(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return mu(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Io(0,t);if(t==this.size)return Io(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=t)return a==t||n>0?Io(r+1,a):Io(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return M.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new M(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return M.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new M(n||t,r)}static from(t){if(!t)return M.empty;if(t instanceof M)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new M([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}M.empty=new M([],0);const Ks={index:0,offset:0};function Io(e,t){return Ks.index=e,Ks.offset=t,Ks}function Do(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Do(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Do(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let Ie=class Jd{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Do(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Jd.none;if(t instanceof Jd)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Ie.none=[];class ko extends Error{}class ${constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=_u(this.content,t+this.openStart,n);return r&&new $(r,this.openStart,this.openEnd)}removeBetween(t,n){return new $(hu(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return $.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new $(M.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new $(t,r,i)}}$.empty=new $(M.empty,0,0);function hu(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:a,offset:s}=e.findIndex(n);if(i==t||o.isText){if(s!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(hu(o.content,t-i-1,n-i-1)))}function _u(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),a=e.maybeChild(i);if(o==t||a.isText)return e.cut(0,t).append(n).append(e.cut(t));let s=_u(a.content,t-o-1,n);return s&&e.replaceChild(i,a.copy(s))}function MS(e,t,n){if(n.openStart>e.depth)throw new ko("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ko("Inconsistent open depths");return gu(e,t,n,0)}function gu(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=gu(e,t,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,s=a.content;return Jn(a,s.cut(0,e.parentOffset).append(n.content).append(s.cut(t.parentOffset)))}else{let{start:a,end:s}=LS(n,e);return Jn(o,Eu(e,a,s,t,r))}else return Jn(o,Mo(e,t,r))}function fu(e,t){if(!t.type.compatibleContent(e.type))throw new ko("Cannot join "+t.type.name+" onto "+e.type.name)}function Qs(e,t,n){let r=e.node(n);return fu(r,t.node(n)),r}function Xn(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Ei(e,t,n,r){let i=(t||e).node(n),o=0,a=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Xn(e.nodeAfter,r),o++));for(let s=o;s<a;s++)Xn(i.child(s),r);t&&t.depth==n&&t.textOffset&&Xn(t.nodeBefore,r)}function Jn(e,t){return e.type.checkContent(t),e.copy(t)}function Eu(e,t,n,r,i){let o=e.depth>i&&Qs(e,t,i+1),a=r.depth>i&&Qs(n,r,i+1),s=[];return Ei(null,e,i,s),o&&a&&t.index(i)==n.index(i)?(fu(o,a),Xn(Jn(o,Eu(e,t,n,r,i+1)),s)):(o&&Xn(Jn(o,Mo(e,t,i+1)),s),Ei(t,n,i,s),a&&Xn(Jn(a,Mo(n,r,i+1)),s)),Ei(r,null,i,s),new M(s)}function Mo(e,t,n){let r=[];if(Ei(null,e,n,r),e.depth>n){let i=Qs(e,t,n+1);Xn(Jn(i,Mo(e,t,n+1)),r)}return Ei(t,null,n,r),new M(r)}function LS(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)r=t.node(i).copy(M.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}class Si{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Ie.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Lo(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=t;;){let{index:s,offset:l}=a.content.findIndex(o),c=o-l;if(r.push(a,s,i+l),!c||(a=a.child(s),a.isText))break;o=c-1,i+=l+1}return new Si(n,r,o)}static resolveCached(t,n){let r=Su.get(t);if(r)for(let o=0;o<r.elts.length;o++){let a=r.elts[o];if(a.pos==n)return a}else Su.set(t,r=new PS);let i=r.elts[r.i]=Si.resolve(t,n);return r.i=(r.i+1)%FS,i}}class PS{constructor(){this.elts=[],this.i=0}}const FS=12,Su=new WeakMap;class Lo{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const BS=Object.create(null);let un=class eu{constructor(t,n,r,i=Ie.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||M.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Do(this.attrs,n||t.defaultAttrs||BS)&&Ie.sameSet(this.marks,r||Ie.none)}copy(t=null){return t==this.content?this:new eu(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new eu(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return $.empty;let i=this.resolve(t),o=this.resolve(n),a=r?0:i.sharedDepth(n),s=i.start(a),l=i.node(a).content.cut(i.pos-s,o.pos-s);return new $(l,i.depth-a,o.depth-a)}replace(t,n,r){return MS(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Si.resolveCached(this,t)}resolveNoCache(t){return Si.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),bu(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=M.empty,i=0,o=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=Ie.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!Ie.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=M.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};un.prototype.text=void 0;class Po extends un{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):bu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Po(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Po(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function bu(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class er{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new US(t,n);if(r.next==null)return er.empty;let i=yu(r);r.next&&r.err("Unexpected trailing text");let o=qS(YS(i));return jS(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(a,s){let l=a.matchFragment(t,r);if(l&&(!n||l.validEnd))return M.from(s.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:d,next:u}=a.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let p=o(u,s.concat(d));if(p)return p}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:l}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!i.type||l.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return o}).join(`
2
2
  `)}}er.empty=new er(!0);class US{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function yu(e){let t=[];do t.push(HS(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function HS(e){let t=[];do t.push(VS(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function VS(e){let t=$S(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=GS(e,t);else break;return t}function Cu(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function GS(e,t){let n=Cu(e),r=n;return e.eat(",")&&(e.next!="}"?r=Cu(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function zS(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.isInGroup(t)&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function $S(e){if(e.eat("(")){let t=yu(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=zS(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function YS(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(a,s,l){let c={term:l,to:s};return t[a].push(c),c}function i(a,s){a.forEach(l=>l.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((l,c)=>l.concat(o(c,s)),[]);if(a.type=="seq")for(let l=0;;l++){let c=o(a.exprs[l],s);if(l==a.exprs.length-1)return c;i(c,s=n())}else if(a.type=="star"){let l=n();return r(s,l),i(o(a.expr,l),l),[r(l)]}else if(a.type=="plus"){let l=n();return i(o(a.expr,s),l),i(o(a.expr,l),l),[r(l)]}else{if(a.type=="opt")return[r(s)].concat(o(a.expr,s));if(a.type=="range"){let l=s;for(let c=0;c<a.min;c++){let d=n();i(o(a.expr,l),d),l=d}if(a.max==-1)i(o(a.expr,l),l);else for(let c=a.min;c<a.max;c++){let d=n();r(l,d),i(o(a.expr,l),d),l=d}return[r(l)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function vu(e,t){return t-e}function Tu(e,t){let n=[];return r(t),n.sort(vu);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:s,to:l}=o[a];!s&&n.indexOf(l)==-1&&r(l)}}}function qS(e){let t=Object.create(null);return n(Tu(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:s,to:l})=>{if(!s)return;let c;for(let d=0;d<i.length;d++)i[d][0]==s&&(c=i[d][1]);Tu(e,l).forEach(d=>{c||i.push([s,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let o=t[r.join(",")]=new er(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(vu);o.next.push({type:i[a][0],next:t[s.join(",")]||n(s)})}return o}}function jS(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let s=0;s<i.next.length;s++){let{type:l,next:c}=i.next[s];a.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Nu(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Ou(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Ru(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let o=e[i];o.validate&&o.validate(t[i])}}function Au(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new KS(e,r,t[r]);return n}let wu=class jE{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Au(t,r.attrs),this.defaultAttrs=Nu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==er.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:Ou(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new un(this,this.computeAttrs(t),M.from(n),Ie.setFrom(r))}createChecked(t=null,n,r){return n=M.from(n),this.checkContent(n),new un(this,this.computeAttrs(t),n,Ie.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=M.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(M.empty,!0);return o?new un(this,t,n.append(o),Ie.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){Ru(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Ie.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,a)=>r[o]=new jE(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function WS(e,t,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}class KS{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?WS(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Fo{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=Au(t,i.attrs),this.excluded=null;let o=Nu(this.attrs);this.instance=o?new Ie(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Ie(this,Ou(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,a)=>r[o]=new Fo(o,i++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){Ru(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class xu{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=Ke.from(t.nodes),n.marks=Ke.from(t.marks||{}),this.nodes=wu.compile(this.spec.nodes,this),this.marks=Fo.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",s=o.spec.marks;if(o.contentMatch=r[a]||(r[a]=er.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=s=="_"?null:s?Iu(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:Iu(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof wu){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Po(r,r.defaultAttrs,t,Ie.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return un.fromJSON(this,t)}markFromJSON(t){return Ie.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function Iu(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],a=o;if(o)n.push(o);else for(let s in e.marks){let l=e.marks[s];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function QS(e){return e.tag!=null}function ZS(e){return e.style!=null}let Ar=class tu{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(QS(i))this.tags.push(i);else if(ZS(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=t.nodes[i.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new Lu(this,n,!1);return r.addAll(t,Ie.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new Lu(this,n,!0);return r.addAll(t,Ie.none,n.from,n.to),$.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(eb(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],s=a.style;if(!(s.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||s.length>t.length&&(s.charCodeAt(t.length)!=61||s.slice(t.length+1)!=n))){if(a.getAttrs){let l=a.getAttrs(n);if(l===!1)continue;a.attrs=l||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let s=n[a];if((s.priority==null?50:s.priority)<o)break}n.splice(a,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Pu(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Pu(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new tu(t,tu.schemaRules(t)))}};const Du={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},XS={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ku={ol:!0,ul:!0},bi=1,Zs=2,yi=4;function Mu(e,t,n){return t!=null?(t?bi:0)|(t==="full"?Zs:0):e&&e.whitespace=="pre"?bi|Zs:n&~yi}class Bo{constructor(t,n,r,i,o,a){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=Ie.none,this.match=o||(a&yi?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(M.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&bi)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=M.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(M.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Du.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Lu{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,a=Mu(null,n.preserveWhitespace,0)|(r?yi:0);i?o=new Bo(i.type,i.attrs,Ie.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new Bo(null,null,Ie.none,!0,null,a):o=new Bo(t.schema.topNodeType,null,Ie.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,o=i.options&Zs?"full":this.localPreserveWS||(i.options&bi)>0;if(o==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
3
3
  `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],s=t.previousSibling;(!a||s&&s.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let a=t.nodeName.toLowerCase(),s;ku.hasOwnProperty(a)&&this.parser.normalizeLists&&JS(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(s=this.parser.matchTag(t,this,r));e:if(l?l.ignore:XS.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let c,d=this.needsBlock;if(Du.hasOwnProperty(a))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let u=l&&l.skip?n:this.readStyles(t,n);u&&this.addAll(t,u),c&&this.sync(o),this.needsBlock=d}else{let c=this.readStyles(t,n);c&&this.addElementByRule(t,l,c,l.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
4
4
  `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],a=r.getPropertyValue(o);if(a)for(let s=void 0;;){let l=this.parser.matchStyle(o,a,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return n}addElementByRule(t,n,r,i){let o,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r)||this.leafFallback(t,r);else{let l=this.enter(a,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let s=this.top;if(a&&a.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}o&&this.sync(s)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let a=r?t.childNodes[r]:t.firstChild,s=i==null?null:t.childNodes[i];a!=s;a=a.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(a,n);this.findAtPoint(t,o)}findPlace(t,n){let r,i;for(let o=this.open;o>=0;o--){let a=this.nodes[o],s=a.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,i=a,!s.length)||a.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(t,n){if(t.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(t,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(t.type));let o=Ie.none;for(let a of r.concat(t.marks))(i.type?i.type.allowsMarkType(a.type):Fu(a.type,t.type))&&(o=a.addToSet(o));return i.content.push(t.mark(o)),!0}return!1}enter(t,n,r,i){let o=this.findPlace(t.create(n),r);return o&&(o=this.enterInner(t,n,r,!0,i)),o}enterInner(t,n,r,i=!1,o){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(t);let s=Mu(t,o,a.options);a.options&yi&&a.content.length==0&&(s|=yi);let l=Ie.none;return r=r.filter(c=>(a.type?a.type.allowsMarkType(c.type):Fu(c.type,t))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Bo(t,n,l,i,null,s)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=bi)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(s,l)=>{for(;s>=0;s--){let c=n[s];if(c==""){if(s==n.length-1||s==0)continue;for(;l>=o;l--)if(a(s-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function JS(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&ku.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function eb(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Pu(e){let t={};for(let n in e)t[n]=e[n];return t}function Fu(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],a=s=>{o.push(s);for(let l=0;l<s.edgeCount;l++){let{type:c,next:d}=s.edge(l);if(c==t||o.indexOf(d)<0&&a(d))return!0}};if(a(i.contentMatch))return!0}}class tr{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=Xs(n).createDocumentFragment());let i=r,o=[];return t.forEach(a=>{if(o.length||a.marks.length){let s=0,l=0;for(;s<o.length&&l<a.marks.length;){let c=a.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[s][0])||c.type.spec.spanning===!1)break;s++,l++}for(;s<o.length;)i=o.pop()[1];for(;l<a.marks.length;){let c=a.marks[l++],d=this.serializeMark(c,a.isInline,n);d&&(o.push([c,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=Uo(Xs(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&Uo(Xs(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return Uo(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new tr(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Bu(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return Bu(t.marks)}}function Bu(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Xs(e){return e.document||window.document}const Uu=new WeakMap;function tb(e){let t=Uu.get(e);return t===void 0&&Uu.set(e,t=nb(e)),t}function nb(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function Uo(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=tb(r))&&o.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let s,l=n?e.createElementNS(n,i):e.createElement(i),c=t[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let p=u.indexOf(" ");p>0?l.setAttributeNS(u.slice(0,p),u.slice(p+1),c[u]):l.setAttribute(u,c[u])}}for(let u=d;u<t.length;u++){let p=t[u];if(p===0){if(u<t.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:m,contentDOM:h}=Uo(e,p,n,r);if(l.appendChild(m),h){if(s)throw new RangeError("Multiple content holes");s=h}}}return{dom:l,contentDOM:s}}const Hu=65535,Vu=Math.pow(2,16);function rb(e,t){return e+t*Vu}function Gu(e){return e&Hu}function ib(e){return(e-(e&Hu))/Vu}const zu=1,$u=2,Ho=4,Yu=8;class Js{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Yu)>0}get deletedBefore(){return(this.delInfo&(zu|Ho))>0}get deletedAfter(){return(this.delInfo&($u|Ho))>0}get deletedAcross(){return(this.delInfo&Ho)>0}}class yt{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&yt.empty)return yt.empty}recover(t){let n=0,r=Gu(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+ib(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>t)break;let c=this.ranges[s+o],d=this.ranges[s+a],u=l+c;if(t<=u){let p=c?t==l?-1:t==u?1:n:n,m=l+i+(p<0?0:d);if(r)return m;let h=t==(n<0?l:u)?null:rb(s/3,t-l),_=t==l?$u:t==u?zu:Ho;return(n<0?t!=l:t!=u)&&(_|=Yu),new Js(m,_,h)}i+=d-c}return r?t+i:new Js(t+i,0,null)}touches(t,n){let r=0,i=Gu(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[s+o],d=l+c;if(t<=d&&s==i*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),l=a+(this.inverted?0:o),c=this.ranges[i+n],d=this.ranges[i+r];t(s,s+c,l,l+d),o+=d-c}}invert(){return new yt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?yt.empty:new yt(t<0?[0,-t,0]:[0,0,t])}}yt.empty=new yt([]);class wr{constructor(t=[],n,r=0,i=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=i}slice(t=0,n=this.maps.length){return new wr(this.maps,this.mirror,t,n)}copy(){return new wr(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let i=t.getMirror(n);this.appendMap(t.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new wr;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(t,n);if(s.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,t=this.maps[l].recover(s.recover);continue}}i|=s.delInfo,t=s.pos}return r?t:new Js(t,i,null)}}const el=Object.create(null);class et{getMap(){return yt.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=el[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in el)throw new RangeError("Duplicate use of step JSON ID "+t);return el[t]=n,n.prototype.jsonID=t,n}}class He{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new He(t,null)}static fail(t){return new He(null,t)}static fromReplace(t,n,r,i){try{return He.ok(t.replace(n,r,i))}catch(o){if(o instanceof ko)return He.fail(o.message);throw o}}}function tl(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(tl(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return M.fromArray(r)}class Tn extends et{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new $(tl(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return He.fromReplace(t,this.from,this.to,o)}invert(){return new jt(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Tn(n.pos,r.pos,this.mark)}merge(t){return t instanceof Tn&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Tn(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Tn(n.from,n.to,t.markFromJSON(n.mark))}}et.jsonID("addMark",Tn);class jt extends et{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new $(tl(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return He.fromReplace(t,this.from,this.to,r)}invert(){return new Tn(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new jt(n.pos,r.pos,this.mark)}merge(t){return t instanceof jt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new jt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new jt(n.from,n.to,t.markFromJSON(n.mark))}}et.jsonID("removeMark",jt);class Nn extends et{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return He.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return He.fromReplace(t,this.pos,this.pos+1,new $(M.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Nn(this.pos,n.marks[i]);return new Nn(this.pos,this.mark)}}return new xr(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Nn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Nn(n.pos,t.markFromJSON(n.mark))}}et.jsonID("addNodeMark",Nn);class xr extends et{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return He.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return He.fromReplace(t,this.pos,this.pos+1,new $(M.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Nn(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new xr(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new xr(n.pos,t.markFromJSON(n.mark))}}et.jsonID("removeNodeMark",xr);class ze extends et{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&nl(t,this.from,this.to)?He.fail("Structure replace would overwrite content"):He.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new yt([this.from,this.to-this.from,this.slice.size])}invert(t){return new ze(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new ze(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof ze)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?$.empty:new $(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new ze(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?$.empty:new $(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new ze(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ze(n.from,n.to,$.fromJSON(t,n.slice),!!n.structure)}}et.jsonID("replace",ze);class $e extends et{constructor(t,n,r,i,o,a,s=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(t){if(this.structure&&(nl(t,this.from,this.gapFrom)||nl(t,this.gapTo,this.to)))return He.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return He.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?He.fromReplace(t,this.from,this.to,r):He.fail("Content does not fit in gap")}getMap(){return new yt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new $e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new $e(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new $e(n.from,n.to,n.gapFrom,n.gapTo,$.fromJSON(t,n.slice),n.insert,!!n.structure)}}et.jsonID("replaceAround",$e);function nl(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function ob(e,t,n,r){let i=[],o=[],a,s;e.doc.nodesBetween(t,n,(l,c,d)=>{if(!l.isInline)return;let u=l.marks;if(!r.isInSet(u)&&d.type.allowsMarkType(r.type)){let p=Math.max(c,t),m=Math.min(c+l.nodeSize,n),h=r.addToSet(u);for(let _=0;_<u.length;_++)u[_].isInSet(h)||(a&&a.to==p&&a.mark.eq(u[_])?a.to=m:i.push(a=new jt(p,m,u[_])));s&&s.to==p?s.to=m:o.push(s=new Tn(p,m,r))}}),i.forEach(l=>e.step(l)),o.forEach(l=>e.step(l))}function ab(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(a,s)=>{if(!a.isInline)return;o++;let l=null;if(r instanceof Fo){let c=a.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else r?r.isInSet(a.marks)&&(l=[r]):l=a.marks;if(l&&l.length){let c=Math.min(s+a.nodeSize,n);for(let d=0;d<l.length;d++){let u=l[d],p;for(let m=0;m<i.length;m++){let h=i[m];h.step==o-1&&u.eq(i[m].style)&&(p=h)}p?(p.to=c,p.step=o):i.push({style:u,from:Math.max(s,t),to:c,step:o})}}}),i.forEach(a=>e.step(new jt(a.from,a.to,a.style)))}function rl(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),a=[],s=t+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),d=s+c.nodeSize,u=r.matchType(c.type);if(!u)a.push(new ze(s,d,$.empty));else{r=u;for(let p=0;p<c.marks.length;p++)n.allowsMarkType(c.marks[p].type)||e.step(new jt(s,d,c.marks[p]));if(i&&c.isText&&n.whitespace!="pre"){let p,m=/\r?\n|\r/g,h;for(;p=m.exec(c.text);)h||(h=new $(M.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),a.push(new ze(s+p.index,s+p.index+p[0].length,h))}}s=d}if(!r.validEnd){let l=r.fillBefore(M.empty,!0);e.replace(s,s,new $(l,0,0))}for(let l=a.length-1;l>=0;l--)e.step(a[l])}function sb(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Ir(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(n==0||r.type.spec.isolating||!sb(r,i,o))break}return null}function lb(e,t,n){let{$from:r,$to:i,depth:o}=t,a=r.before(o+1),s=i.after(o+1),l=a,c=s,d=M.empty,u=0;for(let h=o,_=!1;h>n;h--)_||r.index(h)>0?(_=!0,d=M.from(r.node(h).copy(d)),u++):l--;let p=M.empty,m=0;for(let h=o,_=!1;h>n;h--)_||i.after(h+1)<i.end(h)?(_=!0,p=M.from(i.node(h).copy(p)),m++):c++;e.step(new $e(l,c,a,s,new $(d.append(p),u,m),d.size-u,!0))}function il(e,t,n=null,r=e){let i=cb(e,t),o=i&&db(r,t);return o?i.map(qu).concat({type:t,attrs:n}).concat(o.map(qu)):null}function qu(e){return{type:e,attrs:null}}function cb(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let a=o.length?o[0]:t;return n.canReplaceWith(r,i,a)?o:null}function db(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),a=t.contentMatch.findWrapping(o.type);if(!a)return null;let s=(a.length?a[a.length-1]:t).contentMatch;for(let l=r;s&&l<i;l++)s=s.matchType(n.child(l).type);return!s||!s.validEnd?null:a}function ub(e,t,n){let r=M.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let s=n[a].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=M.from(n[a].type.create(n[a].attrs,r))}let i=t.start,o=t.end;e.step(new $e(i,o,i,o,new $(r,0,0),n.length,!0))}function pb(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(a,s)=>{let l=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,l)&&mb(e.doc,e.mapping.slice(o).map(s),r)){let c=null;if(r.schema.linebreakReplacement){let m=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);m&&!h?c=!1:!m&&h&&(c=!0)}c===!1&&Wu(e,a,s,o),rl(e,e.mapping.slice(o).map(s,1),r,void 0,c===null);let d=e.mapping.slice(o),u=d.map(s,1),p=d.map(s+a.nodeSize,1);return e.step(new $e(u,p,u+1,p-1,new $(M.from(r.create(l,null,a.marks)),0,0),1,!0)),c===!0&&ju(e,a,s,o),!1}})}function ju(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let a,s=/\r?\n|\r/g;for(;a=s.exec(i.text);){let l=e.mapping.slice(r).map(n+1+o+a.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function Wu(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let a=e.mapping.slice(r).map(n+1+o);e.replaceWith(a,a+1,t.type.schema.text(`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gis_victory/curd-form",
3
3
  "private": false,
4
- "version": "0.0.27",
4
+ "version": "0.0.28",
5
5
  "type": "module",
6
6
  "main": "dist/curd-form.umd.js",
7
7
  "module": "dist/curd-form.es.js",