1(globalThis.webpackChunk_N_E=globalThis.webpackChunk_N_E||[]).push([[32416],{53856:(t,e,n)=>{"use strict";var r=n(610003);function i(){}function s(){}s.resetWarningCache=i,t.exports=function(){function t(t,e,n,i,s,o){if(o!==r){var l=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function e(){return t}t.isRequired=t;var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:s,resetWarningCache:i};return n.PropTypes=n,n}},127666:(t,e,n)=>{"use strict";n.d(e,{ZS:()=>k,b6:()=>y,tN:()=>w});var r=n(234510),i=n(767566),s=n(794475);class o{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){let n,r,i,s;if(0==this.eventCount)return null;let h=this.items.length;for(;;h--)if(this.items.get(h-1).selection){--h;break}e&&(r=(n=this.remapping(h,this.items.length)).maps.length);let a=t.tr,c=[],p=[];return this.items.forEach((t,e)=>{if(!t.step){n||(r=(n=this.remapping(h,e+1)).maps.length),r--,p.push(t);return}if(n){p.push(new l(t.map));let e=t.step.map(n.slice(r)),i;e&&a.maybeStep(e).doc&&(i=a.mapping.maps[a.mapping.maps.length-1],c.push(new l(i,void 0,void 0,c.length+p.length))),r--,i&&n.appendMap(i,r)}else a.maybeStep(t.step);if(t.selection)return i=n?t.selection.map(n.slice(r)):t.selection,s=new o(this.items.slice(0,h).append(p.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,n,r){var i,s;let h,c=[],p=this.eventCount,u=this.items,f=!r&&u.length?u.get(u.length-1):null;for(let n=0;n<t.steps.length;n++){let i=t.steps[n].invert(t.docs[n]),s=new l(t.mapping.maps[n],i,e),o;(o=f&&f.merge(s))&&(s=o,n?c.pop():u=u.slice(0,u.length-1)),c.push(s),e&&(p++,e=void 0),r||(f=s)}let d=p-n.depth;return d>a&&(i=u,s=d,i.forEach((t,e)=>{if(t.selection&&0==s--)return h=e,!1}),u=i.slice(h),p-=d),new o(u.append(c),p)}remapping(t,e){let n=new i.X9;return this.items.forEach((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)},t,e),n}addMaps(t){return 0==this.eventCount?this:new o(this.items.append(t.map(t=>new l(t))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,s=t.steps.length,h=this.eventCount;this.items.forEach(t=>{t.selection&&h--},r);let a=e;this.items.forEach(e=>{let r=i.getMirror(--a);if(null==r)return;s=Math.min(s,r);let o=i.maps[r];if(e.step){let s=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(i.slice(a+1,r));c&&h++,n.push(new l(o,s,c))}else n.push(new l(o))},r);let c=[];for(let t=e;t<s;t++)c.push(new l(i.maps[t]));let p=new o(this.items.slice(0,r).append(c).append(n),h);return p.emptyItemCount()>500&&(p=p.compress(this.items.length-n.length)),p}emptyItemCount(){let t=0;return this.items.forEach(e=>{!e.step&&t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,i=[],s=0;return this.items.forEach((r,o)=>{if(o>=t)i.push(r),r.selection&&s++;else if(r.step){let t=r.step.map(e.slice(n)),o=t&&t.getMap();if(n--,o&&e.appendMap(o,n),t){let h=r.selection&&r.selection.map(e.slice(n));h&&s++;let a=new l(o.invert(),t,h),c,p=i.length-1;(c=i.length&&i[p].merge(a))?i[p]=c:i.push(a)}}else r.map&&n--},this.items.length,0),new o(r.A.from(i.reverse()),s)}}o.empty=new o(r.A.empty,0);class l{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new l(e.getMap().invert(),e,this.selection)}}}class h{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let a=20;function c(t){let e=[];for(let n=t.length-1;n>=0&&0==e.length;n--)t[n].forEach((t,n,r,i)=>e.push(r,i));return e}function p(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;
1r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}let u=!1,f=null;function d(t){let e=t.plugins;if(f!=e){u=!1,f=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){u=!0;break}}return u}let m=new s.hs("history"),g=new s.hs("closeHistory");function y(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new s.k_({key:m,state:{init:()=>new h(o.empty,o.empty,null,0,-1),apply:(e,n,r)=>(function(t,e,n,r){let i=n.getMeta(m),s;if(i)return i.historyState;n.getMeta(g)&&(t=new h(t.done,t.undone,null,0,-1));let l=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(l&&l.getMeta(m))if(l.getMeta(m).redo)return new h(t.done.addTransform(n,void 0,r,d(e)),t.undone,c(n.mapping.maps),t.prevTime,t.prevComposition);else return new h(t.done,t.undone.addTransform(n,void 0,r,d(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||l&&!1===l.getMeta("addToHistory"))if(s=n.getMeta("rebased"))return new h(t.done.rebased(n,s),t.undone.rebased(n,s),p(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);else return new h(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),p(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),s=0==t.prevTime||!l&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((t,r)=>{for(let i=0;i<e.length;i+=2)t<=e[i+1]&&r>=e[i]&&(n=!0)}),n}(n,t.prevRanges)),a=l?p(t.prevRanges,n.mapping):c(n.mapping.maps);return new h(t.done.addTransform(n,s?e.selection.getBookmark():void 0,r,d(e)),o.empty,a,n.time,null==i?t.prevComposition:i)}})(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?w:"historyRedo"==n?k:null;return!!r&&!!t.editable&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}function x(t,e){return(n,r)=>{let i=m.getState(n);if(!i||0==(t?i.undone:i.done).eventCount)return!1;if(r){let s=function(t,e,n){let r=d(e),i=m.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),a=new h(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(o).setMeta(m,{redo:n,historyState:a})}(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}let w=x(!1,!0),k=x(!0,!0);x(!1,!1),x(!0,!1)},267040:(t,e,n)=>{"use strict";n.d(e,{K:()=>a,w:()=>h});var r=n(77961),i=n(794475);let s="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),o="u">typeof navigator&&/Win/.test(navigator.platform);function l(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function h(t){return new i.k_({props:{handleKeyDown:a(t)}})}function a(t){let e=function(t){let e=Object.create(null);for(let n in t)e[function(t){let e,n,r,i,o=t.split(/-(?!$)/),l=o[o.length-1];"Space"==l&&(l=" ");for(let t=0;t<o.length-1;t++){let l=o[t];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))e=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else if(/^s(hift)?$/i.test(l))r=!0;else if(/^mod$/i.test(l))s?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+l)}return e&&(l="Alt-"+l),n&&(l="Ctrl-"+l),i&&(l="Meta-"+l),r&&(l="Shift-"+l),l}(n)]=t[n];return e}(t);return function(t,n){let i=(0,r.xT)(n),s,h=e[l(i,n)];if(h&&h(t.state,t.dispatch,t))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=e[l(i,n,!1)];if(r&&r(t.state,t.dispatch,t))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(o&&n.ctrlKey&&n.altKey)&&(s=r.E3[n.keyCode])&&s!=i){let r=e[l(s,n)];if(r&&r(t.state,t.dispatch,t))return!0}}return!1}}},272436:(t,e,n)=>{t.exports=n(53856)()},372307:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(794475),i=n(767566);function s(t={}){return new r.k_({view:e=>new o(e,t)})}class o{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!=(n=e.width)?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map(e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}})}
1destroy(){this.handlers.forEach(({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e))}update(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,i,s=this.editorView.dom,o=s.getBoundingClientRect(),l=o.width/s.offsetWidth,h=o.height/s.offsetHeight;if(r){let t=n.nodeBefore,e=n.nodeAfter;if(t||e){let n=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(n){let r=n.getBoundingClientRect(),s=t?r.bottom:r.top;t&&e&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let o=this.width/2*h;i={left:r.left,right:r.right,top:s-o,bottom:s+o}}}}if(!i){let t=this.editorView.coordsAtPos(this.cursorPos),e=this.width/2*l;i={left:t.left-e,right:t.left+e,top:t.top,bottom:t.bottom}}let a=this.editorView.dom.offsetParent;if(!this.element&&(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),a&&(a!=document.body||"static"!=getComputedStyle(a).position)){let n=a.getBoundingClientRect(),r=n.width/a.offsetWidth,i=n.height/a.offsetHeight;t=n.left-a.scrollLeft*r,e=n.top-a.scrollTop*i}else t=-pageXOffset,e=-pageYOffset;this.element.style.left=(i.left-t)/l+"px",this.element.style.top=(i.top-e)/h+"px",this.element.style.width=(i.right-i.left)/l+"px",this.element.style.height=(i.bottom-i.top)/h+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,s="function"==typeof r?r(this.editorView,e,t):r;if(e&&!s){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=(0,i.Um)(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}},610003:t=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},643214:(t,e,n)=>{"use strict";n.d(e,{z:()=>c});var r=n(267040),i=n(794475),s=n(792708),o=n(197838);class l extends i.LN{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return l.valid(n)?new l(n):i.LN.near(n)}content(){return s.Ji.empty}eq(t){return t instanceof l&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new l(t.resolve(e.pos))}getBookmark(){return new h(this.anchor)}static valid(t){let e=t.parent;if(e.inlineContent||!function(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let t=r.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||a(t.type))return!0;if(t.inlineContent)return!1}}return!0}(t)||!function(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let t=r.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||a(t.type))return!0;if(t.inlineContent)return!1}}return!0}(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e,n=!1){t:for(;;){if(!n&&l.valid(t))return t;let r=t.pos,s=null;for(let n=t.depth;;n--){let i=t.node(n);if(e>0?t.indexAfter(n)<i.childCount:t.index(n)>0){s=i.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;r+=e;let o=t.doc.resolve(r);if(l.valid(o))return o}for(;;){let o=e>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!i.nh.isSelectable(s)){t=t.doc.resolve(r+s.nodeSize*e),n=!1;continue t}break}s=o,r+=e;let h=t.doc.resolve(r);if(l.valid(h))return h}return null}}}l.prototype.visible=!1,l.findFrom=l.findGapCursorFrom,i.LN.jsonID("gapcursor",l);class h{constructor(t){this.pos=t}map(t){return new h(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return l.valid(e)?new l(e):i.LN.near(e)}}function a(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function c(){return new i.k_({props:{decorations:m,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&l.valid(n)?new l(n):null,handleClick:f,handleKeyDown:p,handleDOMEvents:{beforeinput
1:d}}})}let p=(0,r.K)({ArrowLeft:u("horiz",-1),ArrowRight:u("horiz",1),ArrowUp:u("vert",-1),ArrowDown:u("vert",1)});function u(t,e){let n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,s){let o=t.selection,h=e>0?o.$to:o.$from,a=o.empty;if(o instanceof i.U3){if(!s.endOfTextblock(n)||0==h.depth)return!1;a=!1,h=t.doc.resolve(e>0?h.after():h.before())}let c=l.findGapCursorFrom(h,e,a);return!!c&&(r&&r(t.tr.setSelection(new l(c))),!0)}}function f(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!l.valid(r))return!1;let s=t.posAtCoords({left:n.clientX,top:n.clientY});return!(s&&s.inside>-1&&i.nh.isSelectable(t.state.doc.nodeAt(s.inside)))&&(t.dispatch(t.state.tr.setSelection(new l(r))),!0)}function d(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof l))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=s.FK.empty;for(let t=r.length-1;t>=0;t--)o=s.FK.from(r[t].createAndFill(null,o));let h=t.state.tr.replace(n.pos,n.pos,new s.Ji(o,0,0));return h.setSelection(i.U3.near(h.doc.resolve(n.pos+1))),t.dispatch(h),!1}function m(t){if(!(t.selection instanceof l))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",o.zF.create(t.doc,[o.NZ.widget(t.selection.head,e,{key:"gapcursor"})])}},726269:(t,e,n)=>{"use strict";n.d(e,{$B:()=>l,Sd:()=>s,T2:()=>o});var r=n(767566),i=n(792708);function s(t,e=null){return function(n,s){let{$from:o,$to:l}=n.selection,h=o.blockRange(l);if(!h)return!1;let a=s?n.tr:null;return!!function(t,e,n,s=null){let o=!1,l=e,h=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&0==e.startIndex){if(0==e.$from.index(e.depth-1))return!1;let t=h.resolve(e.start-2);l=new i.u$(t,t,e.depth),e.endIndex<e.parent.childCount&&(e=new i.u$(e.$from,h.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=(0,r.oM)(l,n,s,e);return!!a&&(t&&function(t,e,n,s,o){let l=i.FK.empty;for(let t=n.length-1;t>=0;t--)l=i.FK.from(n[t].type.create(n[t].attrs,l));t.step(new r.Wg(e.start-2*!!s,e.end,e.start,e.end,new i.Ji(l,0,0),n.length,!0));let h=0;for(let t=0;t<n.length;t++)n[t].type==o&&(h=t+1);let a=n.length-h,c=e.start+n.length-2*!!s,p=e.parent;for(let n=e.startIndex,i=e.endIndex,s=!0;n<i;n++,s=!1)!s&&(0,r.zy)(t.doc,c,a)&&(t.split(c,a),c+=2*a),c+=p.child(n).nodeSize}(t,e,a,o,n),!0)}(a,h,t,e)&&(s&&s(a.scrollIntoView()),!0)}}function o(t){return function(e,n){let{$from:s,$to:o}=e.selection,l=s.blockRange(o,e=>e.childCount>0&&e.firstChild.type==t);return!!l&&(!n||(s.node(l.depth-1).type==t?function(t,e,n,s){let o=t.tr,l=s.end,h=s.$to.end(s.depth);l<h&&(o.step(new r.Wg(l-1,h,l,h,new i.Ji(i.FK.from(n.create(null,s.parent.copy())),1,0),1,!0)),s=new i.u$(o.doc.resolve(s.$from.pos),o.doc.resolve(h),s.depth));let a=(0,r.jP)(s);if(null==a)return!1;o.lift(s,a);let c=o.doc.resolve(o.mapping.map(l,-1)-1);return(0,r.n9)(o.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&o.join(c.pos),e(o.scrollIntoView()),!0}(e,n,t,l):function(t,e,n){let s=t.tr,o=n.parent;for(let t=n.end,e=n.endIndex-1,r=n.startIndex;e>r;e--)t-=o.child(e).nodeSize,s.delete(t-1,t+1);let l=s.doc.resolve(n.start),h=l.nodeAfter;if(s.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;
vendor: 3,783 bytes, line 1
1let a=0==n.startIndex,c=n.endIndex==o.childCount,p=l.node(-1),u=l.index(-1);if(!p.canReplace(u+ +!a,u+1,h.content.append(c?i.FK.empty:i.FK.from(o))))return!1;let f=l.pos,d=f+h.nodeSize;return s.step(new r.Wg(f-!!a,d+ +!!c,f+1,d-1,new i.Ji((a?i.FK.empty:i.FK.from(o.copy(i.FK.empty))).append(c?i.FK.empty:i.FK.from(o.copy(i.FK.empty))),+!a,+!c),+!a)),e(s.scrollIntoView()),!0}(e,n,l)))}}function l(t){return function(e,n){let{$from:s,$to:o}=e.selection,l=s.blockRange(o,e=>e.childCount>0&&e.firstChild.type==t);if(!l)return!1;let h=l.startIndex;if(0==h)return!1;let a=l.parent,c=a.child(h-1);if(c.type!=t)return!1;if(n){let s=c.lastChild&&c.lastChild.type==a.type,o=i.FK.from(s?t.create():null),h=new i.Ji(i.FK.from(t.create(null,i.FK.from(a.type.create(null,o)))),s?3:1,0),p=l.start,u=l.end;n(e.tr.step(new r.Wg(p-(s?3:1),u,p,u,h,1,!0)).scrollIntoView())}return!0}}n(794475)},792708:(t,e,n)=>{"use strict";n.d(e,{CU:()=>h,FK:()=>i,Ji:()=>c,S4:()=>J,Sj:()=>D,ZF:()=>H,bP:()=>C,sX:()=>$,u$:()=>v,vI:()=>a});var r=n(814938);class i{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,i){for(let s=0,o=0;o<e;s++){let l=this.content[s],h=o+l.nodeSize;if(h>t&&!1!==n(l,r+o,i||null,s)&&l.content.size){let i=o+1;l.nodesBetween(Math.max(0,t-i),Math.min(l.content.size,e-i),n,r+i)}o=h}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",s=!0;return this.nodesBetween(t,e,(o,l)=>{let h=o.isText?o.text.slice(Math.max(t,l)-l,e-l):o.isLeaf?r?"function"==typeof r?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&h||o.isTextblock)&&n&&(s?s=!1:i+=n),i+=h},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),s=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),s=1);s<t.content.length;s++)r.push(t.content[s]);return new i(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let i=0,s=0;s<e;i++){let o=this.content[i],l=s+o.nodeSize;l>t&&((s<t||l>e)&&(o=o.isText?o.cut(Math.max(0,t-s),Math.min(o.text.length,e-s)):o.cut(Math.max(0,t-s-1),Math.min(o.content.size,e-s-1))),n.push(o),r+=o.nodeSize),s=l}return new i(n,r)}cutByIndex(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),s=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new i(r,s)}addToStart(t){return new i([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new i(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))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 e=this.content[t];if(!e)throw RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return function t(e,n,r){for(let i=0;;i++){if(i==e.childCount||i==n.childCount)return e.childCount==n.childCount?null:r;let s=e.child(i),o=n.child(i);if(s==o){r+=s.nodeSize;continue}if(!s.sameMarkup(o))return r;if(s.isText&&s.text!=o.text){for(let t=0;s.text[t]==o.text[t];t++)r++;return r}if(s.content.size||o.content.size){let e=t(s.content,o.content,r+1);if(null!=e)return e}r+=s.nodeSize}}(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return function t(e,n,r,i){for(let s=e.childCount,o=n.childCount;;
vendor: 5,056 bytes, line 1
1){if(0==s||0==o)return s==o?null:{a:r,b:i};let l=e.child(--s),h=n.child(--o),a=l.nodeSize;if(l==h){r-=a,i-=a;continue}if(!l.sameMarkup(h))return{a:r,b:i};if(l.isText&&l.text!=h.text){let t=0,e=Math.min(l.text.length,h.text.length);for(;t<e&&l.text[l.text.length-t-1]==h.text[h.text.length-t-1];)t++,r--,i--;return{a:r,b:i}}if(l.content.size||h.content.size){let e=t(l.content,h.content,r-1,i-1);if(e)return e}r-=a,i-=a}}(this,t,e,n)}findIndex(t){if(0==t)return o(0,t);if(t==this.size)return o(this.content.length,t);if(t>this.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,n=0;;e++){let r=n+this.child(e).nodeSize;if(r>=t){if(r==t)return o(e+1,r);return o(e,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return i.empty;let e,n=0;for(let r=0;r<t.length;r++){let i=t[r];n+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(e||(e=t.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new i(e||t,n)}static from(t){if(!t)return i.empty;if(t instanceof i)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new i([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}i.empty=new i([],0);let s={index:0,offset:0};function o(t,e){return s.index=t,s.offset=e,s}function l(t,e){if(t===e)return!0;if(!(t&&"object"==typeof t)||!(e&&"object"==typeof e))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!l(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!l(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class h{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&l(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw RangeError(`There is no mark type ${e.type} in this schema`);let r=n.create(e.attrs);return n.checkAttrs(r.attrs),r}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return h.none;if(t instanceof h)return[t];let e=t.slice();return e.sort((t,e)=>t.type.rank-e.type.rank),e}}h.none=[];class a extends Error{}class c{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=function t(e,n,r,i){let{index:s,offset:o}=e.findIndex(n),l=e.maybeChild(s);if(o==n||l.isText)return i&&!i.canReplace(s,s,r)?null:e.cut(0,n).append(r).append(e.cut(n));let h=t(l.content,n-o-1,r,l);return h&&e.replaceChild(s,l.copy(h))}(this.content,t+this.openStart,e);return n&&new c(n,this.openStart,this.openEnd)}removeBetween(t,e){return new c(function t(e,n,r){let{index:i,offset:s}=e.findIndex(n),o=e.maybeChild(i),{index:l,offset:h}=e.findIndex(r);if(s==n||o.isText){if(h!=r&&!e.child(l).isText)throw RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(i!=l)throw RangeError("Removing non-flat range");return e.replaceChild(i,o.copy(t(o.content,n-s-1,r-s-1)))}(this.content,t+this.openStart,e+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,e){if(!e)return c.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new c(i.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new c(t,n,r)}}function p(t,e){if(!e.type.compatibleContent(t.type))throw new a("Cannot join "+e.type.n
vendor: 4,720 bytes, line 1
1ame+" onto "+t.type.name)}function u(t,e,n){let r=t.node(n);return p(r,e.node(n)),r}function f(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function d(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(f(t.nodeAfter,r),s++));for(let t=s;t<o;t++)f(i.child(t),r);e&&e.depth==n&&e.textOffset&&f(e.nodeBefore,r)}function m(t,e){return t.type.checkContent(e),t.copy(e)}function g(t,e,n){let r=[];return d(null,t,n,r),t.depth>n&&f(m(u(t,e,n+1),g(t,e,n+1)),r),d(e,null,n,r),new i(r)}c.empty=new c(i.empty,0,0);class y{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?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[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return h.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let i=n.marks;for(var s=0;s<i.length;s++)!1!==i[s].type.spec.inclusive||r&&i[s].isInSet(r.marks)||(i=i[s--].removeFromSet(i));return i}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new v(this,t,n);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 e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let e=t;;){let{index:t,offset:s}=e.content.findIndex(i),o=i-s;if(n.push(e,t,r+s),!o||(e=e.child(t)).isText)break;i=o-1,r+=s+1}return new y(e,n,i)}static resolveCached(t,e){let n=k.get(t);if(n)for(let t=0;t<n.elts.length;t++){let r=n.elts[t];if(r.pos==e)return r}else k.set(t,n=new x);let r=n.elts[n.i]=y.resolve(t,e);return n.i=(n.i+1)%w,r}}class x{constructor(){this.elts=[],this.i=0}}let w=12,k=new WeakMap;class v{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}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)}}let S=Object.create(null);class C{constructor(t,e,n,r=h.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||i.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,e,n,r=0){this.content.nodesBetween(t,e,n,r,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,"")}
vendor: 4,155 bytes, line 1
1textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}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,e,n){return this.type==t&&l(this.attrs,e||t.defaultAttrs||S)&&h.sameSet(this.marks,n||h.none)}copy(t=null){return t==this.content?this:new C(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new C(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return c.empty;let r=this.resolve(t),i=this.resolve(e),s=n?0:r.sharedDepth(e),o=r.start(s);return new c(r.node(s).content.cut(r.pos-o,i.pos-o),r.depth-s,i.depth-s)}replace(t,e,n){var r=this.resolve(t),s=this.resolve(e);if(n.openStart>r.depth)throw new a("Inserted content deeper than insertion position");if(r.depth-n.openStart!=s.depth-n.openEnd)throw new a("Inconsistent open depths");return function t(e,n,r,s){let o=e.index(s),l=e.node(s);if(o==n.index(s)&&s<e.depth-r.openStart){let i=t(e,n,r,s+1);return l.copy(l.content.replaceChild(o,i))}if(!r.content.size)return m(l,g(e,n,s));if(r.openStart||r.openEnd||e.depth!=s||n.depth!=s){let{start:t,end:o}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(i.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e);return m(l,function t(e,n,r,s,o){let l=e.depth>o&&u(e,n,o+1),h=s.depth>o&&u(r,s,o+1),a=[];return d(null,e,o,a),l&&h&&n.index(o)==r.index(o)?(p(l,h),f(m(l,t(e,n,r,s,o+1)),a)):(l&&f(m(l,g(e,n,o+1)),a),d(n,r,o,a),h&&f(m(h,g(r,s,o+1)),a)),d(s,null,o,a),new i(a)}(e,t,o,n,s))}{let t=e.parent,i=t.content;return m(t,i.cut(0,e.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(r,s,n,0)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(!(e=e.maybeChild(n)))return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return y.resolveCached(this,t)}resolveNoCache(t){return y.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,t=>(n.isInSet(t.marks)&&(r=!0),!r)),r}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()+")"),T(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=i.empty,r=0,s=n.childCount){let o=this.contentMatchAt(t).matchFragment(n,r,s),l=o&&o.matchFragment(this.content,e);if(!l||!l.validEnd)return!1;for(let t=r;t<s;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(t).matchType(n),s=i&&i.matchFragment(this.content,e);return!!s&&s.validEnd}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=h.none;for(let e=0;e<this.marks.length;e++){let n=this.marks[e];n.type.checkAttrs(n.attrs),t=n.addToSet(t)}if(!h.sameSet(t,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}
1`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e 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(t=>t.toJSON())),t}static fromJSON(t,e){let n;if(!e)throw RangeError("Invalid input for Node.fromJSON");if(e.marks){if(!Array.isArray(e.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=i.fromJSON(t,e.content),s=t.nodeType(e.type).create(e.attrs,r,n);return s.type.checkAttrs(s.attrs),s}}C.prototype.text=void 0;class b extends C{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):T(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new b(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new b(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function T(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class E{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){var n;let r,i=new O(t,e);if(null==i.next)return E.empty;let s=function t(e){let n=[];do n.push(function(e){let n=[];do n.push(function(e){let n=function(e){if(e.eat("(")){let n=t(e);return e.eat(")")||e.err("Missing closing paren"),n}if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=(function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let t in n){let r=n[t];r.isInGroup(e)&&i.push(r)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i})(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}}(e);for(;;)if(e.eat("+"))n={type:"plus",expr:n};else if(e.eat("*"))n={type:"star",expr:n};else if(e.eat("?"))n={type:"opt",expr:n};else if(e.eat("{"))n=function(t,e){let n=A(t),r=n;return t.eat(",")&&(r="}"!=t.next?A(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}(e,n);else break;return n}(e));while(e.next&&")"!=e.next&&"|"!=e.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(e));while(e.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let o=(n=function(t){let e=[[]];return i(function t(e,s){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(t(n,s)),[]);if("seq"==e.type)for(let r=0;;r++){let o=t(e.exprs[r],s);if(r==e.exprs.length-1)return o;i(o,s=n())}else if("star"==e.type){let o=n();return r(s,o),i(t(e.expr,o),o),[r(o)]}else if("plus"==e.type){let o=n();return i(t(e.expr,s),o),i(t(e.expr,o),o),[r(o)]}else if("opt"==e.type)return[r(s)].concat(t(e.expr,s));else if("range"==e.type){let o=s;for(let r=0;r<e.min;r++){let r=n();i(t(e.expr,o),r),o=r}if(-1==e.max)i(t(e.expr,o),o);else for(let s=e.min;s<e.max;s++){let s=n();r(o,s),i(t(e.expr,o),s),o=s}return[r(o)]}else if("name"==e.type)return[r(s,void 0,e.value)];else throw Error("Unknown expr type")}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach(t=>t.to=e)}}(s),r=Object.create(null),function t(e){let i=[];e.forEach(t=>{n[t].forEach(({term:t,to:e})=>{let r;if(t){for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);I(n,e).forEach(e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})}})});let s=r[e.join(",")]=new E(e.indexOf(n.length-1)>-1);for(let e=0;e<i.length;e++){let n=i[e][1].sort(M);s.next.push({type:i[e][0],next:r[n.join(",")]||t(n)})}return s}(I(n,0)));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],i=!t.validEnd,s=[];for(let e=0;e<t.next.length;e++){let{type:n,next:o}=t.next[e];s.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(o)&&r.push(o)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,i),o}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function s(o,l){let h=o.matchFragment(t,n);if(h&&(!e||h.validEnd))return i.from(l.map(t=>t.createAndFill()));for(let t=0;t<o.next.length;t++){let{type:e,next:n}=o.next[t];if(!(e.isText||e.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let t=s(n,l.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<i.next.length;t++){let{type:s,next:o}=i.next[t];s.isLeaf||s.hasRequiredAttrs()||s.name in e||r.type&&!o.validEnd||(n.push({match:s.contentMatch,type:s,via:r}),e[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return!function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r}).join("\n")}}E.empty=new E(!0);class O{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?
vendor: 4,467 bytes, line 1
1=\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 SyntaxError(t+" (in content expression '"+this.string+"')")}}function A(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function M(t,e){return e-t}function I(t,e){let n=[];return function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t<i.length;t++){let{term:r,to:s}=i[t];r||-1!=n.indexOf(s)||e(s)}}(e),n.sort(M)}function z(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function R(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(void 0===i){let e=t[r];if(e.hasDefault)i=e.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function N(t,e,n,r){for(let r in e)if(!(r in t))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in t){let r=t[n];r.validate&&r.validate(e[n])}}function F(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new P(t,r,e[r]);return n}class B{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=F(t,n.attrs),this.defaultAttrs=z(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==E.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:R(this.attrs,t)}create(t=null,e,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new C(this,this.computeAttrs(t),i.from(e),h.setFrom(n))}createChecked(t=null,e,n){return e=i.from(e),this.checkContent(e),new C(this,this.computeAttrs(t),e,h.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=i.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),s=r&&r.fillBefore(i.empty,!0);return s?new C(this,t,e.append(s),h.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){N(this.attrs,t,"node",this.name)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){let e;if(null==this.markSet)return t;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:h.none:t}static compile(t,e){let n=Object.create(null);t.forEach((t,r)=>n[t]=new B(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class P{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(t,e,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class ${constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=F(t,r.attrs),this.excluded=null;let i=z(this.attrs);this.instance=i?new h(this,i):null}create(t=null){return!t&&this.instance?this.instance:new h(this,R(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,i)=>n[t]=new $(t,r++,e,i)),n}removeFromSet(t){for(var e=0;e<t.length;
1e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){N(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class D{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=r.A.from(t.nodes),e.marks=r.A.from(t.marks||{}),this.nodes=B.compile(this.spec.nodes,this),this.marks=$.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",i=e.spec.marks;if(e.contentMatch=n[r]||(n[r]=E.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==i?null:i?V(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:V(this,n.split(" "))}this.nodeFromJSON=t=>C.fromJSON(this,t),this.markFromJSON=t=>h.fromJSON(this,t),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof B){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new b(n,n.defaultAttrs,t,h.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeType(t){let e=this.nodes[t];if(!e)throw RangeError("Unknown node type: "+t);return e}}function V(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let e in t.marks){let r=t.marks[e];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class J{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach(t=>{if(null!=t.tag)this.tags.push(t);else if(null!=t.style){let e=/[^=]*/.exec(t.style)[0];0>n.indexOf(e)&&n.push(e),this.styles.push(t)}}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new _(this,e,!1);return n.addAll(t,h.none,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new _(this,e,!0);return n.addAll(t,h.none,e.from,e.to),c.maxOpen(n.finish())}matchTag(t,e,n){for(let s=n?this.tags.indexOf(n)+1:0;s<this.tags.length;s++){var r,i;let n=this.tags[s];if(r=t,i=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,i)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],s=r.style;if(0==s.indexOf(t)&&(!r.context||n.matchesContext(r.context))&&(!(s.length>t.length)||61==s.charCodeAt(t.length)&&s.slice(t.length+1)==e)){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach(t=>{n(t=U(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach(t=>{n(t=U(t)),t.node||t.ignore||t.mark||(t.node=e)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new J(t,J.schemaRules(t)))}}let L={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},j={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},W={ol:!0,ul:!0};function K(t,e,n){return null!=e?!!e|2*("full"===e):t&&"pre"==t.whitespace?3:-5&n}class q{constructor(t,e,n,r,i,s){this.type=t,this.attrs=e,this.marks=n,this.solid=r,this.options=s,this.content=[],this.activeMarks=h.none,this.match=i||(4&s?null:t.contentMatch)}
1findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(i.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let e=this.type.contentMatch,n;return(n=e.findWrapping(t.type))?(this.match=e,n):null}}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t=this.content[this.content.length-1],e;t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))&&(t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=t.withText(t.text.slice(0,t.text.length-e[0].length)))}let e=i.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!L.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class _{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=e.topNode,i,s=K(null,e.preserveWhitespace,0)|4*!!n;i=r?new q(r.type,r.attrs,h.none,!0,e.topMatch||r.type.contentMatch,s):n?new q(null,null,h.none,!0,null,s):new q(t.schema.topNodeType,null,h.none,!0,null,s),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:s}=this.parser;if("full"===i||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(i)if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let t=n.split(/\r?\n|\r/);for(let n=0;n<t.length;n++)n&&this.insertNode(s.linebreakReplacement.create(),e,!0),t[n]&&this.insertNode(s.text(t[n]),e,!/\S/.test(t[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let e=r.content[r.content.length-1],i=t.previousSibling;
vendor: 5,690 bytes, line 1
1(!e||i&&"BR"==i.nodeName||e.isText&&/[ \t\r\n\u000c]$/.test(e.text))&&(n=n.slice(1))}n&&this.insertNode(s.text(n),e,!/\S/.test(n)),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let r=this.localPreserveWS,i=this.top;("PRE"==t.tagName||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),o;W.hasOwnProperty(s)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&W.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(o=this.parser.matchTag(t,this,n));e:if(l?l.ignore:j.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,e);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 n,r=this.needsBlock;if(L.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);break e}let o=l&&l.skip?e:this.readStyles(t,e);o&&this.addAll(t,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(t,e);n&&this.addElementByRule(t,l,n,!1===l.consuming?o:void 0)}this.localPreserveWS=r}leafFallback(t,e){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"),e)}ignoreFallback(t,e){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let t=0;t<this.parser.matchedStyles.length;t++){let r=this.parser.matchedStyles[t],i=n.getPropertyValue(r);if(i)for(let t;;){let n=this.parser.matchStyle(r,i,this,t);if(!n)break;if(n.ignore)return null;if(e=n.clearMark?e.filter(t=>!n.clearMark(t)):e.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)t=n;else break}}return e}addElementByRule(t,e,n,r){let i,s;if(e.node)if((s=this.parser.schema.nodes[e.node]).isLeaf)this.insertNode(s.create(e.attrs),n,"BR"==t.nodeName)||this.leafFallback(t,n);else{let t=this.enter(s,e.attrs||null,n,e.preserveWhitespace);t&&(i=!0,n=t)}else{let t=this.parser.schema.marks[e.mark];n=n.concat(t.create(e.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t,n,!1));else{let r=t;"string"==typeof e.contentElement?r=t.querySelector(e.contentElement):"function"==typeof e.contentElement?r=e.contentElement(t):e.contentElement&&(r=e.contentElement),this.findAround(t,r,!0),this.addAll(r,n),this.findAround(t,r,!1)}i&&this.sync(o)&&this.open--}addAll(t,e,n,r){let i=n||0;for(let s=n?t.childNodes[n]:t.firstChild,o=null==r?null:t.childNodes[r];s!=o;s=s.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(s,e);this.findAtPoint(t,i)}findPlace(t,e,n){let r,i;for(let e=this.open,s=0;e>=0;e--){let o=this.nodes[e],l=o.findWrapping(t);if(l&&(!r||r.length>l.length+s)&&(r=l,i=o,!l.length))break;if(o.solid){if(n)break;s+=2}}if(!r)return null;this.sync(i);for(let t=0;t<r.length;t++)e=this.enterInner(r[t],null,e,!1);return e}insertNode(t,e,n){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&(e=this.enterInner(t,null,e))}let r=this.findPlace(t,e,n);if(r){this.closeExtra();let e=this.top;e.match&&(e.match=e.match.matchType(t.type));let n=h.none;for(let i of r.concat(t.marks))(e.type?e.type.allowsMarkType(i.type):G(i.type,t.type))&&(n=i.addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n,r){let i=this.findPlace(t.create(e),n,!1);return i&&(i=this.enterInner(t,e,n,!0,r)),i}enterInner(t,e,n,r=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let o=K(t,i,s.options);4&s.options&&0==s.content.length&&(o|=4);let l=h.none;return n=n.filter(e=>(s.type?!s.type.allowsMarkType(e.type):!G(e.type,t))||(l=e.addToSet(l),!1)),this.nodes.push(new q(t,e,l,r,null,o)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].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 e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;else this.localPreserveWS&&(this.nodes[e].options|=1);return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,s=(t,o)=>{for(;t>=0;t--){let l=e[t];if(""==l){if(t==e.length-1||0==t)continue;for(;o>=i;o--)if(s(t-1,o))return!0;return!1}
1{let t=o>0||0==o&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!t||t.name!=l&&!t.isInGroup(l))return!1;o--}}return!0};return s(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}}function U(t){let e={};for(let n in t)e[n]=t[n];return e}function G(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=t=>{s.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:i}=t.edge(n);if(r==e||0>s.indexOf(i)&&o(i))return!0}};if(o(i.contentMatch))return!0}}class H{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=Y(e).createDocumentFragment());let r=n,i=[];return t.forEach(t=>{if(i.length||t.marks.length){let n=0,s=0;for(;n<i.length&&s<t.marks.length;){let e=t.marks[s];if(!this.marks[e.type.name]){s++;continue}if(!e.eq(i[n][0])||!1===e.type.spec.spanning)break;n++,s++}for(;n<i.length;)r=i.pop()[1];for(;s<t.marks.length;){let n=t.marks[s++],o=this.serializeMark(n,t.isInline,e);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(t,e))}),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=Q(Y(e),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&Q(Y(n),r(t,e),null,t.attrs)}static renderSpec(t,e,n=null,r){return Q(t,e,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new H(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=X(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return X(t.marks)}}function X(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Y(t){return t.document||window.document}let Z=new WeakMap;function Q(t,e,n,r){let i,s,o;if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let l=e[0],h;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(s=Z.get(r))&&Z.set(r,(o=null,!function t(e){if(e&&"object"==typeof e)if(Array.isArray(e))if("string"==typeof e[0])o||(o=[]),o.push(e);else for(let n=0;n<e.length;n++)t(e[n]);else for(let n in e)t(e[n])}(r),s=o)),h=s)&&h.indexOf(e)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=l.indexOf(" ");a>0&&(n=l.slice(0,a),l=l.slice(a+1));let c=n?t.createElementNS(n,l):t.createElement(l),p=e[1],u=1;if(p&&"object"==typeof p&&null==p.nodeType&&!Array.isArray(p)){for(let t in u=2,p)if(null!=p[t]){let e=t.indexOf(" ");e>0?c.setAttributeNS(t.slice(0,e),t.slice(e+1),p[t]):"style"==t&&c.style?c.style.cssText=p[t]:c.setAttribute(t,p[t])}}for(let s=u;s<e.length;s++){let o=e[s];if(0===o){if(s<e.length-1||s>u)throw RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:e,contentDOM:s}=Q(t,o,n,r);if(c.appendChild(e),s){if(i)throw RangeError("Multiple content holes");i=s}}}return{dom:c,contentDOM:i}}},902267:(t,e,n)=>{"use strict";n.d(e,{$f:()=>I,G2:()=>w,I$:()=>b,Im:()=>R,Qv:()=>h,Sd:()=>y,Z1:()=>T,_G:()=>c,_e:()=>f,bh:()=>k,eB:()=>a,eT:()=>g,ec:()=>z,hy:()=>O,ic:()=>o,iz:()=>E,pC:()=>S,yY:()=>v,y_:()=>N});var r=n(767566),i=n(792708),s=n(794475);let o=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function l(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("backward",t):!(n.parentOffset>0))?n:null}let h=(t,e,n)=>{let o=l(t,n);if(!o)return!1;let h=d(o);if(!h){let n=o.blockRange(),i=n&&(0,r.jP)(n);return null!=i&&(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)}let a=h.nodeBefore;if(A(t,h,e,-1))return!0;
1if(0==o.parent.content.size&&(u(a,"end")||s.nh.isSelectable(a)))for(let n=o.depth;;n--){let l=(0,r.$L)(t.doc,o.before(n),o.after(n),i.Ji.empty);if(l&&l.slice.size<l.to-l.from){if(e){let n=t.tr.step(l);n.setSelection(u(a,"end")?s.LN.findFrom(n.doc.resolve(n.mapping.map(h.pos,-1)),-1):s.nh.create(n.doc,h.pos-a.nodeSize)),e(n.scrollIntoView())}return!0}if(1==n||o.node(n-1).childCount>1)break}return!!a.isAtom&&h.depth==o.depth-1&&(e&&e(t.tr.delete(h.pos-a.nodeSize,h.pos).scrollIntoView()),!0)},a=(t,e,n)=>{let r=l(t,n);if(!r)return!1;let i=d(r);return!!i&&p(t,i,e)},c=(t,e,n)=>{let r=m(t,n);if(!r)return!1;let i=x(r);return!!i&&p(t,i,e)};function p(t,e,n){let o=e.nodeBefore,l=e.pos-1;for(;!o.isTextblock;l--){if(o.type.spec.isolating)return!1;let t=o.lastChild;if(!t)return!1;o=t}let h=e.nodeAfter,a=e.pos+1;for(;!h.isTextblock;a++){if(h.type.spec.isolating)return!1;let t=h.firstChild;if(!t)return!1;h=t}let c=(0,r.$L)(t.doc,l,a,i.Ji.empty);if(!c||c.from!=l||c instanceof r.Ln&&c.slice.size>=a-l)return!1;if(n){let e=t.tr.step(c);e.setSelection(s.U3.create(e.doc,l)),n(e.scrollIntoView())}return!0}function u(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let f=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=d(r)}let l=o&&o.nodeBefore;return!!l&&!!s.nh.isSelectable(l)&&(e&&e(t.tr.setSelection(s.nh.create(t.doc,o.pos-l.nodeSize)).scrollIntoView()),!0)};function d(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function m(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("forward",t):!(n.parentOffset<n.parent.content.size))?n:null}let g=(t,e,n)=>{let o=m(t,n);if(!o)return!1;let l=x(o);if(!l)return!1;let h=l.nodeAfter;if(A(t,l,e,1))return!0;if(0==o.parent.content.size&&(u(h,"start")||s.nh.isSelectable(h))){let n=(0,r.$L)(t.doc,o.before(),o.after(),i.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(u(h,"start")?s.LN.findFrom(r.doc.resolve(r.mapping.map(l.pos)),1):s.nh.create(r.doc,r.mapping.map(l.pos))),e(r.scrollIntoView())}return!0}}return!!h.isAtom&&l.depth==o.depth-1&&(e&&e(t.tr.delete(l.pos,l.pos+h.nodeSize).scrollIntoView()),!0)},y=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=x(r)}let l=o&&o.nodeAfter;return!!l&&!!s.nh.isSelectable(l)&&(e&&e(t.tr.setSelection(s.nh.create(t.doc,o.pos)).scrollIntoView()),!0)};function x(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}let w=(t,e)=>{let n=t.selection,i=n instanceof s.nh,o;if(i){if(n.node.isTextblock||!(0,r.n9)(t.doc,n.from))return!1;o=n.from}else if(null==(o=(0,r.N0)(t.doc,n.from,-1)))return!1;if(e){let n=t.tr.join(o);i&&n.setSelection(s.nh.create(n.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(n.scrollIntoView())}return!0},k=(t,e)=>{let n=t.selection,i;if(n instanceof s.nh){if(n.node.isTextblock||!(0,r.n9)(t.doc,n.to))return!1;i=n.to}else if(null==(i=(0,r.N0)(t.doc,n.to,1)))return!1;return e&&e(t.tr.join(i).scrollIntoView()),!0},v=(t,e)=>{let{$from:n,$to:i}=t.selection,s=n.blockRange(i),o=s&&(0,r.jP)(s);return null!=o&&(e&&e(t.tr.lift(s,o).scrollIntoView()),!0)},S=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)};function C(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let b=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),l=C(i.contentMatchAt(o));if(!l||!i.canReplaceWith(o,o,l))return!1;if(e){let r=n.after(),i=t.tr.replaceWith(r,r,l.createAndFill());i.setSelection(s.LN.near(i.doc.resolve(r),1)),e(i.scrollIntoView())}return!0},T=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof s.i5||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=C(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=t.tr.insert(n,o.createAndFill());l.setSelection(s.U3.create(l.doc,n+1)),e(l.scrollIntoView())}return!0},E=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if((0,r.zy)(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),s=i&&(0,r.jP)(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}
1,O=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return 0!=o&&(i=n.before(o),e&&e(t.tr.setSelection(s.nh.create(t.doc,i))),!0)};function A(t,e,n,o){let l,h,a,c=e.nodeBefore,p=e.nodeAfter,f,d,m=c.type.spec.isolating||p.type.spec.isolating;if(!m&&(l=e.nodeBefore,h=e.nodeAfter,a=e.index(),l&&h&&l.type.compatibleContent(h.type)&&(!l.content.size&&e.parent.canReplace(a-1,a)?(n&&n(t.tr.delete(e.pos-l.nodeSize,e.pos).scrollIntoView()),!0):!!e.parent.canReplace(a,a+1)&&!!(h.isTextblock||(0,r.n9)(t.doc,e.pos))&&(n&&n(t.tr.join(e.pos).scrollIntoView()),!0))))return!0;let g=!m&&e.parent.canReplace(e.index(),e.index()+1);if(g&&(f=(d=c.contentMatchAt(c.childCount)).findWrapping(p.type))&&d.matchType(f[0]||p.type).validEnd){if(n){let s=e.pos+p.nodeSize,o=i.FK.empty;for(let t=f.length-1;t>=0;t--)o=i.FK.from(f[t].create(null,o));o=i.FK.from(c.copy(o));let l=t.tr.step(new r.Wg(e.pos-1,s,e.pos,s,new i.Ji(o,1,0),f.length,!0)),h=l.doc.resolve(s+2*f.length);h.nodeAfter&&h.nodeAfter.type==c.type&&(0,r.n9)(l.doc,h.pos)&&l.join(h.pos),n(l.scrollIntoView())}return!0}let y=p.type.spec.isolating||o>0&&m?null:s.LN.findFrom(e,1),x=y&&y.$from.blockRange(y.$to),w=x&&(0,r.jP)(x);if(null!=w&&w>=e.depth)return n&&n(t.tr.lift(x,w).scrollIntoView()),!0;if(g&&u(p,"start",!0)&&u(c,"end")){let s=c,o=[];for(;o.push(s),!s.isTextblock;)s=s.lastChild;let l=p,h=1;for(;!l.isTextblock;l=l.firstChild)h++;if(s.canReplace(s.childCount,s.childCount,l.content)){if(n){let s=i.FK.empty;for(let t=o.length-1;t>=0;t--)s=i.FK.from(o[t].copy(s));n(t.tr.step(new r.Wg(e.pos-o.length,e.pos+p.nodeSize,e.pos+h,e.pos+p.nodeSize-h,new i.Ji(s,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function M(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(e.tr.setSelection(s.U3.create(e.doc,t<0?i.start(o):i.end(o)))),!0)}}let I=M(-1),z=M(1);function R(t,e=null){return function(n,i){let{$from:s,$to:o}=n.selection,l=s.blockRange(o),h=l&&(0,r.oM)(l,t,e);return!!h&&(i&&i(n.tr.wrap(l,h).scrollIntoView()),!0)}}function N(t,e=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:s},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(s,o,(r,s)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(t,e)))if(r.type==t)i=!0;else{let e=n.doc.resolve(s),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:s},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(s,o,t,e)}r(i.scrollIntoView())}return!0}}function F(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let B=F(o,h,f),P=F(o,g,y),$={Enter:F(S,T,E,(t,e)=>{let{$from:n,$to:i}=t.selection;if(t.selection instanceof s.nh&&t.selection.node.isBlock)return!!n.parentOffset&&!!(0,r.zy)(t.doc,n.pos)&&(e&&e(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let o=[],l,h,a=!1,c=!1;for(let t=n.depth;;t--){if(n.node(t).isBlock){let e;a=n.end(t)==n.pos+(n.depth-t),c=n.start(t)==n.pos-(n.depth-t),h=C(n.node(t-1).contentMatchAt(n.indexAfter(t-1)));o.unshift(e||(a&&h?{type:h}:null)),l=t;break}if(1==t)return!1;o.unshift(null)}let p=t.tr;(t.selection instanceof s.U3||t.selection instanceof s.i5)&&p.deleteSelection();let u=p.mapping.map(n.pos),f=(0,r.zy)(p.doc,u,o.length,o);if(f||(o[0]=h?{type:h}:null,f=(0,r.zy)(p.doc,u,o.length,o)),!f)return!1;if(p.split(u,o.length,o),!a&&c&&n.node(l).type!=h){let t=p.mapping.map(n.before(l)),e=p.doc.resolve(t);h&&n.node(l-1).canReplaceWith(e.index(),e.index()+1,h)&&p.setNodeMarkup(p.mapping.map(n.before(l)),h)}return e&&e(p.scrollIntoView()),!0}),"Mod-Enter":b,Backspace:B,"Mod-Backspace":B,"Shift-Backspace":B,Delete:P,"Mod-Delete":P,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new s.i5(t.doc))),!0)},D={"Ctrl-h":$.Backspace,"Alt-Backspace":$["Mod-Backspace"],"Ctrl-d":$.Delete,"Ctrl-Alt-Backspace":$["Mod-Delete"],"Alt-Delete":$["Mod-Delete"],"Alt-d":$["Mod-Delete"],"Ctrl-a":I,"Ctrl-e":z};for(let t in $)D[t]=$[t];"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.