1"use strict";(self.rspackChunksciobot_next=self.rspackChunksciobot_next||[]).push([["10j"],{v1d:function(e,t,i){let o,n;i.d(t,{m:function(){return F}});var s=i("Cv"),l=i("CW"),r=i("aq"),a=i("BnQ"),h=i("qO");if("u">typeof WeakMap){let e=new WeakMap;o=t=>e.get(t),n=(t,i)=>(e.set(t,i),i)}else{let e=[],t=0;o=t=>{for(let i=0;i<e.length;i+=2)if(e[i]==t)return e[i+1]},n=(i,o)=>(10==t&&(t=0),e[t++]=i,e[t++]=o)}var d=class{constructor(e,t,i,o){this.width=e,this.height=t,this.map=i,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){let i=this.map[t];if(i!=e)continue;let o=t%this.width,n=t/this.width|0,s=o+1,l=n+1;for(let e=1;s<this.width&&this.map[t+e]==i;e++)s++;for(let e=1;l<this.height&&this.map[t+this.width*e]==i;e++)l++;return{left:o,top:n,right:s,bottom:l}}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,i){let{left:o,right:n,top:s,bottom:l}=this.findCell(e);return"horiz"==t?(i<0?0==o:n==this.width)?null:this.map[s*this.width+(i<0?o-1:n)]:(i<0?0==s:l==this.height)?null:this.map[o+this.width*(i<0?s-1:l)]}rectBetween(e,t){let{left:i,right:o,top:n,bottom:s}=this.findCell(e),{left:l,right:r,top:a,bottom:h}=this.findCell(t);return{left:Math.min(i,l),top:Math.min(n,a),right:Math.max(o,r),bottom:Math.max(s,h)}}cellsInRect(e){let t=[],i={};for(let o=e.top;o<e.bottom;o++)for(let n=e.left;n<e.right;n++){let s=o*this.width+n,l=this.map[s];!i[l]&&(i[l]=!0,n==e.left&&n&&this.map[s-1]==l||o==e.top&&o&&this.map[s-this.width]==l||t.push(l))}return t}positionAt(e,t,i){for(let o=0,n=0;;o++){let s=n+i.child(o).nodeSize;if(o==e){let i=t+e*this.width,o=(e+1)*this.width;for(;i<o&&this.map[i]<n;)i++;return i==o?s-1:this.map[i]}n=s}}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,i=!1;for(let o=0;o<e.childCount;o++){let n=e.child(o),s=0;if(i)for(let t=0;t<o;t++){let i=e.child(t);for(let e=0;e<i.childCount;e++){let n=i.child(e);t+n.attrs.rowspan>o&&(s+=n.attrs.colspan)}}for(let e=0;e<n.childCount;e++){let t=n.child(e);s+=t.attrs.colspan,t.attrs.rowspan>1&&(i=!0)}-1==t?t=s:t!=s&&(t=Math.max(t,s))}return t}(e),i=e.childCount,o=[],n=0,s=null,l=[];for(let e=0,n=t*i;e<n;e++)o[e]=0;for(let r=0,a=0;r<i;r++){let h=e.child(r);a++;for(let e=0;;e++){for(;n<o.length&&0!=o[n];)n++;if(e==h.childCount)break;let d=h.child(e),{colspan:p,rowspan:u,colwidth:c}=d.attrs;for(let e=0;e<u;e++){if(e+r>=i){(s||(s=[])).push({type:"overlong_rowspan",pos:a,n:u-e});break}let h=n+e*t;for(let e=0;e<p;e++){0==o[h+e]?o[h+e]=a:(s||(s=[])).push({type:"collision",row:r,pos:a,n:p-e});let i=c&&c[e];if(i){let o=(h+e)%t*2,n=l[o];null==n||n!=i&&1==l[o+1]?(l[o]=i,l[o+1]=1):n==i&&l[o+1]++}}}n+=p,a+=d.nodeSize}let d=(r+1)*t,p=0;for(;n<d;)0==o[n++]&&p++;p&&(s||(s=[])).push({type:"missing",row:r,n:p}),a++}(0===t||0===i)&&(s||(s=[])).push({type:"zero_sized"});let r=new d(t,i,o,s),a=!1;for(let e=0;!a&&e<l.length;e+=2)null!=l[e]&&l[e+1]<i&&(a=!0);return a&&function(e,t,i){e.problems||(e.problems=[]);let o={};for(let n=0;n<e.map.length;n++){let s=e.map[n];if(o[s])continue;o[s]=!0;let l=i.nodeAt(s);if(!l)throw RangeError(`No cell with offset ${s} found`);let r=null,a=l.attrs;for(let i=0;i<a.colspan;i++){let o=t[(n+i)%e.width*2];null==o||a.colwidth&&a.colwidth[i]==o||((r||(r=function(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let i=0;i<e.colspan;i++)t.push(0);return t}(a)))[i]=o)}r&&e.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:r})}}(r,l,e),r}(e))}};function p(e){let t=e.cached.tableNodeTypes;if(!t)for(let i in t=e.cached.tableNodeTypes={},e.nodes){let o=e.nodes[i],n=o.spec.tableRole;n&&(t[n]=o)}return t}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 c(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function f(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function m(e,t,i){let o=e.node(-1),n=d.get(o),s=e.start(-1),l=n.nextCell(e.pos-s,t,i);return null==l?null:e.node(0).resolve(s+l)}function g(e,t,i=1){let o={...e,colspan:e.colspan-i};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,i),o.colwidth.some(e=>e>0)||(o.colwidth=null)),o}new r.hs("selectingCells");var w=class e extends r.LN{constructor(e,t=e){let i=e.node(-1),o=d.get(i),n=e.start(-1),s=o.rectBetween(e.pos-n,t.pos-n),l=e.node(0),a=o.cellsInRect(s).filter(e=>e!=t.pos-n);a.unshift(t.pos-n);let h=a.map(e=>{let t=i.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e}
1 found`);let o=n+e+1;return new r.yn(l.resolve(o),l.resolve(o+t.content.size))});super(h[0].$from,h[0].$to,h),this.$anchorCell=e,this.$headCell=t}map(t,i){let o=t.resolve(i.map(this.$anchorCell.pos)),n=t.resolve(i.map(this.$headCell.pos));if(c(o)&&c(n)&&f(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),i=this.$anchorCell.start(-1),o=t.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i),n={},s=[];for(let i=o.top;i<o.bottom;i++){let l=[];for(let s=i*t.width+o.left,r=o.left;r<o.right;r++,s++){let i=t.map[s];if(n[i])continue;n[i]=!0;let r=t.findCell(i),a=e.nodeAt(i);if(!a)throw RangeError(`No cell with offset ${i} found`);let h=o.left-r.left,d=r.right-o.right;if(h>0||d>0){let e=a.attrs;if(h>0&&(e=g(e,0,h)),d>0&&(e=g(e,e.colspan-d,d)),r.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(r.top<o.top||r.bottom>o.bottom){let e={...a.attrs,rowspan:Math.min(r.bottom,o.bottom)-Math.max(r.top,o.top)};a=r.top<o.top?a.type.createAndFill(e):a.type.create(e,a.content)}l.push(a)}s.push(e.child(i).copy(a.FK.from(l)))}let l=this.isColSelection()&&this.isRowSelection()?e:s;return new a.Ji(a.FK.from(l),1,1)}replace(e,t=a.Ji.empty){let i=e.steps.length,o=this.ranges;for(let n=0;n<o.length;n++){let{$from:s,$to:l}=o[n],r=e.mapping.slice(i);e.replace(r.map(s.pos),r.map(l.pos),n?a.Ji.empty:t)}let n=r.LN.findFrom(e.doc.resolve(e.mapping.slice(i).map(this.to)),-1);n&&e.setSelection(n)}replaceWith(e,t){this.replace(e,new a.Ji(a.FK.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),i=d.get(t),o=this.$anchorCell.start(-1),n=i.cellsInRect(i.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let i=0;i<n.length;i++)e(t.nodeAt(n[i]),o+n[i])}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,i=t){let o=t.node(-1),n=d.get(o),s=t.start(-1),l=n.findCell(t.pos-s),r=n.findCell(i.pos-s),a=t.node(0);return l.top<=r.top?(l.top>0&&(t=a.resolve(s+n.map[l.left])),r.bottom<n.height&&(i=a.resolve(s+n.map[n.width*(n.height-1)+r.right-1]))):(r.top>0&&(i=a.resolve(s+n.map[r.left])),l.bottom<n.height&&(t=a.resolve(s+n.map[n.width*(n.height-1)+l.right-1]))),new e(t,i)}isRowSelection(){let e=this.$anchorCell.node(-1),t=d.get(e),i=this.$anchorCell.start(-1),o=t.colCount(this.$anchorCell.pos-i),n=t.colCount(this.$headCell.pos-i);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,i=t){let o=t.node(-1),n=d.get(o),s=t.start(-1),l=n.findCell(t.pos-s),r=n.findCell(i.pos-s),a=t.node(0);return l.left<=r.left?(l.left>0&&(t=a.resolve(s+n.map[l.top*n.width])),r.right<n.width&&(i=a.resolve(s+n.map[n.width*(r.top+1)-1]))):(r.left>0&&(i=a.resolve(s+n.map[r.top*n.width])),l.right<n.width&&(t=a.resolve(s+n.map[n.width*(l.top+1)-1]))),new e(t,i)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,i){return new e(t.resolve(i.anchor),t.resolve(i.head))}static create(t,i,o=i){return new e(t.resolve(i),t.resolve(o))}getBookmark(){return new v(this.$anchorCell.pos,this.$headCell.pos)}};w.prototype.visible=!1,r.LN.jsonID("cell",w);var v=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),i=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==i.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&i.index()<i.parent.childCount&&f(t,i)?new w(t,i):r.LN.near(i,1)}};function y(e){let t=e.selection,i=function(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 i=function(e){for(let t=e.depth-1;t>0;
1t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}(t.$head)||function(e){for(let t=e.nodeAfter,i=e.pos;t;t=t.firstChild,i++){let o=t.type.spec.tableRole;if("cell"==o||"header_cell"==o)return e.doc.resolve(i)}for(let t=e.nodeBefore,i=e.pos;t;t=t.lastChild,i--){let o=t.type.spec.tableRole;if("cell"==o||"header_cell"==o)return e.doc.resolve(i-t.nodeSize)}}(t.$head);if(i)return i;throw RangeError(`No cell found around position ${t.head}`)}(e),o=i.node(-1),n=i.start(-1),s=d.get(o);return{...t instanceof w?s.rectBetween(t.$anchorCell.pos-n,t.$headCell.pos-n):s.findCell(i.pos-n),tableStart:n,map:s,table:o}}function b(e,t,i){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!==i.header_cell)return!1}return!0}function C(e,t){if((t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic)return function(t,i){if(!u(t))return!1;if(i){let o=p(t.schema),n=y(t),s=t.tr,l=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),r=l.map(e=>n.table.nodeAt(e));for(let e=0;e<l.length;e++)r[e].type==o.header_cell&&s.setNodeMarkup(n.tableStart+l[e],o.cell,r[e].attrs);if(0===s.steps.length)for(let e=0;e<l.length;e++)s.setNodeMarkup(n.tableStart+l[e],o.header_cell,r[e].attrs);i(s)}return!0};return function(t,i){if(!u(t))return!1;if(i){let o=p(t.schema),n=y(t),s=t.tr,l=b("row",n,o),r=b("column",n,o),a=+("column"===e?!!l:"row"===e&&!!r),h="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?r?o.cell:o.header_cell:"row"==e?l?o.cell:o.header_cell:o.cell;n.map.cellsInRect(h).forEach(e=>{let t=e+n.tableStart,i=s.doc.nodeAt(t);i&&s.setNodeMarkup(t,d,i.attrs)}),i(s)}return!0}}function O(e,t){let i=e.selection;if(!(i instanceof w))return!1;if(t){let o=e.tr,n=p(e.schema).cell.createAndFill().content;
1i.forEachCell((e,t)=>{e.content.eq(n)||o.replace(o.mapping.map(t+1),o.mapping.map(t+e.nodeSize-1),new a.Ji(n,0,0))}),o.docChanged&&t(o)}return!0}new r.hs("fix-tables"),C("row",{useDeprecatedLogic:!0}),C("column",{useDeprecatedLogic:!0}),C("cell",{useDeprecatedLogic:!0});function I(e,t,i){return!i.eq(e.selection)&&(t&&t(e.tr.setSelection(i).scrollIntoView()),!0)}function U(e,t){return(i,o,n)=>{if(!n)return!1;let s=i.selection;if(s instanceof w)return I(i,o,r.LN.near(s.$headCell,t));if("horiz"!=e&&!s.empty)return!1;let l=D(n,e,t);if(null==l)return!1;if("horiz"==e)return I(i,o,r.LN.near(i.doc.resolve(s.head+t),t));{let n,s=i.doc.resolve(l),a=m(s,e,t);return n=a?r.LN.near(a,1):t<0?r.LN.near(i.doc.resolve(s.before(-1)),-1):r.LN.near(i.doc.resolve(s.after(-1)),1),I(i,o,n)}}}function S(e,t){return(i,o,n)=>{let s;if(!n)return!1;let l=i.selection;if(l instanceof w)s=l;else{let o=D(n,e,t);if(null==o)return!1;s=new w(i.doc.resolve(o))}let r=m(s.$headCell,e,t);return!!r&&I(i,o,new w(s.$anchorCell,r))}}function D(e,t,i){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 s=o.node(n);if((i<0?o.index(n):o.indexAfter(n))!=(i<0?0:s.childCount))break;if("cell"==s.type.spec.tableRole||"header_cell"==s.type.spec.tableRole){let s=o.before(n),l="vert"==t?i>0?"down":"up":i>0?"right":"left";return e.endOfTextblock(l)?s:null}}return null}(0,h.K)({ArrowLeft:U("horiz",-1),ArrowRight:U("horiz",1),ArrowUp:U("vert",-1),ArrowDown:U("vert",1),"Shift-ArrowLeft":S("horiz",-1),"Shift-ArrowRight":S("horiz",1),"Shift-ArrowUp":S("vert",-1),"Shift-ArrowDown":S("vert",1),Backspace:O,"Mod-Backspace":O,Delete:O,"Mod-Delete":O}),new r.hs("tableColumnResizing");var R=class{get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push((0,l.UU)("boolean"!=typeof this.floatingUIOptions.flip?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push((0,l.BN)("boolean"!=typeof this.floatingUIOptions.shift?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push((0,l.cY)("boolean"!=typeof this.floatingUIOptions.offset?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push((0,l.UE)(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push((0,l.Ej)("boolean"!=typeof this.floatingUIOptions.size?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push((0,l.RK)("boolean"!=typeof this.floatingUIOptions.autoPlacement?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push((0,l.jD)("boolean"!=typeof this.floatingUIOptions.hide?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push((0,l.mG)("boolean"!=typeof this.floatingUIOptions.inline?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,t,i,o;let{selection:n}=this.editor.state,l=null==(e=this.getReferencedVirtualElement)?void 0:e.call(this);if(l)return l;if(!(null==(t=this.view)||null==(t=t.dom)?void 0:t.parentNode))return;let a=(0,s.MG)(this.view,n.from,n.to),h={getBoundingClientRect:()=>a,getClientRects:()=>[a]};if(n instanceof r.nh){let e=this.view.nodeDOM(n.from),t=e.dataset.nodeViewWrapper?e:e.querySelector("[data-node-view-wrapper]");t&&(e=t),e&&(h={getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>[e.getBoundingClientRect()]})}if(n instanceof w){let e,t,s,l,{$anchorCell:r,$headCell:a}=n,d=r?r.pos:a.pos,p=a?a.pos:r.pos,u=this.view.nodeDOM(d),c=this.view.nodeDOM(p);if(!u||!c)return;let f=u===c?u.getBoundingClientRect():(i=u.getBoundingClientRect(),o=c.getBoundingClientRect(),e=Math.min(i.top,o.top),t=Math.max(i.bottom,o.bottom),s=Math.min(i.left,o.left),l=Math.max(i.right,o.right)-s,new DOMRect(s,e,l,t-e));h={getBoundingClientRect:()=>f,getClientRects:()=>[f]}}return h}constructor({editor:e,element:t,view:i,pluginKey:o="bubbleMenu",updateDelay:n=250,resizeDelay:l=60,shouldShow:r,appendTo:a,getReferencedVirtualElement:h,options:d}){var p;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:i,to:o})=>{let{doc:n,selection:l}=t,{empty:r}=l,a=!n.textBetween(i,o).length&&(0,s.eE)(t.selection),h=this.element.contains(document.activeElement);return!!(e.hasFocus()||h)&&!r&&!a&&!!this.editor.isEditable},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{var t;if(this.editor.isDestroyed)return void this.destroy();if(this.preventHide){this.preventHide=!1;return}(null==e?void 0:e.relatedTarget)&&(null==(t=this.element.parentNode)?void 0:t.contains(e.relatedTarget))||(null==e?void 0:e.relatedTarget)!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>
1{let i=!(null==t?void 0:t.selection.eq(e.state.selection)),o=!(null==t?void 0:t.doc.eq(e.state.doc));(i||o)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,i,o,t)},this.updateDelay))},this.updateHandler=(e,t,i,o)=>{let{composing:n}=e;if(!n&&(t||i)){if(!this.getShouldShow(o))return void this.hide();this.show(),this.updatePosition()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);"updatePosition"===t?this.updatePosition():t&&"object"==typeof t&&"updateOptions"===t.type?this.updateOptions(t.options):"hide"===t?this.hide():"show"===t&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=i,this.pluginKey=o,this.updateDelay=n,this.resizeDelay=l,this.appendTo=a,this.scrollTarget=null!=(p=null==d?void 0:d.scrollTarget)?p:window,this.getReferencedVirtualElement=h,this.floatingUIOptions={...this.floatingUIOptions,...d},this.element.tabIndex=0,r&&(this.shouldShow=r),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(i,i.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&(0,l.rD)(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:i,middlewareData:o})=>{var n,s;if(this.isVisible&&!this.editor.isDestroyed&&this.element.isConnected){if((null==(n=o.hide)?void 0:n.referenceHidden)||(null==(s=o.hide)?void 0:s.escaped)){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=i,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:i}=e,o=i.selection.from!==i.selection.to;if(this.updateDelay>0&&o)return void this.handleDebouncedUpdate(e,t);let n=!(null==t?void 0:t.selection.eq(e.state.selection)),s=!(null==t?void 0:t.doc.eq(e.state.doc));this.updateHandler(e,n,s,t)}getShouldShow(e){var t;let{state:i}=this.view,{selection:o}=i,{ranges:n}=o,s=Math.min(...n.map(e=>e.$from.pos)),l=Math.max(...n.map(e=>e.$to.pos));return(null==(t=this.shouldShow)?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:i,oldState:e,from:s,to:l}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";let t="function"==typeof this.appendTo?this.appendTo():this.appendTo;null==(e=null!=t?t:this.view.dom.parentElement)||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){if(void 0!==e.updateDelay&&(this.updateDelay=e.updateDelay),void 0!==e.resizeDelay&&(this.resizeDelay=e.resizeDelay),void 0!==e.appendTo&&(this.appendTo=e.appendTo),void 0!==e.getReferencedVirtualElement&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),void 0!==e.shouldShow&&e.shouldShow&&(this.shouldShow=e.shouldShow),void 0!==e.options){var t;let i=null!=(t=e.options.scrollTarget)?t:window;i!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=i,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};let T=e=>new r.k_({key:"string"==typeof e.pluginKey?new r.hs(e.pluginKey):e.pluginKey,view:t=>new R({view:t,...e})});s.YY.create({name:"bubbleMenu",addOptions:()=>({element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[T({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var E=i("g5"),$=i("u"),z=i("llS"),H=class{getTextContent(e){return(0,s.q4)(e,{textSeri
1alizers:(0,s.iR)(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push((0,l.UU)("boolean"!=typeof this.floatingUIOptions.flip?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push((0,l.BN)("boolean"!=typeof this.floatingUIOptions.shift?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push((0,l.cY)("boolean"!=typeof this.floatingUIOptions.offset?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push((0,l.UE)(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push((0,l.Ej)("boolean"!=typeof this.floatingUIOptions.size?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push((0,l.RK)("boolean"!=typeof this.floatingUIOptions.autoPlacement?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push((0,l.jD)("boolean"!=typeof this.floatingUIOptions.hide?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push((0,l.mG)("boolean"!=typeof this.floatingUIOptions.inline?this.floatingUIOptions.inline:void 0)),e}constructor({editor:e,element:t,view:i,pluginKey:o="floatingMenu",updateDelay:n=250,resizeDelay:s=60,options:l,appendTo:r,shouldShow:a}){var h;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:i}=t,{$anchor:o,empty:n}=i,s=1===o.depth,l=o.parent.isTextblock&&!o.parent.type.spec.code&&!o.parent.textContent&&0===o.parent.childCount&&!this.getTextContent(o.parent);return!!e.hasFocus()&&!!n&&!!s&&!!l&&!!this.editor.isEditable},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,i,o)=>{let{composing:n}=e;if(!n&&(t||i)){if(!this.getShouldShow(o))return void this.hide();this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{var t;if(this.preventHide){this.preventHide=!1;return}(null==e?void 0:e.relatedTarget)&&(null==(t=this.element.parentNode)?void 0:t.contains(e.relatedTarget))||(null==e?void 0:e.relatedTarget)!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);"updatePosition"===t?this.updatePosition():t&&"object"==typeof t&&"updateOptions"===t.type?this.updateOptions(t.options):"hide"===t?this.hide():"show"===t&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=i,this.pluginKey=o,this.updateDelay=n,this.resizeDelay=s,this.appendTo=r,this.scrollTarget=null!=(h=null==l?void 0:l.scrollTarget)?h:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(i,i.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){var t;let{state:i}=this.view,{selection:o}=i,{ranges:n}=o,s=Math.min(...n.map(e=>e.$from.pos)),l=Math.max(...n.map(e=>e.$to.pos));return null==(t=this.shouldShow)?void 0:t.call(this,{editor:this.editor,view:this.view,state:i,oldState:e,from:s,to:l})}updateOptions(e){if(void 0!==e.updateDelay&&(this.updateDelay=e.updateDelay),void 0!==e.resizeDelay&&(this.resizeDelay=e.resizeDelay),void 0!==e.appendTo&&(this.appendTo=e.appendTo),void 0!==e.shouldShow&&e.shouldShow&&(this.shouldShow=e.shouldShow),void 0!==e.options){var t;let i=null!=(t=e.options.scrollTarget)?t:window;i!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=i,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!(null==(e=this.view)||null==(e=e.dom)?void 0:e.parentNode))return;let{selection:t}=this.editor.state,i=(0,s.MG)(this.view,t.from,t.to);(0,l.rD)({getBoundingClientRect:()=>i,getClientRects:()=>[i]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:i,middlewareData:o})=>{var n,s;if((null==(n=o.hide)?void 0:n.referenceHidden)||(null==(s=o.hide)?void 0:s.escaped)){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=i,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let i=!(null==t?void 0:t.selection.eq(e.state.selection)),o=!(null==t?void 0:t.doc.eq(e.state.doc));this.updateHandler(e,i,o,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";let t="function"==typeof this.appendTo?this.appendTo():this.appendTo;null==(e=null!=t?t:this.view.dom.parentElement)||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}};let M=e=>new r.k_({key:"string"==typeof e.pluginKey?new r.hs(e.pluginKey):e.pluginKey,view:t=>new H({view:t,...e})});function x(e,t){return null!=e?e:new r.hs(t)}s.YY.create({name:"floatingMenu",addOptions:()=>({element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}),addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[M({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});let P="u">typeof window?$.useLayoutEffect:$.useEffect,L=new Set(["left","opacity","position","top","visibility","width"]),N=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","o
1pacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),A=new Set(["children","className","style"]),k=new Set(["tabIndex"]),K=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),B={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function V(e,t){return/^on[A-Z]/.test(e)&&"function"==typeof t}function j(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function q(e,t,i){if("tabIndex"===t){e.tabIndex=Number(i);return}e[t]=i}function W(e,t){let i=(0,$.useRef)({}),o=(0,$.useRef)([]);P(()=>{var n,s,l;let r,a,h,d=i.current;return!function(e,t,i){if(t!==i){if(i){e.className=i;return}e.removeAttribute("class")}}(e,d.className,t.className),n=d.style,s=t.style,r=null!=n?n:{},a=null!=s?s:{},(new Set([...Object.keys(r),...Object.keys(a)])).forEach(t=>{let i=r[t],o=a[t];if(i!==o){if(null==o)return void(!L.has(t)&&e.style.removeProperty(j(t)));L.has(t)||e.style.setProperty(j(t),"number"!=typeof o||0===o||t.startsWith("--")||N.has(t)?String(o):`${o}px`)}}),(new Set([...Object.keys(d),...Object.keys(t)])).forEach(i=>{if(A.has(i)||!(i.startsWith("aria-")||i.startsWith("data-")||K.has(i))||V(i,d[i])||V(i,t[i]))return;let o=d[i],n=t[i];if(o===n)return;let s=(i.startsWith("aria-")||i.startsWith("data-"),i);if(null==n||!1===n){k.has(i)&&function(e,t){if("tabIndex"===t)return e.removeAttribute("tabindex");let i=e[t];if("boolean"==typeof i){e[t]=!1;return}if("number"==typeof i){e[t]=0;return}e[t]=""}(e,i),e.removeAttribute(s);return}if(!0===n){k.has(i)&&q(e,i,!0),e.setAttribute(s,"");return}k.has(i)?q(e,i,n):e.setAttribute(s,String(n))}),l=o.current,l.forEach(({eventName:t,listener:i,options:o})=>{e.removeEventListener(t,i,o)}),h=[],Object.entries(t).forEach(([t,i])=>{var o;let n,s;if(!V(t,i))return;let{eventName:l,options:r}={eventName:null!=(o=B[s=((n=t.endsWith("Capture"))?t.slice(0,-7):t).slice(2)])?o:s.toLowerCase(),options:n?{capture:!0}:void 0},a=t=>{let o,n,s;i((o=t.defaultPrevented,n=!1,Object.defineProperties(s=Object.create(t),{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>o},isPropagationStopped:{value:()=>n},preventDefault:{value:()=>{o=!0,t.preventDefault()}},stopPropagation:{value:()=>{n=!0,t.stopPropagation()}}}),s))};e.addEventListener(l,a,r),h.push({eventName:l,listener:a,options:r})}),o.current=h,i.current=t,()=>{o.current.forEach(({eventName:t,listener:i,options:o})=>{e.removeEventListener(t,i,o)}),o.current=[]}},[e,t])}let F=$.forwardRef(({pluginKey:e,editor:t,updateDelay:i,resizeDelay:o,appendTo:n,shouldShow:s=null,getReferencedVirtualElement:l,options:r,children:a,...h},d)=>{let p=(0,$.useRef)(document.createElement("div")),u=(0,$.useRef)(x(e,"bubbleMenu")).current;W(p.current,h),"function"==typeof d?d(p.current):d&&(d.current=p.current);let{editor:c}=(0,E.aA)(),f=t||c,m={updateDelay:i,resizeDelay:o,appendTo:n,pluginKey:u,shouldShow:s,getReferencedVirtualElement:l,options:r},g=(0,$.useRef)(m);g.current=m;let[w,v]=(0,$.useState)(!1),y=(0,$.useRef)(!0);return(0,$.useEffect)(()=>{if(null==f?void 0:f.isDestroyed)return;if(!f)return void console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");let e=p.current;e.style.visibility="hidden",e.style.position="absolute";let t=T({...g.current,editor:f,element:e});f.registerPlugin(t);let i=g.current.pluginKey;return y.current=!0,v(!0),()=>{v(!1),f.unregisterPlugin(i),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[f]),(0,$.useEffect)(()=>{if(w&&f&&!f.isDestroyed){if(y.current){y.current=!1;return}f.view.dispatch(f.state.tr.setMeta(u,{type:"updateOptions",options:g.current}))}},[w,f,i,o,s,r,n,l,u]),(0,z.createPortal)(a,p.current)});$.forwardRef(({pluginKey:e,editor:t,updateDelay:i,resizeDelay:o,appendTo:n,shouldShow:s=null,options:l,children:r,...a},h)=>{let d=(0,$.useRef)(document.createElement("div")),p=(0,$.useRef)(x(e,"floatingMenu")).current;W(d.current,a),"function"==typeof h?h(d.current):h&&(h.current=d.current);let{editor:u}=(0,E.aA)(),c=t||u,f={updateDelay:i,resizeDelay:o,appendTo:n,pluginKey:p,shouldShow:s,options:l},m=(0,$.useRef)(f);m.current=f;let[g,w]=(0,$.useState)(!1),v=(0,$.useRef)(!0);return(0,$.useEffect)(()=>
1{if(null==c?void 0:c.isDestroyed)return;if(!c)return void console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");let e=d.current;e.style.visibility="hidden",e.style.position="absolute";let t=M({...m.current,editor:c,element:e});c.registerPlugin(t);let i=m.current.pluginKey;return v.current=!0,w(!0),()=>{w(!1),c.unregisterPlugin(i),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[c]),(0,$.useEffect)(()=>{if(g&&c&&!c.isDestroyed){if(v.current){v.current=!1;return}c.view.dispatch(c.state.tr.setMeta(p,{type:"updateOptions",options:m.current}))}},[g,c,i,o,s,l,n,p]),(0,z.createPortal)(r,d.current)})}}]);
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.