PageSourceSearch

https://community.soberpowered.com/packs/js/65193-cdb3471a910e557b.js

js soberpowered.com collected 2026-09-30 13:29:50 UTC 40,866 bytes, 2 lines download raw bytes

1"use strict";(self.rspackChunkcircle=self.rspackChunkcircle||[]).push([[65193],{708937(e,t,l){var o=l(288459),n=l(16488);function r(e={}){return new o.k_({view:t=>new i(t,e)})}class i{constructor(e,t){var l;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!=(l=t.width)?l:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let l=e=>{this[t](e)};return e.dom.addEventListener(t,l),{name:t,handler:l}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t,l=this.editorView.state.doc.resolve(this.cursorPos),o=!l.parent.inlineContent,n;if(o){let e=l.nodeBefore,t=l.nodeAfter;if(e||t){let l=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(l){let o=l.getBoundingClientRect(),r=e?o.bottom:o.top;e&&t&&(r=(r+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),n={left:o.left,right:o.right,top:r-this.width/2,bottom:r+this.width/2}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos);n={left:e.left-this.width/2,right:e.left+this.width/2,top:e.top,bottom:e.bottom}}let r=this.editorView.dom.offsetParent;if(!this.element&&(this.element=r.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",o),this.element.classList.toggle("prosemirror-dropcursor-inline",!o),r&&(r!=document.body||"static"!=getComputedStyle(r).position)){let l=r.getBoundingClientRect();e=l.left-r.scrollLeft,t=l.top-r.scrollTop}else e=-pageXOffset,t=-pageYOffset;this.element.style.left=n.left-e+"px",this.element.style.top=n.top-t+"px",this.element.style.width=n.right-n.left+"px",this.element.style.height=n.bottom-n.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),l=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),o=l&&l.type.spec.disableDropCursor,r="function"==typeof o?o(this.editorView,t,e):o;if(t&&!r){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=(0,n.Um)(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}l.d(t,{A:()=>r})},170167(e,t,l){var o=l(897836),n=l(288459),r=l(823201),i=l(207547);class s extends n.LN{constructor(e){super(e,e)}map(e,t){let l=e.resolve(t.map(this.head));return s.valid(l)?new s(l):n.LN.near(l)}content(){return r.Ji.empty}eq(e){return e instanceof s&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new s(e.resolve(t.pos))}getBookmark(){return new a(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let l=e.index(t),o=e.node(t);if(0==l){if(o.type.spec.isolating)return!0;continue}for(let e=o.child(l-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let l=e.indexAfter(t),o=e.node(t);if(l==o.childCount){if(o.type.spec.isolating)return!0;continue}for(let e=o.child(l);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;
1if(e.inlineContent)return!1}}return!0}(e))return!1;let l=t.type.spec.allowGapCursor;if(null!=l)return l;let o=t.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,t,l=!1){e:for(;;){if(!l&&s.valid(e))return e;let o=e.pos,r=null;for(let l=e.depth;;l--){let n=e.node(l);if(t>0?e.indexAfter(l)<n.childCount:e.index(l)>0){r=n.child(t>0?e.indexAfter(l):e.index(l)-1);break}if(0==l)return null;o+=t;let i=e.doc.resolve(o);if(s.valid(i))return i}for(;;){let i=t>0?r.firstChild:r.lastChild;if(!i){if(r.isAtom&&!r.isText&&!n.nh.isSelectable(r)){e=e.doc.resolve(o+r.nodeSize*t),l=!1;continue e}break}r=i,o+=t;let a=e.doc.resolve(o);if(s.valid(a))return a}return null}}}s.prototype.visible=!1,s.findFrom=s.findGapCursorFrom,n.LN.jsonID("gapcursor",s);class a{constructor(e){this.pos=e}map(e){return new a(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return s.valid(t)?new s(t):n.LN.near(t)}}function c(){return new n.k_({props:{decorations:u,createSelectionBetween:(e,t,l)=>t.pos==l.pos&&s.valid(l)?new s(l):null,handleClick:p,handleKeyDown:d,handleDOMEvents:{beforeinput
1:f}}})}let d=(0,o.K)({ArrowLeft:h("horiz",-1),ArrowRight:h("horiz",1),ArrowUp:h("vert",-1),ArrowDown:h("vert",1)});function h(e,t){let l="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,o,r){let i=e.selection,a=t>0?i.$to:i.$from,c=i.empty;if(i instanceof n.U3){if(!r.endOfTextblock(l)||0==a.depth)return!1;c=!1,a=e.doc.resolve(t>0?a.after():a.before())}let d=s.findGapCursorFrom(a,t,c);return!!d&&(o&&o(e.tr.setSelection(new s(d))),!0)}}function p(e,t,l){if(!e||!e.editable)return!1;let o=e.state.doc.resolve(t);if(!s.valid(o))return!1;let r=e.posAtCoords({left:l.clientX,top:l.clientY});return!(r&&r.inside>-1&&n.nh.isSelectable(e.state.doc.nodeAt(r.inside)))&&(e.dispatch(e.state.tr.setSelection(new s(o))),!0)}function f(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof s))return!1;let{$from:l}=e.state.selection,o=l.parent.contentMatchAt(l.index()).findWrapping(e.state.schema.nodes.text);if(!o)return!1;let i=r.FK.empty;for(let e=o.length-1;e>=0;e--)i=r.FK.from(o[e].createAndFill(null,i));let a=e.state.tr.replace(l.pos,l.pos,new r.Ji(i,0,0));return a.setSelection(n.U3.near(a.doc.resolve(l.pos+1))),e.dispatch(a),!1}function u(e){if(!(e.selection instanceof s))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",i.zF.create(e.doc,[i.NZ.widget(e.selection.head,t,{key:"gapcursor"})])}l.d(t,{z:()=>c})},955002(e,t,l){var o,n,r=l(288459),i=l(823201),s=l(207547),a=l(897836),c=l(16488);if("u">typeof WeakMap){let e=new WeakMap;o=t=>e.get(t),n=(t,l)=>(e.set(t,l),l)}else{let e=[],t=0;o=t=>{for(let l=0;l<e.length;l+=2)if(e[l]==t)return e[l+1]},n=(l,o)=>(10==t&&(t=0),e[t++]=l,e[t++]=o)}var d=class{constructor(e,t,l,o){this.width=e,this.height=t,this.map=l,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){let l=this.map[t];if(l!=e)continue;let o=t%this.width,n=t/this.width|0,r=o+1,i=n+1;for(let e=1;r<this.width&&this.map[t+e]==l;e++)r++;for(let e=1;i<this.height&&this.map[t+this.width*e]==l;e++)i++;return{left:o,top:n,right:r,bottom:i}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,l){let{left:o,right:n,top:r,bottom:i}=this.findCell(e);return"horiz"==t?(l<0?0==o:n==this.width)?null:this.map[r*this.width+(l<0?o-1:n)]:(l<0?0==r:i==this.height)?null:this.map[o+this.width*(l<0?r-1:i)]}rectBetween(e,t){let{left:l,right:o,top:n,bottom:r}=this.findCell(e),{left:i,right:s,top:a,bottom:c}=this.findCell(t);return{left:Math.min(l,i),top:Math.min(n,a),right:Math.max(o,s),bottom:Math.max(r,c)}}cellsInRect(e){let t=[],l={};for(let o=e.top;o<e.bottom;o++)for(let n=e.left;n<e.right;n++){let r=o*this.width+n,i=this.map[r];!l[i]&&(l[i]=!0,n==e.left&&n&&this.map[r-1]==i||o==e.top&&o&&this.map[r-this.width]==i||t.push(i))}return t}positionAt(e,t,l){for(let o=0,n=0;;o++){let r=n+l.child(o).nodeSize;if(o==e){let l=t+e*this.width,o=(e+1)*this.width;for(;l<o&&this.map[l]<n;)l++;return l==o?r-1:this.map[l]}n=r}}static get(e){return o(e)||n(e,function(e){if("table"!=e.type.spec.tableRole)throw RangeError("Not a table node: "+e.type.name);let t=function(e){let t=-1,l=!1;for(let o=0;o<e.childCount;o++){let n=e.child(o),r=0;if(l)for(let t=0;t<o;t++){let l=e.child(t);for(let e=0;e<l.childCount;e++){let n=l.child(e);t+n.attrs.rowspan>o&&(r+=n.attrs.colspan)}}for(let e=0;e<n.childCount;e++){let t=n.child(e);r+=t.attrs.colspan,t.attrs.rowspan>1&&(l=!0)}-1==t?t=r:t!=r&&(t=Math.max(t,r))}return t}(e),l=e.childCount,o=[],n=0,r=null,i=[];for(let e=0,n=t*l;e<n;e++)o[e]=0;for(let s=0,a=0;s<l;s++){let c=e.child(s);a++;for(let e=0;;e++){for(;n<o.length&&0!=o[n];)n++;if(e==c.childCount)break;let d=c.child(e),{colspan:h,rowspan:p,colwidth:f}=d.attrs;for(let e=0;e<p;e++){if(e+s>=l){(r||(r=[])).push({type:"overlong_rowspan",pos:a,n:p-e});break}let c=n+e*t;for(let e=0;e<h;e++){0==o[c+e]?o[c+e]=a:(r||(r=[])).push({type:"collision",row:s,pos:a,n:h-e});let l=f&&f[e];if(l){let o=(c+e)%t*2,n=i[o];null==n||n!=l&&1==i[o+1]?(i[o]=l,i[o+1]=1):n==l&&i[o+1]++}}}n+=h,a+=d.nodeSize}let d=(s+1)*t,h=0;for(;n<d;)0==o[n++]&&h++;h&&(r||(r=[])).push({type:"missing",row:s,n:h}),a++}(0===t||0===l)&&(r||(r=[])).push({type:"zero_sized"});let s=new d(t,l,o,r),a=!1;for(let e=0;!a&&e<i.length;e+=2)null!=i[e]&&i[e+1]<l&&(a=!0);return a&&function(e,t,l){e.problems||(e.problems=[]);let o={};for(let n=0;n<e.map.length;n++){let r=e.map[n];if(o[r])continue;o[r]=!0;let i=l.nodeAt(r);if(!i)throw RangeError(`No cell with offset ${r} found`);let s=null,a=i.attrs;for(let l=0;l<a.colspan;l++){let o=t[2*((n+l)%e.width)];null==o||a.colwidth&&a.colwidth[l]==o||((s||(s=function(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let l=0;l<e.colspan;l++)t.push(0);return t}(a)))[l]=o)}s&&e.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:s})}}(s,i,e),s}(e))}};function h(e){let t=e.cached.tableNodeTypes;
1if(!t)for(let l in t=e.cached.tableNodeTypes={},e.nodes){let o=e.nodes[l],n=o.spec.tableRole;n&&(t[n]=o)}return t}var p=new r.hs("selectingCells");function f(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function u(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function m(e){let t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;let l=f(t.$head)||function(e){for(let t=e.nodeAfter,l=e.pos;t;t=t.firstChild,l++){let o=t.type.spec.tableRole;if("cell"==o||"header_cell"==o)return e.doc.resolve(l)}for(let t=e.nodeBefore,l=e.pos;t;t=t.lastChild,l--){let o=t.type.spec.tableRole;if("cell"==o||"header_cell"==o)return e.doc.resolve(l-t.nodeSize)}}(t.$head);if(l)return l;throw RangeError(`No cell found around position ${t.head}`)}function g(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function w(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function v(e,t,l){let o=e.node(-1),n=d.get(o),r=e.start(-1),i=n.nextCell(e.pos-r,t,l);return null==i?null:e.node(0).resolve(r+i)}function C(e,t,l=1){let o={...e,colspan:e.colspan-l};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,l),o.colwidth.some(e=>e>0)||(o.colwidth=null)),o}function b(e,t,l=1){let o={...e,colspan:e.colspan+l};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let e=0;e<l;e++)o.colwidth.splice(t,0,0)}return o}var y=class e extends r.LN{constructor(e,t=e){const l=e.node(-1),o=d.get(l),n=e.start(-1),i=o.rectBetween(e.pos-n,t.pos-n),s=e.node(0),a=o.cellsInRect(i).filter(e=>e!=t.pos-n);a.unshift(t.pos-n);const c=a.map(e=>{let t=l.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let o=n+e+1;return new r.yn(s.resolve(o),s.resolve(o+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,l){let o=t.resolve(l.map(this.$anchorCell.pos)),n=t.resolve(l.map(this.$headCell.pos));if(g(o)&&g(n)&&w(o,n)){let t=this.$anchorCell.node(-1)!=o.node(-1);return t&&this.isRowSelection()?e.rowSelection(o,n):t&&this.isColSelection()?e.colSelection(o,n):new e(o,n)}return r.U3.between(o,n)}content(){let e=this.$anchorCell.node(-1),t=d.get(e),l=this.$anchorCell.start(-1),o=t.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l),n={},r=[];for(let l=o.top;l<o.bottom;l++){let s=[];for(let r=l*t.width+o.left,i=o.left;i<o.right;i++,r++){let l=t.map[r];if(n[l])continue;n[l]=!0;let i=t.findCell(l),a=e.nodeAt(l);if(!a)throw RangeError(`No cell with offset ${l}
1 found`);let c=o.left-i.left,d=i.right-o.right;if(c>0||d>0){let e=a.attrs;if(c>0&&(e=C(e,0,c)),d>0&&(e=C(e,e.colspan-d,d)),i.left<o.left){if(!(a=a.type.createAndFill(e)))throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else a=a.type.create(e,a.content)}if(i.top<o.top||i.bottom>o.bottom){let e={...a.attrs,rowspan:Math.min(i.bottom,o.bottom)-Math.max(i.top,o.top)};a=i.top<o.top?a.type.createAndFill(e):a.type.create(e,a.content)}s.push(a)}r.push(e.child(l).copy(i.FK.from(s)))}let s=this.isColSelection()&&this.isRowSelection()?e:r;return new i.Ji(i.FK.from(s),1,1)}replace(e,t=i.Ji.empty){let l=e.steps.length,o=this.ranges;for(let n=0;n<o.length;n++){let{$from:r,$to:s}=o[n],a=e.mapping.slice(l);e.replace(a.map(r.pos),a.map(s.pos),n?i.Ji.empty:t)}let n=r.LN.findFrom(e.doc.resolve(e.mapping.slice(l).map(this.to)),-1);n&&e.setSelection(n)}replaceWith(e,t){this.replace(e,new i.Ji(i.FK.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),l=d.get(t),o=this.$anchorCell.start(-1),n=l.cellsInRect(l.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let l=0;l<n.length;l++)e(t.nodeAt(n[l]),o+n[l])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);return!(Math.min(e,t)>0)&&Math.max(e+this.$anchorCell.nodeAfter.attrs.rowspan,t+this.$headCell.nodeAfter.attrs.rowspan)==this.$headCell.node(-1).childCount}static colSelection(t,l=t){let o=t.node(-1),n=d.get(o),r=t.start(-1),i=n.findCell(t.pos-r),s=n.findCell(l.pos-r),a=t.node(0);return i.top<=s.top?(i.top>0&&(t=a.resolve(r+n.map[i.left])),s.bottom<n.height&&(l=a.resolve(r+n.map[n.width*(n.height-1)+s.right-1]))):(s.top>0&&(l=a.resolve(r+n.map[s.left])),i.bottom<n.height&&(t=a.resolve(r+n.map[n.width*(n.height-1)+i.right-1]))),new e(t,l)}isRowSelection(){let e=this.$anchorCell.node(-1),t=d.get(e),l=this.$anchorCell.start(-1),o=t.colCount(this.$anchorCell.pos-l),n=t.colCount(this.$headCell.pos-l);return!(Math.min(o,n)>0)&&Math.max(o+this.$anchorCell.nodeAfter.attrs.colspan,n+this.$headCell.nodeAfter.attrs.colspan)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,l=t){let o=t.node(-1),n=d.get(o),r=t.start(-1),i=n.findCell(t.pos-r),s=n.findCell(l.pos-r),a=t.node(0);return i.left<=s.left?(i.left>0&&(t=a.resolve(r+n.map[i.top*n.width])),s.right<n.width&&(l=a.resolve(r+n.map[n.width*(s.top+1)-1]))):(s.left>0&&(l=a.resolve(r+n.map[s.top*n.width])),i.right<n.width&&(t=a.resolve(r+n.map[n.width*(i.top+1)-1]))),new e(t,l)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,l){return new e(t.resolve(l.anchor),t.resolve(l.head))}static create(t,l,o=l){return new e(t.resolve(l),t.resolve(o))}getBookmark(){return new A(this.$anchorCell.pos,this.$headCell.pos)}};y.prototype.visible=!1,r.LN.jsonID("cell",y);var A=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),l=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==l.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&l.index()<l.parent.childCount&&w(t,l)?new y(t,l):r.LN.near(l,1)}};function S(e){if(!(e.selection instanceof y))return null;let t=[];return e.selection.forEachCell((e,l)=>{t.push(s.NZ.node(l,l+e.nodeSize,{class:"selectedCell"}))}),s.zF.create(e.doc,t)}var $=new r.hs("fix-tables");function N(e,t){let l,o=(t,o)=>{"table"==t.type.spec.tableRole&&(l=function(e,t,l,o){let n,r,i=d.get(t);if(!i.problems)return o;o||(o=e.tr);let s=[];for(let e=0;e<i.height;e++)s.push(0);for(let e=0;e<i.problems.length;e++){let n=i.problems[e];if("collision"==n.type){let e=t.nodeAt(n.pos);if(!e)continue;let r=e.attrs;for(let e=0;e<r.rowspan;e++)s[n.row+e]+=n.n;o.setNodeMarkup(o.mapping.map(l+1+n.pos),null,C(r,r.colspan-n.n,n.n))}else if("missing"==n.type)s[n.row]+=n.n;else if("overlong_rowspan"==n.type){let e=t.nodeAt(n.pos);if(!e)continue;o.setNodeMarkup(o.mapping.map(l+1+n.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-n.n})}else if("colwidth mismatch"==n.type){let e=t.nodeAt(n.pos);if(!e)continue;o.setNodeMarkup(o.mapping.map(l+1+n.pos),null,{...e.attrs,colwidth:n.colwidth})}else if("zero_sized"==n.type){let e=o.mapping.map(l);o.delete(e,e+t.nodeSize)}}for(let e=0;e<s.length;e++)s[e]&&(null==n&&(n=e),r=e);for(let a=0,c=l+1;a<i.height;a++){let l=t.child(a),i=c+l.nodeSize,d=s[a];if(d>0){let t="cell";l.firstChild&&(t=l.firstChild.type.spec.tableRole);let s=[];for(let l=0;l<d;l++){let l=h(e.schema)[t].createAndFill();l&&s.push(l)}let p=(0==a||n==a-1)&&r==a?c+1:i-1;o.insert(o.mapping.map(p),s)}c=i}return o.setMeta($,{fixTables:!0})}(e,t,o,l))};return t?t.doc!=e.doc&&function e(t,l,o,n){let r=t.childCount,i=l.childCount;t:for(let s=0,a=0;s<i;s++){let i=l.child(s);for(let e=a,l=Math.min(r,s+3);e<l;e++)if(t.child(e)==i){a=e+1,o+=i.nodeSize;continue t}n(i,o),a<r&&t.child(a).sameMarkup(i)?e(t.child(a),i,o+1,n):i.nodesBetween(0,i.content.size,n,o+1),o+=i.nodeSize}}(t.doc,e.doc,0,o):e.doc.descendants(o),l}
1function M(e){let t=e.selection,l=m(e),o=l.node(-1),n=l.start(-1),r=d.get(o);return{...t instanceof y?r.rectBetween(t.$anchorCell.pos-n,t.$headCell.pos-n):r.findCell(l.pos-n),tableStart:n,map:r,table:o}}function R(e,{map:t,tableStart:l,table:o},n){let r=n>0?-1:0;(function(e,t,l){let o=h(t.type.schema).header_cell;for(let n=0;n<e.height;n++)if(t.nodeAt(e.map[l+n*e.width]).type!=o)return!1;return!0})(t,o,n+r)&&(r=0==n||n==t.width?null:0);for(let i=0;i<t.height;i++){let s=i*t.width+n;if(n>0&&n<t.width&&t.map[s-1]==t.map[s]){let r=t.map[s],a=o.nodeAt(r);e.setNodeMarkup(e.mapping.map(l+r),null,b(a.attrs,n-t.colCount(r))),i+=a.attrs.rowspan-1}else{let a=null==r?h(o.type.schema).cell:o.nodeAt(t.map[s+r]).type,c=t.positionAt(i,n,o);e.insert(e.mapping.map(l+c),a.createAndFill())}}return e}function z(e,t){if(!u(e))return!1;if(t){let l=M(e);t(R(e.tr,l,l.left))}return!0}function x(e,t){if(!u(e))return!1;if(t){let l=M(e);t(R(e.tr,l,l.right))}return!0}function k(e,t){if(!u(e))return!1;if(t){let l=M(e),o=e.tr;if(0==l.left&&l.right==l.map.width)return!1;for(let e=l.right-1;!function(e,{map:t,table:l,tableStart:o},n){let r=e.mapping.maps.length;for(let i=0;i<t.height;){let s=i*t.width+n,a=t.map[s],c=l.nodeAt(a),d=c.attrs;if(n>0&&t.map[s-1]==a||n<t.width-1&&t.map[s+1]==a)e.setNodeMarkup(e.mapping.slice(r).map(o+a),null,C(d,n-t.colCount(a)));else{let t=e.mapping.slice(r).map(o+a);e.delete(t,t+c.nodeSize)}i+=d.rowspan}}(o,l,e),e!=l.left;e--){let e=l.tableStart?o.doc.nodeAt(l.tableStart-1):o.doc;if(!e)throw RangeError("No table found");l.table=e,l.map=d.get(e)}t(o)}return!0}function E(e,{map:t,tableStart:l,table:o},n){var r;let i=l;for(let e=0;e<n;e++)i+=o.child(e).nodeSize;let s=[],a=n>0?-1:0;(function(e,t,l){var o;let n=h(t.type.schema).header_cell;for(let r=0;r<e.width;r++)if((null==(o=t.nodeAt(e.map[r+l*e.width]))?void 0:o.type)!=n)return!1;return!0})(t,o,n+a)&&(a=0==n||n==t.height?null:0);for(let i=0,c=t.width*n;i<t.width;i++,c++)if(n>0&&n<t.height&&t.map[c]==t.map[c-t.width]){let n=t.map[c],r=o.nodeAt(n).attrs;e.setNodeMarkup(l+n,null,{...r,rowspan:r.rowspan+1}),i+=r.colspan-1}else{let e=null==a?h(o.type.schema).cell:null==(r=o.nodeAt(t.map[c+a*t.width]))?void 0:r.type,l=null==e?void 0:e.createAndFill();l&&s.push(l)}return e.insert(i,h(o.type.schema).row.create(null,s)),e}function L(e,t){if(!u(e))return!1;if(t){let l=M(e);t(E(e.tr,l,l.top))}return!0}function F(e,t){if(!u(e))return!1;if(t){let l=M(e);t(E(e.tr,l,l.bottom))}return!0}function D(e,t){if(!u(e))return!1;if(t){let l=M(e),o=e.tr;if(0==l.top&&l.bottom==l.map.height)return!1;for(let e=l.bottom-1;!function(e,{map:t,table:l,tableStart:o},n){let r=0;for(let e=0;e<n;e++)r+=l.child(e).nodeSize;let i=r+l.child(n).nodeSize,s=e.mapping.maps.length;e.delete(r+o,i+o);let a=new Set;for(let r=0,i=n*t.width;r<t.width;r++,i++){let c=t.map[i];if(!a.has(c)){if(a.add(c),n>0&&c==t.map[i-t.width]){let t=l.nodeAt(c).attrs;e.setNodeMarkup(e.mapping.slice(s).map(c+o),null,{...t,rowspan:t.rowspan-1}),r+=t.colspan-1}else if(n<t.height&&c==t.map[i+t.width]){let i=l.nodeAt(c),a=i.attrs,d=i.type.create({...a,rowspan:i.attrs.rowspan-1},i.content),h=t.positionAt(n+1,r,l);e.insert(e.mapping.slice(s).map(o+h),d),r+=a.colspan-1}}}}(o,l,e),e!=l.top;e--){let e=l.tableStart?o.doc.nodeAt(l.tableStart-1):o.doc;if(!e)throw RangeError("No table found");l.table=e,l.map=d.get(l.table)}t(o)}return!0}function _(e){let t=e.content;return 1==t.childCount&&t.child(0).isTextblock&&0==t.child(0).childCount}function T(e,t){let l=e.selection;if(!(l instanceof y)||l.$anchorCell.pos==l.$headCell.pos)return!1;let o=M(e),{map:n}=o;if(function({width:e,height:t,map:l},o){let n=o.top*e+o.left,r=n,i=(o.bottom-1)*e+o.left,s=n+(o.right-o.left-1);for(let t=o.top;t<o.bottom;t++){if(o.left>0&&l[r]==l[r-1]||o.right<e&&l[s]==l[s+1])return!0;r+=e,s+=e}for(let r=o.left;r<o.right;r++){if(o.top>0&&l[n]==l[n-e]||o.bottom<t&&l[i]==l[i+e])return!0;n++,i++}return!1}(n,o))return!1;if(t){let l,r,s=e.tr,a={},c=i.FK.empty;for(let e=o.top;e<o.bottom;e++)for(let t=o.left;t<o.right;t++){let i=n.map[e*n.width+t],d=o.table.nodeAt(i);if(!a[i]&&d)if(a[i]=!0,null==l)l=i,r=d;else{_(d)||(c=c.append(d.content));let e=s.mapping.map(i+o.tableStart);s.delete(e,e+d.nodeSize)}}if(null==l||null==r)return!0;
1if(s.setNodeMarkup(l+o.tableStart,null,{...b(r.attrs,r.attrs.colspan,o.right-o.left-r.attrs.colspan),rowspan:o.bottom-o.top}),c.size){let e=l+1+r.content.size,t=_(r)?l+1:e;s.replaceWith(t+o.tableStart,e+o.tableStart,c)}s.setSelection(new y(s.doc.resolve(l+o.tableStart))),t(s)}return!0}function V(e,t){var l;let o=h(e.schema);return(l=({node:e})=>o[e.type.spec.tableRole],(e,t)=>{var o;let n,r,i=e.selection;if(i instanceof y){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;n=i.$anchorCell.nodeAfter,r=i.$anchorCell.pos}else{if(!(n=function(e){for(let t=e.depth;t>0;t--){let l=e.node(t).type.spec.tableRole;if("cell"===l||"header_cell"===l)return e.node(t)}return null}(i.$from)))return!1;r=null==(o=f(i.$from))?void 0:o.pos}if(null==n||null==r||1==n.attrs.colspan&&1==n.attrs.rowspan)return!1;if(t){let o,s=n.attrs,a=[],c=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});let d=M(e),h=e.tr;for(let e=0;e<d.right-d.left;e++)a.push(c?{...s,colwidth:c&&c[e]?[c[e]]:null}:s);for(let e=d.top;e<d.bottom;e++){let t=d.map.positionAt(e,d.left,d.table);e==d.top&&(t+=n.nodeSize);for(let r=d.left,i=0;r<d.right;r++,i++)(r!=d.left||e!=d.top)&&h.insert(o=h.mapping.map(t+d.tableStart,1),l({node:n,row:e,col:r}).createAndFill(a[i]))}h.setNodeMarkup(r,l({node:n,row:d.top,col:d.left}),a[0]),i instanceof y&&h.setSelection(new y(h.doc.resolve(i.$anchorCell.pos),o?h.doc.resolve(o):void 0)),t(h)}return!0})(e,t)}function B(e,t){return function(l,o){if(!u(l))return!1;let n=m(l);if(n.nodeAfter.attrs[e]===t)return!1;if(o){let r=l.tr;l.selection instanceof y?l.selection.forEachCell((l,o)=>{l.attrs[e]!==t&&r.setNodeMarkup(o,null,{...l.attrs,[e]:t})}):r.setNodeMarkup(n.pos,null,{...n.nodeAfter.attrs,[e]:t}),o(r)}return!0}}function O(e,t,l){let o=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;e<o.length;e++){let n=t.table.nodeAt(o[e]);if(n&&n.type!==l.header_cell)return!1}return!0}function H(e,t){if((t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic)return function(t,l){if(!u(t))return!1;if(l){let o=h(t.schema),n=M(t),r=t.tr,i=n.map.cellsInRect("column"==e?{left:n.left,top:0,right:n.right,bottom:n.map.height}:"row"==e?{left:0,top:n.top,right:n.map.width,bottom:n.bottom}:n),s=i.map(e=>n.table.nodeAt(e));for(let e=0;e<i.length;e++)s[e].type==o.header_cell&&r.setNodeMarkup(n.tableStart+i[e],o.cell,s[e].attrs);if(0==r.steps.length)for(let e=0;e<i.length;e++)r.setNodeMarkup(n.tableStart+i[e],o.header_cell,s[e].attrs);l(r)}return!0};return function(t,l){if(!u(t))return!1;if(l){let o=h(t.schema),n=M(t),r=t.tr,i=O("row",n,o),s=O("column",n,o),a=+!!("column"===e?i:"row"===e&&s),c="column"==e?{left:0,top:a,right:1,bottom:n.map.height}:"row"==e?{left:a,top:0,right:n.map.width,bottom:1}:n,d="column"==e?s?o.cell:o.header_cell:"row"==e?i?o.cell:o.header_cell:o.cell;n.map.cellsInRect(c).forEach(e=>{let t=e+n.tableStart,l=r.doc.nodeAt(t);l&&r.setNodeMarkup(t,d,l.attrs)}),l(r)}return!0}}H("row",{useDeprecatedLogic:!0}),H("column",{useDeprecatedLogic:!0});var K=H("cell",{useDeprecatedLogic:!0});function J(e){return function(t,l){if(!u(t))return!1;let o=function(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,l=e.before();t>=0;t--){let o=e.node(-1).child(t),n=o.lastChild;if(n)return l-1-n.nodeSize;l-=o.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let l=e.indexAfter(-1),o=e.after();l<t.childCount;l++){let e=t.child(l);if(e.childCount)return o+1;o+=e.nodeSize}}return null}(m(t),e);if(null==o)return!1;if(l){let e=t.doc.resolve(o);l(t.tr.setSelection(r.U3.between(e,e.node(0).resolve(e.pos+e.nodeAfter.nodeSize))).scrollIntoView())}return!0}}function P(e,t){let l=e.selection.$anchor;for(let o=l.depth;o>0;o--)if("table"==l.node(o).type.spec.tableRole)return t&&t(e.tr.delete(l.before(o),l.after(o)).scrollIntoView()),!0;return!1}function U(e,t){let l=e.selection;if(!(l instanceof y))return!1;if(t){let o=e.tr,n=h(e.schema).cell.createAndFill().content;l.forEachCell((e,t)=>{e.content.eq(n)||o.replace(o.mapping.map(t+1),o.mapping.map(t+e.nodeSize-1),new i.Ji(n,0,0))}),o.docChanged&&t(o)}return!0}function W(e,t){let l=e.createAndFill();return new c.dL(l).replace(0,l.content.size,t).doc}function I(e,t,l,o,n,r,i,s){if(0==i||i==t.height)return!1;let a=!1;for(let c=n;c<r;c++){let n=i*t.width+c,r=t.map[n];if(t.map[n-t.width]==r){a=!0;let n=l.nodeAt(r),{top:d,left:h}=t.findCell(r);e.setNodeMarkup(e.mapping.slice(s).map(r+o),null,{...n.attrs,rowspan:i-d}),e.insert(e.mapping.slice(s).map(t.positionAt(i,h,l)),n.type.createAndFill({...n.attrs,rowspan:d+n.attrs.rowspan-i})),c+=n.attrs.colspan-1}}return a}function X(e,t,l,o,n,r,i,s){if(0==i||i==t.width)return!1;let a=!1;for(let c=n;c<r;c++){let n=c*t.width+i,r=t.map[n];if(t.map[n-1]==r){a=!0;let n=l.nodeAt(r),d=t.colCount(r),h=e.mapping.slice(s).map(r+o);e.setNodeMarkup(h,null,C(n.attrs,i-d,n.attrs.colspan-(i-d))),e.insert(h+n.nodeSize,n.type.createAndFill(C(n.attrs,0,i-d))),c+=n.attrs.rowspan-1}}return a}function G(e,t,l,o,n){let r=l?e.doc.nodeAt(l-1):e.doc;if(!r)throw Error("No table found");let s=d.get(r),{top:a,left:c}=o,p=c+n.width,f=a+n.height,u=e.tr,m=0;function g(){if(!(r=l?u.doc.nodeAt(l-1):u.doc))throw Error("No table found");s=d.get(r),m=u.mapping.maps.length}(function(e,t,l,o,n,r){let s,a,c=h(e.doc.type.schema);if(n>t.width)for(let r=0,i=0;r<t.height;r++){let d,h=l.child(r);i+=h.nodeSize;let p=[];d=null==h.lastChild||h.lastChild.type==c.cell?s||(s=c.cell.createAndFill()):a||(a=c.header_cell.createAndFill());for(let e=t.width;e<n;e++)p.push(d);e.insert(e.mapping.slice(0).map(i-1+o),p)}if(r>t.height){let d=[];for(let e=0,o=(t.height-1)*t.width;e<Math.max(t.width,n);e++){let n=!(e>=t.width)&&l.nodeAt(t.map[o+e]).type==c.header_cell;d.push(n?a||(a=c.header_cell.createAndFill()):s||(s=c.cell.createAndFill()))}let h=c.row.create(null,i.FK.from(d)),p=[];for(let e=t.height;e<r;e++)p.push(h);e.insert(e.mapping.slice(0).map(o+l.nodeSize-2),p)}return!!(s||a)})(u,s,r,l,p,f)&&g(),I(u,s,r,l,c,p,a,m)&&g(),I(u,s,r,l,c,p,f,m)&&g(),X(u,s,r,l,a,f,c,m)&&g(),X(u,s,r,l,a,f,p,m)&&g();for(let e=a;
1e<f;e++){let t=s.positionAt(e,c,r),o=s.positionAt(e,p,r);u.replace(u.mapping.slice(m).map(t+l),u.mapping.slice(m).map(o+l),new i.Ji(n.rows[e-a],0,0))}g(),u.setSelection(new y(u.doc.resolve(l+s.positionAt(a,c,r)),u.doc.resolve(l+s.positionAt(f-1,p-1,r)))),t(u)}var q=(0,a.K)({ArrowLeft:Z("horiz",-1),ArrowRight:Z("horiz",1),ArrowUp:Z("vert",-1),ArrowDown:Z("vert",1),"Shift-ArrowLeft":j("horiz",-1),"Shift-ArrowRight":j("horiz",1),"Shift-ArrowUp":j("vert",-1),"Shift-ArrowDown":j("vert",1),Backspace:U,"Mod-Backspace":U,Delete:U,"Mod-Delete":U});function Y(e,t,l){return!l.eq(e.selection)&&(t&&t(e.tr.setSelection(l).scrollIntoView()),!0)}function Z(e,t){return(l,o,n)=>{if(!n)return!1;let i=l.selection;if(i instanceof y)return Y(l,o,r.LN.near(i.$headCell,t));if("horiz"!=e&&!i.empty)return!1;let s=el(n,e,t);if(null==s)return!1;if("horiz"==e)return Y(l,o,r.LN.near(l.doc.resolve(i.head+t),t));{let n,i=l.doc.resolve(s),a=v(i,e,t);return n=a?r.LN.near(a,1):t<0?r.LN.near(l.doc.resolve(i.before(-1)),-1):r.LN.near(l.doc.resolve(i.after(-1)),1),Y(l,o,n)}}}function j(e,t){return(l,o,n)=>{let r;if(!n)return!1;let i=l.selection;if(i instanceof y)r=i;else{let o=el(n,e,t);if(null==o)return!1;r=new y(l.doc.resolve(o))}let s=v(r.$headCell,e,t);return!!s&&Y(l,o,new y(r.$anchorCell,s))}}function Q(e,t){let l=f(e.state.doc.resolve(t));return!!l&&(e.dispatch(e.state.tr.setSelection(new y(l))),!0)}function ee(e,t,l){if(!u(e.state))return!1;let o=function(e){if(!e.size)return null;let{content:t,openStart:l,openEnd:o}=e;for(;1==t.childCount&&(l>0&&o>0||"table"==t.child(0).type.spec.tableRole);)l--,o--,t=t.child(0).content;let n=t.child(0),r=n.type.spec.tableRole,s=n.type.schema,a=[];if("row"==r)for(let e=0;e<t.childCount;e++){let n=t.child(e).content,r=e?0:Math.max(0,l-1),c=e<t.childCount-1?0:Math.max(0,o-1);(r||c)&&(n=W(h(s).row,new i.Ji(n,r,c)).content),a.push(n)}else{if("cell"!=r&&"header_cell"!=r)return null;a.push(l||o?W(h(s).row,new i.Ji(t,l,o)).content:t)}return function(e,t){let l=[];for(let e=0;e<t.length;e++){let o=t[e];for(let t=o.childCount-1;t>=0;t--){let{rowspan:n,colspan:r}=o.child(t).attrs;for(let t=e;t<e+n;t++)l[t]=(l[t]||0)+r}}let o=0;for(let e=0;e<l.length;e++)o=Math.max(o,l[e]);for(let n=0;n<l.length;n++)if(n>=t.length&&t.push(i.FK.empty),l[n]<o){let r=h(e).cell.createAndFill(),s=[];for(let e=l[n];e<o;e++)s.push(r);t[n]=t[n].append(i.FK.from(s))}return{height:t.length,width:o,rows:t}}(s,a)}(l),n=e.state.selection;if(n instanceof y){o||(o={width:1,height:1,rows:[i.FK.from(W(h(e.state.schema).cell,l))]});let t=n.$anchorCell.node(-1),r=n.$anchorCell.start(-1),s=d.get(t).rectBetween(n.$anchorCell.pos-r,n.$headCell.pos-r);return o=function({width:e,height:t,rows:l},o,n){if(e!=o){let t=[],n=[];for(let e=0;e<l.length;e++){let r=l[e],s=[];for(let l=t[e]||0,n=0;l<o;n++){let i=r.child(n%r.childCount);l+i.attrs.colspan>o&&(i=i.type.createChecked(C(i.attrs,i.attrs.colspan,l+i.attrs.colspan-o),i.content)),s.push(i),l+=i.attrs.colspan;for(let l=1;l<i.attrs.rowspan;l++)t[e+l]=(t[e+l]||0)+i.attrs.colspan}n.push(i.FK.from(s))}l=n,e=o}if(t!=n){let e=[];for(let o=0,r=0;o<n;o++,r++){let s=[],a=l[r%t];for(let e=0;e<a.childCount;e++){let t=a.child(e);o+t.attrs.rowspan>n&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,n-t.attrs.rowspan)},t.content)),s.push(t)}e.push(i.FK.from(s))}l=e,t=n}return{width:e,height:t,rows:l}}(o,s.right-s.left,s.bottom-s.top),G(e.state,e.dispatch,r,s,o),!0}if(!o)return!1;{let t=m(e.state),l=t.start(-1);return G(e.state,e.dispatch,l,d.get(t.node(-1)).findCell(t.pos-l),o),!0}}function et(e,t){var l;let o;if(t.ctrlKey||t.metaKey)return;let n=eo(e,t.target);if(t.shiftKey&&e.state.selection instanceof y)r(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&null!=(o=f(e.state.selection.$anchor))&&(null==(l=en(e,t))?void 0:l.pos)!=o.pos)r(o,t),t.preventDefault();else if(!n)return;function r(t,l){let o=en(e,l),n=null==p.getState(e.state);if(!o||!w(t,o))if(!n)return;else o=t;let r=new y(t,o);if(n||!e.state.selection.eq(r)){let l=e.state.tr.setSelection(r);n&&l.setMeta(p,t.pos),e.dispatch(l)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",s),null!=p.getState(e.state)&&e.dispatch(e.state.tr.setMeta(p,-1))}function s(l){let o,s=p.getState(e.state);if(null!=s)o=e.state.doc.resolve(s);else if(eo(e,l.target)!=n&&!(o=en(e,t)))return i();o&&r(o,l)}e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",s)}function el(e,t,l){if(!(e.state.selection instanceof r.U3))return null;let{$head:o}=e.state.selection;for(let n=o.depth-1;n>=0;n--){let r=o.node(n);if((l<0?o.index(n):o.indexAfter(n))!=(l<0?0:r.childCount))break;if("cell"==r.type.spec.tableRole||"header_cell"==r.type.spec.tableRole){let r=o.before(n),i="vert"==t?l>0?"down":"up":l>0?"right":"left";return e.endOfTextblock(i)?r:null}}return null}function eo(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t;return null}function en(e,t){let l=e.posAtCoords({left:t.clientX,top:t.clientY});return l&&l?f(e.state.doc.resolve(l.pos)):null}var er=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ei(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,ei(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}};function ei(e,t,l,o,n,r){var i;let s=0,a=!0,c=t.firstChild,d=e.firstChild;if(d){for(let e=0,l=0;e<d.childCount;e++){let{colspan:i,colwidth:h}=d.child(e).attrs;for(let e=0;e<i;e++,l++){let i=n==l?r:h&&h[e],d=i?i+"px":"";
1if(s+=i||o,i||(a=!1),c)c.style.width!=d&&(c.style.width=d),c=c.nextSibling;else{let e=document.createElement("col");e.style.width=d,t.appendChild(e)}}}for(;c;){let e=c.nextSibling;null==(i=c.parentNode)||i.removeChild(c),c=e}a?(l.style.width=s+"px",l.style.minWidth=""):(l.style.width="",l.style.minWidth=s+"px")}}var es=new r.hs("tableColumnResizing");function ea({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:l=100,View:o=er,lastColumnResizable:n=!0}={}){let i=new r.k_({key:es,state:{init(e,t){var n,r;let s=null==(r=null==(n=i.spec)?void 0:n.props)?void 0:r.nodeViews,a=h(t.schema).table.name;return o&&s&&(s[a]=(e,t)=>new o(e,l,t)),new ec(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>{let t=es.getState(e);return t&&t.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(t,l)=>{!function(e,t,l,o){if(!e.editable)return;let n=es.getState(e.state);if(n&&!n.dragging){let r=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),i=-1;if(r){let{left:o,right:n}=r.getBoundingClientRect();t.clientX-o<=l?i=ed(e,t,"left",l):n-t.clientX<=l&&(i=ed(e,t,"right",l))}if(i!=n.activeHandle){if(!o&&-1!==i){let t=e.state.doc.resolve(i),l=t.node(-1),o=d.get(l),n=t.start(-1);if(o.colCount(t.pos-n)+t.nodeAfter.attrs.colspan-1==o.width-1)return}ep(e,i)}}}(t,l,e,n)},mouseleave:e=>{!function(e){if(!e.editable)return;let t=es.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&ep(e,-1)}(e)},mousedown:(e,o)=>{!function(e,t,l,o){var n;if(!e.editable)return;let r=null!=(n=e.dom.ownerDocument.defaultView)?n:window,i=es.getState(e.state);if(!i||-1==i.activeHandle||i.dragging)return;let s=e.state.doc.nodeAt(i.activeHandle),a=function(e,t,{colspan:l,colwidth:o}){let n=o&&o[o.length-1];if(n)return n;let r=e.domAtPos(t),i=r.node.childNodes[r.offset].offsetWidth,s=l;if(o)for(let e=0;e<l;e++)o[e]&&(i-=o[e],s--);return i/s}(e,i.activeHandle,s.attrs);function c(t){r.removeEventListener("mouseup",c),r.removeEventListener("mousemove",h);let o=es.getState(e.state);(null==o?void 0:o.dragging)&&(function(e,t,l){let o=e.state.doc.resolve(t),n=o.node(-1),r=d.get(n),i=o.start(-1),s=r.colCount(o.pos-i)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let e=0;e<r.height;e++){let t=e*r.width+s;if(e&&r.map[t]==r.map[t-r.width])continue;let o=r.map[t],c=n.nodeAt(o).attrs,d=1==c.colspan?0:s-r.colCount(o);if(c.colwidth&&c.colwidth[d]==l)continue;let h=c.colwidth?c.colwidth.slice():Array(c.colspan).fill(0);h[d]=l,a.setNodeMarkup(i+o,null,{...c,colwidth:h})}a.docChanged&&e.dispatch(a)}(e,o.activeHandle,eh(o.dragging,t,l)),e.dispatch(e.state.tr.setMeta(es,{setDragging:null})))}function h(t){if(!t.which)return c(t);let n=es.getState(e.state);if(n&&n.dragging){let r=eh(n.dragging,t,l);ef(e,n.activeHandle,r,o)}}e.dispatch(e.state.tr.setMeta(es,{setDragging:{startX:t.clientX,startWidth:a}})),ef(e,i.activeHandle,a,o),r.addEventListener("mouseup",c),r.addEventListener("mousemove",h),t.preventDefault()}(e,o,t,l)}},decorations:e=>{let t=es.getState(e);if(t&&t.activeHandle>-1)return function(e,t){var l;let o=[],n=e.doc.resolve(t),r=n.node(-1);if(!r)return s.zF.empty;let i=d.get(r),a=n.start(-1),c=i.colCount(n.pos-a)+n.nodeAfter.attrs.colspan-1;for(let t=0;t<i.height;t++){let n=c+t*i.width;if((c==i.width-1||i.map[n]!=i.map[n+1])&&(0==t||i.map[n]!=i.map[n-i.width])){let t=i.map[n],c=a+t+r.nodeAt(t).nodeSize-1,d=document.createElement("div");d.className="column-resize-handle",(null==(l=es.getState(e))?void 0:l.dragging)&&o.push(s.NZ.node(a+t,a+t+r.nodeAt(t).nodeSize,{class:"column-resize-dragging"})),o.push(s.NZ.widget(c,d))}}return s.zF.create(e.doc,o)}(e,t.activeHandle)},nodeViews:{}}});return i}var ec=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let l=t.getMeta(es);if(l&&null!=l.setHandle)return new e(l.setHandle,!1);if(l&&void 0!==l.setDragging)return new e(this.activeHandle,l.setDragging);if(this.activeHandle>-1&&t.docChanged){let l=t.mapping.map(this.activeHandle,-1);return g(t.doc.resolve(l))||(l=-1),new e(l,this.dragging)}return this}};function ed(e,t,l,o){let n=e.posAtCoords({left:t.clientX+("right"==l?-o:o),top:t.clientY});if(!n)return -1;let{pos:r}=n,i=f(e.state.doc.resolve(r));if(!i)return -1;if("right"==l)return i.pos;let s=d.get(i.node(-1)),a=i.start(-1),c=s.map.indexOf(i.pos-a);return c%s.width==0?-1:a+s.map[c-1]}function eh(e,t,l){let o=t.clientX-e.startX;return Math.max(l,e.startWidth+o)}function ep(e,t){e.dispatch(e.state.tr.setMeta(es,{setHandle:t}))}function ef(e,t,l,o){let n=e.state.doc.resolve(t),r=n.node(-1),i=n.start(-1),s=d.get(r).colCount(n.pos-i)+n.nodeAfter.attrs.colspan-1,a=e.domAtPos(n.start(-1)).node;for(;a&&"TABLE"!=a.nodeName;)a=a.parentNode;a&&ei(r,a.firstChild,a,o,s,l)}function eu({allowTableNodeSelection:e=!1}={}){return new r.k_({key:p,state:{init:()=>null,apply(e,t){let l=e.getMeta(p);if(null!=l)return -1==l?null:l;if(null==t||!e.docChanged)return t;let{deleted:o,pos:n}=e.mapping.mapResult(t);return o?null:n}},props:{decorations:S,handleDOMEvents:{mousedown:et},createSelectionBetween:e=>null!=p.getState(e.state)?e.state.selection:null,handleTripleClick:Q,handleKeyDown:q,handlePaste:ee},appendTransaction:(t,l,o)=>(function(e,t,l){let o,n,i=(t||e).selection,s=(t||e).doc;if(i instanceof r.nh&&(n=i.node.type.spec.tableRole)){if("cell"==n||"header_cell"==n)o=y.create(s,i.from);else if("row"==n){let e=s.resolve(i.from+1);o=y.rowSelection(e,e)}else if(!l){let e=d.get(i.node),t=i.from+1,l=t+e.map[e.width*e.height-1];o=y.create(s,t+1,l)}}else i instanceof r.U3&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let l=e.pos,o=t.pos,n=e.depth;for(;n>=0&&!(e.after(n+1)<e.end(n));n--,l++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,o--);return l==o&&/row|table/.test(e.node(n).type.spec.tableRole)}(i)?o=r.U3.create(s,i.from):i instanceof r.U3&&function({$from:e,$to:t}){let l,o;for(let t=e.depth;t>0;t--){let o=e.node(t);if("cell"===o.type.spec.tableRole||"header_cell"===o.type.spec.tableRole){l=o;break}}for(let e=t.depth;e>0;e--){let l=t.node(e);if("cell"===l.type.spec.tableRole||"header_cell"===l.type.spec.tableRole){o=l;break}}return l!==o&&0===t.parentOffset}(i)&&(o=r.U3.create(s,i.$from.start(),i.$from.end()));return o&&(t||(t=e.tr)).setSelection(o),t})(o,N(o,l),e)})}l.d(t,{AL:()=>ea,D8:()=>J,GU:()=>x,JD:()=>L,L0:()=>V,LF:()=>eu,RC:()=>z,_G:()=>K,aR:()=>D,gC:()=>F,gR:()=>k,i4:()=>B,iS:()=>H,kG:()=>P,rP:()=>N,rn:()=>y,w7:()=>T})}}]);
2//# sourceMappingURL=/packs/js/65193-cdb3471a910e557b.js.map

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.