PageSourceSearch

https://fish.audio/assets/index-C7bnuabh.js

js fish.audio collected 2026-09-24 20:00:35 UTC 277,458 bytes, 138 lines download raw bytes

vendor: 8,091 bytes, lines 1-2
1import{r as B,R as Ye}from"./plan-Dq4jfPIL.js";import{r as $l,R as Bl}from"./useEvent-Dr-4GR-2.js";import{s as Rs}from"./mobile-navigation-9wRrde2W.js";import{j as se}from"./not-found-D8inZVAo.js";import{d as Vl}from"./index-C7yKKq-w.js";import{w as zl}from"./with-selector-CXe9M5pe.js";import{A as Bn,T as O,S as _,f as He,j as Vn,N as E,l as mt,r as _r,c as K,g as Ee,h as Hr,F as w,R as Xe,i as Ls,k as hr,D as zt,m as xt,M as _l,n as Is,a as V,d as Hl,E as jl,P as Y,o as Fl,p as $s,e as Wl,q as Kl,s as Ul,u as ql}from"./index-LjRAU3r9.js";const jr=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Bs(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const Vs=(e,t,n)=>{let r=Bs(e,n);if(!r)return!1;let o=Fr(r);if(!o){let i=r.blockRange(),l=i&&mt(i);return l==null?!1:(t&&t(e.tr.lift(i,l).scrollIntoView()),!0)}let s=o.nodeBefore;if(qs(e,o,t,-1))return!0;if(r.parent.content.size==0&&(at(s,"end")||E.isSelectable(s)))for(let i=r.depth;;i--){let l=_r(e.doc,r.before(i),r.after(i),K.empty);if(l&&l.slice.size<l.to-l.from){if(t){let a=e.tr.step(l);a.setSelection(at(s,"end")?_.findFrom(a.doc.resolve(a.mapping.map(o.pos,-1)),-1):E.create(a.doc,o.pos-s.nodeSize)),t(a.scrollIntoView())}return!0}if(i==1||r.node(i-1).childCount>1)break}return s.isAtom&&o.depth==r.depth-1?(t&&t(e.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1},Gl=(e,t,n)=>{let r=Bs(e,n);if(!r)return!1;let o=Fr(r);return o?zs(e,o,t):!1},Jl=(e,t,n)=>{let r=Hs(e,n);if(!r)return!1;let o=Wr(r);return o?zs(e,o,t):!1};function zs(e,t,n){let r=t.nodeBefore,o=r,s=t.pos-1;for(;!o.isTextblock;s--){if(o.type.spec.isolating)return!1;let d=o.lastChild;if(!d)return!1;o=d}let i=t.nodeAfter,l=i,a=t.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let d=l.firstChild;if(!d)return!1;l=d}let c=_r(e.doc,s,a,K.empty);if(!c||c.from!=s||c instanceof Ls&&c.slice.size>=a-s)return!1;if(n){let d=e.tr.step(c);d.setSelection(O.create(d.doc,s)),n(d.scrollIntoView())}return!0}function at(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const _s=(e,t,n)=>{let{$head:r,empty:o}=e.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=Fr(r)}let i=s&&s.nodeBefore;return!i||!E.isSelectable(i)?!1:(t&&t(e.tr.setSelection(E.create(e.doc,s.pos-i.nodeSize)).scrollIntoView()),!0)};function Fr(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Hs(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const js=(e,t,n)=>{let r=Hs(e,n);if(!r)return!1;let o=Wr(r);if(!o)return!1;let s=o.nodeAfter;if(qs(e,o,t,1))return!0;if(r.parent.content.size==0&&(at(s,"start")||E.isSelectable(s))){let i=_r(e.doc,r.before(),r.after(),K.empty);if(i&&i.slice.size<i.to-i.from){if(t){let l=e.tr.step(i);l.setSelection(at(s,"start")?_.findFrom(l.doc.resolve(l.mapping.map(o.pos)),1):E.create(l.doc,l.mapping.map(o.pos))),t(l.scrollIntoView())}return!0}}return s.isAtom&&o.depth==r.depth-1?(t&&t(e.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),!0):!1},Fs=(e,t,n)=>{let{$head:r,empty:o}=e.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=Wr(r)}let i=s&&s.nodeAfter;return!i||!E.isSelectable(i)?!1:(t&&t(e.tr.setSelection(E.create(e.doc,s.pos)).scrollIntoView()),!0)};function Wr(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const Yl=(e,t)=>{let n=e.selection,r=n instanceof E,o;if(r){if(n.node.isTextblock||!He(e.doc,n.from))return!1;o=n.from}else if(o=Vn(e.doc,n.from,-1),o==null)return!1;if(t){let s=e.tr.join(o);r&&s.setSelection(E.create(s.doc,o-e.doc.resolve(o).nodeBefore.nodeSize)),t(s.scrollIntoView())}return!0},Xl=(e,t)=>{let n=e.selection,r;if(n instanceof E){if(n.node.isTextblock||!He(e.doc,n.to))return!1;r=n.to}else if(r=Vn(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Ql=(e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),s=o&&mt(o);return s==null?!1:(t&&t(e.tr.lift(o,s).scrollIntoView()),!0)},Ws=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
2`).scrollIntoView()),!0)};function Kr(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Zl=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),i=Kr(o.contentMatchAt(s));if(!i||!o.canReplaceWith(s,s,i))return!1;if(t){let l=n.after(),a=e.tr.replaceWith(l,l,i.createAndFill());a.setSelection(_.near(a.doc.resolve(l),1)),t(a.scrollIntoView())}return!0},Ks=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof Bn||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=Kr(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let i=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=e.tr.insert(i,s.createAndFill());l.setSelection(O.create(l.doc,i+1)),t(l.scrollIntoView())}return!0},Us=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Ee(e.doc,s))return t&&t(e.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&mt(r);return o==null?!1:(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};function ea(e){return(t,n)=>{let{$from:r,$to:o}=t.selection;if(t.selection instanceof E&&t.selection.node.isBlock)return!r.parentOffset||!Ee(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],i,l,a=!1,c=!1;for(let f=r.depth;;f--)if(r.node(f).isBlock){a=r.end(f)==r.pos+(r.depth-f),c=r.start(f)==r.pos-(r.depth-f),l=Kr(r.node(f-1).contentMatchAt(r.indexAfter(f-1))),s.unshift(a&&l?{type:l}:null),i=f;break}else{if(f==1)return!1;s.unshift(null)}let d=t.tr;(t.selection instanceof O||t.selection instanceof Bn)&&d.deleteSelection();let u=d.mapping.map(r.pos),h=Ee(d.doc,u,s.length,s);if(h||(s[0]=l?{type:l}:null,h=Ee(d.doc,u,s.length,s)),!h)return!1;if(d.split(u,s.length,s),!a&&c&&r.node(i).type!=l){let f=d.mapping.map(r.before(i)),p=d.doc.resolve(f);l&&r.node(i-1).canReplaceWith(p.index(),p.index()+1,l)&&d.setNodeMarkup(d.mapping.map(r.before(i)),l)}return n&&n(d.scrollIntoView()),!0}}const ta=ea(),na=(e,t)=>{let{$from:n,to:r}=e.selection,o,s=n.sharedDepth(r);return s==0?!1:(o=n.before(s),t&&t(e.tr.setSelection(E.create(e.doc,o))),!0)};function ra(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,s=t.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(s,s+1)||!(o.isTextblock||He(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function qs(e,t,n,r){let o=t.nodeBefore,s=t.nodeAfter,i,l,a=o.type.spec.isolating||s.type.spec.isolating;if(!a&&ra(e,t,n))return!0;let c=!a&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(i=(l=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&l.matchType(i[0]||s.type).validEnd){if(n){let f=t.pos+s.nodeSize,p=w.empty;for(let y=i.length-1;y>=0;y--)p=w.from(i[y].create(null,p));p=w.from(o.copy(p));let m=e.tr.step(new Xe(t.pos-1,f,t.pos,f,new K(p,1,0),i.length,!0)),g=m.doc.resolve(f+2*i.length);g.nodeAfter&&g.nodeAfter.type==o.type&&He(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let d=s.type.spec.isolating||r>0&&a?null:_.findFrom(t,1),u=d&&d.$from.blockRange(d.$to),h=u&&mt(u);if(h!=null&&h>=t.depth)return n&&n(e.tr.lift(u,h).scrollIntoView()),!0;if(c&&at(s,"start",!0)&&at(o,"end")){let f=o,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let m=s,g=1;for(;!m.isTextblock;m=m.firstChild)g++;
vendor: 4,591 bytes, line 2
2if(f.canReplace(f.childCount,f.childCount,m.content)){if(n){let y=w.empty;for(let C=p.length-1;C>=0;C--)y=w.from(p[C].copy(y));let k=e.tr.step(new Xe(t.pos-p.length,t.pos+s.nodeSize,t.pos+g,t.pos+s.nodeSize-g,new K(y,p.length,0),0,!0));n(k.scrollIntoView())}return!0}}return!1}function Gs(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(t.tr.setSelection(O.create(t.doc,e<0?o.start(s):o.end(s)))),!0):!1}}const oa=Gs(-1),sa=Gs(1);function ia(e,t=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),l=i&&Hr(i,e,t);return l?(r&&r(n.tr.wrap(i,l).scrollIntoView()),!0):!1}}function Ao(e,t=null){return function(n,r){let o=!1;for(let s=0;s<n.selection.ranges.length&&!o;s++){let{$from:{pos:i},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(i,l,(a,c)=>{if(o)return!1;if(!(!a.isTextblock||a.hasMarkup(e,t)))if(a.type==e)o=!0;else{let d=n.doc.resolve(c),u=d.index();o=d.parent.canReplaceWith(u,u+1,e)}})}if(!o)return!1;if(r){let s=n.tr;for(let i=0;i<n.selection.ranges.length;i++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[i];s.setBlockType(l,a,e,t)}r(s.scrollIntoView())}return!0}}function Ur(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}Ur(jr,Vs,_s);Ur(jr,js,Fs);Ur(Ws,Ks,Us,ta);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function la(e,t=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s);if(!i)return!1;let l=r?n.tr:null;return aa(l,i,e,t)?(r&&r(l.scrollIntoView()),!0):!1}}function aa(e,t,n,r=null){let o=!1,s=t,i=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let a=i.resolve(t.start-2);s=new hr(a,a,t.depth),t.endIndex<t.parent.childCount&&(t=new hr(t.$from,i.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let l=Hr(s,n,r,t);return l?(e&&ca(e,t,l,o,n),!0):!1}function ca(e,t,n,r,o){let s=w.empty;for(let d=n.length-1;d>=0;d--)s=w.from(n[d].type.create(n[d].attrs,s));e.step(new Xe(t.start-(r?2:0),t.end,t.start,t.end,new K(s,0,0),n.length,!0));let i=0;for(let d=0;d<n.length;d++)n[d].type==o&&(i=d+1);let l=n.length-i,a=t.start+n.length-(r?2:0),c=t.parent;for(let d=t.startIndex,u=t.endIndex,h=!0;d<u;d++,h=!1)!h&&Ee(e.doc,a,l)&&(e.split(a,l),a+=2*l),a+=c.child(d).nodeSize;return e}function da(e){return function(t,n){let{$from:r,$to:o}=t.selection,s=r.blockRange(o,i=>i.childCount>0&&i.firstChild.type==e);return s?n?r.node(s.depth-1).type==e?ua(t,n,e,s):fa(t,n,s):!0:!1}}function ua(e,t,n,r){let o=e.tr,s=r.end,i=r.$to.end(r.depth);s<i&&(o.step(new Xe(s-1,i,s,i,new K(w.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new hr(o.doc.resolve(r.$from.pos),o.doc.resolve(i),r.depth));const l=mt(r);if(l==null)return!1;o.lift(r,l);let a=o.doc.resolve(o.mapping.map(s,-1)-1);return He(o.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&o.join(a.pos),t(o.scrollIntoView()),!0}function fa(e,t,n){let r=e.tr,o=n.parent;for(let f=n.end,p=n.endIndex-1,m=n.startIndex;p>m;p--)f-=o.child(p).nodeSize,r.delete(f-1,f+1);let s=r.doc.resolve(n.start),i=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==o.childCount,c=s.node(-1),d=s.index(-1);if(!c.canReplace(d+(l?0:1),d+1,i.content.append(a?w.empty:w.from(o))))return!1;let u=s.pos,h=u+i.nodeSize;return r.step(new Xe(u-(l?1:0),h+(a?1:0),u+1,h-1,new K((l?w.empty:w.from(o.copy(w.empty))).append(a?w.empty:w.from(o.copy(w.empty))),l?0:1,a?0:1),l?0:1)),t(r.scrollIntoView()),!0}function ha(e){return function(t,n){let{$from:r,$to:o}=t.selection,s=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==e);if(!s)return!1;let i=s.startIndex;if(i==0)return!1;let l=s.parent,a=l.child(i-1);if(a.type!=e)return!1;if(n){let c=a.lastChild&&a.lastChild.type==l.type,d=w.from(c?e.create():null),u=new K(w.from(e.create(null,w.from(l.type.create(null,d)))),c?3:1,0),h=s.start,f=s.end;n(t.tr.step(new Xe(h-(c?3:1),f,h,f,u,1,!0)).scrollIntoView())}return!0}}const q=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},ct=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let pr=null;const xe=function(e,t,n){let r=pr||(pr=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},pa=function(){pr=null},Qe=function(e,t,n,r){return n&&(No(e,t,n,r,-1)||No(e,t,n,r,1))},ma=/^(img|br|input|textarea|hr)$/i;function No(e,t,n,r,o){for(var s;;){if(e==n&&t==r)return!0;
vendor: 4,765 bytes, line 2
2if(t==(o<0?0:de(e))){let i=e.parentNode;if(!i||i.nodeType!=1||_t(e)||ma.test(e.nodeName)||e.contentEditable=="false")return!1;t=q(e)+(o<0?0:1),e=i}else if(e.nodeType==1){let i=e.childNodes[t+(o<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((s=i.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)t+=o;else return!1;else e=i,t=o<0?de(e):0}else return!1}}function de(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ga(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=de(e)}else if(e.parentNode&&!_t(e))t=q(e),e=e.parentNode;else return null}}function ya(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!_t(e))t=q(e)+1,e=e.parentNode;else return null}}function ba(e,t,n){for(let r=t==0,o=t==de(e);r||o;){if(e==n)return!0;let s=q(e);if(e=e.parentNode,!e)return!1;r=r&&s==0,o=o&&s==de(e)}}function _t(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const zn=function(e){return e.focusNode&&Qe(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function We(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function ka(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Sa(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(de(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(de(r.startContainer),r.startOffset)}}}const ge=typeof navigator<"u"?navigator:null,wo=typeof document<"u"?document:null,je=ge&&ge.userAgent||"",mr=/Edge\/(\d+)/.exec(je),Js=/MSIE \d/.exec(je),gr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(je),oe=!!(Js||gr||mr),$e=Js?document.documentMode:gr?+gr[1]:mr?+mr[1]:0,ue=!oe&&/gecko\/(\d+)/i.test(je);ue&&+(/Firefox\/(\d+)/.exec(je)||[0,0])[1];const yr=!oe&&/Chrome\/(\d+)/.exec(je),J=!!yr,Ys=yr?+yr[1]:0,Q=!oe&&!!ge&&/Apple Computer/.test(ge.vendor),dt=Q&&(/Mobile\/\w+/.test(je)||!!ge&&ge.maxTouchPoints>2),ce=dt||(ge?/Mac/.test(ge.platform):!1),Xs=ge?/Win/.test(ge.platform):!1,Me=/Android \d/.test(je),Ht=!!wo&&"webkitFontSmoothing"in wo.documentElement.style,Ca=Ht?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function xa(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function be(e,t){return typeof e=="number"?e:e[t]}function Ma(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Oo(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let i=n||e.dom;i;){if(i.nodeType!=1){i=ct(i);continue}let l=i,a=l==s.body,c=a?xa(s):Ma(l),d=0,u=0;if(t.top<c.top+be(r,"top")?u=-(c.top-t.top+be(o,"top")):t.bottom>c.bottom-be(r,"bottom")&&(u=t.bottom-t.top>c.bottom-c.top?t.top+be(o,"top")-c.top:t.bottom-c.bottom+be(o,"bottom")),t.left<c.left+be(r,"left")?d=-(c.left-t.left+be(o,"left")):t.right>c.right-be(r,"right")&&(d=t.right-c.right+be(o,"right")),d||u)if(a)s.defaultView.scrollBy(d,u);else{let f=l.scrollLeft,p=l.scrollTop;u&&(l.scrollTop+=u),d&&(l.scrollLeft+=d);let m=l.scrollLeft-f,g=l.scrollTop-p;t={left:t.left-m,top:t.top-g,right:t.right-m,bottom:t.bottom-g}}let h=a?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(h))break;i=h=="absolute"?i.offsetParent:ct(i)}}function Ta(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,o;for(let s=(t.left+t.right)/2,i=n+1;i<Math.min(innerHeight,t.bottom);i+=5){let l=e.root.elementFromPoint(s,i);if(!l||l==e.dom||!e.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,o=a.top;break}}return{refDOM:r,refTop:o,stack:Qs(e.dom)}}function Qs(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=ct(r));return t}function Ea({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Zs(n,r==0?0:r-t)}function Zs(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:s}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=s&&(r.scrollLeft=s)}}let rt=null;function va(e){if(e.setActive)return e.setActive();if(rt)return e.focus(rt);let t=Qs(e);e.focus(rt==null?{get preventScroll(){return rt={preventScroll:!0},!0}}:void 0),rt||(rt=!1,Zs(t,0))}
vendor: 4,816 bytes, line 2
2function ei(e,t){let n,r=2e8,o,s=0,i=t.top,l=t.top,a,c;for(let d=e.firstChild,u=0;d;d=d.nextSibling,u++){let h;if(d.nodeType==1)h=d.getClientRects();else if(d.nodeType==3)h=xe(d).getClientRects();else continue;for(let f=0;f<h.length;f++){let p=h[f];if(p.top<=i&&p.bottom>=l){i=Math.max(p.bottom,i),l=Math.min(p.top,l);let m=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(m<r){n=d,r=m,o=m&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,d.nodeType==1&&m&&(s=u+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!a&&p.left<=t.left&&p.right>=t.left&&(a=d,c={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(s=u+1)}}return!n&&a&&(n=a,o=c,r=0),n&&n.nodeType==3?Aa(n,o):!n||r&&n.nodeType==1?{node:e,offset:s}:ei(n,o)}function Aa(e,t){let n=e.nodeValue.length,r=document.createRange(),o;for(let s=0;s<n;s++){r.setEnd(e,s+1),r.setStart(e,s);let i=Oe(r,1);if(i.top!=i.bottom&&qr(t,i)){o={node:e,offset:s+(t.left>=(i.left+i.right)/2?1:0)};break}}return r.detach(),o||{node:e,offset:0}}function qr(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Na(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function wa(e,t,n){let{node:r,offset:o}=ei(t,n),s=-1;if(r.nodeType==1&&!r.firstChild){let i=r.getBoundingClientRect();s=i.left!=i.right&&n.left>(i.left+i.right)/2?1:-1}return e.docView.posFromDOM(r,o,s)}function Oa(e,t,n,r){let o=-1;for(let s=t,i=!1;s!=e.dom;){let l=e.docView.nearestDesc(s,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!i&&a.left>r.left||a.top>r.top?o=l.posBefore:(!i&&a.right<r.left||a.bottom<r.top)&&(o=l.posAfter),i=!0),!l.contentDOM&&o<0&&!l.node.isText))return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}function ti(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),s=o;;){let i=e.childNodes[s];if(i.nodeType==1){let l=i.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(qr(t,c))return ti(i,t,c)}}if((s=(s+1)%r)==o)break}return e}function Da(e,t){let n=e.dom.ownerDocument,r,o=0,s=Sa(n,t.left,t.top);s&&({node:r,offset:o}=s);let i=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),l;if(!i||!e.dom.contains(i.nodeType!=1?i.parentNode:i)){let c=e.dom.getBoundingClientRect();if(!qr(t,c)||(i=ti(e.dom,t,c),!i))return null}if(Q)for(let c=i;r&&c;c=ct(c))c.draggable&&(r=void 0);if(i=Na(i,t),r){if(ue&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let d=r.childNodes[o],u;d.nodeName=="IMG"&&(u=d.getBoundingClientRect()).right<=t.left&&u.bottom>t.top&&o++}let c;Ht&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&o--,r==e.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?l=e.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=Oa(e,r,o,t))}l==null&&(l=wa(e,i,t));let a=e.docView.nearestDesc(i,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Do(e){return e.top<e.bottom||e.left<e.right}function Oe(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(Do(r))return r}return Array.prototype.find.call(n,Do)||e.getBoundingClientRect()}const Pa=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ni(e,t,n){let{node:r,offset:o,atom:s}=e.docView.domFromPos(t,n<0?-1:1),i=Ht||ue;if(r.nodeType==3)if(i&&(Pa.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let a=Oe(xe(r,o,o),n);if(ue&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Oe(xe(r,o-1,o-1),-1);if(c.top==a.top){let d=Oe(xe(r,o,o+1),-1);if(d.top!=a.top)return yt(d,d.left<c.left)}}return a}else{let a=o,c=o,d=n<0?1:-1;return n<0&&!o?(c++,d=-1):n>=0&&o==r.nodeValue.length?(a--,d=1):n<0?a--:c++,yt(Oe(xe(r,a,c),d),d<0)}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==de(r))){let a=r.childNodes[o-1];if(a.nodeType==1)return Yn(a.getBoundingClientRect(),!1)}if(s==null&&o<de(r)){let a=r.childNodes[o];if(a.nodeType==1)return Yn(a.getBoundingClientRect(),!0)}return Yn(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==de(r))){let a=r.childNodes[o-1],c=a.nodeType==3?xe(a,de(a)-(i?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return yt(Oe(c,1),!1)}if(s==null&&o<de(r)){let a=r.childNodes[o];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;
vendor: 8,482 bytes, lines 2-3
2let c=a?a.nodeType==3?xe(a,0,i?0:1):a.nodeType==1?a:null:null;if(c)return yt(Oe(c,-1),!0)}return yt(Oe(r.nodeType==3?xe(r):r,-n),n>=0)}function yt(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Yn(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function ri(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}function Ra(e,t,n){let r=t.selection,o=n=="up"?r.$from:r.$to;return ri(e,t,()=>{let{node:s}=e.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let l=e.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let i=ni(e,o.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=xe(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let d=a[c];if(d.bottom>d.top+1&&(n=="up"?i.top-d.top>(d.bottom-i.top)*2:d.bottom-i.bottom>(i.bottom-d.top)*2))return!1}}return!0})}const La=/[\u0590-\u08ac]/;function Ia(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,s=!o,i=o==r.parent.content.size,l=e.domSelection();return l?!La.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:i:ri(e,t,()=>{let{focusNode:a,focusOffset:c,anchorNode:d,anchorOffset:u}=e.domSelectionRange(),h=l.caretBidiLevel;l.modify("move",n,"character");let f=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:p,focusOffset:m}=e.domSelectionRange(),g=p&&!f.contains(p.nodeType==1?p:p.parentNode)||a==p&&c==m;try{l.collapse(d,u),a&&(a!=d||c!=u)&&l.extend&&l.extend(a,c)}catch{}return h!=null&&(l.caretBidiLevel=h),g}):r.pos==r.start()||r.pos==r.end()}let Po=null,Ro=null,Lo=!1;function $a(e,t,n){return Po==t&&Ro==n?Lo:(Po=t,Ro=n,Lo=n=="up"||n=="down"?Ra(e,t,n):Ia(e,t,n))}const fe=0,Io=1,Ke=2,ye=3;class jt{constructor(t,n,r,o){this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=fe,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==t)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let s,i;if(t==this.contentDOM)s=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.previousSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(i)+i.size:this.posAtStart}else{let s,i;if(t==this.contentDOM)s=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.nextSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(i):this.posAtEnd}let o;if(t==this.dom&&this.contentDOM)o=n>q(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=t;;s=s.parentNode){if(s==this.dom){o=!1;break}if(s.previousSibling)break}if(o==null&&n==t.childNodes.length)for(let s=t;;s=s.parentNode){if(s==this.dom){o=!0;break}if(s.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,o=t;o;o=o.parentNode){let s=this.getDesc(o),i;if(s&&(!n||s.node))if(r&&(i=s.nodeDOM)&&!(i.nodeType==1?i.contains(t.nodeType==1?t:t.parentNode):i==t))r=!1;else return s}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let o=t;o;o=o.parentNode){let s=this.getDesc(o);if(s)return s.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],s=r+o.size;if(r==t&&s!=r){for(;!o.border&&o.children.length;)for(let i=0;i<o.children.length;i++){let l=o.children[i];if(l.size){o=l;break}}return o}if(t<s)return o.descAt(t-r-o.border);r=s}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,o=0;for(let s=0;r<this.children.length;r++){let i=this.children[r],l=s+i.size;if(l>t||i instanceof si){o=t-s;break}s=l}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof oi&&s.side>=0;r--);if(n<=0){let s,i=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,i=!1);return s&&n&&i&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?q(s.dom)+1:0}}else{let s,i=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,i=!1);return s&&i&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?q(s.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,s=-1;for(let i=r,l=0;;l++){let a=this.children[l],c=i+a.size;if(o==-1&&t<=c){let d=i+a.border;if(t>=d&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(t,n,d);t=i;for(let u=l;u>0;u--){let h=this.children[u-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){o=q(h.dom)+1;break}t-=h.size}o==-1&&(o=0)}if(o>-1&&(c>n||l==this.children.length-1)){n=c;for(let d=l+1;d<this.children.length;d++){let u=this.children[d];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(-1)){s=q(u.dom);break}n+=u.size}s==-1&&(s=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:t,to:n,fromOffset:o,toOffset:s}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,o=!1){let s=Math.min(t,n),i=Math.max(t,n);for(let f=0,p=0;f<this.children.length;f++){let m=this.children[f],g=p+m.size;if(s>p&&i<g)return m.setSelection(t-p-m.border,n-p-m.border,r,o);p=g}let l=this.domFromPos(t,t?-1:1),a=n==t?l:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),d=r.domSelectionRange(),u=!1;if((ue||Q)&&t==n){let{node:f,offset:p}=l;if(f.nodeType==3){if(u=!!(p&&f.nodeValue[p-1]==`
3`),u&&p==f.nodeValue.length)for(let m=f,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(l=a={node:g.parentNode,offset:q(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=f.childNodes[p-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(ue&&d.focusNode&&d.focusNode!=a.node&&d.focusNode.nodeType==1){let f=d.focusNode.childNodes[d.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||u&&Q)&&Qe(l.node,l.offset,d.anchorNode,d.anchorOffset)&&Qe(a.node,a.offset,d.focusNode,d.focusOffset))return;let h=!1;if((c.extend||t==n)&&!(u&&ue)){c.collapse(l.node,l.offset);try{t!=n&&c.extend(a.node,a.offset),h=!0}catch{}}if(!h){if(t>n){let p=l;l=a,a=p}let f=document.createRange();f.setEnd(a.node,a.offset),f.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,o=0;o<this.children.length;o++){let s=this.children[o],i=r+s.size;if(r==i?t<=i&&n>=r:t<i&&n>r){let l=r+s.border,a=i-s.border;if(t>=l&&n<=a){this.dirty=t==r||n==i?Ke:Io,t==l&&n==a&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=ye:s.markDirty(t-l,n-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Ke:ye}r=i}this.dirty=Ke}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?Ke:Io;n.dirty<r&&(n.dirty=r)}
vendor: 4,887 bytes, line 3
3}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class oi extends jt{constructor(t,n,r,o){let s,i=n.type.toDOM;if(typeof i=="function"&&(i=i(r,()=>{if(!s)return o;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(i.nodeType!=1){let l=document.createElement("span");l.appendChild(i),i=l}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(t,[],i,null),this.widget=n,this.widget=n,s=this}matchesWidget(t){return this.dirty==fe&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Ba extends jt{constructor(t,n,r,o){super(t,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Ze extends jt{constructor(t,n,r,o,s){super(t,[],r,o),this.mark=n,this.spec=s}static create(t,n,r,o){let s=o.nodeViews[n.type.name],i=s&&s(n,o,r);return(!i||!i.dom)&&(i=zt.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Ze(t,n,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&ye||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=ye&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=fe){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=fe}}slice(t,n,r){let o=Ze.create(this.parent,this.mark,!0,r),s=this.children,i=this.size;n<i&&(s=kr(s,n,i,r)),t>0&&(s=kr(s,0,t,r));for(let l=0;l<s.length;l++)s[l].parent=o;return o.children=s,o}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Be extends jt{constructor(t,n,r,o,s,i,l,a,c){super(t,[],s,i),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(t,n,r,o,s,i){let l=s.nodeViews[n.type.name],a,c=l&&l(n,s,()=>{if(!a)return i;if(a.parent)return a.parent.posBeforeChild(a)},r,o),d=c&&c.dom,u=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:u}=zt.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!u&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let h=d;return d=ai(d,r,n),c?a=new Va(t,n,r,o,d,u||null,h,c,s,i+1):n.isText?new _n(t,n,r,o,d,h,s):new Be(t,n,r,o,d,u||null,h,s,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>w.empty)}return t}matchesNode(t,n,r){return this.dirty==fe&&t.eq(this.node)&&en(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,o=n,s=t.composing?this.localCompositionInfo(t,n):null,i=s&&s.pos>-1?s:null,l=s&&s.pos<0,a=new _a(this,i&&i.node,t);Fa(this.node,this.innerDeco,(c,d,u)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,t,d):c.type.side>=0&&!u&&a.syncToMarks(d==this.node.childCount?_l.none:this.node.child(d).marks,r,t,d),a.placeWidget(c,t,o)},(c,d,u,h)=>{a.syncToMarks(c.marks,r,t,h);let f;a.findNodeMatch(c,d,u,h)||l&&t.state.selection.from>o&&t.state.selection.to<o+c.nodeSize&&(f=a.findIndexWithChild(s.node))>-1&&a.updateNodeAt(c,d,u,f,t)||a.updateNextNode(c,d,u,t,h,o)||a.addNode(c,d,u,t,o),o+=c.nodeSize}),a.syncToMarks([],r,t,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Ke)&&(i&&this.protectLocalComposition(t,i),ii(this.contentDOM,this.children,t),dt&&Wa(this.dom))}localCompositionInfo(t,n){let{from:r,to:o}=t.state.selection;if(!(t.state.selection instanceof O)||r<n||o>n+this.node.content.size)return null;let s=t.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let i=s.nodeValue,l=Ka(this.node.content,i,r-n,o-n);
vendor: 5,030 bytes, line 3
3return l<0?null:{node:s,pos:l,text:i}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let i=new Ba(this,s,n,o);t.input.compositionNodes.push(i),this.children=kr(this.children,r,r+o.length,t,i)}update(t,n,r,o){return this.dirty==ye||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,o),!0)}updateInner(t,n,r,o){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=fe}updateOuterDeco(t){if(en(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=li(this.dom,this.nodeDOM,br(this.outerDeco,this.node,n),br(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function $o(e,t,n,r,o){ai(r,t,e);let s=new Be(void 0,e,t,n,r,r,r,o,0);return s.contentDOM&&s.updateChildren(o,0),s}class _n extends Be{constructor(t,n,r,o,s,i,l){super(t,n,r,o,s,null,i,l,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,o){return this.dirty==ye||this.dirty!=fe&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=fe||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=fe,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let o=this.node.cut(t,n),s=document.createTextNode(o.text);return new _n(this.parent,o,this.outerDeco,this.innerDeco,s,s,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=ye)}get domAtom(){return!1}isText(t){return this.node.text==t}}class si extends jt{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==fe&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Va extends Be{constructor(t,n,r,o,s,i,l,a,c,d){super(t,n,r,o,s,i,l,c,d),this.spec=a}update(t,n,r,o){if(this.dirty==ye)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let s=this.spec.update(t,n,r);return s&&this.updateInner(t,n,r,o),s}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function ii(e,t,n){let r=e.firstChild,o=!1;for(let s=0;s<t.length;s++){let i=t[s],l=i.dom;if(l.parentNode==e){for(;l!=r;)r=Bo(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(l,r);if(i instanceof Ze){let a=r?r.previousSibling:e.lastChild;ii(i.contentDOM,i.children,n),r=a?a.nextSibling:e.firstChild}}for(;r;)r=Bo(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const Mt=function(e){e&&(this.nodeName=e)};Mt.prototype=Object.create(null);const Ue=[new Mt];function br(e,t,n){if(e.length==0)return Ue;let r=n?Ue[0]:new Mt,o=[r];for(let s=0;s<e.length;s++){let i=e[s].type.attrs;if(i){i.nodeName&&o.push(r=new Mt(i.nodeName));for(let l in i){let a=i[l];a!=null&&(n&&o.length==1&&o.push(r=new Mt(t.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return o}function li(e,t,n,r){if(n==Ue&&r==Ue)return t;let o=t;for(let s=0;s<r.length;s++){let i=r[s],l=n[s];if(s){let a;l&&l.nodeName==i.nodeName&&o!=e&&(a=o.parentNode)&&a.nodeName.toLowerCase()==i.nodeName||(a=document.createElement(i.nodeName),a.pmIsDeco=!0,a.appendChild(o),l=Ue[0]),o=a}za(o,l||Ue[0],i)}return o}function za(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);
vendor: 4,232 bytes, line 3
3if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)o.indexOf(r[s])==-1&&e.classList.remove(r[s]);for(let s=0;s<o.length;s++)r.indexOf(o[s])==-1&&e.classList.add(o[s]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(t.style);)e.style.removeProperty(o[1])}n.style&&(e.style.cssText+=n.style)}}function ai(e,t,n){return li(e,e,Ue,br(t,n,e.nodeType!=1))}function en(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Bo(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class _a{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=Ha(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,o){let s=0,i=this.stack.length>>1,l=Math.min(i,t.length);for(;s<l&&(s==i-1?this.top:this.stack[s+1<<1]).matchesMark(t[s])&&t[s].type.spec.spanning!==!1;)s++;for(;s<i;)this.destroyRest(),this.top.dirty=fe,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<t.length;){this.stack.push(this.top,this.index+1);let a=-1,c=this.top.children.length;o<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let d=this.index;d<c;d++){let u=this.top.children[d];if(u.matchesMark(t[i])&&!this.isLocked(u.dom)){a=d;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let d=Ze.create(this.top,t[i],n,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,i++}}findNodeMatch(t,n,r,o){let s=-1,i;if(o>=this.preMatch.index&&(i=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&i.matchesNode(t,n,r))s=this.top.children.indexOf(i,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let c=this.top.children[l];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){s=l;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(t,n,r,o,s){let i=this.top.children[o];return i.dirty==ye&&i.dom==i.contentDOM&&(i.dirty=Ke),i.update(t,n,r,s)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}t=n}}updateNextNode(t,n,r,o,s,i){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof Be){let c=this.preMatch.matched.get(a);if(c!=null&&c!=s)return!1;let d=a.dom,u,h=this.isLocked(d)&&!(t.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==t.text&&a.dirty!=ye&&en(n,a.outerDeco));if(!h&&a.update(t,n,r,o))return this.destroyBetween(this.index,l),a.dom!=d&&(this.changed=!0),this.index++,!0;if(!h&&(u=this.recreateWrapper(a,t,n,r,o,i)))return this.destroyBetween(this.index,l),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=Ke,u.updateChildren(o,i+1),u.dirty=fe),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,o,s,i){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!en(r,t.outerDeco)||!o.eq(t.innerDeco))return null;let l=Be.create(this.top,n,r,o,s,i);if(l.contentDOM){l.children=t.children,t.children=[];for(let a of l.children)a.parent=l}return t.destroy(),l}addNode(t,n,r,o,s){let i=Be.create(this.top,t,n,r,o,s);i.contentDOM&&i.updateChildren(o,s+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(t,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(t)&&(t==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let s=new oi(this.top,t,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof Ze;)n=t,t=n.children[n.children.length-1];
vendor: 15,624 bytes, lines 3-6
3(!t||!(t instanceof _n)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Q||J)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new si(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function Ha(e,t){let n=t,r=n.children.length,o=e.childCount,s=new Map,i=[];e:for(;o>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof Ze)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=e.child(o-1))break;--o,s.set(l,o),i.push(l)}}return{index:o,matched:s,matches:i.reverse()}}function ja(e,t){return e.type.side-t.type.side}function Fa(e,t,n,r){let o=t.locals(e),s=0;if(o.length==0){for(let c=0;c<e.childCount;c++){let d=e.child(c);r(d,o,t.forChild(s,d),c),s+=d.nodeSize}return}let i=0,l=[],a=null;for(let c=0;;){let d,u;for(;i<o.length&&o[i].to==s;){let g=o[i++];g.widget&&(d?(u||(u=[d])).push(g):d=g)}if(d)if(u){u.sort(ja);for(let g=0;g<u.length;g++)n(u[g],c,!!a)}else n(d,c,!!a);let h,f;if(a)f=-1,h=a,a=null;else if(c<e.childCount)f=c,h=e.child(c++);else break;for(let g=0;g<l.length;g++)l[g].to<=s&&l.splice(g--,1);for(;i<o.length&&o[i].from<=s&&o[i].to>s;)l.push(o[i++]);let p=s+h.nodeSize;if(h.isText){let g=p;i<o.length&&o[i].from<g&&(g=o[i].from);for(let y=0;y<l.length;y++)l[y].to<g&&(g=l[y].to);g<p&&(a=h.cut(g-s),h=h.cut(0,g-s),p=g,f=-1)}else for(;i<o.length&&o[i].to<p;)i++;let m=h.isInline&&!h.isLeaf?l.filter(g=>!g.inline):l.slice();r(h,m,t.forChild(s,h),f),s=p}}function Wa(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Ka(e,t,n,r){for(let o=0,s=0;o<e.childCount&&s<=r;){let i=e.child(o++),l=s;if(s+=i.nodeSize,!i.isText)continue;let a=i.text;for(;o<e.childCount;){let c=e.child(o++);if(s+=c.nodeSize,!c.isText)break;a+=c.text}if(s>=n){if(s>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let c=l<r?a.lastIndexOf(t,r-l-1):-1;if(c>=0&&c+t.length+l>=n)return l+c;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return-1}function kr(e,t,n,r,o){let s=[];for(let i=0,l=0;i<e.length;i++){let a=e[i],c=l,d=l+=a.size;c>=n||d<=t?s.push(a):(c<t&&s.push(a.slice(0,t-c,r)),o&&(s.push(o),o=void 0),d>n&&s.push(a.slice(n-c,a.size,r)))}return s}function Gr(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),s=o&&o.size==0,i=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(i<0)return null;let l=r.resolve(i),a,c;if(zn(n)){for(a=i;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&E.isSelectable(u)&&o.parent&&!(u.isInline&&ba(n.focusNode,n.focusOffset,o.dom))){let h=o.posBefore;c=new E(i==h?l:r.resolve(h))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let u=i,h=i;for(let f=0;f<n.rangeCount;f++){let p=n.getRangeAt(f);u=Math.min(u,e.docView.posFromDOM(p.startContainer,p.startOffset,1)),h=Math.max(h,e.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(u<0)return null;[a,i]=h==e.state.selection.anchor?[h,u]:[u,h],l=r.resolve(i)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let d=r.resolve(a);if(!c){let u=t=="pointer"||e.state.selection.head<l.pos&&!s?1:-1;c=Jr(e,d,l,u)}return c}function ci(e){return e.editable?e.hasFocus():ui(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ve(e,t=!1){let n=e.state.selection;if(di(e,n),!!ci(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&J){let r=e.domSelectionRange(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Qe(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)qa(e);else{let{anchor:r,head:o}=n,s,i;Vo&&!(n instanceof O)&&(n.$from.parent.inlineContent||(s=zo(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(i=zo(e,n.to))),e.docView.setSelection(r,o,e,t),Vo&&(s&&_o(s),i&&_o(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Ua(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Vo=Q||J&&Ys<63;function zo(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Q&&o&&o.contentEditable=="false")return Xn(o);if((!o||o.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(o)return Xn(o);if(s)return Xn(s)}}function Xn(e){return e.contentEditable="true",Q&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function _o(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Ua(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!ci(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function qa(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,q(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&oe&&$e<=11&&(n.disabled=!0,n.disabled=!1)}function di(e,t){if(t instanceof E){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Ho(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Ho(e)}function Ho(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Jr(e,t,n,r){return e.someProp("createSelectionBetween",o=>o(e,t,n))||O.between(t,n,r)}function jo(e){return e.editable&&!e.hasFocus()?!1:ui(e)}function ui(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Ga(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Qe(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Sr(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),s=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return s&&_.findFrom(s,t)}function De(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Fo(e,t,n){let r=e.state.selection;if(r instanceof O)if(n.indexOf("s")>-1){let{$head:o}=r,s=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let i=e.state.doc.resolve(o.pos+s.nodeSize*(t<0?-1:1));return De(e,new O(r.$anchor,i))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=Sr(e.state,t);return o&&o instanceof E?De(e,o):!1}else if(!(ce&&n.indexOf("m")>-1)){let o=r.$head,s=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,i;if(!s||s.isText)return!1;let l=t<0?o.pos-s.nodeSize:o.pos;return s.isAtom||(i=e.docView.descAt(l))&&!i.contentDOM?E.isSelectable(s)?De(e,new E(t<0?e.state.doc.resolve(o.pos-s.nodeSize):o)):Ht?De(e,new O(e.state.doc.resolve(t<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof E&&r.node.isInline)return De(e,new O(t>0?r.$to:r.$from));{let o=Sr(e.state,t);return o?De(e,o):!1}}}function tn(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Tt(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function ot(e,t){return t<0?Ja(e):Ya(e)}function Ja(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,s,i=!1;for(ue&&n.nodeType==1&&r<tn(n)&&Tt(n.childNodes[r],-1)&&(i=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Tt(l,-1))o=n,s=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(fi(n))break;{let l=n.previousSibling;for(;l&&Tt(l,-1);)o=n.parentNode,s=q(l),l=l.previousSibling;if(l)n=l,r=tn(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}i?Cr(e,n,r):o&&Cr(e,o,s)}function Ya(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o=tn(n),s,i;for(;;)if(r<o){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Tt(l,1))s=n,i=++r;else break}else{if(fi(n))break;{let l=n.nextSibling;for(;l&&Tt(l,1);)s=l.parentNode,i=q(l)+1,l=l.nextSibling;if(l)n=l,r=0,o=tn(n);else{if(n=n.parentNode,n==e.dom)break;r=o=0}}}s&&Cr(e,s,i)}function fi(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Xa(e,t){for(;e&&t==e.childNodes.length&&!_t(e);)t=q(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function Qa(e,t){for(;e&&!t&&!_t(e);)t=q(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function Cr(e,t,n){if(t.nodeType!=3){let s,i;(i=Xa(t,n))?(t=i,n=0):(s=Qa(t,n))&&(t=s,n=s.nodeValue.length)}let r=e.domSelection();if(!r)return;if(zn(r)){let s=document.createRange();s.setEnd(t,n),s.setStart(t,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&ve(e)},50)}function Wo(e,t){let n=e.state.doc.resolve(t);if(!(J||Xs)&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let s=e.coordsAtPos(t-1),i=(s.top+s.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(s.left-o.left)>1)return s.left<o.left?"ltr":"rtl"}if(t<n.end()){let s=e.coordsAtPos(t+1),i=(s.top+s.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(s.left-o.left)>1)return s.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Ko(e,t,n){let r=e.state.selection;if(r instanceof O&&!r.empty||n.indexOf("s")>-1||ce&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let i=Sr(e.state,t);if(i&&i instanceof E)return De(e,i)}if(!o.parent.inlineContent){let i=t<0?o:s,l=r instanceof Bn?_.near(i,t):_.findFrom(i,t);return l?De(e,l):!1}return!1}function Uo(e,t){if(!(e.state.selection instanceof O))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let i=e.state.tr;return t<0?i.delete(n.pos-s.nodeSize,n.pos):i.delete(n.pos,n.pos+s.nodeSize),e.dispatch(i),!0}return!1}function qo(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Za(e){if(!Q||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;qo(e,r,"true"),setTimeout(()=>qo(e,r,"false"),20)}return!1}function ec(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function tc(e,t){let n=t.keyCode,r=ec(t);if(n==8||ce&&n==72&&r=="c")return Uo(e,-1)||ot(e,-1);if(n==46&&!t.shiftKey||ce&&n==68&&r=="c")return Uo(e,1)||ot(e,1);if(n==13||n==27)return!0;if(n==37||ce&&n==66&&r=="c"){let o=n==37?Wo(e,e.state.selection.from)=="ltr"?-1:1:-1;return Fo(e,o,r)||ot(e,o)}else if(n==39||ce&&n==70&&r=="c"){let o=n==39?Wo(e,e.state.selection.from)=="ltr"?1:-1:1;return Fo(e,o,r)||ot(e,o)}else{if(n==38||ce&&n==80&&r=="c")return Ko(e,-1,r)||ot(e,-1);if(n==40||ce&&n==78&&r=="c")return Za(e)||Ko(e,1,r)||ot(e,1);if(r==(ce?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Yr(e,t){e.someProp("transformCopied",f=>{t=f(t,e)});let n=[],{content:r,openStart:o,openEnd:s}=t;for(;o>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,s--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let i=e.someProp("clipboardSerializer")||zt.fromSchema(e.state.schema),l=bi(),a=l.createElement("div");a.appendChild(i.serializeFragment(r,{document:l}));let c=a.firstChild,d,u=0;for(;c&&c.nodeType==1&&(d=yi[c.nodeName.toLowerCase()]);){for(let f=d.length-1;f>=0;f--){let p=l.createElement(d[f]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),u++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${s}${u?` -${u}`:""} ${JSON.stringify(n)}`);let h=e.someProp("clipboardTextSerializer",f=>f(t,e))||t.content.textBetween(0,t.content.size,`
4
5`);return{dom:a,text:h,slice:t}}function hi(e,t,n,r,o){let s=o.parent.type.spec.code,i,l;if(!n&&!t)return null;let a=!!t&&(r||s||!n);if(a){if(e.someProp("transformPastedText",h=>{t=h(t,s||r,e)}),s)return l=new K(w.from(e.state.schema.text(t.replace(/\r\n?/g,`
6`))),0,0),e.someProp("transformPasted",h=>{l=h(l,e,!0)}),l;let u=e.someProp("clipboardTextParser",h=>h(t,o,r,e));if(u)l=u;else{let h=o.marks(),{schema:f}=e.state,p=zt.fromSchema(f);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=i.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(f.text(m,h)))})}}else e.someProp("transformPastedHTML",u=>{n=u(n,e)}),i=sc(n),Ht&&ic(i);let c=i&&i.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let h=i.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;i=h}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||xt.fromSchema(e.state.schema)).parseSlice(i,{preserveWhitespace:!!(a||d),context:o,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!nc.test(h.parentNode.nodeName)?{ignore:!0}:null}})),d)l=lc(Go(l,+d[1],+d[2]),d[4]);else if(l=K.maxOpen(rc(l.content,o),!0),l.openStart||l.openEnd){let u=0,h=0;for(let f=l.content.firstChild;u<l.openStart&&!f.type.spec.isolating;u++,f=f.firstChild);for(let f=l.content.lastChild;h<l.openEnd&&!f.type.spec.isolating;h++,f=f.lastChild);l=Go(l,u,h)}return e.someProp("transformPasted",u=>{l=u(l,e,a)}),l}const nc=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function rc(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o=t.node(n).contentMatchAt(t.index(n)),s,i=[];if(e.forEach(l=>{if(!i)return;let a=o.findWrapping(l.type),c;if(!a)return i=null;if(c=i.length&&s.length&&mi(a,s,l,i[i.length-1],0))i[i.length-1]=c;else{i.length&&(i[i.length-1]=gi(i[i.length-1],s.length));let d=pi(l,a);i.push(d),o=o.matchType(d.type),s=a}}),i)return w.from(i)}return e}function pi(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,w.from(e));return e}function mi(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let s=mi(e,t,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(w.from(pi(n,e,o+1))))}}function gi(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,gi(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(w.empty,!0);return e.copy(n.append(r))}
vendor: 4,767 bytes, line 6
6function xr(e,t,n,r,o,s){let i=t<0?e.firstChild:e.lastChild,l=i.content;return e.childCount>1&&(s=0),o<r-1&&(l=xr(l,t,n,r,o+1,s)),o>=n&&(l=t<0?i.contentMatchAt(0).fillBefore(l,s<=o).append(l):l.append(i.contentMatchAt(i.childCount).fillBefore(w.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,i.copy(l))}function Go(e,t,n){return t<e.openStart&&(e=new K(xr(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new K(xr(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const yi={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Jo=null;function bi(){return Jo||(Jo=document.implementation.createHTMLDocument("title"))}let Qn=null;function oc(e){let t=window.trustedTypes;return t?(Qn||(Qn=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Qn.createHTML(e)):e}function sc(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=bi().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),o;if((o=r&&yi[r[1].toLowerCase()])&&(e=o.map(s=>"<"+s+">").join("")+e+o.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=oc(e),o)for(let s=0;s<o.length;s++)n=n.querySelector(o[s])||n;return n}function ic(e){let t=e.querySelectorAll(J?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function lc(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:o,openStart:s,openEnd:i}=e;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;o=w.from(a.create(r[l+1],o)),s++,i++}return new K(o,s,i)}const te={},ne={},ac={touchstart:!0,touchmove:!0};class cc{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function dc(e){for(let t in te){let n=te[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{fc(e,r)&&!Xr(e,r)&&(e.editable||!(r.type in ne))&&n(e,r)},ac[t]?{passive:!0}:void 0)}Q&&e.dom.addEventListener("input",()=>null),Mr(e)}function Ie(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function uc(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Mr(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>Xr(e,r))})}function Xr(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function fc(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function hc(e,t){!Xr(e,t)&&te[t.type]&&(e.editable||!(t.type in ne))&&te[t.type](e,t)}ne.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Si(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Me&&J&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),dt&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",o=>o(e,We(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||tc(e,n)?n.preventDefault():Ie(e,"key")};ne.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};ne.keypress=(e,t)=>{let n=t;if(Si(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||ce&&n.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof O)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),s=()=>e.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,r.$from.pos,r.$to.pos,o,s))&&e.dispatch(s()),n.preventDefault()}};function Hn(e){return{left:e.clientX,top:e.clientY}}function pc(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}
vendor: 22,028 bytes, line 6
6function Qr(e,t,n,r,o){if(r==-1)return!1;let s=e.state.doc.resolve(r);for(let i=s.depth+1;i>0;i--)if(e.someProp(t,l=>i>s.depth?l(e,n,s.nodeAfter,s.before(i),o,!0):l(e,n,s.node(i),s.before(i),o,!1)))return!0;return!1}function lt(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function mc(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&E.isSelectable(r)?(lt(e,new E(n)),!0):!1}function gc(e,t){if(t==-1)return!1;let n=e.state.selection,r,o;n instanceof E&&(r=n.node);let s=e.state.doc.resolve(t);for(let i=s.depth+1;i>0;i--){let l=i>s.depth?s.nodeAfter:s.node(i);if(E.isSelectable(l)){r&&n.$from.depth>0&&i>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?o=s.before(n.$from.depth):o=s.before(i);break}}return o!=null?(lt(e,E.create(e.state.doc,o)),!0):!1}function yc(e,t,n,r,o){return Qr(e,"handleClickOn",t,n,r)||e.someProp("handleClick",s=>s(e,t,r))||(o?gc(e,n):mc(e,n))}function bc(e,t,n,r){return Qr(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",o=>o(e,t,r))}function kc(e,t,n,r){return Qr(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",o=>o(e,t,r))||Sc(e,n,r)}function Sc(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(lt(e,O.create(r,0,r.content.size)),!0):!1;let o=r.resolve(t);for(let s=o.depth+1;s>0;s--){let i=s>o.depth?o.nodeAfter:o.node(s),l=o.before(s);if(i.inlineContent)lt(e,O.create(r,l+1,l+1+i.content.size));else if(E.isSelectable(i))lt(e,E.create(r,l));else continue;return!0}}function Zr(e){return nn(e)}const ki=ce?"metaKey":"ctrlKey";te.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Zr(e),o=Date.now(),s="singleClick";o-e.input.lastClick.time<500&&pc(n,e.input.lastClick)&&!n[ki]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?s="doubleClick":e.input.lastClick.type=="doubleClick"&&(s="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s,button:n.button};let i=e.posAtCoords(Hn(n));i&&(s=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Cc(e,i,n,!!r)):(s=="doubleClick"?bc:kc)(e,i.pos,i.inside,n)?n.preventDefault():Ie(e,"pointer"))};class Cc{constructor(t,n,r,o){this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[ki],this.allowDefault=r.shiftKey;let s,i;if(n.inside>-1)s=t.state.doc.nodeAt(n.inside),i=n.inside;else{let d=t.state.doc.resolve(n.pos);s=d.parent,i=d.depth?d.before():0}const l=o?null:r.target,a=l?t.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=t.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof E&&c.from<=i&&c.to>i)&&(this.mightDrag={node:s,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ue&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ie(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>ve(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Hn(t))),this.updateAllowDefault(t),this.allowDefault||!n?Ie(this.view,"pointer"):yc(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Q&&this.mightDrag&&!this.mightDrag.node.isAtom||J&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(lt(this.view,_.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Ie(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ie(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}te.touchstart=e=>{e.input.lastTouch=Date.now(),Zr(e),Ie(e,"pointer")};te.touchmove=e=>{e.input.lastTouch=Date.now(),Ie(e,"pointer")};te.contextmenu=e=>Zr(e);function Si(e,t){return e.composing?!0:Q&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const xc=Me?5e3:-1;ne.compositionstart=ne.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof O&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||J&&Xs&&Mc(e)))e.markCursor=e.state.storedMarks||n.marks(),nn(e,!0),e.markCursor=null;else if(nn(e,!t.selection.empty),ue&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let o=r.focusNode,s=r.focusOffset;o&&o.nodeType==1&&s!=0;){let i=s<0?o.lastChild:o.childNodes[s-1];if(!i)break;if(i.nodeType==3){let l=e.domSelection();l&&l.collapse(i,i.nodeValue.length);break}else o=i,s=-1}}e.input.composing=!0}Ci(e,xc)};function Mc(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}ne.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Ci(e,20))};function Ci(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>nn(e),t))}function xi(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Ec());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Tc(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=ga(t.focusNode,t.focusOffset),r=ya(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,s=e.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!o||!o.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let i=n.pmViewDesc;if(!(!i||!i.isText(n.nodeValue)))return r}}return n||r}function Ec(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function nn(e,t=!1){if(!(Me&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),xi(e),t||e.docView&&e.docView.dirty){let n=Gr(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function vc(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Pt=oe&&$e<15||dt&&Ca<604;te.copy=ne.cut=(e,t)=>{let n=t,r=e.state.selection,o=n.type=="cut";if(r.empty)return;let s=Pt?null:n.clipboardData,i=r.content(),{dom:l,text:a}=Yr(e,i);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):vc(e,l),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Ac(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Nc(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Rt(e,r.value,null,o,t):Rt(e,r.textContent,r.innerHTML,o,t)},50)}function Rt(e,t,n,r,o){let s=hi(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",a=>a(e,o,s||K.empty)))return!0;if(!s)return!1;let i=Ac(s),l=i?e.state.tr.replaceSelectionWith(i,r):e.state.tr.replaceSelection(s);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Mi(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ne.paste=(e,t)=>{let n=t;if(e.composing&&!Me)return;let r=Pt?null:n.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Rt(e,Mi(r),r.getData("text/html"),o,n)?n.preventDefault():Nc(e,n)};class Ti{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const wc=ce?"altKey":"ctrlKey";function Ei(e,t){let n=e.someProp("dragCopies",r=>!r(t));return n??!t[wc]}te.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=e.state.selection,s=o.empty?null:e.posAtCoords(Hn(n)),i;if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof E?o.to-1:o.to))){if(r&&r.mightDrag)i=E.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let u=e.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=e.docView&&(i=E.create(e.state.doc,u.posBefore))}}let l=(i||e.state.selection).content(),{dom:a,text:c,slice:d}=Yr(e,l);(!n.dataTransfer.files.length||!J||Ys>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Pt?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Pt||n.dataTransfer.setData("text/plain",c),e.dragging=new Ti(d,Ei(e,n),i)};te.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};ne.dragover=ne.dragenter=(e,t)=>t.preventDefault();ne.drop=(e,t)=>{try{Oc(e,t,e.dragging)}finally{e.dragging=null}};function Oc(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Hn(t));if(!r)return;let o=e.state.doc.resolve(r.pos),s=n&&n.slice;s?e.someProp("transformPasted",f=>{s=f(s,e,!1)}):s=hi(e,Mi(t.dataTransfer),Pt?null:t.dataTransfer.getData("text/html"),!1,o);let i=!!(n&&Ei(e,t));if(e.someProp("handleDrop",f=>f(e,t,s||K.empty,i))){t.preventDefault();return}if(!s)return;t.preventDefault();let l=s?Is(e.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let a=e.state.tr;if(i){let{node:f}=n;f?f.replace(a):a.deleteSelection()}let c=a.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,u=a.doc;if(d?a.replaceRangeWith(c,c,s.content.firstChild):a.replaceRange(c,c,s),a.doc.eq(u))return;let h=a.doc.resolve(c);if(d&&E.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))a.setSelection(new E(h));else{let f=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((p,m,g,y)=>f=y),a.setSelection(Jr(e,h,a.doc.resolve(f)))}e.focus(),e.dispatch(a.setMeta("uiEvent","drop"))}te.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ve(e)},20))};te.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};te.beforeinput=(e,t)=>{if(J&&Me&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",s=>s(e,We(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in ne)te[e]=ne[e];function Lt(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class rn{constructor(t,n){this.toDOM=t,this.spec=n||Ge,this.side=this.spec.side||0}map(t,n,r,o){let{pos:s,deleted:i}=t.mapResult(n.from+o,this.side<0?-1:1);return i?null:new ee(s-r,s-r,this)}valid(){return!0}eq(t){return this==t||t instanceof rn&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Lt(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Ve{constructor(t,n){this.attrs=t,this.spec=n||Ge}map(t,n,r,o){let s=t.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,i=t.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return s>=i?null:new ee(s,i,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Ve&&Lt(this.attrs,t.attrs)&&Lt(this.spec,t.spec)}static is(t){return t.type instanceof Ve}destroy(){}}class eo{constructor(t,n){this.attrs=t,this.spec=n||Ge}map(t,n,r,o){let s=t.mapResult(n.from+o,1);if(s.deleted)return null;let i=t.mapResult(n.to+o,-1);return i.deleted||i.pos<=s.pos?null:new ee(s.pos-r,i.pos-r,this)}valid(t,n){let{index:r,offset:o}=t.content.findIndex(n.from),s;return o==n.from&&!(s=t.child(r)).isText&&o+s.nodeSize==n.to}eq(t){return this==t||t instanceof eo&&Lt(this.attrs,t.attrs)&&Lt(this.spec,t.spec)}destroy(){}}class ee{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new ee(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new ee(t,t,new rn(n,r))}static inline(t,n,r,o){return new ee(t,n,new Ve(r,o))}static node(t,n,r,o){return new ee(t,n,new eo(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ve}get widget(){return this.type instanceof rn}}const st=[],Ge={};class L{constructor(t,n){this.local=t.length?t:st,this.children=n.length?n:st}static create(t,n){return n.length?on(n,t,0,Ge):X}find(t,n,r){let o=[];return this.findInner(t??0,n??1e9,o,0,r),o}findInner(t,n,r,o,s){for(let i=0;i<this.local.length;i++){let l=this.local[i];l.from<=n&&l.to>=t&&(!s||s(l.spec))&&r.push(l.copy(l.from+o,l.to+o))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<n&&this.children[i+1]>t){let l=this.children[i]+1;this.children[i+2].findInner(t-l,n-l,r,o+l,s)}}map(t,n,r){return this==X||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Ge)}mapInner(t,n,r,o,s){let i;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(t,r,o);a&&a.type.valid(n,a)?(i||(i=[])).push(a):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?Dc(this.children,i||[],t,n,r,o,s):i?new L(i.sort(Je),st):X}add(t,n){return n.length?this==X?L.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let o,s=0;t.forEach((l,a)=>{let c=a+r,d;if(d=Ai(n,l,c)){for(o||(o=this.children.slice());s<o.length&&o[s]<a;)s+=3;o[s]==a?o[s+2]=o[s+2].addInner(l,d,c+1):o.splice(s,0,a,a+l.nodeSize,on(d,l,c+1,Ge)),s+=3}});let i=vi(s?Ni(n):n,-r);for(let l=0;l<i.length;l++)i[l].type.valid(t,i[l])||i.splice(l--,1);return new L(i.length?this.local.concat(i).sort(Je):this.local,o||this.children)}remove(t){return t.length==0||this==X?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,o=this.local;for(let s=0;s<r.length;s+=3){let i,l=r[s]+n,a=r[s+1]+n;for(let d=0,u;d<t.length;d++)(u=t[d])&&u.from>l&&u.to<a&&(t[d]=null,(i||(i=[])).push(u));if(!i)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(i,l+1);c!=X?r[s+2]=c:(r.splice(s,3),s-=3)}if(o.length){for(let s=0,i;s<t.length;s++)if(i=t[s])for(let l=0;l<o.length;l++)o[l].eq(i,n)&&(o==this.local&&(o=this.local.slice()),o.splice(l--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new L(o,r):X}forChild(t,n){if(this==X)return this;if(n.isLeaf)return L.empty;let r,o;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=t){this.children[l]==t&&(r=this.children[l+2]);break}let s=t+1,i=s+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<i&&a.to>s&&a.type instanceof Ve){let c=Math.max(s,a.from)-s,d=Math.min(i,a.to)-s;c<d&&(o||(o=[])).push(a.copy(c,d))}}if(o){let l=new L(o.sort(Je),st);return r?new Re([l,r]):l}return r||X}eq(t){if(this==t)return!0;if(!(t instanceof L)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return to(this.localsInner(t))}localsInner(t){if(this==X)return st;if(t.inlineContent||!this.local.some(Ve.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ve||n.push(this.local[r]);return n}forEachSet(t){t(this)}}L.empty=new L([],[]);L.removeOverlap=to;const X=L.empty;class Re{constructor(t){this.members=t}map(t,n){const r=this.members.map(o=>o.map(t,n,Ge));return Re.from(r)}forChild(t,n){if(n.isLeaf)return L.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(t,n);s!=X&&(s instanceof Re?r=r.concat(s.members):r.push(s))}return Re.from(r)}eq(t){if(!(t instanceof Re)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let o=0;o<this.members.length;o++){let s=this.members[o].localsInner(t);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let i=0;i<s.length;i++)n.push(s[i])}}return n?to(r?n:n.sort(Je)):st}static from(t){switch(t.length){case 0:return X;case 1:return t[0];default:return new Re(t.every(n=>n instanceof L)?t:t.reduce((n,r)=>n.concat(r instanceof L?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function Dc(e,t,n,r,o,s,i){let l=e.slice();for(let c=0,d=s;c<n.maps.length;c++){let u=0;n.maps[c].forEach((h,f,p,m)=>{let g=m-p-(f-h);for(let y=0;y<l.length;y+=3){let k=l[y+1];if(k<0||h>k+d-u)continue;let C=l[y]+d-u;f>=C?l[y+1]=h<=C?-2:-1:h>=d&&g&&(l[y]+=g,l[y+1]+=g)}u+=g}),d=n.maps[c].map(d,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let d=n.map(e[c]+s),u=d-o;if(u<0||u>=r.content.size){a=!0;continue}let h=n.map(e[c+1]+s,-1),f=h-o,{index:p,offset:m}=r.content.findIndex(u),g=r.maybeChild(p);if(g&&m==u&&m+g.nodeSize==f){let y=l[c+2].mapInner(n,g,d+1,e[c]+s+1,i);y!=X?(l[c]=u,l[c+1]=f,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=Pc(l,e,t,n,o,s,i),d=on(c,r,0,i);t=d.local;for(let u=0;u<l.length;u+=3)l[u+1]<0&&(l.splice(u,3),u-=3);for(let u=0,h=0;u<d.children.length;u+=3){let f=d.children[u];for(;h<l.length&&l[h]<f;)h+=3;l.splice(h,0,d.children[u],d.children[u+1],d.children[u+2])}}return new L(t.sort(Je),l)}function vi(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new ee(o.from+t,o.to+t,o.type))}return n}function Pc(e,t,n,r,o,s,i){function l(a,c){for(let d=0;d<a.local.length;d++){let u=a.local[d].map(r,o,c);u?n.push(u):i.onRemove&&i.onRemove(a.local[d].spec)}for(let d=0;d<a.children.length;d+=3)l(a.children[d+2],a.children[d]+c+1)}for(let a=0;a<e.length;a+=3)e[a+1]==-1&&l(e[a+2],t[a]+s+1);return n}function Ai(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let s=0,i;s<e.length;s++)(i=e[s])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),e[s]=null);return o}function Ni(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function on(e,t,n,r){let o=[],s=!1;t.forEach((l,a)=>{let c=Ai(e,l,a+n);if(c){s=!0;let d=on(c,l,n+a+1,r);d!=X&&o.push(a,a+l.nodeSize,d)}});let i=vi(s?Ni(e):e,-n).sort(Je);for(let l=0;l<i.length;l++)i[l].type.valid(t,i[l])||(r.onRemove&&r.onRemove(i[l].spec),i.splice(l--,1));return i.length||o.length?new L(i,o):X}function Je(e,t){return e.from-t.from||e.to-t.to}function to(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let s=t[o];if(s.from==r.from){s.to!=r.to&&(t==e&&(t=e.slice()),t[o]=s.copy(s.from,r.to),Yo(t,o+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,s.from),Yo(t,o,r.copy(s.from,r.to)));break}}}return t}function Yo(e,t,n){for(;t<e.length&&Je(n,e[t])>0;)t++;e.splice(t,0,n)}function Zn(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=X&&t.push(r)}),e.cursorWrapper&&t.push(L.create(e.state.doc,[e.cursorWrapper.deco])),Re.from(t)}const Rc={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Lc=oe&&$e<=11;class Ic{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class $c{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ic,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);oe&&$e<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>
vendor: 12,103 bytes, line 6
6o.target.nodeValue.length)?this.flushSoon():Q&&t.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Lc&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Rc)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(jo(this.view)){if(this.suppressingSelectionUpdates)return ve(this.view);if(oe&&$e<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Qe(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let s=t.focusNode;s;s=ct(s))n.add(s);for(let s=t.anchorNode;s;s=ct(s))if(n.has(s)){r=s;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&jo(t)&&!this.ignoreSelectionChange(r),s=-1,i=-1,l=!1,a=[];if(t.editable)for(let d=0;d<n.length;d++){let u=this.registerMutation(n[d],a);u&&(s=s<0?u.from:Math.min(u.from,s),i=i<0?u.to:Math.max(u.to,i),u.typeOver&&(l=!0))}if(a.some(d=>d.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let d of a)if(d.nodeName=="BR"&&d.parentNode){let u=d.nextSibling;for(;u&&u.nodeType==1;){if(u.contentEditable=="false"){d.parentNode.removeChild(d);break}u=u.firstChild}}}else if(ue&&a.length){let d=a.filter(u=>u.nodeName=="BR");if(d.length==2){let[u,h]=d;u.parentNode&&u.parentNode.parentNode==h.parentNode?h.remove():u.remove()}else{let{focusNode:u}=this.currentSelection;for(let h of d){let f=h.parentNode;f&&f.nodeName=="LI"&&(!u||zc(t,u)!=f)&&h.remove()}}}let c=null;s<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&zn(r)&&(c=Gr(t))&&c.eq(_.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,ve(t),this.currentSelection.set(r),t.scrollToSelection()):(s>-1||o)&&(s>-1&&(t.docView.markDirty(s,i),Bc(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,_c(t,a)),this.handleDOMChange(s,i,l,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||ve(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let d=0;d<t.addedNodes.length;d++){let u=t.addedNodes[d];n.push(u),u.nodeType==3&&(this.lastChangedTextNode=u)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let o=t.previousSibling,s=t.nextSibling;if(oe&&$e<=11&&t.addedNodes.length)for(let d=0;d<t.addedNodes.length;d++){let{previousSibling:u,nextSibling:h}=t.addedNodes[d];(!u||Array.prototype.indexOf.call(t.addedNodes,u)<0)&&(o=u),(!h||Array.prototype.indexOf.call(t.addedNodes,h)<0)&&(s=h)}let i=o&&o.parentNode==t.target?q(o)+1:0,l=r.localPosFromDOM(t.target,i,-1),a=s&&s.parentNode==t.target?q(s):t.target.childNodes.length,c=r.localPosFromDOM(t.target,a,1);return{from:l,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let Xo=new WeakMap,Qo=!1;function Bc(e){if(!Xo.has(e)&&(Xo.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=ue,Qo)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Qo=!0}}function Zo(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,s=t.endOffset,i=e.domAtPos(e.state.selection.anchor);return Qe(i.node,i.offset,o,s)&&([n,r,o,s]=[o,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:s}}function Vc(e,t){if(t.getComposedRanges){let o=t.getComposedRanges(e.root)[0];if(o)return Zo(e,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?Zo(e,n):null}function zc(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function _c(e,t){var n;let{focusNode:r,focusOffset:o}=e.domSelectionRange();for(let s of t)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let i=s.nextSibling;for(;i&&i.nodeName!="TD"&&i.nodeName!="TH";)i=i.nextSibling;if(i){let l=i;for(;;){let a=l.firstChild;if(!a||a.nodeType!=1||a.contentEditable=="false"||/^(BR|IMG)$/.test(a.nodeName))break;l=a}l.insertBefore(s,l.firstChild),r==s&&e.domSelection().collapse(s,o)}else s.parentNode.removeChild(s)}}function Hc(e,t,n){let{node:r,fromOffset:o,toOffset:s,from:i,to:l}=e.docView.parseRange(t,n),a=e.domSelectionRange(),c,d=a.anchorNode;if(d&&e.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:a.anchorOffset}],zn(a)||c.push({node:a.focusNode,offset:a.focusOffset})),J&&e.input.lastKeyCode===8)for(let g=s;g>o;g--){let y=r.childNodes[g-1],k=y.pmViewDesc;if(y.nodeName=="BR"&&!k){s=g;break}if(!k||k.size)break}let u=e.state.doc,h=e.someProp("domParser")||xt.fromSchema(e.state.schema),f=u.resolve(i),p=null,m=h.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:s,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:jc,context:f});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),p={anchor:g+i,head:y+i}}return{doc:m,sel:p,from:i,to:l}}function jc(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Q&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||Q&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Fc=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Wc(e,t,n,r,o){let s=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let x=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,N=Gr(e,x);if(N&&!e.state.selection.eq(N)){if(J&&Me&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",F=>F(e,We(13,"Enter"))))return;let D=e.state.tr.setSelection(N);x=="pointer"?D.setMeta("pointer",!0):x=="key"&&D.scrollIntoView(),s&&D.setMeta("composition",s),e.dispatch(D)}return}let i=e.state.doc.resolve(t),l=i.sharedDepth(n);t=i.before(l+1),n=e.state.doc.resolve(n).after(l+1);let a=e.state.selection,c=Hc(e,t,n),d=e.state.doc,u=d.slice(c.from,c.to),h,f;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(h=e.state.selection.to,f="end"):(h=e.state.selection.from,f="start"),e.input.lastKeyCode=null;let p=qc(u.content,c.doc.content,c.from,h,f);if(p&&e.input.domChangeCount++,(dt&&e.input.lastIOSEnter>Date.now()-225||Me)&&o.some(x=>x.nodeType==1&&!Fc.test(x.nodeName))&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",x=>x(e,We(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&a instanceof O&&!a.empty&&a.$head.sameParent(a.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let x=es(e,e.state.doc,c.sel);if(x&&!x.eq(e.state.selection)){let N=e.state.tr.setSelection(x);s&&N.setMeta("composition",s),e.dispatch(N)}}return}e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof O&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=c.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),oe&&$e<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),g=c.doc.resolveNoCache(p.endB-c.from),y=d.resolve(p.start),k=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA;if((dt&&e.input.lastIOSEnter>Date.now()-225&&(!k||o.some(x=>x.nodeName=="DIV"||x.nodeName=="P"))||!k&&m.pos<c.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(c.doc.textBetween(m.pos,g.pos,"","")))&&e.someProp("handleKeyDown",x=>x(e,We(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&Uc(d,p.start,p.endA,m,g)&&e.someProp("handleKeyDown",x=>x(e,We(8,"Backspace")))){Me&&J&&e.domObserver.suppressSelectionUpdates();return}J&&p.endB==p.start&&(e.input.lastChromeDelete=Date.now()),Me&&!k&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,g=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(x){return x(e,We(13,"Enter"))})},20));let C=p.start,T=p.endA,S=x=>{let N=x||e.state.tr.replace(C,T,c.doc.slice(p.start-c.from,p.endB-c.from));if(c.sel){let D=es(e,N.doc,c.sel);D&&!(J&&e.composing&&D.empty&&(p.start!=p.endB||e.input.lastChromeDelete<Date.now()-100)&&(D.head==C||D.head==N.mapping.map(T)-1)||oe&&D.empty&&D.head==C)&&N.setSelection(D)}return s&&N.setMeta("composition",s),N.scrollIntoView()},v;if(k)if(m.pos==g.pos){oe&&$e<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ve(e),20));let x=S(e.state.tr.delete(C,T)),N=d.resolve(p.start).marksAcross(d.resolve(p.endA));N&&x.ensureMarks(N),e.dispatch(x)}else if(p.endA==p.endB&&(v=Kc(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start())))){let x=S(e.state.tr);v.type=="add"?x.addMark(C,T,v.mark):x.removeMark(C,T,v.mark),e.dispatch(x)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let x=m.parent.textBetween(m.parentOffset,g.parentOffset),N=()=>S(e.state.tr.insertText(x,C,T));e.someProp("handleTextInput",D=>D(e,C,T,x,N))||e.dispatch(N())}else e.dispatch(S());else e.dispatch(S())}
vendor: 5,742 bytes, line 6
6function es(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Jr(e,t.resolve(n.anchor),t.resolve(n.head))}function Kc(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,s=r,i,l,a;for(let d=0;d<r.length;d++)o=r[d].removeFromSet(o);for(let d=0;d<n.length;d++)s=n[d].removeFromSet(s);if(o.length==1&&s.length==0)l=o[0],i="add",a=d=>d.mark(l.addToSet(d.marks));else if(o.length==0&&s.length==1)l=s[0],i="remove",a=d=>d.mark(l.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<t.childCount;d++)c.push(a(t.child(d)));if(w.from(c).eq(e))return{mark:l,type:i}}function Uc(e,t,n,r,o){if(n-t<=o.pos-r.pos||er(r,!0,!1)<o.pos)return!1;let s=e.resolve(t);if(!r.parent.isTextblock){let l=s.nodeAfter;return l!=null&&n==t+l.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let i=e.resolve(er(s,!0,!0));return!i.parent.isTextblock||i.pos>n||er(i,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(i.parent.content)}function er(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let s=e.node(r).maybeChild(e.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,o++}return o}function qc(e,t,n,r,o){let s=e.findDiffStart(t,n);if(s==null)return null;let{a:i,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if(o=="end"){let a=Math.max(0,s-Math.min(i,l));r-=i+a-s}if(i<s&&e.size<t.size){let a=r<=s&&r>=i?s-r:0;s-=a,s&&s<t.size&&ts(t.textBetween(s-1,s+1))&&(s+=a?1:-1),l=s+(l-i),i=s}else if(l<s){let a=r<=s&&r>=l?s-r:0;s-=a,s&&s<e.size&&ts(e.textBetween(s-1,s+1))&&(s+=a?1:-1),i=s+(i-l),l=s}return{start:s,endA:i,endB:l}}function ts(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class wi{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new cc,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(ls),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=ss(this),rs(this),this.nodeViews=is(this),this.docView=$o(this.state.doc,ns(this),Zn(this),this.dom,this),this.domObserver=new $c(this,(r,o,s,i)=>Wc(this,r,o,s,i)),this.domObserver.start(),dc(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Mr(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(ls),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let o=this.state,s=!1,i=!1;t.storedMarks&&this.composing&&(xi(this),i=!0),this.state=t;let l=o.plugins!=t.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=is(this);Jc(f,this.nodeViews)&&(this.nodeViews=f,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Mr(this),this.editable=ss(this),rs(this);let a=Zn(this),c=ns(this),d=o.plugins!=t.plugins&&!o.doc.eq(t.doc)?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",u=s||!this.docView.matchesNode(t.doc,c,a);(u||!t.selection.eq(o.selection))&&(i=!0);let h=d=="preserve"&&i&&this.dom.style.overflowAnchor==null&&Ta(this);if(i){this.domObserver.stop();let f=u&&(oe||J)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&Gc(o.selection,t.selection);if(u){let p=J?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Tc(this)),(s||!this.docView.update(t.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=$o(t.doc,c,a,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Ga(this))?ve(this,f):(di(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,o),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():h&&Ea(h)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof E){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Oo(this,n.getBoundingClientRect(),t)}else Oo(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,o=-1;
vendor: 5,962 bytes, line 6
6if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(o=s)}this.dragging=new Ti(t.slice,t.move,o<0?void 0:E.create(this.state.doc,o))}someProp(t,n){let r=this._props&&this._props[t],o;if(r!=null&&(o=n?n(r):r))return o;for(let i=0;i<this.directPlugins.length;i++){let l=this.directPlugins[i].props[t];if(l!=null&&(o=n?n(l):l))return o}let s=this.state.plugins;if(s)for(let i=0;i<s.length;i++){let l=s[i].props[t];if(l!=null&&(o=n?n(l):l))return o}}hasFocus(){if(oe){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&va(this.dom),ve(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return Da(this,t)}coordsAtPos(t,n=1){return ni(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let o=this.docView.posFromDOM(t,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,n){return $a(this,n||this.state,t)}pasteHTML(t,n){return Rt(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Rt(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return Yr(this,t)}destroy(){this.docView&&(uc(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Zn(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,pa())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return hc(this,t)}domSelectionRange(){let t=this.domSelection();return t?Q&&this.root.nodeType===11&&ka(this.dom.ownerDocument)==this.dom&&Vc(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}wi.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function ns(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[ee.node(0,e.state.doc.content.size,t)]}function rs(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:ee.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ss(e){return!e.someProp("editable",t=>t(e.state)===!1)}function Gc(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function is(e){let t=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=r[o])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Jc(e,t){let n=0,r=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let o in t)r++;return n!=r}function ls(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var ze={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},sn={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Yc=typeof navigator<"u"&&/Mac/.test(navigator.platform),Xc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var G=0;G<10;G++)ze[48+G]=ze[96+G]=String(G);for(var G=1;G<=24;G++)ze[G+111]="F"+G;for(var G=65;G<=90;G++)ze[G]=String.fromCharCode(G+32),sn[G]=String.fromCharCode(G);for(var tr in ze)sn.hasOwnProperty(tr)||(sn[tr]=ze[tr]);function Qc(e){var t=Yc&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Xc&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?sn:ze)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Zc=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ed=typeof navigator<"u"&&/Win/.test(navigator.platform);function td(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,o,s,i;for(let l=0;l<t.length-1;l++){let a=t[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))Zc?i=!0:o=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),i&&(n="Meta-"+n),s&&(n="Shift-"+n),n}
vendor: 5,945 bytes, line 6
6function nd(e){let t=Object.create(null);for(let n in e)t[td(n)]=e[n];return t}function nr(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function rd(e){return new V({props:{handleKeyDown:Oi(e)}})}function Oi(e){let t=nd(e);return function(n,r){let o=Qc(r),s,i=t[nr(o,r)];if(i&&i(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let l=t[nr(o,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(ed&&r.ctrlKey&&r.altKey)&&(s=ze[r.keyCode])&&s!=o){let l=t[nr(s,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var od=Object.defineProperty,no=(e,t)=>{for(var n in t)od(e,n,{get:t[n],enumerable:!0})};function jn(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:s}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return s},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}var Fn=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:o}=n,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([i,l])=>[i,(...c)=>{const d=l(...c)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:s}=r,i=[],l=!!e,a=e||o.tr,c=()=>(!l&&t&&!a.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(a),i.every(u=>u===!0)),d={...Object.fromEntries(Object.entries(n).map(([u,h])=>[u,(...p)=>{const m=this.buildProps(a,t),g=h(...p)(m);return i.push(g),d}])),run:c};return d}createCan(e){const{rawCommands:t,state:n}=this,r=!1,o=e||n.tr,s=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(t).map(([l,a])=>[l,(...c)=>a(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:s}=r,i={tr:e,editor:r,view:s,state:jn({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([l,a])=>[l,(...c)=>a(...c)(i)]))}};return i}},Di={};no(Di,{blur:()=>sd,clearContent:()=>id,clearNodes:()=>ld,command:()=>ad,createParagraphNear:()=>cd,cut:()=>dd,deleteCurrentNode:()=>ud,deleteNode:()=>fd,deleteRange:()=>hd,deleteSelection:()=>pd,enter:()=>md,exitCode:()=>gd,extendMarkRange:()=>yd,first:()=>bd,focus:()=>Sd,forEach:()=>Cd,insertContent:()=>xd,insertContentAt:()=>Ed,joinBackward:()=>Nd,joinDown:()=>Ad,joinForward:()=>wd,joinItemBackward:()=>Od,joinItemForward:()=>Dd,joinTextblockBackward:()=>Pd,joinTextblockForward:()=>Rd,joinUp:()=>vd,keyboardShortcut:()=>Id,lift:()=>$d,liftEmptyBlock:()=>Bd,liftListItem:()=>Vd,newlineInCode:()=>zd,resetAttributes:()=>_d,scrollIntoView:()=>Hd,selectAll:()=>jd,selectNodeBackward:()=>Fd,selectNodeForward:()=>Wd,selectParentNode:()=>Kd,selectTextblockEnd:()=>Ud,selectTextblockStart:()=>qd,setContent:()=>Gd,setMark:()=>gu,setMeta:()=>yu,setNode:()=>bu,setNodeSelection:()=>ku,setTextDirection:()=>Su,setTextSelection:()=>Cu,sinkListItem:()=>xu,splitBlock:()=>Mu,splitListItem:()=>Tu,toggleList:()=>vu,toggleMark:()=>Au,toggleNode:()=>Nu,toggleWrap:()=>wu,undoInputRule:()=>Ou,unsetAllMarks:()=>Du,unsetMark:()=>Pu,unsetTextDirection:()=>Ru,updateAttributes:()=>Lu,wrapIn:()=>Iu,wrapInList:()=>$u});var sd=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),id=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),ld=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return n&&o.forEach(({$from:s,$to:i})=>{e.doc.nodesBetween(s.pos,i.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:d}=t,u=c.resolve(d.map(a)),h=c.resolve(d.map(a+l.nodeSize)),f=u.blockRange(h);if(!f)return;const p=mt(f);if(l.type.isTextblock){const{defaultType:m}=u.parent.contentMatchAt(u.index());t.setNodeMarkup(f.start,m)}(p||p===0)&&t.lift(f,p)})}),!0},ad=e=>t=>e(t),cd=()=>({state:e,dispatch:t})=>Ks(e,t),dd=(e,t)=>({editor:n,tr:r})=>{const{state:o}=n,s=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const i=r.mapping.map(t);return r.insert(i,s.content),r.setSelection(new O(r.doc.resolve(Math.max(i-1,0)))),!0},ud=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(t){const l=o.before(s),a=o.after(s);e.delete(l,a).scrollIntoView()}return!0}return!1};function H(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var fd=e=>({tr:t,state:n,dispatch:r})=>{const o=H(e,n.schema),s=t.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===o){if(r){const a=s.before(i),c=s.after(i);t.delete(a,c).scrollIntoView()}return!0}return!1},hd=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},pd=()=>({state:e,dispatch:t})=>jr(e,t),md=()=>({commands:e})=>e.keyboardShortcut("Enter"),gd=()=>({state:e,dispatch:t})=>Zl(e,t);function ro(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function ln(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(o=>n.strict?t[o]===e[o]:ro(t[o])?t[o].test(e[o]):t[o]===e[o]):!0}function Pi(e,t,n={}){return e.find(r=>r.type===t&&ln(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function as(e,t,n={}
6){return!!Pi(e,t,n)}function oo(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===t))return;if(!n){const c=r.node.marks.find(d=>d.type===t);c&&(n=c.attrs)}if(!Pi([...r.node.marks],t,n))return;let s=r.index,i=e.start()+r.offset,l=s+1,a=i+r.node.nodeSize;for(;s>0&&as([...e.parent.child(s-1).marks],t,n);)s-=1,i-=e.parent.child(s).nodeSize;for(;l<e.parent.childCount&&as([...e.parent.child(l).marks],t,n);)a+=e.parent.child(l).nodeSize,l+=1;return{from:i,to:a}}function Ae(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var yd=(e,t)=>({tr:n,state:r,dispatch:o})=>{const s=Ae(e,r.schema),{doc:i,selection:l}=n,{$from:a,from:c,to:d}=l;if(o){const u=oo(a,s,t);if(u&&u.from<=c&&u.to>=d){const h=O.create(i,u.from,u.to);n.setSelection(h)}}return!0},bd=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function so(e){return e instanceof O}function Te(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Ri(e,t=null){if(!t)return null;const n=_.atStart(e),r=_.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const o=n.from,s=r.to;return t==="all"?O.create(e,Te(0,o,s),Te(e.content.size,o,s)):O.create(e,Te(t,o,s),Te(t,o,s))}function Tr(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function It(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function kd(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Sd=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:s})=>{t={scrollIntoView:!0,...t};const i=()=>{(It()||Tr())&&r.dom.focus(),kd()&&!It()&&!Tr()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(s&&e===null&&!so(n.state.selection))return i(),!0;const l=Ri(o.doc,e)||n.state.selection,a=n.state.selection.eq(l);return s&&(a||o.setSelection(l),a&&o.storedMarks&&o.setStoredMarks(o.storedMarks),i()),!0},Cd=(e,t)=>n=>e.every((r,o)=>t(r,{...n,index:o})),xd=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Li=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Li(r)}return e};function Wt(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return Li(n)}function $t(e,t,n){if(e instanceof Wl||e instanceof w)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,o=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return w.fromArray(e.map(l=>t.nodeFromJSON(l)));const i=t.nodeFromJSON(e);return n.errorOnInvalidContent&&i.check(),i}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",s),$t("",t,n)}if(o){if(n.errorOnInvalidContent){let i=!1,l="";const a=new $s({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(i=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?xt.fromSchema(a).parseSlice(Wt(e),n.parseOptions):xt.fromSchema(a).parse(Wt(e),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=xt.fromSchema(t);return n.slice?s.parseSlice(Wt(e),n.parseOptions).content:s.parse(Wt(e),n.parseOptions)}return $t("",t,n)}
vendor: 4,371 bytes, line 6
6function Md(e,t,n){const r=e.steps.length-1;if(r<t)return;const o=e.steps[r];if(!(o instanceof Ls||o instanceof Xe))return;const s=e.mapping.maps[r];let i=0;s.forEach((l,a,c,d)=>{i===0&&(i=d)}),e.setSelection(_.near(e.doc.resolve(i),n))}var Td=e=>!("type"in e),Ed=(e,t,n)=>({tr:r,dispatch:o,editor:s})=>{var i;if(o){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const a=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{$t(t,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(g){a(g)}try{l=$t(t,s.schema,{parseOptions:c,errorOnInvalidContent:(i=n.errorOnInvalidContent)!=null?i:s.options.enableContentCheck})}catch(g){return a(g),!1}let{from:d,to:u}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},h=!0,f=!0;if((Td(l)?l:[l]).forEach(g=>{g.check(),h=h?g.isText&&g.marks.length===0:!1,f=f?g.isBlock:!1}),d===u&&f){const{parent:g}=r.doc.resolve(d);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(d-=1,u+=1)}let m;if(h){if(Array.isArray(t))m=t.map(g=>g.text||"").join("");else if(t instanceof w){let g="";t.forEach(y=>{y.text&&(g+=y.text)}),m=g}else typeof t=="object"&&t&&t.text?m=t.text:m=t;r.insertText(m,d,u)}else{m=l;const g=r.doc.resolve(d),y=g.node(),k=g.parentOffset===0,C=y.isText||y.isTextblock,T=y.content.size>0;k&&C&&T&&f&&(d=Math.max(0,d-1)),r.replaceWith(d,u,m)}n.updateSelection&&Md(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:m}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:m})}return!0},vd=()=>({state:e,dispatch:t})=>Yl(e,t),Ad=()=>({state:e,dispatch:t})=>Xl(e,t),Nd=()=>({state:e,dispatch:t})=>Vs(e,t),wd=()=>({state:e,dispatch:t})=>js(e,t),Od=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Vn(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Dd=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Vn(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Pd=()=>({state:e,dispatch:t})=>Gl(e,t),Rd=()=>({state:e,dispatch:t})=>Jl(e,t);function Ii(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Ld(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,o,s,i;for(let l=0;l<t.length-1;l+=1){const a=t[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))It()||Ii()?i=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),i&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var Id=e=>({editor:t,view:n,tr:r,dispatch:o})=>{const s=Ld(e).split(/-(?!$)/),i=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,l))});return a?.steps.forEach(c=>{const d=c.map(r.mapping);d&&o&&r.maybeStep(d)}),!0};function _e(e,t,n={}){const{from:r,to:o,empty:s}=e.selection,i=t?H(t,e.schema):null,l=[];e.doc.nodesBetween(r,o,(u,h)=>{if(u.isText)return;const f=Math.max(r,h),p=Math.min(o,h+u.nodeSize);l.push({node:u,from:f,to:p})});const a=o-r,c=l.filter(u=>i?i.name===u.node.type.name:!0).filter(u=>ln(u.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((u,h)=>u+h.to-h.from,0)>=a}var $d=(e,t={})=>({state:n,dispatch:r})=>{const o=H(e,n.schema);return _e(n,o,t)?Ql(n,r):!1},Bd=()=>({state:e,dispatch:t})=>Us(e,t),Vd=e=>({state:t,dispatch:n})=>{const r=H(e,t.schema);return da(r)(t,n)},zd=()=>({state:e,dispatch:t})=>Ws(e,t);function Wn(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function cs(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,o)=>(n.includes(o)||(r[o]=e[o]),r),{})}var _d=(e,t)=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=Wn(typeof e=="string"?e:e.name,r.schema);if(!l)return!1;l==="node"&&(s=H(e,r.schema)),l==="mark"&&(i=Ae(e,r.schema));let a=!1;
6return n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{s&&s===d.type&&(a=!0,o&&n.setNodeMarkup(u,void 0,cs(d.attrs,t))),i&&d.marks.length&&d.marks.forEach(h=>{i===h.type&&(a=!0,o&&n.addMark(u,u+d.nodeSize,i.create(cs(h.attrs,t))))})})}),a},Hd=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),jd=()=>({tr:e,dispatch:t})=>{if(t){const n=new Bn(e.doc);e.setSelection(n)}return!0},Fd=()=>({state:e,dispatch:t})=>_s(e,t),Wd=()=>({state:e,dispatch:t})=>Fs(e,t),Kd=()=>({state:e,dispatch:t})=>na(e,t),Ud=()=>({state:e,dispatch:t})=>sa(e,t),qd=()=>({state:e,dispatch:t})=>oa(e,t);function Er(e,t,n={},r={}){return $t(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Gd=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:s,dispatch:i,commands:l})=>{const{doc:a}=s;if(r.preserveWhitespace!=="full"){const c=Er(e,o.schema,r,{errorOnInvalidContent:t??o.options.enableContentCheck});return i&&s.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!n),!0}return i&&s.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},e,{parseOptions:r,errorOnInvalidContent:t??o.options.enableContentCheck})};function $i(e,t){const n=Ae(t,e.schema),{from:r,to:o,empty:s}=e.selection,i=[];s?(e.storedMarks&&i.push(...e.storedMarks),i.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,a=>{i.push(...a.marks)});const l=i.find(a=>a.type.name===n.name);return l?{...l.attrs}:{}}function Bi(e,t){const n=new Hl(e);return t.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function Jd(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function ap(e,t){const n=[];return e.descendants((r,o)=>{t(r)&&n.push({node:r,pos:o})}),n}function Yd(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(o,s)=>{n(o)&&r.push({node:o,pos:s})}),r}function Xd(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function Kn(e){return t=>Xd(t.$from,e)}function M(e,t,n){return e.config[t]===void 0&&e.parent?M(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?M(e.parent,t,n):null}):e.config[t]}function io(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},r=M(t,"addExtensions",n);return r?[t,...io(r())]:t}).flat(10)}function lo(e,t){const n=zt.fromSchema(t).serializeFragment(e),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function Vi(e){return typeof e=="function"}function P(e,t=void 0,...n){return Vi(e)?t?e.bind(t)(...n):e(...n):e}function Qd(e={}){return Object.keys(e).length===0&&e.constructor===Object}function ut(e){const t=e.filter(o=>o.type==="extension"),n=e.filter(o=>o.type==="node"),r=e.filter(o=>o.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function zi(e){const t=[],{nodeExtensions:n,markExtensions:r}=ut(e),o=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},i=n.filter(c=>c.name!=="text").map(c=>c.name),l=r.map(c=>c.name),a=[...i,...l];return e.forEach(c=>{const d={name:c.name,options:c.options,storage:c.storage,extensions:o},u=M(c,"addGlobalAttributes",d);if(!u)return;u().forEach(f=>{let p;Array.isArray(f.types)?p=f.types:f.types==="*"?p=a:f.types==="nodes"?p=i:f.types==="marks"?p=l:p=[],p.forEach(m=>{Object.entries(f.attributes).forEach(([g,y])=>{t.push({type:m,name:g,attribute:{...s,...y}})})})})}),o.forEach(c=>{const d={name:c.name,options:c.options,storage:c.storage},u=M(c,"addAttributes",d);if(!u)return;const h=u();Object.entries(h).forEach(([f,p])=>{const m={...s,...p};typeof m?.default=="function"&&(m.default=m.default()),m?.isRequired&&m?.default===void 0&&delete m.default,t.push({type:c.name,name:f,attribute:m})})}),t}function Zd(e){const t=[];let n="",r=!1,o=!1,s=0;const i=e.length;for(let l=0;l<i;l+=1){const a=e[l];if(a==="'"&&!o){r=!r,n+=a;continue}if(a==='"'&&!r){o=!o,n+=a;continue}if(!r&&!o){if(a==="("){s+=1,n+=a;continue}if(a===")"&&s>0){s-=1,n+=a;continue}if(a===";"&&s===0){t.push(n),n="";continue}}n+=a}
6return n&&t.push(n),t}function ds(e){const t=[],n=Zd(e||""),r=n.length;for(let o=0;o<r;o+=1){const s=n[o],i=s.indexOf(":");if(i===-1)continue;const l=s.slice(0,i).trim(),a=s.slice(i+1).trim();l&&a&&t.push([l,a])}return t}function j(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([o,s])=>{if(!r[o]){r[o]=s;return}if(o==="class"){const l=s?String(s).split(" "):[],a=r[o]?r[o].split(" "):[],c=l.filter(d=>!a.includes(d));r[o]=[...a,...c].join(" ")}else if(o==="style"){const l=new Map([...ds(r[o]),...ds(s)]);r[o]=Array.from(l.entries()).map(([a,c])=>`${a}: ${c}`).join("; ")}else r[o]=s}),r},{})}function ft(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>j(n,r),{})}function eu(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function us(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const o=t.reduce((s,i)=>{const l=i.attribute.parseHTML?i.attribute.parseHTML(n):eu(n.getAttribute(i.name));return l==null?s:{...s,[i.name]:l}},{});return{...r,...o}}}}function fs(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&Qd(n)?!1:n!=null))}function hs(e){var t,n;const r={};return!((t=e?.attribute)!=null&&t.isRequired)&&"default"in(e?.attribute||{})&&(r.default=e.attribute.default),((n=e?.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function tu(e,t){var n;const r=zi(e),{nodeExtensions:o,markExtensions:s}=ut(e),i=(n=o.find(c=>M(c,"topNode")))==null?void 0:n.name,l=Object.fromEntries(o.map(c=>{const d=r.filter(y=>y.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:t},h=e.reduce((y,k)=>{const C=M(k,"extendNodeSchema",u);return{...y,...C?C(c):{}}},{}),f=fs({...h,content:P(M(c,"content",u)),marks:P(M(c,"marks",u)),group:P(M(c,"group",u)),inline:P(M(c,"inline",u)),atom:P(M(c,"atom",u)),selectable:P(M(c,"selectable",u)),draggable:P(M(c,"draggable",u)),code:P(M(c,"code",u)),whitespace:P(M(c,"whitespace",u)),linebreakReplacement:P(M(c,"linebreakReplacement",u)),defining:P(M(c,"defining",u)),isolating:P(M(c,"isolating",u)),attrs:Object.fromEntries(d.map(hs))}),p=P(M(c,"parseHTML",u));p&&(f.parseDOM=p.map(y=>us(y,d)));const m=M(c,"renderHTML",u);m&&(f.toDOM=y=>m({node:y,HTMLAttributes:ft(y,d)}));const g=M(c,"renderText",u);return g&&(f.toText=g),[c.name,f]})),a=Object.fromEntries(s.map(c=>{const d=r.filter(g=>g.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:t},h=e.reduce((g,y)=>{const k=M(y,"extendMarkSchema",u);return{...g,...k?k(c):{}}},{}),f=fs({...h,inclusive:P(M(c,"inclusive",u)),excludes:P(M(c,"excludes",u)),group:P(M(c,"group",u)),spanning:P(M(c,"spanning",u)),code:P(M(c,"code",u)),attrs:Object.fromEntries(d.map(hs))}),p=P(M(c,"parseHTML",u));p&&(f.parseDOM=p.map(g=>us(g,d)));const m=M(c,"renderHTML",u);return m&&(f.toDOM=g=>m({mark:g,HTMLAttributes:ft(g,d)})),[c.name,f]}));return new $s({topNode:i,nodes:l,marks:a})}function nu(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function Et(e){return e.sort((n,r)=>{const o=M(n,"priority")||100,s=M(r,"priority")||100;return o>s?-1:o<s?1:0})}function _i(e){const t=Et(io(e)),n=nu(t.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),t}function Hi(e,t,n){const{from:r,to:o}=t,{blockSeparator:s=`
7
8`,textSerializers:i={}}=n||{};let l="";return e.nodesBetween(r,o,(a,c,d,u)=>{var h;a.isBlock&&c>r&&(l+=s);const f=i?.[a.type.name];if(f)return d&&(l+=f({node:a,pos:c,parent:d,index:u,range:t})),!1;a.isText&&(l+=(h=a?.text)==null?void 0:h.slice(Math.max(r,c)-c,o-c))}),l}function ru(e,t){const n={from:0,to:e.content.size};return Hi(e,n,t)}function ji(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function ou(e,t){const n=H(t,e.schema),{from:r,to:o}=e.selection,s=[];e.doc.nodesBetween(r,o,l=>{s.push(l)});const i=s.reverse().find(l=>
8l.type.name===n.name);return i?{...i.attrs}:{}}function Fi(e,t){const n=Wn(typeof t=="string"?t:t.name,e.schema);return n==="node"?ou(e,t):n==="mark"?$i(e,t):{}}function su(e,t=JSON.stringify){const n={};return e.filter(r=>{const o=t(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function iu(e){const t=su(e);return t.length===1?t:t.filter((n,r)=>!t.filter((s,i)=>i!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function Wi(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((o,s)=>{const i=[];if(o.ranges.length)o.forEach((l,a)=>{i.push({from:l,to:a})});else{const{from:l,to:a}=n[s];if(l===void 0||a===void 0)return;i.push({from:l,to:a})}i.forEach(({from:l,to:a})=>{const c=t.slice(s).map(l,-1),d=t.slice(s).map(a),u=t.invert().map(c,-1),h=t.invert().map(d);r.push({oldRange:{from:u,to:h},newRange:{from:c,to:d}})})}),iu(r)}function ao(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(o=>{const s=n.resolve(e),i=oo(s,o.type);i&&r.push({mark:o,...i})}):n.nodesBetween(e,t,(o,s)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(i=>({from:s,to:s+o.nodeSize,mark:i})))}),r}var lu=(e,t,n,r=20)=>{const o=e.doc.resolve(n);let s=r,i=null;for(;s>0&&i===null;){const l=o.node(s);l?.type.name===t?i=l:s-=1}return[i,s]};function bt(e,t){return t.nodes[e]||t.marks[e]||null}function Qt(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=e.find(s=>s.type===t&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}var au=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(o,s,i,l)=>{var a,c;const d=((c=(a=o.type.spec).toText)==null?void 0:c.call(a,{node:o,pos:s,parent:i,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?d:d.slice(0,Math.max(0,r-s))}),n};function vr(e,t,n={}){const{empty:r,ranges:o}=e.selection,s=t?Ae(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(u=>s?s.name===u.type.name:!0).find(u=>ln(u.attrs,n,{strict:!1}));let i=0;const l=[];if(o.forEach(({$from:u,$to:h})=>{const f=u.pos,p=h.pos;e.doc.nodesBetween(f,p,(m,g)=>{if(s&&m.inlineContent&&!m.type.allowsMarkType(s))return!1;if(!m.isText&&!m.marks.length)return;const y=Math.max(f,g),k=Math.min(p,g+m.nodeSize),C=k-y;i+=C,l.push(...m.marks.map(T=>({mark:T,from:y,to:k})))})}),i===0)return!1;const a=l.filter(u=>s?s.name===u.mark.type.name:!0).filter(u=>ln(u.mark.attrs,n,{strict:!1})).reduce((u,h)=>u+h.to-h.from,0),c=l.filter(u=>s?u.mark.type!==s&&u.mark.type.excludes(s):!0).reduce((u,h)=>u+h.to-h.from,0);return(a>0?a+c:a)>=i}function cu(e,t,n={}){if(!t)return _e(e,null,n)||vr(e,null,n);const r=Wn(t,e.schema);return r==="node"?_e(e,t,n):r==="mark"?vr(e,t,n):!1}var du=(e,t)=>{const{$from:n,$to:r,$anchor:o}=e.selection;if(t){const s=Kn(l=>l.type.name===t)(e.selection);if(!s)return!1;const i=e.doc.resolve(s.pos+1);return o.pos+1===i.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},uu=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function ps(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function rr(e,t){const{nodeExtensions:n}=ut(t),r=n.find(i=>i.name===e);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},s=P(M(r,"group",o));return typeof s!="string"?!1:s.split(" ").includes("list")}function Un(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return!/\S/.test((r=e.text)!=null?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let o=!0;return e.content.forEach(s=>{o!==!1&&(Un(s,{ignoreWhitespace:n,checkChildren:t})||(o=!1))}),o}return!1}function Ki(e){return e instanceof E}function fu({selection:e,pos:t,nodeSize:n,selectedOnTextSelection:r=!1}){const{from:o,to:s}=e;return!!(o<=t&&s>=t+n||r&&so(e)&&o>t&&s<t+n)}var Ui=class qi{constructor(t){this.position=t}static fromJSON(t){return new qi(t.position)}toJSON(){return{position:this.position}}};function hu(e,t){const n=t.mapping.mapResult(e.position);return{position:new Ui(n.pos),mapResult:n}}function pu(e){return new Ui(e)}
vendor: 4,528 bytes, line 8
8function cp(e,t,n){const o=e.state.doc.content.size,s=Te(t,0,o),i=Te(n,0,o),l=e.coordsAtPos(s),a=e.coordsAtPos(i,-1),c=Math.min(l.top,a.top),d=Math.max(l.bottom,a.bottom),u=Math.min(l.left,a.left),h=Math.max(l.right,a.right),f=h-u,p=d-c,y={top:c,bottom:d,left:u,right:h,width:f,height:p,x:u,y:c};return{...y,toJSON:()=>y}}function mu(e,t,n){var r;const{selection:o}=t;let s=null;if(so(o)&&(s=o.$cursor),s){const l=(r=e.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(l)||!l.some(c=>c.type.excludes(n)))}const{ranges:i}=o;return i.some(({$from:l,$to:a})=>{let c=l.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(l.pos,a.pos,(d,u,h)=>{if(c)return!1;if(d.isInline){const f=!h||h.type.allowsMarkType(n),p=!!n.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(n));c=f&&p}return!c}),c})}var gu=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:i,ranges:l}=s,a=Ae(e,r.schema);if(o)if(i){const c=$i(r,a);n.addStoredMark(a.create({...c,...t}))}else l.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;r.doc.nodesBetween(d,u,(h,f)=>{const p=Math.max(f,d),m=Math.min(f+h.nodeSize,u);h.marks.find(y=>y.type===a)?h.marks.forEach(y=>{a===y.type&&n.addMark(p,m,a.create({...y.attrs,...t}))}):n.addMark(p,m,a.create(t))})});return mu(r,n,a)},yu=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),bu=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const s=H(e,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock?o().command(({commands:l})=>Ao(s,{...i,...t})(n)?!0:l.clearNodes()).command(({state:l})=>Ao(s,{...i,...t})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ku=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,o=Te(e,0,r.content.size),s=E.create(r,o);t.setSelection(s)}return!0},Su=(e,t)=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=r;let i,l;return typeof t=="number"?(i=t,l=t):t&&"from"in t&&"to"in t?(i=t.from,l=t.to):(i=s.from,l=s.to),o&&n.doc.nodesBetween(i,l,(a,c)=>{a.isText||n.setNodeMarkup(c,void 0,{...a.attrs,dir:e})}),!0},Cu=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:o,to:s}=typeof e=="number"?{from:e,to:e}:e,i=O.atStart(r).from,l=O.atEnd(r).to,a=Te(o,i,l),c=Te(s,i,l),d=O.create(r,a,c);t.setSelection(d)}return!0},xu=e=>({state:t,dispatch:n})=>{const r=H(e,t.schema);return ha(r)(t,n)};function ms(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(o=>t?.includes(o.type.name));e.tr.ensureMarks(r)}}var Mu=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:i}=t,{$from:l,$to:a}=s,c=o.extensionManager.attributes,d=Qt(c,l.node().type.name,l.node().attrs);if(s instanceof E&&s.node.isBlock)return!l.parentOffset||!Ee(i,l.pos)?!1:(r&&(e&&ms(n,o.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const u=a.parentOffset===a.parent.content.size,h=l.depth===0?void 0:Jd(l.node(-1).contentMatchAt(l.indexAfter(-1)));let f=u&&h?[{type:h,attrs:d}]:void 0,p=Ee(t.doc,t.mapping.map(l.pos),1,f);if(!f&&!p&&Ee(t.doc,t.mapping.map(l.pos),1,h?[{type:h}]:void 0)&&(p=!0,f=h?[{type:h,attrs:d}]:void 0),r){if(p&&(s instanceof O&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,f),h&&!u&&!l.parentOffset&&l.parent.type!==h)){const m=t.mapping.map(l.before()),g=t.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,h)&&t.setNodeMarkup(t.mapping.map(l.before()),h)}e&&ms(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return p},Tu=(e,t={})=>({tr:n,state:r,dispatch:o,editor:s})=>{var i;const l=H(e,r.schema),{$from:a,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||a.depth<2||!a.sameParent(c))return!1;const u=a.node(-1);if(u.type!==l)return!1;const h=s.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(o){let y=w.empty;const k=a.index(-1)?1:a.index(-2)?2:3;for(let N=a.depth-k;N>=a.depth-3;N-=1)y=w.from(a.node(N).copy(y));const C=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,T={...Qt(h,a.node().type.name,a.node().attrs),...t},S=((i=l.contentMatch.defaultType)==null?void 0:i.createAndFill(T))||void 0;y=y.append(w.from(l.createAndFill(null,S)||void 0));const v=a.before(a.depth-(k-1));n.replace(v,a.after(-C),new K(y,4-k,0));let x=-1;n.doc.nodesBetween(v,n.doc.content.size,(N,D)=>
8{if(x>-1)return!1;N.isTextblock&&N.content.size===0&&(x=D+1)}),x>-1&&n.setSelection(O.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}const f=c.pos===a.end()?u.contentMatchAt(0).defaultType:null,p={...Qt(h,u.type.name,u.attrs),...t},m={...Qt(h,a.node().type.name,a.node().attrs),...t};n.delete(a.pos,c.pos);const g=f?[{type:l,attrs:p},{type:f,attrs:m}]:[{type:l,attrs:p}];if(!Ee(n.doc,a.pos,2))return!1;if(o){const{selection:y,storedMarks:k}=r,{splittableMarks:C}=s.extensionManager,T=k||y.$to.parentOffset&&y.$from.marks();if(n.split(a.pos,2,g).scrollIntoView(),!T||!o)return!0;const S=T.filter(v=>C.includes(v.type.name));n.ensureMarks(S)}return!0},or=(e,t)=>{const n=Kn(i=>i.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=e.doc.nodeAt(r);return n.node.type===o?.type&&He(e.doc,n.pos)&&e.join(n.pos),!0},sr=(e,t)=>{const n=Kn(i=>i.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=e.doc.nodeAt(r);return n.node.type===o?.type&&He(e.doc,r)&&e.join(r),!0};function Eu(e){const t=e.doc,n=t.firstChild;if(!n)return null;const r=t.resolve(1),o=t.resolve(n.nodeSize-1);return O.between(r,o)}var vu=(e,t,n,r={})=>({editor:o,tr:s,state:i,dispatch:l,chain:a,commands:c,can:d})=>{const{extensions:u,splittableMarks:h}=o.extensionManager,f=H(e,i.schema),p=H(t,i.schema),{selection:m,storedMarks:g}=i,{$from:y,$to:k}=m,C=y.blockRange(k),T=g||m.$to.parentOffset&&m.$from.marks();if(!C)return!1;const S=Kn(Z=>rr(Z.type.name,u))(m),v=m.from===0&&m.to===i.doc.content.size,x=i.doc.content.content,N=x.length===1?x[0]:null,D=v&&N&&rr(N.type.name,u)?{node:N,pos:0}:null,F=S??D,Ne=!!S&&C.depth>=1&&C.depth-S.depth<=1,he=!!D;if((Ne||he)&&F){if(F.node.type===f)return v&&he?a().command(({tr:Z,dispatch:U})=>{const W=Eu(Z);return W?(Z.setSelection(W),U&&U(Z),!0):!1}).liftListItem(p).run():c.liftListItem(p);if(rr(F.node.type.name,u)&&f.validContent(F.node.content))return a().command(()=>(s.setNodeMarkup(F.pos,f),!0)).command(()=>or(s,f)).command(()=>sr(s,f)).run()}return!n||!T||!l?a().command(()=>d().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>or(s,f)).command(()=>sr(s,f)).run():a().command(()=>{const Z=d().wrapInList(f,r),U=T.filter(W=>h.includes(W.type.name));return s.ensureMarks(U),Z?!0:c.clearNodes()}).wrapInList(f,r).command(()=>or(s,f)).command(()=>sr(s,f)).run()},Au=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,i=Ae(e,r.schema);return vr(r,i,t)?o.unsetMark(i,{extendEmptyMarkRange:s}):o.setMark(i,t)},Nu=(e,t,n={})=>({state:r,commands:o})=>{const s=H(e,r.schema),i=H(t,r.schema),l=_e(r,s,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?o.setNode(i,a):o.setNode(s,{...a,...n})},wu=(e,t={})=>({state:n,commands:r})=>{const o=H(e,n.schema);return _e(n,o,t)?r.lift(o):r.wrapIn(o,t)},Ou=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let s;if(o.spec.isInputRules&&(s=o.getState(e))){if(t){const i=e.tr,l=s.transform;for(let a=l.steps.length-1;a>=0;a-=1)i.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=i.doc.resolve(s.from).marks();i.replaceWith(s.from,s.to,e.schema.text(s.text,a))}else i.delete(s.from,s.to)}return!0}}return!1},Du=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach(s=>{e.removeMark(s.$from.pos,s.$to.pos)}),!0},Pu=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:i=!1}=t,{selection:l}=n,a=Ae(e,r.schema),{$from:c,empty:d,ranges:u}=l;if(!o)return!0;if(d&&i){let{from:h,to:f}=l;const p=(s=c.marks().find(g=>g.type===a))==null?void 0:s.attrs,m=oo(c,a,p);m&&(h=m.from,f=m.to),n.removeMark(h,f,a)}else u.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,a)});return n.removeStoredMark(a),!0},Ru=e=>({tr:t,state:n,dispatch:r})=>{const{selection:o}=n;let s,i;return typeof e=="number"?(s=e,i=e):e&&"from"in e&&"to"in e?(s=e.from,i=e.to):(s=o.from,i=o.to),r&&t.doc.nodesBetween(s,i,(l,a)=>{if(l.isText)return;const c={...l.attrs};delete c.dir,t.setNodeMarkup(a,void 0,c)}),!0},Lu=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=Wn(typeof e=="string"?e:e.name,r.schema);if(!l)return!1;l==="node"&&(s=H(e,r.schema)),l==="mark"&&(i=Ae(e,r.schema));let a=!1;
vendor: 34,375 bytes, lines 8-81
8return n.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let h,f,p,m;n.selection.empty?r.doc.nodesBetween(d,u,(g,y)=>{s&&s===g.type&&(a=!0,p=Math.max(y,d),m=Math.min(y+g.nodeSize,u),h=y,f=g)}):r.doc.nodesBetween(d,u,(g,y)=>{y<d&&s&&s===g.type&&(a=!0,p=Math.max(y,d),m=Math.min(y+g.nodeSize,u),h=y,f=g),y>=d&&y<=u&&(s&&s===g.type&&(a=!0,o&&n.setNodeMarkup(y,void 0,{...g.attrs,...t})),i&&g.marks.length&&g.marks.forEach(k=>{if(i===k.type&&(a=!0,o)){const C=Math.max(y,d),T=Math.min(y+g.nodeSize,u);n.addMark(C,T,i.create({...k.attrs,...t}))}}))}),f&&(h!==void 0&&o&&n.setNodeMarkup(h,void 0,{...f.attrs,...t}),i&&f.marks.length&&f.marks.forEach(g=>{i===g.type&&o&&n.addMark(p,m,i.create({...g.attrs,...t}))}))}),a},Iu=(e,t={})=>({state:n,dispatch:r})=>{const o=H(e,n.schema);return ia(o,t)(n,r)},$u=(e,t={})=>({state:n,dispatch:r})=>{const o=H(e,n.schema);return la(o,t)(n,r)},Bu=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(r=>r.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(r=>r!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},qn=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!=null?t:!0}},Vu=(e,t)=>{if(ro(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Kt(e){var t;const{editor:n,from:r,to:o,text:s,rules:i,plugin:l}=e,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(t=c.nodeBefore||c.nodeAfter)!=null&&t.marks.find(h=>h.type.spec.code))return!1;let d=!1;const u=au(c)+s;return i.forEach(h=>{if(d)return;const f=Vu(u,h.find);if(!f)return;const p=a.state.tr,m=jn({state:a.state,transaction:p}),g={from:r-(f[0].length-s.length),to:o},{commands:y,chain:k,can:C}=new Fn({editor:n,state:m});h.handler({state:m,range:g,match:f,commands:y,chain:k,can:C})===null||!p.steps.length||(h.undoable&&p.setMeta(l,{transform:p,from:r,to:o,text:s}),a.dispatch(p),d=!0)}),d}function zu(e){const{editor:t,rules:n}=e,r=new V({state:{init(){return null},apply(o,s,i){const l=o.getMeta(r);if(l)return l;const a=o.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:d}=a;typeof d=="string"?d=d:d=lo(w.from(d),i.schema);const{from:u}=a,h=u+d.length;Kt({editor:t,from:u,to:h,text:d,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:s}},props:{handleTextInput(o,s,i,l){return Kt({editor:t,from:s,to:i,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:s}=o.state.selection;s&&Kt({editor:t,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,s){if(s.key!=="Enter")return!1;const{$cursor:i}=o.state.selection;return i?Kt({editor:t,from:i.pos,to:i.pos,text:`
9`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function _u(e){return Object.prototype.toString.call(e).slice(8,-1)}function Ut(e){return _u(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Gi(e,t){const n={...e};return Ut(e)&&Ut(t)&&Object.keys(t).forEach(r=>{Ut(t[r])&&Ut(e[r])?n[r]=Gi(e[r],t[r]):n[r]=t[r]}),n}var co=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...P(M(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...P(M(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Gi(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},tt=class Ji extends co{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new Ji(n)}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,o=t.state.selection.$from;if(o.pos===o.end()){const i=o.marks();if(!!!i.find(c=>c?.type.name===n.name))return!1;const a=i.find(c=>c?.type.name===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",o.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function Hu(e){return typeof e=="number"}var ju=class{constructor(e){this.find=e.find,this.handler=e.handler}},Fu=(e,t,n)=>{if(ro(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(o=>{const s=[o.text];return s.index=o.index,s.input=e,s.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(o.replaceWith)),s}):[]};function Wu(e){const{editor:t,state:n,from:r,to:o,rule:s,pasteEvent:i,dropEvent:l}=e,{commands:a,chain:c,can:d}=new Fn({editor:t,state:n}),u=[];return n.doc.nodesBetween(r,o,(f,p)=>{var m,g,y,k,C;if((g=(m=f.type)==null?void 0:m.spec)!=null&&g.code||!(f.isText||f.isTextblock||f.isInline))return;const T=(C=(k=(y=f.content)==null?void 0:y.size)!=null?k:f.nodeSize)!=null?C:0,S=Math.max(r,p),v=Math.min(o,p+T);if(S>=v)return;const x=f.isText?f.text||"":f.textBetween(S-p,v-p,void 0,"");Fu(x,s.find,i).forEach(D=>{if(D.index===void 0)return;const F=S+D.index+1,Ne=F+D[0].length,he={from:n.tr.mapping.map(F),to:n.tr.mapping.map(Ne)},Z=s.handler({state:n,range:he,match:D,commands:a,chain:c,can:d,pasteEvent:i,dropEvent:l});u.push(Z)})}),u.every(f=>f!==null)}var qt=null,Ku=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function Uu(e){const{editor:t,rules:n}=e;let r=null,o=!1,s=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:d,from:u,to:h,rule:f,pasteEvt:p})=>{const m=d.tr,g=jn({state:d,transaction:m});if(!(!Wu({editor:t,state:g,from:Math.max(u-1,0),to:h.b-1,rule:f,pasteEvent:p,dropEvent:l})||!m.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(d=>new V({view(u){const h=p=>{var m;r=(m=u.dom.parentElement)!=null&&m.contains(p.target)?u.dom.parentElement:null,r&&(qt=t)},f=()=>{qt&&(qt=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(u,h)=>{if(s=r===u.dom.parentElement,l=h,!s){const f=qt;f?.isEditable&&setTimeout(()=>{const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(u,h)=>{var f;const p=(f=h.clipboardData)==null?void 0:f.getData("text/html");return i=h,o=!!p?.includes("data-pm-slice"),!1}}},appendTransaction:(u,h,f)=>{const p=u[0],m=p.getMeta("uiEvent")==="paste"&&!o,g=p.getMeta("uiEvent")==="drop"&&!s,y=p.getMeta("applyPasteRules"),k=!!y;if(!m&&!g&&!k)return;if(k){let{text:S}=y;typeof S=="string"?S=S:S=lo(w.from(S),f.schema);const{from:v}=y,x=v+S.length,N=Ku(S);return a({rule:d,state:f,from:v,to:{b:x},pasteEvt:N})}const C=h.doc.content.findDiffStart(f.doc.content),T=h.doc.content.findDiffEnd(f.doc.content);if(!(!Hu(C)||!T||C===T.b))return a({rule:d,state:f,from:C,to:T,pasteEvt:i})}}))}var Gn=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=_i(e),this.schema=tu(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:bt(t.name,this.schema)},r=M(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this;return Et([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:bt(r.name,this.schema)},s=[],i=M(r,"addKeyboardShortcuts",o);let l={};if(r.type==="mark"&&M(r,"exitable",o)&&(l.ArrowRight=()=>tt.handleExit({editor:e,mark:r})),i){const h=Object.fromEntries(Object.entries(i()).map(([f,p])=>[f,()=>p({editor:e})]));l={...l,...h}}const a=rd(l);s.push(a);const c=M(r,"addInputRules",o);if(ps(r,e.options.enableInputRules)&&c){const h=c();if(h&&h.length){const f=zu({editor:e,rules:h}),p=Array.isArray(f)?f:[f];s.push(...p)}}const d=M(r,"addPasteRules",o);if(ps(r,e.options.enablePasteRules)&&d){const h=d();if(h&&h.length){const f=Uu({editor:e,rules:h});s.push(...f)}}const u=M(r,"addProseMirrorPlugins",o);if(u){const h=u();s.push(...h)}return s})}get attributes(){return zi(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=ut(this.extensions);return Object.fromEntries(t.filter(n=>!!M(n,"addNodeView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:H(n.name,this.schema)},s=M(n,"addNodeView",o);if(!s)return[];const i=s();if(!i)return[];const l=(a,c,d,u,h)=>{const f=ft(a,r);return i({node:a,view:c,getPos:d,decorations:u,innerDecorations:h,editor:e,extension:n,HTMLAttributes:f})};return[n.name,l]}))}dispatchTransaction(e){const{editor:t}=this;return Et([...this.extensions].reverse()).reduceRight((r,o)=>{const s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:t,type:bt(o.name,this.schema)},i=M(o,"dispatchTransaction",s);return i?l=>{i.call(s,{transaction:l,next:r})}:r},e)}transformPastedHTML(e){const{editor:t}=this;return Et([...this.extensions]).reduce((r,o)=>{const s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:t,type:bt(o.name,this.schema)},i=M(o,"transformPastedHTML",s);return i?(l,a)=>{const c=r(l,a);return i.call(s,c)}:r},e||(r=>r))}get markViews(){const{editor:e}=this,{markExtensions:t}=ut(this.extensions);return Object.fromEntries(t.filter(n=>!!M(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Ae(n.name,this.schema)},s=M(n,"addMarkView",o);if(!s)return[];const i=(l,a,c)=>{const d=ft(l,r);return s()({mark:l,view:a,inline:c,editor:e,extension:n,HTMLAttributes:d,updateAttributes:u=>{cf(l,e,u)}})};return[n.name,i]}))}destroy(){this.extensions.forEach(e=>{let t=e;for(;t.parent;){const n=t.parent;n.child===t&&(n.child=null),t=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{var n;const r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:bt(t.name,this.schema)};t.type==="mark"&&((n=P(M(t,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(t.name);const o=M(t,"onBeforeCreate",r),s=M(t,"onCreate",r),i=M(t,"onUpdate",r),l=M(t,"onSelectionUpdate",r),a=M(t,"onTransaction",r),c=M(t,"onFocus",r),d=M(t,"onBlur",r),u=M(t,"onDestroy",r);o&&this.editor.on("beforeCreate",o),s&&this.editor.on("create",s),i&&this.editor.on("update",i),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),u&&this.editor.on("destroy",u)})}};Gn.resolve=_i;Gn.sort=Et;Gn.flatten=io;var qu={};no(qu,{ClipboardTextSerializer:()=>Xi,Commands:()=>Qi,Delete:()=>Zi,Drop:()=>el,Editable:()=>tl,FocusEvents:()=>rl,Keymap:()=>ol,Paste:()=>sl,Tabindex:()=>il,TextDirection:()=>ll,focusEventsPluginKey:()=>nl});var z=class Yi extends co{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new Yi(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},Xi=z.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new V({key:new Y("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:s}=o,i=Math.min(...s.map(d=>d.$from.pos)),l=Math.max(...s.map(d=>d.$to.pos)),a=ji(n);return Hi(r,{from:i,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Qi=z.create({name:"commands",addCommands(){return{...Di}}}),Zi=z.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,o;const s=()=>{var i,l,a,c;if((c=(a=(l=(i=this.editor.options.coreExtensionOptions)==null?void 0:i.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,e))!=null?c:e.getMeta("y-sync$"))return;const d=Bi(e.before,[e,...t]);Wi(d).forEach(f=>{d.mapping.mapResult(f.oldRange.from).deletedAfter&&d.mapping.mapResult(f.oldRange.to).deletedBefore&&d.before.nodesBetween(f.oldRange.from,f.oldRange.to,(p,m)=>{const g=m+p.nodeSize-2,y=f.oldRange.from<=m&&g<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:m,to:g,newFrom:d.mapping.map(m),newTo:d.mapping.map(g),deletedRange:f.oldRange,newRange:f.newRange,partial:!y,editor:this.editor,transaction:e,combinedTransform:d})})});const h=d.mapping;d.steps.forEach((f,p)=>{var m,g;if(f instanceof Fl){const y=h.slice(p).map(f.from,-1),k=h.slice(p).map(f.to),C=h.invert().map(y,-1),T=h.invert().map(k),S=y>0?(m=d.doc.nodeAt(y-1))==null?void 0:m.marks.some(x=>x.eq(f.mark)):!1,v=(g=d.doc.nodeAt(k))==null?void 0:g.marks.some(x=>x.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:C,to:T},newRange:{from:y,to:k},partial:!!(v||S),editor:this.editor,transaction:e,combinedTransform:d})}})};(o=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||o?setTimeout(s,0):s()}}),el=z.create({name:"drop",addProseMirrorPlugins(){return[new V({key:new Y("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),tl=z.create({name:"editable",addProseMirrorPlugins(){return[new V({key:new Y("editable"),props:{editable:()=>this.editor.options.editable}})]}}),nl=new Y("focusEvents"),rl=z.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new V({key:nl,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),ol=z.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:d,$anchor:u}=a,{pos:h,parent:f}=u,p=u.parent.isTextblock&&h>0?l.doc.resolve(h-1):u,m=p.parent.type.spec.isolating,g=u.pos-u.parentOffset,y=m&&p.parent.childCount===1?g===u.pos:_.atStart(c).from===h;return!d||!f.type.isTextblock||f.textContent.length||!y||y&&u.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},s={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return It()||Ii()?s:o},addProseMirrorPlugins(){return[new V({key:new Y("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(m=>m.getMeta("composition")))return;const r=e.some(m=>m.docChanged)&&!t.doc.eq(n.doc),o=e.some(m=>m.getMeta("preventClearDocument"));if(!r||o)return;const{empty:s,from:i,to:l}=t.selection,a=_.atStart(t.doc).from,c=_.atEnd(t.doc).to;if(s||!(i===a&&l===c)||!Un(n.doc))return;const h=n.tr,f=jn({state:n,transaction:h}),{commands:p}=new Fn({editor:this.editor,state:f});if(p.clearNodes(),!!h.steps.length)return h}})]}}),sl=z.create({name:"paste",addProseMirrorPlugins(){return[new V({key:new Y("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),il=z.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new V({key:new Y("tabindex"),props:{attributes:()=>{var e;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(e=this.options.value)!=null?e:"0"}}}})]}}),ll=z.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=ut(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new V({key:new Y("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),Gu=class St{constructor(t,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=o}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!=null?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new St(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new St(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new St(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,i=n.isInline,l=this.pos+r+(s?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(l);if(!o&&!i&&a.depth<=this.depth)return;const c=new St(a,this.editor,o,o||i?n:null);o&&(c.actualDepth=this.depth+1),t.push(c)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===t)if(Object.keys(n).length>0){const s=o.node.attrs,i=Object.keys(n);for(let l=0;l<i.length;l+=1){const a=i[l];if(s[a]!==n[a])break}}else r=o;o=o.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const s=Object.keys(n);return this.children.forEach(i=>{r&&o.length>0||(i.node.type.name===t&&s.every(a=>n[a]===i.node.attrs[a])&&o.push(i),!(r&&o.length>0)&&(o=o.concat(i.querySelectorAll(t,n,r))))}),o}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}},Ju=`.ProseMirror {
10  position: relative;
11}
12
13.ProseMirror {
14  word-wrap: break-word;
15  white-space: pre-wrap;
16  white-space: break-spaces;
17  -webkit-font-variant-ligatures: none;
18  font-variant-ligatures: none;
19  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
20}
21
22.ProseMirror [contenteditable="false"] {
23  white-space: normal;
24}
25
26.ProseMirror [contenteditable="false"] [contenteditable="true"] {
27  white-space: pre-wrap;
28}
29
30.ProseMirror pre {
31  white-space: pre-wrap;
32}
33
34img.ProseMirror-separator {
35  display: inline !important;
36  border: none !important;
37  margin: 0 !important;
38  width: 0 !important;
39  height: 0 !important;
40}
41
42.ProseMirror-gapcursor {
43  display: none;
44  pointer-events: none;
45  position: absolute;
46  margin: 0;
47}
48
49.ProseMirror-gapcursor:after {
50  content: "";
51  display: block;
52  position: absolute;
53  top: -2px;
54  width: 20px;
55  border-top: 1px solid black;
56  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
57}
58
59@keyframes ProseMirror-cursor-blink {
60  to {
61    visibility: hidden;
62  }
63}
64
65.ProseMirror-hideselection *::selection {
66  background: transparent;
67}
68
69.ProseMirror-hideselection *::-moz-selection {
70  background: transparent;
71}
72
73.ProseMirror-hideselection * {
74  caret-color: transparent;
75}
76
77.ProseMirror-focused .ProseMirror-gapcursor {
78  display: block;
79}`;function Yu(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute("data-tiptap-style",""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}var Xu=class extends Bu{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:hu,createMappablePosition:pu},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:o,moved:s})=>this.options.onDrop(r,o,s)),this.on("paste",({event:r,slice:o})=>this.options.onPaste(r,o)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=Ri(t,this.options.autofocus);this.editorState=jl.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Yu(Ju,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=Vi(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;n=n.filter(i=>!i.key.startsWith(s))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t,n,r;const s=[...this.options.enableCoreExtensions?[tl,Xi.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),Qi,rl,ol,il.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),el,sl,Zi,ll.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i?.type));this.extensionManager=new Gn(s,this)}createCommandManager(){this.commandManager=new Fn({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Er(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),e=Er(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,s=t.transformPastedHTML,i=this.extensionManager.transformPastedHTML(s);this.editorView=new wi(e,{...t,attributes:{role:"textbox",...t?.attributes},dispatchTransaction:o,transformPastedHTML:i,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const a=this.view.dom;a.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(c=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(c)});return}const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),o=n.includes(e),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=n.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=i?.getMeta("focus"),a=i?.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:i}),a&&this.emit("blur",{editor:this,event:a.event,transaction:i}),!(e.getMeta("preventUpdate")||!n.some(c=>c.docChanged)||s.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Fi(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return cu(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return lo(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
80
81`,textSerializers:n={}}=e||{};return ru(this.state.doc,{blockSeparator:t,textSerializers:{...ji(this.schema),...n}})}get isEmpty(){return Un(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new Gu(t,this)}get $doc(){return this.$pos(0)}};function ht(e){return new qn({find:e.find,handler:({state:t,range:n,match:r})=>{const o=P(e.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:s}=t,i=r[r.length-1],l=r[0];if(i){const a=l.search(/\S/),c=n.from+l.indexOf(i),d=c+i.length;if(ao(n.from,n.to,t.doc).filter(f=>f.mark.type.excluded.find(m=>m===e.type&&m!==f.mark.type)).filter(f=>f.to>c).length)return null;d<n.to&&s.delete(d,n.to),c>n.from&&s.delete(n.from+a,c);const h=n.from+a+i.length;s.addMark(n.from+a,h,e.type.create(o||{})),s.removeStoredMark(e.type)}},undoable:e.undoable})}function Qu(e){return new qn({find:e.find,handler:({state:t,range:n,match:r})=>{const o=P(e.getAttributes,void 0,r)||{},{tr:s}=t,i=n.from;let l=n.to;const a=e.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let d=i+c;d>l?d=l:l=d+r[1].length;const u=r[0][r[0].length-1];s.insertText(u,i+r[0].length-1),s.replaceWith(d,l,a)}else if(r[0]){const c=e.type.isInline?i:i-1;s.insert(c,e.type.create(o)).delete(s.mapping.map(i),s.mapping.map(l))}s.scrollIntoView()},undoable:e.undoable})}function Ar(e){return new qn({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),s=P(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,s)},undoable:e.undoable})}function pt(e){return new qn({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{const s=P(e.getAttributes,void 0,r)||{},i=t.tr.delete(n.from,n.to),a=i.doc.resolve(n.from).blockRange(),c=a&&Hr(a,e.type,s);if(!c)return null;if(i.wrap(a,c),e.keepMarks&&e.editor){const{selection:u,storedMarks:h}=t,{splittableMarks:f}=e.editor.extensionManager,p=h||u.$to.parentOffset&&u.$from.marks();if(p){const m=p.filter(g=>f.includes(g.type.name));i.ensureMarks(m)}}if(e.keepAttributes){const u=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(u,s).run()}const d=i.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&He(i.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&i.join(n.from-1)},undoable:e.undoable})}function Zu(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof E){const s=r.index();return r.parent.canReplaceWith(s,s+1,t)}let o=r.depth;for(;o>=0;){const s=r.index(o);if(r.node(o).contentMatchAt(s).matchType(t))return!0;o-=1}return!1}function dp(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var ef={};no(ef,{createAtomBlockMarkdownSpec:()=>tf,createBlockMarkdownSpec:()=>nf,createInlineMarkdownSpec:()=>sf,parseAttributes:()=>uo,parseIndentedBlocks:()=>Nr,renderNestedMarkdownContent:()=>ho,serializeAttributes:()=>fo});function uo(e){if(!e?.trim())return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}
81__`)),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){const c=o.map(d=>d.trim().slice(1));t.class=c.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(t.id=s[1]);const i=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(i)).forEach(([,c,d])=>{var u;const h=parseInt(((u=d.match(/__QUOTED_(\d+)__/))==null?void 0:u[1])||"0",10),f=n[h];f&&(t[c]=f.slice(1,-1))});const a=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(t[d]=!0)}),t}function fo(e){if(!e||Object.keys(e).length===0)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(r=>t.push(`.${r}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?t.push(n):r!==!1&&r!=null&&t.push(`${n}="${String(r)}"`))}),t.join(" ")}function tf(e){const{nodeName:t,name:n,parseAttributes:r=uo,serializeAttributes:o=fo,defaultAttributes:s={},requiredAttributes:i=[],allowedAttributes:l}=e,a=n||t,c=d=>{if(!l)return d;const u={};return l.forEach(h=>{h in d&&(u[h]=d[h])}),u};return{parseMarkdown:(d,u)=>{const h={...s,...d.attributes};return u.createNode(t,h,[])},markdownTokenizer:{name:t,level:"block",start(d){var u;const h=new RegExp(`^:::${a}(?:\\s|$)`,"m"),f=(u=d.match(h))==null?void 0:u.index;return f!==void 0?f:-1},tokenize(d,u,h){const f=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=d.match(f);if(!p)return;const m=p[1]||"",g=r(m);if(!i.find(k=>!(k in g)))return{type:t,raw:p[0],attributes:g}}},renderMarkdown:d=>{const u=c(d.attrs||{}),h=o(u),f=h?` {${h}}`:"";return`:::${a}${f} :::`}}}function nf(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=uo,serializeAttributes:s=fo,defaultAttributes:i={},content:l="block",allowedAttributes:a}=e,c=n||t,d=u=>{if(!a)return u;const h={};return a.forEach(f=>{f in u&&(h[f]=u[f])}),h};return{parseMarkdown:(u,h)=>{let f;if(r){const m=r(u);f=typeof m=="string"?[{type:"text",text:m}]:m}else l==="block"?f=h.parseChildren(u.tokens||[]):f=h.parseInline(u.tokens||[]);const p={...i,...u.attributes};return h.createNode(t,p,f)},markdownTokenizer:{name:t,level:"block",start(u){var h;const f=new RegExp(`^:::${c}`,"m"),p=(h=u.match(f))==null?void 0:h.index;return p!==void 0?p:-1},tokenize(u,h,f){var p;const m=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=u.match(m);if(!g)return;const[y,k=""]=g,C=o(k);let T=1;const S=y.length;let v="";const x=/^:::([\w-]*)(\s.*)?/gm,N=u.slice(S);for(x.lastIndex=0;;){const D=x.exec(N);if(D===null)break;const F=D.index,Ne=D[1];if(!((p=D[2])!=null&&p.endsWith(":::"))){if(Ne)T+=1;else if(T-=1,T===0){const he=N.slice(0,F);v=he.trim();const Z=u.slice(0,S+F+D[0].length);let U=[];if(v)if(l==="block")for(U=f.blockTokens(he),U.forEach(W=>{W.text&&(!W.tokens||W.tokens.length===0)&&(W.tokens=f.inlineTokens(W.text))});U.length>0;){const W=U[U.length-1];if(W.type==="paragraph"&&(!W.text||W.text.trim()===""))U.pop();else break}else U=f.inlineTokens(v);return{type:t,raw:Z,attributes:C,content:v,tokens:U}}}}}},renderMarkdown:(u,h)=>{const f=d(u.attrs||{}),p=s(f),m=p?` {${p}}`:"",g=h.renderChildren(u.content||[],`
82
83`);return`:::${c}${m}
84
85${g}
86
87:::`}}}function rf(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;r!==null;){const[,o,s,i]=r;t[o]=s||i,r=n.exec(e)}return t}function of(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function sf(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=rf,serializeAttributes:s=of,defaultAttributes:i={},selfClosing:l=!1,allowedAttributes:a}=e,c=n||t,d=h=>{if(!a)return h;const f={};return a.forEach(p=>{const m=typeof p=="string"?p:p.name,g=typeof p=="string"?void 0:p.skipIfDefault;if(m in h){const y=h[m];if(g!==void 0&&y===g)return;f[m]=y}}),f},u=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(h,f)=>{const p={...i,...h.attributes};if(l)return f.createNode(t,p);const m=r?r(h):h.content||"";return m?f.createNode(t,p,[f.createTextNode(m)]):f.createNode(t,p,[])},markdownTokenizer:{name:t,level:"inline",start(h){const f=l?new RegExp(`\\[${u}\\s*[^\\]]*\\]`):new RegExp(`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),p=h.match(f),m=p?.index;return m!==void 0?m:-1},tokenize(h,f,p){const m=l?new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),g=h.match(m);if(!g)return;let y="",k="";if(l){const[,T]=g;k=T}else{const[,T,S]=g;k=T,y=S||""}const C=o(k.trim());return{type:t,raw:g[0],content:y.trim(),attributes:C}}},renderMarkdown:h=>{let f="";r?f=r(h):h.content&&h.content.length>0&&(f=h.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const p=d(h.attrs||{}),m=s(p),g=m?` ${m}`:"";return l?`[${c}${g}]`:`[${c}${g}]${f}[/${c}]`}}}function Nr(e,t,n){var r,o,s,i;const l=e.split(`
88`),a=[];let c="",d=0;const u=t.baseIndentSize||2;for(;d<l.length;){const h=l[d],f=h.match(t.itemPattern);if(!f){if(a.length>0)break;if(h.trim()===""){d+=1,c=`${c}${h}
89`;continue}else return}const p=t.extractItemData(f),{indentLevel:m,mainContent:g}=p;c=`${c}${h}
90`;const y=[g];for(d+=1;d<l.length;){const S=l[d];if(S.trim()===""){const x=l.slice(d+1).findIndex(F=>F.trim()!=="");if(x===-1)break;if((((o=(r=l[d+1+x].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>m){y.push(S),c=`${c}${S}
91`,d+=1;continue}else break}if((((i=(s=S.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:i.length)||0)>m)y.push(S),c=`${c}${S}
92`,d+=1;else break}let k;const C=y.slice(1);if(C.length>
920){const S=C.map(v=>v.slice(m+u)).join(`
93`);S.trim()&&(t.customNestedParser?k=t.customNestedParser(S):k=n.blockTokens(S))}const T=t.createToken(p,k);a.push(T)}if(a.length!==0)return{items:a,raw:c}}function ho(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const o=typeof n=="function"?n(r):n,[s,...i]=e.content,l=t.renderChildren([s]);let a=`${o}${l}`;return i&&i.length>0&&i.forEach((c,d)=>{var u,h;const f=(h=(u=t.renderChild)==null?void 0:u.call(t,c,d+1))!=null?h:t.renderChildren([c]);if(f!=null){const p=f.split(`
94`).map(m=>m?t.indent(m):t.indent("")).join(`
95`);a+=c.type==="paragraph"?`
96
97${p}`:`
98${p}`}}),a}var an=new WeakMap;function lf(e,t){let n=an.get(e);if(!n){const r={callbacks:new Set,rafId:null,handler:()=>{r.rafId!==null&&cancelAnimationFrame(r.rafId),r.rafId=requestAnimationFrame(()=>{r.rafId=null,r.callbacks.forEach(o=>o())})}};an.set(e,r),e.on("update",r.handler),n=r}n.callbacks.add(t)}function af(e,t){const n=an.get(e);n&&(n.callbacks.delete(t),n.callbacks.size===0&&(n.rafId!==null&&cancelAnimationFrame(n.rafId),e.off("update",n.handler),an.delete(e)))}function cf(e,t,n={}){const{state:r}=t,{doc:o,tr:s}=r,i=e;o.descendants((l,a)=>{const c=s.mapping.map(a),d=s.mapping.map(a)+l.nodeSize;let u=null;if(l.marks.forEach(f=>{if(f!==i)return!1;u=f}),!u)return;let h=!1;if(Object.keys(n).forEach(f=>{n[f]!==u.attrs[f]&&(h=!0)}),h){const f=e.type.create({...e.attrs,...n});s.removeMark(c,d,e.type),s.addMark(c,d,f)}}),s.docChanged&&t.view.dispatch(s)}var ie=class al extends co{constructor(){super(...arguments),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new al(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},df=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,o,s,i,l;const{view:a}=this.editor,c=e.target,d=c.nodeType===3?(t=c.parentElement)==null?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(n=this.contentDOM)!=null&&n.contains(c)||!d)return;let u=0,h=0;if(this.dom!==d){const k=this.dom.getBoundingClientRect(),C=d.getBoundingClientRect(),T=(o=e.offsetX)!=null?o:(r=e.nativeEvent)==null?void 0:r.offsetX,S=(i=e.offsetY)!=null?i:(s=e.nativeEvent)==null?void 0:s.offsetY;u=C.x-k.x+T,h=C.y-k.y+S}const f=this.dom.cloneNode(!0);try{const k=this.dom.getBoundingClientRect();f.style.width=`${Math.round(k.width)}px`,f.style.height=`${Math.round(k.height)}px`,f.style.boxSizing="border-box",f.style.pointerEvents="none"}catch{}let p=null;try{p=document.createElement("div"),p.style.position="absolute",p.style.top="-9999px",p.style.left="-9999px",p.style.pointerEvents="none",p.appendChild(f),document.body.appendChild(p),(l=e.dataTransfer)==null||l.setDragImage(f,u,h)}finally{p&&setTimeout(()=>{try{p?.remove()}catch{}},0)}const m=this.getPos();if(typeof m!="number")return;const g=E.create(a.state.doc,m),y=a.state.tr.setSelection(g);a.dispatch(y)}stopEvent(e){var t;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!((t=this.contentDOM)!=null&&t.contains(n))))return!1;const o=e.type.startsWith("drag"),s=e.type==="dragover"||e.type==="dragenter",i=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!i&&!o)return!0;const{isEditable:a}=this.editor,{isDragging:c}=this,d=!!this.node.type.spec.draggable,u=E.isSelectable(this.node),h=e.type==="copy",f=e.type==="paste",p=e.type==="cut",m=e.type==="mousedown";if(!d&&u&&o&&e.target===this.dom&&e.preventDefault(),d&&o&&!c&&e.target===this.dom)return e.preventDefault(),!1;if(d&&a&&!c&&m){const g=n.closest("[data-drag-handle]");g&&(this.dom===g||this.dom.contains(g))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||s||i||h||f||p||m&&u)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(It()||Tr())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes
98)].every(n=>n.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{const n=this.getPos();return typeof n!="number"?!1:(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function et(e){return new ju({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{const s=P(e.getAttributes,void 0,r,o);if(s===!1||s===null)return null;const{tr:i}=t,l=r[r.length-1],a=r[0];let c=n.to;if(l){const d=a.search(/\S/),u=n.from+a.indexOf(l),h=u+l.length;if(ao(n.from,n.to,t.doc).filter(m=>m.mark.type.excluded.find(y=>y===e.type&&y!==m.mark.type)).filter(m=>m.to>u).length)return null;h<n.to&&i.delete(h,n.to),u>n.from&&i.delete(n.from+d,u),c=n.from+d+l.length,i.addMark(n.from+d,c,e.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||i.removeStoredMark(e.type)}}})}var uf=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},ff=({contentComponent:e})=>{const t=Rs.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return se.jsx(se.Fragment,{children:Object.values(t)})};function hf(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:Bl.createPortal(r.reactElement,r.element,n)},e.forEach(o=>o())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(o=>o())}}}var pf=class extends Ye.Component{constructor(e){super(e),this.editorContentRef=Ye.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&((e=t.view.dom)!=null&&e.parentNode)){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=hf(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;const t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return se.jsxs(se.Fragment,{children:[se.jsx("div",{ref:uf(t,this.editorContentRef),...n}),e?.contentComponent&&se.jsx(ff,{contentComponent:e.contentComponent})]})}},mf=B.forwardRef((e,t)=>{const n=Ye.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return Ye.createElement(pf,{key:n,innerRef:t,...e})}),gf=Ye.memo(mf),yf=typeof window<"u"?B.useLayoutEffect:B.useEffect,bf=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",t),()=>{n.off("transaction",t)}}}};function kf(e){var t;const[n]=B.useState(()=>new bf(e.editor)),r=zl.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:Vl);return yf(()=>n.watch(e.editor),[e.editor,n]),B.useDebugValue(r),r}var Sf=!1,wr=typeof window>"u",Cf=wr||!!(typeof window<"u"&&window.next),xf=class cl{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.get
98ServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?wr||Cf?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var o,s;return(s=(o=this.options.current).onBeforeCreate)==null?void 0:s.call(o,...r)},onBlur:(...r)=>{var o,s;return(s=(o=this.options.current).onBlur)==null?void 0:s.call(o,...r)},onCreate:(...r)=>{var o,s;return(s=(o=this.options.current).onCreate)==null?void 0:s.call(o,...r)},onDestroy:(...r)=>{var o,s;return(s=(o=this.options.current).onDestroy)==null?void 0:s.call(o,...r)},onFocus:(...r)=>{var o,s;return(s=(o=this.options.current).onFocus)==null?void 0:s.call(o,...r)},onSelectionUpdate:(...r)=>{var o,s;return(s=(o=this.options.current).onSelectionUpdate)==null?void 0:s.call(o,...r)},onTransaction:(...r)=>{var o,s;return(s=(o=this.options.current).onTransaction)==null?void 0:s.call(o,...r)},onUpdate:(...r)=>{var o,s;return(s=(o=this.options.current).onUpdate)==null?void 0:s.call(o,...r)},onContentError:(...r)=>{var o,s;return(s=(o=this.options.current).onContentError)==null?void 0:s.call(o,...r)},onDrop:(...r)=>{var o,s;return(s=(o=this.options.current).onDrop)==null?void 0:s.call(o,...r)},onPaste:(...r)=>{var o,s;return(s=(o=this.options.current).onPaste)==null?void 0:s.call(o,...r)},onDelete:(...r)=>{var o,s;return(s=(o=this.options.current).onDelete)==null?void 0:s.call(o,...r)}};return new Xu(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((o,s)=>{var i;return o===((i=n.extensions)==null?void 0:i[s])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?cl.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((r,o)=>r===t[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function up(e={},t=[]){const n=B.useRef(e);n.current=e;const[r]=B.useState(()=>new xf(n)),o=Rs.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return B.useDebugValue(o),B.useEffect(r.onRender(t)),kf({editor:o,selector:({transactionNumber:s})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&s===0?0:s+1}),o}var po=B.createContext({editor:null});po.Consumer;var fp=()=>B.useContext(po),dl=B.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),ul=()=>B.useContext(dl);function hp({as:e="div",...t}){const{nodeViewContentRef:n,nodeViewContentChildren:r}=ul();return se.jsx(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style},children:r})}var pp=Ye.forwardRef((e,t)=>
98{const{onDragStart:n}=ul(),r=e.as||"div";return se.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function gs(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function ys(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.forward_ref)"||e.$$typeof.description==="react.forward_ref"))}function Mf(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.memo)"||e.$$typeof.description==="react.memo"))}function Tf(e){if(gs(e)||ys(e))return!0;if(Mf(e)){const t=e.type;if(t)return gs(t)||ys(t)}return!1}function Ef(){try{if(B.version)return parseInt(B.version.split(".")[0],10)>=19}catch{}return!1}var vf=class{constructor(e,{editor:t,props:n={},as:r="div",className:o=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isEditorContentInitialized?$l.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;const t=this.component,n=this.props,r=this.editor,o=Ef(),s=Tf(t),i={...n};i.ref&&!(o||s)&&delete i.ref,!i.ref&&(o||s)&&(i.ref=l=>{this.ref=l}),this.reactElement=se.jsx(t,{...i}),(e=r?.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;const t=this.editor;(e=t?.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};Ye.createContext({markViewContentRef:()=>{}});var Af=class extends df{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.positionCheckCallback=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");if(!r)return;r.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){const e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,o){var s;return r==="storage"?(s=e.storage[t.name])!=null?s:{}:Reflect.get(n,r,o)}})}return this.cachedExtensionWithSyncedStorage}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(a={})=>this.updateAttributes(a),deleteNode:()=>this.deleteNode(),ref:B.createRef()};if(!this.component.displayName){const a=c=>c.charAt(0).toUpperCase()+c.substring(1);this.component.displayName=a(this.extension.name)}const r={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:a=>{a&&this.contentDOMElement&&a.firstChild!==this.contentDOMElement&&(a.hasAttribute("data-node-view-wrapper")&&a.removeAttribute("data-node-view-wrapper"),a.appendChild(this.contentDOMElement))}},o=this.component,s=B.memo(a=>se.jsx(dl.Provider,{value:r,children:B.createElement(o,a)}));s.displayName="ReactNodeView";let i=this.node.isInline?"span":"div";this.options.as&&(i=this.options.as);const{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new vf(s,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${l}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos(),this.positionCheckCallback=()=>{const a=this.getPos();typeof a!="number"||a===this.currentPos||(this.currentPos=a,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs=="function"&&this.updateElementAttributes())},lf(this.editor,this.positionCheckCallback)}get dom(){var e;if(this.renderer.element.firstElementChild&&!((e=this.renderer.element.firstElementChild)!=null&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}
98get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const e=this.currentPos;if(typeof e!="number")return;if(fu({selection:this.editor.state.selection,pos:e,nodeSize:this.node.nodeSize,selectedOnTextSelection:this.options.selectedOnTextSelection})){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){const r=s=>{this.renderer.updateProps(s),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const s=this.node,i=this.decorations,l=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:s,oldDecorations:i,newNode:e,newDecorations:t,oldInnerDecorations:l,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}const o=this.getPos();return e===this.node&&this.decorations===t&&this.innerDecorations===n?(o===this.currentPos||(this.currentPos=o,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage,getPos:()=>this.getPos()})),!0):(this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=o,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage}),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.positionCheckCallback&&(af(this.editor,this.positionCheckCallback),this.positionCheckCallback=null),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const t=this.editor.extensionManager.attributes,n=ft(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function mp(e,t){return n=>n.editor.contentComponent?new Af(e,n,t):{}}var mo=B.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});mo.displayName="TiptapContext";var Nf=()=>B.useContext(mo);function fl({editor:e,instance:t,children:n}){const r=e??t;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const o=B.useMemo(()=>({editor:r}),[r]),s=B.useMemo(()=>({editor:r}),[r]);return se.jsx(po.Provider,{value:s,children:se.jsx(mo.Provider,{value:o,children:n})})}fl.displayName="Tiptap";function hl({...e}){const{editor:t}=Nf();return se.jsx(gf,{editor:t,...e})}hl.displayName="Tiptap.Content";Object.assign(fl,{Content:hl});const wf="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
98ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Of="ελ1υ2бг1ел3дети4ею2католик6ом3мÐ
98ºÐ´2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3Õ°Õ¡Õµ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1ì»´2삼성2한국2",Or="numeric",Dr="ascii",Pr="alpha",vt="asciinumeric",Ct="alphanumeric",Rr="domain",pl="emoji",Df="scheme",Pf="slashscheme",ir="whitespace";function Rf(e,t){return e in t||(t[e]=[]),t[e]}function qe(e,t,n){t[Or]&&(t[vt]=!0,t[Ct]=!0),t[Dr]&&(t[vt]=!0,t[Pr]=!0),t[vt]&&(t[Ct]=!0),t[Pr]&&(t[Ct]=!0),t[Ct]&&(t[Rr]=!0),t[pl]&&(t[Rr]=!0);for(const r in t){const o=Rf(r,n);o.indexOf(e)<0&&o.push(e)}}function Lf(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function re(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}re.groups={};re.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const o=t.jr[r][0],s=t.jr[r][1];if(s&&o.test(e))return s}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){r=r||re.groups;let o;return t&&t.j?o=t:(o=new re(t),n&&r&&qe(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const s=e.length;if(!s)return o;for(let i=0;i<s-1;i++)o=o.tt(e[i]);return o.tt(e[s-1],t,n,r)},tt(e,t,n,r){r=r||re.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const s=t;let i,l=o.go(e);if(l?(i=new re,Object.assign(i.j,l.j),i.jr.push.apply(i.jr,l.jr),i.jd=l.jd,i.t=l.t):i=new re,s){if(r)if(i.t&&typeof i.t=="string"){const a=Object.assign(Lf(i.t,r),n);qe(s,a,r)}else n&&qe(s,n,r);i.t=s}return o.j[e]=i,i}};const A=(e,t,n,r,o)=>e.ta(t,n,r,o),I=(e,t,n,r,o)=>e.tr(t,n,r,o),bs=(e,t,n,r,o)=>e.ts(t,n,r,o),b=(e,t,n,r,o)=>e.tt(t,n,r,o),Ce="WORD",Lr="UWORD",ml="ASCIINUMERICAL",gl="ALPHANUMERICAL",Bt="LOCALHOST",Ir="TLD",$r="UTLD",Zt="SCHEME",it="SLASH_SCHEME",go="NUM",Br="WS",yo="NL",At="OPENBRACE",Nt="CLOSEBRACE",cn="OPENBRACKET",dn="CLOSEBRACKET",un="OPENPAREN",fn="CLOSEPAREN",hn="OPENANGLEBRACKET",pn="CLOSEANGLEBRACKET",mn="FULLWIDTHLEFTPAREN",gn="FULLWIDTHRIGHTPAREN",yn="LEFTCORNERBRACKET",bn="RIGHTCORNERBRACKET",kn="LEFTWHITECORNERBRACKET",Sn="RIGHTWHITECORNERBRACKET",Cn="FULLWIDTHLESSTHAN",xn="FULLWIDTHGREATERTHAN",Mn="AMPERSAND",Tn="APOSTROPHE",En="ASTERISK",Pe="AT",vn="BACKSLASH",An="BACKTICK",Nn="CARET",Le="COLON",bo="COMMA",wn="DOLLAR",pe="DOT",On="EQUALS",ko="EXCLAMATION",ae="HYPHEN",wt="PERCENT",Dn="PIPE",Pn="PLUS",Rn="POUND",Ot="QUERY",So="QUOTE",yl="FULLWIDTHMIDDLEDOT",Co="SEMI",me="SLASH",Dt="TILDE",Ln="UNDERSCORE",bl="EMOJI",In="SYM";var kl=Object.freeze({__proto__:null,ALPHANUMERICAL:gl,AMPERSAND:Mn,APOSTROPHE:Tn,ASCIINUMERICAL:ml,ASTERISK:En,AT:Pe,BACKSLASH:vn,BACKTICK:An,CARET:Nn,CLOSEANGLEBRACKET:pn,CLOSEBRACE:Nt,CLOSEBRACKET:dn,CLOSEPAREN:fn,COLON:Le,COMMA:bo,DOLLAR:wn,DOT:pe,EMOJI:bl,EQUALS:On,EXCLAMATION:ko,FULLWIDTHGREATERTHAN:xn,FULLWIDTHLEFTPAREN:mn,FULLWIDTHLESSTHAN:Cn,FULLWIDTHMIDDLEDOT:yl,FULLWIDTHRIGHTPAREN:gn,HYPHEN:ae,LEFTCORNERBRACKET:yn,LEFTWHITECORNERBRACKET:kn,LOCALHOST:Bt,NL:yo,NUM:go,OPENANGLEBRACKET:hn,OPENBRACE:At,OPENBRACKET:cn,OPENPAREN:un,PERCENT:wt,PIPE:Dn,PLUS:Pn,POUND:Rn,QUERY:Ot,QUOTE:So,RIGHTCORNERBRACKET:bn,RIGHTWHITECORNERBRACKET:Sn,SCHEME:Zt,SEMI:Co,SLASH:me,SLASH_SCHEME:it,SYM:In,TILDE:Dt,TLD:Ir,UNDERSCORE:Ln,UTLD:$r,UWORD:Lr,WORD:Ce,WS:Br});const ke=/[a-z]/,kt=new RegExp("\\p{L}","u"),lr=new RegExp("\\p{Emoji}","u"),Se=/\d/,ar=/\s/,ks="\r",cr=`
99`,If="️",$f="‍",dr="";let Gt=null,Jt=null;function Bf(e=[]){const t={};re.groups=t;const n=new re;Gt==null&&(Gt=Ss(wf)),Jt==null&&(Jt=Ss(Of)),b(n,"'",Tn),b(n,"{",At),b(n,"}",Nt),b(n,"[",cn),b(n,"]",dn),b(n,"(",un),b(n,")",fn),b(n,"<",hn),b(n,">",pn),b(n,"(",mn),b(n,")",gn),b(n,"「",yn),b(n,"」",bn),b(n,"『",kn),b(n,"』",Sn),b(n,"<",Cn),b(n,">",xn),b(n,"&",Mn),b(n,"*",En),b(n,"@",Pe),b(n,"`",An),b(n,"^",Nn),b(n,":",Le),b(n,",",bo),b(n,"$",wn),b(n,".",pe),b(n,"=",On),b(n,"!",ko),b(n,"-",ae),b(n,"%",wt),b(n,"|",Dn),b(n,"+",Pn),b(n,"#",Rn),b(n,"?",Ot),b(n,'"',So),b(n,"/",me),b(n,";",Co),b(n,"~",Dt),b(n,"_",Ln),b(n,"\\",vn),b(n,"・",yl);const r=I(n,Se,go,{[Or]:!0});I(r,Se,r);const o=I(r,ke,ml,{[vt]:!0}),s=I(r,kt,gl,{[Ct]:!0}),i=I(n,ke,Ce,{[Dr]:!0});I(i,Se,o),I(i,ke,i),I(o,Se,o),I(o,ke,o);const l=I(n,kt,Lr,{[Pr]:!0});I(l,ke),I(l,Se,s),I(l,kt,l),I(s,Se,s),I(s,ke),I(s,kt,s);const a=b(n,cr,yo,{[ir]:!0}),c=b(n,ks,Br,{[ir]:!0}),d=I(n,ar,Br,{[ir]:!0});b(n,dr,d),b(c,cr,a),b(c,dr,d),I(c,ar,d),b(d,ks),b(d,cr),I(d,ar,d),b(d,dr,d);const u=I(n,lr,bl,{[pl]:!0});b(u,"#"),I(u,lr,u),b(u,If,u);const h=b(u,$f);b(h,"#"),I(h,lr,u);const f=[[ke,i],[Se,o]],p=[[ke,null],[kt,l],[Se,s]];for(let m=0;m<Gt.length;m++)we(n,Gt[m],Ir,Ce,f);for(let m=0;m<Jt.length;m++)we(n,Jt[m],$r,Lr,p);qe(Ir,{tld:!0,ascii:!0},t),qe($r,{utld:!0,alpha:!0},t),we(n,"file",Zt,Ce,f),we(n,"mailto",Zt,Ce,f),we(n,"http",it,Ce,f),we(n,"https",it,Ce,f),we(n,"ftp",it,Ce,f),we(n,"ftps",it,Ce,f),qe(Zt,{scheme:!0,ascii:!0},t),qe(it,{slashscheme:!0,ascii:!0},t),e=e.sort((m,g)=>m[0]>g[0]?1:-1);for(let m=0;m<e.length;m++){const g=e[m][0],k=e[m][1]?{[Df]:!0}:{[Pf]:!0}
vendor: 7,498 bytes, lines 99-102
99;g.indexOf("-")>=0?k[Rr]=!0:ke.test(g)?Se.test(g)?k[vt]=!0:k[Dr]=!0:k[Or]=!0,bs(n,g,g,k)}return bs(n,"localhost",Bt,{ascii:!0}),n.jd=new re(In),{start:n,tokens:Object.assign({groups:t},kl)}}function Sl(e,t){const n=Vf(t.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[];let s=0,i=0;for(;i<r;){let l=e,a=null,c=0,d=null,u=-1,h=-1;for(;i<r&&(a=l.go(n[i]));)l=a,l.accepts()?(u=0,h=0,d=l):u>=0&&(u+=n[i].length,h++),c+=n[i].length,s+=n[i].length,i++;s-=u,i-=h,c-=u,o.push({t:d.t,v:t.slice(s-c,s),s:s-c,e:s})}return o}function Vf(e){const t=[],n=e.length;let r=0;for(;r<n;){let o=e.charCodeAt(r),s,i=o<55296||o>56319||r+1===n||(s=e.charCodeAt(r+1))<56320||s>57343?e[r]:e.slice(r,r+2);t.push(i),r+=i.length}return t}function we(e,t,n,r,o){let s;const i=t.length;for(let l=0;l<i-1;l++){const a=t[l];e.j[a]?s=e.j[a]:(s=new re(r),s.jr=o.slice(),e.j[a]=s),e=s}return s=new re(n),s.jr=o.slice(),e.j[t[i-1]]=s,s}function Ss(e){const t=[],n=[];let r=0,o="0123456789";for(;r<e.length;){let s=0;for(;o.indexOf(e[r+s])>=0;)s++;if(s>0){t.push(n.join(""));for(let i=parseInt(e.substring(r,r+s),10);i>0;i--)n.pop();r+=s}else n.push(e[r]),r++}return t}const Vt={defaultProtocol:"http",events:null,format:Cs,formatHref:Cs,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function xo(e,t=null){let n=Object.assign({},Vt);e&&(n=Object.assign(n,e instanceof xo?e.o:e));const r=n.ignoreTags,o=[];for(let s=0;s<r.length;s++)o.push(r[s].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}xo.prototype={o:Vt,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let o=this.o[e];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Vt[e],typeof o=="function"&&r&&(o=o(t,n))):typeof o=="function"&&r&&(o=o(t,n.t,n)),o)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function Cs(e){return e}function Cl(e,t){this.t="token",this.v=e,this.tk=t}Cl.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Vt.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),s=this.toFormattedString(e),i={},l=e.get("className",n,t),a=e.get("target",n,t),c=e.get("rel",n,t),d=e.getObj("attributes",n,t),u=e.getObj("events",n,t);return i.href=r,l&&(i.class=l),a&&(i.target=a),c&&(i.rel=c),d&&Object.assign(i,d),{tagName:o,attributes:i,content:s,eventListeners:u}}};function Jn(e,t){class n extends Cl{constructor(o,s){super(o,s),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const xs=Jn("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Ms=Jn("text"),zf=Jn("nl"),Yt=Jn("url",{isLink:!0,toHref(e=Vt.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Bt&&e[1].t===Le}}),le=e=>new re(e);function _f({groups:e}){const t=e.domain.concat([Mn,En,Pe,vn,An,Nn,wn,On,ae,go,wt,Dn,Pn,Rn,me,In,Dt,Ln]),n=[Tn,Le,bo,pe,ko,wt,Ot,So,Co,hn,pn,At,Nt,dn,cn,un,fn,mn,gn,yn,bn,kn,Sn,Cn,xn],r=[Mn,Tn,En,vn,An,Nn,wn,On,ae,At,Nt,wt,Dn,Pn,Rn,Ot,me,In,Dt,Ln],o=le(),s=b(o,Dt);A(s,r,s),A(s,e.domain,s);const i=le(),l=le(),a=le();A(o,e.domain,i),A(o,e.scheme,l),A(o,e.slashscheme,a),A(i,r,s),A(i,e.domain,i);const c=b(i,Pe);b(s,Pe,c),b(l,Pe,c),b(a,Pe,c);const d=b(s,pe);A(d,r,s),A(d,e.domain,s);const u=le();A(c,e.domain,u),A(u,e.domain,u);const h=b(u,pe);A(h,e.domain,u);const f=le(xs);A(h,e.tld,f),A(h,e.utld,f),b(c,Bt,f);const p=b(u,ae);b(p,ae,p),A(p,e.domain,u),A(f,e.domain,u),b(f,pe,h),b(f,ae,p);const m=b(f,Le);A(m,e.numeric,xs);const g=b(i,ae),y=b(i,pe);b(g,ae,g),A(g,e.domain,i),A(y,r,s),A(y,e.domain,i);const k=le(Yt);A(y,e.tld,k),A(y,e.utld,k),A(k,e.domain,i),A(k,r,s),b(k,pe,y),b(k,ae,g),b(k,Pe,c);const C=b(k,Le),T=le(Yt);A(C,e.numeric,T);const S=le(Yt),v=le();A(S,t,S),A(S,n,v),A(v,t,S),A(v,n,v),b(k,me,S),b(T,me,S);const x=b(l,Le),N=b(a,Le),D=b(N,me),F=b(D,me);A(l,e.domain,i),b(l,pe,y),b(l,ae,g),A(a,e.domain,i),b(a,pe,y),b(a,ae,g),A(x,e.domain,S),b(x,me,S),b(x,Ot,S),A(F,e.domain,S),A(F,t,S),b(F,me,S);const Ne=[[At,Nt],[cn,dn],[un,fn],[hn,pn],[mn,gn],[yn,bn],[kn,Sn],[Cn,xn]];for(let he=0;he<Ne.length;he++){const[Z,U]=Ne[he],W=b(S,Z);b(v,Z,W),b(W,U,S);const nt=le(Yt);A(W,t,nt);const gt=le();A(W,n),A(nt,t,nt),A(nt,n,gt),A(gt,t,nt),A(gt,n,gt),b(nt,U,S),b(gt,U,S)}return b(o,Bt,k),b(o,yo,zf),{start:o,tokens:kl}}function Hf(e,t,n){let r=n.length,o=0,s=[],i=[];for(;o<r;){let l=e,a=null,c=null,d=0,u=null,h=-1;for(;o<r&&!(a=l.go(n[o].t));)i.push(n[o++]);for(;o<r&&(c=a||l.go(n[o].t));)a=null,l=c,l.accepts()?(h=0,u=l):h>=0&&h++,o++,d++;if(h<0)o-=d,o<r&&(i.push(n[o]),o++);else{i.length>0&&(s.push(ur(Ms,t,i)),i=[]),o-=h,d-=h;const f=u.t,p=n.slice(o-d,o);s.push(ur(f,t,p))}}return i.length>0&&s.push(ur(Ms,t,i)),s}function ur(e,t,n){const r=n[0].s,o=n[n.length-1].e,s=t.slice(r,o);return new e(s,n)}const jf=typeof console<"u"&&console&&console.warn||(()=>{}),Ff="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",R={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Wf(){return re.groups={},R.scanner=null,R.parser=null,R.tokenQueue=[],R.pluginQueue=[],R.customSchemes=[],R.initialized=!1,R}function Ts(e,t=!1){if(R.initialized&&jf(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Ff}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
1001. Must only contain digits, lowercase ASCII letters or "-"
1012. Cannot start or end with "-"
1023. "-" cannot repeat`);R.customSchemes.push([e,t])}function Kf(){R.scanner=Bf(R.customSchemes);for(let e=0;e<R.tokenQueue.length;e++)R.tokenQueue[e][1]({scanner:R.scanner});R.parser=_f(R.scanner.tokens);for(let e=0;e<R.pluginQueue.length;e++)R.pluginQueue[e][1]({scanner:R.scanner,parser:R.parser});return R.initialized=!0,R}function Mo(e){return R.initialized||Kf(),Hf(R.parser.start,e,Sl(R.scanner.start,e))}Mo.scan=Sl;function xl(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new xo(n),o=Mo(e),s=[];for(let i=0;i<o.length;i++){const l=o[i];l.isLink&&(!t||l.t===t)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}var To="[\0-   ᠎ -\u2029  ]",Uf=new RegExp(To),qf=new RegExp(`${To}$`),Gf=new RegExp(To,"g");function Jf(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function Yf(e){return new V({key:new Y("autolink"),appendTransaction:(t,n,r)=>{const o=t.some(c=>c.docChanged)&&!n.doc.eq(r.doc),s=t.some(c=>
102c.getMeta("preventAutolink"));if(!o||s)return;const{tr:i}=r,l=Bi(n.doc,[...t]);if(Wi(l).forEach(({newRange:c})=>{const d=Yd(r.doc,c,f=>f.isTextblock);let u,h;if(d.length>1)u=d[0],h=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(d.length){const f=r.doc.textBetween(c.from,c.to," "," ");if(!qf.test(f))return;u=d[0],h=r.doc.textBetween(u.pos,c.to,void 0," ")}if(u&&h){const f=h.split(Uf).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],m=u.pos+h.lastIndexOf(p);if(!p)return!1;const g=Mo(p).map(y=>y.toObject(e.defaultProtocol));if(!Jf(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>e.validate(y.value)).filter(y=>e.shouldAutoLink(y.value)).forEach(y=>{ao(y.from,y.to,r.doc).some(k=>k.mark.type===e.type)||i.addMark(y.from,y.to,e.type.create({href:y.href}))})}}),!!i.steps.length)return i}})}function Xf(e){return new V({key:new Y("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,s;if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{const a=r.target;if(!a)return!1;const c=e.editor.view.dom;i=a.closest("a"),i&&!c.contains(i)&&(i=null)}if(!i)return!1;let l=!1;if(e.enableClickSelection&&(l=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const a=Fi(t.state,e.type.name),c=(o=i.href)!=null?o:a.href,d=(s=i.target)!=null?s:a.target;c&&(window.open(c,d),l=!0)}return l}}})}function Qf(e){return new V({key:new Y("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:o}=e,{state:s}=t,{selection:i}=s,{empty:l}=i;if(l)return!1;let a="";r.content.forEach(d=>{a+=d.textContent});const c=xl(a,{defaultProtocol:e.defaultProtocol}).find(d=>d.isLink&&d.value===a);return!a||!c||o!==void 0&&!o(c.value)?!1:e.editor.commands.setMark(e.type,{href:c.href})}}})}function Fe(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!e||e.replace(Gf,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Zf=tt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){Ts(e);return}Ts(e.scheme,e.optionalSlashes)})},onDestroy(){Wf()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Fe(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const o=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(o)||!/\./.test(o))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!Fe(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!Fe(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",j(this.options.HTMLAttributes,e),0]:["a",j(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,o,s;const i=(r=(n=e.attrs)==null?void 0:n.href)!=null?r:"",l=(s=(o=e.attrs)==null?void 0:o.title)!=null?s:"",a=t.renderChildren(e);return l?`[${a}](${i} "${l}")`:`[${a}](${i})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Fe(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Fe(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[et({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=xl(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:i=>!!Fe(i,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(s=>{this.options.shouldAutoLink(s.value)&&t.push({text:s.value,data:{href:s.href},index:s.start})})}return t}
102,type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)==null?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(Yf({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Fe(o,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(Xf({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Qf({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),Ml=tt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",j(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const o=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!o)return;const s=o[2].trim();return{type:"underline",raw:o[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),gp=Ml,$n=(e,t)=>{if(e==="slot")return 0;if(e instanceof Function)return e(t);const{children:n,...r}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},eh=/^\s*>\s$/,th=ie.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return $n("blockquote",{...j(this.options.HTMLAttributes,e),children:$n("slot",{})})},parseMarkdown:(e,t)=>{var n;const r=(n=t.parseBlockChildren)!=null?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";const n=">",r=[];return e.content.forEach((o,s)=>{var i,l;const d=((l=(i=t.renderChild)==null?void 0:i.call(t,o,s))!=null?l:t.renderChildren([o])).split(`
103`).map(u=>u.trim()===""?n:`${n} ${u}`);r.push(d.join(`
104`))}),r.join(`
105${n}
106`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}}
vendor: 1,200 bytes, line 106
106,addInputRules(){return[pt({find:eh,type:this.type})]}}),nh=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,rh=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,oh=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,sh=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,ih=tt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return $n("strong",{...j(this.options.HTMLAttributes,e),children:$n("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
vendor: 7,833 bytes, lines 106-127
106,addInputRules(){return[ht({find:nh,type:this.type}),ht({find:oh,type:this.type})]},addPasteRules(){return[et({find:rh,type:this.type}),et({find:sh,type:this.type})]}}),lh=/(^|[^`])`([^`]+)`(?!`)$/,ah=/(^|[^`])`([^`]+)`(?!`)/g,ch=tt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",j(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ht({find:lh,type:this.type})]},addPasteRules(){return[et({find:ah,type:this.type})]}}),fr=4,dh=/^```([a-z]+)?[\s\n]$/,uh=/^~~~([a-z]+)?[\s\n]$/,fh=ie.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:fr,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const s=[...((t=e.firstElementChild)==null?void 0:t.classList)||[]].filter(i=>i.startsWith(n)).map(i=>i.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",j(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return((n=e.raw)==null?void 0:n.startsWith("```"))===!1&&((r=e.raw)==null?void 0:r.startsWith("~~~"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const o=((n=e.attrs)==null?void 0:n.language)||"";return e.content?r=[`\`\`\`${o}`,t.renderChildren(e.content),"```"].join(`
107`):r=`\`\`\`${o}
108
109\`\`\``,r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:fr,{state:r}=e,{selection:o}=r,{$from:s,empty:i}=o;if(s.parent.type!==this.type)return!1;const l=" ".repeat(n);return i?e.commands.insertContent(l):e.commands.command(({tr:a})=>{const{from:c,to:d}=o,f=r.doc.textBetween(c,d,`
110`,`
111`).split(`
112`).map(p=>l+p).join(`
113`);return a.replaceWith(c,d,r.schema.text(f)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:fr,{state:r}=e,{selection:o}=r,{$from:s,empty:i}=o;return s.parent.type!==this.type?!1:i?e.commands.command(({tr:l})=>{var a;const{pos:c}=s,d=s.start(),u=s.end(),f=r.doc.textBetween(d,u,`
114`,`
115`).split(`
116`);let p=0,m=0;const g=c-d;for(let v=0;v<f.length;v+=1){if(m+f[v].length>=g){p=v;break}m+=f[v].length+1}const k=((a=f[p].match(/^ */))==null?void 0:a[0])||"",C=Math.min(k.length,n);if(C===0)return!0;let T=d;for(let v=0;v<p;v+=1)T+=f[v].length+1;return l.delete(T,T+C),c-T<=C&&l.setSelection(O.create(l.doc,T)),!0}):e.commands.command(({tr:l})=>{const{from:a,to:c}=o,h=r.doc.textBetween(a,c,`
117`,`
118`).split(`
119`).map(f=>{var p;const m=((p=f.match(/^ */))==null?void 0:p[0])||"",g=Math.min(m.length,n);return f.slice(g)}).join(`
120`);return l.replaceWith(a,c,r.schema.text(h)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,i=r.parent.textContent.endsWith(`
121
122`);return!s||!i?!1:e.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:s}=n;if(!s||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const l=o.after();return l===void 0?!1:r.nodeAt(l)?e.commands.command(({tr:c})=>(c.setSelection(_.near(r.resolve(l))),!0)):e.commands.exitCode()}}},addInputRules(){return[Ar({find:dh,type:this.type,getAttributes:e=>({language:e[1]})}),Ar({find:uh,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new V({key:new Y("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,s=o?.mode;if(!n||!s)return!1;const{tr:i,schema:l}=e.state,a=l.text(n.replace(/\r\n?/g,`
123`));return i.replaceSelectionWith(this.type.create({language:s},a)),i.selection.$from.parent.type!==this.type&&i.setSelection(O.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),e.dispatch(i),!0}}})]}}),Tl=ie.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
124
125`):""}),yp=Tl,hh=ie.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",j(this.options.HTMLAttributes,e)]},renderText(){return`
126`},renderMarkdown:()=>`  
127`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:l}=r.extensionManager,a=s||o.$to.parentOffset&&o.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&a&&i){const u=a.filter(h=>l.includes(h.type.name));c.ensureMarks(u)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ph=ie.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,j(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(n=e.attrs)!=null&&n.level?parseInt(e.attrs.level,10):1,o="#".repeat(r);return e.content?`${o} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Ar({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
127)\\s$`),type:this.type,getAttributes:{level:e}}))}}),mh=ie.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",j(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!Zu(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,o=e();return Ki(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:s,tr:i,dispatch:l})=>{if(l){const{$to:a}=i.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?i.setSelection(O.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection(E.create(i.doc,a.pos)):i.setSelection(O.create(i.doc,a.pos));else{const d=s.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,u=d?.create();u&&(i.insert(c,u),i.setSelection(O.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Qu({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.t
vendor: 1,045 bytes, line 127
127ype})]}}),gh=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,yh=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,bh=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,kh=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Sh=tt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",j(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}}
vendor: 9,034 bytes, lines 127-137
127,addInputRules(){return[ht({find:gh,type:this.type}),ht({find:bh,type:this.type})]},addPasteRules(){return[et({find:yh,type:this.type}),et({find:kh,type:this.type})]}}),Ch=Object.defineProperty,xh=(e,t)=>{for(var n in t)Ch(e,n,{get:t[n],enumerable:!0})},Mh="listItem",Es="textStyle",vs=/^\s*([-+*])\s$/,El=ie.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",j(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
128`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Mh,this.editor.getAttributes(Es)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=pt({find:vs,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=pt({find:vs,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Es),editor:this.editor})),[e]}}),vl=ie.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",j(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if(e.type!=="list_item")return[];const r=(n=t.parseBlockChildren)!=null?n:t.parseChildren;let o=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(i=>i.type==="paragraph"))o=r(e.tokens);else{const i=e.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(o=[{type:"paragraph",content:t.parseInline(i.tokens)}],e.tokens.length>1){const a=e.tokens.slice(1),c=r(a);o.push(...c)}}else o=r(e.tokens)}return o.length===0&&(o=[{type:"paragraph",content:[]}]),{type:"listItem",content:o}},renderMarkdown:(e,t,n)=>ho(e,t,r=>{var o,s;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((s=(o=r.meta)==null?void 0:o.parentAttrs)==null?void 0:s.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Th={};xh(Th,{findListItemPos:()=>Ft,getNextListDepth:()=>Eo,handleBackspace:()=>Vr,handleDelete:()=>zr,hasListBefore:()=>Al,hasListItemAfter:()=>Eh,hasListItemBefore:()=>Nl,listItemHasSubList:()=>wl,nextListIsDeeper:()=>Ol,nextListIsHigher:()=>Dl});var Ft=(e,t)=>{const{$from:n}=t.selection,r=H(e,t.schema);let o=null,s=n.depth,i=n.pos,l=null;for(;s>0&&l===null;)o=n.node(s),o.type===r?l=s:(s-=1,i-=1);return l===null?null:{$pos:t.doc.resolve(i),depth:l}},Eo=(e,t)=>{const n=Ft(e,t);if(!n)return!1;const[,r]=lu(t,e,n.$pos.pos+4);return r},Al=(e,t,n)=>{const{$anchor:r}=e.selection,o=Math.max(0,r.pos-2),s=e.doc.resolve(o).node();return!(!s||!n.includes(s.type.name))},Nl=(e,t)=>{var n;const{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-2);return!(o.index()===0||((n=o.nodeBefore)==null?void 0:n.type.name)!==e)},wl=(e,t,n)=>{if(!n)return!1;const r=H(e,t.schema);let o=!1;return n.descendants(s=>{s.type===r&&(o=!0)}),o},Vr=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!_e(e.state,t)&&Al(e.state,t,n)){const{$anchor:l}=e.state.selection,a=e.state.doc.resolve(l.before()-1),c=[];a.node().descendants((h,f)=>{h.type.name===t&&c.push({node:h,pos:f})});const d=c.at(-1);if(!d)return!1;const u=e.state.doc.resolve(a.start()+d.pos+1);return e.chain().cut({from:l.start()-1,to:l.end()+1},u.end()).joinForward().run()}if(!_e(e.state,t)||!uu(e.state))return!1;const r=Ft(t,e.state);if(!r)return!1;const s=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),i=wl(t,e.state,s);return Nl(t,e.state)&&!i?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},Ol=(e,t)=>{const n=Eo(e,t),r=Ft(e,t);return!r||!n?!1:n>r.depth},Dl=(e,t)=>{const n=Eo(e,t),r=Ft(e,t);return!r||!n?!1:n<r.depth},zr=(e,t)=>{if(!_e(e.state,t)||!du(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:o}=n;return!n.empty&&r.sameParent(o)?!1:Ol(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Dl(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},Eh=(e,t)=>{var n;const{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-r.parentOffset-2);return!(o.index()===o.parent.childCount-1||((n=o.nodeAfter)==null?void 0:n.type.name)!==e)},Pl=z.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&zr(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&zr(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Vr(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Vr(e,n,r)&&(t=!0)}),t}}}}),As=/^(\s*)(\d+)\.\s+(.*)$/,vh=/^\s/;function Ah(e){const t=[];let n=0,r=0;for(;n<e.length;){const o=e[n],s=o.match(As);if(!s)break;const[,i,l,a]=s,c=i.length;let d=a,u=n+1;const h=[o];for(;u<e.length;){const f=e[u];if(f.match(As))break;if(f.trim()==="")h.push(f),d+=`
129`,u+=1;else if(f.match(vh))h.push(f),d+=`
130${f.slice(c+2)}`,u+=1;else break}t.push({indent:c,number:parseInt(l,10),content:d.trim(),raw:h.join(`
131`)}),r=u,n=u}return[t,r]}function Rl(e,t,n){var r;const o=[];let s=0;for(;s<e.length;){const i=e[s];if(i.indent===t){const l=i.content.split(`
132`),a=((r=l[0])==null?void 0:r.trim())||"",c=[];a&&c.push({type:"paragraph",raw:a,tokens:n.inlineTokens(a)});const d=l.slice(1).join(`
133`).trim();if(d){const f=n.blockTokens(d);c.push(...f)}let u=s+1;const h=[];for(;u<e.length&&e[u].indent>t;)h.push(e[u]),u+=1;if(h.length>0){const f=Math.min(...h.map(m=>m.indent)),p=Rl(h,f,n);c.push({type:"list",ordered:!0,start:h[0].number,items:p,raw:h.map(m=>m.raw).join(`
134`)})}o.push({type:"list_item",raw:i.raw,tokens:c}),s=u}else s+=1}return o}function Nh(e,t){return e.map(n=>{if(n.type!=="list_item")return t.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(o=>{if(o.type==="paragraph"||o.type==="list"||o.type==="blockquote"||o.type==="code")r.push(...t.parseChildren([o]));else if(o.type==="text"&&o.tokens){const s=t.parseChildren([o]);r.push({type:"paragraph",content:s})}else{const s=t.parseChildren([o]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var wh="listItem",Ns="textStyle",ws=/^(\d+)\.\s$/,Ll=ie.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",j(this.options.HTMLAttributes,n),0]:["ol",j(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];const n=e.start||1,r=e.items?Nh(e.items,t):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
135`):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=t?.index;return n!==void 0?n:-1},tokenize:(e,t,n)=>{var r;const o=e.split(`
136`),[s,i]=Ah(o);if(s.length===0)return;const l=Rl(s,0,n);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=s[0])==null?void 0:r.number)||1,items:l,raw:o.slice(0,i).join(`
137`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wh,this.editor.getAttributes(Ns)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}}
137,addInputRules(){let e=pt({find:ws,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=pt({find:ws,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Ns)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),Oh=/^\s*(\[([( |x])?\])\s$/,Dh=ie.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",j(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const o=`- [${(n=e.attrs)!=null&&n.checked?"x":" "}] `;return ho(e,t,o)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const o=document.createElement("li"),s=document.createElement("label"),i=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=u=>{var h,f;l.ariaLabel=((f=(h=this.options.a11y)==null?void 0:h.checkboxLabel)==null?void 0:f.call(h,u,l.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};c(e),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:h}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const p=n();if(typeof p!="number")return!1;const m=f.doc.nodeAt(p);return f.setNodeMarkup(p,void 0,{...m?.attrs,checked:h}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,h)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,h])=>{o.setAttribute(u,h)}),o.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,s.append(l,i),o.append(s,a),Object.entries(t).forEach(([u,h])=>{o.setAttribute(u,h)});let d=new Set(Object.keys(t));return{dom:o,contentDOM:a,update:u=>{if(u.type!==this.type)return!1;o.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,c(u);const h=r.extensionManager.attributes,f=ft(u,h),p=new Set(Object.keys(f)),m=this.options.HTMLAttributes;return d.forEach(g=>{p.has(g)||(g in m?o.setAttribute(g,m[g]):o.removeAttribute(g))}),Object.entries(f).forEach(([g,y])=>{y==null?g in m?o.setAttribute(g,m[g]):o.removeAttribute(g):o.setAttribute(g,y)}),d=p,!0}}}}
137,addInputRules(){return[pt({find:Oh,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),Ph=ie.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",j(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
138`):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=s=>{const i=Nr(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},n);return i?[{type:"taskList",raw:i.raw,items:i.items}]:n.blockTokens(s)},o=Nr(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,i)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:i}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});z.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(El.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(vl.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Pl.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Ll.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(Dh.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Ph.configure(this.options.taskList)),e}});var Os="&nbsp;",Rh=" ",Lh=ie.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",j(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===Os||r[0].text===Rh)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{var r,o;if(!e)return"";const s=Array.isArray(e.content)?e.content:[];if(s.length===0){const i=Array.isArray((r=n?.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((o=n?.previousNode)==null?void 0:o.type)==="paragraph"&&i.length===0?Os:""}return t.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Ih=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,$h=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Bh=tt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",j(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}}
vendor: 5,018 bytes, line 138
138,addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ht({find:Ih,type:this.type})]},addPasteRules(){return[et({find:$h,type:this.type})]}}),Vh=ie.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""});function zh(e={}){return new V({view(t){return new _h(t,e)}})}class _h{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let s=i=>{this[o](i)};return t.dom.addEventListener(o,s),{name:o,handler:s}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,o=this.editorView.dom,s=o.getBoundingClientRect(),i=s.width/o.offsetWidth,l=s.height/o.offsetHeight;if(n){let u=t.nodeBefore,h=t.nodeAfter;if(u||h){let f=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(f){let p=f.getBoundingClientRect(),m=u?p.bottom:p.top;u&&h&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;r={left:p.left,right:p.right,top:m-g,bottom:m+g}}}}if(!r){let u=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*i;r={left:u.left-h,right:u.left+h,top:u.top,bottom:u.bottom}}let a=this.editorView.dom.offsetParent;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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,d;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,d=-pageYOffset;else{let u=a.getBoundingClientRect(),h=u.width/a.offsetWidth,f=u.height/a.offsetHeight;c=u.left-a.scrollLeft*h,d=u.top-a.scrollTop*f}this.element.style.left=(r.left-c)/i+"px",this.element.style.top=(r.top-d)/l+"px",this.element.style.width=(r.right-r.left)/i+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,s=typeof o=="function"?o(this.editorView,n,t):o;if(n&&!s){let i=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Is(this.editorView.state.doc,i,this.editorView.dragging.slice);l!=null&&(i=l)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class $ extends _{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return $.valid(r)?new $(r):_.near(r)}content(){return K.empty}eq(t){return t instanceof $&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new $(t.resolve(n.pos))}getBookmark(){return new vo(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!Hh(t)||!jh(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&$.valid(t))return t;let o=t.pos,s=null;for(let i=t.depth;;i--){let l=t.node(i);if(n>0?t.indexAfter(i)<l.childCount:t.index(i)>0){s=l.child(n>0?t.indexAfter(i):t.index(i)-1);break}else if(i==0)return null;o+=n;let a=t.doc.resolve(o);if($.valid(a))return a}for(;;){let i=n>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!E.isSelectable(s)){t=t.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=i,o+=n;let l=t.doc.resolve(o);if($.valid(l))return l}return null}}}$.prototype.visible=!1;$.findFrom=$.findGapCursorFrom;_.jsonID("gapcursor",$);class vo{constructor(t){this.pos=t}map(t){return new vo(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return $.valid(n)?new $(n):_.near(n)}}function Il(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Hh(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||Il(o.type))return!0;
vendor: 9,287 bytes, line 138
138if(o.inlineContent)return!1}}return!0}function jh(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||Il(o.type))return!0;if(o.inlineContent)return!1}}return!0}function Fh(){return new V({props:{decorations:qh,createSelectionBetween(e,t,n){return t.pos==n.pos&&$.valid(n)?new $(n):null},handleClick:Kh,handleKeyDown:Wh,handleDOMEvents:{beforeinput:Uh}}})}const Wh=Oi({ArrowLeft:Xt("horiz",-1),ArrowRight:Xt("horiz",1),ArrowUp:Xt("vert",-1),ArrowDown:Xt("vert",1)});function Xt(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,o,s){let i=r.selection,l=t>0?i.$to:i.$from,a=i.empty;if(i instanceof O){if(!s.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(t>0?l.after():l.before())}let c=$.findGapCursorFrom(l,t,a);return c?(o&&o(r.tr.setSelection(new $(c))),!0):!1}}function Kh(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!$.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&E.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new $(r))),!0)}function Uh(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof $))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=w.empty;for(let i=r.length-1;i>=0;i--)o=w.from(r[i].createAndFill(null,o));let s=e.state.tr.replace(n.pos,n.pos,new K(o,0,0));return s.setSelection(O.near(s.doc.resolve(n.pos+1))),e.dispatch(s),!1}function qh(e){if(!(e.selection instanceof $))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",L.create(e.doc,[ee.widget(e.selection.head,t,{key:"gapcursor"})])}z.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new V({key:new Y("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const o=this.options.limit;if(o==null||o===0){e=!0;return}const s=this.storage.characters({node:r.doc});if(s>o){const i=s-o,l=0,a=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(l,a);return e=!0,c}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),s=this.storage.characters({node:t.doc});if(s<=r||o>r&&s>r&&s<=o)return!0;if(o>r&&s>r&&s>o||!t.getMeta("paste"))return!1;const l=t.selection.$head.pos,a=s-r,c=l-a,d=l;return t.deleteRange(c,d),!(this.storage.characters({node:t.doc})>r)}})]}});var Gh=z.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[zh(this.options)]}});z.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new V({key:new Y("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,s=[];if(!n||!r)return L.create(e,[]);let i=0;this.options.mode==="deepest"&&e.descendants((a,c)=>{if(a.isText)return;if(!(o>=c&&o<=c+a.nodeSize-1))return!1;i+=1});let l=0;return e.descendants((a,c)=>{if(a.isText||!(o>=c&&o<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&i-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(ee.node(c,c+a.nodeSize,{class:this.options.className}))}),L.create(e,s)}}})]}});var Jh=z.create({name:"gapCursor",addProseMirrorPlugins(){return[Fh()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=P(M(e,"allowGapCursor",n)))!=null?t:null}}}),Ds="placeholder";function Yh(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var Xh=z.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Ds,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${Yh(this.options.dataAttribute)}`:`data-${Ds}`;return[new V({key:new Y("placeholder"),props:{decorations:({doc:t,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=n,s=[];if(!r)return null;const i=this.editor.isEmpty;return t.descendants((l,a)=>{const c=o>=a&&o<=a+l.nodeSize,d=!l.isLeaf&&Un(l);if(!l.type.isTextblock)return this.options.includeChildren;if((c||!this.options.showOnlyCurrent)&&d){const u=[this.options.emptyNodeClass];i&&u.push(this.options.emptyEditorClass);const h=ee.node(a,a+l.nodeSize,{class:u.join(" "),[e]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:l,pos:a,hasAnchor:c}):this.options.placeholder});s.push(h)}return this.options.includeChildren}),L.create(t,s)}}})]}});z.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new V({key:new Y("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||Ki(n.selection)||e.view.dragging?null:L.create(n.doc,[ee.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function Ps({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var Qh=z.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new Y(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,o])=>o).filter(o=>(this.options.notAfter||[]).concat(n).includes(o.name));return[new V({key:t,appendTransaction:(o,s,i)=>{const{doc:l,tr:a,schema:c}=i,d=t.getState(i),u=l.content.size,h=c.nodes[n];if(d)return a.insert(u,h.create())},state:{init:(o,s)=>{const i=s.tr.doc.lastChild;return!Ps({node:i,types:r})},apply:(o,s)=>{if(!o.docChanged||o.getMeta("__uniqueIDTransaction"))return s;const i=o.doc.lastChild;return!Ps({node:i,types:r})}}})]}}),Zh=z.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>ql(e,t),redo:()=>({state:e,dispatch:t})=>Ul(e,t)}},addProseMirrorPlugins(){return[Kl(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ep=z.create({name:"starterKit",addExtensions(){var e,t,n,r;const o=[];return this.options.bold!==!1&&o.push(ih.configure(this.options.bold)),this.options.blockquote!==!1&&o.push(th.configure(this.options.blockquote)),this.options.bulletList!==!1&&o.push(El.configure(this.options.bulletList)),this.options.code!==!1&&o.push(ch.configure(this.options.code)),this.options.codeBlock!==!1&&o.push(fh.configure(this.options.codeBlock)),this.options.document!==!1&&o.push(Tl.configure(this.options.document)),this.options.dropcursor!==!1&&o.push(Gh.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&o.push(Jh.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&o.push(hh.configure(this.options.hardBreak)),this.options.heading!==!1&&o.push(ph.configure(this.options.heading)),this.options.undoRedo!==!1&&o.push(Zh.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&o.push(mh.configure(this.options.horizontalRule)),this.options.italic!==!1&&o.push(Sh.configure(this.options.italic)),this.options.listItem!==!1&&o.push(vl.configure(this.options.listItem)),this.options.listKeymap!==!1&&o.push(Pl.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&o.push(Zf.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&o.push(Ll.configure(this.options.orderedList)),this.options.paragraph!==!1&&o.push(Lh.configure(this.options.paragraph)),this.options.strike!==!1&&o.push(Bh.configure(this.options.strike)),this.options.text!==!1&&o.push(Vh.configure(this.options.text)),this.options.underline!==!1&&o.push(Ml.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&o.push(Qh.configure((r=this.options)==null?void 0:r.trailingNode)),o}}),bp=ep,kp=Xh;export{L as D,gf as E,qn as I,Zf as L,tt as M,ie as N,Lh as P,mp as R,ep as S,Ml as U,kp as a,z as b,ee as c,sf as d,dp as e,pp as f,hp as g,P as h,bp as i,M as j,Oi as k,Xd as l,j as m,so as n,ap as o,cp as p,ru as q,ji as r,fp as s,kf as t,up as u,et as v,ht as w,gp as x,yp as y};

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.