${t.getColHeader(w-u)}`;else if(b)C=`${t.getRowHeader(d-h)} | `;else{const y=o[d][w],{hidden:E,rowspan:T,colspan:N}=t.getCellMeta(d-h,w-u);if(!E){const D=[];if(T&&D.push(`rowspan="${T}"`),N&&D.push(`colspan="${N}"`),Sn(y))C=` | `;else{const B=y.toString().replace("<","<").replace(">",">").replace(/(
(\r\n|\n)?|\r\n|\n)/g,`
\r
+`).replace(/\x20/gi," ").replace(/\t/gi," ");C=`${B} | `}}}g.push(C)}const m=["",...g,"
"].join("");f?l.splice(1,0,m):c.splice(-1,0,m)}return a.splice(1,0,l.join(""),c.join("")),a.join("")}function PH(t){const e=t.length,n=[""];for(let i=0;i");for(let a=0;a/g,">").replace(/(
(\r\n|\n)?|\r\n|\n)/g,`
\r
+`).replace(/\x20{2,}/gi,u=>`${" ".repeat(u.length-1)} `).replace(/\t/gi," ");s.push(`${c} | `)}n.push("",...s,"
"),i+1===e&&n.push("")}return n.push("
"),n.join("")}function wde(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;const n={},i=e.createDocumentFragment(),o=e.createElement("div");i.appendChild(o);let r=t;if(typeof r=="string"){const y=r.replace(/]*?>([\s\S]*?)<\/\s*td>/g,E=>{const T=E.match(/ | ]*?>/g)[0],N=//g,D=E.substring(T.length,E.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(N,`
+`).replace(`
+`,"").replaceAll(/<\/(.*)>\s+$/mg,"$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^ $/mg,"");return`${T}${D} | `});o.insertAdjacentHTML("afterbegin",`${y}`),r=o.querySelector("table")}if(!r||!pde(r))return;const s=o.querySelector('meta[name$="enerator"]'),a=r.querySelector("tbody th")!==null,l=r.querySelector("tr"),c=l?Array.from(l.cells).reduce((y,E)=>y+E.colSpan,0)-(a?1:0):0,u=r.tFoot&&Array.from(r.tFoot.rows)||[],h=[];let d=!1,f=0,g=0;if(r.tHead){const y=Array.from(r.tHead.rows).filter(E=>{const T=E.querySelector("td")!==null;return T&&h.push(E),!T});f=y.length,d=f>0,f>1?n.nestedHeaders=Array.from(y).reduce((E,T)=>{const N=Array.from(T.cells).reduce((D,B,K)=>{if(a&&K===0)return D;const{colSpan:q,innerHTML:J}=B,ee=q>1?{label:J,colspan:q}:J;return D.push(ee),D},[]);return E.push(N),E},[]):d&&(n.colHeaders=Array.from(y[0].children).reduce((E,T,N)=>(a&&N===0||E.push(T.innerHTML),E),[]))}h.length&&(n.fixedRowsTop=h.length),u.length&&(n.fixedRowsBottom=u.length);const m=[...h,...Array.from(r.tBodies).reduce((y,E)=>(y.push(...Array.from(E.rows)),y),[]),...u];g=m.length;const w=new Array(g);for(let y=0;yge===void 0);if(K==="TD"){if(J>1||ee>1){for(let he=y;he[\r\n]?[\x20]{0,3}/gim,`\r
+`):ge=q.replace(/
[\r\n]?/gim,`\r
+`),w[y][se]=ge.replace(mde,me=>dB[me])}else C.push(q)}}return b.length&&(n.mergeCells=b),C.length&&(n.rowHeaders=C),w.length&&(n.data=w),n}function bde(t,e){fB(t,e),e.add(t)}function Xa(t,e,n){fB(t,e),e.set(t,n)}function fB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yf(t,e,n){return(e=vde(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vde(t){var e=yde(t,"string");return typeof e=="symbol"?e:e+""}function yde(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xi(t,e){return t.get(Zi(t,e))}function dr(t,e,n){return t.set(Zi(t,e),n),n}function Zi(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}Ee.getSingleton().register("afterCopyLimit");Ee.getSingleton().register("modifyCopyableRange");Ee.getSingleton().register("beforeCut");Ee.getSingleton().register("afterCut");Ee.getSingleton().register("beforePaste");Ee.getSingleton().register("afterPaste");Ee.getSingleton().register("beforeCopy");Ee.getSingleton().register("afterCopy");const Nw="copyPaste",Cde=80,Sde=["fragmentSelection"],OH=['',''].join("");var wx=new WeakMap,bx=new WeakMap,vx=new WeakMap,sh=new WeakMap,Dw=new WeakMap,Lw=new WeakMap,ah=new WeakMap,wy=new WeakMap,co=new WeakSet;class _de extends St{constructor(){super(...arguments),bde(this,co),yf(this,"columnsLimit",1/0),yf(this,"rowsLimit",1/0),yf(this,"pasteMode","overwrite"),yf(this,"uiContainer",this.hot.rootDocument.body),Xa(this,wx,!1),Xa(this,bx,!1),Xa(this,vx,!1),Xa(this,sh,"cells-only"),Xa(this,Dw,!1),Xa(this,Lw,!1),Xa(this,ah,new Lhe({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),Xa(this,wy,!1),yf(this,"copyableRanges",[])}static get PLUGIN_KEY(){return Nw}static get SETTING_KEYS(){return[Nw,...Sde]}static get PLUGIN_PRIORITY(){return Cde}isEnabled(){return!!this.hot.getSettings()[Nw]}enablePlugin(){var e=this;if(this.enabled)return;const{[Nw]:n}=this.hot.getSettings();if(typeof n=="object"){var i,o;this.pasteMode=(i=n.pasteMode)!==null&&i!==void 0?i:this.pasteMode,this.rowsLimit=isNaN(n.rowsLimit)?this.rowsLimit:n.rowsLimit,this.columnsLimit=isNaN(n.columnsLimit)?this.columnsLimit:n.columnsLimit,dr(wx,this,!!n.copyColumnHeaders),dr(bx,this,!!n.copyColumnGroupHeaders),dr(vx,this,!!n.copyColumnHeadersOnly),this.uiContainer=(o=n.uiContainer)!==null&&o!==void 0?o:this.uiContainer}this.addHook("afterContextMenuDefaultOptions",r=>Zi(co,this,Ede).call(this,r)),this.addHook("afterSelection",function(){for(var r=arguments.length,s=new Array(r),a=0;aZi(co,this,Mde).call(this)),this.eventManager.addEventListener(this.hot.rootDocument,"copy",function(){return e.onCopy(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"cut",function(){return e.onCut(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"paste",function(){return e.onPaste(...arguments)}),MV()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",function(){for(var r=arguments.length,s=new Array(r),a=0;aZi(co,this,Ide).call(this))),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin()}copy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"cells-only";dr(sh,this,e),dr(Dw,this,!0),Zi(co,this,IH).call(this,"copy")}copyCellsOnly(){this.copy("cells-only")}copyColumnHeadersOnly(){this.copy("column-headers-only")}copyWithAllColumnHeaders(){this.copy("with-column-group-headers")}copyWithColumnHeaders(){this.copy("with-column-headers")}cut(){dr(Lw,this,!0),Zi(co,this,IH).call(this,"cut")}getRangedCopyableData(e){return Ag(this.getRangedData(e))}getRangedData(e){const n=[],{rows:i,columns:o}=hB(e);return F(i,r=>{const s=[];F(o,a=>{r<0?s.push(this.hot.getColHeader(a,r)):s.push(this.hot.getCopyableData(r,a))}),n.push(s)}),n}paste(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;if(!e&&!n)return;const i=new Nhe;e&&i.clipboardData.setData("text/plain",e),n&&i.clipboardData.setData("text/html",n),this.onPaste(i)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}Xi(ah,this).setSelectedRange(e);const n=new Map([["headers",null],["cells",null]]);Xi(sh,this)==="column-headers-only"?n.set("headers",Xi(ah,this).getMostBottomColumnHeadersRange()):(Xi(sh,this)==="with-column-headers"?n.set("headers",Xi(ah,this).getMostBottomColumnHeadersRange()):Xi(sh,this)==="with-column-group-headers"&&n.set("headers",Xi(ah,this).getAllColumnHeadersRange()),n.set("cells",Xi(ah,this).getCellsRange())),this.copyableRanges=Array.from(n.values()).filter(o=>o!==null).map(o=>{let{startRow:r,startCol:s,endRow:a,endCol:l}=o;return{startRow:r,startCol:s,endRow:a,endCol:l}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const i=n.get("cells");if(i!==null&&i.isRangeTrimmed){const{startRow:o,startCol:r,endRow:s,endCol:a}=i;this.hot.runHooks("afterCopyLimit",s-o+1,a-r+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){var e;return(e=this.hot.getActiveEditor())===null||e===void 0?void 0:e.isOpened()}populateValues(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.hot.getSelectedRangeLast();if(!e.length)return;const i=e.length,o=e[0].length,r=[],{row:s,col:a}=n.getTopStartCorner(),{row:l,col:c}=n.getBottomEndCorner();let u=s,h=a,d=s,f=a;for(;r.length"u"&&this.hot.rootWindow.clipboardData.setData("Text",l);this.hot.runHooks("afterCopy",r,this.copyableRanges,s)}dr(sh,this,"cells-only")}onCut(e){var n;const i=this.hot.getFocusManager().getRefocusElement(),o=(n=e.target)===null||n===void 0?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!Xi(Lw,this)||this.isEditorOpened()||e.target instanceof HTMLElement&&(o&&e.target!==i||!o&&e.target!==this.hot.rootDocument.body))return;e.preventDefault(),this.setCopyableText(),dr(Lw,this,!1);const r=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",r,this.copyableRanges)){const a=Ag(r);if(e&&e.clipboardData){const l=PH(r,this.hot.rootDocument);e.clipboardData.setData("text/plain",a),e.clipboardData.setData("text/html",[OH,l].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",a);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",r,this.copyableRanges)}}onPaste(e){var n;const i=this.hot.getFocusManager().getRefocusElement(),o=(n=e.target)===null||n===void 0?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||e.target instanceof HTMLElement&&(o&&e.target!==i||!o&&e.target!==this.hot.rootDocument.body))return;e.preventDefault();let r;if(e&&typeof e.clipboardData<"u"){const u=dT(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});u&&/("u"&&typeof this.hot.rootWindow.clipboardData<"u"&&(r=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof r=="string"&&(r=Mhe(r)),r===void 0||r&&r.length===0||this.hot.runHooks("beforePaste",r,this.copyableRanges)===!1)return;const[s,a,l,c]=this.populateValues(r);this.hot.selectCell(s,a,Math.min(this.hot.countRows()-1,l),Math.min(this.hot.countCols()-1,c)),this.hot.runHooks("afterPaste",r,this.copyableRanges)}destroy(){super.destroy()}}function IH(t){if(MV()){const e=this.hot.getSelectedRangeLast();if(e){const{row:n,col:i}=e.highlight,o=this.hot.getCell(n,i,!0);o&&Eee(o,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function Rde(t){const{rows:e}=hB(t);let n=0;for(let i=0;i=0);i++)n+=1;return{columnHeadersCount:n}}function xde(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:n}=t.highlight,i=this.hot.getCell(e,n,!0);i&&RV(i)}}}function gB(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:n}=t.highlight,i=this.hot.getCell(e,n,!0);i!=null&&i.hasAttribute("contenteditable")&&xV(i)}}}function Ede(t){t.items.push({name:"---------"},Phe(this)),Xi(wx,this)&&t.items.push(Ahe(this)),Xi(bx,this)&&t.items.push(Ihe(this)),Xi(vx,this)&&t.items.push(Ohe(this)),t.items.push(Hhe(this))}function Tde(t,e,n,i,o){Xi(wy,this)&&(o.value=!0),dr(wy,this,!1)}function Mde(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function Pde(){Zi(co,this,gB).call(this)}function Ode(){Zi(co,this,xde).call(this)}function Ide(){Zi(co,this,gB).call(this)}function mB(t,e){return`border_row${t}col${e}`}function rg(){return{width:1,color:"#000"}}function xa(){return{hide:!0}}function Ade(){return{width:1,color:"#000",cornerVisible:!1}}function z0(t){if(Te(t.start)||Te(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(Te(t.end)||Te(t.right)){var n;t.end=(n=t.end)!==null&&n!==void 0?n:t.right}return delete t.left,delete t.right,t}function Cf(t){return Te(t.start)&&(t.left=t.start),Te(t.end)&&(t.right=t.end),t}function Y0(t,e){return{id:mB(t,e),border:Ade(),row:t,col:e,top:xa(),bottom:xa(),start:xa(),end:xa()}}function Hde(t,e){return pn(e,"border")&&e.border&&(t.border=e.border),pn(e,"top")&&Te(e.top)&&(e.top?(Xe(e.top)||(e.top=rg()),t.top=e.top):(e.top=xa(),t.top=e.top)),pn(e,"bottom")&&Te(e.bottom)&&(e.bottom?(Xe(e.bottom)||(e.bottom=rg()),t.bottom=e.bottom):(e.bottom=xa(),t.bottom=e.bottom)),pn(e,"start")&&Te(e.start)&&(e.start?(Xe(e.start)||(e.start=rg()),t.start=e.start):(e.start=xa(),t.start=e.start)),pn(e,"end")&&Te(e.end)&&(e.end?(Xe(e.end)||(e.end=rg()),t.end=e.end):(e.end=xa(),t.end=e.end)),t}function Na(t,e){let n=!1;return F(t.getSelectedRange(),i=>{i.forAll((o,r)=>{if(o<0||r<0)return;const s=t.getCellMeta(o,r).borders;if(s)if(e){if(!pn(s[e],"hide")||s[e].hide===!1)return n=!0,!1}else return n=!0,!1})}),n}function tS(t){return`✓${t}`}function kde(t){return t.some(e=>Te(e.left)||Te(e.right))}function Nde(t){return t.some(e=>Te(e.start)||Te(e.end))}const Dde=new Map([["left","start"],["right","end"]]);function Lde(t){var e;return(e=Dde.get(t))!==null&&e!==void 0?e:t}function $de(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(n1);return Na(this,"bottom")&&(e=tS(e)),e},callback(e,n){const i=Na(this,"bottom");t.prepareBorder(n,"bottom",i)}}}function Fde(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let n=this.getTranslatedPhrase(i1);return Na(this,e)&&(n=tS(n)),n},callback(n,i){const o=Na(this,e);t.prepareBorder(i,e,o)}}}function Vde(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(o1)},callback(e,n){t.prepareBorder(n,"noBorders")},disabled(){return!Na(this)}}}function Wde(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let n=this.getTranslatedPhrase(t1);return Na(this,e)&&(n=tS(n)),n},callback(n,i){const o=Na(this,e);t.prepareBorder(i,e,o)}}}function Bde(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(e1);return Na(this,"top")&&(e=tS(e)),e},callback(e,n){const i=Na(this,"top");t.prepareBorder(n,"top",i)}}}function jde(t,e,n){return(e=Ude(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ude(t){var e=zde(t,"string");return typeof e=="symbol"?e:e+""}function zde(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ja extends _W{constructor(e,n){super(e,null),jde(this,"visualCellRange",null),this.visualCellRange=n||null,this.commit()}add(e){return this.visualCellRange===null?this.visualCellRange=this.settings.createCellRange(e):this.visualCellRange.expand(e),this}clear(){return this.visualCellRange=null,super.clear()}trimToVisibleCellsRangeOnly(e){let{from:n,to:i}=e,o=this.getNearestNotHiddenCoords(n,1),r=this.getNearestNotHiddenCoords(i,-1);return o===null||r===null?null:((o.row>r.row||o.col>r.col)&&(o=n,r=i),this.settings.createCellRange(o,o,r))}getNearestNotHiddenCoords(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n;const o=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,n);if(o===null)return null;const r=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,i);return r===null?null:this.settings.createCellCoords(o,r)}getNearestNotHiddenIndex(e,n,i){return n<0?n:e.getNearestNotHiddenIndex(n,i)}commit(){if(this.visualCellRange===null)return this;const e=this.trimToVisibleCellsRangeOnly(this.visualCellRange);return e===null?this.cellRange=null:this.cellRange=this.createRenderableCellRange(e.from,e.to),this}syncWith(e){const n=e.from.clone().normalize(),i=e.getVerticalDirection()==="N-S"?1:-1,o=e.getHorizontalDirection()==="W-E"?1:-1,r=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let s=null;if((r===null||r.col===null||r.row===null)&&(s=this.getNearestNotHiddenCoords(n,i,o)),s!==null&&e.overlaps(s)){const a=e.highlight.clone();if(a.row>=0&&(a.row=s.row),a.col>=0&&(a.col=s.col),this.cellRange===null){const l=this.settings.visualToRenderableCoords(a);this.cellRange=this.settings.createCellRange(l)}e.setHighlight(a)}return this.settings.selectionType==="focus"&&r!==null&&s===null&&e.setHighlight(this.visualCellRange.highlight),this}getCorners(){const{from:e,to:n}=this.cellRange;return[Math.min(e.row,n.row),Math.min(e.col,n.col),Math.max(e.row,n.row),Math.max(e.col,n.col)]}getVisualCorners(){const e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),n=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,n.row,n.col]}createRenderableCellRange(e,n){const i=this.settings.visualToRenderableCoords(e),o=this.settings.visualToRenderableCoords(n);return i.row===null||i.col===null||o.row===null||o.col===null?null:this.settings.createCellRange(i,i,o)}}function G0(t){let{activeHeaderClassName:e,...n}=t;return new ja({className:e,...n,selectionType:RW})}function Yde(t){let{areaCornerVisible:e,...n}=t;return new ja({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...n,selectionType:cM})}function Gde(t){let{...e}=t;return new ja({className:"highlight",...e,selectionType:cM})}function Kde(t){let{columnClassName:e,...n}=t;return new ja({className:e,...n,selectionType:Vse})}function qde(t){let{cellCornerVisible:e,...n}=t;return new ja({className:"current",headerAttributes:[gT()],border:{width:2,color:"#4b89ff",cornerVisible:e},...n,selectionType:uM})}function Xde(t){let{border:e,visualCellRange:n,...i}=t;return new ja({...e,...i,selectionType:Wse},n)}function Zde(t){let{...e}=t;return new ja({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:$se})}function AH(t){let{headerClassName:e,...n}=t;return new ja({className:e,...n,selectionType:lM})}function Jde(t){let{rowClassName:e,...n}=t;return new ja({className:e,...n,selectionType:Fse})}function Qde(t,e){efe(t,e),e.add(t)}function efe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ji(t,e,n){return(e=tfe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tfe(t){var e=nfe(t,"string");return typeof e=="symbol"?e:e+""}function nfe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qs(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Xr=new WeakSet;class ife{constructor(e){Qde(this,Xr),ji(this,"options",void 0),ji(this,"layerLevel",0),ji(this,"focus",void 0),ji(this,"fill",void 0),ji(this,"layeredAreas",new Map),ji(this,"areas",new Map),ji(this,"rowHeaders",new Map),ji(this,"columnHeaders",new Map),ji(this,"activeRowHeaders",new Map),ji(this,"activeColumnHeaders",new Map),ji(this,"activeCornerHeaders",new Map),ji(this,"rowHighlights",new Map),ji(this,"columnHighlights",new Map),ji(this,"customSelections",[]),this.options=e,this.focus=qde(e),this.fill=Zde(e)}isEnabledFor(e,n){let i=e;e===uM&&(i="current");let o=this.options.disabledCellSelection(n.row,n.col);return typeof o=="string"&&(o=[o]),o===!1||Array.isArray(o)&&!o.includes(i)}useLayerLevel(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.layerLevel=e,this}getFocus(){return this.focus}getFill(){return this.fill}createLayeredArea(){return Qs(Xr,this,ea).call(this,this.layeredAreas,Yde)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return Qs(Xr,this,ea).call(this,this.areas,Gde)}getAreas(){return[...this.areas.values()]}createRowHeader(){return Qs(Xr,this,ea).call(this,this.rowHeaders,AH)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return Qs(Xr,this,ea).call(this,this.columnHeaders,AH)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return Qs(Xr,this,ea).call(this,this.activeRowHeaders,G0)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return Qs(Xr,this,ea).call(this,this.activeColumnHeaders,G0)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return Qs(Xr,this,ea).call(this,this.activeCornerHeaders,G0)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return Qs(Xr,this,ea).call(this,this.rowHighlights,Jde)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return Qs(Xr,this,ea).call(this,this.columnHighlights,Kde)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(Xde({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),F(this.areas.values(),e=>void e.clear()),F(this.layeredAreas.values(),e=>void e.clear()),F(this.rowHeaders.values(),e=>void e.clear()),F(this.columnHeaders.values(),e=>void e.clear()),F(this.activeRowHeaders.values(),e=>void e.clear()),F(this.activeColumnHeaders.values(),e=>void e.clear()),F(this.activeCornerHeaders.values(),e=>void e.clear()),F(this.rowHighlights.values(),e=>void e.clear()),F(this.columnHighlights.values(),e=>void e.clear())}[Symbol.iterator](){return[this.focus,this.fill,...this.areas.values(),...this.layeredAreas.values(),...this.rowHeaders.values(),...this.columnHeaders.values(),...this.activeRowHeaders.values(),...this.activeColumnHeaders.values(),...this.activeCornerHeaders.values(),...this.rowHighlights.values(),...this.columnHighlights.values(),...this.customSelections][Symbol.iterator]()}}function ea(t,e){const n=this.layerLevel;if(t.has(n))return t.get(n);const i=e({layerLevel:n,...this.options});return t.set(n,i),i}function HH(t,e,n){return(e=ofe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ofe(t){var e=rfe(t,"string");return typeof e=="symbol"?e:e+""}function rfe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sfe{constructor(e){HH(this,"ranges",[]),HH(this,"createCellRange",void 0),this.createCellRange=e}isEmpty(){return this.size()===0}set(e){return this.clear(),this.ranges.push(this.createCellRange(e)),this}add(e){return this.ranges.push(this.createCellRange(e)),this}pop(){return this.ranges.pop(),this}current(){return this.peekByIndex(this.size()-1)}previous(){return this.peekByIndex(this.size()-2)}includes(e){return this.ranges.some(n=>n.includes(e))}clear(){return this.ranges.length=0,this}size(){return this.ranges.length}peekByIndex(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n;return e>=0&&e2&&arguments[2]!==void 0?arguments[2]:!1;const o=ut(jt,this).createCellCoords(e,n);let r=ut(Fw,this).current().highlight;const s=ut(jt,this).visualToRenderableCoords(r);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",o),s.row!==null&&s.col!==null){const{width:c,height:u}=In($n,this,wB).call(this),{row:h,col:d}=In($n,this,NH).call(this,r),f=ut(jt,this).fixedRowsBottom(),g=ut(jt,this).minSpareRows(),m=ut(jt,this).minSpareCols(),w=ut(jt,this).autoWrapRow(),b=ut(jt,this).autoWrapCol(),C=ut(jt,this).createCellCoords(h+o.row,d+o.col);if(C.row>=u){const T=Rr(i&&g>0&&f===0),N=C.col+1,D=ut(jt,this).createCellCoords(C.row-u,N>=c?N-c:N);this.runLocalHooks("beforeColumnWrap",T,In($n,this,lh).call(this,D),N>=c),T.value?this.runLocalHooks("insertRowRequire",ut(jt,this).countRenderableRows()):b&&C.assign(D)}else if(C.row<0){const T=Rr(b),N=C.col-1,D=ut(jt,this).createCellCoords(u+C.row,N<0?c+N:N);this.runLocalHooks("beforeColumnWrap",T,In($n,this,lh).call(this,D),N<0),b&&C.assign(D)}if(C.col>=c){const T=Rr(i&&m>0),N=C.row+1,D=ut(jt,this).createCellCoords(N>=u?N-u:N,C.col-c);this.runLocalHooks("beforeRowWrap",T,In($n,this,lh).call(this,D),N>=u),T.value?this.runLocalHooks("insertColRequire",ut(jt,this).countRenderableColumns()):w&&C.assign(D)}else if(C.col<0){const T=Rr(w),N=C.row-1,D=ut(jt,this).createCellCoords(N<0?u+N:N,c+C.col);this.runLocalHooks("beforeRowWrap",T,In($n,this,lh).call(this,D),N<0),w&&C.assign(D)}const{rowDir:y,colDir:E}=In($n,this,kH).call(this,C);a=y,l=E,r=In($n,this,lh).call(this,C)}return this.runLocalHooks("afterTransformStart",r,a,l),r}transformEnd(e,n){const i=ut(jt,this).createCellCoords(e,n),o=ut(Fw,this).current(),r=ut(jt,this).visualToRenderableCoords(o.highlight),s=In($n,this,q0).call(this,o.to.row,o.from.row),a=In($n,this,X0).call(this,o.to.col,o.from.col),l=o.to.clone();let c=0,u=0;if(this.runLocalHooks("beforeTransformEnd",i),r.row!==null&&r.col!==null&&s!==null&&a!==null){const{row:h,col:d}=In($n,this,NH).call(this,o.highlight),f=ut(jt,this).createCellCoords(s+i.row,a+i.col),g=o.getTopStartCorner(),m=o.getTopEndCorner(),w=o.getBottomEndCorner();if(i.col<0&&a>=d&&f.col0&&a<=d&&f.col>d){const E=In($n,this,X0).call(this,m.col,g.col),T=Math.max(f.col-E,1);f.col=E+T}if(i.row<0&&s>=h&&f.row0&&s<=h&&f.row>h){const E=In($n,this,q0).call(this,w.row,g.row),T=Math.max(f.row-E,1);f.row=E+T}const{rowDir:b,colDir:C}=In($n,this,kH).call(this,f);c=b,u=C;const y=In($n,this,lh).call(this,f);i.row===0&&i.col!==0?l.col=y.col:i.row!==0&&i.col===0?l.row=y.row:(l.row=y.row,l.col=y.col)}return this.runLocalHooks("afterTransformEnd",l,c,u),l}setOffsetSize(e){let{x:n,y:i}=e;$w(Tr,this,{x:n,y:i})}resetOffsetSize(){$w(Tr,this,{x:0,y:0})}}function kH(t){const{width:e,height:n}=In($n,this,wB).call(this);let i=0,o=0;return t.row<0?(i=-1,t.row=0):t.row>0&&t.row>=n&&(i=1,t.row=n-1),t.col<0?(o=-1,t.col=0):t.col>0&&t.col>=e&&(o=1,t.col=e-1),{rowDir:i,colDir:o}}function wB(){return{width:ut(Tr,this).x+ut(jt,this).countRenderableColumns(),height:ut(Tr,this).y+ut(jt,this).countRenderableRows()}}function q0(t,e){const n=ut(jt,this).findFirstNonHiddenRenderableRow(t,e);return n===null?null:ut(Tr,this).y+n}function X0(t,e){const n=ut(jt,this).findFirstNonHiddenRenderableColumn(t,e);return n===null?null:ut(Tr,this).x+n}function NH(t){const{row:e,col:n}=ut(jt,this).visualToRenderableCoords(t);if(e===null||n===null)throw new Error("Renderable coords are not visible.");return ut(jt,this).createCellCoords(ut(Tr,this).y+e,ut(Tr,this).x+n)}function lh(t){const e=t.clone();return e.col=t.col-ut(Tr,this).x,e.row=t.row-ut(Tr,this).y,ut(jt,this).renderableToVisualCoords(e)}Ht(yx,li);function ch(t,e,n){lfe(t,e),e.set(t,n)}function lfe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bc(t,e,n){return(e=cfe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cfe(t){var e=ufe(t,"string");return typeof e=="symbol"?e:e+""}function ufe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zt(t,e){return t.get(bB(t,e))}function Zr(t,e,n){return t.set(bB(t,e),n),n}function bB(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var di=new WeakMap,vc=new WeakMap,Vw=new WeakMap,Sf=new WeakMap,Ww=new WeakMap,_f=new WeakMap;class vB{constructor(e,n){var i=this;bc(this,"settings",void 0),bc(this,"tableProps",void 0),bc(this,"inProgress",!1),bc(this,"selectedRange",new sfe((o,r,s)=>this.tableProps.createCellRange(o,r,s))),bc(this,"highlight",void 0),ch(this,di,void 0),ch(this,vc,void 0),bc(this,"selectedByRowHeader",new Set),bc(this,"selectedByColumnHeader",new Set),ch(this,Vw,!1),ch(this,Sf,!1),ch(this,Ww,"unknown"),ch(this,_f,-1),this.settings=e,this.tableProps=n,this.highlight=new ife({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[gT()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(o,r)=>this.tableProps.isDisabledCellSelection(o,r),cellCornerVisible:function(){return i.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return i.isAreaCornerVisible(...arguments)},visualToRenderableCoords:o=>this.tableProps.visualToRenderableCoords(o),renderableToVisualCoords:o=>this.tableProps.renderableToVisualCoords(o),createCellCoords:(o,r)=>this.tableProps.createCellCoords(o,r),createCellRange:(o,r,s)=>this.tableProps.createCellRange(o,r,s)}),Zr(di,this,new yx(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>this.tableProps.countRenderableRows(),countRenderableColumns:()=>this.tableProps.countRenderableColumns(),visualToRenderableCoords:o=>this.tableProps.visualToRenderableCoords(o),renderableToVisualCoords:o=>this.tableProps.renderableToVisualCoords(o),findFirstNonHiddenRenderableRow:function(){return i.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return i.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(o,r)=>this.tableProps.createCellCoords(o,r),fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),Zr(vc,this,new yx(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>{const o=this.selectedRange.current();return this.tableProps.countRenderableRowsInRange(0,o.getOuterBottomEndCorner().row)},countRenderableColumns:()=>{const o=this.selectedRange.current();return this.tableProps.countRenderableColumnsInRange(0,o.getOuterBottomEndCorner().col)},visualToRenderableCoords:o=>this.tableProps.visualToRenderableCoords(o),renderableToVisualCoords:o=>this.tableProps.renderableToVisualCoords(o),findFirstNonHiddenRenderableRow:function(){return i.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return i.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(o,r)=>this.tableProps.createCellCoords(o,r),fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),Zt(di,this).addLocalHook("beforeTransformStart",function(){for(var o=arguments.length,r=new Array(o),s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e;const r=this.settings.selectionMode==="multiple",s=Gt(n)?this.tableProps.getShortcutManager().isCtrlPressed():n,a=e.clone();Zr(Vw,this,!1),this.runLocalHooks(`beforeSetRangeStart${i?"Only":""}`,a),(!r||r&&!s&&Gt(n))&&this.selectedRange.clear(),this.selectedRange.add(a).current().setHighlight(o.clone()),this.getLayerLevel()===0&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),i||this.setRangeEnd(e)}setRangeStartOnly(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.setRangeStart(e,n,!0,i)}setRangeEnd(e){if(this.selectedRange.isEmpty())return;const n=e.clone(),i=this.tableProps.countRows(),o=this.tableProps.countCols(),r=this.selectedRange.current().clone().setTo(e).isSingleHeader();if((i>0||o>0)&&(i===0&&n.col<0&&!r||o===0&&n.row<0&&!r))return;this.runLocalHooks("beforeSetRangeEnd",n),this.begin();const s=this.selectedRange.current();if(this.settings.navigableHeaders||s.highlight.normalize(),this.settings.selectionMode==="single")s.setFrom(s.highlight),s.setTo(s.highlight);else{const l=s.getHorizontalDirection(),c=s.getVerticalDirection(),u=this.isMultiple();s.setTo(n),u&&(l!==s.getHorizontalDirection()||s.getWidth()===1&&!s.includes(s.highlight))&&s.from.assign({col:s.highlight.col}),u&&(c!==s.getVerticalDirection()||s.getHeight()===1&&!s.includes(s.highlight))&&s.from.assign({row:s.highlight.row})}i>0&&o>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!s.isSingleHeader())&&s.to.normalize(),this.runLocalHooks("beforeHighlightSet"),this.setRangeFocus(this.selectedRange.current().highlight),this.applyAndCommit();const a=Zt(_f,this)===-1||this.selectedRange.size()===Zt(_f,this);this.runLocalHooks("afterSetRangeEnd",e,a)}applyAndCommit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.selectedRange.current(),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLayerLevel();const i=this.tableProps.countRows(),o=this.tableProps.countCols();nvoid g.clear()),F(this.highlight.getLayeredAreas(),g=>void g.clear()),F(this.highlight.getRowHeaders(),g=>void g.clear()),F(this.highlight.getColumnHeaders(),g=>void g.clear()),F(this.highlight.getActiveRowHeaders(),g=>void g.clear()),F(this.highlight.getActiveColumnHeaders(),g=>void g.clear()),F(this.highlight.getActiveCornerHeaders(),g=>void g.clear()),F(this.highlight.getRowHighlights(),g=>void g.clear()),F(this.highlight.getColumnHighlights(),g=>void g.clear())),this.highlight.useLayerLevel(n);const r=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),c=this.highlight.createActiveRowHeader(),u=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();if(r.clear(),s.clear(),a.clear(),l.clear(),c.clear(),u.clear(),h.clear(),d.clear(),f.clear(),this.highlight.isEnabledFor(cM,e.highlight)&&(this.isMultiple()||n>=1)&&(r.add(e.from).add(e.to).commit(),s.add(e.from).add(e.to).commit(),n===1)){const g=this.selectedRange.previous();this.highlight.useLayerLevel(n-1),this.highlight.createArea().add(g.from).commit().syncWith(g),this.highlight.createLayeredArea().add(g.from).commit().syncWith(g),this.highlight.useLayerLevel(n)}if(this.highlight.isEnabledFor(lM,e.highlight)){if(!e.isSingleHeader()){const w=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),b=this.tableProps.createCellCoords(e.to.row,-1),C=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),y=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(a.add(w).commit(),l.add(C).commit(),d.add(w).commit(),f.add(C).commit()):(a.add(w).add(b).commit(),l.add(C).add(y).commit(),d.add(w).add(b).commit(),f.add(C).add(y).commit())}const g=!Zt(Sf,this)&&this.isEntireRowSelected()&&(o>0&&o===e.getWidth()||o===0&&this.isSelectedByRowHeader()),m=!Zt(Sf,this)&&this.isEntireColumnSelected()&&(i>0&&i===e.getHeight()||i===0&&this.isSelectedByColumnHeader());g&&c.add(this.tableProps.createCellCoords(Math.max(e.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))).add(this.tableProps.createCellCoords(Math.max(e.to.row,0),-1)).commit(),m&&u.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(),-1),Math.max(e.from.col,0))).add(this.tableProps.createCellCoords(-1,Math.max(e.to.col,0))).commit(),g&&m&&h.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}}setRangeFocus(e){if(this.selectedRange.isEmpty())return;const n=this.selectedRange.current();this.inProgress||this.runLocalHooks("beforeSetFocus",e);const i=this.highlight.getFocus();i.clear(),n.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(uM,n.highlight)&&i.add(n.highlight).commit().syncWith(n),this.inProgress||(Zr(Vw,this,!0),this.runLocalHooks("afterSetFocus",n.highlight))}transformStart(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.settings.navigableHeaders?Zt(di,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):Zt(di,this).resetOffsetSize(),this.setRangeStart(Zt(di,this).transformStart(e,n,i))}transformEnd(e,n){this.settings.navigableHeaders?Zt(di,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):Zt(di,this).resetOffsetSize(),this.setRangeEnd(Zt(di,this).transformEnd(e,n))}transformFocus(e,n){const i=this.selectedRange.current(),{row:o,col:r}=i.getOuterTopStartCorner(),s=this.tableProps.countRenderableColumnsInRange(0,r-1),a=this.tableProps.countRenderableRowsInRange(0,o-1);i.highlight.isHeader()?Zt(vc,this).setOffsetSize({x:r<0?Math.abs(r):-s,y:o<0?Math.abs(o):-a}):Zt(vc,this).setOffsetSize({x:r<0?0:-s,y:o<0?0:-a});const l=Zt(vc,this).transformStart(e,n);this.setRangeFocus(l.normalize())}shiftRows(e,n){if(!this.isSelected())return;const i=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||i.getOuterTopStartCorner().row>=e){const{from:o,to:r,highlight:s}=i,a=this.tableProps.countRows(),l=this.isSelectedByRowHeader(),c=this.isSelectedByColumnHeader(),u=c?-1:0,h=c?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(Pt(o.row+h,u,a-1),o.col),f=this.tableProps.createCellCoords(Pt(r.row+n,u,a-1),r.col);this.markSource("shift"),s.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(Pt(s.row+n,0,a-1),s.col)):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),c&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}shiftColumns(e,n){if(!this.isSelected())return;const i=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||i.getOuterTopStartCorner().col>=e){const{from:o,to:r,highlight:s}=i,a=this.tableProps.countCols(),l=this.isSelectedByRowHeader(),c=this.isSelectedByColumnHeader(),u=l?-1:0,h=l?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(o.row,Pt(o.col+h,u,a-1)),f=this.tableProps.createCellCoords(r.row,Pt(r.col+n,u,a-1));this.markSource("shift"),s.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(s.row,Pt(s.col+n,0,a-1))):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),c&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){if(!this.isSelected())return!1;const e=Rr(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&Zt(Vw,this)}isSelectedByRowHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner(e)&&(e===-1?this.selectedByRowHeader.size>0:this.selectedByRowHeader.has(e))}isEntireRowSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const n=o=>{const{col:r}=o.getOuterTopStartCorner(),s=this.tableProps.countRowHeaders(),a=this.tableProps.countCols();return(s>0&&r<0||s===0)&&o.getWidth()===a};if(e===-1)return Array.from(this.selectedRange).some(o=>n(o));const i=this.selectedRange.peekByIndex(e);return i?n(i):!1}isSelectedByColumnHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner()&&(e===-1?this.selectedByColumnHeader.size>0:this.selectedByColumnHeader.has(e))}isEntireColumnSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const n=o=>{const{row:r}=o.getOuterTopStartCorner(),s=this.tableProps.countColHeaders(),a=this.tableProps.countRows();return(s>0&&r<0||s===0)&&o.getHeight()===a};if(e===-1)return Array.from(this.selectedRange).some(o=>n(o));const i=this.selectedRange.peekByIndex(e);return i?n(i):!1}isSelectedByAnyHeader(){return this.isSelectedByRowHeader(-1)||this.isSelectedByColumnHeader(-1)||this.isSelectedByCorner()}isSelectedByCorner(){return this.selectedByColumnHeader.has(this.getLayerLevel())&&this.selectedByRowHeader.has(this.getLayerLevel())}inInSelection(e){return this.selectedRange.includes(e)}isCellCornerVisible(){return this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&!this.isMultiple()}isCellVisible(e){const n=this.tableProps.visualToRenderableCoords(e);return n.row!==null&&n.col!==null}isAreaCornerVisible(e){return Number.isInteger(e)&&e!==this.getLayerLevel()?!1:this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&this.isMultiple()}clear(){this.selectedRange.clear(),this.highlight.clear()}deselect(){this.isSelected()&&(this.inProgress=!1,this.clear(),this.runLocalHooks("afterDeselect"))}selectAll(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1};const r=this.tableProps.countRows(),s=this.tableProps.countCols(),a=this.tableProps.countRowHeaders(),l=this.tableProps.countColHeaders(),c=i?-l:0,u=n?-a:0;if(c===0&&u===0&&(r===0||s===0))return;let h=(e=this.getSelectedRange().current())===null||e===void 0?void 0:e.highlight;const{focusPosition:d,disableHeadersHighlight:f}=o;Zr(Sf,this,f),d&&Number.isInteger(d==null?void 0:d.row)&&Number.isInteger(d==null?void 0:d.col)&&(h=this.tableProps.createCellCoords(Pt(d.row,c,r-1),Pt(d.col,u,s-1)));const g=this.tableProps.createCellCoords(c,u),m=this.tableProps.createCellCoords(r-1,s-1);this.clear(),this.setRangeStartOnly(g,void 0,h),u<0&&this.selectedByRowHeader.add(this.getLayerLevel()),c<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(m),this.finish(),Zr(Sf,this,!1)}selectCells(e){var n=this;const i=bd(e);if(i===KC)return!1;if(i===GC)throw new Error(Et`Unsupported format of the selection ranges was passed. To select cells pass\x20
+ the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
+ columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const o=Im(i,{createCellCoords:function(){return n.tableProps.createCellCoords(...arguments)},createCellRange:function(){return n.tableProps.createCellRange(...arguments)},propToCol:l=>this.tableProps.propToCol(l),keepDirection:!0}),r=this.settings.navigableHeaders,s={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:r?this.tableProps.countRowHeaders():0,countColHeaders:r?this.tableProps.countColHeaders():0},a=!e.some(l=>{const c=o(l),u=c.isValid(s);return!(u&&!c.containsHeaders()||u&&c.containsHeaders()&&c.isSingleHeader())});return a&&(this.clear(),this.setExpectedLayers(e.length),F(e,l=>{const{from:c,to:u}=o(l);this.setRangeStartOnly(c.clone(),!1),this.setRangeEnd(u.clone())}),this.finish()),a}selectColumns(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const o=typeof e=="string"?this.tableProps.propToCol(e):e,r=typeof n=="string"?this.tableProps.propToCol(n):n,s=this.tableProps.countRows(),a=this.tableProps.countCols(),l=this.tableProps.countColHeaders(),c=l===0?0:-l,u=this.tableProps.createCellCoords(c,o),h=this.tableProps.createCellCoords(s-1,r),d=this.tableProps.createCellRange(u,u,h).isValid({countRows:s,countCols:a,countRowHeaders:0,countColHeaders:l});if(d){let f=0,g=0;Number.isInteger(i==null?void 0:i.row)&&Number.isInteger(i==null?void 0:i.col)?(f=Pt(i.row,c,s-1),g=Pt(i.col,Math.min(o,r),Math.max(o,r))):(f=Pt(i,c,s-1),g=o);const m=this.tableProps.createCellCoords(f,g),w=l===0?0:Pt(m.row,c,-1),b=s-1,C=this.tableProps.createCellCoords(w,o),y=this.tableProps.createCellCoords(b,r);this.runLocalHooks("beforeSelectColumns",C,y,m),C.row=w,y.row=b,this.setRangeStartOnly(C,void 0,m),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(y),this.runLocalHooks("afterSelectColumns",C,y,m),this.finish()}return d}selectRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const o=this.tableProps.countRows(),r=this.tableProps.countCols(),s=this.tableProps.countRowHeaders(),a=s===0?0:-s,l=this.tableProps.createCellCoords(e,a),c=this.tableProps.createCellCoords(n,r-1),u=this.tableProps.createCellRange(l,l,c).isValid({countRows:o,countCols:r,countRowHeaders:s,countColHeaders:0});if(u){let h=0,d=0;Number.isInteger(i==null?void 0:i.row)&&Number.isInteger(i==null?void 0:i.col)?(h=Pt(i.row,Math.min(e,n),Math.max(e,n)),d=Pt(i.col,a,r-1)):(h=e,d=Pt(i,a,r-1));const f=this.tableProps.createCellCoords(h,d),g=s===0?0:Pt(f.col,a,-1),m=r-1,w=this.tableProps.createCellCoords(e,g),b=this.tableProps.createCellCoords(n,m);this.runLocalHooks("beforeSelectRows",w,b,f),w.col=g,b.col=m,this.setRangeStartOnly(w,void 0,f),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(b),this.runLocalHooks("afterSelectRows",w,b,f),this.finish()}return u}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),n=this.tableProps.countCols();if(e===0||n===0){this.deselect();return}const i=this.selectedRange.peekByIndex(this.selectedRange.size()-1),{from:o,to:r,highlight:s}=i;this.clear(),s.assign({row:Pt(s.row,-1/0,e-1),col:Pt(s.col,-1/0,n-1)}),o.assign({row:Pt(o.row,-1/0,e-1),col:Pt(o.col,-1/0,n-1)}),r.assign({row:Pt(r.row,0,e-1),col:Pt(r.col,0,n-1)}),this.selectedRange.ranges.push(i),this.highlight.getFocus().add(s).commit().syncWith(i),this.applyAndCommit(i)}commit(){if(this.highlight.getCustomSelections().forEach(o=>{o.commit()}),!this.isSelected())return;const n=this.highlight.getFocus(),i=this.getLayerLevel();n.commit().syncWith(this.selectedRange.current());for(let o=0;o=0&&o.col>=0&&!s.cell?r.setRangeEnd(o):(c||u)&&o.row>=0&&o.col>=0&&!s.cell?r.setRangeEnd(a(o.row,o.col)):c&&o.row<0&&!s.column?r.setRangeEnd(a(l.to.row,o.col)):u&&o.col<0&&!s.row?r.setRangeEnd(a(o.row,l.to.col)):(!c&&!u&&o.col<0||c&&o.col<0)&&!s.row?r.selectRows(Math.max(l.from.row,0),o.row,o.col):(!c&&!u&&o.row<0||u&&o.row<0)&&!s.column&&r.selectColumns(Math.max(l.from.col,0),o.col,o.row);else{const h=!r.inInSelection(o),d=n||i&&h;o.row<0&&o.col>=0&&!s.column?d&&r.selectColumns(o.col,o.col,o.row):o.col<0&&o.row>=0&&!s.row?d&&r.selectRows(o.row,o.row,o.col):o.col>=0&&o.row>=0&&!s.cell?d&&r.setRangeStart(o):o.col<0&&o.row<0&&r.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}r.markEndSource()}function hfe(t){let{isLeftClick:e,coords:n,selection:i,controller:o,cellCoordsFactory:r}=t;if(!e)return;const s=i.isSelectedByRowHeader(),a=i.isSelectedByColumnHeader(),l=i.tableProps.countCols(),c=i.tableProps.countRows();i.markSource("mouse"),a&&!o.column?i.setRangeEnd(r(c-1,n.col)):s&&!o.row?i.setRangeEnd(r(n.row,l-1)):o.cell||i.setRangeEnd(n),i.markEndSource()}const dfe=new Map([["mousedown",DH],["mouseover",hfe],["touchstart",DH]]);function LH(t,e){let{coords:n,selection:i,controller:o,cellCoordsFactory:r}=e;dfe.get(t.type)({coords:n,selection:i,controller:o,cellCoordsFactory:r,isShiftKey:t.shiftKey,isLeftClick:bT(t)||t.type==="touchstart",isRightClick:gu(t)})}function ffe(t,e){gfe(t,e),e.add(t)}function gfe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mfe(t,e,n){return(e=pfe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pfe(t){var e=wfe(t,"string");return typeof e=="symbol"?e:e+""}function wfe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $H(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const fv="customBorders",bfe=90;var Z0=new WeakSet;class vfe extends St{constructor(){super(...arguments),ffe(this,Z0),mfe(this,"savedBorders",[])}static get PLUGIN_KEY(){return fv}static get PLUGIN_PRIORITY(){return bfe}isEnabled(){return!!this.hot.getSettings()[fv]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>$H(Z0,this,yfe).call(this,e)),this.addHook("init",()=>$H(Z0,this,Cfe).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,n){let i=["top","bottom","start","end"],o=null;n&&(this.checkSettingsCohesion([n]),i=Object.keys(n),o=z0(n));const r=bd(e),s=Im(r,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});F(e,a=>{s(a).forAll((l,c)=>{F(i,u=>{this.prepareBorderFromCustomAdded(l,c,o,Lde(u))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const n=bd(e),i=Im(n,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),o=[];return F(e,r=>{i(r).forAll((s,a)=>{F(this.savedBorders,l=>{l.row===s&&l.col===a&&o.push(Cf(l))})})}),o}clearBorders(e){e?this.setBorders(e):(F(this.savedBorders,n=>{this.clearBordersFromSelectionSettings(n.id),this.clearNullCellRange(),this.hot.removeCellMeta(n.row,n.col,"borders")}),this.savedBorders.length=0)}insertBorderIntoSettings(e,n){this.checkSavedBorders(e)||this.savedBorders.push(e);const o=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,o,n)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:o})}prepareBorderFromCustomAdded(e,n,i,o){const r=this.hot.countRows(),s=this.hot.countCols();if(e>=r||n>=s)return;let a=Y0(e,n);i&&(a=Hde(a,i),F(this.hot.selection.highlight.customSelections,l=>{if(a.id===l.settings.id)return Object.assign(l.settings,i),a.id=l.settings.id,a.top=l.settings.top,a.bottom=l.settings.bottom,a.start=l.settings.start,a.end=l.settings.end,!1})),this.hot.setCellMeta(e,n,"borders",Cf(a)),this.insertBorderIntoSettings(a,o)}prepareBorderFromCustomAddedRange(e,n){const i=Math.min(e.to.row,this.hot.countRows()-1),o=Math.min(e.to.col,this.hot.countCols()-1);Oe(e.from.row,i,r=>{Oe(e.from.col,o,s=>{const a=Y0(r,s);let l=0;r===e.from.row&&pn(n,"top")&&(l+=1,a.top=n.top),r===e.to.row&&pn(n,"bottom")&&(l+=1,a.bottom=n.bottom),s===e.from.col&&pn(n,"start")&&(l+=1,a.start=n.start),s===e.to.col&&pn(n,"end")&&(l+=1,a.end=n.end),l>0&&(this.hot.setCellMeta(r,s,"borders",Cf(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,n){const i=mB(e,n);this.spliceBorder(i),this.clearBordersFromSelectionSettings(i),this.clearNullCellRange(),this.hot.removeCellMeta(e,n,"borders")}setBorder(e,n,i,o){let r=this.hot.getCellMeta(e,n).borders;!r||r.border===void 0?r=Y0(e,n):r=z0(r),o?(r[i]=xa(),this.countHide(r)===4?this.removeAllBorders(e,n):(this.checkCustomSelectionsFromContextMenu(r,i,o)||this.insertBorderIntoSettings(r),this.hot.setCellMeta(e,n,"borders",Cf(r)))):(r[i]=rg(),this.checkCustomSelectionsFromContextMenu(r,i,o)||this.insertBorderIntoSettings(r),this.hot.setCellMeta(e,n,"borders",Cf(r)))}prepareBorder(e,n,i){F(e,o=>{let{start:r,end:s}=o;if(r.row===s.row&&r.col===s.col)n==="noBorders"?this.removeAllBorders(r.row,r.col):this.setBorder(r.row,r.col,n,i);else switch(n){case"noBorders":Oe(r.col,s.col,a=>{Oe(r.row,s.row,l=>{this.removeAllBorders(l,a)})});break;case"top":Oe(r.col,s.col,a=>{this.setBorder(r.row,a,n,i)});break;case"bottom":Oe(r.col,s.col,a=>{this.setBorder(s.row,a,n,i)});break;case"start":Oe(r.row,s.row,a=>{this.setBorder(a,r.col,n,i)});break;case"end":Oe(r.row,s.row,a=>{this.setBorder(a,s.col,n,i)});break}})}createCustomBorders(e){F(e,n=>{const i=z0(n);n.range?this.prepareBorderFromCustomAddedRange(n.range,i):this.prepareBorderFromCustomAdded(n.row,n.col,i)})}countHide(e){const{top:n,bottom:i,start:o,end:r}=e;return Li([n,i,o,r],(a,l)=>{let c=a;return l&&l.hide&&(c+=1),c},0)}clearBordersFromSelectionSettings(e){const n=rt(this.hot.selection.highlight.customSelections,i=>i.settings.id).indexOf(e);n>-1&&this.hot.selection.highlight.customSelections[n].clear()}clearNullCellRange(){F(this.hot.selection.highlight.customSelections,(e,n)=>{if(e.cellRange===null)return this.hot.selection.highlight.customSelections[n].destroy(),this.hot.selection.highlight.customSelections.splice(n,1),!1})}hideBorders(){F(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const n=rt(this.savedBorders,i=>i.id).indexOf(e);n>-1&&this.savedBorders.splice(n,1)}checkSavedBorders(e){let n=!1;return this.countHide(e)===4?(this.spliceBorder(e.id),n=!0):F(this.savedBorders,(o,r)=>{if(e.id===o.id)return this.savedBorders[r]=e,n=!0,!1}),n}checkCustomSelectionsFromContextMenu(e,n,i){let o=!1;return F(this.hot.selection.highlight.customSelections,r=>{if(e.id===r.settings.id){const s=this.hot.view._wt.selectionManager.getBorderInstances(r);return F(s,a=>{a.toggleHiddenClass(n,i)}),o=!0,!1}}),o}checkCustomSelections(e,n,i){const o=this.countHide(e);let r=!1;return o===4?(this.removeAllBorders(e.row,e.col),r=!0):F(this.hot.selection.highlight.customSelections,s=>{if(e.id===s.settings.id){if(s.visualCellRange=n,s.commit(),i){const a=this.hot.view._wt.selectionManager.getBorderInstances(s);F(a,l=>{l.changeBorderStyle(i,e)})}return r=!0,!1}}),r}changeBorderSettings(){const e=this.hot.getSettings()[fv];if(Array.isArray(e)){const n=Ni(e);this.checkSettingsCohesion(n),n.length||(this.savedBorders=n),this.createCustomBorders(n)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const n=kde(e),i=Nde(e);if(n&&i)throw new Error('The "left"/"right" and "start"/"end" options should not be used together. Please use only the option "start"/"end".');if(this.hot.isRtl()&&n)throw new Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".')}destroy(){super.destroy()}}function yfe(t){this.hot.getSettings()[fv]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(QT)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[Bde(this),Wde(this),$de(this),Fde(this),Vde(this)]}})}function Cfe(){this.changeBorderSettings()}function Sfe(t,e){_fe(t,e),e.add(t)}function _fe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function J0(t,e,n){return(e=Rfe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rfe(t){var e=xfe(t,"string");return typeof e=="symbol"?e:e+""}function xfe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function FH(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const VH="dragToScroll",Efe=100;var Q0=new WeakSet;class Tfe extends St{constructor(){super(...arguments),Sfe(this,Q0),J0(this,"boundaries",null),J0(this,"callback",null),J0(this,"listening",!1)}static get PLUGIN_KEY(){return VH}static get PLUGIN_PRIORITY(){return Efe}isEnabled(){return!!this.hot.getSettings()[VH]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>FH(Q0,this,WH).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>FH(Q0,this,WH).call(this,e)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.unregisterEvents(),super.disablePlugin()}setBoundaries(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{left:0,right:this.hot.rootWindow.innerWidth,top:0,bottom:this.hot.rootWindow.innerHeight};this.boundaries=e}setCallback(e){this.callback=e}check(e,n){let i=0,o=0;nthis.boundaries.bottom&&(o=n-this.boundaries.bottom),ethis.boundaries.right&&(i=e-this.boundaries.right),this.callback(i,o)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let n=e;for(;n;)this.eventManager.addEventListener(n.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(n.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(n.document,"mousemove",i=>this.onMouseMove(i)),n=dd(n)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function WH(t){if(gu(t))return;const e=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(e!==this.hot.rootWindow?e.getBoundingClientRect():void 0),this.setCallback((n,i)=>{var o,r;const s=(o=e.scrollLeft)!==null&&o!==void 0?o:e.scrollX,a=(r=e.scrollTop)!==null&&r!==void 0?r:e.scrollY;e.scroll(s+Math.sign(n)*50,a+Math.sign(i)*20)}),this.listen()}function Mfe(t,e){yB(t,e),e.add(t)}function Pfe(t,e,n){yB(t,e),e.set(t,n)}function yB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function e_(t,e,n){return(e=Ofe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ofe(t){var e=Ife(t,"string");return typeof e=="symbol"?e:e+""}function Ife(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Afe(t,e){return t.get(ko(t,e))}function CB(t,e,n){return t.set(ko(t,e),n),n}function ko(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}Ee.getSingleton().register("afterDropdownMenuDefaultOptions");Ee.getSingleton().register("beforeDropdownMenuShow");Ee.getSingleton().register("afterDropdownMenuShow");Ee.getSingleton().register("afterDropdownMenuHide");Ee.getSingleton().register("afterDropdownMenuExecute");const gv="dropdownMenu",Hfe=230,Hm="changeType",t_=gv;var nS=new WeakMap,gr=new WeakSet;class iS extends St{static get PLUGIN_KEY(){return gv}static get PLUGIN_PRIORITY(){return Hfe}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Rp,xp,qe,Tp,qe,zC,qe,Ep,qe,Ho]}constructor(e){super(e),Mfe(this,gr),e_(this,"commandExecutor",new iB(this.hot)),e_(this,"itemsFactory",null),e_(this,"menu",null),Pfe(this,nS,!1),this.hot.addHook("afterGetColHeader",(n,i)=>ko(gr,this,Nfe).call(this,n,i))}isEnabled(){return this.hot.getSettings()[gv]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new oB(this.hot,iS.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",function(){for(var o=arguments.length,r=new Array(o),s=0;s{this.hot.runHooks("afterDropdownMenuDefaultOptions",i),this.itemsFactory.setPredefinedItems(i.items);const o=this.itemsFactory.getItems(n);this.menu&&this.menu.destroy(),this.menu=new kd(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",o),this.menu.setMenuItems(o),this.menu.addLocalHook("beforeOpen",()=>ko(gr,this,Dfe).call(this)),this.menu.addLocalHook("afterOpen",()=>ko(gr,this,Lfe).call(this)),this.menu.addLocalHook("afterSubmenuOpen",r=>ko(gr,this,$fe).call(this,r)),this.menu.addLocalHook("afterClose",()=>ko(gr,this,Ffe).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var r=arguments.length,s=new Array(r),a=0;athis.commandExecutor.registerCommand(r.key,r))})}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&this.menu.destroy(),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager().getContext("grid"),n=()=>{const{highlight:i}=this.hot.getSelectedRangeLast();if((i.isHeader()&&i.row===-1||i.isCell())&&i.col>=0){this.hot.selectColumns(i.col,i.col,-1);const{from:o}=this.hot.getSelectedRangeLast(),r=UC(this.menu.container,this.hot.rootDocument),s=this.hot.getCell(-1,o.col,!0).querySelector(`.${Hm}`),a=s.getBoundingClientRect();this.open({left:a.left+r.left,top:a.top+s.offsetHeight+r.top},{left:a.width,right:0,above:0,below:3}),this.menu.getNavigator().toFirstItem()}};e.addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:n,runOnlyIf:()=>{var i;const o=(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;return o&&this.hot.selection.isCellVisible(o)&&o.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:t_},{keys:[["Shift","Alt","ArrowDown"]],callback:n,runOnlyIf:()=>{var i;const o=(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;return o&&this.hot.selection.isCellVisible(o)&&o.isCell()&&!this.menu.isOpened()},group:t_}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(t_)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>ko(gr,this,kfe).call(this,e))}open(e){var n;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};(n=this.menu)!==null&&n!==void 0&&n.isOpened()||(this.menu.open(),Ze(i,(o,r)=>{this.menu.setOffset(r,o)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close()}executeCommand(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o0&&arguments[0]!==void 0?arguments[0]:!0;this.menu.isOpened()&&(e?this.menu.hotMenu.listen():this.menu.hotMenu.unlisten())}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function SB(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function kfe(t){if(Fe(t.target,Hm)){const e=UC(this.menu.container,this.hot.rootDocument),n=t.target.getBoundingClientRect();t.stopPropagation(),CB(nS,this,!1),this.open({left:n.left+e.left,top:n.top+t.target.offsetHeight+e.top},{left:n.width,right:0,above:0,below:3})}}function Nfe(t,e){const n=e.parentNode;if(!n)return;const i=n.parentNode.childNodes,o=Array.prototype.indexOf.call(i,n);if(t<0||o!==i.length-1)return;const r=e.querySelector(`.${Hm}`);if(this.enabled&&r)return;if(!this.enabled){r&&r.parentNode.removeChild(r);return}const s=this.hot.rootDocument.createElement("button");s.className=Hm,s.type="button",s.tabIndex=-1,this.hot.getSettings().ariaTags&&($e(s,[Iu(),Xv(" ")]),$e(e,[hV("menu")])),s.onclick=function(){return!1},e.firstChild.insertBefore(s,e.firstChild.firstChild)}function Dfe(){this.hot.runHooks("beforeDropdownMenuShow",this)}function Lfe(){this.hot.runHooks("afterDropdownMenuShow",this),ko(gr,this,SB).call(this,this.menu)}function $fe(t){ko(gr,this,SB).call(this,t)}function Ffe(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function Vfe(t){return Afe(nS,this)?null:t}function Wfe(t){Fe(t.target,Hm)&&CB(nS,this,!0)}iS.SEPARATOR={name:qe};function BH(t,e,n){return(e=Bfe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bfe(t){var e=jfe(t,"string");return typeof e=="symbol"?e:e+""}function jfe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ufe{constructor(e){BH(this,"hot",void 0),BH(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:n,endRow:i,endCol:o}=this._getDataRange(),r=this.options,s=[];return Oe(e,i,a=>{const l=[];!r.exportHiddenRows&&this._isHiddenRow(a)||(Oe(n,o,c=>{!r.exportHiddenColumns&&this._isHiddenColumn(c)||l.push(this.hot.getDataAtCell(a,c))}),s.push(l))}),s}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:n,endRow:i}=this._getDataRange(),o=this.hot.getRowHeader();Oe(n,i,r=>{!this.options.exportHiddenRows&&this._isHiddenRow(r)||e.push(o[r])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:n,endCol:i}=this._getDataRange(),o=this.hot.getColHeader();Oe(n,i,r=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(r)||e.push(o[r])})}return e}_getDataRange(){const e=this.hot.countCols()-1,n=this.hot.countRows()-1;let[i=0,o=0,r=n,s=e]=this.options.range;return i=Math.max(i,0),o=Math.max(o,0),r=Math.min(r,n),s=Math.min(s,e),{startRow:i,startCol:o,endRow:r,endCol:s}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}function jH(t,e,n){return(e=zfe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zfe(t){var e=Yfe(t,"string");return typeof e=="symbol"?e:e+""}function Yfe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class IM{static get DEFAULT_OPTIONS(){return{mimeType:"text/plain",fileExtension:"txt",filename:"Handsontable [YYYY]-[MM]-[DD]",encoding:"utf-8",bom:!1,columnHeaders:!1,rowHeaders:!1,exportHiddenColumns:!1,exportHiddenRows:!1,range:[]}}constructor(e,n){jH(this,"dataProvider",void 0),jH(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(n),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let n=Hs(this.constructor.DEFAULT_OPTIONS);const i=new Date;return n=An(Hs(IM.DEFAULT_OPTIONS),n),n=An(n,e),n.filename=lV(n.filename,{YYYY:i.getFullYear(),MM:`${i.getMonth()+1}`.padStart(2,"0"),DD:`${i.getDate()}`.padStart(2,"0")}),n}}const Gfe="\r",Kfe='"',qfe=`
+`;class Xfe extends IM{static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
+`}}export(){const e=this.options,n=this.dataProvider.getData();let i=this.dataProvider.getColumnHeaders();const o=i.length>0,r=this.dataProvider.getRowHeaders(),s=r.length>0;let a=e.bom?"\uFEFF":"";return o&&(i=rt(i,l=>this._escapeCell(l,!0)),s&&(a+=e.columnDelimiter),a+=i.join(e.columnDelimiter),a+=e.rowDelimiter),F(n,(l,c)=>{c>0&&(a+=e.rowDelimiter),s&&(a+=this._escapeCell(r[c])+e.columnDelimiter),a+=l.map(u=>this._escapeCell(u)).join(e.columnDelimiter)}),a}_escapeCell(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=En(e);return i!==""&&(n||i.indexOf(Gfe)>=0||i.indexOf(Kfe)>=0||i.indexOf(qfe)>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(new RegExp('"',"g"),'""'),i=`"${i}"`),i}}const Zfe="csv",Cx={[Zfe]:Xfe};function Jfe(t,e,n){return typeof Cx[t]=="function"?new Cx[t](e,n):null}const Qfe="exportFile",ege=240;class tge extends St{static get PLUGIN_KEY(){return Qfe}static get PLUGIN_PRIORITY(){return ege}isEnabled(){return!0}exportAsString(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createTypeFormatter(e,n).export()}exportAsBlob(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,n))}downloadFile(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{rootDocument:i,rootWindow:o}=this.hot,r=this._createTypeFormatter(e,n),s=this._createBlob(r),a=o.URL||o.webkitURL,l=i.createElement("a"),c=`${r.options.filename}.${r.options.fileExtension}`;if(l.download!==void 0){const u=a.createObjectURL(s);l.style.display="none",l.setAttribute("href",u),l.setAttribute("download",c),i.body.appendChild(l),l.dispatchEvent(new MouseEvent("click")),i.body.removeChild(l),setTimeout(()=>{a.revokeObjectURL(u)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(s,c)}_createTypeFormatter(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Cx[e])throw new Error(`Export format type "${e}" is not supported.`);return Jfe(e,new Ufe(this.hot),n)}_createBlob(e){let n=null;return typeof Blob<"u"&&(n=new Blob([e.export()],{type:`${e.options.mimeType};charset=${e.options.encoding}`})),n}}function uh(t,e,n){return(e=nge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nge(t){var e=ige(t,"string");return typeof e=="symbol"?e:e+""}function ige(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Mp{constructor(e,n){let{id:i,stateless:o=!0}=n;uh(this,"hot",void 0),uh(this,"id",void 0),uh(this,"elements",[]),uh(this,"hidden",!1),uh(this,"stateId",""),uh(this,"state",void 0),this.hot=e,this.id=i,this.stateId=`Filters.component.${this.id}`,this.state=o?null:this.hot.columnIndexMapper.registerMap(this.stateId,new jC)}getElements(){return this.elements}reset(){F(this.elements,e=>e.reset())}hide(){this.hidden=!0}show(){this.hidden=!1}isHidden(){return this.hot===null||this.hidden}restoreState(e){this.state&&this.setState(this.state.getValueAtIndex(e))}setState(){throw new Error("The state setting logic is not implemented")}saveState(e){this.state&&this.state.setValueAtIndex(e,this.getState())}getState(){throw new Error("The state gathering logic is not implemented")}destroy(){this.hot.columnIndexMapper.unregisterMap(this.stateId),this.clearLocalHooks(),F(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}Ht(Mp,li);const km={};function Vl(t,e){if(!km[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:n,descriptor:i}=km[t];let o=e;return i.inputValuesDecorator&&(o=i.inputValuesDecorator(o)),function(r){return n.apply(r.meta.instance,[].concat([r],[o]))}}function eu(t){if(!km[t])throw Error(`Filter condition "${t}" does not exist.`);return km[t].descriptor}function On(t,e,n){n.key=t,km[t]={condition:e,descriptor:n}}const Yn="none";function oge(){return!0}On(Yn,oge,{name:kC,inputsCount:0,showOperators:!1});const Hg="empty";function rge(t){return Sn(t.value)}On(Hg,rge,{name:h1,inputsCount:0,showOperators:!0});const mv="not_empty";function sge(t,e){return!Vl(Hg,e)(t)}On(mv,sge,{name:d1,inputsCount:0,showOperators:!0});const kg="eq";function age(t,e){let[n]=e;return En(t.value).toLocaleLowerCase(t.meta.locale)===En(n)}On(kg,age,{name:f1,inputsCount:1,showOperators:!0});const pv="neq";function lge(t,e){return!Vl(kg,e)(t)}On(pv,lge,{name:g1,inputsCount:1,showOperators:!0});const _B="gt";function cge(t,e){let[n]=e,i=n;return t.meta.type==="numeric"&&(i=parseFloat(i,10)),t.value>i}On(_B,cge,{name:v1,inputsCount:1,showOperators:!0});const RB="gte";function uge(t,e){let[n]=e,i=n;return t.meta.type==="numeric"&&(i=parseFloat(i,10)),t.value>=i}On(RB,uge,{name:y1,inputsCount:1,showOperators:!0});const xB="lt";function hge(t,e){let[n]=e,i=n;return t.meta.type==="numeric"&&(i=parseFloat(i,10)),t.value=0}On(AM,fge,{name:x1,inputsCount:1,showOperators:!0});const HM="date_before";function gge(t,e){let[n]=e;const i=le(t.value,t.meta.dateFormat),o=le(n,t.meta.dateFormat);return!i.isValid()||!o.isValid()?!1:i.diff(o)<=0}On(HM,gge,{name:E1,inputsCount:1,showOperators:!0});const by="between";function mge(t,e){let[n,i]=e,o=n,r=i;if(t.meta.type==="numeric"){const s=parseFloat(o,10),a=parseFloat(r,10);o=Math.min(s,a),r=Math.max(s,a)}else if(t.meta.type==="date"){const s=Vl(HM,[r]),a=Vl(AM,[o]);return s(t)&&a(t)}return t.value>=o&&t.value<=r}On(by,mge,{name:_1,inputsCount:2,showOperators:!0});const TB="not_between";function pge(t,e){return!Vl(by,e)(t)}On(TB,pge,{name:R1,inputsCount:2,showOperators:!0});const MB="begins_with";function wge(t,e){let[n]=e;return En(t.value).toLocaleLowerCase(t.meta.locale).startsWith(En(n))}On(MB,wge,{name:m1,inputsCount:1,showOperators:!0});const PB="ends_with";function bge(t,e){let[n]=e;return En(t.value).toLocaleLowerCase(t.meta.locale).endsWith(En(n))}On(PB,bge,{name:p1,inputsCount:1,showOperators:!0});const kM="contains";function vge(t,e){let[n]=e;return En(t.value).toLocaleLowerCase(t.meta.locale).indexOf(En(n))>=0}On(kM,vge,{name:w1,inputsCount:1,showOperators:!0});const OB="not_contains";function yge(t,e){return!Vl(kM,e)(t)}On(OB,yge,{name:b1,inputsCount:1,showOperators:!0});const IB="date_tomorrow";function Cge(t){const e=le(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(le().subtract(-1,"days").startOf("day"),"d"):!1}On(IB,Cge,{name:M1,inputsCount:0});const AB="date_today";function Sge(t){const e=le(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(le().startOf("day"),"d"):!1}On(AB,Sge,{name:T1,inputsCount:0});const HB="date_yesterday";function _ge(t){const e=le(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(le().subtract(1,"days").startOf("day"),"d"):!1}On(HB,_ge,{name:P1,inputsCount:0});Lee();function Rge(t,e){let n=t;return n===""&&(n=`(${e})`),n}const Sx=new Set([1]).has(1),xge=Sx&&typeof Array.from=="function";function Pp(t){let e=t;return Sx&&(e=new Set(e)),function(n){let i;return Sx?i=e.has(n):i=!!~e.indexOf(n),i}}function kB(t){return t??""}function _x(t){let e=t;return xge?e=Array.from(new Set(e)):e=JF(e),e=e.sort((n,i)=>typeof n=="number"&&typeof i=="number"?n-i:n===i?0:n>i?1:-1),e}function UH(t,e,n,i){const o=[],r=t===e;let s;return r||(s=Pp(e)),F(t,a=>{let l=!1;(r||s(a))&&(l=!0);const c={checked:l,value:a,visualValue:Rge(a,n)};i&&i(c),o.push(c)}),o}const tu="by_value";function Ege(t,e){let[n]=e;return n(t.value)}On(tu,Ege,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[Pp(e)]},showOperators:!1});const Nm={};function Tge(t){if(!Nm[t])throw Error(`Operation with id "${t}" does not exist.`);const e=Nm[t].func;return function(n,i){return e(n,i)}}function Mge(t){return Nm[t].name}function NM(t,e,n){Nm[t]={name:e,func:n}}const Nl="conjunction",Pge=A1;function Oge(t,e){return t.every(n=>n.func(e))}NM(Nl,Pge,Oge);const vy="disjunction",Ige=NC;function Age(t,e){return t.some(n=>n.func(e))}NM(vy,Ige,Age);const DM="disjunctionWithExtraCondition",Hge=NC;function kge(t,e){if(t.length<3)throw Error("Operation doesn't work on less then three conditions.");return t.slice(0,t.length-1).some(n=>n.func(e))&&t[t.length-1].func(e)}NM(DM,Hge,kge);const Nge="numeric",NB="text",Dge="date",zH={[Nge]:[Yn,qe,Hg,mv,qe,kg,pv,qe,_B,RB,xB,EB,by,TB],[NB]:[Yn,qe,Hg,mv,qe,kg,pv,qe,MB,PB,qe,kM,OB],[Dge]:[Yn,qe,Hg,mv,qe,kg,pv,qe,HM,AM,by,qe,IB,AB,HB]};function Lge(t){const e=[];let n=t;return zH[n]||(n=NB),F(zH[n],i=>{let o;i===qe?o={name:qe}:o=Hs(eu(i)),e.push(o)}),e}function Rf(t,e,n){return(e=$ge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $ge(t){var e=Fge(t,"string");return typeof e=="symbol"?e:e+""}function Fge(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const n_="built",i_="building",YH=["click","input","keydown","keypress","keyup","focus","blur","change"];let Mr=class DB{static get DEFAULTS(){return Hs({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,n){Rf(this,"hot",void 0),Rf(this,"eventManager",new kr(this)),Rf(this,"options",void 0),Rf(this,"_element",void 0),Rf(this,"buildState",void 0),this.hot=e,this.options=An(DB.DEFAULTS,n),this._element=this.hot.rootDocument.createElement(this.options.wrapIt?"div":this.options.tagName)}setValue(e){this.options.value=e,this.update()}getValue(){return this.options.value}get element(){return this.buildState===i_?this._element:this.buildState===n_?(this.update(),this._element):(this.buildState=i_,this.build(),this.buildState=n_,this._element)}isBuilt(){return this.buildState===n_}translateIfPossible(e){return typeof e=="string"&&e.startsWith($i)?this.hot.getTranslatedPhrase(e):e}build(){const e=(n,i)=>{this.eventManager.addEventListener(n,i,o=>this.runLocalHooks(i,o,this))};if(this.buildState||(this.buildState=i_),this._element.setAttribute("data-hot-input",!0),this.options.tabIndex!==void 0&&this._element.setAttribute("tabindex",this.options.tabIndex),this.options.role!==void 0&&this._element.setAttribute("role",this.options.role),this.options.className&&ce(this._element,this.options.className),this.options.children.length)F(this.options.children,n=>this._element.appendChild(n.element));else if(this.options.wrapIt){const n=this.hot.rootDocument.createElement(this.options.tagName);n.setAttribute("data-hot-input",!0),Ze(this.options,(i,o)=>{n[o]!==void 0&&o!=="className"&&o!=="tagName"&&o!=="children"&&(n[o]=this.translateIfPossible(i))}),this._element.appendChild(n),F(YH,i=>e(n,i))}else F(YH,n=>e(this._element,n))}update(){}reset(){this.options.value="",this.update()}show(){this.element.style.display=""}hide(){this.element.style.display="none"}focus(){}destroy(){this.eventManager.destroy(),this.eventManager=null,this.hot=null,this._element.parentNode&&this._element.parentNode.removeChild(this._element),this._element=null}};Ht(Mr,li);function Vge(t,e){LB(t,e),e.add(t)}function Wge(t,e,n){LB(t,e),e.set(t,n)}function LB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Bw(t,e){return t.get(LM(t,e))}function Bge(t,e,n){return t.set(LM(t,e),n),n}function LM(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var hh=new WeakMap,GH=new WeakSet;class Dl extends Mr{static get DEFAULTS(){return Hs({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,n){super(e,An(Dl.DEFAULTS,n)),Vge(this,GH),Wge(this,hh,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>LM(GH,this,jge).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");Bge(hh,this,this._element.firstChild),ce(this._element,"htUIInput"),ce(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Bw(hh,this).type=this.options.type,Bw(hh,this).placeholder=this.translateIfPossible(this.options.placeholder),Bw(hh,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&Bw(hh,this).focus()}}function jge(t){this.options.value=t.target.value}function Uge(t,e){$B(t,e),e.add(t)}function xf(t,e,n){$B(t,e),e.set(t,n)}function $B(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dh(t,e,n){return t.set(Ng(t,e),n),n}function un(t,e){return t.get(Ng(t,e))}function Ng(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ln=new WeakMap,jw=new WeakMap,Uw=new WeakMap,o_=new WeakMap,zw=new WeakMap,Yw=new WeakSet;class Dm extends Mr{static get DEFAULTS(){return Hs({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,n){super(e,An(Dm.DEFAULTS,n)),Uge(this,Yw),xf(this,Ln,null),xf(this,jw,[]),xf(this,Uw,void 0),xf(this,o_,void 0),xf(this,zw,void 0),this.registerHooks()}getMenu(){return un(Ln,this)}registerHooks(){this.addLocalHook("click",()=>Ng(Yw,this,Gge).call(this))}setItems(e){dh(jw,this,this.translateNames(e)),un(Ln,this)&&un(Ln,this).setMenuItems(un(jw,this))}translateNames(e){return F(e,n=>{n.name=this.translateIfPossible(n.name)}),e}build(){super.build(),dh(Ln,this,new kd(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),un(Ln,this).setMenuItems(un(jw,this));const e=new Mr(this.hot,{className:"htUISelectCaption"}),n=new Mr(this.hot,{className:"htUISelectDropdown"});dh(Uw,this,e),dh(o_,this,e.element),dh(zw,this,n),this.hot.getSettings().ariaTags&&($e(n.element,[Iu()]),$e(this._element,[uV()])),F([e,n],i=>this._element.appendChild(i.element)),un(Ln,this).addLocalHook("select",i=>Ng(Yw,this,zge).call(this,i)),un(Ln,this).addLocalHook("afterClose",()=>Ng(Yw,this,Yge).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=un(Ln,this).hot.getTranslatedPhrase(kC),un(o_,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();un(Ln,this)&&(un(Ln,this).open(),un(Ln,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),un(Ln,this).getNavigator().toFirstItem(),un(Ln,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:n=>{this.closeOptions(),this.runLocalHooks("tabKeydown",n)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){un(Ln,this)&&un(Ln,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){un(Ln,this)&&(un(Ln,this).destroy(),dh(Ln,this,null)),un(Uw,this)&&un(Uw,this).destroy(),un(zw,this)&&un(zw,this).destroy(),super.destroy()}}function zge(t){t.name!==qe&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function Yge(){this.runLocalHooks("afterClose")}function Gge(){this.openOptions()}function Kge(t,e){qge(t,e),e.add(t)}function qge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function KH(t,e,n){return(e=Xge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xge(t){var e=Zge(t,"string");return typeof e=="symbol"?e:e+""}function Zge(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qH(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var r_=new WeakSet;class Rx extends Mp{constructor(e,n){super(e,{id:n.id,stateless:!1}),Kge(this,r_),KH(this,"name",""),KH(this,"addSeparator",!1),this.name=n.name,this.addSeparator=n.addSeparator,this.elements.push(new Dm(this.hot,{menuContainer:n.menuContainer})),this.elements.push(new Dl(this.hot,{placeholder:$1})),this.elements.push(new Dl(this.hot,{placeholder:F1})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>qH(r_,this,Jge).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),F(this.getInputElements(),e=>{e.addLocalHook("keydown",n=>qH(r_,this,Qge).call(this,n))})}setState(e){if(this.reset(),!e)return;const n=Hs(e.command);n.name.startsWith(wn)&&(n.name=this.hot.getTranslatedPhrase(n.name)),this.getSelectElement().setValue(n),F(e.args,(i,o)=>{if(o>n.inputsCount-1)return!1;const r=this.getInputElement(o);r.setValue(i),r[n.inputsCount>o?"show":"hide"](),o||this.hot._registerTimeout(()=>r.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||eu(Yn),n=[];return F(this.getInputElements(),(i,o)=>{e.inputsCount>o&&n.push(i.getValue())}),{command:e,args:n}}updateState(e,n){const i=eu(e?e.name:Yn);this.state.setValueAtIndex(n,{command:i,args:e?e.args:[]}),e||F(this.getInputElements(),o=>o.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof Dm)[0]}getInputElement(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.getInputElements()[e]}getInputElements(){return this.elements.filter(e=>e instanceof Dl)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,i,o,r,s)=>{ce(n.parentNode,"htFiltersMenuCondition"),this.addSeparator&&ce(n.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return ce(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||F(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let n=[eu(Yn)];if(e!==null){const{visualIndex:i}=e;n=Lge(this.hot.getDataType(0,i,this.hot.countRows(),i))}F(this.getInputElements(),i=>i.hide()),this.getSelectElement().setItems(n),super.reset(),this.getSelectElement().setValue(n[0])}}function Jge(t){F(this.getInputElements(),(e,n)=>{e[t.inputsCount>n?"show":"hide"](),n===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function Qge(t){wp(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),$r(t))}function XH(t,e,n){eme(t,e),e.set(t,n)}function eme(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ef(t,e){return t.get(FB(t,e))}function ZH(t,e,n){return t.set(FB(t,e),n),n}function FB(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var fh=new WeakMap,s_=new WeakMap;class yy extends Mr{static get DEFAULTS(){return Hs({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,n){super(e,An(yy.DEFAULTS,n)),XH(this,fh,void 0),XH(this,s_,void 0)}build(){super.build();const e=this.hot.rootDocument.createElement("label");e.textContent=this.translateIfPossible(this.options.label.textContent),e.htmlFor=this.translateIfPossible(this.options.label.htmlFor),ZH(s_,this,e),ZH(fh,this,this._element.firstChild),Ef(fh,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Ef(s_,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?Ef(fh,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(Ef(fh,this).checked=e)}focus(){this.isBuilt()&&Ef(fh,this).focus()}}function tme(t,e){nme(t,e),e.add(t)}function nme(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ime(t,e,n){return(e=ome(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ome(t){var e=rme(t,"string");return typeof e=="symbol"?e:e+""}function rme(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sme(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const JH=0;var QH=new WeakSet;class ame extends Mp{constructor(e,n){super(e,{id:n.id,stateless:!1}),tme(this,QH),ime(this,"name",""),this.name=n.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(ce(n.parentNode,"htFiltersMenuOperators"),F(this.elements,i=>n.appendChild(i.element)),n)}}buildOperatorsElement(){const e=[Nl,vy];F(e,n=>{const i=new yy(this.hot,{name:"operator",label:{htmlFor:n,textContent:Mge(n)},value:n,checked:n===e[JH],id:n});i.addLocalHook("change",o=>sme(QH,this,lme).call(this,o)),this.elements.push(i)})}setChecked(e){if(this.elements.length{n.setChecked(i===e)})}getActiveOperationId(){const e=this.elements.find(n=>n instanceof yy&&n.isChecked());return e?e.getValue():Nl}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&F(this.elements,n=>{n.setChecked(n.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Nl,n=arguments.length>1?arguments[1]:void 0,i=e;i===DM&&(i=vy),this.state.setValueAtIndex(n,i)}reset(){this.setChecked(JH)}}function lme(t){this.setState(t.target.value)}const cme="ABCDEFGHIJKLMNOPQRSTUVWXYZ",ek=cme.length;function ume(t){let e=t+1,n="",i;for(;e>0;)i=(e-1)%ek,n=String.fromCharCode(65+i)+n,e=parseInt((e-i)/ek,10);return n}function VB(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t;const i=[];return(!Array.isArray(t)||!Array.isArray(t[0]))&&(n=[t]),n.forEach((o,r)=>{Array.isArray(o)?o.forEach((s,a)=>{i.push([r+e,a,s])}):Object.keys(o).forEach(s=>{i.push([r+e,s,o[s]])})}),i}function WB(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&Xe(t[0])&&(e=hT(t[0]))),e}function hme(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function dme(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function fme(t,e,n){gme(t,e),e.set(t,n)}function gme(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a_(t,e){return t.get(BB(t,e))}function mme(t,e,n){return t.set(BB(t,e),n),n}function BB(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Tf=new WeakMap;class Lm extends Mr{static get DEFAULTS(){return Hs({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,n){super(e,An(Lm.DEFAULTS,n)),fme(this,Tf,void 0)}build(){super.build(),mme(Tf,this,this._element.firstChild)}update(){this.isBuilt()&&(a_(Tf,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&a_(Tf,this).focus()}activate(){a_(Tf,this).click()}}function pme(t,e){jB(t,e),e.add(t)}function gh(t,e,n){jB(t,e),e.set(t,n)}function jB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ye(t,e){return t.get(Wh(t,e))}function sr(t,e,n){return t.set(Wh(t,e),n),n}function Wh(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const tk="multipleSelect.itemBox";var mr=new WeakMap,Rn=new WeakMap,l_=new WeakMap,ta=new WeakMap,Za=new WeakMap,Ja=new WeakMap,Mf=new WeakSet;class $m extends Mr{static get DEFAULTS(){return Hs({className:"htUIMultipleSelect",value:[]})}constructor(e,n){super(e,An($m.DEFAULTS,n)),pme(this,Mf),gh(this,mr,[]),gh(this,Rn,void 0),gh(this,l_,void 0),gh(this,ta,void 0),gh(this,Za,void 0),gh(this,Ja,void 0),sr(ta,this,new Dl(this.hot,{placeholder:L1,className:"htUIMultipleSelectSearch"})),sr(Za,this,new Lm(this.hot,{textContent:H1,className:"htUISelectAll"})),sr(Ja,this,new Lm(this.hot,{textContent:k1,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return Ye(Rn,this)}registerHooks(){Ye(ta,this).addLocalHook("keydown",e=>Wh(Mf,this,bme).call(this,e)),Ye(ta,this).addLocalHook("input",e=>Wh(Mf,this,wme).call(this,e)),Ye(Za,this).addLocalHook("click",e=>Wh(Mf,this,vme).call(this,e)),Ye(Ja,this).addLocalHook("click",e=>Wh(Mf,this,yme).call(this,e))}setItems(e){var n;sr(mr,this,e),(n=Ye(Rn,this))===null||n===void 0||n.loadData(Ye(mr,this))}setLocale(e){sr(l_,this,e)}getLocale(){return Ye(l_,this)}getItems(){return[...Ye(mr,this)]}getValue(){return Sme(Ye(mr,this))}getSearchInputElement(){return Ye(ta,this)}getSelectAllElement(){return Ye(Za,this)}getClearAllElement(){return Ye(Ja,this)}isSelectedAllValues(){return Ye(mr,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,n=e.createElement("div"),i=new Mr(this.hot,{className:"htUISelectionControls",children:[Ye(Za,this),Ye(Ja,this)]});this._element.appendChild(Ye(ta,this).element),this._element.appendChild(i.element),this._element.appendChild(n);const o=r=>{var s;if(!this._element)return;(s=Ye(Rn,this))===null||s===void 0||s.destroy(),ce(r,"htUIMultipleSelectHot"),sr(Rn,this,new this.hot.constructor(r,{data:Ye(mr,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(c,u,h,d,f,g)=>{c.title=g.instance.getDataAtRowProp(u,g.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{Ye(Rn,this).listen()},colWidths:()=>Ye(Rn,this).container.scrollWidth-Xn(e),maxCols:1,autoWrapCol:!0,height:110,copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),Ye(Rn,this).init();const l=Ye(Rn,this).getShortcutManager().getContext("grid");l.removeShortcutsByKeys(["Tab"]),l.removeShortcutsByKeys(["Shift","Tab"]),l.addShortcut({keys:[["Escape"]],callback:c=>{this.runLocalHooks("keydown",c,this)},group:tk}),l.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:c=>{Ye(Rn,this).deselectCell(),this.runLocalHooks("keydown",c,this),this.runLocalHooks("listTabKeydown",c,this)},group:tk})};o(n),this.hot._registerTimeout(()=>o(n),100)}focus(){this.isBuilt()&&Ye(Rn,this).listen()}reset(){Ye(ta,this).reset(),Ye(Za,this).reset(),Ye(Ja,this).reset()}update(){this.isBuilt()&&(Ye(Rn,this).loadData(Cme(Ye(mr,this),this.options.value)),super.update())}destroy(){var e;(e=Ye(Rn,this))===null||e===void 0||e.destroy(),Ye(ta,this).destroy(),Ye(Ja,this).destroy(),Ye(Za,this).destroy(),sr(ta,this,null),sr(Ja,this,null),sr(Za,this,null),sr(Rn,this,null),sr(mr,this,null),super.destroy()}}function wme(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let n;e===""?n=[...Ye(mr,this)]:n=Ye(mr,this).filter(i=>`${i.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),Ye(Rn,this).loadData(n)}function bme(t){this.runLocalHooks("keydown",t,this),BV(wp,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),$r(t),Ye(Rn,this).listen(),Ye(Rn,this).selectCell(0,0))}function vme(t){const e=[];t.preventDefault(),Ye(Rn,this).getSourceData().forEach((n,i)=>{n.checked=!0,e.push(VB(n,i)[0])}),Ye(Rn,this).setSourceDataAtCell(e)}function yme(t){const e=[];t.preventDefault(),Ye(Rn,this).getSourceData().forEach((n,i)=>{n.checked=!1,e.push(VB(n,i)[0])}),Ye(Rn,this).setSourceDataAtCell(e)}function Cme(t,e){const n=Pp(e);return t.map(i=>(i.checked=n(i.value),i))}function Sme(t){const e=[];return t.forEach(n=>{n.checked&&e.push(n.value)}),e}function _me(t,e){Rme(t,e),e.add(t)}function Rme(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xme(t,e,n){return(e=Eme(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Eme(t){var e=Tme(t,"string");return typeof e=="symbol"?e:e+""}function Tme(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gw(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Pf=new WeakSet;class Mme extends Mp{constructor(e,n){super(e,{id:n.id,stateless:!1}),_me(this,Pf),xme(this,"name",""),this.name=n.name,this.elements.push(new $m(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>Gw(Pf,this,Pme).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,n)=>Gw(Pf,this,Ome).call(this,e,n))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===tu){const n=this.getMultipleSelectElement();n.setItems(e.itemsSnapshot),n.setValue(e.args[0]),n.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),n=e.getItems();return{command:{key:e.isSelectedAllValues()||!n.length?Yn:tu},args:[e.getValue()],itemsSnapshot:n}}updateState(e){const n=(i,o,r,s,a)=>{const[l]=Fl(o,h=>h.name===tu),c={},u=this.hot.getTranslatedPhrase(ly);if(l){const h=s(i,a),d=rt(h,C=>C.value),f=new Map(h.map(C=>[C.value,this.hot.getCellMeta(C.meta.visualRow,C.meta.visualCol)])),g=_x(d);r&&(l.args[0]=r);const m=[],w=UH(g,l.args[0],u,C=>{C.checked&&m.push(C.value),Gw(Pf,this,nk).call(this,C,f)}),b=e.editedConditionStack.column;c.locale=this.hot.getCellMeta(0,b).locale,c.args=[m],c.command=eu(tu),c.itemsSnapshot=w}else c.args=[],c.command=eu(Yn);this.state.setValueAtIndex(i,c)};n(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&n(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter(e=>e instanceof $m)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,i,o,r,s)=>{ce(n.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return ce(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||F(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getTranslatedPhrase(ly),n=this._getColumnVisibleValues(),i=n.map(l=>l.value),o=new Map(n.map(l=>[l.value,l.meta])),r=_x(i),s=UH(r,r,e,l=>{Gw(Pf,this,nk).call(this,l,o)});this.getMultipleSelectElement().setItems(s),super.reset(),this.getMultipleSelectElement().setValue(r);const a=this.hot.getPlugin("filters").getSelectedColumn();a!==null&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,a.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return e===null?[]:rt(this.hot.getDataAtCol(e.visualIndex),(n,i)=>({value:kB(n),meta:this.hot.getCellMeta(i,e.visualIndex)}))}}function Pme(t){wp(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),$r(t))}function nk(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function Ome(t,e){switch(e.type){case"numeric":return QV(t,e);default:return t}}var UB;function Ime(t,e){Ame(t,e),e.add(t)}function Ame(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hme(t,e,n){return(e=kme(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kme(t){var e=Nme(t,"string");return typeof e=="symbol"?e:e+""}function Nme(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dme(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ik=new WeakSet;class Fm extends Mp{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,n){super(e,{id:n.id,stateless:!0}),Ime(this,ik),Hme(this,"name",""),this.name=n.name,this.elements.push(new Dl(this.hot,{type:"button",value:N1,className:"htUIButton htUIButtonOK",identifier:Fm.BUTTON_OK})),this.elements.push(new Dl(this.hot,{type:"button",value:D1,className:"htUIButton htUIButtonCancel",identifier:Fm.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){F(this.elements,e=>{e.addLocalHook("click",(n,i)=>Dme(ik,this,Lme).call(this,n,i))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(ce(n.parentNode,"htFiltersMenuActionBar"),F(this.elements,i=>n.appendChild(i.element)),n)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}UB=Fm;function Lme(t,e){e.options.identifier===UB.BUTTON_OK?this.accept():this.cancel()}function Kw(t,e,n){return(e=$me(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $me(t){var e=Fme(t,"string");return typeof e=="symbol"?e:e+""}function Fme(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const ok="ConditionCollection.filteringStates";class $M{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Kw(this,"hot",void 0),Kw(this,"isMapRegistrable",void 0),Kw(this,"filteringStates",new jC),Kw(this,"previousConditionStack",null),this.hot=e,this.isMapRegistrable=n,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(ok,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return this.getFilteredColumns().length===0}isMatch(e,n){var i;const o=this.filteringStates.getValueAtIndex(n),r=(i=o==null?void 0:o.conditions)!==null&&i!==void 0?i:[],s=o==null?void 0:o.operation;return this.isMatchInConditions(r,e,s)}isMatchInConditions(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nl;return e.length?Tge(i)(e,n):!0}addCondition(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nl,o=arguments.length>3?arguments[3]:void 0;const r=this.hot.getCellMeta(0,e).locale,s=rt(n.args,u=>typeof u=="string"?u.toLocaleLowerCase(r):u),a=n.name||n.command.key;this.previousConditionStack===null&&this.setPreviousConditionStack(this.exportAllConditions()),this.runLocalHooks("beforeAdd",e);const l=this.getOperation(e);if(l){if(l!==i)throw Error(Et`The column of index ${e} has been already applied with a \`${l}\`\x20
+ filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
+ Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
+ use it consequently for a particular column).`)}else if(Gt(Nm[i]))throw new Error(Et`Unexpected operation named \`${i}\`. Possible ones are\x20
+ \`disjunction\` and \`conjunction\`.`);const c=this.getConditions(e);c.length===0?this.filteringStates.setValueAtIndex(e,{operation:i,conditions:[{name:a,args:s,func:Vl(a,s)}]},o):c.push({name:a,args:s,func:Vl(a,s)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var n,i;return(n=(i=this.filteringStates.getValueAtIndex(e))===null||i===void 0?void 0:i.conditions)!==null&&n!==void 0?n:[]}getOperation(e){var n;return(n=this.filteringStates.getValueAtIndex(e))===null||n===void 0?void 0:n.operation}getFilteredColumns(){return this.filteringStates.getEntries().map(e=>{let[n]=e;return n})}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return Li(this.filteringStates.getEntries(),(e,n)=>{let[i,{operation:o,conditions:r}]=n;return e.push({column:i,operation:o,conditions:rt(r,s=>{let{name:a,args:l}=s;return{name:a,args:l}})}),e},[])}importAllConditions(e){this.clean(),F(e,n=>{F(n.conditions,i=>this.addCondition(n.column,i))})}removeConditions(e){this.setPreviousConditionStack(this.exportAllConditions()),this.runLocalHooks("beforeRemove",e),this.filteringStates.clearValue(e),this.runLocalHooks("afterRemove",e)}clean(){this.runLocalHooks("beforeClean"),this.filteringStates.clear(),this.runLocalHooks("afterClean")}hasConditions(e,n){const i=this.getConditions(e);return n?i.some(o=>o.name===n):i.length>0}setPreviousConditionStack(e){this.previousConditionStack=e}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(ok),this.filteringStates=null,this.clearLocalHooks()}}Ht($M,li);function rk(t,e,n){return(e=Vme(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vme(t){var e=Wme(t,"string");return typeof e=="symbol"?e:e+""}function Wme(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class zB{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];rk(this,"conditionCollection",void 0),rk(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=n}filter(){let e=[];return F(this.conditionCollection.getFilteredColumns(),(n,i)=>{let o=this.columnDataFactory(n);i&&(o=this._getIntersectData(o,e)),e=this.filterByColumn(n,o)}),e}filterByColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const i=[];return F(n,o=>{o!==void 0&&this.conditionCollection.isMatch(o,e)&&i.push(o)}),i}_getIntersectData(e,n){const i=[];return F(n,o=>{const r=o.meta.visualRow;e[r]!==void 0&&(i[r]=e[r])}),i}}function Bme(t,e){jme(t,e),e.add(t)}function jme(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yc(t,e,n){return(e=Ume(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ume(t){var e=zme(t,"string");return typeof e=="symbol"?e:e+""}function zme(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function c_(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var qw=new WeakSet;class YB{constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];Bme(this,qw),yc(this,"hot",void 0),yc(this,"conditionCollection",void 0),yc(this,"columnDataFactory",void 0),yc(this,"changes",[]),yc(this,"grouping",!1),yc(this,"latestEditedColumnPosition",-1),yc(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=n,this.columnDataFactory=i,this.conditionCollection.addLocalHook("beforeRemove",o=>c_(qw,this,Yme).call(this,o)),this.conditionCollection.addLocalHook("afterRemove",o=>this.updateStatesAtColumn(o)),this.conditionCollection.addLocalHook("afterAdd",o=>this.updateStatesAtColumn(o)),this.conditionCollection.addLocalHook("beforeClean",()=>c_(qw,this,Gme).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>c_(qw,this,Kme).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,F(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,n){var i=this;if(this.grouping){this.changes.indexOf(e)===-1&&this.changes.push(e);return}const o=this.conditionCollection.exportAllConditions();let r=this.conditionCollection.getColumnStackPosition(e);r===-1&&(r=this.latestEditedColumnPosition);const s=o.slice(0,r),a=o.slice(r);a.length&&a[0].column===e&&a.shift();const l=Lne(function(u,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const f=new $M(i.hot,!1),g=[].concat(u,d);f.importAllConditions(g);const m=i.columnDataFactory(h);let w;f.isEmpty()?w=m:w=new zB(f,C=>i.columnDataFactory(C)).filter(),w=rt(w,C=>C.meta.visualRow);const b=Pp(w);return f.destroy(),Fl(m,C=>b(C.meta.visualRow))})(s),c=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:c},dependentConditionStacks:a,filteredRowsFactory:l,conditionArgsChange:n})}destroy(){this.clearLocalHooks(),Ze(this,(e,n)=>{this[n]=null})}}function Yme(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function Gme(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function Kme(){F(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}Ht(YB,li);function qme(t){return sB({initialPage:0,size:()=>t.length,onItemSelect:(n,i)=>{const o=t[n];if(o instanceof $m)return i;if(o.element&&!fd(o.element))return!1;o.focus()}})}const Of="filters";function Xme(t,e){let n=-1;const i=qme(e),o=l=>()=>{t.isOpened()&&t.getKeyboardShortcutsCtrl().listen(Of),i.setCurrentPage(e.indexOf(l))};e.forEach(l=>{l instanceof Mr&&(l.addLocalHook("click",o(l)),l.addLocalHook("focus",o(l)),l.addLocalHook("afterClose",o(l)))}),t.addLocalHook("afterSelectionChange",l=>{l.key.startsWith("filter_")||i.clear()});function r(l){const c=t.getKeyboardShortcutsCtrl(),u=l.getKeyboardShortcutsCtrl();i.clear(),u.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:c.getContext(Of),callback:()=>{l.isSubMenu()&&l.close(),c.listen(Of)}}]),!l.isSubMenu()&&c.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:h=>{const d=t.getNavigator();d.getCurrentPage()>-1&&(n=d.getCurrentPage()),d.clear(),h.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{t.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:h=>{const d=e[i.getCurrentPage()];d instanceof Dm&&(d.openOptions(),h.preventDefault()),d instanceof Lm&&(d.activate(),h.preventDefault()),d instanceof Mr||h.preventDefault()}}],Of)}t.addLocalHook("afterSubmenuOpen",r),t.addLocalHook("afterOpen",r);function s(){t.focus(),t.getKeyboardShortcutsCtrl().listen(Of)}function a(){return n}return{...i,listen:s,getLastMenuPage:a}}function Zme(t,e){GB(t,e),e.add(t)}function Jme(t,e,n){GB(t,e),e.set(t,n)}function GB(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function If(t,e,n){return(e=Qme(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qme(t){var e=epe(t,"string");return typeof e=="symbol"?e:e+""}function epe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tpe(t,e,n){return t.set(lo(t,e),n),n}function Af(t,e){return t.get(lo(t,e))}function lo(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const xx="filters",npe=250,sk=xx;var Cc=new WeakMap,To=new WeakSet;class ipe extends St{static get PLUGIN_KEY(){return xx}static get PLUGIN_PRIORITY(){return npe}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){super(e),Zme(this,To),If(this,"dropdownMenuPlugin",null),If(this,"conditionCollection",null),If(this,"conditionUpdateObserver",null),If(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),If(this,"filtersRowsMap",null),Jme(this,Cc,void 0),this.hot.addHook("afterGetColHeader",(n,i)=>lo(To,this,cpe).call(this,n,i))}isEnabled(){return!!this.hot.getSettings()[xx]}enablePlugin(){if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new Sp),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const e=this.hot.getSettings().dropdownMenu,n=e&&e.uiContainer||this.hot.rootDocument.body,i=s=>(s.addLocalHook("accept",()=>lo(To,this,ak).call(this,"accept")),s.addLocalHook("cancel",()=>lo(To,this,ak).call(this,"cancel")),s.addLocalHook("change",a=>lo(To,this,lpe).call(this,s,a)),s),o=()=>`${this.hot.getTranslatedPhrase(O1)}:`,r=()=>`${this.hot.getTranslatedPhrase(I1)}:`;if(!this.components.get("filter_by_condition")){const s=new Rx(this.hot,{id:"filter_by_condition",name:o,addSeparator:!1,menuContainer:n});s.addLocalHook("afterClose",()=>lo(To,this,lk).call(this)),this.components.set("filter_by_condition",i(s))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new ame(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const s=new Rx(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:n});s.addLocalHook("afterClose",()=>lo(To,this,lk).call(this)),this.components.set("filter_by_condition2",i(s))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",i(new Mme(this.hot,{id:"filter_by_value",name:r}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",i(new Fm(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new $M(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new YB(this.hot,this.conditionCollection,s=>this.getDataMapAtColumn(s)),this.conditionUpdateObserver.addLocalHook("update",s=>lo(To,this,upe).call(this,s))),this.components.forEach(s=>s.show()),this.addHook("afterDropdownMenuDefaultOptions",s=>lo(To,this,ape).call(this,s)),this.addHook("afterDropdownMenuShow",()=>lo(To,this,rpe).call(this)),this.addHook("afterDropdownMenuHide",()=>lo(To,this,spe).call(this)),this.addHook("afterChange",s=>lo(To,this,ope).call(this,s)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!Af(Cc,this)&&this.dropdownMenuPlugin.enabled){const s=this.dropdownMenuPlugin.menu,a=[{focus:()=>{const c=s.getNavigator(),u=Af(Cc,this).getLastMenuPage();s.focus(),u>0?c.setCurrentPage(u):c.toFirstItem()}},...Array.from(this.components).map(c=>{let[,u]=c;return u.getElements()}).flat()];tpe(Cc,this,Xme(s,a));const l=c=>{Af(Cc,this).listen(),c.preventDefault(),wp(c.keyCode,"TAB")&&(c.shiftKey?Af(Cc,this).toPreviousItem():Af(Cc,this).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",l),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",l)}this.registerShortcuts(),super.enablePlugin()}disablePlugin(){if(this.enabled){var e;(e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach((n,i)=>{n.destroy(),this.components.set(i,null)}),this.conditionCollection.destroy(),this.conditionCollection=null,this.hot.rowIndexMapper.unregisterMap(this.pluginName)}this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Alt","A"]],stopPropagation:!0,callback:()=>{const e=this.hot.getSelected();this.clearConditions(),this.filter(),e&&this.hot.selectCells(e)},group:sk})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(sk)}addCondition(e,n,i){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Nl;const r=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(r,{command:{key:n},args:i},o)}removeConditions(e){const n=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(n)}clearConditions(e){if(e===void 0)this.conditionCollection.clean();else{const n=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(n)}}filter(){const{navigableHeaders:e}=this.hot.getSettings(),n=this._createDataFilter(),i=!this.conditionCollection.isEmpty();let o=[];const r=this.conditionCollection.exportAllConditions();if(this.hot.runHooks("beforeFilter",r,this.conditionCollection.previousConditionStack)!==!1)if(i){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),o=rt(n.filter(),c=>c.meta.visualRow);const l=Pp(o);Oe(this.hot.countSourceRows()-1,c=>{l(c)||a.push(c)}),F(a,c=>{this.filtersRowsMap.setValueAtIndex(c,!0)})},!0),!e&&!o.length&&this.hot.deselectCell()}else this.filtersRowsMap.clear();this.hot.runHooks("afterFilter",r),this.conditionCollection.setPreviousConditionStack(null),this.hot.view.adjustElementsSize(),this.hot.render(),this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col)}getSelectedColumn(){var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n?{visualIndex:n.col,physicalIndex:this.hot.toPhysicalColumn(n.col)}:null}getDataMapAtColumn(e){const n=this.hot.toVisualColumn(e),i=[];return F(this.hot.getSourceDataAtCol(n),(o,r)=>{var s;const{row:a,col:l,visualCol:c,visualRow:u,type:h,instance:d,dateFormat:f,locale:g}=this.hot.getCellMeta(r,n),m=(s=this.hot.getDataAtCell(this.hot.toVisualRow(r),n))!==null&&s!==void 0?s:o;i.push({meta:{row:a,col:l,visualCol:c,visualRow:u,type:h,instance:d,dateFormat:f,locale:g},value:kB(m)})}),i}updateValueComponentCondition(e){const n=this.hot.getDataAtCol(e),i=_x(n);this.conditionUpdateObserver.updateStatesAtColumn(e,i)}restoreComponents(e){var n;const i=(n=this.getSelectedColumn())===null||n===void 0?void 0:n.physicalIndex;e.forEach(o=>{o.isHidden()||o.restoreState(i)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,n,i,o){let r=e;return r===vy&&n.command.key!==Yn&&i.command.key!==Yn&&o.command.key!==Yn?r=DM:o.command.key!==Yn&&(n.command.key===Yn||i.command.key===Yn)&&(r=Nl),r}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:n}=e.getState(),i=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];n.showOperators?this.showComponents(...i):this.hideComponents(...i)}_createDataFilter(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.conditionCollection;return new zB(e,n=>this.getDataMapAtColumn(n))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const n=this.dropdownMenuPlugin.menu;for(var i=arguments.length,o=new Array(i),r=0;r{F(n.menuItems,(a,l)=>{a.key===s.getMenuItemDescriptor().key&&e.push(l)})}),e}changeComponentsVisibility(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.dropdownMenuPlugin)return;const i=this.dropdownMenuPlugin.menu.hotMenu,o=i.getPlugin("hiddenRows");for(var r=arguments.length,s=new Array(r>1?r-1:0),a=1;a{e!==null&&(e.destroy(),this.components.set(n,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function ope(t){t&&F(t,e=>{const[,n]=e,i=this.hot.propToCol(n);this.conditionCollection.hasConditions(i)&&this.updateValueComponentCondition(i)})}function rpe(){const t=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),t.updateMenuDimensions()}function spe(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function ape(t){t.items.push({name:qe}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function ak(t){var e;if(t==="accept"){const i=this.getSelectedColumn();if(i===null){var n;(n=this.dropdownMenuPlugin)===null||n===void 0||n.close();return}const{physicalIndex:o}=i,r=this.components.get("filter_by_condition").getState(),s=this.components.get("filter_by_condition2").getState(),a=this.components.get("filter_by_value").getState(),l=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),r,s,a);this.conditionUpdateObserver.groupChanges();let c=this.conditionCollection.getColumnStackPosition(o);c===-1&&(c=void 0),this.conditionCollection.removeConditions(o),r.command.key!==Yn&&(this.conditionCollection.addCondition(o,r,l,c),s.command.key!==Yn&&this.conditionCollection.addCondition(o,s,l,c)),a.command.key!==Yn&&this.conditionCollection.addCondition(o,a,l,c),this.conditionUpdateObserver.flush(),this.components.forEach(u=>u.saveState(o)),this.filtersRowsMap.clear(),this.filter()}(e=this.dropdownMenuPlugin)===null||e===void 0||e.close()}function lpe(t,e){this.updateDependentComponentsVisibility(),t.constructor===Rx&&!e.inputsCount&&this.setListeningDropdownMenu()}function lk(){this.setListeningDropdownMenu()}function cpe(t,e){const n=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(n)?ce(e,"htFiltersActive"):Be(e,"htFiltersActive")}function upe(t){var e;if(!((e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled))return;const{editedConditionStack:{conditions:n,column:i}}=t,o=n.filter(s=>s.name===tu),r=n.filter(s=>s.name!==tu);if(o.length>=2||r.length>=3)xt(Et`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
+ The overall amount of conditions exceed the capability of the dropdown menu.\x20
+ For more details see the documentation.`);else{const s=this.conditionCollection.getOperation(i);this.components.get("filter_by_condition").updateState(r[0],i),this.components.get("filter_by_condition2").updateState(r[1],i),this.components.get("filter_operators").updateState(s,i),this.components.get("filter_by_value").updateState(t)}}const KB="internal-use-in-handsontable",Ex={licenseKey:KB,useArrayArithmetic:!0,useColumnIndex:!1,useStats:!1,evaluateNullToZero:!0,precisionEpsilon:1e-13,precisionRounding:14,smartRounding:!0,leapYear1900:!1,nullDate:{year:1899,month:12,day:30},nullYear:30,dateFormats:["DD/MM/YYYY","DD/MM/YY"],timeFormats:["hh:mm","hh:mm:ss.sss"],matchWholeCell:!0,useRegularExpressions:!1,useWildcards:!0,functionArgSeparator:",",thousandSeparator:"",decimalSeparator:".",language:"enGB"};function qB(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[yi])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function XB(t){return Object.keys(t).reduce((e,n)=>(n!=="hyperformula"&&(e[n]=t[n]),e),{})}function hpe(t){var e;const n=t[yi],i=XB(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),o=qB(t);return{...Ex,...i,...o}}function dpe(t){var e;const n=t[yi],i=XB(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),o=qB(t);return{...i,...o}}function fpe(t,e){return Object.keys(e).some(n=>e[n]!==void 0&&e[n]!==t[n])}function oS(){const t="engine_relationship",e=Fr(yi);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function FM(){const t="shared_engine_usage",e=Fr(yi);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function gpe(t){const e=t.getSettings(),n=e[yi],i=n==null?void 0:n.engine;if(n===!0||Gt(i))return null;if(typeof i.hyperformula=="function"||typeof i=="function"){var o;return mpe((o=i.hyperformula)!==null&&o!==void 0?o:i,e,t)}else if(typeof i=="object"&&Gt(i.hyperformula)){const r=oS(),s=FM().get(i);return r.has(i)||r.set(i,[]),r.get(i).push(t),s&&s.push(t.guid),i.getConfig().licenseKey||i.updateConfig({licenseKey:KB}),(i.getConfig().leapYear1900!==Ex.leapYear1900||uT(i.getConfig().nullDate,Ex.nullDate)===!1)&&xt(Et`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
+ settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),i}return null}function mpe(t,e,n){const i=e[yi],o=hpe(e),r=oS(),s=FM();ppe(t,i.functions),wpe(t,i.language);const a=t.buildEmpty(o);return r.set(a,[n]),s.set(a,[n.guid]),bpe(a,i.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function ck(t){var e;const n=oS(),i=n.size===0?[]:Array.from((e=n.get(t))!==null&&e!==void 0?e:[]);return new Map(i.map(o=>[o.getPlugin("formulas").sheetId,o]))}function uk(t,e){if(t){const n=oS(),i=n.get(t),o=FM(),r=o.get(t);i&&i.includes(e)&&(i.splice(i.indexOf(e),1),i.length===0&&n.delete(t)),r&&r.includes(e.guid)&&(r.splice(r.indexOf(e.guid),1),r.length===0&&(o.delete(t),t.destroy()))}}function ppe(t,e){e&&e.forEach(n=>{const{name:i,plugin:o,translations:r}=n;try{t.registerFunction(i,o,r)}catch(s){xt(s.message)}})}function wpe(t,e){if(e){const{langCode:n}=e;try{t.registerLanguage(n,e)}catch(i){xt(i.message)}}}function bpe(t,e){e&&(t.suspendEvaluation(),e.forEach(n=>{const{name:i,expression:o,scope:r,options:s}=n;try{t.addNamedExpression(i,o,r,s)}catch(a){xt(a.message)}}),t.resumeEvaluation())}function vpe(t,e){return(Gt(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const ZB="DD/MM/YYYY";function JB(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function ype(t){return JB(t)?t.substr(1):t}function Cpe(t){return typeof t=="string"&&t.startsWith("=")}function VM(t,e){return typeof t=="string"&&e==="date"}function QB(t,e){return le(t,e,!0).isValid()}function ej(t,e){return le(t,e,!0).format(ZB)}function Spe(t,e){return le(t,ZB,!0).format(e)}function tj(t,e){const i=new Date(Date.UTC(0,0,t+-1));return le(i).format(e)}function _pe(t,e,n){const i=Array.from(Array(n).keys()).filter(r=>t.includes(r)===!1);if(e===0){var o;return(o=i[e])!==null&&o!==void 0?o:0}return i[e-1]+1}function Rpe(t,e){const n=[];return t.forEach(i=>{const o={from:i,to:e};n.forEach(r=>{const s=r.from>r.to,a=r.to<=o.from;r.from>o.from&&a&&s&&(o.from+=1)}),o.from>=e&&(e+=1),n.push(o)}),n}function xpe(t){return t.forEach((e,n)=>{t.slice(n+1).forEach(o=>{const r=o.frome.from&&r&&(o.from-=1)})}),t}function WM(t,e,n){const i=Rpe(t,_pe(t,e,n));return xpe(i)}function Sc(t,e,n){Epe(t,e),e.set(t,n)}function Epe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jt(t,e){return t.get(nj(t,e))}function Qa(t,e,n){return t.set(nj(t,e),n),n}function nj(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Hf=new WeakMap,el=new WeakMap,io=new WeakMap,Xw=new WeakMap,u_=new WeakMap,h_=new WeakMap,Zw=new WeakMap;class hk{constructor(e,n,i){Sc(this,Hf,void 0),Sc(this,el,void 0),Sc(this,io,void 0),Sc(this,Xw,[]),Sc(this,u_,[]),Sc(this,h_,void 0),Sc(this,Zw,[]),Qa(Hf,this,e),Qa(el,this,n),Qa(io,this,i)}setRemovedHfIndexes(e){return Qa(Zw,this,e.map(n=>{const i=Jt(el,this).getVisualFromPhysicalIndex(n);return this.getHfIndexFromVisualIndex(i)})),Jt(Zw,this)}getRemovedHfIndexes(){return Jt(Zw,this)}getHfIndexFromVisualIndex(e){const n=Jt(el,this).getIndexesSequence(),i=Jt(el,this).getNotTrimmedIndexes();return n.indexOf(i[e])}syncMoves(e){const i=`move${Hr(Jt(Hf,this))}s`;Jt(io,this).getEngine().batch(()=>{e.forEach(o=>{const r=o.from!==o.to,s=o.from+1!==o.to;r&&s&&Jt(io,this).getEngine()[i](Jt(io,this).getSheetId(),o.from,1,o.to)})})}storeMovesInformation(e,n,i){i!==!1&&(Qa(u_,this,e.map(o=>this.getHfIndexFromVisualIndex(o))),Qa(h_,this,this.getHfIndexFromVisualIndex(n)))}calculateAndSyncMoves(e,n){if(Jt(io,this).isPerformingUndoRedo()||e===!1||n===!1)return;const i=WM(Jt(u_,this),Jt(h_,this),Jt(el,this).getNumberOfIndexes());Jt(io,this).getSheetId()===null?Jt(io,this).getPostponeAction(()=>this.syncMoves(i)):this.syncMoves(i)}getIndexesChangeSyncMethod(){const e=`set${Hr(Jt(Hf,this))}Order`;return n=>{if(Jt(io,this).isPerformingUndoRedo())return;const i=Jt(el,this).getIndexesSequence();if(n==="update"&&i.length>0){const o=Jt(Xw,this).map(l=>i.indexOf(l)),r=Jt(io,this).getEngine().getSheetDimensions(Jt(io,this).getSheetId());let s;Jt(Hf,this)==="row"?s=r.height:s=r.width;const a=o.length;for(let l=a;l