@sps-woodland/editable-table 8.50.1 → 8.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.umd.cjs CHANGED
@@ -1,86 +1 @@
1
- (function(ki,mt){typeof exports=="object"&&typeof module<"u"?mt(exports,require("react"),require("react-dom"),require("@sps-woodland/core")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@sps-woodland/core"],mt):(ki=typeof globalThis<"u"?globalThis:ki||self,mt(ki.EditableTable={},ki.React,ki.ReactDOM,ki.core))})(this,(function(ki,mt,Wd,GT){"use strict";function rF(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const ms=rF(mt);var qT=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},KT={},hc,XT;function dn(){if(XT)return hc;XT=1;var t=function(e){return e&&e.Math===Math&&e};return hc=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof qT=="object"&&qT)||t(typeof hc=="object"&&hc)||(function(){return this})()||Function("return this")(),hc}var Gp={},qp,ZT;function Rn(){return ZT||(ZT=1,qp=function(t){try{return!!t()}catch{return!0}}),qp}var Kp,QT;function kr(){if(QT)return Kp;QT=1;var t=Rn();return Kp=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Kp}var Xp,JT;function Bd(){if(JT)return Xp;JT=1;var t=Rn();return Xp=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Xp}var Zp,e_;function In(){if(e_)return Zp;e_=1;var t=Bd(),e=Function.prototype.call;return Zp=t?e.bind(e):function(){return e.apply(e,arguments)},Zp}var Qp={},t_;function iF(){if(t_)return Qp;t_=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);return Qp.f=n?function(i){var o=e(this,i);return!!o&&o.enumerable}:t,Qp}var Jp,n_;function jd(){return n_||(n_=1,Jp=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),Jp}var ew,r_;function Xt(){if(r_)return ew;r_=1;var t=Bd(),e=Function.prototype,n=e.call,r=t&&e.bind.bind(n,n);return ew=t?r:function(i){return function(){return n.apply(i,arguments)}},ew}var tw,i_;function oa(){if(i_)return tw;i_=1;var t=Xt(),e=t({}.toString),n=t("".slice);return tw=function(r){return n(e(r),8,-1)},tw}var nw,o_;function oF(){if(o_)return nw;o_=1;var t=Xt(),e=Rn(),n=oa(),r=Object,i=t("".split);return nw=e(function(){return!r("z").propertyIsEnumerable(0)})?function(o){return n(o)==="String"?i(o,""):r(o)}:r,nw}var rw,s_;function Ud(){return s_||(s_=1,rw=function(t){return t==null}),rw}var iw,a_;function dc(){if(a_)return iw;a_=1;var t=Ud(),e=TypeError;return iw=function(n){if(t(n))throw new e("Can't call method on "+n);return n},iw}var ow,l_;function fc(){if(l_)return ow;l_=1;var t=oF(),e=dc();return ow=function(n){return t(e(n))},ow}var sw,u_;function tn(){if(u_)return sw;u_=1;var t=typeof document=="object"&&document.all;return sw=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},sw}var aw,c_;function oi(){if(c_)return aw;c_=1;var t=tn();return aw=function(e){return typeof e=="object"?e!==null:t(e)},aw}var lw,h_;function Ml(){if(h_)return lw;h_=1;var t=dn(),e=tn(),n=function(r){return e(r)?r:void 0};return lw=function(r,i){return arguments.length<2?n(t[r]):t[r]&&t[r][i]},lw}var uw,d_;function gc(){if(d_)return uw;d_=1;var t=Xt();return uw=t({}.isPrototypeOf),uw}var cw,f_;function zd(){if(f_)return cw;f_=1;var t=dn(),e=t.navigator,n=e&&e.userAgent;return cw=n?String(n):"",cw}var hw,g_;function sF(){if(g_)return hw;g_=1;var t=dn(),e=zd(),n=t.process,r=t.Deno,i=n&&n.versions||r&&r.version,o=i&&i.v8,s,a;return o&&(s=o.split("."),a=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!a&&e&&(s=e.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=e.match(/Chrome\/(\d+)/),s&&(a=+s[1]))),hw=a,hw}var dw,m_;function fw(){if(m_)return dw;m_=1;var t=sF(),e=Rn(),n=dn(),r=n.String;return dw=!!Object.getOwnPropertySymbols&&!e(function(){var i=Symbol("symbol detection");return!r(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&t&&t<41}),dw}var gw,p_;function w_(){if(p_)return gw;p_=1;var t=fw();return gw=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",gw}var mw,v_;function pw(){if(v_)return mw;v_=1;var t=Ml(),e=tn(),n=gc(),r=w_(),i=Object;return mw=r?function(o){return typeof o=="symbol"}:function(o){var s=t("Symbol");return e(s)&&n(s.prototype,i(o))},mw}var ww,C_;function Yd(){if(C_)return ww;C_=1;var t=String;return ww=function(e){try{return t(e)}catch{return"Object"}},ww}var vw,y_;function Jn(){if(y_)return vw;y_=1;var t=tn(),e=Yd(),n=TypeError;return vw=function(r){if(t(r))return r;throw new n(e(r)+" is not a function")},vw}var Cw,b_;function mc(){if(b_)return Cw;b_=1;var t=Jn(),e=Ud();return Cw=function(n,r){var i=n[r];return e(i)?void 0:t(i)},Cw}var yw,S_;function aF(){if(S_)return yw;S_=1;var t=In(),e=tn(),n=oi(),r=TypeError;return yw=function(i,o){var s,a;if(o==="string"&&e(s=i.toString)&&!n(a=t(s,i))||e(s=i.valueOf)&&!n(a=t(s,i))||o!=="string"&&e(s=i.toString)&&!n(a=t(s,i)))return a;throw new r("Can't convert object to primitive value")},yw}var bw={exports:{}},Sw,R_;function ps(){return R_||(R_=1,Sw=!1),Sw}var Rw,E_;function Ew(){if(E_)return Rw;E_=1;var t=dn(),e=Object.defineProperty;return Rw=function(n,r){try{e(t,n,{value:r,configurable:!0,writable:!0})}catch{t[n]=r}return r},Rw}var T_;function Tw(){if(T_)return bw.exports;T_=1;var t=ps(),e=dn(),n=Ew(),r="__core-js_shared__",i=bw.exports=e[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.41.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"}),bw.exports}var _w,__;function M_(){if(__)return _w;__=1;var t=Tw();return _w=function(e,n){return t[e]||(t[e]=n||{})},_w}var Mw,I_;function Il(){if(I_)return Mw;I_=1;var t=dc(),e=Object;return Mw=function(n){return e(t(n))},Mw}var Iw,P_;function Lr(){if(P_)return Iw;P_=1;var t=Xt(),e=Il(),n=t({}.hasOwnProperty);return Iw=Object.hasOwn||function(i,o){return n(e(i),o)},Iw}var Pw,O_;function x_(){if(O_)return Pw;O_=1;var t=Xt(),e=0,n=Math.random(),r=t(1 .toString);return Pw=function(i){return"Symbol("+(i===void 0?"":i)+")_"+r(++e+n,36)},Pw}var Ow,A_;function si(){if(A_)return Ow;A_=1;var t=dn(),e=M_(),n=Lr(),r=x_(),i=fw(),o=w_(),s=t.Symbol,a=e("wks"),l=o?s.for||s:s&&s.withoutSetter||r;return Ow=function(u){return n(a,u)||(a[u]=i&&n(s,u)?s[u]:l("Symbol."+u)),a[u]},Ow}var xw,H_;function lF(){if(H_)return xw;H_=1;var t=In(),e=oi(),n=pw(),r=mc(),i=aF(),o=si(),s=TypeError,a=o("toPrimitive");return xw=function(l,u){if(!e(l)||n(l))return l;var c=r(l,a),h;if(c){if(u===void 0&&(u="default"),h=t(c,l,u),!e(h)||n(h))return h;throw new s("Can't convert object to primitive value")}return u===void 0&&(u="number"),i(l,u)},xw}var Aw,N_;function D_(){if(N_)return Aw;N_=1;var t=lF(),e=pw();return Aw=function(n){var r=t(n,"string");return e(r)?r:r+""},Aw}var Hw,k_;function Nw(){if(k_)return Hw;k_=1;var t=dn(),e=oi(),n=t.document,r=e(n)&&e(n.createElement);return Hw=function(i){return r?n.createElement(i):{}},Hw}var Dw,L_;function $_(){if(L_)return Dw;L_=1;var t=kr(),e=Rn(),n=Nw();return Dw=!t&&!e(function(){return Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a!==7}),Dw}var F_;function V_(){if(F_)return Gp;F_=1;var t=kr(),e=In(),n=iF(),r=jd(),i=fc(),o=D_(),s=Lr(),a=$_(),l=Object.getOwnPropertyDescriptor;return Gp.f=t?l:function(c,h){if(c=i(c),h=o(h),a)try{return l(c,h)}catch{}if(s(c,h))return r(!e(n.f,c,h),c[h])},Gp}var kw={},Lw,W_;function B_(){if(W_)return Lw;W_=1;var t=kr(),e=Rn();return Lw=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Lw}var $w,j_;function nn(){if(j_)return $w;j_=1;var t=oi(),e=String,n=TypeError;return $w=function(r){if(t(r))return r;throw new n(e(r)+" is not an object")},$w}var U_;function ws(){if(U_)return kw;U_=1;var t=kr(),e=$_(),n=B_(),r=nn(),i=D_(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l="enumerable",u="configurable",c="writable";return kw.f=t?n?function(d,f,m){if(r(d),f=i(f),r(m),typeof d=="function"&&f==="prototype"&&"value"in m&&c in m&&!m[c]){var b=a(d,f);b&&b[c]&&(d[f]=m.value,m={configurable:u in m?m[u]:b[u],enumerable:l in m?m[l]:b[l],writable:!1})}return s(d,f,m)}:s:function(d,f,m){if(r(d),f=i(f),r(m),e)try{return s(d,f,m)}catch{}if("get"in m||"set"in m)throw new o("Accessors not supported");return"value"in m&&(d[f]=m.value),d},kw}var Fw,z_;function Pl(){if(z_)return Fw;z_=1;var t=kr(),e=ws(),n=jd();return Fw=t?function(r,i,o){return e.f(r,i,n(1,o))}:function(r,i,o){return r[i]=o,r},Fw}var Vw={exports:{}},Ww,Y_;function uF(){if(Y_)return Ww;Y_=1;var t=kr(),e=Lr(),n=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,i=e(n,"name"),o=i&&(function(){}).name==="something",s=i&&(!t||t&&r(n,"name").configurable);return Ww={EXISTS:i,PROPER:o,CONFIGURABLE:s},Ww}var Bw,G_;function cF(){if(G_)return Bw;G_=1;var t=Xt(),e=tn(),n=Tw(),r=t(Function.toString);return e(n.inspectSource)||(n.inspectSource=function(i){return r(i)}),Bw=n.inspectSource,Bw}var jw,q_;function hF(){if(q_)return jw;q_=1;var t=dn(),e=tn(),n=t.WeakMap;return jw=e(n)&&/native code/.test(String(n)),jw}var Uw,K_;function zw(){if(K_)return Uw;K_=1;var t=M_(),e=x_(),n=t("keys");return Uw=function(r){return n[r]||(n[r]=e(r))},Uw}var Yw,X_;function Gw(){return X_||(X_=1,Yw={}),Yw}var qw,Z_;function Q_(){if(Z_)return qw;Z_=1;var t=hF(),e=dn(),n=oi(),r=Pl(),i=Lr(),o=Tw(),s=zw(),a=Gw(),l="Object already initialized",u=e.TypeError,c=e.WeakMap,h,d,f,m=function(v){return f(v)?d(v):h(v,{})},b=function(v){return function(I){var M;if(!n(I)||(M=d(I)).type!==v)throw new u("Incompatible receiver, "+v+" required");return M}};if(t||o.state){var S=o.state||(o.state=new c);S.get=S.get,S.has=S.has,S.set=S.set,h=function(v,I){if(S.has(v))throw new u(l);return I.facade=v,S.set(v,I),I},d=function(v){return S.get(v)||{}},f=function(v){return S.has(v)}}else{var E=s("state");a[E]=!0,h=function(v,I){if(i(v,E))throw new u(l);return I.facade=v,r(v,E,I),I},d=function(v){return i(v,E)?v[E]:{}},f=function(v){return i(v,E)}}return qw={set:h,get:d,has:f,enforce:m,getterFor:b},qw}var J_;function eM(){if(J_)return Vw.exports;J_=1;var t=Xt(),e=Rn(),n=tn(),r=Lr(),i=kr(),o=uF().CONFIGURABLE,s=cF(),a=Q_(),l=a.enforce,u=a.get,c=String,h=Object.defineProperty,d=t("".slice),f=t("".replace),m=t([].join),b=i&&!e(function(){return h(function(){},"length",{value:8}).length!==8}),S=String(String).split("String"),E=Vw.exports=function(v,I,M){d(c(I),0,7)==="Symbol("&&(I="["+f(c(I),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),M&&M.getter&&(I="get "+I),M&&M.setter&&(I="set "+I),(!r(v,"name")||o&&v.name!==I)&&(i?h(v,"name",{value:I,configurable:!0}):v.name=I),b&&M&&r(M,"arity")&&v.length!==M.arity&&h(v,"length",{value:M.arity});try{M&&r(M,"constructor")&&M.constructor?i&&h(v,"prototype",{writable:!1}):v.prototype&&(v.prototype=void 0)}catch{}var T=l(v);return r(T,"source")||(T.source=m(S,typeof I=="string"?I:"")),v};return Function.prototype.toString=E(function(){return n(this)&&u(this).source||s(this)},"toString"),Vw.exports}var Kw,tM;function Xw(){if(tM)return Kw;tM=1;var t=tn(),e=ws(),n=eM(),r=Ew();return Kw=function(i,o,s,a){a||(a={});var l=a.enumerable,u=a.name!==void 0?a.name:o;if(t(s)&&n(s,u,a),a.global)l?i[o]=s:r(o,s);else{try{a.unsafe?i[o]&&(l=!0):delete i[o]}catch{}l?i[o]=s:e.f(i,o,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return i},Kw}var Zw={},Qw,nM;function dF(){if(nM)return Qw;nM=1;var t=Math.ceil,e=Math.floor;return Qw=Math.trunc||function(r){var i=+r;return(i>0?e:t)(i)},Qw}var Jw,rM;function pc(){if(rM)return Jw;rM=1;var t=dF();return Jw=function(e){var n=+e;return n!==n||n===0?0:t(n)},Jw}var ev,iM;function fF(){if(iM)return ev;iM=1;var t=pc(),e=Math.max,n=Math.min;return ev=function(r,i){var o=t(r);return o<0?e(o+i,0):n(o,i)},ev}var tv,oM;function gF(){if(oM)return tv;oM=1;var t=pc(),e=Math.min;return tv=function(n){var r=t(n);return r>0?e(r,9007199254740991):0},tv}var nv,sM;function Ol(){if(sM)return nv;sM=1;var t=gF();return nv=function(e){return t(e.length)},nv}var rv,aM;function mF(){if(aM)return rv;aM=1;var t=fc(),e=fF(),n=Ol(),r=function(i){return function(o,s,a){var l=t(o),u=n(l);if(u===0)return!i&&-1;var c=e(a,u),h;if(i&&s!==s){for(;u>c;)if(h=l[c++],h!==h)return!0}else for(;u>c;c++)if((i||c in l)&&l[c]===s)return i||c||0;return!i&&-1}};return rv={includes:r(!0),indexOf:r(!1)},rv}var iv,lM;function uM(){if(lM)return iv;lM=1;var t=Xt(),e=Lr(),n=fc(),r=mF().indexOf,i=Gw(),o=t([].push);return iv=function(s,a){var l=n(s),u=0,c=[],h;for(h in l)!e(i,h)&&e(l,h)&&o(c,h);for(;a.length>u;)e(l,h=a[u++])&&(~r(c,h)||o(c,h));return c},iv}var ov,cM;function sv(){return cM||(cM=1,ov=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),ov}var hM;function pF(){if(hM)return Zw;hM=1;var t=uM(),e=sv(),n=e.concat("length","prototype");return Zw.f=Object.getOwnPropertyNames||function(i){return t(i,n)},Zw}var av={},dM;function wF(){return dM||(dM=1,av.f=Object.getOwnPropertySymbols),av}var lv,fM;function vF(){if(fM)return lv;fM=1;var t=Ml(),e=Xt(),n=pF(),r=wF(),i=nn(),o=e([].concat);return lv=t("Reflect","ownKeys")||function(a){var l=n.f(i(a)),u=r.f;return u?o(l,u(a)):l},lv}var uv,gM;function mM(){if(gM)return uv;gM=1;var t=Lr(),e=vF(),n=V_(),r=ws();return uv=function(i,o,s){for(var a=e(o),l=r.f,u=n.f,c=0;c<a.length;c++){var h=a[c];!t(i,h)&&!(s&&t(s,h))&&l(i,h,u(o,h))}},uv}var cv,pM;function CF(){if(pM)return cv;pM=1;var t=Rn(),e=tn(),n=/#|\.prototype\./,r=function(l,u){var c=o[i(l)];return c===a?!0:c===s?!1:e(u)?t(u):!!u},i=r.normalize=function(l){return String(l).replace(n,".").toLowerCase()},o=r.data={},s=r.NATIVE="N",a=r.POLYFILL="P";return cv=r,cv}var hv,wM;function vt(){if(wM)return hv;wM=1;var t=dn(),e=V_().f,n=Pl(),r=Xw(),i=Ew(),o=mM(),s=CF();return hv=function(a,l){var u=a.target,c=a.global,h=a.stat,d,f,m,b,S,E;if(c?f=t:h?f=t[u]||i(u,{}):f=t[u]&&t[u].prototype,f)for(m in l){if(S=l[m],a.dontCallGetSet?(E=e(f,m),b=E&&E.value):b=f[m],d=s(c?m:u+(h?".":"#")+m,a.forced),!d&&b!==void 0){if(typeof S==typeof b)continue;o(S,b)}(a.sham||b&&b.sham)&&n(S,"sham",!0),r(f,m,S,a)}},hv}var dv,vM;function Gd(){if(vM)return dv;vM=1;var t=Bd(),e=Function.prototype,n=e.apply,r=e.call;return dv=typeof Reflect=="object"&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),dv}var fv,CM;function yM(){if(CM)return fv;CM=1;var t=Xt(),e=Jn();return fv=function(n,r,i){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[i]))}catch{}},fv}var gv,bM;function yF(){if(bM)return gv;bM=1;var t=oi();return gv=function(e){return t(e)||e===null},gv}var mv,SM;function bF(){if(SM)return mv;SM=1;var t=yF(),e=String,n=TypeError;return mv=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")},mv}var pv,RM;function EM(){if(RM)return pv;RM=1;var t=yM(),e=oi(),n=dc(),r=bF();return pv=Object.setPrototypeOf||("__proto__"in{}?(function(){var i=!1,o={},s;try{s=t(Object.prototype,"__proto__","set"),s(o,[]),i=o instanceof Array}catch{}return function(l,u){return n(l),r(u),e(l)&&(i?s(l,u):l.__proto__=u),l}})():void 0),pv}var wv,TM;function SF(){if(TM)return wv;TM=1;var t=ws().f;return wv=function(e,n,r){r in e||t(e,r,{configurable:!0,get:function(){return n[r]},set:function(i){n[r]=i}})},wv}var vv,_M;function RF(){if(_M)return vv;_M=1;var t=tn(),e=oi(),n=EM();return vv=function(r,i,o){var s,a;return n&&t(s=i.constructor)&&s!==o&&e(a=s.prototype)&&a!==o.prototype&&n(r,a),r},vv}var Cv,MM;function EF(){if(MM)return Cv;MM=1;var t=si(),e=t("toStringTag"),n={};return n[e]="z",Cv=String(n)==="[object z]",Cv}var yv,IM;function PM(){if(IM)return yv;IM=1;var t=EF(),e=tn(),n=oa(),r=si(),i=r("toStringTag"),o=Object,s=n((function(){return arguments})())==="Arguments",a=function(l,u){try{return l[u]}catch{}};return yv=t?n:function(l){var u,c,h;return l===void 0?"Undefined":l===null?"Null":typeof(c=a(u=o(l),i))=="string"?c:s?n(u):(h=n(u))==="Object"&&e(u.callee)?"Arguments":h},yv}var bv,OM;function qd(){if(OM)return bv;OM=1;var t=PM(),e=String;return bv=function(n){if(t(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(n)},bv}var Sv,xM;function TF(){if(xM)return Sv;xM=1;var t=qd();return Sv=function(e,n){return e===void 0?arguments.length<2?"":n:t(e)},Sv}var Rv,AM;function _F(){if(AM)return Rv;AM=1;var t=oi(),e=Pl();return Rv=function(n,r){t(r)&&"cause"in r&&e(n,"cause",r.cause)},Rv}var Ev,HM;function MF(){if(HM)return Ev;HM=1;var t=Xt(),e=Error,n=t("".replace),r=(function(s){return String(new e(s).stack)})("zxcasd"),i=/\n\s*at [^:]*:[^\n]*/,o=i.test(r);return Ev=function(s,a){if(o&&typeof s=="string"&&!e.prepareStackTrace)for(;a--;)s=n(s,i,"");return s},Ev}var Tv,NM;function IF(){if(NM)return Tv;NM=1;var t=Rn(),e=jd();return Tv=!t(function(){var n=new Error("a");return"stack"in n?(Object.defineProperty(n,"stack",e(1,7)),n.stack!==7):!0}),Tv}var _v,DM;function PF(){if(DM)return _v;DM=1;var t=Pl(),e=MF(),n=IF(),r=Error.captureStackTrace;return _v=function(i,o,s,a){n&&(r?r(i,o):t(i,"stack",e(s,a)))},_v}var Mv,kM;function OF(){if(kM)return Mv;kM=1;var t=Ml(),e=Lr(),n=Pl(),r=gc(),i=EM(),o=mM(),s=SF(),a=RF(),l=TF(),u=_F(),c=PF(),h=kr(),d=ps();return Mv=function(f,m,b,S){var E="stackTraceLimit",v=S?2:1,I=f.split("."),M=I[I.length-1],T=t.apply(null,I);if(T){var P=T.prototype;if(!d&&e(P,"cause")&&delete P.cause,!b)return T;var D=t("Error"),K=m(function(Y,U){var J=l(S?U:Y,void 0),ee=S?new T(Y):new T;return J!==void 0&&n(ee,"message",J),c(ee,K,ee.stack,2),this&&r(P,this)&&a(ee,this,K),arguments.length>v&&u(ee,arguments[v]),ee});if(K.prototype=P,M!=="Error"?i?i(K,D):o(K,D,{name:!0}):h&&E in T&&(s(K,T,E),s(K,T,"prepareStackTrace")),o(K,T),!d)try{P.name!==M&&n(P,"name",M),P.constructor=K}catch{}return K}},Mv}var LM;function xF(){if(LM)return KT;LM=1;var t=vt(),e=dn(),n=Gd(),r=OF(),i="WebAssembly",o=e[i],s=new Error("e",{cause:7}).cause!==7,a=function(u,c){var h={};h[u]=r(u,c,s),t({global:!0,constructor:!0,arity:1,forced:s},h)},l=function(u,c){if(o&&o[u]){var h={};h[u]=r(i+"."+u,c,s),t({target:i,stat:!0,constructor:!0,arity:1,forced:s},h)}};return a("Error",function(u){return function(h){return n(u,this,arguments)}}),a("EvalError",function(u){return function(h){return n(u,this,arguments)}}),a("RangeError",function(u){return function(h){return n(u,this,arguments)}}),a("ReferenceError",function(u){return function(h){return n(u,this,arguments)}}),a("SyntaxError",function(u){return function(h){return n(u,this,arguments)}}),a("TypeError",function(u){return function(h){return n(u,this,arguments)}}),a("URIError",function(u){return function(h){return n(u,this,arguments)}}),l("CompileError",function(u){return function(h){return n(u,this,arguments)}}),l("LinkError",function(u){return function(h){return n(u,this,arguments)}}),l("RuntimeError",function(u){return function(h){return n(u,this,arguments)}}),KT}xF();var $M={},Iv,FM;function VM(){if(FM)return Iv;FM=1;var t=oa();return Iv=Array.isArray||function(n){return t(n)==="Array"},Iv}var Pv,WM;function BM(){if(WM)return Pv;WM=1;var t=kr(),e=VM(),n=TypeError,r=Object.getOwnPropertyDescriptor,i=t&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(o){return o instanceof TypeError}})();return Pv=i?function(o,s){if(e(o)&&!r(o,"length").writable)throw new n("Cannot set read only .length");return o.length=s}:function(o,s){return o.length=s},Pv}var Ov,jM;function UM(){if(jM)return Ov;jM=1;var t=TypeError,e=9007199254740991;return Ov=function(n){if(n>e)throw t("Maximum allowed index exceeded");return n},Ov}var zM;function AF(){if(zM)return $M;zM=1;var t=vt(),e=Il(),n=Ol(),r=BM(),i=UM(),o=Rn(),s=o(function(){return[].push.call({length:4294967296},1)!==4294967297}),a=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(u){return u instanceof TypeError}},l=s||!a();return t({target:"Array",proto:!0,arity:1,forced:l},{push:function(c){var h=e(this),d=n(h),f=arguments.length;i(d+f);for(var m=0;m<f;m++)h[d]=arguments[m],d++;return r(h,d),d}}),$M}AF();var YM={},GM={},xv,qM;function HF(){if(qM)return xv;qM=1;var t=gc(),e=TypeError;return xv=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")},xv}var Av,KM;function NF(){if(KM)return Av;KM=1;var t=Rn();return Av=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Av}var Hv,XM;function ZM(){if(XM)return Hv;XM=1;var t=Lr(),e=tn(),n=Il(),r=zw(),i=NF(),o=r("IE_PROTO"),s=Object,a=s.prototype;return Hv=i?s.getPrototypeOf:function(l){var u=n(l);if(t(u,o))return u[o];var c=u.constructor;return e(c)&&u instanceof c?c.prototype:u instanceof s?a:null},Hv}var Nv,QM;function DF(){if(QM)return Nv;QM=1;var t=eM(),e=ws();return Nv=function(n,r,i){return i.get&&t(i.get,r,{getter:!0}),i.set&&t(i.set,r,{setter:!0}),e.f(n,r,i)},Nv}var Dv,JM;function eI(){if(JM)return Dv;JM=1;var t=kr(),e=ws(),n=jd();return Dv=function(r,i,o){t?e.f(r,i,n(0,o)):r[i]=o},Dv}var kv={},Lv,tI;function kF(){if(tI)return Lv;tI=1;var t=uM(),e=sv();return Lv=Object.keys||function(r){return t(r,e)},Lv}var nI;function LF(){if(nI)return kv;nI=1;var t=kr(),e=B_(),n=ws(),r=nn(),i=fc(),o=kF();return kv.f=t&&!e?Object.defineProperties:function(a,l){r(a);for(var u=i(l),c=o(l),h=c.length,d=0,f;h>d;)n.f(a,f=c[d++],u[f]);return a},kv}var $v,rI;function iI(){if(rI)return $v;rI=1;var t=Ml();return $v=t("document","documentElement"),$v}var Fv,oI;function Vv(){if(oI)return Fv;oI=1;var t=nn(),e=LF(),n=sv(),r=Gw(),i=iI(),o=Nw(),s=zw(),a=">",l="<",u="prototype",c="script",h=s("IE_PROTO"),d=function(){},f=function(v){return l+c+a+v+l+"/"+c+a},m=function(v){v.write(f("")),v.close();var I=v.parentWindow.Object;return v=null,I},b=function(){var v=o("iframe"),I="java"+c+":",M;return v.style.display="none",i.appendChild(v),v.src=String(I),M=v.contentWindow.document,M.open(),M.write(f("document.F=Object")),M.close(),M.F},S,E=function(){try{S=new ActiveXObject("htmlfile")}catch{}E=typeof document<"u"?document.domain&&S?m(S):b():m(S);for(var v=n.length;v--;)delete E[u][n[v]];return E()};return r[h]=!0,Fv=Object.create||function(I,M){var T;return I!==null?(d[u]=t(I),T=new d,d[u]=null,T[h]=I):T=E(),M===void 0?T:e.f(T,M)},Fv}var Wv,sI;function aI(){if(sI)return Wv;sI=1;var t=Rn(),e=tn(),n=oi(),r=Vv(),i=ZM(),o=Xw(),s=si(),a=ps(),l=s("iterator"),u=!1,c,h,d;[].keys&&(d=[].keys(),"next"in d?(h=i(i(d)),h!==Object.prototype&&(c=h)):u=!0);var f=!n(c)||t(function(){var m={};return c[l].call(m)!==m});return f?c={}:a&&(c=r(c)),e(c[l])||o(c,l,function(){return this}),Wv={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:u},Wv}var lI;function $F(){if(lI)return GM;lI=1;var t=vt(),e=dn(),n=HF(),r=nn(),i=tn(),o=ZM(),s=DF(),a=eI(),l=Rn(),u=Lr(),c=si(),h=aI().IteratorPrototype,d=kr(),f=ps(),m="constructor",b="Iterator",S=c("toStringTag"),E=TypeError,v=e[b],I=f||!i(v)||v.prototype!==h||!l(function(){v({})}),M=function(){if(n(this,h),o(this)===h)throw new E("Abstract class Iterator not directly constructable")},T=function(P,D){d?s(h,P,{configurable:!0,get:function(){return D},set:function(K){if(r(this),this===h)throw new E("You can't redefine this property");u(this,P)?this[P]=K:a(this,P,K)}}):h[P]=D};return u(h,S)||T(S,b),(I||!u(h,m)||h[m]===Object)&&T(m,M),M.prototype=h,t({global:!0,constructor:!0,forced:I},{Iterator:M}),GM}var uI;function FF(){return uI||(uI=1,$F()),YM}FF();var cI={},hI={},Bv,dI;function Li(){return dI||(dI=1,Bv=function(t){return{iterator:t,next:t.next,done:!1}}),Bv}var jv,fI;function VF(){if(fI)return jv;fI=1;var t=Xw();return jv=function(e,n,r){for(var i in n)t(e,i,n[i],r);return e},jv}var Uv,gI;function WF(){return gI||(gI=1,Uv=function(t,e){return{value:t,done:e}}),Uv}var zv,mI;function xl(){if(mI)return zv;mI=1;var t=In(),e=nn(),n=mc();return zv=function(r,i,o){var s,a;e(r);try{if(s=n(r,"return"),!s){if(i==="throw")throw o;return o}s=t(s,r)}catch(l){a=!0,s=l}if(i==="throw")throw o;if(a)throw s;return e(s),o},zv}var Yv,pI;function Gv(){if(pI)return Yv;pI=1;var t=In(),e=Vv(),n=Pl(),r=VF(),i=si(),o=Q_(),s=mc(),a=aI().IteratorPrototype,l=WF(),u=xl(),c=i("toStringTag"),h="IteratorHelper",d="WrapForValidIterator",f=o.set,m=function(E){var v=o.getterFor(E?d:h);return r(e(a),{next:function(){var M=v(this);if(E)return M.nextHandler();if(M.done)return l(void 0,!0);try{var T=M.nextHandler();return M.returnHandlerResult?T:l(T,M.done)}catch(P){throw M.done=!0,P}},return:function(){var I=v(this),M=I.iterator;if(I.done=!0,E){var T=s(M,"return");return T?t(T,M):l(void 0,!0)}if(I.inner)try{u(I.inner.iterator,"normal")}catch(P){return u(M,"throw",P)}return M&&u(M,"normal"),l(void 0,!0)}})},b=m(!0),S=m(!1);return n(S,c,"Iterator Helper"),Yv=function(E,v,I){var M=function(P,D){D?(D.iterator=P.iterator,D.next=P.next):D=P,D.type=v?d:h,D.returnHandlerResult=!!I,D.nextHandler=E,D.counter=0,D.done=!1,f(this,D)};return M.prototype=v?b:S,M},Yv}var qv,wI;function vI(){if(wI)return qv;wI=1;var t=nn(),e=xl();return qv=function(n,r,i,o){try{return o?r(t(i)[0],i[1]):r(i)}catch(s){e(n,"throw",s)}},qv}var CI;function BF(){if(CI)return hI;CI=1;var t=vt(),e=In(),n=Jn(),r=nn(),i=Li(),o=Gv(),s=vI(),a=ps(),l=o(function(){for(var u=this.iterator,c=this.predicate,h=this.next,d,f,m;;){if(d=r(e(h,u)),f=this.done=!!d.done,f)return;if(m=d.value,s(u,c,[m,this.counter++],!0))return m}});return t({target:"Iterator",proto:!0,real:!0,forced:a},{filter:function(c){return r(this),n(c),new l(i(this),{predicate:c})}}),hI}var yI;function jF(){return yI||(yI=1,BF()),cI}jF();var bI={},SI={},Kv,RI;function UF(){if(RI)return Kv;RI=1;var t=oa(),e=Xt();return Kv=function(n){if(t(n)==="Function")return e(n)},Kv}var Xv,EI;function TI(){if(EI)return Xv;EI=1;var t=UF(),e=Jn(),n=Bd(),r=t(t.bind);return Xv=function(i,o){return e(i),o===void 0?i:n?r(i,o):function(){return i.apply(o,arguments)}},Xv}var Zv,_I;function MI(){return _I||(_I=1,Zv={}),Zv}var Qv,II;function zF(){if(II)return Qv;II=1;var t=si(),e=MI(),n=t("iterator"),r=Array.prototype;return Qv=function(i){return i!==void 0&&(e.Array===i||r[n]===i)},Qv}var Jv,PI;function eC(){if(PI)return Jv;PI=1;var t=PM(),e=mc(),n=Ud(),r=MI(),i=si(),o=i("iterator");return Jv=function(s){if(!n(s))return e(s,o)||e(s,"@@iterator")||r[t(s)]},Jv}var tC,OI;function YF(){if(OI)return tC;OI=1;var t=In(),e=Jn(),n=nn(),r=Yd(),i=eC(),o=TypeError;return tC=function(s,a){var l=arguments.length<2?i(s):a;if(e(l))return n(t(l,s));throw new o(r(s)+" is not iterable")},tC}var nC,xI;function Al(){if(xI)return nC;xI=1;var t=TI(),e=In(),n=nn(),r=Yd(),i=zF(),o=Ol(),s=gc(),a=YF(),l=eC(),u=xl(),c=TypeError,h=function(f,m){this.stopped=f,this.result=m},d=h.prototype;return nC=function(f,m,b){var S=b&&b.that,E=!!(b&&b.AS_ENTRIES),v=!!(b&&b.IS_RECORD),I=!!(b&&b.IS_ITERATOR),M=!!(b&&b.INTERRUPTED),T=t(m,S),P,D,K,Y,U,J,ee,ae=function(se){return P&&u(P,"normal",se),new h(!0,se)},ne=function(se){return E?(n(se),M?T(se[0],se[1],ae):T(se[0],se[1])):M?T(se,ae):T(se)};if(v)P=f.iterator;else if(I)P=f;else{if(D=l(f),!D)throw new c(r(f)+" is not iterable");if(i(D)){for(K=0,Y=o(f);Y>K;K++)if(U=ne(f[K]),U&&s(d,U))return U;return new h(!1)}P=a(f,D)}for(J=v?f.next:P.next;!(ee=e(J,P)).done;){try{U=ne(ee.value)}catch(se){u(P,"throw",se)}if(typeof U=="object"&&U&&s(d,U))return U}return new h(!1)},nC}var AI;function GF(){if(AI)return SI;AI=1;var t=vt(),e=Al(),n=Jn(),r=nn(),i=Li();return t({target:"Iterator",proto:!0,real:!0},{find:function(s){r(this),n(s);var a=i(this),l=0;return e(a,function(u,c){if(s(u,l++))return c(u)},{IS_RECORD:!0,INTERRUPTED:!0}).result}}),SI}var HI;function qF(){return HI||(HI=1,GF()),bI}qF();var NI={},DI={},kI;function KF(){if(kI)return DI;kI=1;var t=vt(),e=Al(),n=Jn(),r=nn(),i=Li(),o=TypeError;return t({target:"Iterator",proto:!0,real:!0},{reduce:function(a){r(this),n(a);var l=i(this),u=arguments.length<2,c=u?void 0:arguments[1],h=0;if(e(l,function(d){u?(u=!1,c=d):c=a(c,d,h),h++},{IS_RECORD:!0}),u)throw new o("Reduce of empty iterator with no initial value");return c}}),DI}var LI;function XF(){return LI||(LI=1,KF()),NI}XF();var $I;function Z(){return $I.apply(null,arguments)}function ZF(t){$I=t}function ai(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function sa(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function Qe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function rC(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(Qe(t,e))return!1;return!0}function er(t){return t===void 0}function Ro(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function wc(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function FI(t,e){var n=[],r,i=t.length;for(r=0;r<i;++r)n.push(e(t[r],r));return n}function vs(t,e){for(var n in e)Qe(e,n)&&(t[n]=e[n]);return Qe(e,"toString")&&(t.toString=e.toString),Qe(e,"valueOf")&&(t.valueOf=e.valueOf),t}function $i(t,e,n,r){return dP(t,e,n,r,!0).utc()}function QF(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Oe(t){return t._pf==null&&(t._pf=QF()),t._pf}var iC;Array.prototype.some?iC=Array.prototype.some:iC=function(t){var e=Object(this),n=e.length>>>0,r;for(r=0;r<n;r++)if(r in e&&t.call(this,e[r],r,e))return!0;return!1};function oC(t){var e=null,n=!1,r=t._d&&!isNaN(t._d.getTime());if(r&&(e=Oe(t),n=iC.call(e.parsedDateParts,function(i){return i!=null}),r=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n),t._strict&&(r=r&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=r;else return r;return t._isValid}function Kd(t){var e=$i(NaN);return t!=null?vs(Oe(e),t):Oe(e).userInvalidated=!0,e}var VI=Z.momentProperties=[],sC=!1;function aC(t,e){var n,r,i,o=VI.length;if(er(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),er(e._i)||(t._i=e._i),er(e._f)||(t._f=e._f),er(e._l)||(t._l=e._l),er(e._strict)||(t._strict=e._strict),er(e._tzm)||(t._tzm=e._tzm),er(e._isUTC)||(t._isUTC=e._isUTC),er(e._offset)||(t._offset=e._offset),er(e._pf)||(t._pf=Oe(e)),er(e._locale)||(t._locale=e._locale),o>0)for(n=0;n<o;n++)r=VI[n],i=e[r],er(i)||(t[r]=i);return t}function vc(t){aC(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),sC===!1&&(sC=!0,Z.updateOffset(this),sC=!1)}function li(t){return t instanceof vc||t!=null&&t._isAMomentObject!=null}function WI(t){Z.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function $r(t,e){var n=!0;return vs(function(){if(Z.deprecationHandler!=null&&Z.deprecationHandler(null,t),n){var r=[],i,o,s,a=arguments.length;for(o=0;o<a;o++){if(i="",typeof arguments[o]=="object"){i+=`
2
- [`+o+"] ";for(s in arguments[0])Qe(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[o];r.push(i)}WI(t+`
3
- Arguments: `+Array.prototype.slice.call(r).join("")+`
4
- `+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var BI={};function jI(t,e){Z.deprecationHandler!=null&&Z.deprecationHandler(t,e),BI[t]||(WI(e),BI[t]=!0)}Z.suppressDeprecationWarnings=!1,Z.deprecationHandler=null;function Fi(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function JF(t){var e,n;for(n in t)Qe(t,n)&&(e=t[n],Fi(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function lC(t,e){var n=vs({},t),r;for(r in e)Qe(e,r)&&(sa(t[r])&&sa(e[r])?(n[r]={},vs(n[r],t[r]),vs(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)Qe(t,r)&&!Qe(e,r)&&sa(t[r])&&(n[r]=vs({},n[r]));return n}function uC(t){t!=null&&this.set(t)}var cC;Object.keys?cC=Object.keys:cC=function(t){var e,n=[];for(e in t)Qe(t,e)&&n.push(e);return n};var eV={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function tV(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return Fi(r)?r.call(e,n):r}function Vi(t,e,n){var r=""+Math.abs(t),i=e-r.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var hC=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Xd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,dC={},Hl={};function Ce(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(Hl[t]=i),e&&(Hl[e[0]]=function(){return Vi(i.apply(this,arguments),e[1],e[2])}),n&&(Hl[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function nV(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function rV(t){var e=t.match(hC),n,r;for(n=0,r=e.length;n<r;n++)Hl[e[n]]?e[n]=Hl[e[n]]:e[n]=nV(e[n]);return function(i){var o="",s;for(s=0;s<r;s++)o+=Fi(e[s])?e[s].call(i,t):e[s];return o}}function Zd(t,e){return t.isValid()?(e=UI(e,t.localeData()),dC[e]=dC[e]||rV(e),dC[e](t)):t.localeData().invalidDate()}function UI(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(Xd.lastIndex=0;n>=0&&Xd.test(t);)t=t.replace(Xd,r),Xd.lastIndex=0,n-=1;return t}var iV={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function oV(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(hC).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var sV="Invalid date";function aV(){return this._invalidDate}var lV="%d",uV=/\d{1,2}/;function cV(t){return this._ordinal.replace("%d",t)}var hV={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function dV(t,e,n,r){var i=this._relativeTime[n];return Fi(i)?i(t,e,n,r):i.replace(/%d/i,t)}function fV(t,e){var n=this._relativeTime[t>0?"future":"past"];return Fi(n)?n(e):n.replace(/%s/i,e)}var zI={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Fr(t){return typeof t=="string"?zI[t]||zI[t.toLowerCase()]:void 0}function fC(t){var e={},n,r;for(r in t)Qe(t,r)&&(n=Fr(r),n&&(e[n]=t[r]));return e}var gV={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function mV(t){var e=[],n;for(n in t)Qe(t,n)&&e.push({unit:n,priority:gV[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var YI=/\d/,yr=/\d\d/,GI=/\d{3}/,gC=/\d{4}/,Qd=/[+-]?\d{6}/,Rt=/\d\d?/,qI=/\d\d\d\d?/,KI=/\d\d\d\d\d\d?/,Jd=/\d{1,3}/,mC=/\d{1,4}/,ef=/[+-]?\d{1,6}/,Nl=/\d+/,tf=/[+-]?\d+/,pV=/Z|[+-]\d\d:?\d\d/gi,nf=/Z|[+-]\d\d(?::?\d\d)?/gi,wV=/[+-]?\d+(\.\d{1,3})?/,Cc=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Dl=/^[1-9]\d?/,pC=/^([1-9]\d|\d)/,rf;rf={};function ue(t,e,n){rf[t]=Fi(e)?e:function(r,i){return r&&n?n:e}}function vV(t,e){return Qe(rf,t)?rf[t](e._strict,e._locale):new RegExp(CV(t))}function CV(t){return Eo(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,o){return n||r||i||o}))}function Eo(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Vr(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function Be(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=Vr(e)),n}var wC={};function pt(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),Ro(e)&&(r=function(o,s){s[e]=Be(o)}),i=t.length,n=0;n<i;n++)wC[t[n]]=r}function yc(t,e){pt(t,function(n,r,i,o){i._w=i._w||{},e(n,i._w,i,o)})}function yV(t,e,n){e!=null&&Qe(wC,t)&&wC[t](e,n._a,n,t)}function of(t){return t%4===0&&t%100!==0||t%400===0}var Pn=0,To=1,Wi=2,fn=3,ui=4,_o=5,aa=6,bV=7,SV=8;Ce("Y",0,0,function(){var t=this.year();return t<=9999?Vi(t,4):"+"+t}),Ce(0,["YY",2],0,function(){return this.year()%100}),Ce(0,["YYYY",4],0,"year"),Ce(0,["YYYYY",5],0,"year"),Ce(0,["YYYYYY",6,!0],0,"year"),ue("Y",tf),ue("YY",Rt,yr),ue("YYYY",mC,gC),ue("YYYYY",ef,Qd),ue("YYYYYY",ef,Qd),pt(["YYYYY","YYYYYY"],Pn),pt("YYYY",function(t,e){e[Pn]=t.length===2?Z.parseTwoDigitYear(t):Be(t)}),pt("YY",function(t,e){e[Pn]=Z.parseTwoDigitYear(t)}),pt("Y",function(t,e){e[Pn]=parseInt(t,10)});function bc(t){return of(t)?366:365}Z.parseTwoDigitYear=function(t){return Be(t)+(Be(t)>68?1900:2e3)};var XI=kl("FullYear",!0);function RV(){return of(this.year())}function kl(t,e){return function(n){return n!=null?(ZI(this,t,n),Z.updateOffset(this,e),this):Sc(this,t)}}function Sc(t,e){if(!t.isValid())return NaN;var n=t._d,r=t._isUTC;switch(e){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function ZI(t,e,n){var r,i,o,s,a;if(!(!t.isValid()||isNaN(n))){switch(r=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}o=n,s=t.month(),a=t.date(),a=a===29&&s===1&&!of(o)?28:a,i?r.setUTCFullYear(o,s,a):r.setFullYear(o,s,a)}}function EV(t){return t=Fr(t),Fi(this[t])?this[t]():this}function TV(t,e){if(typeof t=="object"){t=fC(t);var n=mV(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=Fr(t),Fi(this[t]))return this[t](e);return this}function _V(t,e){return(t%e+e)%e}var Zt;Array.prototype.indexOf?Zt=Array.prototype.indexOf:Zt=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function vC(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=_V(e,12);return t+=(e-n)/12,n===1?of(t)?29:28:31-n%7%2}Ce("M",["MM",2],"Mo",function(){return this.month()+1}),Ce("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),Ce("MMMM",0,0,function(t){return this.localeData().months(this,t)}),ue("M",Rt,Dl),ue("MM",Rt,yr),ue("MMM",function(t,e){return e.monthsShortRegex(t)}),ue("MMMM",function(t,e){return e.monthsRegex(t)}),pt(["M","MM"],function(t,e){e[To]=Be(t)-1}),pt(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[To]=i:Oe(n).invalidMonth=t});var MV="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),QI="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),JI=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,IV=Cc,PV=Cc;function OV(t,e){return t?ai(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||JI).test(e)?"format":"standalone"][t.month()]:ai(this._months)?this._months:this._months.standalone}function xV(t,e){return t?ai(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[JI.test(e)?"format":"standalone"][t.month()]:ai(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function AV(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)o=$i([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?e==="MMM"?(i=Zt.call(this._shortMonthsParse,s),i!==-1?i:null):(i=Zt.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=Zt.call(this._shortMonthsParse,s),i!==-1?i:(i=Zt.call(this._longMonthsParse,s),i!==-1?i:null)):(i=Zt.call(this._longMonthsParse,s),i!==-1?i:(i=Zt.call(this._shortMonthsParse,s),i!==-1?i:null))}function HV(t,e,n){var r,i,o;if(this._monthsParseExact)return AV.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=$i([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[r].test(t))return r;if(n&&e==="MMM"&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function eP(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=Be(e);else if(e=t.localeData().monthsParse(e),!Ro(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,vC(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function tP(t){return t!=null?(eP(this,t),Z.updateOffset(this,!0),this):Sc(this,"Month")}function NV(){return vC(this.year(),this.month())}function DV(t){return this._monthsParseExact?(Qe(this,"_monthsRegex")||nP.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(Qe(this,"_monthsShortRegex")||(this._monthsShortRegex=IV),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function kV(t){return this._monthsParseExact?(Qe(this,"_monthsRegex")||nP.call(this),t?this._monthsStrictRegex:this._monthsRegex):(Qe(this,"_monthsRegex")||(this._monthsRegex=PV),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function nP(){function t(l,u){return u.length-l.length}var e=[],n=[],r=[],i,o,s,a;for(i=0;i<12;i++)o=$i([2e3,i]),s=Eo(this.monthsShort(o,"")),a=Eo(this.months(o,"")),e.push(s),n.push(a),r.push(a),r.push(s);e.sort(t),n.sort(t),r.sort(t),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function LV(t,e,n,r,i,o,s){var a;return t<100&&t>=0?(a=new Date(t+400,e,n,r,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,n,r,i,o,s),a}function Rc(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function sf(t,e,n){var r=7+e-n,i=(7+Rc(t,0,r).getUTCDay()-e)%7;return-i+r-1}function rP(t,e,n,r,i){var o=(7+n-r)%7,s=sf(t,r,i),a=1+7*(e-1)+o+s,l,u;return a<=0?(l=t-1,u=bc(l)+a):a>bc(t)?(l=t+1,u=a-bc(t)):(l=t,u=a),{year:l,dayOfYear:u}}function Ec(t,e,n){var r=sf(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,o,s;return i<1?(s=t.year()-1,o=i+Mo(s,e,n)):i>Mo(t.year(),e,n)?(o=i-Mo(t.year(),e,n),s=t.year()+1):(s=t.year(),o=i),{week:o,year:s}}function Mo(t,e,n){var r=sf(t,e,n),i=sf(t+1,e,n);return(bc(t)-r+i)/7}Ce("w",["ww",2],"wo","week"),Ce("W",["WW",2],"Wo","isoWeek"),ue("w",Rt,Dl),ue("ww",Rt,yr),ue("W",Rt,Dl),ue("WW",Rt,yr),yc(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=Be(t)});function $V(t){return Ec(t,this._week.dow,this._week.doy).week}var FV={dow:0,doy:6};function VV(){return this._week.dow}function WV(){return this._week.doy}function BV(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function jV(t){var e=Ec(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Ce("d",0,"do","day"),Ce("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),Ce("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),Ce("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),Ce("e",0,0,"weekday"),Ce("E",0,0,"isoWeekday"),ue("d",Rt),ue("e",Rt),ue("E",Rt),ue("dd",function(t,e){return e.weekdaysMinRegex(t)}),ue("ddd",function(t,e){return e.weekdaysShortRegex(t)}),ue("dddd",function(t,e){return e.weekdaysRegex(t)}),yc(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:Oe(n).invalidWeekday=t}),yc(["d","e","E"],function(t,e,n,r){e[r]=Be(t)});function UV(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function zV(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function CC(t,e){return t.slice(e,7).concat(t.slice(0,e))}var YV="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),iP="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),GV="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),qV=Cc,KV=Cc,XV=Cc;function ZV(t,e){var n=ai(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?CC(n,this._week.dow):t?n[t.day()]:n}function QV(t){return t===!0?CC(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function JV(t){return t===!0?CC(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function eW(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=$i([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?e==="dddd"?(i=Zt.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=Zt.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Zt.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=Zt.call(this._weekdaysParse,s),i!==-1||(i=Zt.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Zt.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=Zt.call(this._shortWeekdaysParse,s),i!==-1||(i=Zt.call(this._weekdaysParse,s),i!==-1)?i:(i=Zt.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Zt.call(this._minWeekdaysParse,s),i!==-1||(i=Zt.call(this._weekdaysParse,s),i!==-1)?i:(i=Zt.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function tW(t,e,n){var r,i,o;if(this._weekdaysParseExact)return eW.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=$i([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[r].test(t))return r;if(n&&e==="ddd"&&this._shortWeekdaysParse[r].test(t))return r;if(n&&e==="dd"&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function nW(t){if(!this.isValid())return t!=null?this:NaN;var e=Sc(this,"Day");return t!=null?(t=UV(t,this.localeData()),this.add(t-e,"d")):e}function rW(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function iW(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=zV(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function oW(t){return this._weekdaysParseExact?(Qe(this,"_weekdaysRegex")||yC.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Qe(this,"_weekdaysRegex")||(this._weekdaysRegex=qV),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function sW(t){return this._weekdaysParseExact?(Qe(this,"_weekdaysRegex")||yC.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Qe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=KV),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function aW(t){return this._weekdaysParseExact?(Qe(this,"_weekdaysRegex")||yC.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Qe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=XV),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function yC(){function t(c,h){return h.length-c.length}var e=[],n=[],r=[],i=[],o,s,a,l,u;for(o=0;o<7;o++)s=$i([2e3,1]).day(o),a=Eo(this.weekdaysMin(s,"")),l=Eo(this.weekdaysShort(s,"")),u=Eo(this.weekdays(s,"")),e.push(a),n.push(l),r.push(u),i.push(a),i.push(l),i.push(u);e.sort(t),n.sort(t),r.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function bC(){return this.hours()%12||12}function lW(){return this.hours()||24}Ce("H",["HH",2],0,"hour"),Ce("h",["hh",2],0,bC),Ce("k",["kk",2],0,lW),Ce("hmm",0,0,function(){return""+bC.apply(this)+Vi(this.minutes(),2)}),Ce("hmmss",0,0,function(){return""+bC.apply(this)+Vi(this.minutes(),2)+Vi(this.seconds(),2)}),Ce("Hmm",0,0,function(){return""+this.hours()+Vi(this.minutes(),2)}),Ce("Hmmss",0,0,function(){return""+this.hours()+Vi(this.minutes(),2)+Vi(this.seconds(),2)});function oP(t,e){Ce(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}oP("a",!0),oP("A",!1);function sP(t,e){return e._meridiemParse}ue("a",sP),ue("A",sP),ue("H",Rt,pC),ue("h",Rt,Dl),ue("k",Rt,Dl),ue("HH",Rt,yr),ue("hh",Rt,yr),ue("kk",Rt,yr),ue("hmm",qI),ue("hmmss",KI),ue("Hmm",qI),ue("Hmmss",KI),pt(["H","HH"],fn),pt(["k","kk"],function(t,e,n){var r=Be(t);e[fn]=r===24?0:r}),pt(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),pt(["h","hh"],function(t,e,n){e[fn]=Be(t),Oe(n).bigHour=!0}),pt("hmm",function(t,e,n){var r=t.length-2;e[fn]=Be(t.substr(0,r)),e[ui]=Be(t.substr(r)),Oe(n).bigHour=!0}),pt("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[fn]=Be(t.substr(0,r)),e[ui]=Be(t.substr(r,2)),e[_o]=Be(t.substr(i)),Oe(n).bigHour=!0}),pt("Hmm",function(t,e,n){var r=t.length-2;e[fn]=Be(t.substr(0,r)),e[ui]=Be(t.substr(r))}),pt("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[fn]=Be(t.substr(0,r)),e[ui]=Be(t.substr(r,2)),e[_o]=Be(t.substr(i))});function uW(t){return(t+"").toLowerCase().charAt(0)==="p"}var cW=/[ap]\.?m?\.?/i,hW=kl("Hours",!0);function dW(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var aP={calendar:eV,longDateFormat:iV,invalidDate:sV,ordinal:lV,dayOfMonthOrdinalParse:uV,relativeTime:hV,months:MV,monthsShort:QI,week:FV,weekdays:YV,weekdaysMin:GV,weekdaysShort:iP,meridiemParse:cW},Ot={},Tc={},_c;function fW(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n<r;n+=1)if(t[n]!==e[n])return n;return r}function lP(t){return t&&t.toLowerCase().replace("_","-")}function gW(t){for(var e=0,n,r,i,o;e<t.length;){for(o=lP(t[e]).split("-"),n=o.length,r=lP(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=af(o.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&fW(o,r)>=n-1)break;n--}e++}return _c}function mW(t){return!!(t&&t.match("^[^/\\\\]*$"))}function af(t){var e=null,n;if(Ot[t]===void 0&&typeof module<"u"&&module&&module.exports&&mW(t))try{e=_c._abbr,n=require,n("./locale/"+t),Cs(e)}catch{Ot[t]=null}return Ot[t]}function Cs(t,e){var n;return t&&(er(e)?n=Io(t):n=SC(t,e),n?_c=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),_c._abbr}function SC(t,e){if(e!==null){var n,r=aP;if(e.abbr=t,Ot[t]!=null)jI("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Ot[t]._config;else if(e.parentLocale!=null)if(Ot[e.parentLocale]!=null)r=Ot[e.parentLocale]._config;else if(n=af(e.parentLocale),n!=null)r=n._config;else return Tc[e.parentLocale]||(Tc[e.parentLocale]=[]),Tc[e.parentLocale].push({name:t,config:e}),null;return Ot[t]=new uC(lC(r,e)),Tc[t]&&Tc[t].forEach(function(i){SC(i.name,i.config)}),Cs(t),Ot[t]}else return delete Ot[t],null}function pW(t,e){if(e!=null){var n,r,i=aP;Ot[t]!=null&&Ot[t].parentLocale!=null?Ot[t].set(lC(Ot[t]._config,e)):(r=af(t),r!=null&&(i=r._config),e=lC(i,e),r==null&&(e.abbr=t),n=new uC(e),n.parentLocale=Ot[t],Ot[t]=n),Cs(t)}else Ot[t]!=null&&(Ot[t].parentLocale!=null?(Ot[t]=Ot[t].parentLocale,t===Cs()&&Cs(t)):Ot[t]!=null&&delete Ot[t]);return Ot[t]}function Io(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return _c;if(!ai(t)){if(e=af(t),e)return e;t=[t]}return gW(t)}function wW(){return cC(Ot)}function RC(t){var e,n=t._a;return n&&Oe(t).overflow===-2&&(e=n[To]<0||n[To]>11?To:n[Wi]<1||n[Wi]>vC(n[Pn],n[To])?Wi:n[fn]<0||n[fn]>24||n[fn]===24&&(n[ui]!==0||n[_o]!==0||n[aa]!==0)?fn:n[ui]<0||n[ui]>59?ui:n[_o]<0||n[_o]>59?_o:n[aa]<0||n[aa]>999?aa:-1,Oe(t)._overflowDayOfYear&&(e<Pn||e>Wi)&&(e=Wi),Oe(t)._overflowWeeks&&e===-1&&(e=bV),Oe(t)._overflowWeekday&&e===-1&&(e=SV),Oe(t).overflow=e),t}var vW=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,CW=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yW=/Z|[+-]\d\d(?::?\d\d)?/,lf=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],EC=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],bW=/^\/?Date\((-?\d+)/i,SW=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,RW={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function uP(t){var e,n,r=t._i,i=vW.exec(r)||CW.exec(r),o,s,a,l,u=lf.length,c=EC.length;if(i){for(Oe(t).iso=!0,e=0,n=u;e<n;e++)if(lf[e][1].exec(i[1])){s=lf[e][0],o=lf[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(i[3]){for(e=0,n=c;e<n;e++)if(EC[e][1].exec(i[3])){a=(i[2]||" ")+EC[e][0];break}if(a==null){t._isValid=!1;return}}if(!o&&a!=null){t._isValid=!1;return}if(i[4])if(yW.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=s+(a||"")+(l||""),_C(t)}else t._isValid=!1}function EW(t,e,n,r,i,o){var s=[TW(t),QI.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return o&&s.push(parseInt(o,10)),s}function TW(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function _W(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function MW(t,e,n){if(t){var r=iP.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return Oe(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function IW(t,e,n){if(t)return RW[t];if(e)return 0;var r=parseInt(n,10),i=r%100,o=(r-i)/100;return o*60+i}function cP(t){var e=SW.exec(_W(t._i)),n;if(e){if(n=EW(e[4],e[3],e[2],e[5],e[6],e[7]),!MW(e[1],n,t))return;t._a=n,t._tzm=IW(e[8],e[9],e[10]),t._d=Rc.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),Oe(t).rfc2822=!0}else t._isValid=!1}function PW(t){var e=bW.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(uP(t),t._isValid===!1)delete t._isValid;else return;if(cP(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:Z.createFromInputFallback(t)}Z.createFromInputFallback=$r("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function Ll(t,e,n){return t??e??n}function OW(t){var e=new Date(Z.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function TC(t){var e,n,r=[],i,o,s;if(!t._d){for(i=OW(t),t._w&&t._a[Wi]==null&&t._a[To]==null&&xW(t),t._dayOfYear!=null&&(s=Ll(t._a[Pn],i[Pn]),(t._dayOfYear>bc(s)||t._dayOfYear===0)&&(Oe(t)._overflowDayOfYear=!0),n=Rc(s,0,t._dayOfYear),t._a[To]=n.getUTCMonth(),t._a[Wi]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[fn]===24&&t._a[ui]===0&&t._a[_o]===0&&t._a[aa]===0&&(t._nextDay=!0,t._a[fn]=0),t._d=(t._useUTC?Rc:LV).apply(null,r),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[fn]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==o&&(Oe(t).weekdayMismatch=!0)}}function xW(t){var e,n,r,i,o,s,a,l,u;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(o=1,s=4,n=Ll(e.GG,t._a[Pn],Ec(Et(),1,4).year),r=Ll(e.W,1),i=Ll(e.E,1),(i<1||i>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,u=Ec(Et(),o,s),n=Ll(e.gg,t._a[Pn],u.year),r=Ll(e.w,u.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+o,(e.e<0||e.e>6)&&(l=!0)):i=o),r<1||r>Mo(n,o,s)?Oe(t)._overflowWeeks=!0:l!=null?Oe(t)._overflowWeekday=!0:(a=rP(n,r,i,o,s),t._a[Pn]=a.year,t._dayOfYear=a.dayOfYear)}Z.ISO_8601=function(){},Z.RFC_2822=function(){};function _C(t){if(t._f===Z.ISO_8601){uP(t);return}if(t._f===Z.RFC_2822){cP(t);return}t._a=[],Oe(t).empty=!0;var e=""+t._i,n,r,i,o,s,a=e.length,l=0,u,c;for(i=UI(t._f,t._locale).match(hC)||[],c=i.length,n=0;n<c;n++)o=i[n],r=(e.match(vV(o,t))||[])[0],r&&(s=e.substr(0,e.indexOf(r)),s.length>0&&Oe(t).unusedInput.push(s),e=e.slice(e.indexOf(r)+r.length),l+=r.length),Hl[o]?(r?Oe(t).empty=!1:Oe(t).unusedTokens.push(o),yV(o,r,t)):t._strict&&!r&&Oe(t).unusedTokens.push(o);Oe(t).charsLeftOver=a-l,e.length>0&&Oe(t).unusedInput.push(e),t._a[fn]<=12&&Oe(t).bigHour===!0&&t._a[fn]>0&&(Oe(t).bigHour=void 0),Oe(t).parsedDateParts=t._a.slice(0),Oe(t).meridiem=t._meridiem,t._a[fn]=AW(t._locale,t._a[fn],t._meridiem),u=Oe(t).era,u!==null&&(t._a[Pn]=t._locale.erasConvertYear(u,t._a[Pn])),TC(t),RC(t)}function AW(t,e,n){var r;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(r=t.isPM(n),r&&e<12&&(e+=12),!r&&e===12&&(e=0)),e)}function HW(t){var e,n,r,i,o,s,a=!1,l=t._f.length;if(l===0){Oe(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)o=0,s=!1,e=aC({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],_C(e),oC(e)&&(s=!0),o+=Oe(e).charsLeftOver,o+=Oe(e).unusedTokens.length*10,Oe(e).score=o,a?o<r&&(r=o,n=e):(r==null||o<r||s)&&(r=o,n=e,s&&(a=!0));vs(t,n||e)}function NW(t){if(!t._d){var e=fC(t._i),n=e.day===void 0?e.date:e.day;t._a=FI([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),TC(t)}}function DW(t){var e=new vc(RC(hP(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function hP(t){var e=t._i,n=t._f;return t._locale=t._locale||Io(t._l),e===null||n===void 0&&e===""?Kd({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),li(e)?new vc(RC(e)):(wc(e)?t._d=e:ai(n)?HW(t):n?_C(t):kW(t),oC(t)||(t._d=null),t))}function kW(t){var e=t._i;er(e)?t._d=new Date(Z.now()):wc(e)?t._d=new Date(e.valueOf()):typeof e=="string"?PW(t):ai(e)?(t._a=FI(e.slice(0),function(n){return parseInt(n,10)}),TC(t)):sa(e)?NW(t):Ro(e)?t._d=new Date(e):Z.createFromInputFallback(t)}function dP(t,e,n,r,i){var o={};return(e===!0||e===!1)&&(r=e,e=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(sa(t)&&rC(t)||ai(t)&&t.length===0)&&(t=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=n,o._i=t,o._f=e,o._strict=r,DW(o)}function Et(t,e,n,r){return dP(t,e,n,r,!1)}var LW=$r("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Et.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:Kd()}),$W=$r("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Et.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:Kd()});function fP(t,e){var n,r;if(e.length===1&&ai(e[0])&&(e=e[0]),!e.length)return Et();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function FW(){var t=[].slice.call(arguments,0);return fP("isBefore",t)}function VW(){var t=[].slice.call(arguments,0);return fP("isAfter",t)}var WW=function(){return Date.now?Date.now():+new Date},Mc=["year","quarter","month","week","day","hour","minute","second","millisecond"];function BW(t){var e,n=!1,r,i=Mc.length;for(e in t)if(Qe(t,e)&&!(Zt.call(Mc,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[Mc[r]]){if(n)return!1;parseFloat(t[Mc[r]])!==Be(t[Mc[r]])&&(n=!0)}return!0}function jW(){return this._isValid}function UW(){return ci(NaN)}function uf(t){var e=fC(t),n=e.year||0,r=e.quarter||0,i=e.month||0,o=e.week||e.isoWeek||0,s=e.day||0,a=e.hour||0,l=e.minute||0,u=e.second||0,c=e.millisecond||0;this._isValid=BW(e),this._milliseconds=+c+u*1e3+l*6e4+a*1e3*60*60,this._days=+s+o*7,this._months=+i+r*3+n*12,this._data={},this._locale=Io(),this._bubble()}function cf(t){return t instanceof uf}function MC(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function zW(t,e,n){var r=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),o=0,s;for(s=0;s<r;s++)Be(t[s])!==Be(e[s])&&o++;return o+i}function gP(t,e){Ce(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Vi(~~(n/60),2)+e+Vi(~~n%60,2)})}gP("Z",":"),gP("ZZ",""),ue("Z",nf),ue("ZZ",nf),pt(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=IC(nf,t)});var YW=/([\+\-]|\d\d)/gi;function IC(t,e){var n=(e||"").match(t),r,i,o;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(YW)||["-",0,0],o=+(i[1]*60)+Be(i[2]),o===0?0:i[0]==="+"?o:-o)}function PC(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(li(t)||wc(t)?t.valueOf():Et(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),Z.updateOffset(n,!1),n):Et(t).local()}function OC(t){return-Math.round(t._d.getTimezoneOffset())}Z.updateOffset=function(){};function GW(t,e,n){var r=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=IC(nf,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=OC(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?vP(this,ci(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Z.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:OC(this)}function qW(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function KW(t){return this.utcOffset(0,t)}function XW(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(OC(this),"m")),this}function ZW(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=IC(pV,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function QW(t){return this.isValid()?(t=t?Et(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function JW(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function eB(){if(!er(this._isDSTShifted))return this._isDSTShifted;var t={},e;return aC(t,this),t=hP(t),t._a?(e=t._isUTC?$i(t._a):Et(t._a),this._isDSTShifted=this.isValid()&&zW(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function tB(){return this.isValid()?!this._isUTC:!1}function nB(){return this.isValid()?this._isUTC:!1}function mP(){return this.isValid()?this._isUTC&&this._offset===0:!1}var rB=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,iB=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ci(t,e){var n=t,r=null,i,o,s;return cf(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:Ro(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=rB.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:Be(r[Wi])*i,h:Be(r[fn])*i,m:Be(r[ui])*i,s:Be(r[_o])*i,ms:Be(MC(r[aa]*1e3))*i}):(r=iB.exec(t))?(i=r[1]==="-"?-1:1,n={y:la(r[2],i),M:la(r[3],i),w:la(r[4],i),d:la(r[5],i),h:la(r[6],i),m:la(r[7],i),s:la(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(s=oB(Et(n.from),Et(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),o=new uf(n),cf(t)&&Qe(t,"_locale")&&(o._locale=t._locale),cf(t)&&Qe(t,"_isValid")&&(o._isValid=t._isValid),o}ci.fn=uf.prototype,ci.invalid=UW;function la(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function pP(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function oB(t,e){var n;return t.isValid()&&e.isValid()?(e=PC(e,t),t.isBefore(e)?n=pP(t,e):(n=pP(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function wP(t,e){return function(n,r){var i,o;return r!==null&&!isNaN(+r)&&(jI(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),i=ci(n,r),vP(this,i,t),this}}function vP(t,e,n,r){var i=e._milliseconds,o=MC(e._days),s=MC(e._months);t.isValid()&&(r=r??!0,s&&eP(t,Sc(t,"Month")+s*n),o&&ZI(t,"Date",Sc(t,"Date")+o*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&Z.updateOffset(t,o||s))}var sB=wP(1,"add"),aB=wP(-1,"subtract");function CP(t){return typeof t=="string"||t instanceof String}function lB(t){return li(t)||wc(t)||CP(t)||Ro(t)||cB(t)||uB(t)||t===null||t===void 0}function uB(t){var e=sa(t)&&!rC(t),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,o,s=r.length;for(i=0;i<s;i+=1)o=r[i],n=n||Qe(t,o);return e&&n}function cB(t){var e=ai(t),n=!1;return e&&(n=t.filter(function(r){return!Ro(r)&&CP(t)}).length===0),e&&n}function hB(t){var e=sa(t)&&!rC(t),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,o;for(i=0;i<r.length;i+=1)o=r[i],n=n||Qe(t,o);return e&&n}function dB(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function fB(t,e){arguments.length===1&&(arguments[0]?lB(arguments[0])?(t=arguments[0],e=void 0):hB(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||Et(),r=PC(n,this).startOf("day"),i=Z.calendarFormat(this,r)||"sameElse",o=e&&(Fi(e[i])?e[i].call(this,n):e[i]);return this.format(o||this.localeData().calendar(i,this,Et(n)))}function gB(){return new vc(this)}function mB(t,e){var n=li(t)?t:Et(t);return this.isValid()&&n.isValid()?(e=Fr(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function pB(t,e){var n=li(t)?t:Et(t);return this.isValid()&&n.isValid()?(e=Fr(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function wB(t,e,n,r){var i=li(t)?t:Et(t),o=li(e)?e:Et(e);return this.isValid()&&i.isValid()&&o.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function vB(t,e){var n=li(t)?t:Et(t),r;return this.isValid()&&n.isValid()?(e=Fr(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf())):!1}function CB(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function yB(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function bB(t,e,n){var r,i,o;if(!this.isValid())return NaN;if(r=PC(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=Fr(e),e){case"year":o=hf(this,r)/12;break;case"month":o=hf(this,r);break;case"quarter":o=hf(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-i)/864e5;break;case"week":o=(this-r-i)/6048e5;break;default:o=this-r}return n?o:Vr(o)}function hf(t,e){if(t.date()<e.date())return-hf(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),r=t.clone().add(n,"months"),i,o;return e-r<0?(i=t.clone().add(n-1,"months"),o=(e-r)/(r-i)):(i=t.clone().add(n+1,"months"),o=(e-r)/(i-r)),-(n+o)||0}Z.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",Z.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function SB(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function RB(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?Zd(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Fi(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Zd(n,"Z")):Zd(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function EB(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,r,i,o;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",o=e+'[")]',this.format(n+r+i+o)}function TB(t){t||(t=this.isUtc()?Z.defaultFormatUtc:Z.defaultFormat);var e=Zd(this,t);return this.localeData().postformat(e)}function _B(t,e){return this.isValid()&&(li(t)&&t.isValid()||Et(t).isValid())?ci({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function MB(t){return this.from(Et(),t)}function IB(t,e){return this.isValid()&&(li(t)&&t.isValid()||Et(t).isValid())?ci({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function PB(t){return this.to(Et(),t)}function yP(t){var e;return t===void 0?this._locale._abbr:(e=Io(t),e!=null&&(this._locale=e),this)}var bP=$r("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function SP(){return this._locale}var df=1e3,$l=60*df,ff=60*$l,RP=(365*400+97)*24*ff;function Fl(t,e){return(t%e+e)%e}function EP(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-RP:new Date(t,e,n).valueOf()}function TP(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-RP:Date.UTC(t,e,n)}function OB(t){var e,n;if(t=Fr(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?TP:EP,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Fl(e+(this._isUTC?0:this.utcOffset()*$l),ff);break;case"minute":e=this._d.valueOf(),e-=Fl(e,$l);break;case"second":e=this._d.valueOf(),e-=Fl(e,df);break}return this._d.setTime(e),Z.updateOffset(this,!0),this}function xB(t){var e,n;if(t=Fr(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?TP:EP,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=ff-Fl(e+(this._isUTC?0:this.utcOffset()*$l),ff)-1;break;case"minute":e=this._d.valueOf(),e+=$l-Fl(e,$l)-1;break;case"second":e=this._d.valueOf(),e+=df-Fl(e,df)-1;break}return this._d.setTime(e),Z.updateOffset(this,!0),this}function AB(){return this._d.valueOf()-(this._offset||0)*6e4}function HB(){return Math.floor(this.valueOf()/1e3)}function NB(){return new Date(this.valueOf())}function DB(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function kB(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function LB(){return this.isValid()?this.toISOString():null}function $B(){return oC(this)}function FB(){return vs({},Oe(this))}function VB(){return Oe(this).overflow}function WB(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ce("N",0,0,"eraAbbr"),Ce("NN",0,0,"eraAbbr"),Ce("NNN",0,0,"eraAbbr"),Ce("NNNN",0,0,"eraName"),Ce("NNNNN",0,0,"eraNarrow"),Ce("y",["y",1],"yo","eraYear"),Ce("y",["yy",2],0,"eraYear"),Ce("y",["yyy",3],0,"eraYear"),Ce("y",["yyyy",4],0,"eraYear"),ue("N",xC),ue("NN",xC),ue("NNN",xC),ue("NNNN",QB),ue("NNNNN",JB),pt(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?Oe(n).era=i:Oe(n).invalidEra=t}),ue("y",Nl),ue("yy",Nl),ue("yyy",Nl),ue("yyyy",Nl),ue("yo",ej),pt(["y","yy","yyy","yyyy"],Pn),pt(["yo"],function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Pn]=n._locale.eraYearOrdinalParse(t,i):e[Pn]=parseInt(t,10)});function BB(t,e){var n,r,i,o=this._eras||Io("en")._eras;for(n=0,r=o.length;n<r;++n)switch(typeof o[n].since==="string"&&(i=Z(o[n].since).startOf("day"),o[n].since=i.valueOf()),typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":i=Z(o[n].until).startOf("day").valueOf(),o[n].until=i.valueOf();break}return o}function jB(t,e,n){var r,i,o=this.eras(),s,a,l;for(t=t.toUpperCase(),r=0,i=o.length;r<i;++r)if(s=o[r].name.toUpperCase(),a=o[r].abbr.toUpperCase(),l=o[r].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(a===t)return o[r];break;case"NNNN":if(s===t)return o[r];break;case"NNNNN":if(l===t)return o[r];break}else if([s,a,l].indexOf(t)>=0)return o[r]}function UB(t,e){var n=t.since<=t.until?1:-1;return e===void 0?Z(t.since).year():Z(t.since).year()+(e-t.offset)*n}function zB(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].name;return""}function YB(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].narrow;return""}function GB(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].abbr;return""}function qB(){var t,e,n,r,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=i[t].since<=i[t].until?1:-1,r=this.clone().startOf("day").valueOf(),i[t].since<=r&&r<=i[t].until||i[t].until<=r&&r<=i[t].since)return(this.year()-Z(i[t].since).year())*n+i[t].offset;return this.year()}function KB(t){return Qe(this,"_erasNameRegex")||AC.call(this),t?this._erasNameRegex:this._erasRegex}function XB(t){return Qe(this,"_erasAbbrRegex")||AC.call(this),t?this._erasAbbrRegex:this._erasRegex}function ZB(t){return Qe(this,"_erasNarrowRegex")||AC.call(this),t?this._erasNarrowRegex:this._erasRegex}function xC(t,e){return e.erasAbbrRegex(t)}function QB(t,e){return e.erasNameRegex(t)}function JB(t,e){return e.erasNarrowRegex(t)}function ej(t,e){return e._eraYearOrdinalRegex||Nl}function AC(){var t=[],e=[],n=[],r=[],i,o,s,a,l,u=this.eras();for(i=0,o=u.length;i<o;++i)s=Eo(u[i].name),a=Eo(u[i].abbr),l=Eo(u[i].narrow),e.push(s),t.push(a),n.push(l),r.push(s),r.push(a),r.push(l);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}Ce(0,["gg",2],0,function(){return this.weekYear()%100}),Ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function gf(t,e){Ce(0,[t,t.length],0,e)}gf("gggg","weekYear"),gf("ggggg","weekYear"),gf("GGGG","isoWeekYear"),gf("GGGGG","isoWeekYear"),ue("G",tf),ue("g",tf),ue("GG",Rt,yr),ue("gg",Rt,yr),ue("GGGG",mC,gC),ue("gggg",mC,gC),ue("GGGGG",ef,Qd),ue("ggggg",ef,Qd),yc(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=Be(t)}),yc(["gg","GG"],function(t,e,n,r){e[r]=Z.parseTwoDigitYear(t)});function tj(t){return _P.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function nj(t){return _P.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function rj(){return Mo(this.year(),1,4)}function ij(){return Mo(this.isoWeekYear(),1,4)}function oj(){var t=this.localeData()._week;return Mo(this.year(),t.dow,t.doy)}function sj(){var t=this.localeData()._week;return Mo(this.weekYear(),t.dow,t.doy)}function _P(t,e,n,r,i){var o;return t==null?Ec(this,r,i).year:(o=Mo(t,r,i),e>o&&(e=o),aj.call(this,t,e,n,r,i))}function aj(t,e,n,r,i){var o=rP(t,e,n,r,i),s=Rc(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}Ce("Q",0,"Qo","quarter"),ue("Q",YI),pt("Q",function(t,e){e[To]=(Be(t)-1)*3});function lj(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Ce("D",["DD",2],"Do","date"),ue("D",Rt,Dl),ue("DD",Rt,yr),ue("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),pt(["D","DD"],Wi),pt("Do",function(t,e){e[Wi]=Be(t.match(Rt)[0])});var MP=kl("Date",!0);Ce("DDD",["DDDD",3],"DDDo","dayOfYear"),ue("DDD",Jd),ue("DDDD",GI),pt(["DDD","DDDD"],function(t,e,n){n._dayOfYear=Be(t)});function uj(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Ce("m",["mm",2],0,"minute"),ue("m",Rt,pC),ue("mm",Rt,yr),pt(["m","mm"],ui);var cj=kl("Minutes",!1);Ce("s",["ss",2],0,"second"),ue("s",Rt,pC),ue("ss",Rt,yr),pt(["s","ss"],_o);var hj=kl("Seconds",!1);Ce("S",0,0,function(){return~~(this.millisecond()/100)}),Ce(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Ce(0,["SSS",3],0,"millisecond"),Ce(0,["SSSS",4],0,function(){return this.millisecond()*10}),Ce(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Ce(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Ce(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Ce(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Ce(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ue("S",Jd,YI),ue("SS",Jd,yr),ue("SSS",Jd,GI);var ys,IP;for(ys="SSSS";ys.length<=9;ys+="S")ue(ys,Nl);function dj(t,e){e[aa]=Be(("0."+t)*1e3)}for(ys="S";ys.length<=9;ys+="S")pt(ys,dj);IP=kl("Milliseconds",!1),Ce("z",0,0,"zoneAbbr"),Ce("zz",0,0,"zoneName");function fj(){return this._isUTC?"UTC":""}function gj(){return this._isUTC?"Coordinated Universal Time":""}var te=vc.prototype;te.add=sB,te.calendar=fB,te.clone=gB,te.diff=bB,te.endOf=xB,te.format=TB,te.from=_B,te.fromNow=MB,te.to=IB,te.toNow=PB,te.get=EV,te.invalidAt=VB,te.isAfter=mB,te.isBefore=pB,te.isBetween=wB,te.isSame=vB,te.isSameOrAfter=CB,te.isSameOrBefore=yB,te.isValid=$B,te.lang=bP,te.locale=yP,te.localeData=SP,te.max=$W,te.min=LW,te.parsingFlags=FB,te.set=TV,te.startOf=OB,te.subtract=aB,te.toArray=DB,te.toObject=kB,te.toDate=NB,te.toISOString=RB,te.inspect=EB,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=LB,te.toString=SB,te.unix=HB,te.valueOf=AB,te.creationData=WB,te.eraName=zB,te.eraNarrow=YB,te.eraAbbr=GB,te.eraYear=qB,te.year=XI,te.isLeapYear=RV,te.weekYear=tj,te.isoWeekYear=nj,te.quarter=te.quarters=lj,te.month=tP,te.daysInMonth=NV,te.week=te.weeks=BV,te.isoWeek=te.isoWeeks=jV,te.weeksInYear=oj,te.weeksInWeekYear=sj,te.isoWeeksInYear=rj,te.isoWeeksInISOWeekYear=ij,te.date=MP,te.day=te.days=nW,te.weekday=rW,te.isoWeekday=iW,te.dayOfYear=uj,te.hour=te.hours=hW,te.minute=te.minutes=cj,te.second=te.seconds=hj,te.millisecond=te.milliseconds=IP,te.utcOffset=GW,te.utc=KW,te.local=XW,te.parseZone=ZW,te.hasAlignedHourOffset=QW,te.isDST=JW,te.isLocal=tB,te.isUtcOffset=nB,te.isUtc=mP,te.isUTC=mP,te.zoneAbbr=fj,te.zoneName=gj,te.dates=$r("dates accessor is deprecated. Use date instead.",MP),te.months=$r("months accessor is deprecated. Use month instead",tP),te.years=$r("years accessor is deprecated. Use year instead",XI),te.zone=$r("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",qW),te.isDSTShifted=$r("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",eB);function mj(t){return Et(t*1e3)}function pj(){return Et.apply(null,arguments).parseZone()}function PP(t){return t}var Je=uC.prototype;Je.calendar=tV,Je.longDateFormat=oV,Je.invalidDate=aV,Je.ordinal=cV,Je.preparse=PP,Je.postformat=PP,Je.relativeTime=dV,Je.pastFuture=fV,Je.set=JF,Je.eras=BB,Je.erasParse=jB,Je.erasConvertYear=UB,Je.erasAbbrRegex=XB,Je.erasNameRegex=KB,Je.erasNarrowRegex=ZB,Je.months=OV,Je.monthsShort=xV,Je.monthsParse=HV,Je.monthsRegex=kV,Je.monthsShortRegex=DV,Je.week=$V,Je.firstDayOfYear=WV,Je.firstDayOfWeek=VV,Je.weekdays=ZV,Je.weekdaysMin=JV,Je.weekdaysShort=QV,Je.weekdaysParse=tW,Je.weekdaysRegex=oW,Je.weekdaysShortRegex=sW,Je.weekdaysMinRegex=aW,Je.isPM=uW,Je.meridiem=dW;function mf(t,e,n,r){var i=Io(),o=$i().set(r,e);return i[n](o,t)}function OP(t,e,n){if(Ro(t)&&(e=t,t=void 0),t=t||"",e!=null)return mf(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=mf(t,r,n,"month");return i}function HC(t,e,n,r){typeof t=="boolean"?(Ro(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,Ro(e)&&(n=e,e=void 0),e=e||"");var i=Io(),o=t?i._week.dow:0,s,a=[];if(n!=null)return mf(e,(n+o)%7,r,"day");for(s=0;s<7;s++)a[s]=mf(e,(s+o)%7,r,"day");return a}function wj(t,e){return OP(t,e,"months")}function vj(t,e){return OP(t,e,"monthsShort")}function Cj(t,e,n){return HC(t,e,n,"weekdays")}function yj(t,e,n){return HC(t,e,n,"weekdaysShort")}function bj(t,e,n){return HC(t,e,n,"weekdaysMin")}Cs("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=Be(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}}),Z.lang=$r("moment.lang is deprecated. Use moment.locale instead.",Cs),Z.langData=$r("moment.langData is deprecated. Use moment.localeData instead.",Io);var Po=Math.abs;function Sj(){var t=this._data;return this._milliseconds=Po(this._milliseconds),this._days=Po(this._days),this._months=Po(this._months),t.milliseconds=Po(t.milliseconds),t.seconds=Po(t.seconds),t.minutes=Po(t.minutes),t.hours=Po(t.hours),t.months=Po(t.months),t.years=Po(t.years),this}function xP(t,e,n,r){var i=ci(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function Rj(t,e){return xP(this,t,e,1)}function Ej(t,e){return xP(this,t,e,-1)}function AP(t){return t<0?Math.floor(t):Math.ceil(t)}function Tj(){var t=this._milliseconds,e=this._days,n=this._months,r=this._data,i,o,s,a,l;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=AP(NC(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=Vr(t/1e3),r.seconds=i%60,o=Vr(i/60),r.minutes=o%60,s=Vr(o/60),r.hours=s%24,e+=Vr(s/24),l=Vr(HP(e)),n+=l,e-=AP(NC(l)),a=Vr(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function HP(t){return t*4800/146097}function NC(t){return t*146097/4800}function _j(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=Fr(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+HP(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(NC(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return e*24+r/36e5;case"minute":return e*1440+r/6e4;case"second":return e*86400+r/1e3;case"millisecond":return Math.floor(e*864e5)+r;default:throw new Error("Unknown unit "+t)}}function Oo(t){return function(){return this.as(t)}}var NP=Oo("ms"),Mj=Oo("s"),Ij=Oo("m"),Pj=Oo("h"),Oj=Oo("d"),xj=Oo("w"),Aj=Oo("M"),Hj=Oo("Q"),Nj=Oo("y"),Dj=NP;function kj(){return ci(this)}function Lj(t){return t=Fr(t),this.isValid()?this[t+"s"]():NaN}function ua(t){return function(){return this.isValid()?this._data[t]:NaN}}var $j=ua("milliseconds"),Fj=ua("seconds"),Vj=ua("minutes"),Wj=ua("hours"),Bj=ua("days"),jj=ua("months"),Uj=ua("years");function zj(){return Vr(this.days()/7)}var xo=Math.round,Vl={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Yj(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function Gj(t,e,n,r){var i=ci(t).abs(),o=xo(i.as("s")),s=xo(i.as("m")),a=xo(i.as("h")),l=xo(i.as("d")),u=xo(i.as("M")),c=xo(i.as("w")),h=xo(i.as("y")),d=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||s<=1&&["m"]||s<n.m&&["mm",s]||a<=1&&["h"]||a<n.h&&["hh",a]||l<=1&&["d"]||l<n.d&&["dd",l];return n.w!=null&&(d=d||c<=1&&["w"]||c<n.w&&["ww",c]),d=d||u<=1&&["M"]||u<n.M&&["MM",u]||h<=1&&["y"]||["yy",h],d[2]=e,d[3]=+t>0,d[4]=r,Yj.apply(null,d)}function qj(t){return t===void 0?xo:typeof t=="function"?(xo=t,!0):!1}function Kj(t,e){return Vl[t]===void 0?!1:e===void 0?Vl[t]:(Vl[t]=e,t==="s"&&(Vl.ss=e-1),!0)}function Xj(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Vl,i,o;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},Vl,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),o=Gj(this,!n,r,i),n&&(o=i.pastFuture(+this,o)),i.postformat(o)}var DC=Math.abs;function Wl(t){return(t>0)-(t<0)||+t}function pf(){if(!this.isValid())return this.localeData().invalidDate();var t=DC(this._milliseconds)/1e3,e=DC(this._days),n=DC(this._months),r,i,o,s,a=this.asSeconds(),l,u,c,h;return a?(r=Vr(t/60),i=Vr(r/60),t%=60,r%=60,o=Vr(n/12),n%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=Wl(this._months)!==Wl(a)?"-":"",c=Wl(this._days)!==Wl(a)?"-":"",h=Wl(this._milliseconds)!==Wl(a)?"-":"",l+"P"+(o?u+o+"Y":"")+(n?u+n+"M":"")+(e?c+e+"D":"")+(i||r||t?"T":"")+(i?h+i+"H":"")+(r?h+r+"M":"")+(t?h+s+"S":"")):"P0D"}var Ye=uf.prototype;Ye.isValid=jW,Ye.abs=Sj,Ye.add=Rj,Ye.subtract=Ej,Ye.as=_j,Ye.asMilliseconds=NP,Ye.asSeconds=Mj,Ye.asMinutes=Ij,Ye.asHours=Pj,Ye.asDays=Oj,Ye.asWeeks=xj,Ye.asMonths=Aj,Ye.asQuarters=Hj,Ye.asYears=Nj,Ye.valueOf=Dj,Ye._bubble=Tj,Ye.clone=kj,Ye.get=Lj,Ye.milliseconds=$j,Ye.seconds=Fj,Ye.minutes=Vj,Ye.hours=Wj,Ye.days=Bj,Ye.weeks=zj,Ye.months=jj,Ye.years=Uj,Ye.humanize=Xj,Ye.toISOString=pf,Ye.toString=pf,Ye.toJSON=pf,Ye.locale=yP,Ye.localeData=SP,Ye.toIsoString=$r("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",pf),Ye.lang=bP,Ce("X",0,0,"unix"),Ce("x",0,0,"valueOf"),ue("x",tf),ue("X",wV),pt("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),pt("x",function(t,e,n){n._d=new Date(Be(t))});Z.version="2.30.1",ZF(Et),Z.fn=te,Z.min=FW,Z.max=VW,Z.now=WW,Z.utc=$i,Z.unix=mj,Z.months=wj,Z.isDate=wc,Z.locale=Cs,Z.invalid=Kd,Z.duration=ci,Z.isMoment=li,Z.weekdays=Cj,Z.parseZone=pj,Z.localeData=Io,Z.isDuration=cf,Z.monthsShort=vj,Z.weekdaysMin=bj,Z.defineLocale=SC,Z.updateLocale=pW,Z.locales=wW,Z.weekdaysShort=yj,Z.normalizeUnits=Fr,Z.relativeTimeRounding=qj,Z.relativeTimeThreshold=Kj,Z.calendarFormat=dB,Z.prototype=te,Z.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};var DP={},kC,kP;function Bi(){if(kP)return kC;kP=1;var t=Xt(),e=Set.prototype;return kC={Set,add:t(e.add),has:t(e.has),remove:t(e.delete),proto:e},kC}var LC,LP;function ca(){if(LP)return LC;LP=1;var t=Bi().has;return LC=function(e){return t(e),e},LC}var $C,$P;function ha(){if($P)return $C;$P=1;var t=In();return $C=function(e,n,r){for(var i=r?e:e.iterator,o=e.next,s,a;!(s=t(o,i)).done;)if(a=n(s.value),a!==void 0)return a},$C}var FC,FP;function Ic(){if(FP)return FC;FP=1;var t=Xt(),e=ha(),n=Bi(),r=n.Set,i=n.proto,o=t(i.forEach),s=t(i.keys),a=s(new r).next;return FC=function(l,u,c){return c?e({iterator:s(l),next:a},u):o(l,u)},FC}var VC,VP;function WC(){if(VP)return VC;VP=1;var t=Bi(),e=Ic(),n=t.Set,r=t.add;return VC=function(i){var o=new n;return e(i,function(s){r(o,s)}),o},VC}var BC,WP;function Pc(){if(WP)return BC;WP=1;var t=yM(),e=Bi();return BC=t(e.proto,"size","get")||function(n){return n.size},BC}var jC,BP;function da(){if(BP)return jC;BP=1;var t=Jn(),e=nn(),n=In(),r=pc(),i=Li(),o="Invalid size",s=RangeError,a=TypeError,l=Math.max,u=function(c,h){this.set=c,this.size=l(h,0),this.has=t(c.has),this.keys=t(c.keys)};return u.prototype={getIterator:function(){return i(e(n(this.keys,this.set)))},includes:function(c){return n(this.has,this.set,c)}},jC=function(c){e(c);var h=+c.size;if(h!==h)throw new a(o);var d=r(h);if(d<0)throw new s(o);return new u(c,d)},jC}var UC,jP;function Zj(){if(jP)return UC;jP=1;var t=ca(),e=Bi(),n=WC(),r=Pc(),i=da(),o=Ic(),s=ha(),a=e.has,l=e.remove;return UC=function(c){var h=t(this),d=i(c),f=n(h);return r(h)<=d.size?o(h,function(m){d.includes(m)&&l(f,m)}):s(d.getIterator(),function(m){a(h,m)&&l(f,m)}),f},UC}var zC,UP;function fa(){if(UP)return zC;UP=1;var t=Ml(),e=function(r){return{size:r,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},n=function(r){return{size:r,has:function(){return!0},keys:function(){throw new Error("e")}}};return zC=function(r,i){var o=t("Set");try{new o()[r](e(0));try{return new o()[r](e(-1)),!1}catch{if(!i)return!0;try{return new o()[r](n(-1/0)),!1}catch{var s=new o;return s.add(1),s.add(2),i(s[r](n(1/0)))}}}catch{return!1}},zC}var zP;function Qj(){if(zP)return DP;zP=1;var t=vt(),e=Zj(),n=fa(),r=!n("difference",function(i){return i.size===0});return t({target:"Set",proto:!0,real:!0,forced:r},{difference:e}),DP}Qj();var YP={},YC,GP;function Jj(){if(GP)return YC;GP=1;var t=ca(),e=Bi(),n=Pc(),r=da(),i=Ic(),o=ha(),s=e.Set,a=e.add,l=e.has;return YC=function(c){var h=t(this),d=r(c),f=new s;return n(h)>d.size?o(d.getIterator(),function(m){l(h,m)&&a(f,m)}):i(h,function(m){d.includes(m)&&a(f,m)}),f},YC}var qP;function eU(){if(qP)return YP;qP=1;var t=vt(),e=Rn(),n=Jj(),r=fa(),i=!r("intersection",function(o){return o.size===2&&o.has(1)&&o.has(2)})||e(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});return t({target:"Set",proto:!0,real:!0,forced:i},{intersection:n}),YP}eU();var KP={},GC,XP;function tU(){if(XP)return GC;XP=1;var t=ca(),e=Bi().has,n=Pc(),r=da(),i=Ic(),o=ha(),s=xl();return GC=function(l){var u=t(this),c=r(l);if(n(u)<=c.size)return i(u,function(d){if(c.includes(d))return!1},!0)!==!1;var h=c.getIterator();return o(h,function(d){if(e(u,d))return s(h,"normal",!1)})!==!1},GC}var ZP;function nU(){if(ZP)return KP;ZP=1;var t=vt(),e=tU(),n=fa(),r=!n("isDisjointFrom",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isDisjointFrom:e}),KP}nU();var QP={},qC,JP;function rU(){if(JP)return qC;JP=1;var t=ca(),e=Pc(),n=Ic(),r=da();return qC=function(o){var s=t(this),a=r(o);return e(s)>a.size?!1:n(s,function(l){if(!a.includes(l))return!1},!0)!==!1},qC}var eO;function iU(){if(eO)return QP;eO=1;var t=vt(),e=rU(),n=fa(),r=!n("isSubsetOf",function(i){return i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSubsetOf:e}),QP}iU();var tO={},KC,nO;function oU(){if(nO)return KC;nO=1;var t=ca(),e=Bi().has,n=Pc(),r=da(),i=ha(),o=xl();return KC=function(a){var l=t(this),u=r(a);if(n(l)<u.size)return!1;var c=u.getIterator();return i(c,function(h){if(!e(l,h))return o(c,"normal",!1)})!==!1},KC}var rO;function sU(){if(rO)return tO;rO=1;var t=vt(),e=oU(),n=fa(),r=!n("isSupersetOf",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSupersetOf:e}),tO}sU();var iO={},XC,oO;function aU(){if(oO)return XC;oO=1;var t=ca(),e=Bi(),n=WC(),r=da(),i=ha(),o=e.add,s=e.has,a=e.remove;return XC=function(u){var c=t(this),h=r(u).getIterator(),d=n(c);return i(h,function(f){s(c,f)?a(d,f):o(d,f)}),d},XC}var sO;function lU(){if(sO)return iO;sO=1;var t=vt(),e=aU(),n=fa();return t({target:"Set",proto:!0,real:!0,forced:!n("symmetricDifference")},{symmetricDifference:e}),iO}lU();var aO={},ZC,lO;function uU(){if(lO)return ZC;lO=1;var t=ca(),e=Bi().add,n=WC(),r=da(),i=ha();return ZC=function(s){var a=t(this),l=r(s).getIterator(),u=n(a);return i(l,function(c){e(u,c)}),u},ZC}var uO;function cU(){if(uO)return aO;uO=1;var t=vt(),e=uU(),n=fa();return t({target:"Set",proto:!0,real:!0,forced:!n("union")},{union:e}),aO}cU();function hU(t){const e=t.length;let n=0;for(;n<e;)t[n]=[t[n]],n+=1}function cO(t,e){const n=e.length;let r=0;for(;r<n;)t.push(e[r]),r+=1}function wf(t){const e=[];if(!t||t.length===0||!t[0]||t[0].length===0)return e;const n=t.length,r=t[0].length;for(let i=0;i<n;i++)for(let o=0;o<r;o++)e[o]||(e[o]=[]),e[o][i]=t[i][o];return e}function tr(t,e,n,r){let i=-1,o=t,s=n;Array.isArray(t)||(o=Array.from(t));const a=o.length;for(i+=1;i<a;)s=e(s,o[i],i,o),i+=1;return s}function ga(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length,o=[];let s=-1;for(;n<i;){const a=r[n];e(a,n,r)&&(s+=1,o[s]=a),n+=1}return o}function je(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length,o=[];let s=-1;for(;n<i;){const a=r[n];s+=1,o[s]=e(a,n,r),n+=1}return o}function H(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length;for(;n<i&&e(r[n],n,r)!==!1;)n+=1;return t}function dU(t){const e=[];return H(t,n=>{e.indexOf(n)===-1&&e.push(n)}),e}function hO(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const[r,...i]=[...e];let o=r;return H(i,s=>{o=o.filter(a=>!s.includes(a))}),o}function dO(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function tt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return tr(t,(o,s,a)=>{const l=s.replace(/\r?\n\s*/g,""),u=n[a]?n[a]:"";return o+l+u},"").trim()}function xt(t){let e;switch(typeof t){case"string":case"number":e=`${t}`;break;case"object":e=t===null?"":t.toString();break;case"undefined":e="";break;default:e=t.toString();break}return e}function ce(t){return typeof t<"u"}function At(t){return typeof t>"u"}function Bt(t){return t===null||t===""||At(t)}function fU(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const Oc="length",xc=t=>parseInt(t,16),fO=t=>parseInt(t,10),vf=(t,e,n)=>t.substr(e,n),Ac=t=>t.codePointAt(0)-65,QC=t=>`${t}`.replace(/\-/g,""),gU=t=>xc(vf(QC(t),xc("12"),Ac("F")))/(xc(vf(QC(t),Ac("B"),~~![][Oc]))||9),mU=()=>typeof location<"u"&&/^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host);let gO=!1;const mO={invalid:()=>tt`
5
- The license key for Handsontable is invalid.\x20
6
- If you need any help, contact us at support@handsontable.com.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return tt`
7
- The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
8
- version ${n}. Renew your license key at handsontable.com or downgrade to a version released prior\x20
9
- to ${e}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>tt`
10
- The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
11
- Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
12
- passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20
13
- us at support@handsontable.com.`,non_commercial:()=>""},pO={invalid:()=>tt`
14
- The license key for Handsontable is invalid.\x20
15
- <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
16
- install it properly or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return tt`
17
- The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
18
- version ${n}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
19
- license key or downgrade to a version released prior to ${e}. If you need any\x20
20
- help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`},missing:()=>tt`
21
- The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
22
- Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
23
- passing the key: 'non-commercial-and-evaluation'.\x20
24
- <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
25
- the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function pU(t,e){const n=!Bt(t),r=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",i="15.3.0";let o,s="invalid",a="invalid";t=QC(t||"");const l=wU(t);if(n||r||l)if(l){const u=Z("29/04/2025","DD/MM/YYYY"),c=Math.floor(u.toDate().getTime()/864e5),h=gU(t);o=Z((h+1)*864e5,"x").format("MMMM DD, YYYY"),c>h?(s="expired",a="expired"):(s="valid",a="valid")}else r?(s="non_commercial",a="valid"):(s="invalid",a="invalid");else s="missing",a="missing";if(mU()&&(s="valid",a="valid"),!gO&&s!=="valid"&&(mO[s]({keyValidityDate:o,hotVersion:i})&&console[s==="non_commercial"?"info":"warn"](mO[s]({keyValidityDate:o,hotVersion:i})),gO=!0),a!=="valid"&&e.parentNode&&pO[a]({keyValidityDate:o,hotVersion:i})){const c=document.createElement("div");c.className="handsontable hot-display-license-info",c.innerHTML=pO[a]({keyValidityDate:o,hotVersion:i}),e.parentNode.insertBefore(c,e.nextSibling)}}function wU(t){let e=[][Oc],n=e;if(t[Oc]!==Ac("Z"))return!1;for(let r="",i="B<H4P+".split(""),o=Ac(i.shift());o;o=Ac(i.shift()||"A"))--o<""[Oc]?n=n|(fO(`${fO(xc(r)+(xc(vf(t,Math.abs(o),2))+[]).padStart(2,"0"))}`)%97||2)>>1:r=vf(t,o,o?i[Oc]===1?9:8:6);return n===e}var wO={},JC,vO;function ey(){if(vO)return JC;vO=1;var t=Xt();return JC=t([].slice),JC}var ty,CO;function vU(){if(CO)return ty;CO=1;var t=Xt(),e=VM(),n=tn(),r=oa(),i=qd(),o=t([].push);return ty=function(s){if(n(s))return s;if(e(s)){for(var a=s.length,l=[],u=0;u<a;u++){var c=s[u];typeof c=="string"?o(l,c):(typeof c=="number"||r(c)==="Number"||r(c)==="String")&&o(l,i(c))}var h=l.length,d=!0;return function(f,m){if(d)return d=!1,m;if(e(this))return m;for(var b=0;b<h;b++)if(l[b]===f)return m}}},ty}var yO;function CU(){if(yO)return wO;yO=1;var t=vt(),e=Ml(),n=Gd(),r=In(),i=Xt(),o=Rn(),s=tn(),a=pw(),l=ey(),u=vU(),c=fw(),h=String,d=e("JSON","stringify"),f=i(/./.exec),m=i("".charAt),b=i("".charCodeAt),S=i("".replace),E=i(1 .toString),v=/[\uD800-\uDFFF]/g,I=/^[\uD800-\uDBFF]$/,M=/^[\uDC00-\uDFFF]$/,T=!c||o(function(){var Y=e("Symbol")("stringify detection");return d([Y])!=="[null]"||d({a:Y})!=="{}"||d(Object(Y))!=="{}"}),P=o(function(){return d("\uDF06\uD834")!=='"\\udf06\\ud834"'||d("\uDEAD")!=='"\\udead"'}),D=function(Y,U){var J=l(arguments),ee=u(U);if(!(!s(ee)&&(Y===void 0||a(Y))))return J[1]=function(ae,ne){if(s(ee)&&(ne=r(ee,this,h(ae),ne)),!a(ne))return ne},n(d,null,J)},K=function(Y,U,J){var ee=m(J,U-1),ae=m(J,U+1);return f(I,Y)&&!f(M,ae)||f(M,Y)&&!f(I,ee)?"\\u"+E(b(Y,0),16):Y};return d&&t({target:"JSON",stat:!0,arity:3,forced:T||P},{stringify:function(U,J,ee){var ae=l(arguments),ne=n(T?D:d,null,ae);return P&&typeof ne=="string"?S(ne,v,K):ne}}),wO}CU();var bO={},SO={},RO;function yU(){if(RO)return SO;RO=1;var t=vt(),e=Al(),n=Jn(),r=nn(),i=Li();return t({target:"Iterator",proto:!0,real:!0},{forEach:function(s){r(this),n(s);var a=i(this),l=0;e(a,function(u){s(u,l++)},{IS_RECORD:!0})}}),SO}var EO;function bU(){return EO||(EO=1,yU()),bO}bU();function Hc(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},Ne(t,(n,r)=>{r!=="__children"&&(n&&typeof n=="object"&&!Array.isArray(n)?e[r]=Hc(n):Array.isArray(n)?n.length&&typeof n[0]=="object"&&!Array.isArray(n[0])?e[r]=[Hc(n[0])]:e[r]=[]:e[r]=null)})),e}function SU(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function rn(t,e,n){const r=Array.isArray(n);return Ne(e,(i,o)=>{(r===!1||n.includes(o))&&(t[o]=i)}),t}function Cf(t,e){Ne(e,(n,r)=>{e[r]&&typeof e[r]=="object"?(t[r]||(Array.isArray(e[r])?t[r]=[]:Object.prototype.toString.call(e[r])==="[object Date]"?t[r]=e[r]:t[r]={}),Cf(t[r],e[r])):t[r]=e[r]})}function Fn(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function ji(t){const e={};return Ne(t,(n,r)=>{e[r]=n}),e}function ct(t){t.MIXINS||(t.MIXINS=[]);for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return H(n,i=>{t.MIXINS.push(i.MIXIN_NAME),Ne(i,(o,s)=>{if(t.prototype[s]!==void 0)throw new Error(`Mixin conflict. Property '${s}' already exist and cannot be overwritten.`);if(typeof o=="function")t.prototype[s]=o;else{const a=function(c,h){const d=`_${c}`,f=m=>{let b=m;return(Array.isArray(b)||He(b))&&(b=Fn(b)),b};return function(){return this[d]===void 0&&(this[d]=f(h)),this[d]}},l=function(c){const h=`_${c}`;return function(d){this[h]=d}};Object.defineProperty(t.prototype,s,{get:a(s,o),set:l(s),configurable:!0})}})}),t}function ny(t,e){return JSON.stringify(t)===JSON.stringify(e)}function He(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ao(t,e,n,r){r.value=n,r.writable=r.writable!==!1,r.enumerable=r.enumerable!==!1,r.configurable=r.configurable!==!1,Object.defineProperty(t,e,r)}function Ne(t,e){for(const n in t)if((!t.hasOwnProperty||t.hasOwnProperty&&Object.prototype.hasOwnProperty.call(t,n))&&e(t[n],n,t)===!1)break;return t}function RU(t,e){const n=e.split(".");let r=t;return Ne(n,i=>{if(r=r[i],r===void 0)return r=void 0,!1}),r}function ry(t,e,n){if(typeof e!="string")return;const r=e.split(".");let i=t;r.forEach((o,s)=>{o==="__proto__"||o==="constructor"||o==="prototype"||(s!==r.length-1?(on(i,o)||(i[o]={}),i=i[o]):i[o]=n)})}function iy(t){if(!He(t))return 0;const e=function(n){let r=0;return He(n)?Ne(n,(i,o)=>{o!=="__children"&&(r+=e(i))}):r+=1,r};return e(t)}function br(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"value";const n=`_${e}`,r={_touched:!1,[n]:t,isTouched(){return this._touched}};return Object.defineProperty(r,e,{get(){return this[n]},set(i){this._touched=!0,this[n]=i},enumerable:!0,configurable:!0}),r}function on(t,e){return Object.prototype.hasOwnProperty.call(t,e)}const EU="hooksRefRegisterer",TO={_hooksStorage:Object.create(null),addHook(t,e){return this._hooksStorage[t]||(this._hooksStorage[t]=[]),this.hot.addHook(t,e),this._hooksStorage[t].push(e),this},removeHooksByKey(t){H(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){Ne(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};Ao(TO,"MIXIN_NAME",EU,{writable:!1,enumerable:!1});const{entries:_O,setPrototypeOf:MO,isFrozen:TU,getPrototypeOf:_U,getOwnPropertyDescriptor:MU}=Object;let{freeze:Vn,seal:Wr,create:Bl}=Object,{apply:oy,construct:sy}=typeof Reflect<"u"&&Reflect;Vn||(Vn=function(e){return e}),Wr||(Wr=function(e){return e}),oy||(oy=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return e.apply(n,i)}),sy||(sy=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new e(...r)});const Nc=sn(Array.prototype.forEach),IU=sn(Array.prototype.lastIndexOf),IO=sn(Array.prototype.pop),Dc=sn(Array.prototype.push),PU=sn(Array.prototype.splice),Wn=Array.isArray,kc=sn(String.prototype.toLowerCase),ay=sn(String.prototype.toString),PO=sn(String.prototype.match),jl=sn(String.prototype.replace),OO=sn(String.prototype.indexOf),OU=sn(String.prototype.trim),xU=sn(Number.prototype.toString),AU=sn(Boolean.prototype.toString),xO=typeof BigInt>"u"?null:sn(BigInt.prototype.toString),AO=typeof Symbol>"u"?null:sn(Symbol.prototype.toString),jt=sn(Object.prototype.hasOwnProperty),Lc=sn(Object.prototype.toString),En=sn(RegExp.prototype.test),yf=HU(TypeError);function sn(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return oy(t,e,r)}}function HU(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return sy(t,n)}}function xe(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kc;if(MO&&MO(t,null),!Wn(e))return t;let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=n(i);o!==i&&(TU(e)||(e[r]=o),i=o)}t[i]=!0}return t}function NU(t){for(let e=0;e<t.length;e++)jt(t,e)||(t[e]=null);return t}function nr(t){const e=Bl(null);for(const[n,r]of _O(t))jt(t,n)&&(Wn(r)?e[n]=NU(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=nr(r):e[n]=r);return e}function DU(t){switch(typeof t){case"string":return t;case"number":return xU(t);case"boolean":return AU(t);case"bigint":return xO?xO(t):"0";case"symbol":return AO?AO(t):"Symbol()";case"undefined":return Lc(t);case"function":case"object":{if(t===null)return Lc(t);const e=t,n=Ul(e,"toString");if(typeof n=="function"){const r=n(e);return typeof r=="string"?r:Lc(r)}return Lc(t)}default:return Lc(t)}}function Ul(t,e){for(;t!==null;){const r=MU(t,e);if(r){if(r.get)return sn(r.get);if(typeof r.value=="function")return sn(r.value)}t=_U(t)}function n(){return null}return n}function kU(t){try{return En(t,""),!0}catch{return!1}}const HO=Vn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ly=Vn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),uy=Vn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),LU=Vn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),cy=Vn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$U=Vn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),NO=Vn(["#text"]),DO=Vn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),hy=Vn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),kO=Vn(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),bf=Vn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),FU=Wr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),VU=Wr(/<%[\w\W]*|[\w\W]*%>/gm),WU=Wr(/\$\{[\w\W]*/gm),BU=Wr(/^data-[\-\w.\u00B7-\uFFFF]+$/),jU=Wr(/^aria-[\-\w]+$/),LO=Wr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),UU=Wr(/^(?:\w+script|data):/i),zU=Wr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$O=Wr(/^html$/i),YU=Wr(/^[a-z][.\w]*(-[.\w]+)+$/i);var FO=Object.freeze({__proto__:null,ARIA_ATTR:jU,ATTR_WHITESPACE:zU,CUSTOM_ELEMENT:YU,DATA_ATTR:BU,DOCTYPE_NAME:$O,ERB_EXPR:VU,IS_ALLOWED_URI:LO,IS_SCRIPT_OR_DATA:UU,MUSTACHE_EXPR:FU,TMPLIT_EXPR:WU});const $c={element:1,text:3,progressingInstruction:7,comment:8,document:9},GU=function(){return typeof window>"u"?null:window},qU=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},VO=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function WO(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:GU();const e=Re=>WO(Re);if(e.version="3.4.2",e.removed=[],!t||!t.document||t.document.nodeType!==$c.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:f}=t,m=l.prototype,b=Ul(m,"cloneNode"),S=Ul(m,"remove"),E=Ul(m,"nextSibling"),v=Ul(m,"childNodes"),I=Ul(m,"parentNode");if(typeof s=="function"){const Re=n.createElement("template");Re.content&&Re.content.ownerDocument&&(n=Re.content.ownerDocument)}let M,T="";const{implementation:P,createNodeIterator:D,createDocumentFragment:K,getElementsByTagName:Y}=n,{importNode:U}=r;let J=VO();e.isSupported=typeof _O=="function"&&typeof I=="function"&&P&&P.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ee,ERB_EXPR:ae,TMPLIT_EXPR:ne,DATA_ATTR:se,ARIA_ATTR:ft,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:Ee,CUSTOM_ELEMENT:gt}=FO;let{IS_ALLOWED_URI:Wt}=FO,q=null;const g=xe({},[...HO,...ly,...uy,...cy,...NO]);let w=null;const p=xe({},[...DO,...hy,...kO,...bf]);let _=Object.seal(Bl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),A=null,$=null;const W=Object.seal(Bl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let z=!0,y=!0,R=!1,C=!0,N=!1,O=!0,L=!1,j=!1,k=!1,F=!1,B=!1,V=!1,G=!0,le=!1;const de="user-content-";let Pe=!0,$e=!1,Ue={},be=null;const Fe=xe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let It=null;const yo=xe({},["audio","video","img","source","image","track"]);let bo=null;const So=xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pt="http://www.w3.org/1998/Math/MathML",Qn="http://www.w3.org/2000/svg",ut="http://www.w3.org/1999/xhtml";let wt=ut,We=!1,vr=null;const Yp=xe({},[Pt,Qn,ut],ay);let uc=xe({},["mi","mo","mn","ms","mtext"]),BT=xe({},["annotation-xml"]);const kle=xe({},["title","style","font","a","script"]);let Vd=null;const Lle=["application/xhtml+xml","text/html"],$le="text/html";let wn=null,cc=null;const Fle=n.createElement("form"),U$=function(x){return x instanceof RegExp||x instanceof Function},jT=function(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(cc&&cc===x)return;(!x||typeof x!="object")&&(x={}),x=nr(x),Vd=Lle.indexOf(x.PARSER_MEDIA_TYPE)===-1?$le:x.PARSER_MEDIA_TYPE,wn=Vd==="application/xhtml+xml"?ay:kc,q=jt(x,"ALLOWED_TAGS")&&Wn(x.ALLOWED_TAGS)?xe({},x.ALLOWED_TAGS,wn):g,w=jt(x,"ALLOWED_ATTR")&&Wn(x.ALLOWED_ATTR)?xe({},x.ALLOWED_ATTR,wn):p,vr=jt(x,"ALLOWED_NAMESPACES")&&Wn(x.ALLOWED_NAMESPACES)?xe({},x.ALLOWED_NAMESPACES,ay):Yp,bo=jt(x,"ADD_URI_SAFE_ATTR")&&Wn(x.ADD_URI_SAFE_ATTR)?xe(nr(So),x.ADD_URI_SAFE_ATTR,wn):So,It=jt(x,"ADD_DATA_URI_TAGS")&&Wn(x.ADD_DATA_URI_TAGS)?xe(nr(yo),x.ADD_DATA_URI_TAGS,wn):yo,be=jt(x,"FORBID_CONTENTS")&&Wn(x.FORBID_CONTENTS)?xe({},x.FORBID_CONTENTS,wn):Fe,A=jt(x,"FORBID_TAGS")&&Wn(x.FORBID_TAGS)?xe({},x.FORBID_TAGS,wn):nr({}),$=jt(x,"FORBID_ATTR")&&Wn(x.FORBID_ATTR)?xe({},x.FORBID_ATTR,wn):nr({}),Ue=jt(x,"USE_PROFILES")?x.USE_PROFILES&&typeof x.USE_PROFILES=="object"?nr(x.USE_PROFILES):x.USE_PROFILES:!1,z=x.ALLOW_ARIA_ATTR!==!1,y=x.ALLOW_DATA_ATTR!==!1,R=x.ALLOW_UNKNOWN_PROTOCOLS||!1,C=x.ALLOW_SELF_CLOSE_IN_ATTR!==!1,N=x.SAFE_FOR_TEMPLATES||!1,O=x.SAFE_FOR_XML!==!1,L=x.WHOLE_DOCUMENT||!1,F=x.RETURN_DOM||!1,B=x.RETURN_DOM_FRAGMENT||!1,V=x.RETURN_TRUSTED_TYPE||!1,k=x.FORCE_BODY||!1,G=x.SANITIZE_DOM!==!1,le=x.SANITIZE_NAMED_PROPS||!1,Pe=x.KEEP_CONTENT!==!1,$e=x.IN_PLACE||!1,Wt=kU(x.ALLOWED_URI_REGEXP)?x.ALLOWED_URI_REGEXP:LO,wt=typeof x.NAMESPACE=="string"?x.NAMESPACE:ut,uc=jt(x,"MATHML_TEXT_INTEGRATION_POINTS")&&x.MATHML_TEXT_INTEGRATION_POINTS&&typeof x.MATHML_TEXT_INTEGRATION_POINTS=="object"?nr(x.MATHML_TEXT_INTEGRATION_POINTS):xe({},["mi","mo","mn","ms","mtext"]),BT=jt(x,"HTML_INTEGRATION_POINTS")&&x.HTML_INTEGRATION_POINTS&&typeof x.HTML_INTEGRATION_POINTS=="object"?nr(x.HTML_INTEGRATION_POINTS):xe({},["annotation-xml"]);const Q=jt(x,"CUSTOM_ELEMENT_HANDLING")&&x.CUSTOM_ELEMENT_HANDLING&&typeof x.CUSTOM_ELEMENT_HANDLING=="object"?nr(x.CUSTOM_ELEMENT_HANDLING):Bl(null);if(_=Bl(null),jt(Q,"tagNameCheck")&&U$(Q.tagNameCheck)&&(_.tagNameCheck=Q.tagNameCheck),jt(Q,"attributeNameCheck")&&U$(Q.attributeNameCheck)&&(_.attributeNameCheck=Q.attributeNameCheck),jt(Q,"allowCustomizedBuiltInElements")&&typeof Q.allowCustomizedBuiltInElements=="boolean"&&(_.allowCustomizedBuiltInElements=Q.allowCustomizedBuiltInElements),N&&(y=!1),B&&(F=!0),Ue&&(q=xe({},NO),w=Bl(null),Ue.html===!0&&(xe(q,HO),xe(w,DO)),Ue.svg===!0&&(xe(q,ly),xe(w,hy),xe(w,bf)),Ue.svgFilters===!0&&(xe(q,uy),xe(w,hy),xe(w,bf)),Ue.mathMl===!0&&(xe(q,cy),xe(w,kO),xe(w,bf))),W.tagCheck=null,W.attributeCheck=null,jt(x,"ADD_TAGS")&&(typeof x.ADD_TAGS=="function"?W.tagCheck=x.ADD_TAGS:Wn(x.ADD_TAGS)&&(q===g&&(q=nr(q)),xe(q,x.ADD_TAGS,wn))),jt(x,"ADD_ATTR")&&(typeof x.ADD_ATTR=="function"?W.attributeCheck=x.ADD_ATTR:Wn(x.ADD_ATTR)&&(w===p&&(w=nr(w)),xe(w,x.ADD_ATTR,wn))),jt(x,"ADD_URI_SAFE_ATTR")&&Wn(x.ADD_URI_SAFE_ATTR)&&xe(bo,x.ADD_URI_SAFE_ATTR,wn),jt(x,"FORBID_CONTENTS")&&Wn(x.FORBID_CONTENTS)&&(be===Fe&&(be=nr(be)),xe(be,x.FORBID_CONTENTS,wn)),jt(x,"ADD_FORBID_CONTENTS")&&Wn(x.ADD_FORBID_CONTENTS)&&(be===Fe&&(be=nr(be)),xe(be,x.ADD_FORBID_CONTENTS,wn)),Pe&&(q["#text"]=!0),L&&xe(q,["html","head","body"]),q.table&&(xe(q,["tbody"]),delete A.tbody),x.TRUSTED_TYPES_POLICY){if(typeof x.TRUSTED_TYPES_POLICY.createHTML!="function")throw yf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof x.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw yf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=x.TRUSTED_TYPES_POLICY,T=M.createHTML("")}else M===void 0&&(M=qU(f,i)),M!==null&&typeof T=="string"&&(T=M.createHTML(""));Vn&&Vn(x),cc=x},z$=xe({},[...ly,...uy,...LU]),Y$=xe({},[...cy,...$U]),Vle=function(x){let Q=I(x);(!Q||!Q.tagName)&&(Q={namespaceURI:wt,tagName:"template"});const ge=kc(x.tagName),St=kc(Q.tagName);return vr[x.namespaceURI]?x.namespaceURI===Qn?Q.namespaceURI===ut?ge==="svg":Q.namespaceURI===Pt?ge==="svg"&&(St==="annotation-xml"||uc[St]):!!z$[ge]:x.namespaceURI===Pt?Q.namespaceURI===ut?ge==="math":Q.namespaceURI===Qn?ge==="math"&&BT[St]:!!Y$[ge]:x.namespaceURI===ut?Q.namespaceURI===Qn&&!BT[St]||Q.namespaceURI===Pt&&!uc[St]?!1:!Y$[ge]&&(kle[ge]||!z$[ge]):!!(Vd==="application/xhtml+xml"&&vr[x.namespaceURI]):!1},Ni=function(x){Dc(e.removed,{element:x});try{I(x).removeChild(x)}catch{S(x)}},_l=function(x,Q){try{Dc(e.removed,{attribute:Q.getAttributeNode(x),from:Q})}catch{Dc(e.removed,{attribute:null,from:Q})}if(Q.removeAttribute(x),x==="is")if(F||B)try{Ni(Q)}catch{}else try{Q.setAttribute(x,"")}catch{}},G$=function(x){let Q=null,ge=null;if(k)x="<remove></remove>"+x;else{const hn=PO(x,/^[\r\n\t ]+/);ge=hn&&hn[0]}Vd==="application/xhtml+xml"&&wt===ut&&(x='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+x+"</body></html>");const St=M?M.createHTML(x):x;if(wt===ut)try{Q=new d().parseFromString(St,Vd)}catch{}if(!Q||!Q.documentElement){Q=P.createDocument(wt,"template",null);try{Q.documentElement.innerHTML=We?T:St}catch{}}const $n=Q.body||Q.documentElement;return x&&ge&&$n.insertBefore(n.createTextNode(ge),$n.childNodes[0]||null),wt===ut?Y.call(Q,L?"html":"body")[0]:L?Q.documentElement:$n},q$=function(x){return D.call(x.ownerDocument||x,x,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},UT=function(x){return x instanceof h&&(typeof x.nodeName!="string"||typeof x.textContent!="string"||typeof x.removeChild!="function"||!(x.attributes instanceof c)||typeof x.removeAttribute!="function"||typeof x.setAttribute!="function"||typeof x.namespaceURI!="string"||typeof x.insertBefore!="function"||typeof x.hasChildNodes!="function")},zT=function(x){return typeof a=="function"&&x instanceof a};function gs(Re,x,Q){Nc(Re,ge=>{ge.call(e,x,Q,cc)})}const K$=function(x){let Q=null;if(gs(J.beforeSanitizeElements,x,null),UT(x))return Ni(x),!0;const ge=wn(x.nodeName);if(gs(J.uponSanitizeElement,x,{tagName:ge,allowedTags:q}),O&&x.hasChildNodes()&&!zT(x.firstElementChild)&&En(/<[/\w!]/g,x.innerHTML)&&En(/<[/\w!]/g,x.textContent)||O&&x.namespaceURI===ut&&ge==="style"&&zT(x.firstElementChild)||x.nodeType===$c.progressingInstruction||O&&x.nodeType===$c.comment&&En(/<[/\w]/g,x.data))return Ni(x),!0;if(A[ge]||!(W.tagCheck instanceof Function&&W.tagCheck(ge))&&!q[ge]){if(!A[ge]&&Z$(ge)&&(_.tagNameCheck instanceof RegExp&&En(_.tagNameCheck,ge)||_.tagNameCheck instanceof Function&&_.tagNameCheck(ge)))return!1;if(Pe&&!be[ge]){const St=I(x)||x.parentNode,$n=v(x)||x.childNodes;if($n&&St){const hn=$n.length;for(let Cr=hn-1;Cr>=0;--Cr){const ii=b($n[Cr],!0);St.insertBefore(ii,E(x))}}}return Ni(x),!0}return x instanceof l&&!Vle(x)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&En(/<\/no(script|embed|frames)/i,x.innerHTML)?(Ni(x),!0):(N&&x.nodeType===$c.text&&(Q=x.textContent,Nc([ee,ae,ne],St=>{Q=jl(Q,St," ")}),x.textContent!==Q&&(Dc(e.removed,{element:x.cloneNode()}),x.textContent=Q)),gs(J.afterSanitizeElements,x,null),!1)},X$=function(x,Q,ge){if($[Q]||G&&(Q==="id"||Q==="name")&&(ge in n||ge in Fle))return!1;const St=w[Q]||W.attributeCheck instanceof Function&&W.attributeCheck(Q,x);if(!(y&&!$[Q]&&En(se,Q))){if(!(z&&En(ft,Q))){if(!St||$[Q]){if(!(Z$(x)&&(_.tagNameCheck instanceof RegExp&&En(_.tagNameCheck,x)||_.tagNameCheck instanceof Function&&_.tagNameCheck(x))&&(_.attributeNameCheck instanceof RegExp&&En(_.attributeNameCheck,Q)||_.attributeNameCheck instanceof Function&&_.attributeNameCheck(Q,x))||Q==="is"&&_.allowCustomizedBuiltInElements&&(_.tagNameCheck instanceof RegExp&&En(_.tagNameCheck,ge)||_.tagNameCheck instanceof Function&&_.tagNameCheck(ge))))return!1}else if(!bo[Q]){if(!En(Wt,jl(ge,Ee,""))){if(!((Q==="src"||Q==="xlink:href"||Q==="href")&&x!=="script"&&OO(ge,"data:")===0&&It[x])){if(!(R&&!En(pe,jl(ge,Ee,"")))){if(ge)return!1}}}}}}return!0},Wle=xe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Z$=function(x){return!Wle[kc(x)]&&En(gt,x)},Q$=function(x){gs(J.beforeSanitizeAttributes,x,null);const{attributes:Q}=x;if(!Q||UT(x))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:w,forceKeepAttr:void 0};let St=Q.length;for(;St--;){const $n=Q[St],{name:hn,namespaceURI:Cr,value:ii}=$n,Di=wn(hn),YT=ii;let Sn=hn==="value"?YT:OU(YT);if(ge.attrName=Di,ge.attrValue=Sn,ge.keepAttr=!0,ge.forceKeepAttr=void 0,gs(J.uponSanitizeAttribute,x,ge),Sn=ge.attrValue,le&&(Di==="id"||Di==="name")&&OO(Sn,de)!==0&&(_l(hn,x),Sn=de+Sn),O&&En(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Sn)){_l(hn,x);continue}if(Di==="attributename"&&PO(Sn,"href")){_l(hn,x);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){_l(hn,x);continue}if(!C&&En(/\/>/i,Sn)){_l(hn,x);continue}N&&Nc([ee,ae,ne],tF=>{Sn=jl(Sn,tF," ")});const eF=wn(x.nodeName);if(!X$(eF,Di,Sn)){_l(hn,x);continue}if(M&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Cr)switch(f.getAttributeType(eF,Di)){case"TrustedHTML":{Sn=M.createHTML(Sn);break}case"TrustedScriptURL":{Sn=M.createScriptURL(Sn);break}}if(Sn!==YT)try{Cr?x.setAttributeNS(Cr,hn,Sn):x.setAttribute(hn,Sn),UT(x)?Ni(x):IO(e.removed)}catch{_l(hn,x)}}gs(J.afterSanitizeAttributes,x,null)},J$=function(x){let Q=null;const ge=q$(x);for(gs(J.beforeSanitizeShadowDOM,x,null);Q=ge.nextNode();)gs(J.uponSanitizeShadowNode,Q,null),K$(Q),Q$(Q),Q.content instanceof o&&J$(Q.content);gs(J.afterSanitizeShadowDOM,x,null)};return e.sanitize=function(Re){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=null,ge=null,St=null,$n=null;if(We=!Re,We&&(Re="<!-->"),typeof Re!="string"&&!zT(Re)&&(Re=DU(Re),typeof Re!="string"))throw yf("dirty is not a string, aborting");if(!e.isSupported)return Re;if(j||jT(x),e.removed=[],typeof Re=="string"&&($e=!1),$e){const ii=Re.nodeName;if(typeof ii=="string"){const Di=wn(ii);if(!q[Di]||A[Di])throw yf("root node is forbidden and cannot be sanitized in-place")}}else if(Re instanceof a)Q=G$("<!---->"),ge=Q.ownerDocument.importNode(Re,!0),ge.nodeType===$c.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?Q=ge:Q.appendChild(ge);else{if(!F&&!N&&!L&&Re.indexOf("<")===-1)return M&&V?M.createHTML(Re):Re;if(Q=G$(Re),!Q)return F?null:V?T:""}Q&&k&&Ni(Q.firstChild);const hn=q$($e?Re:Q);for(;St=hn.nextNode();)K$(St),Q$(St),St.content instanceof o&&J$(St.content);if($e)return Re;if(F){if(N){Q.normalize();let ii=Q.innerHTML;Nc([ee,ae,ne],Di=>{ii=jl(ii,Di," ")}),Q.innerHTML=ii}if(B)for($n=K.call(Q.ownerDocument);Q.firstChild;)$n.appendChild(Q.firstChild);else $n=Q;return(w.shadowroot||w.shadowrootmode)&&($n=U.call(r,$n,!0)),$n}let Cr=L?Q.outerHTML:Q.innerHTML;return L&&q["!doctype"]&&Q.ownerDocument&&Q.ownerDocument.doctype&&Q.ownerDocument.doctype.name&&En($O,Q.ownerDocument.doctype.name)&&(Cr="<!DOCTYPE "+Q.ownerDocument.doctype.name+`>
26
- `+Cr),N&&Nc([ee,ae,ne],ii=>{Cr=jl(Cr,ii," ")}),M&&V?M.createHTML(Cr):Cr},e.setConfig=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jT(Re),j=!0},e.clearConfig=function(){cc=null,j=!1},e.isValidAttribute=function(Re,x,Q){cc||jT({});const ge=wn(Re),St=wn(x);return X$(ge,St,Q)},e.addHook=function(Re,x){typeof x=="function"&&Dc(J[Re],x)},e.removeHook=function(Re,x){if(x!==void 0){const Q=IU(J[Re],x);return Q===-1?void 0:PU(J[Re],Q,1)[0]}return IO(J[Re])},e.removeHooks=function(Re){J[Re]=[]},e.removeAllHooks=function(){J=VO()},e}var KU=WO();function hi(t){return t[0].toUpperCase()+t.substr(1)}function BO(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function jO(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function UO(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return`${t}`.replace(/(?:\\)?\[([^[\]]+)]/g,(n,r)=>n.charAt(0)==="\\"?n.substr(1,n.length-1):e[r]===void 0?"":e[r])}function zO(t){return dy(`${t}`,{ALLOWED_TAGS:[]})}function dy(t,e){return KU.sanitize(t,e)}const ma=t=>["tabindex",t],XU=()=>["role","treegrid"],Ho=()=>["role","presentation"],ZU=()=>["role","gridcell"],QU=()=>["role","rowheader"],YO=()=>["role","rowgroup"],JU=()=>["role","columnheader"],fy=()=>["role","row"],ez=()=>["role","menu"],tz=()=>["role","menuitem"],nz=()=>["role","menuitemcheckbox"],rz=()=>["role","combobox"],GO=()=>["role","listbox"],iz=()=>["role","option"],oz=()=>["role","checkbox"],sz=()=>["scope","col"],az=()=>["scope","row"],lz=()=>["type","text"],Fc=t=>["aria-label",t],pa=()=>["aria-hidden","true"],uz=()=>["aria-disabled","true"],cz=()=>["aria-multiselectable","true"],qO=t=>["aria-haspopup",t],KO=t=>["aria-rowcount",t],Sf=t=>["aria-colcount",t],XO=t=>["aria-rowindex",t],gy=t=>["aria-colindex",t],Br=t=>["aria-expanded",t],hz=t=>["aria-sort",t],ZO=()=>["aria-readonly","true"],QO=()=>["aria-invalid","true"],JO=t=>["aria-checked",t],my=()=>["aria-selected","true"],dz=()=>["aria-autocomplete","list"],fz=t=>["aria-controls",t],gz=t=>["aria-activedescendant",t],mz=t=>["aria-live",t],pz=t=>["aria-relevant",t],wz=t=>["aria-setsize",t],vz=t=>["aria-posinset",t];function Cz(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=null,i=t;for(;i!==null;){if(n===e){r=i;break}i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:(n+=1,i=i.parentNode)}return r}function Rf(t,e){const n=t.closest(".handsontable");return!!n&&(n.parentNode===e||n===e)}function yz(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function zl(t){return yz(t)&&t.parent}function wa(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:r,DOCUMENT_FRAGMENT_NODE:i}=Node;let o=t;for(;o!=null&&o!==n;){const{nodeType:s,nodeName:a}=o;if(s===r&&(e.includes(a)||e.includes(o)))return o;const{host:l}=o;l&&s===i?o=l:o=o.parentNode}return null}function Ef(t,e,n){const r=[];let i=t;for(;i&&(i=wa(i,e,n),!(!i||n&&!n.contains(i)));)r.push(i),i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:i=i.parentNode;const o=r.length;return o?r[o-1]:null}function bz(t,e){const n={element:void 0,classNames:[]};let r=t;for(;r!==null&&r!==t.ownerDocument.documentElement&&!n.element;){if(typeof e=="string"&&r.classList.contains(e))n.element=r,n.classNames.push(e);else if(e instanceof RegExp){const i=Array.from(r.classList).filter(o=>e.test(o));i.length&&(n.element=r,n.classNames.push(...i))}r=r.parentElement}return n}function va(t,e){let n=t.parentNode,r=[];for(typeof e=="string"?t.defaultView?r=Array.prototype.slice.call(t.querySelectorAll(e),0):r=Array.prototype.slice.call(t.ownerDocument.querySelectorAll(e),0):r.push(e);n!==null;){if(r.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function Sz(t){let e=0,n=t;if(n.previousSibling)for(;n=n.previousSibling;)e+=1;return e}function Ca(t,e,n){const r=n.parentElement.querySelector(`.ht_clone_${t}`);return r?r.contains(e):null}function ex(t){return!t||!t.length?[]:t.filter(e=>!!e)}function tx(t,e){if(!t||!t.length)return{regexFree:[],regexes:[]};const n=[],r=[];return r.push(...t.filter(i=>{const o=i instanceof RegExp;return o&&e&&n.push(i),!o})),{regexFree:r,regexes:n}}function ye(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function X(t,e){typeof e=="string"&&(e=e.split(" ")),e=ex(e),e.length>0&&t.classList.add(...e)}function ve(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:n,regexes:r}=tx(e,!0);n=ex(n),n.length>0&&t.classList.remove(...n),r.forEach(i=>{t.classList.forEach(o=>{i.test(o)&&t.classList.remove(o)})})}function Se(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;Array.isArray(e)||(e=[[e,n]]),e.forEach(r=>{Array.isArray(r)&&r[0]!==""&&t.setAttribute(...r)})}function Yl(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);const{regexFree:n,regexes:r}=tx(e,!0);n.forEach(i=>{i!==""&&t.removeAttribute(i)}),r.forEach(i=>{t.getAttributeNames().forEach(o=>{i.test(o)&&t.removeAttribute(o)})})}function nx(t){if(t.nodeType===3)t.parentNode.removeChild(t);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(t.nodeName)>-1){const e=t.childNodes;for(let n=e.length-1;n>=0;n--)nx(e[n])}}function No(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const Rz=/(<(.*)>|&(.*);)/;function Gl(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;Rz.test(e)?t.innerHTML=n?dy(e):e:ya(t,e)}function ya(t,e){const n=t.firstChild;n&&n.nodeType===3&&n.nextSibling===null?n.textContent=e:(No(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function ql(t){const e=t.ownerDocument.documentElement,n=t.ownerDocument.defaultView;let r=t;for(;r!==e;){if(r===null)return!1;if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE)if(r.host){if(r.host.impl)return ql(r.host.impl);if(r.host)return ql(r.host);throw new Error("Lost in Web Components world")}else return!1;else if(n.getComputedStyle(r).display==="none")return!1;r=r.parentNode}return!0}function Ez(t){const n=t.ownerDocument.defaultView;let r=t;for(;r.parentNode;){if(r.style.height==="0px"||r.style.height==="0")return n.getComputedStyle(r).overflow==="hidden";r=r.parentNode}return!1}function On(t){const e=t.ownerDocument,n=e.defaultView,r=e.documentElement;let i=t,o,s,a;for(o=i.offsetLeft,s=i.offsetTop,a=i;(i=i.offsetParent)&&!(i===e.body||!("offsetLeft"in i));)o+=i.offsetLeft,s+=i.offsetTop,a=i;return a&&a.style.position==="fixed"&&(o+=n.pageXOffset||r.scrollLeft,s+=n.pageYOffset||r.scrollTop),{left:o,top:s}}function rx(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function py(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function wy(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?rx(e):t.scrollTop}function ix(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?py(e):t.scrollLeft}function Tf(t){let e=t.ownerDocument,n=e?e.defaultView:void 0;e||(e=t.document?t.document:t,n=e.defaultView);const r=["auto","scroll"];let i=t.parentNode;for(;i&&i.style&&e.body!==i;){let{overflow:o,overflowX:s,overflowY:a}=i.style;if([o,s,a].includes("scroll"))return i;if({overflow:o,overflowX:s,overflowY:a}=n.getComputedStyle(i),r.includes(o)||r.includes(s)||r.includes(a)||i.clientHeight<=i.scrollHeight+1&&(r.includes(a)||r.includes(o))||i.clientWidth<=i.scrollWidth+1&&(r.includes(s)||r.includes(o)))return i;i=i.parentNode}return n}function Tz(t){return t.scrollHeight-t.clientHeight}function _z(t){return t.scrollWidth-t.clientWidth}function Vc(t){const e=t.ownerDocument,n=e.defaultView;let r=t.parentNode;for(;r&&r.style&&e.body!==r;){if(r.style.overflow!=="visible"&&r.style.overflow!=="")return r;const i=n.getComputedStyle(r),o=["scroll","hidden","auto"],s=i.getPropertyValue("overflow"),a=i.getPropertyValue("overflow-y"),l=i.getPropertyValue("overflow-x");if(o.includes(s)||o.includes(a)||o.includes(l))return r;r=r.parentNode}return n}function _f(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window;if(t){if(t===n)return e==="width"?`${n.innerWidth}px`:e==="height"?`${n.innerHeight}px`:void 0}else return;const r=t.style[e];if(r!==""&&r!==void 0)return r;const i=n.getComputedStyle(t);if(i[e]!==""&&i[e]!==void 0)return i[e]}function Qt(t){return t.offsetWidth}function an(t){return t.offsetHeight}function Wc(t){return t.clientHeight||t.innerHeight}function ox(t){return t.clientWidth||t.innerWidth}function sx(t){return t.selectionStart?t.selectionStart:0}function Mz(t){return t.selectionEnd?t.selectionEnd:0}function ax(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;t.getSelection&&(t.getSelection().empty?t.getSelection().empty():t.getSelection().removeAllRanges&&t.getSelection().removeAllRanges())}function Mf(t,e,n){if(n===void 0&&(n=e),t.setSelectionRange){t.focus();try{t.setSelectionRange(e,n)}catch{const i=t.parentNode,o=i.style.display;i.style.display="block",t.setSelectionRange(e,n),i.style.display=o}}}let vy;function Iz(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;const e=t.createElement("div");e.style.height="200px",e.style.width="100%";const n=t.createElement("div");n.style.boxSizing="content-box",n.style.height="150px",n.style.left="0px",n.style.overflow="hidden",n.style.position="absolute",n.style.top="0px",n.style.width="200px",n.style.visibility="hidden",n.appendChild(e),(t.body||t.documentElement).appendChild(n);const r=e.offsetWidth;n.style.overflow="scroll";let i=e.offsetWidth;return r===i&&(i=n.clientWidth),(t.body||t.documentElement).removeChild(n),r-i}function vn(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return vy===void 0&&(vy=Iz(t)),vy}function lx(t){return t instanceof Window?t.document.body.scrollHeight>t.innerHeight:t.offsetWidth!==t.clientWidth}function ux(t){return t instanceof Window?t.document.body.scrollWidth>t.innerWidth:t.offsetHeight!==t.clientHeight}function Cy(t,e,n){t.style.transform=`translate3d(${e},${n},0)`}function If(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function Pf(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function cx(t){return Pf(t)&&t.hasAttribute("data-hot-input")===!1}function hx(t){return!t.parentNode}function Pz(t,e){new IntersectionObserver((r,i)=>{r.forEach(o=>{o.isIntersecting&&t.offsetParent!==null&&(e(),i.unobserve(t))})},{root:t.ownerDocument.body}).observe(t)}function dx(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const r=t.ownerDocument,i=r.createRange(),o=r.defaultView.getSelection();Se(t,"contenteditable",!0),n&&Se(t,...pa()),e&&X(t,"invisibleSelection"),i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i)}function fx(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=t.ownerDocument.defaultView.getSelection();t.hasAttribute("aria-hidden")&&t.removeAttribute("aria-hidden"),n.removeAllRanges(),e&&ve(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function Oz(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;dx(t,n),e(),fx(t,n)}function Do(t){var e;const n=t==null||(e=t.ownerDocument)===null||e===void 0?void 0:e.defaultView.Element;return!!(n&&n!==null&&t instanceof n)}function di(t,e,n){return(e=xz(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xz(t){var e=Az(t,"string");return typeof e=="symbol"?e:e+""}function Az(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Hz="base",Ut=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class Kl{static get EDITOR_TYPE(){return Hz}constructor(e){di(this,"hot",void 0),di(this,"state",Ut.VIRGIN),di(this,"_opened",!1),di(this,"_fullEditMode",!1),di(this,"_closeCallback",null),di(this,"TD",null),di(this,"row",null),di(this,"col",null),di(this,"prop",null),di(this,"originalValue",null),di(this,"cellProperties",null),this.hot=e,this.init()}_fireCallbacks(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)}init(){}getValue(){throw Error("Editor getValue() method unimplemented")}setValue(){throw Error("Editor setValue() method unimplemented")}open(){throw Error("Editor open() method unimplemented")}close(){throw Error("Editor close() method unimplemented")}prepare(e,n,r,i,o,s){this.TD=i,this.row=e,this.col=n,this.prop=r,this.originalValue=o,this.cellProperties=s,this.state=this.isOpened()?this.state:Ut.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,n){let r,i,o,s;if(n){const l=this.hot.getSelectedLast();r=Math.max(Math.min(l[0],l[2]),0),i=Math.max(Math.min(l[1],l[3]),0),o=Math.max(l[0],l[2]),s=Math.max(l[1],l[3])}else[r,i,o,s]=[this.row,this.col,null,null];const a=this.hot.runHooks("modifyGetCellCoords",r,i,!1,"meta");Array.isArray(a)&&([r,i]=a),this.hot.populateFromArray(r,i,e,o,s,"edit")}beginEditing(e,n){if(this.state!==Ut.VIRGIN)return;const r=this.hot,i=r.rowIndexMapper.getRenderableFromVisualIndex(this.row),o=r.columnIndexMapper.getRenderableFromVisualIndex(this.col),s=()=>{if(this.state=Ut.EDITING,this.isInFullEditMode()){const l=typeof e=="string"?e:xt(this.originalValue);this.setValue(l)}this.open(n),this._opened=!0,this.focus(),r.view.render(),r.runHooks("afterBeginEditing",this.row,this.col)};this.hot.addHookOnce("afterScroll",s),r.view.scrollViewport(r._createCellCoords(i,o))||(this.hot.removeHook("afterScroll",s),s())}finishEditing(e,n,r){let i;if(r){const o=this._closeCallback;this._closeCallback=s=>{o&&o(s),r(s),this.hot.view.render()}}if(!this.isWaiting()){if(this.state===Ut.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===Ut.EDITING){if(e){this.cancelChanges(),this.hot.view.render();return}const o=this.getValue();this.cellProperties.trimWhitespace?i=[[typeof o=="string"?String.prototype.trim.call(o||""):o]]:i=[[o]],this.state=Ut.WAITING,this.saveValue(i,n),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",s=>{this.state=Ut.FINISHED,this.discardEditor(s)}):(this.state=Ut.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=Ut.FINISHED,this.discardEditor()}discardEditor(e){this.state===Ut.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=Ut.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Ut.VIRGIN,this._fireCallbacks(!0),this.hot.getShortcutManager().setActiveContextName("grid")))}enableFullEditMode(){this._fullEditMode=!0}isInFullEditMode(){return this._fullEditMode}isOpened(){return this._opened}isWaiting(){return this.state===Ut.WAITING}getEditedCellRect(){var e;const n=this.getEditedCell();if(!n)return;const{wtOverlays:r,wtViewport:i}=this.hot.view._wt,o=this.hot.rootWindow,s=On(n),a=Qt(n),l=On(this.hot.rootElement),u=Qt(this.hot.rootElement),c=r.topOverlay.holder,h=r.inlineStartOverlay.holder,d=c!==o?c.scrollTop:0,f=h!==o?h.scrollLeft:0,m=o.innerWidth-l.left-u,{wtTable:b}=(e=r.getParentOverlay(n))!==null&&e!==void 0?e:this.hot.view._wt,S=b.name,E=["master","inline_start"].includes(S)?d:0,v=["master","top","bottom"].includes(S)?f:0,I=s.top===l.top?0:1;let M=s.top-l.top-I-E,T=0;this.hot.isRtl()?T=o.innerWidth-s.left-a-m-1+v:T=s.left-l.left-1-v,["top","top_inline_start_corner"].includes(S)&&(M+=r.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(S)&&(T+=Math.abs(r.inlineStartOverlay.getOverlayOffset()));const P=this.hot.hasColHeaders(),D=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),K=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),U=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(P&&D<=0||D===U)&&(M+=1),K<=0&&(T+=1);const J=i.rowsRenderCalculator.startPosition,ee=i.columnsRenderCalculator.startPosition,ae=Math.abs(r.inlineStartOverlay.getScrollPosition()),ne=r.topOverlay.getScrollPosition(),se=vn(this.hot.rootDocument);let ft=n.offsetTop;if(["inline_start","master"].includes(S)&&(ft+=J-ne),["bottom","bottom_inline_start_corner"].includes(S)){const{wtViewport:W,wtTable:z}=r.bottomOverlay.clone;ft+=W.getWorkspaceHeight()-z.getHeight()-se}let pe=n.offsetLeft;this.hot.isRtl()?(pe>=0?pe=b.getWidth()-n.offsetLeft:pe=Math.abs(pe),pe+=ee-ae-a):["top","master","bottom"].includes(S)&&(pe+=ee-ae);const Ee=o.getComputedStyle(this.TD),gt=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",Wt=parseInt(Ee[gt],10)>0?0:1,q=parseInt(Ee.borderTopWidth,10)>0?0:1,g=Qt(n)+Wt,w=an(n)+q,p=lx(c)?se:0,_=ux(h)?se:0,A=this.hot.view.maximumVisibleElementWidth(pe)-p+Wt,$=Math.max(this.hot.view.maximumVisibleElementHeight(ft)-_+q,this.hot.view.getDefaultRowHeight());return{top:M,start:T,height:w,maxHeight:$,width:g,maxWidth:A}}getEditedCellsLayerClass(){switch(this.checkEditorSection()){case"inline-start":return"ht_clone_left ht_clone_inline_start";case"bottom":return"ht_clone_bottom";case"bottom-inline-start-corner":return"ht_clone_bottom_left_corner ht_clone_bottom_inline_start_corner";case"top":return"ht_clone_top";case"top-inline-start-corner":return"ht_clone_top_left_corner ht_clone_top_inline_start_corner";default:return"ht_clone_master"}}getEditedCell(){return this.hot.getCell(this.row,this.col,!0)}checkEditorSection(){const e=this.hot.countRows();let n="";return this.row<this.hot.getSettings().fixedRowsTop?this.col<this.hot.getSettings().fixedColumnsStart?n="top-inline-start-corner":n="top":this.hot.getSettings().fixedRowsBottom&&this.row>=e-this.hot.getSettings().fixedRowsBottom?this.col<this.hot.getSettings().fixedColumnsStart?n="bottom-inline-start-corner":n="bottom":this.col<this.hot.getSettings().fixedColumnsStart&&(n="inline-start"),n}}ct(Kl,TO);function fi(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function ba(t){return t.isImmediatePropagationEnabled===!1}function Sa(t){return t.button===2}function yy(t){return t.button===0}function Nz(t){return t instanceof TouchEvent}function Dz(t,e){const n={x:t.offsetX,y:t.offsetY};let r=t.target;if(!Do(e)||r!==e&&r.contains(e))return n;for(;r!==e;)n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;return n}function kz(t,e,n){return(e=Lz(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lz(t){var e=$z(t,"string");return typeof e=="symbol"?e:e+""}function $z(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gi{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;kz(this,"context",void 0),this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;function o(s){r.call(this,Fz(s))}return this.context.eventListeners.push({element:e,event:n,callback:r,callbackProxy:o,options:i,eventManager:this}),e.addEventListener(n,o,i),()=>{this.removeEventListener(e,n,r)}}removeEventListener(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=this.context.eventListeners.length,s;for(;o;)if(o-=1,s=this.context.eventListeners[o],s.event===n&&s.element===e){if(r&&r!==s.callback||i&&s.eventManager!==this)continue;this.context.eventListeners.splice(o,1),s.element.removeEventListener(s.event,s.callbackProxy,s.options)}}clearEvents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.context)return;let n=this.context.eventListeners.length;for(;n;){n-=1;const r=this.context.eventListeners[n];e&&r.eventManager!==this||(this.context.eventListeners.splice(n,1),r.element.removeEventListener(r.event,r.callbackProxy,r.options))}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,n){let r=e.document,i=e;r||(r=e.ownerDocument?e.ownerDocument:e,i=r.defaultView);const o={bubbles:!0,cancelable:n!=="mousemove",view:i,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0};let s;r.createEvent?(s=r.createEvent("MouseEvents"),s.initMouseEvent(n,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,r.body.parentNode)):s=r.createEventObject(),e.dispatchEvent?e.dispatchEvent(s):e.fireEvent(`on${n}`,s)}}function Fz(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),fi(this)},t}function Of(t){return window.requestAnimationFrame(t)}function xf(t){window.cancelAnimationFrame(t)}function gx(){return"ontouchstart"in window}function Vz(){return typeof window<"u"}let Xl;function Wz(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Xl||(typeof Intl=="object"?Xl=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?Xl=(n,r)=>`${n}`.localeCompare(r):Xl=(n,r)=>n===r?0:n>r?-1:1,Xl)}const jr=t=>{const e={value:!1};return e.test=(n,r)=>{e.value=t(n,r)},e},bs={chrome:jr((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:jr(t=>/CriOS/.test(t)),edge:jr(t=>/Edge/.test(t)),edgeWebKit:jr(t=>/EdgiOS/.test(t)),firefox:jr(t=>/Firefox/.test(t)),firefoxWebKit:jr(t=>/FxiOS/.test(t)),mobile:jr(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:jr((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},Bc={mac:jr(t=>/^Mac/.test(t)),win:jr(t=>/^Win/.test(t)),linux:jr(t=>/^Linux/.test(t)),ios:jr(t=>/iPhone|iPad|iPod/i.test(t))};function Bz(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ne(bs,n=>{let{test:r}=n;r(t,e)})}function jz(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ne(Bc,e=>{let{test:n}=e;n(t)})}Vz()&&(Bz(),jz());function mx(){return bs.chrome.value}function Uz(){return bs.chromeWebKit.value}function by(){return bs.firefox.value}function zz(){return bs.firefoxWebKit.value}function Af(){return bs.safari.value}function Yz(){return bs.edge.value}function ko(){return bs.mobile.value}function px(){return Bc.ios.value}function wx(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&Bc.mac.value}function vx(){return Bc.win.value}function Cx(){return Bc.mac.value}var yx={},bx={},Sy,Sx;function Gz(){if(Sx)return Sy;Sx=1;var t=In(),e=Jn(),n=nn(),r=Li(),i=Gv(),o=vI(),s=i(function(){var a=this.iterator,l=n(t(this.next,a)),u=this.done=!!l.done;if(!u)return o(a,this.mapper,[l.value,this.counter++],!0)});return Sy=function(l){return n(this),e(l),new s(r(this),{mapper:l})},Sy}var Rx;function qz(){if(Rx)return bx;Rx=1;var t=vt(),e=Gz(),n=ps();return t({target:"Iterator",proto:!0,real:!0,forced:n},{map:e}),bx}var Ex;function Kz(){return Ex||(Ex=1,qz()),yx}Kz();function Bn(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=typeof t;if(n==="number")return!isNaN(t)&&isFinite(t);if(n==="string"){if(t.length===0)return!1;if(t.length===1)return/\d/.test(t);const r=Array.from(new Set([".",...e])).map(i=>`\\${i}`).join("|");return new RegExp(`^[+-]?(((${r})?\\d+((${r})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(t.trim())}else if(n==="object")return!!t&&typeof t.valueOf()=="number"&&!(t instanceof Date);return!1}function Xz(t){return Bn(t,[","])}function fe(t,e,n){let r=-1;for(typeof e=="function"?(n=e,e=t):r=t-1;++r<=e&&n(r)!==!1;);}function Tx(t,e,n){let r=t+1;for(typeof e=="function"&&(n=e,e=0);--r>=e&&n(r)!==!1;);}function _x(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function ze(t,e,n){return Math.min(t,e)===t?e:Math.max(t,n)===t?n:t}function Mx(t,e,n){t.addEventListener(e,n,!1)}function Ix(t,e,n){t.removeEventListener(e,n,!1)}function Hf(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function Px(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300,textContent:h=>h.value,...e},r=t.body,i=t.createTextNode(""),o=t.createElement("span");let s;function a(){var h,d;i.textContent=n.textContent(s),o.style.position="absolute",o.style.fontSize=Hf(s).fontSize,o.style.fontFamily=Hf(s).fontFamily,o.style.whiteSpace="pre",r.appendChild(o);const f=parseInt(((h=Hf(s))===null||h===void 0?void 0:h.paddingInlineStart)||0,10),m=parseInt(((d=Hf(s))===null||d===void 0?void 0:d.paddingInlineEnd)||0,10),b=o.clientWidth+f+m+1;r.removeChild(o);const S=s.style;S.height=`${n.minHeight}px`,n.minWidth>b?S.width=`${n.minWidth}px`:b>n.maxWidth?S.width=`${n.maxWidth}px`:S.width=`${b}px`;const E=s.scrollHeight?s.scrollHeight-1:0;n.minHeight>E?S.height=`${n.minHeight}px`:n.maxHeight<E?(S.height=`${n.maxHeight}px`,S.overflowY="visible"):S.height=`${E}px`}function l(){t.defaultView.setTimeout(a,0)}function u(h){if(h&&h.minHeight)if(h.minHeight==="inherit")n.minHeight=s.clientHeight;else{const d=parseInt(h.minHeight,10);isNaN(d)||(n.minHeight=d)}if(h&&h.maxHeight)if(h.maxHeight==="inherit")n.maxHeight=s.clientHeight;else{const d=parseInt(h.maxHeight,10);isNaN(d)||(n.maxHeight=d)}if(h&&h.minWidth)if(h.minWidth==="inherit")n.minWidth=s.clientWidth;else{const d=parseInt(h.minWidth,10);isNaN(d)||(n.minWidth=d)}if(h&&h.maxWidth)if(h.maxWidth==="inherit")n.maxWidth=s.clientWidth;else{const d=parseInt(h.maxWidth,10);isNaN(d)||(n.maxWidth=d)}o.firstChild||(o.className="autoResize",o.style.display="inline-block",o.appendChild(i))}function c(h,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s=h,u(d),s.nodeName==="TEXTAREA"&&(s.style.resize="none",s.style.height=`${n.minHeight}px`,s.style.minWidth=`${n.minWidth}px`,s.style.maxWidth=`${n.maxWidth}px`,s.style.overflowY="hidden"),f&&(Mx(s,"input",a),Mx(s,"keydown",l)),a()}return{init:c,resize:a,unObserve(){Ix(s,"input",a),Ix(s,"keydown",l)}}}function Ox(t,e){const n=sx(e),r=e.value.split(`
27
- `);let i=n,o=0;for(let s=0;s<r.length;s++){const a=r[s];s!==0&&(o+=r[s-1].length+1);const l=o+a.length;if(t==="home"?i=o:t==="end"&&(i=l),n<=l)break}Mf(e,i)}function Ra(t,e,n){return(e=Zz(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zz(t){var e=Qz(t,"string");return typeof e=="symbol"?e:e+""}function Qz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Jz="ht_editor_visible",Nf="ht_editor_hidden",xx="textEditor",eY="text";class Ea extends Kl{static get EDITOR_TYPE(){return eY}constructor(e){super(e),Ra(this,"eventManager",new gi(this)),Ra(this,"autoResize",Px(this.hot.rootDocument)),Ra(this,"TEXTAREA",void 0),Ra(this,"textareaStyle",void 0),Ra(this,"TEXTAREA_PARENT",void 0),Ra(this,"textareaParentStyle",void 0),Ra(this,"layerClass",void 0),this.eventManager=new gi(this),this.createElements(),this.bindEvents(),this.hot.addHookOnce("afterDestroy",()=>this.destroy())}getValue(){return this.TEXTAREA.value}setValue(e){this.TEXTAREA.value=e}open(){this.refreshDimensions(),this.showEditableElement(),this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this.autoResize.unObserve(),Rf(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,n,r,i,o,s){const a=this.state;if(super.prepare(e,n,r,i,o,s),!s.readOnly){this.refreshDimensions(!0);const{allowInvalid:l}=s;l&&!this.isOpened()&&(this.TEXTAREA.value=""),a!==Ut.FINISHED&&!this.isOpened()&&this.hideEditableElement()}}beginEditing(e,n){this.state===Ut.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,n))}focus(){this.TEXTAREA.select(),Mf(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),Se(this.TEXTAREA,[["data-hot-input",""],ma(-1)]),X(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.textareaStyle.overflowY="visible",this.TEXTAREA_PARENT=e.createElement("DIV"),X(this.TEXTAREA_PARENT,"handsontableInputHolder"),ye(this.TEXTAREA_PARENT,this.layerClass)&&ve(this.TEXTAREA_PARENT,this.layerClass),X(this.TEXTAREA_PARENT,Nf),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){Yz()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",ve(this.TEXTAREA_PARENT,this.layerClass),X(this.TEXTAREA_PARENT,Nf)}showEditableElement(){this.textareaParentStyle.height="",this.textareaParentStyle.overflow="",this.textareaParentStyle.position="",this.textareaParentStyle[this.hot.isRtl()?"left":"right"]="auto",this.textareaParentStyle.opacity="1",this.textareaStyle.textIndent="";const e=this.TEXTAREA_PARENT.childNodes;let n=!1;fe(e.length-1,r=>{const i=e[r];if(ye(i,"handsontableEditor"))return n=!0,!1}),ye(this.TEXTAREA_PARENT,Nf)&&ve(this.TEXTAREA_PARENT,Nf),n?(this.layerClass=Jz,X(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),X(this.TEXTAREA_PARENT,this.layerClass))}refreshValue(){const e=this.hot.toPhysicalRow(this.row),n=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=n,this.setValue(n),this.refreshDimensions()}refreshDimensions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.state!==Ut.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD){e||this.close();return}const{top:n,start:r,width:i,maxWidth:o,height:s,maxHeight:a}=this.getEditedCellRect();this.textareaParentStyle.top=`${n}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${r}px`,this.showEditableElement();const l=this.hot.rootWindow.getComputedStyle(this.TD);this.TEXTAREA.style.fontSize=l.fontSize,this.TEXTAREA.style.fontFamily=l.fontFamily,this.TEXTAREA.style.backgroundColor=this.TD.style.backgroundColor,this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(i,o),minHeight:Math.min(s,a),maxWidth:o,maxHeight:a},!0)}bindEvents(){px()&&this.eventManager.addEventListener(this.TEXTAREA,"focusout",()=>this.finishEditing(!1)),this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>{this.refreshDimensions(),this.state===Ut.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===Ut.EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={runOnlyIf:()=>ce(this.hot.getSelected()),group:xx},i=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
28
- `)};n.addShortcuts([{keys:[["Control","Enter"]],callback:()=>(i(),!1),runOnlyIf:o=>!this.hot.selection.isMultiple()&&!o.altKey},{keys:[["Meta","Enter"]],callback:()=>(i(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(i(),!1)},{keys:[["Home"]],callback:(o,s)=>{let[a]=s;Ox(a,this.TEXTAREA)}},{keys:[["End"]],callback:(o,s)=>{let[a]=s;Ox(a,this.TEXTAREA)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(xx)}}const Ax="gridDefault",Ss="editorManager.handlingEditor",tY={name:"editorCloseAndSave",callback(t){t._getEditorManager().closeEditorAndSaveChanges()}},nY={name:"editorCloseAndSaveByArrowKeys",callback(t,e,n){const r=t._getEditorManager(),i=r.getActiveEditor();i.isInFullEditMode()&&i.state===Ut.EDITING||(r.closeEditorAndSaveChanges(),t.getSelected()&&(n.includes("arrowdown")?t.selection.transformStart(1,0):n.includes("arrowup")?t.selection.transformStart(-1,0):n.includes("arrowleft")?t.selection.transformStart(0,-1*t.getDirectionFactor()):n.includes("arrowright")&&t.selection.transformStart(0,t.getDirectionFactor())),e.preventDefault())}},rY={name:"editorCloseAndSaveByEnter",callback(t,e){const n=t._getEditorManager();n.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),n.moveSelectionAfterEnter(e)}},iY={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},oY={name:"editorFastOpen",callback(t,e){const{highlight:n}=t.getSelectedRangeLast();n.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},sY={name:"editorOpen",callback(t,e,n){const r=t._getEditorManager(),i=t.getSelectedRangeLast(),{highlight:o}=i;if(t.selection.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0){const s=t.getSettings(),a=typeof s.enterMoves=="function"?s.enterMoves(e):s.enterMoves;n.includes("shift")?t.selection.transformFocus(-a.row,-a.col):t.selection.transformFocus(a.row,a.col);return}o.isHeader()||(t.getSettings().enterBeginsEditing?r.cellProperties.readOnly?r.moveSelectionAfterEnter(e):r.openEditor(null,e,!0):r.moveSelectionAfterEnter(e),fi(e))}};function aY(){return[tY,nY,rY,iY,oY,sY]}const lY={name:"extendCellsSelectionDown",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(1,0),e.markEndSource())}},uY={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{selection:e,rowIndexMapper:n}=t,{to:r}=t.getSelectedRangeLast(),i=Math.min(r.row+t.countVisibleRows(),t.countRows()-1),o=n.getNearestNotHiddenIndex(i,-1);if(o!==null){const s=t._createCellCoords(o,r.col),a=r.row-t.getFirstFullyVisibleRow(),l=Math.min(s.row-a,t.countRows()-1);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}},cY={name:"extendCellsSelectionLeft",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,-1*t.getDirectionFactor()),e.markEndSource())}},hY={name:"extendCellsSelectionRight",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,t.getDirectionFactor()),e.markEndSource())}},dY={name:"extendCellsSelectionToColumns",callback(t){const{selection:e}=t,{highlight:n,from:r,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByRowHeader()?e.selectAll(!0,!0):t.selectColumns(r.col,i.col,n),e.markEndSource()}},fY={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(t.countRows()-1,-1),l=i.clone();l.row=r.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},gY={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&r.isCell()){const s=n.getNearestNotHiddenIndex(t.countCols()-1,-1),a=i.clone();a.col=r.col,e.markSource("keyboard"),e.setRangeStart(a,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(o.row,s)),e.markEndSource()}}},mY={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&r.isCell()){const s=parseInt(t.getSettings().fixedColumnsStart,10),a=n.getNearestNotHiddenIndex(s,1),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},pY={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},wY={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},vY={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(0,1),l=i.clone();l.row=r.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},CY={name:"extendCellsSelectionToRows",callback(t){const{selection:e}=t,{highlight:n,from:r,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByColumnHeader()?e.selectAll(!0,!0):t.selectRows(r.row,i.row,n),e.markEndSource()}},yY={name:"extendCellsSelectionUp",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(-1,0),e.markEndSource())}},bY={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{selection:e,rowIndexMapper:n}=t,{to:r}=t.getSelectedRangeLast(),i=Math.max(r.row-t.countVisibleRows(),0),o=n.getNearestNotHiddenIndex(i,1);if(o!==null){const s=t._createCellCoords(o,r.col),a=r.row-t.getFirstFullyVisibleRow(),l=Math.max(s.row-a,0);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}};function SY(){return[lY,uY,cY,hY,dY,fY,gY,mY,pY,wY,vY,CY,yY,bY]}const RY={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(1,0),e.markEndSource()}},EY={name:"moveCellSelectionDownByViewportHeight",callback(t){const{selection:e}=t,{navigableHeaders:n}=t.getSettings(),r=n?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+r;o=o===0?1:o,i===t.countRows()-1?o=1:i+o>t.countRows()&&(o=t.countRows()-i-1),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}},TY={name:"moveCellSelectionInlineEnd",callback(t,e){const{selection:n}=t,r=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;n.markSource("keyboard"),n.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?n.transformFocus(-o.row,-o.col):n.transformStart(-o.row,-o.col),n.markEndSource()}},_Y={name:"moveCellSelectionInlineStart",callback(t,e){const{selection:n}=t,r=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;n.markSource("keyboard"),n.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?n.transformFocus(o.row,o.col):n.transformStart(o.row,o.col),n.markEndSource()}},MY={name:"moveCellSelectionLeft",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,-1*t.getDirectionFactor()),e.markEndSource()}},IY={name:"moveCellSelectionRight",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,t.getDirectionFactor()),e.markEndSource()}},PY={name:"moveCellSelectionToMostBottom",callback(t){const{selection:e}=t,{col:n}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);r===null&&(r=-1),e.setRangeStart(t._createCellCoords(r,n))}},OY={name:"moveCellSelectionToMostBottomInlineEnd",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:r}=t,i=parseInt(t.getSettings().fixedRowsBottom,10),o=n.getNearestNotHiddenIndex(t.countRows()-i-1,-1),s=r.getNearestNotHiddenIndex(t.countCols()-1,-1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(o,s)),e.markEndSource()}},xY={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t;e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(t.getSelectedRangeLast().highlight.row,n.getNearestNotHiddenIndex(t.countCols()-1,-1))),e.markEndSource()}},AY={name:"moveCellSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,r=parseInt(t.getSettings().fixedColumnsStart,10),i=t.getSelectedRangeLast().highlight.row,o=n.getNearestNotHiddenIndex(r,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(i,o)),e.markEndSource()}},HY={name:"moveCellSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,r=t.getSelectedRangeLast().highlight.row;let i=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);i===null&&(i=t.isRtl()?-1:-t.countRowHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,i)),e.markEndSource()}},NY={name:"moveCellSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{row:r}=t.getSelectedRangeLast().highlight;let i=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);i===null&&(i=t.isRtl()?-t.countRowHeaders():-1),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,i)),e.markEndSource()}},DY={name:"moveCellSelectionToMostTop",callback(t){const{selection:e}=t,{col:n}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);r===null&&(r=-t.countColHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,n)),e.markEndSource()}},kY={name:"moveCellSelectionToMostTopInlineStart",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:r}=t,i=parseInt(t.getSettings().fixedRowsTop,10),o=parseInt(t.getSettings().fixedColumnsStart,10),s=n.getNearestNotHiddenIndex(i,1),a=r.getNearestNotHiddenIndex(o,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(s,a)),e.markEndSource()}},LY={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(-1,0),e.markEndSource()}},$Y={name:"moveCellSelectionUpByViewportHight",callback(t){const{selection:e}=t,{navigableHeaders:n}=t.getSettings(),r=n?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+r;o=o===0?-1:-o,i===-r?o=-1:i+o<r&&(o=-(i+r)),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}};function FY(){return[RY,EY,TY,_Y,MY,IY,PY,OY,xY,AY,HY,NY,DY,kY,LY,$Y]}const VY={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},WY={name:"scrollToFocusedCell",callback(t){const{highlight:e}=t.getSelectedRangeLast(),n=t.getFirstFullyVisibleRow()-1,r=t.getFirstFullyVisibleColumn()-1,i=t.getLastFullyVisibleRow()+1,o=t.getLastFullyVisibleColumn()+1,s=t._createCellCoords(n,r),a=t._createCellCoords(i,o);if(!t._createCellRange(s,s,a).includes(e)&&(e.row>=0||e.col>=0)){const u={};if(e.col>=0){const c=Math.floor(t.countVisibleCols()/2);u.col=Math.max(e.col-c,0)}if(e.row>=0){const c=Math.floor(t.countVisibleRows()/2);u.row=Math.max(e.row-c,0)}t.scrollViewportTo({...u,verticalSnap:"top",horizontalSnap:"start"})}}},BY={name:"selectAllCells",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!0}),e.markEndSource()}},jY={name:"selectAllCellsAndHeaders",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!1}),e.markEndSource()}},UY={name:"populateSelectedCellsData",callback(t){const e=t.getSelectedRange(),{row:n,col:r}=e[e.length-1].highlight.normalize(),i=t.getDataAtCell(n,r),o=new Map;for(let s=0;s<e.length;s++)e[s].forAll((a,l)=>{if(a>=0&&l>=0&&(a!==n||l!==r)){const{readOnly:u}=t.getCellMeta(a,l);u||o.set(`${a}x${l}`,[a,l,i])}});t.setDataAtCell(Array.from(o.values()))}},zY=[...aY(),...SY(),...FY(),VY,WY,BY,jY,UY];function Hx(t){const e={};return zY.forEach(n=>{let{name:r,callback:i}=n;e[r]=function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i(t,...s)}}),e}function YY(t){const e=t.getShortcutManager().addContext("editor"),n=Hx(t),r={group:Ss};e.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>n.editorCloseAndSaveByEnter(i,o)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(i,o)=>n.editorCloseAndSaveByEnter(i,o)},{keys:[["Tab"],["Tab","Shift"],["PageDown"],["PageUp"]],forwardToContext:t.getShortcutManager().getContext("grid"),callback:(i,o)=>n.editorCloseAndSave(i,o)},{keys:[["ArrowDown"],["ArrowUp"],["ArrowLeft"],["ArrowRight"]],preventDefault:!1,callback:(i,o)=>n.editorCloseAndSaveByArrowKeys(i,o)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>n.editorCloseWithoutSaving()}],r)}function GY(t){const e=t.getShortcutManager().addContext("grid"),n=Hx(t),r={runOnlyIf:()=>{const{navigableHeaders:i}=t.getSettings();return ce(t.getSelected())&&(i||!i&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:Ax};e.addShortcuts([{keys:[["F2"]],callback:i=>n.editorFastOpen(i)},{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>n.editorOpen(i,o)},{keys:[["Backspace"],["Delete"]],callback:()=>n.emptySelectedCells()}],{group:Ss,runOnlyIf:()=>ce(t.getSelected())}),e.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>n.selectAllCells(),runOnlyIf:()=>{var i;return!((i=t.getSelectedRangeLast())!==null&&i!==void 0&&i.highlight.isHeader())}},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>{var i;return(i=t.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isHeader()},preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>n.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>n.populateSelectedCellsData(),runOnlyIf:()=>{var i,o;return!((i=t.getSelectedRangeLast())!==null&&i!==void 0&&i.highlight.isHeader())&&((o=t.getSelectedRangeLast())===null||o===void 0?void 0:o.getCellsCount())>1}},{keys:[["Control","Space"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToColumns()},{keys:[["Shift","Space"]],stopPropagation:!0,callback:()=>n.extendCellsSelectionToRows()},{keys:[["ArrowUp"]],callback:()=>n.moveCellSelectionUp()},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTop()},{keys:[["ArrowUp","Shift"]],callback:()=>n.extendCellsSelectionUp()},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostTop(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>n.moveCellSelectionDown()},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottom()},{keys:[["ArrowDown","Shift"]],callback:()=>n.extendCellsSelectionDown()},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostBottom(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>n.moveCellSelectionLeft()},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostLeft()},{keys:[["ArrowLeft","Shift"]],callback:()=>n.extendCellsSelectionLeft()},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostLeft(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>n.moveCellSelectionRight()},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostRight()},{keys:[["ArrowRight","Shift"]],callback:()=>n.extendCellsSelectionRight()},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostRight(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>n.moveCellSelectionUpByViewportHight()},{keys:[["PageUp","Shift"]],callback:()=>n.extendCellsSelectionUpByViewportHeight()},{keys:[["PageDown"]],callback:()=>n.moveCellSelectionDownByViewportHeight()},{keys:[["PageDown","Shift"]],callback:()=>n.extendCellsSelectionDownByViewportHeight()},{keys:[["Tab"]],preventDefault:!1,callback:i=>n.moveCellSelectionInlineStart(i)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:i=>n.moveCellSelectionInlineEnd(i)},{keys:[["Control/Meta","Backspace"]],callback:()=>n.scrollToFocusedCell()}],r)}function qY(t){[GY,YY].forEach(e=>e(t))}const Nx="handsontableEditor",KY="handsontable";class Ry extends Ea{static get EDITOR_TYPE(){return KY}open(){super.open();const e=this.htContainer.style;this.htEditor&&(this.htEditor.destroy(),e.width="",e.height="",e.overflow=""),e.display==="none"&&(e.display=""),this.htEditor=new this.hot.constructor(this.htContainer,this.htOptions),this.htEditor.init(),this.htEditor.rootElement.style.display="",this.cellProperties.strict?this.htEditor.selectCell(0,0):this.htEditor.deselectCell(),Mf(this.TEXTAREA,0,this.TEXTAREA.value.length),this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),this.refreshDimensions()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s);const a=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,autoWrapCol:!1,autoWrapRow:!1,ariaTags:!1,themeName:this.hot.getCurrentThemeName(),afterOnCellMouseDown(u,c){const h=this.getSourceData(c.row,c.col);h!==void 0&&a.setValue(h),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&rn(l,s.handsontable),this.htOptions=l}beginEditing(e,n){const r=this.hot.getSettings().onBeginEditing;r&&r()===!1||super.beginEditing(e,n)}createElements(){super.createElements();const e=this.hot.rootDocument.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()}finishEditing(e,n,r){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedLast()){const i=this.htEditor.getValue();i!==void 0&&this.setValue(i)}super.finishEditing(e,n,r)}getHeight(){return this.htEditor.view.getTableHeight()+1}getWidth(){return this.htEditor.view.getTableWidth()}assignHooks(){this.hot.addHook("afterDestroy",()=>{var e;(e=this.htEditor)===null||e===void 0||e.destroy()}),this.hot.addHook("afterSetTheme",(e,n)=>{if(!n){var r;(r=this.htEditor)===null||r===void 0||r.useTheme(e)}})}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const r={group:Nx,relativeToGroup:Ss,position:"before"},i=(o,s)=>{const a=this.htEditor;if(o!==void 0&&(o<0||a.flipped&&o>a.countRows()-1?a.deselectCell():a.selectCell(o,0),a.getData().length))return s.preventDefault(),fi(s),this.hot.listen(),this.TEXTAREA.focus(),!1};n.addShortcuts([{keys:[["ArrowUp"]],callback:o=>{const s=this.htEditor;let a,l;return!s.getSelectedLast()&&s.flipped?a=s.countRows()-1:s.getSelectedLast()&&(s.flipped?(l=s.getSelectedLast()[0],a=Math.max(0,l-1)):(l=s.getSelectedLast()[0],a=l-1)),i(a,o)},preventDefault:!1},{keys:[["ArrowDown"]],callback:o=>{const s=this.htEditor;let a,l;if(!s.getSelectedLast()&&!s.flipped)a=0;else if(s.getSelectedLast()){if(s.flipped)a=s.getSelectedLast()[0]+1;else if(!s.flipped){const u=s.countRows()-1;l=s.getSelectedLast()[0],a=Math.min(u,l+1)}}return i(a,o)},preventDefault:!1}],r)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(Nx)}}const we={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:by()?182:174,AUDIO_MUTE:by()?181:173,AUDIO_UP:by()?183:175,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND_LEFT:91,COMMAND_RIGHT:93,COMMAND_FIREFOX:224,CONTROL:17,DELETE:46,END:35,ENTER:13,ESCAPE:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,HOME:36,INSERT:45,MEDIA_NEXT:176,MEDIA_PLAY_PAUSE:179,MEDIA_PREV:177,MEDIA_STOP:178,NULL:0,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PERIOD:190,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,A:65,C:67,D:68,F:70,L:76,O:79,P:80,S:83,V:86,X:88,Y:89,Z:90},XY=[we.ALT,we.ARROW_DOWN,we.ARROW_LEFT,we.ARROW_RIGHT,we.ARROW_UP,we.AUDIO_DOWN,we.AUDIO_MUTE,we.AUDIO_UP,we.BACKSPACE,we.CAPS_LOCK,we.DELETE,we.END,we.ENTER,we.ESCAPE,we.F1,we.F2,we.F3,we.F4,we.F5,we.F6,we.F7,we.F8,we.F9,we.F10,we.F11,we.F12,we.F13,we.F14,we.F15,we.F16,we.F17,we.F18,we.F19,we.HOME,we.INSERT,we.MEDIA_NEXT,we.MEDIA_PLAY_PAUSE,we.MEDIA_PREV,we.MEDIA_STOP,we.NULL,we.NUM_LOCK,we.PAGE_DOWN,we.PAGE_UP,we.PAUSE,we.SCROLL_LOCK,we.SHIFT,we.TAB];function ZY(t){return t===32||t>=48&&t<=57||t>=96&&t<=111||t>=186&&t<=192||t>=219&&t<=222||t>=226||t>=65&&t<=90}function Dx(t){return XY.includes(t)}function QY(t){return[we.CONTROL,we.COMMAND_LEFT,we.COMMAND_RIGHT,we.COMMAND_FIREFOX].includes(t)}function jc(t,e){const n=e.split("|");let r=!1;return H(n,i=>{if(t===we[i])return r=!0,!1}),r}const JY="base";function Uc(t,e,n,r,i,o,s){const a=s.ariaTags,l=[],u=[],c=[],h=[];s.className&&X(e,s.className),s.readOnly?(l.push(s.readOnlyCellClassName),a&&h.push(ZO())):a&&c.push(ZO()[0]),s.valid===!1&&s.invalidCellClassName?(l.push(s.invalidCellClassName),a&&h.push(QO())):(u.push(s.invalidCellClassName),a&&c.push(QO()[0])),s.wordWrap===!1&&s.noWordWrapClassName&&l.push(s.noWordWrapClassName),!o&&s.placeholder&&l.push(s.placeholderCellClassName),ve(e,u),X(e,l),Yl(e,c),Se(e,h)}Uc.RENDERER_TYPE=JY;const eG="text";function Lo(t,e,n,r,i,o,s){Uc.apply(this,[t,e,n,r,i,o,s]);let a=o;!a&&s.placeholder&&(a=s.placeholder),a=xt(a),s.trimWhitespace&&(a=a.trim()),ya(e,a)}Lo.RENDERER_TYPE=eG;function rt(t){return typeof t=="function"}function Df(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200,n=null,r;function i(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return n&&clearTimeout(n),n=setTimeout(()=>{r=t.apply(this,s)},e),r}return i}function kx(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return t.apply(this,n.concat(s))}}function tG(t){const e=t.length;function n(r){return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];const l=r.concat(s);let u;return l.length>=e?u=t.apply(this,l):u=n(l),u}}return n([])}function Ey(t,e,n,r,i,o,s,a){return ce(a)?t.call(e,n,r,i,o,s,a):ce(s)?t.call(e,n,r,i,o,s):ce(o)?t.call(e,n,r,i,o):ce(i)?t.call(e,n,r,i):ce(r)?t.call(e,n,r):ce(n)?t.call(e,n):t.call(e)}function nG(t,e){$x(t,e),e.add(t)}function Lx(t,e,n){$x(t,e),e.set(t,n)}function $x(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kf(t,e,n){return(e=rG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rG(t){var e=iG(t,"string");return typeof e=="symbol"?e:e+""}function iG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ty(t,e){return t.get(_y(t,e))}function _y(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 oG="autocomplete";var My=new WeakMap,Fx=new WeakMap,Iy=new WeakSet;class Py extends Ry{constructor(){super(...arguments),nG(this,Iy),kf(this,"query",null),kf(this,"strippedChoices",[]),kf(this,"rawChoices",[]),Lx(this,My,this.hot.guid.slice(0,9)),Lx(this,Fx,Df(()=>{this.focus()},100)),kf(this,"sortByRelevance",function(e,n,r){const i=[],o=[],s=e.length;let a=n.length,l,u,c,h;if(s===0){for(c=0;c<a;c++)o.push(c);return o}for(c=0;c<a;c++){if(u=zO(xt(n[c])),r)h=u.indexOf(e);else{const d=this.cellProperties.locale;h=u.toLocaleLowerCase(d).indexOf(e.toLocaleLowerCase(d))}h!==-1&&(l=u.length-h-s,i.push({baseIndex:c,index:h,charsLeft:l,value:u}))}for(i.sort((d,f)=>{if(f.index===-1)return-1;if(d.index===-1)return 1;if(d.index<f.index)return-1;if(f.index<d.index)return 1;if(d.index===f.index){if(d.charsLeft<f.charsLeft)return-1;if(d.charsLeft>f.charsLeft)return 1}return 0}),c=0,a=i.length;c<a;c++)o.push(i[c].baseIndex);return o})}static get EDITOR_TYPE(){return oG}getValue(){const e=this.rawChoices.find(n=>this.stripValueIfNeeded(n)===this.TEXTAREA.value);return ce(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),X(this.htContainer,"autocompleteEditor"),X(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&Se(this.TEXTAREA,[lz(),rz(),qO("listbox"),dz()])}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.hot.getSettings().ariaTags&&Se(this.TEXTAREA,[Br("false"),fz(`${Ty(My,this)}-listbox-${e}-${n}`)])}open(){super.open();const e=this.cellProperties.trimDropdown===void 0?!0:this.cellProperties.trimDropdown,n=this.hot.getSettings().ariaTags,r=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,i=r?.length,{row:o,col:s}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",a=>this.onBeforeKeyDown(a)),this.htEditor.addHook("afterScroll",Ty(Fx,this)),this.htEditor.updateSettings({colWidths:e?[Qt(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(a,l,u,c,h,d,f)=>{Lo(a,l,u,c,h,d,f);const{filteringCaseSensitive:m,allowHtml:b,locale:S}=this.cellProperties,E=this.query;let v=xt(d),I,M;v&&!b&&(I=m===!0?v.indexOf(E):v.toLocaleLowerCase(S).indexOf(E.toLocaleLowerCase(S)),I!==-1&&(M=v.substr(I,E.length),v=v.replace(M,`<strong>${M}</strong>`))),n&&Se(l,[iz(),...r?[wz(i)]:[],...r?[vz(r.indexOf(d)+1)]:[],["id",`${this.htEditor.rootElement.id}_${u}-${c}`]]),l.innerHTML=v},afterSelectionEnd:(a,l)=>{if(n){const u=h=>{Se(h,[my()]),Se(this.TEXTAREA,...gz(h.id))},c=this.htEditor.getCell(a,l,!0);c!==null?u(c):this.htEditor.addHookOnce("afterScrollVertically",()=>{const h=this.htEditor.getCell(a,l,!0);u(h)})}}}),n&&(Se(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...Ho()),Se(this.htEditor.rootElement,[GO(),mz("polite"),pz("text"),["id",`${Ty(My,this)}-listbox-${o}-${s}`]]),Se(this.TEXTAREA,...Br("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&Se(this.TEXTAREA,[Br("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const n=this.cellProperties.source;this.query=e,typeof n=="function"?n.call(this.cellProperties,e,r=>{this.rawChoices=r,this.updateChoicesList(this.stripValuesIfNeeded(r))}):Array.isArray(n)?(this.rawChoices=n,this.updateChoicesList(this.stripValuesIfNeeded(n))):this.updateChoicesList([])}updateChoicesList(e){const n=sx(this.TEXTAREA),r=Mz(this.TEXTAREA),i=this.cellProperties.sortByRelevance,o=this.cellProperties.filter;let s=null,a=null,l=e;i&&(s=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),l,this.cellProperties.filteringCaseSensitive));const u=Array.isArray(s)?s.length:0;if(o===!1)u&&(a=s[0]);else{const c=[];for(let h=0,d=l.length;h<d&&!(i&&u<=h);h++)u?c.push(l[s[h]]):c.push(l[h]);a=0,l=c}this.strippedChoices=l,l.length===0?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData(wf([l])),l.length>0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(a)),this.hot.listen(),Mf(this.TEXTAREA,n,n===r?void 0:r)}flipDropdownIfNeeded(){const e=this.getEditedCellRect(),n=e.height;let r=e.top;if(this.hot.view.isVerticallyScrollableByWindow()){const a=this.hot.view.getTableOffset().top-this.hot.rootWindow.scrollY;r=Math.max(r+a,0)}const i=this.getHeight(),o=this.hot.view.getWorkspaceHeight()-r-n,s=i>o&&r>o+n;return s?this.flipDropdown(i):this.unflipDropdown(),this.limitDropdownIfNeeded(s?r:o,i),s}limitDropdownIfNeeded(e,n){if(n>e){let r=0,i=0,o=0,s=null;do o=this.htEditor.getRowHeight(i)||this.htEditor.view.getDefaultRowHeight(),r+=o,i+=1;while(r<e);s=r-o,this.htEditor.flipped&&(this.htEditor.rootElement.style.top=`${parseInt(this.htEditor.rootElement.style.top,10)+n-s}px`),this.setDropdownHeight(r-o)}}flipDropdown(e){const n=this.htEditor.rootElement.style;n.position="absolute",n.top=`${-e}px`,this.htEditor.flipped=!0}unflipDropdown(){const e=this.htEditor.rootElement.style;e.position="absolute",e.top="",this.htEditor.flipped=void 0}updateDropdownDimensions(){this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),_y(Iy,this,Vx).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),_y(Iy,this,Vx).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}highlightBestMatchingChoice(e){typeof e=="number"?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getHeight(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),n=parseInt(e.borderTopWidth,10)+parseInt(e.borderBottomWidth,10),r=Math.min(this.cellProperties.visibleRows,this.strippedChoices.length);return Array.from({length:r},(o,s)=>s).reduce((o,s)=>{const a=this.htEditor.getRowHeight(s)||this.htEditor.view.getDefaultRowHeight();return o+a},0)+n+1}getWidth(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),n=parseInt(e.borderInlineStartWidth,10)+parseInt(e.borderInlineEndWidth,10);return this.htEditor.getColWidth(0)+n}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:n}=this.cellProperties,r=je(e,o=>xt(o));return je(r,o=>n?o:zO(o))}allowKeyEventPropagation(e){const n=this.htEditor.getSelectedRangeLast(),r={row:n?n.from.row:-1};let i=!1;return e===we.ARROW_DOWN&&r.row>0&&r.row<this.htEditor.countRows()-1&&(i=!0),e===we.ARROW_UP&&r.row>-1&&(i=!0),i}onBeforeKeyDown(e){if(ZY(e.keyCode)||e.keyCode===we.BACKSPACE||e.keyCode===we.DELETE||e.keyCode===we.INSERT){let n=10;if(e.keyCode===we.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(n+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},n)}}}function Vx(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getWidth()+vn(this.hot.rootDocument)})}const sG="checkbox";class Wx extends Kl{static get EDITOR_TYPE(){return sG}beginEditing(e,n){if(n&&n.type==="mouseup"&&n.target.nodeName==="TD"){const r=this.TD.querySelector('input[type="checkbox"]');ye(r,"htBadValue")||r.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}const Rs=()=>window,Ur=()=>window.document,Oy=(t,e)=>window.setTimeout(t,e),Ui=function(t,e,n,r){t.addEventListener(e,n,!!r)},$o=function(t,e,n,r){t.removeEventListener(e,n,!!r)},aG=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},Sr=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},xy=function(t,e){Sr(t,e)||(t.className=t.className===""?e:t.className+" "+e)},Ay=function(t,e){t.className=aG((" "+t.className+" ").replace(" "+e+" "," "))},Hy=function(t){return/Array/.test(Object.prototype.toString.call(t))},Rr=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},lG=function(t){let e=t.getDay();return e===0||e===6},uG=function(t){return t%4===0&&t%100!==0||t%400===0},Bx=function(t,e){return[31,uG(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},Lf=function(t){Rr(t)&&t.setHours(0,0,0,0)},$f=function(t,e){return t.getTime()===e.getTime()},Ff=function(t,e,n){let r,i;for(r in e)i=t[r]!==void 0,i&&typeof e[r]=="object"&&e[r]!==null&&e[r].nodeName===void 0?Rr(e[r])?n&&(t[r]=new Date(e[r].getTime())):Hy(e[r])?n&&(t[r]=e[r].slice(0)):t[r]=Ff({},e[r],n):(n||!i)&&(t[r]=e[r]);return t},jx=function(t,e,n){let r=Ur().createEvent("HTMLEvents");r.initEvent(e,!0,!1),r=Ff(r,n),t.dispatchEvent(r)},Ux=function(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t},zi={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,firstWeekOfYearMinDays:4,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},zx=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},cG=function(t){let e=[],n="false";if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)e.push("is-outside-current-month"),t.enableSelectionDaysInNextAndPreviousMonths||e.push("is-selection-disabled");else return'<td class="is-empty"></td>';return t.isDisabled&&e.push("is-disabled"),t.isToday&&e.push("is-today"),t.isSelected&&(e.push("is-selected"),n="true"),t.hasEvent&&e.push("has-event"),t.isInRange&&e.push("is-inrange"),t.isStartRange&&e.push("is-startrange"),t.isEndRange&&e.push("is-endrange"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+t.year+'" data-pika-month="'+t.month+'" data-pika-day="'+t.day+'">'+t.day+"</button></td>"},hG=function(t,e){t.setHours(0,0,0,0);let n=t.getDate(),r=t.getDay(),i=e,o=i-1,s=7,a=function(d){return(d+s-1)%s};t.setDate(n+o-a(r));let l=new Date(t.getFullYear(),0,i),u=1440*60*1e3,c=(t.getTime()-l.getTime())/u;return 1+Math.round((c-o+a(l.getDay()))/s)},dG=function(t,e,n,r,i){let o=new Date(r,n,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(o).isoWeek():hG(o,i))+"</td>"},fG=function(t,e,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},gG=function(t){return"<tbody>"+t.join("")+"</tbody>"},mG=function(t){let e,n=[];for(t.showWeekNumber&&n.push("<th></th>"),e=0;e<7;e++)n.push('<th scope="col"><abbr title="'+zx(t,e)+'">'+zx(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?n.reverse():n).join("")+"</tr></thead>"},pG=function(t,e,n,r,i,o){let s,a,l,u=t._o,c=n===u.minYear,h=n===u.maxYear,d='<div id="'+o+'" class="pika-title" role="heading" aria-live="polite">',f,m,b=!0,S=!0;for(l=[],s=0;s<12;s++)l.push('<option value="'+(n===i?s-e:12+s-e)+'"'+(s===r?' selected="selected"':"")+(c&&s<u.minMonth||h&&s>u.maxMonth?' disabled="disabled"':"")+">"+u.i18n.months[s]+"</option>");for(f='<div class="pika-label">'+u.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",Hy(u.yearRange)?(s=u.yearRange[0],a=u.yearRange[1]+1):(s=n-u.yearRange,a=1+n+u.yearRange),l=[];s<a&&s<=u.maxYear;s++)s>=u.minYear&&l.push('<option value="'+s+'"'+(s===n?' selected="selected"':"")+">"+s+"</option>");return m='<div class="pika-label">'+n+u.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",u.showMonthAfterYear?d+=m+f:d+=f+m,c&&(r===0||u.minMonth>=r)&&(b=!1),h&&(r===11||u.maxMonth<=r)&&(S=!1),e===0&&(d+='<button class="pika-prev'+(b?"":" is-disabled")+'" type="button">'+u.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(d+='<button class="pika-next'+(S?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),d+="</div>"},wG=function(t,e,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+mG(t)+gG(e)+"</table>"};function Ny(t){let e=this,n=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||Rs().event;let o=i.target||i.srcElement;if(o)if(Sr(o,"is-disabled")||(Sr(o,"pika-button")&&!Sr(o,"is-empty")&&!Sr(o.parentNode,"is-disabled")?(e.setDate(new Date(o.getAttribute("data-pika-year"),o.getAttribute("data-pika-month"),o.getAttribute("data-pika-day"))),n.bound&&Oy(function(){e.hide(),n.blurFieldOnSelect&&n.field&&n.field.blur()},100)):Sr(o,"pika-prev")?e.prevMonth():Sr(o,"pika-next")&&e.nextMonth()),Sr(o,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||Rs().event;let o=i.target||i.srcElement;o&&(Sr(o,"pika-select-month")?e.gotoMonth(o.value):Sr(o,"pika-select-year")&&e.gotoYear(o.value))},e._onKeyChange=function(i){if(i=i||Rs().event,e.isVisible())switch(i.keyCode){case 13:case 27:n.field&&n.field.blur();break;case 37:e.adjustDate("subtract",1);break;case 38:e.adjustDate("subtract",7);break;case 39:e.adjustDate("add",1);break;case 40:e.adjustDate("add",7);break;case 8:case 46:e.setDate(null);break}},e._parseFieldValue=function(){if(n.parse)return n.parse(n.field.value,n.format);if(this.hasMoment){let i=this.moment(n.field.value,n.format,n.formatStrict);return i&&i.isValid()?i.toDate():null}else return new Date(Date.parse(n.field.value))},e._onInputChange=function(i){let o;i.firedBy!==e&&(o=e._parseFieldValue(),Rr(o)&&e.setDate(o),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=Ur().activeElement;do if(Sr(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=Oy(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||Rs().event;let o=i.target||i.srcElement,s=o;if(o){!hasEventListeners&&Sr(o,"pika-select")&&(o.onchange||(o.setAttribute("onchange","return;"),Ui(o,"change",e._onChange)));do if(Sr(s,"pika-single")||s===n.trigger)return;while(s=s.parentNode);e._v&&o!==n.trigger&&s!==n.trigger&&e.hide()}},e.el=Ur().createElement("div"),e.el.className="pika-single"+(n.isRTL?" is-rtl":"")+(n.theme?" "+n.theme:""),Ui(e.el,"mousedown",e._onMouseDown,!0),Ui(e.el,"touchend",e._onMouseDown,!0),Ui(e.el,"change",e._onChange),n.keyboardInput&&Ui(Ur(),"keydown",e._onKeyChange),n.field&&(n.container?n.container.appendChild(e.el):n.bound?Ur().body.appendChild(e.el):n.field.parentNode.insertBefore(e.el,n.field.nextSibling),Ui(n.field,"change",e._onInputChange),n.defaultDate||(n.defaultDate=e._parseFieldValue(),n.setDefaultDate=!0));let r=n.defaultDate;Rr(r)?n.setDefaultDate?e.setDate(r,!0):e.gotoDate(r):e.gotoDate(new Date),n.bound?(this.hide(),e.el.className+=" is-bound",Ui(n.trigger,"click",e._onInputClick),Ui(n.trigger,"focus",e._onInputFocus),Ui(n.trigger,"blur",e._onInputBlur)):this.show()}Ny.prototype={config:function(t){this._o||(this._o=Ff({},zi,!0));let e=Ff(this._o,t,!0);e.isRTL=!!e.isRTL,e.field=e.field&&e.field.nodeName?e.field:null,e.theme=typeof e.theme=="string"&&e.theme?e.theme:null,e.bound=!!(e.bound!==void 0?e.field&&e.bound:e.field),e.trigger=e.trigger&&e.trigger.nodeName?e.trigger:e.field,e.disableWeekends=!!e.disableWeekends,e.disableDayFn=typeof e.disableDayFn=="function"?e.disableDayFn:null;let n=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=n>4?4:n,Rr(e.minDate)||(e.minDate=!1),Rr(e.maxDate)||(e.maxDate=!1),e.minDate&&e.maxDate&&e.maxDate<e.minDate&&(e.maxDate=e.minDate=!1),e.minDate&&this.setMinDate(e.minDate),e.maxDate&&this.setMaxDate(e.maxDate),Hy(e.yearRange)){let r=new Date().getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||r,e.yearRange[1]=parseInt(e.yearRange[1],10)||r}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||zi.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,Rr(this._d)?this._o.toString?this._o.toString(this._d,t):this.hasMoment?this.moment(this._d).format(t):this._d.toDateString():""},getMoment:function(){return this.hasMoment?this.moment(this._d):null},setMoment:function(t,e){this.hasMoment&&this.moment.isMoment(t)&&this.setDate(t.toDate(),e)},useMoment:function(t){this.hasMoment=!0,this.moment=t},getDate:function(){return Rr(this._d)?new Date(this._d.getTime()):null},setDate:function(t,e){if(!t)return this._d=null,this._o.field&&(this._o.field.value="",jx(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!Rr(t))return;let n=this._o.minDate,r=this._o.maxDate;Rr(n)&&t<n?t=n:Rr(r)&&t>r&&(t=r),this._d=new Date(t.getTime()),Lf(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),jx(this._o.field,"change",{firedBy:this})),!e&&typeof this._o.onSelect=="function"&&this._o.onSelect.call(this,this.getDate())},clear:function(){this.setDate(null)},gotoDate:function(t){let e=!0;if(Rr(t)){if(this.calendars){let n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=t.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),e=i<n.getTime()||r.getTime()<i}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}],this._o.mainCalendar==="right"&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(t,e){let n=this.getDate()||new Date,r=parseInt(e)*24*60*60*1e3,i;t==="add"?i=new Date(n.valueOf()+r):t==="subtract"&&(i=new Date(n.valueOf()-r)),this.setDate(i)},adjustCalendars:function(){this.calendars[0]=Ux(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=Ux({month:this.calendars[0].month+t,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())},setMinDate:function(t){t instanceof Date?(Lf(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=zi.minDate,this._o.minYear=zi.minYear,this._o.minMonth=zi.minMonth,this._o.startRange=zi.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(Lf(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=zi.maxDate,this._o.maxYear=zi.maxYear,this._o.maxMonth=zi.maxMonth,this._o.endRange=zi.endRange),this.draw()},setStartRange:function(t){this._o.startRange=t},setEndRange:function(t){this._o.endRange=t},draw:function(t){if(!this._v&&!t)return;let e=this._o,n=e.minYear,r=e.maxYear,i=e.minMonth,o=e.maxMonth,s="",a;this._y<=n&&(this._y=n,!isNaN(i)&&this._m<i&&(this._m=i)),this._y>=r&&(this._y=r,!isNaN(o)&&this._m>o&&(this._m=o));for(let l=0;l<e.numberOfMonths;l++)a="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),s+='<div class="pika-lendar">'+pG(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,a)+this.render(this.calendars[l].year,this.calendars[l].month,a)+"</div>";this.el.innerHTML=s,e.bound&&e.field.type!=="hidden"&&Oy(function(){e.trigger.focus()},1),typeof this._o.onDraw=="function"&&this._o.onDraw(this),e.bound&&e.field.setAttribute("aria-label",e.ariaLabel)},adjustPosition:function(){let t,e,n,r,i,o,s,a,l,u,c;this._o.container||(this.el.style.position="absolute",t=this._o.trigger,e=this.el.offsetWidth,n=this.el.offsetHeight,r=Rs().innerWidth||Ur().documentElement.clientWidth,i=Rs().innerHeight||Ur().documentElement.clientHeight,o=Ur().body.scrollTop||Ur().documentElement.scrollTop,u=!0,c=!0,l=t.getBoundingClientRect(),s=l.left+Rs().pageXOffset,a=l.bottom+Rs().pageYOffset,(this._o.reposition&&s+e>r||this._o.position.indexOf("right")>-1&&s-e+t.offsetWidth>0)&&(s=s-e+t.offsetWidth,u=!1),(this._o.reposition&&a+n>i+o||this._o.position.indexOf("top")>-1&&a-n-t.offsetHeight>0)&&(a=a-n-t.offsetHeight,c=!1),s<0&&(s=0),a<0&&(a=0),this.el.style.left=s+"px",this.el.style.top=a+"px",xy(this.el,u?"left-aligned":"right-aligned"),xy(this.el,c?"bottom-aligned":"top-aligned"),Ay(this.el,u?"right-aligned":"left-aligned"),Ay(this.el,c?"top-aligned":"bottom-aligned"))},render:function(t,e,n){let r=this._o,i=new Date,o=Bx(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];Lf(i),r.firstDay>0&&(s-=r.firstDay,s<0&&(s+=7));let u=e===0?11:e-1,c=e===11?0:e+1,h=e===0?t-1:t,d=e===11?t+1:t,f=Bx(h,u),m=o+s,b=m;for(;b>7;)b-=7;m+=7-b;let S=!1;for(let E=0,v=0;E<m;E++){let I=new Date(t,e,1+(E-s)),M=Rr(this._d)?$f(I,this._d):!1,T=$f(I,i),P=r.events.indexOf(I.toDateString())!==-1,D=E<s||E>=o+s,K=1+(E-s),Y=e,U=t,J=r.startRange&&$f(r.startRange,I),ee=r.endRange&&$f(r.endRange,I),ae=r.startRange&&r.endRange&&r.startRange<I&&I<r.endRange,ne=r.minDate&&I<r.minDate||r.maxDate&&I>r.maxDate||r.disableWeekends&&lG(I)||r.disableDayFn&&r.disableDayFn(I);D&&(E<s?(K=f+K,Y=u,U=h):(K=K-o,Y=c,U=d));let se={day:K,month:Y,year:U,hasEvent:P,isSelected:M,isToday:T,isDisabled:ne,isEmpty:D,isStartRange:J,isEndRange:ee,isInRange:ae,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&M&&(S=!0),l.push(cG(se)),++v===7&&(r.showWeekNumber&&l.unshift(dG(this,E-s,e,t,r.firstWeekOfYearMinDays)),a.push(fG(l,r.isRTL,r.pickWholeWeek,S)),l=[],v=0,S=!1)}return wG(r,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),Ay(this.el,"is-hidden"),this._o.bound&&(Ui(Ur(),"click",this._onClick),this.adjustPosition()),typeof this._o.onOpen=="function"&&this._o.onOpen.call(this))},hide:function(){let t=this._v;t!==!1&&(this._o.bound&&$o(Ur(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),xy(this.el,"is-hidden"),this._v=!1,t!==void 0&&typeof this._o.onClose=="function"&&this._o.onClose.call(this))},destroy:function(){let t=this._o;this.hide(),$o(this.el,"mousedown",this._onMouseDown,!0),$o(this.el,"touchend",this._onMouseDown,!0),$o(this.el,"change",this._onChange),t.keyboardInput&&$o(Ur(),"keydown",this._onKeyChange),t.field&&($o(t.field,"change",this._onInputChange),t.bound&&($o(t.trigger,"click",this._onInputClick),$o(t.trigger,"focus",this._onInputFocus),$o(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function vG(t,e){CG(t,e),e.add(t)}function CG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yx(t,e,n){return(e=yG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yG(t){var e=bG(t,"string");return typeof e=="symbol"?e:e+""}function bG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dy(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 Gx="date",qx="dateEditor",SG="DD/MM/YYYY";var Vf=new WeakSet;class Kx extends Ea{constructor(){super(...arguments),vG(this,Vf),Yx(this,"parentDestroyed",!1),Yx(this,"$datePicker",null)}static get EDITOR_TYPE(){return Gx}init(){if(typeof Z!="function")throw new Error("You need to include moment.js to your project.");if(typeof Ny!="function")throw new Error("You need to include Pikaday to your project.");super.init(),this.hot.addHook("afterDestroy",()=>{this.parentDestroyed=!0,this.destroyElements()}),this.hot.addHook("afterSetTheme",(e,n)=>{n||(ve(this.datePicker,/ht-theme-.*/g),X(this.datePicker,e))})}createElements(){super.createElements(),this.datePicker=this.hot.rootDocument.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,this.datePicker.setAttribute("dir",this.hot.isRtl()?"rtl":"ltr"),X(this.datePicker,"htDatepickerHolder");const e=this.hot.getCurrentThemeName();ve(this.datePicker,/ht-theme-.*/g),X(this.datePicker,e),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",n=>{ye(n.target,"pika-day")&&this.hideDatepicker(),n.stopPropagation()})}destroyElements(){const e=this.datePicker.parentNode;this.$datePicker&&this.$datePicker.destroy(),e&&e.removeChild(this.datePicker)}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s)}open(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const r=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),r.addShortcuts([{keys:[["ArrowLeft"]],callback:()=>{this.$datePicker.adjustDate("subtract",1)}},{keys:[["ArrowRight"]],callback:()=>{this.$datePicker.adjustDate("add",1)}},{keys:[["ArrowUp"]],callback:()=>{this.$datePicker.adjustDate("subtract",7)}},{keys:[["ArrowDown"]],callback:()=>{this.$datePicker.adjustDate("add",7)}}],{group:qx})}close(){var e;this._opened=!1,(e=this.$datePicker)!==null&&e!==void 0&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{const i=this.hot._getEditorManager();i.closeEditor(),this.hot.view.render(),i.prepareEditor()}),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(qx),super.close()}finishEditing(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.finishEditing(e,n)}showDatepicker(e){const n=Dy(Vf,this,ky).call(this),r=this.hot.view.isMouseDown(),i=e?Dx(e.keyCode):!1;let o;this.datePicker.style.display="block",this.$datePicker=new Ny(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(Z),this.$datePicker._onInputFocus=function(){},this.originalValue?(o=this.originalValue,Z(o,n,!0).isValid()&&this.$datePicker.setMoment(Z(o,n),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!i&&!r&&this.setValue("")):this.cellProperties.defaultDate?(o=this.cellProperties.defaultDate,Z(o,n,!0).isValid()&&this.$datePicker.setMoment(Z(o,n),!0),!i&&!r&&this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){var e;const n=this.TEXTAREA,r={};this.cellProperties&&this.cellProperties.datePickerConfig&&Cf(r,this.cellProperties.datePickerConfig);const i=r.onSelect,o=r.onClose;return r.field=n,r.trigger=n,r.container=this.datePicker,r.bound=!1,r.keyboardInput=!1,r.format=(e=r.format)!==null&&e!==void 0?e:Dy(Vf,this,ky).call(this),r.reposition=r.reposition||!1,r.isRTL=!1,r.onSelect=s=>{let a=s;isNaN(a.getTime())||(a=Z(a).format(Dy(Vf,this,ky).call(this))),this.setValue(a),i&&i(),ko()&&this.hideDatepicker()},r.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),o&&o()},r}refreshDimensions(e){var n;if(super.refreshDimensions(e),this.state!==Ut.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.hideDatepicker();return}const{rowIndexMapper:r,columnIndexMapper:i}=this.hot,{wtOverlays:o}=this.hot.view._wt,{wtTable:s}=(n=o.getParentOverlay(this.TD))!==null&&n!==void 0?n:this.hot.view._wt,a=r.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleRow()),l=r.getVisualFromRenderableIndex(s.getLastPartiallyVisibleRow()),u=i.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleColumn()),c=i.getVisualFromRenderableIndex(s.getLastPartiallyVisibleColumn());if(this.row>=a&&this.row<=l&&this.col>=u&&this.col<=c){const h=this.TD.getBoundingClientRect();this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+h.top+an(this.TD)}px`;let d=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?d+=h.right-Qt(this.datePicker):d+=h.left,this.datePickerStyle.left=`${d}px`}else this.hideDatepicker()}}function ky(){var t;return(t=this.cellProperties.dateFormat)!==null&&t!==void 0?t:SG}const RG="dropdown";class Xx extends Py{static get EDITOR_TYPE(){return RG}prepare(e,n,r,i,o,s){s.filter=!1,s.strict=!0,super.prepare(e,n,r,i,o,s)}}const EG="numeric";class Zx extends Ea{static get EDITOR_TYPE(){return EG}}function TG(t,e,n){return(e=_G(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _G(t){var e=MG(t,"string");return typeof e=="symbol"?e:e+""}function MG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const IG="password";class Qx extends Ea{constructor(){super(...arguments),TG(this,"autoResize",Px(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}))}static get EDITOR_TYPE(){return IG}createElements(){super.createElements(),this.TEXTAREA=this.hot.rootDocument.createElement("input"),this.TEXTAREA.setAttribute("type","password"),this.TEXTAREA.setAttribute("data-hot-input",""),this.TEXTAREA.className="handsontableInput",this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,No(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const Ly="ht_editor_visible",Jx="selectEditor",PG="select";class eA extends Kl{static get EDITOR_TYPE(){return PG}init(){this.selectWrapper=this.hot.rootDocument.createElement("div"),this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.selectWrapper.style.display="none";const e=this.hot.rootDocument.createElement("DIV"),n=this.hot.getSettings().ariaTags;e.className="htAutocompleteArrow",n&&e.setAttribute(...pa()),e.appendChild(this.hot.rootDocument.createTextNode("▼")),X(this.selectWrapper,"htSelectEditor"),this.selectWrapper.appendChild(this.select),this.selectWrapper.insertBefore(e,this.selectWrapper.firstChild),this.hot.rootElement.appendChild(this.selectWrapper),this.registerHooks()}getValue(){return this.select.value}setValue(e){this.select.value=e}open(){this._opened=!0,this.refreshDimensions(),this.selectWrapper.style.display="",this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.selectWrapper.style.display="none",ye(this.selectWrapper,Ly)&&ve(this.selectWrapper,Ly),this.unregisterShortcuts(),this.clearHooks()}focus(){this.select.focus()}registerHooks(){this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>this.refreshDimensions()),this.addHook("afterRowResize",()=>this.refreshDimensions())}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s);const a=this.cellProperties.selectOptions;let l;typeof a=="function"?l=this.prepareOptions(a(this.row,this.col,this.prop)):l=this.prepareOptions(a),No(this.select),Ne(l,(u,c)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=c,Gl(h,u),this.select.appendChild(h)})}prepareOptions(e){let n={};if(Array.isArray(e))for(let r=0,i=e.length;r<i;r++)n[e[r]]=e[r];else typeof e=="object"&&(n=e);return n}refreshValue(){const e=this.hot.getSourceDataAtCell(this.row,this.prop);this.originalValue=e,this.setValue(e),this.refreshDimensions()}refreshDimensions(){if(this.state!==Ut.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.close();return}const{top:e,start:n,width:r,height:i}=this.getEditedCellRect(),o=this.selectWrapper.style;o.height=`${i}px`,o.width=`${r}px`,o.top=`${e}px`,o[this.hot.isRtl()?"right":"left"]=`${n}px`,o.margin="0px",X(this.selectWrapper,Ly)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={group:Jx};this.isInFullEditMode()&&n.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{const i=this.select.selectedIndex-1;i>=0&&(this.select[i].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const i=this.select.selectedIndex+1;i<=this.select.length-1&&(this.select[i].selected=!0)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(Jx)}}const OG="time";class tA extends Ea{static get EDITOR_TYPE(){return OG}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.TEXTAREA.dir="ltr"}}function et(){ce(console)&&console.warn(...arguments)}function $y(){ce(console)&&console.error(...arguments)}const Ta=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","beforeCompositionStart","afterGetCellMeta","afterGetColHeader","afterGetRowHeader","afterInit","afterLoadData","afterUpdateData","afterMomentumScroll","afterOnCellCornerMouseDown","afterOnCellCornerDblClick","afterOnCellMouseDown","afterOnCellMouseUp","afterOnCellContextMenu","afterOnCellMouseOver","afterOnCellMouseOut","afterRemoveCol","afterRemoveRow","beforeRenderer","afterRenderer","afterRowSequenceChange","beforeViewportScrollVertically","beforeViewportScrollHorizontally","beforeViewportScroll","afterScrollHorizontally","afterScrollVertically","afterScroll","afterSelection","afterSelectionByProp","afterSelectionEnd","afterSelectionEndByProp","afterSelectionFocusSet","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","afterSetTheme","afterUpdateSettings","afterValidate","beforeLanguageChange","afterLanguageChange","beforeAutofill","afterAutofill","beforeCellAlignment","beforeChange","beforeChangeRender","beforeDrawBorders","beforeGetCellMeta","beforeRemoveCellMeta","beforeInit","beforeInitWalkontable","beforeLoadData","beforeUpdateData","beforeKeyDown","beforeOnCellMouseDown","beforeOnCellMouseUp","beforeOnCellContextMenu","beforeOnCellMouseOver","beforeOnCellMouseOut","beforeRemoveCol","beforeRemoveRow","beforeViewRender","afterViewRender","beforeRender","afterRender","beforeRowWrap","beforeColumnWrap","beforeSetCellMeta","beforeSelectionFocusSet","beforeSetRangeStartOnly","beforeSetRangeStart","beforeSetRangeEnd","beforeSelectionHighlightSet","beforeTouchScroll","beforeValidate","beforeValueRender","construct","init","modifyColHeader","modifyColWidth","modifyFiltersMultiSelectValue","modifyFocusedElement","modifyRowHeader","modifyRowHeight","modifyRowHeightByOverlayName","modifyData","modifySourceData","modifyRowData","modifyGetCellCoords","modifyGetCoordsElement","modifyFocusOnTabNavigation","beforeHighlightingRowHeader","beforeHighlightingColumnHeader","persistentStateLoad","persistentStateReset","persistentStateSave","beforeColumnSort","afterColumnSort","modifyAutofillRange","modifyCopyableRange","beforeCut","afterCut","beforeCopy","afterCopy","beforePaste","afterPaste","beforeColumnFreeze","afterColumnFreeze","beforeColumnMove","afterColumnMove","beforeColumnUnfreeze","afterColumnUnfreeze","beforeRowMove","afterRowMove","beforeColumnResize","afterColumnResize","beforeRowResize","afterRowResize","afterGetColumnHeaderRenderers","afterGetRowHeaderRenderers","beforeStretchingColumnWidth","beforeFilter","afterFilter","afterFormulasValuesUpdate","afterNamedExpressionAdded","afterNamedExpressionRemoved","afterSheetAdded","afterSheetRenamed","afterSheetRemoved","modifyColumnHeaderHeight","modifyColumnHeaderValue","beforeUndo","beforeUndoStackChange","afterUndo","afterUndoStackChange","beforeRedo","beforeRedoStackChange","afterRedo","afterRedoStackChange","modifyRowHeaderWidth","modifyTransformFocus","modifyTransformStart","modifyTransformEnd","afterModifyTransformFocus","afterModifyTransformStart","afterModifyTransformEnd","afterViewportRowCalculatorOverride","afterViewportColumnCalculatorOverride","afterPluginsInitialized","beforeHideRows","afterHideRows","beforeUnhideRows","afterUnhideRows","beforeHideColumns","afterHideColumns","beforeUnhideColumns","afterUnhideColumns","beforeTrimRow","afterTrimRow","beforeUntrimRow","afterUntrimRow","beforeDropdownMenuShow","afterDropdownMenuShow","afterDropdownMenuHide","beforeAddChild","afterAddChild","beforeDetachChild","afterDetachChild","beforeBeginEditing","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],Fy=new Map([["modifyRow","8.0.0"],["modifyCol","8.0.0"],["unmodifyRow","8.0.0"],["unmodifyCol","8.0.0"],["skipLengthCache","8.0.0"],["hiddenColumn","8.0.0"],["hiddenRow","8.0.0"]]),Vy=new Map([[]]);var nA={},Wy,rA;function xG(){if(rA)return Wy;rA=1;var t=Ol();return Wy=function(e,n,r){for(var i=0,o=arguments.length>2?r:t(n),s=new e(o);o>i;)s[i]=n[i++];return s},Wy}var By,iA;function AG(){if(iA)return By;iA=1;var t=dn();return By=function(e,n){var r=t[e],i=r&&r.prototype;return i&&i[n]},By}var jy,oA;function Wf(){if(oA)return jy;oA=1;var t=si(),e=Vv(),n=ws().f,r=t("unscopables"),i=Array.prototype;return i[r]===void 0&&n(i,r,{configurable:!0,value:e(null)}),jy=function(o){i[r][o]=!0},jy}var sA;function HG(){if(sA)return nA;sA=1;var t=vt(),e=Xt(),n=Jn(),r=fc(),i=xG(),o=AG(),s=Wf(),a=Array,l=e(o("Array","sort"));return t({target:"Array",proto:!0},{toSorted:function(c){c!==void 0&&n(c);var h=r(this),d=i(a,h);return l(d,c)}}),s("toSorted"),nA}HG();function NG(t,e){aA(t,e),e.add(t)}function Uy(t,e,n){aA(t,e),e.set(t,n)}function aA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lA(t,e,n){return t.set(Bf(t,e),n),n}function Tn(t,e){return t.get(Bf(t,e))}function Bf(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 DG=100;var Er=new WeakMap,Zl=new WeakMap,zy=new WeakMap,Yy=new WeakSet;class uA{constructor(){NG(this,Yy),Uy(this,Er,new Map),Uy(this,Zl,new Map),Uy(this,zy,new Set),Ta.forEach(e=>Bf(Yy,this,cA).call(this,e))}getHooks(e){var n;return(n=Tn(Er,this).get(e))!==null&&n!==void 0?n:[]}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Tn(Er,this).has(e)||(Bf(Yy,this,cA).call(this,e),Ta.push(e));const i=Tn(Er,this).get(e);if(i.find(u=>u.callback===n))return;const o=Number.isInteger(r.orderIndex)?r.orderIndex:0,s=!!r.runOnce,a=!!r.initialHook;let l=!1;if(a){const u=i.find(c=>c.initialHook);u&&(u.callback=n,l=!0)}if(!l){i.push({callback:n,orderIndex:o,runOnce:s,initialHook:a,skip:!1});let u=Tn(zy,this).has(e);!u&&o!==0&&(u=!0,Tn(zy,this).add(e)),u&&i.length>1&&Tn(Er,this).set(e,i.toSorted((c,h)=>c.orderIndex-h.orderIndex))}}has(e){return Tn(Er,this).has(e)&&Tn(Er,this).get(e).length>0}remove(e,n){if(!Tn(Er,this).has(e))return!1;const r=Tn(Er,this).get(e),i=r.find(o=>o.callback===n);if(i){let o=Tn(Zl,this).get(e);return i.skip=!0,o+=1,o>DG&&(Tn(Er,this).set(e,r.filter(s=>!s.skip)),o=0),Tn(Zl,this).set(e,o),!0}return!1}destroy(){Tn(Er,this).clear(),Tn(Zl,this).clear(),lA(Er,this,null),lA(Zl,this,null)}}function cA(t){Tn(Er,this).set(t,[]),Tn(Zl,this).set(t,0)}function kG(t,e,n){return(e=LG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LG(t){var e=$G(t,"string");return typeof e=="symbol"?e:e+""}function $G(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const FG=tt`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
29
- Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
30
- learn about the migration path.`;class re{constructor(){kG(this,"globalBucket",new uA)}static getSingleton(){return WG()}getBucket(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=new uA),e.pluginHookBucket):this.globalBucket}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(n)?H(n,o=>this.add(e,o,r)):(Fy.has(e)&&et(UO(FG,{hookName:e,removedInVersion:Fy.get(e)})),Vy.has(e)&&et(Vy.get(e)),this.getBucket(r).add(e,n,{orderIndex:i,runOnce:!1})),this}once(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(n)?H(n,o=>this.once(e,o,r)):this.getBucket(r).add(e,n,{orderIndex:i,runOnce:!0}),this}addAsFixed(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return Array.isArray(n)?H(n,i=>this.addAsFixed(e,i,r)):this.getBucket(r).add(e,n,{initialHook:!0}),this}remove(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return this.getBucket(r).remove(e,n)}has(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.getBucket(n).has(e)}run(e,n,r,i,o,s,a,l){{const u=this.getBucket().getHooks(n),c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=Ey(u[h].callback,e,r,i,o,s,a,l);d!==void 0&&(r=d),u[h]&&u[h].runOnce&&this.remove(n,u[h].callback),h+=1}}{const u=this.getBucket(e).getHooks(n),c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=Ey(u[h].callback,e,r,i,o,s,a,l);d!==void 0&&(r=d),u[h]&&u[h].runOnce&&this.remove(n,u[h].callback,e),h+=1}}return r}destroy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.getBucket(e).destroy()}register(e){this.isRegistered(e)||Ta.push(e)}deregister(e){this.isRegistered(e)&&Ta.splice(Ta.indexOf(e),1)}isDeprecated(e){return Vy.has(e)||Fy.has(e)}isRegistered(e){return Ta.indexOf(e)>=0}getRegistered(){return Ta}}const VG=new re;function WG(){return VG}const Gy=new Map;function mi(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";Gy.has(t)||Gy.set(t,new Map);const e=Gy.get(t);function n(a,l){e.set(a,l)}function r(a){return e.get(a)}function i(a){return e.has(a)}function o(){return[...e.keys()]}function s(){return[...e.values()]}return{register:n,getItem:r,hasItem:i,getNames:o,getValues:s}}const qy=new WeakMap,{register:BG,getItem:hA,hasItem:dA,getNames:Ble,getValues:jle}=mi("editors");function jG(t){const e={},n=t;this.getConstructor=function(){return t},this.getInstance=function(r){return r.guid in e||(e[r.guid]=new n(r)),e[r.guid]},re.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function fA(t,e){let n;if(typeof t=="function")qy.get(t)||Tr(null,t),n=qy.get(t);else if(typeof t=="string")n=hA(t);else throw Error('Only strings and functions can be passed as "editor" parameter');if(!n)throw Error(`No editor registered under name "${t}"`);return n.getInstance(e)}function Ky(t){if(typeof t=="function")return t;if(!dA(t))throw Error(`No registered editor found under "${t}" name`);return hA(t).getConstructor()}function Tr(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const n=new jG(e);typeof t=="string"&&BG(t,n),qy.set(e,n)}function UG(){Tr(Kl),Tr(Py),Tr(Wx),Tr(Kx),Tr(Xx),Tr(Ry),Tr(Zx),Tr(Qx),Tr(eA),Tr(Ea),Tr(tA)}const zG="html";function Xy(t,e,n,r,i,o,s){Uc.apply(this,[t,e,n,r,i,o,s]),Gl(e,o??"",!1)}Xy.RENDERER_TYPE=zG;const YG="autocomplete";function Ql(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=s.allowHtml?Xy:Lo,u=a.createElement("DIV"),c=t.getSettings().ariaTags;if(u.className="htAutocompleteArrow",c&&u.setAttribute(...pa()),u.appendChild(a.createTextNode("▼")),l.apply(this,[t,e,n,r,i,o,s]),e.firstChild||e.appendChild(a.createTextNode(" ")),e.insertBefore(u,e.firstChild),X(e,"htAutocomplete"),!t.acArrowListener){const h=new gi(t);t.acArrowListener=function(d){ye(d.target,"htAutocompleteArrow")&&t.view._wt.getSetting("onCellDblClick",null,t._createCellCoords(n,r),e)},h.addEventListener(t.rootElement,"mousedown",t.acArrowListener),t.addHookOnce("afterDestroy",()=>{h.destroy()})}}Ql.RENDERER_TYPE=YG;const GG="dropdown";function Zy(t,e,n,r,i,o,s){Ql.apply(this,[t,e,n,r,i,o,s])}Zy.RENDERER_TYPE=GG;var gA={},mA={},pA;function qG(){if(pA)return mA;pA=1;var t=vt(),e=Al(),n=Jn(),r=nn(),i=Li();return t({target:"Iterator",proto:!0,real:!0},{every:function(s){r(this),n(s);var a=i(this),l=0;return!e(a,function(u,c){if(!s(u,l++))return c()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),mA}var wA;function KG(){return wA||(wA=1,qG()),gA}KG();const vA="ContextMenu:items",_e=vA,Qy=`${_e}.noItems`,Jy=`${_e}.insertRowAbove`,eb=`${_e}.insertRowBelow`,tb=`${_e}.insertColumnOnTheLeft`,nb=`${_e}.insertColumnOnTheRight`,rb=`${_e}.removeRow`,ib=`${_e}.removeColumn`,ob=`${_e}.undo`,sb=`${_e}.redo`,jf=`${_e}.readOnly`,ab=`${_e}.clearColumn`,lb=`${_e}.copy`,ub=`${_e}.copyWithHeaders`,cb=`${_e}.copyWithGroupHeaders`,hb=`${_e}.copyHeadersOnly`,db=`${_e}.cut`,fb=`${_e}.freezeColumn`,gb=`${_e}.unfreezeColumn`,mb=`${_e}.mergeCells`,pb=`${_e}.unmergeCells`,wb=`${_e}.addComment`,vb=`${_e}.editComment`,Cb=`${_e}.removeComment`,yb=`${_e}.readOnlyComment`,bb=`${_e}.align`,Sb=`${_e}.align.left`,Rb=`${_e}.align.center`,Eb=`${_e}.align.right`,Tb=`${_e}.align.justify`,_b=`${_e}.align.top`,Mb=`${_e}.align.middle`,Ib=`${_e}.align.bottom`,Pb=`${_e}.borders`,Ob=`${_e}.borders.top`,xb=`${_e}.borders.right`,Ab=`${_e}.borders.bottom`,Hb=`${_e}.borders.left`,Nb=`${_e}.borders.remove`,Db=`${_e}.nestedHeaders.insertChildRow`,kb=`${_e}.nestedHeaders.detachFromParent`,Lb=`${_e}.hideColumn`,$b=`${_e}.showColumn`,Fb=`${_e}.hideRow`,Vb=`${_e}.showRow`,jn="Filters:",Ht=`${jn}conditions`,Uf=`${Ht}.none`,Wb=`${Ht}.isEmpty`,Bb=`${Ht}.isNotEmpty`,jb=`${Ht}.isEqualTo`,Ub=`${Ht}.isNotEqualTo`,zb=`${Ht}.beginsWith`,Yb=`${Ht}.endsWith`,Gb=`${Ht}.contains`,qb=`${Ht}.doesNotContain`,XG=`${Ht}.byValue`,Kb=`${Ht}.greaterThan`,Xb=`${Ht}.greaterThanOrEqualTo`,Zb=`${Ht}.lessThan`,Qb=`${Ht}.lessThanOrEqualTo`,Jb=`${Ht}.isBetween`,eS=`${Ht}.isNotBetween`,tS=`${Ht}.after`,nS=`${Ht}.before`,rS=`${Ht}.today`,iS=`${Ht}.tomorrow`,oS=`${Ht}.yesterday`,sS=`${jn}labels.filterByCondition`,aS=`${jn}labels.filterByValue`,lS=`${jn}labels.conjunction`,zf=`${jn}labels.disjunction`,Yf=`${jn}values.blankCells`,uS=`${jn}buttons.selectAll`,cS=`${jn}buttons.clear`,hS=`${jn}buttons.ok`,dS=`${jn}buttons.cancel`,fS=`${jn}buttons.placeholder.search`,gS=`${jn}buttons.placeholder.value`,mS=`${jn}buttons.placeholder.secondValue`,pS="CheckboxRenderer:",wS=`${pS}checked`,vS=`${pS}unchecked`,ZG=Object.freeze(Object.defineProperty({__proto__:null,CHECKBOX_CHECKED:wS,CHECKBOX_RENDERER_NAMESPACE:pS,CHECKBOX_UNCHECKED:vS,CONTEXTMENU_ITEMS_ADD_COMMENT:wb,CONTEXTMENU_ITEMS_ALIGNMENT:bb,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:Ib,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:Rb,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:Tb,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:Sb,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:Mb,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:Eb,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:_b,CONTEXTMENU_ITEMS_BORDERS:Pb,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:Ab,CONTEXTMENU_ITEMS_BORDERS_LEFT:Hb,CONTEXTMENU_ITEMS_BORDERS_RIGHT:xb,CONTEXTMENU_ITEMS_BORDERS_TOP:Ob,CONTEXTMENU_ITEMS_CLEAR_COLUMN:ab,CONTEXTMENU_ITEMS_COPY:lb,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:hb,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:cb,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:ub,CONTEXTMENU_ITEMS_CUT:db,CONTEXTMENU_ITEMS_EDIT_COMMENT:vb,CONTEXTMENU_ITEMS_FREEZE_COLUMN:fb,CONTEXTMENU_ITEMS_HIDE_COLUMN:Lb,CONTEXTMENU_ITEMS_HIDE_ROW:Fb,CONTEXTMENU_ITEMS_INSERT_LEFT:tb,CONTEXTMENU_ITEMS_INSERT_RIGHT:nb,CONTEXTMENU_ITEMS_MERGE_CELLS:mb,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:kb,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:Db,CONTEXTMENU_ITEMS_NO_ITEMS:Qy,CONTEXTMENU_ITEMS_READ_ONLY:jf,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:yb,CONTEXTMENU_ITEMS_REDO:sb,CONTEXTMENU_ITEMS_REMOVE_BORDERS:Nb,CONTEXTMENU_ITEMS_REMOVE_COLUMN:ib,CONTEXTMENU_ITEMS_REMOVE_COMMENT:Cb,CONTEXTMENU_ITEMS_REMOVE_ROW:rb,CONTEXTMENU_ITEMS_ROW_ABOVE:Jy,CONTEXTMENU_ITEMS_ROW_BELOW:eb,CONTEXTMENU_ITEMS_SHOW_COLUMN:$b,CONTEXTMENU_ITEMS_SHOW_ROW:Vb,CONTEXTMENU_ITEMS_UNDO:ob,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:gb,CONTEXTMENU_ITEMS_UNMERGE_CELLS:pb,CONTEXT_MENU_ITEMS_NAMESPACE:vA,FILTERS_BUTTONS_CANCEL:dS,FILTERS_BUTTONS_CLEAR:cS,FILTERS_BUTTONS_OK:hS,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:fS,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:mS,FILTERS_BUTTONS_PLACEHOLDER_VALUE:gS,FILTERS_BUTTONS_SELECT_ALL:uS,FILTERS_CONDITIONS_AFTER:tS,FILTERS_CONDITIONS_BEFORE:nS,FILTERS_CONDITIONS_BEGINS_WITH:zb,FILTERS_CONDITIONS_BETWEEN:Jb,FILTERS_CONDITIONS_BY_VALUE:XG,FILTERS_CONDITIONS_CONTAINS:Gb,FILTERS_CONDITIONS_EMPTY:Wb,FILTERS_CONDITIONS_ENDS_WITH:Yb,FILTERS_CONDITIONS_EQUAL:jb,FILTERS_CONDITIONS_GREATER_THAN:Kb,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:Xb,FILTERS_CONDITIONS_LESS_THAN:Zb,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:Qb,FILTERS_CONDITIONS_NAMESPACE:Ht,FILTERS_CONDITIONS_NONE:Uf,FILTERS_CONDITIONS_NOT_BETWEEN:eS,FILTERS_CONDITIONS_NOT_CONTAIN:qb,FILTERS_CONDITIONS_NOT_EMPTY:Bb,FILTERS_CONDITIONS_NOT_EQUAL:Ub,FILTERS_CONDITIONS_TODAY:rS,FILTERS_CONDITIONS_TOMORROW:iS,FILTERS_CONDITIONS_YESTERDAY:oS,FILTERS_DIVS_FILTER_BY_CONDITION:sS,FILTERS_DIVS_FILTER_BY_VALUE:aS,FILTERS_LABELS_CONJUNCTION:lS,FILTERS_LABELS_DISJUNCTION:zf,FILTERS_NAMESPACE:jn,FILTERS_VALUES_BLANK_CELLS:Yf},Symbol.toStringTag,{value:"Module"})),CA=new WeakMap,yA=new WeakMap,QG="htBadValue",Jl="data-row",eu="data-col",JG="checkboxRenderer",bA="checkbox";re.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,n){const{label:r,type:i,row:o,column:s,prop:a}=e;if(i===bA){if(r){const{value:l,property:u}=r;let c=n;if(l)c=typeof l=="function"?l(o,s,a,n):l;else if(u){const h=this.getDataAtRowProp(o,u);c=h!==null?h:n}t=c}return t}});function CS(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=t.getSettings().ariaTags;Uc.apply(this,[t,e,n,r,i,o,s]),e2(t);let u=t2(a);const c=s.label;let h=!1;if(typeof s.checkedTemplate>"u"&&(s.checkedTemplate=!0),typeof s.uncheckedTemplate>"u"&&(s.uncheckedTemplate=!1),No(e),o===s.checkedTemplate||xt(o).toLocaleLowerCase(s.locale)===xt(s.checkedTemplate).toLocaleLowerCase(s.locale)?u.checked=!0:o===s.uncheckedTemplate||xt(o).toLocaleLowerCase(s.locale)===xt(s.uncheckedTemplate).toLocaleLowerCase(s.locale)?u.checked=!1:Bt(o)?X(u,"noValue"):(u.style.display="none",X(u,QG),h=!0),Se(u,[[Jl,n],[eu,r]]),l&&Se(u,[Fc(u.checked?t.getTranslatedPhrase(wS):t.getTranslatedPhrase(vS)),JO(u.checked),oz()]),!h&&c){let b="";if(c.value)b=typeof c.value=="function"?c.value.call(this,n,r,i,o):c.value;else if(c.property){const E=t.getDataAtRowProp(n,c.property);b=E!==null?E:""}const S=n2(a,b,c.separated!==!0);c.position==="before"?c.separated?(e.appendChild(S),e.appendChild(u)):(S.appendChild(u),u=S):(!c.position||c.position==="after")&&(c.separated?(e.appendChild(u),e.appendChild(S)):(S.insertBefore(u,S.firstChild),u=S))}(!c||c&&!c.separated)&&e.appendChild(u),h&&e.appendChild(a.createTextNode("#bad-value#")),CA.has(t)||(CA.set(t,!0),d());function d(){const S=t.getShortcutManager().getContext("grid"),E={group:JG,relativeToGroup:Ss,position:"before"};S.addShortcuts([{keys:[["space"]],callback:()=>(f(),!m()),runOnlyIf:()=>{var v;return(v=t.getSelectedRangeLast())===null||v===void 0?void 0:v.highlight.isCell()}},{keys:[["enter"]],callback:()=>(f(),!m()),runOnlyIf:()=>{const v=t.getSelectedRangeLast();return t.getSettings().enterBeginsEditing&&v?.highlight.isCell()&&!t.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(f(!0),!m()),runOnlyIf:()=>{var v;return(v=t.getSelectedRangeLast())===null||v===void 0?void 0:v.highlight.isCell()}}],E)}function f(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const S=t.getSelectedRange(),E=[],v=new Map;let I=[],M=0;if(S){for(let T=0;T<S.length;T++){const{row:P,col:D}=S[T].getTopStartCorner(),{row:K,col:Y}=S[T].getBottomEndCorner();for(let U=P;U<=K;U+=1)for(let J=D;J<=Y;J+=1){const ee=t.getCellMeta(U,J);if(ee.hidden)continue;const ae={checkedTemplate:ee.checkedTemplate,uncheckedTemplate:ee.uncheckedTemplate};if(ee.type!=="checkbox"){b===!0&&!ee.readOnly&&(v.has(E.length)?v.set(E.length,[...v.get(E.length),[U,J,null]]):v.set(E.length,[[U,J,null]]));continue}if(ee.readOnly===!0)continue;typeof ee.checkedTemplate>"u"&&(ee.checkedTemplate=!0),typeof ee.uncheckedTemplate>"u"&&(ee.uncheckedTemplate=!1);const ne=t.getDataAtCell(U,J);b===!1?[ee.checkedTemplate,ee.checkedTemplate.toString()].includes(ne)?I.push([U,J,ee.uncheckedTemplate,ae]):[ee.uncheckedTemplate,ee.uncheckedTemplate.toString(),null,void 0].includes(ne)&&I.push([U,J,ee.checkedTemplate,ae]):I.push([U,J,ee.uncheckedTemplate,ae]),M+=1}E.push(M),M=0}I.every(T=>{let[,,P]=T;return P===I[0][2]})?I=I.map(T=>{let[P,D,K]=T;return[P,D,K]}):I=I.map(T=>{let[P,D,,K]=T;return[P,D,K.checkedTemplate]}),I.length>0&&E.forEach((T,P)=>{let D=I.splice(0,T);v.size&&v.has(P)&&(D=[...D,...v.get(P)]),t.setDataAtCell(D)})}}function m(){const b=t.getSelectedRange();if(b){for(let S=0;S<b.length;S++){const E=b[S].getTopStartCorner(),v=b[S].getBottomEndCorner();for(let I=E.row;I<=v.row;I++)for(let M=E.col;M<=v.col;M++){if(t.getCellMeta(I,M).readOnly)continue;const P=t.getCell(I,M);if(Do(P)&&P.querySelectorAll("input[type=checkbox]").length>0)return!0}}return!1}}}CS.RENDERER_TYPE=bA;function e2(t){let e=yA.get(t);if(!e){const{rootElement:n}=t;e=new gi(t),e.addEventListener(n,"click",r=>i2(r,t)),e.addEventListener(n,"mouseup",r=>r2(r,t)),e.addEventListener(n,"change",r=>o2(r,t)),yA.set(t,e)}return e}function t2(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function n2(t,e,n){const r=t.createElement("label");r.className=`htCheckboxRendererLabel ${n?"fullWidth":""}`;const i=t.createTextNode(e);if(n){const o=t.createElement("span");o.appendChild(i),r.appendChild(o)}else r.appendChild(i);return r.cloneNode(!0)}function r2(t,e){const{target:n}=t;yS(n)&&(!n.hasAttribute(Jl)||!n.hasAttribute(eu)||setTimeout(e.listen,10))}function i2(t,e){const{target:n}=t;if(!yS(n)||!n.hasAttribute(Jl)||!n.hasAttribute(eu))return;const r=parseInt(n.getAttribute(Jl),10),i=parseInt(n.getAttribute(eu),10);e.getCellMeta(r,i).readOnly&&t.preventDefault()}function o2(t,e){const{target:n}=t;if(!yS(n)||!n.hasAttribute(Jl)||!n.hasAttribute(eu))return;const r=parseInt(n.getAttribute(Jl),10),i=parseInt(n.getAttribute(eu),10),o=e.getCellMeta(r,i);if(!o.readOnly){let s=null;t.target.checked?s=o.uncheckedTemplate===void 0?!0:o.checkedTemplate:s=o.uncheckedTemplate===void 0?!1:o.uncheckedTemplate,e.setDataAtCell(r,i,s)}}function yS(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const s2="handsontable";function bS(t,e,n,r,i,o,s){Ql.apply(this,[t,e,n,r,i,o,s])}bS.RENDERER_TYPE=s2;var a2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function l2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var SS,SA;function u2(){return SA||(SA=1,SS={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(t){let e=t%10;return~~(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),SS}var RS,RA;function EA(){if(RA)return RS;RA=1;const t=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function e(l){return l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(l,u,c,h,d,f,m){if(!isNaN(+l))return+l;let b="",S=l.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(S!==l)return-1*n(S,u,c,h,d,f);for(let P=0;P<t.length;P++){let D=t[P];if(b=l.replace(RegExp(`([0-9 ])(${D.key})$`),"$1"),b!==l)return n(b,u,c,h,d,f)*D.factor}if(b=l.replace("%",""),b!==l)return n(b,u,c,h,d,f)/100;let E=parseFloat(l);if(isNaN(E))return;let v=h(E);if(v&&v!=="."&&(b=l.replace(new RegExp(`${e(v)}$`),""),b!==l))return n(b,u,c,h,d,f);let I={};Object.keys(f).forEach(P=>{I[f[P]]=P});let M=Object.keys(I).sort().reverse(),T=M.length;for(let P=0;P<T;P++){let D=M[P],K=I[D];if(b=l.replace(D,""),b!==l){let Y;switch(K){case"thousand":Y=Math.pow(10,3);break;case"million":Y=Math.pow(10,6);break;case"billion":Y=Math.pow(10,9);break;case"trillion":Y=Math.pow(10,12);break}return n(b,u,c,h,d,f)*Y}}}function r(l,u,c){let h=l.replace(c,"");return h=h.replace(new RegExp(`([0-9])${e(u.thousands)}([0-9])`,"g"),"$1$2"),h=h.replace(u.decimal,"."),h}function i(l,u,c="",h,d,f,m){if(l==="")return;if(l===d)return 0;let b=r(l,u,c);return n(b,u,c,h,d,f)}function o(l,u){if(!(l.indexOf(":")&&u.thousands!==":"))return!1;let h=l.split(":");if(h.length!==3)return!1;let d=+h[0],f=+h[1],m=+h[2];return!isNaN(d)&&!isNaN(f)&&!isNaN(m)}function s(l){let u=l.split(":"),c=+u[0],h=+u[1];return+u[2]+60*h+3600*c}function a(l,u){const c=IS();let h=c.currentDelimiters(),d=c.currentCurrency().symbol,f=c.currentOrdinal(),m=c.getZeroFormat(),b=c.currentAbbreviations(),S;if(typeof l=="string")o(l,h)?S=s(l):S=i(l,h,d,f,m,b);else if(typeof l=="number")S=l;else return;if(S!==void 0)return S}return RS={unformat:a},RS}var ES,TA;function TS(){if(TA)return ES;TA=1;let t=EA();const e=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,n=["currency","percent","byte","time","ordinal","number"],r=["trillion","billion","million","thousand"],i=["prefix","infix","postfix"],o=["sign","parenthesis"],s={type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},u={output:{type:"string",validValues:n},base:{type:"string",validValues:["decimal","binary","general"],restriction:(S,E)=>E.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:S=>S.output==="byte"},characteristic:{type:"number",restriction:S=>S>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:r},average:"boolean",lowPrecision:{type:"boolean",restriction:(S,E)=>E.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:i},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:S=>S>=0,message:"value must be positive"},{restriction:(S,E)=>!E.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:S=>S>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:o},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(S,E)=>E.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},c={languageTag:{type:"string",mandatory:!0,restriction:S=>S.match(e),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:s,spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function h(S,E){let v=d(S),I=m(E);return v&&I}function d(S){return t.unformat(S)!==void 0}function f(S,E,v,I=!1){let M=Object.keys(S).map(T=>{if(!E[T])return console.error(`${v} Invalid key: ${T}`),!1;let P=S[T],D=E[T];if(typeof D=="string"&&(D={type:D}),D.type==="format"){if(!f(P,u,`[Validate ${T}]`,!0))return!1}else if(typeof P!==D.type)return console.error(`${v} ${T} type mismatched: "${D.type}" expected, "${typeof P}" provided`),!1;if(D.restrictions&&D.restrictions.length){let K=D.restrictions.length;for(let Y=0;Y<K;Y++){let{restriction:U,message:J}=D.restrictions[Y];if(!U(P,S))return console.error(`${v} ${T} invalid value: ${J}`),!1}}return D.restriction&&!D.restriction(P,S)?(console.error(`${v} ${T} invalid value: ${D.message}`),!1):D.validValues&&D.validValues.indexOf(P)===-1?(console.error(`${v} ${T} invalid value: must be among ${JSON.stringify(D.validValues)}, "${P}" provided`),!1):!(D.children&&!f(P,D.children,`[Validate ${T}]`))});return I||M.push(...Object.keys(E).map(T=>{let P=E[T];if(typeof P=="string"&&(P={type:P}),P.mandatory){let D=P.mandatory;if(typeof D=="function"&&(D=D(S)),D&&S[T]===void 0)return console.error(`${v} Missing mandatory key "${T}"`),!1}return!0})),M.reduce((T,P)=>T&&P,!0)}function m(S){return f(S,u,"[Validate format]")}function b(S){return f(S,c,"[Validate language]")}return ES={validate:h,validateFormat:m,validateInput:d,validateLanguage:b},ES}function c2(t,e){let n=t.match(/^{([^}]*)}/);return n?(e.prefix=n[1],t.slice(n[0].length)):t}function h2(t,e){let n=t.match(/{([^}]*)}$/);return n?(e.postfix=n[1],t.slice(0,-n[0].length)):t}function d2(t,e){if(t.indexOf("$")!==-1){e.output="currency";return}if(t.indexOf("%")!==-1){e.output="percent";return}if(t.indexOf("bd")!==-1){e.output="byte",e.base="general";return}if(t.indexOf("b")!==-1){e.output="byte",e.base="binary";return}if(t.indexOf("d")!==-1){e.output="byte",e.base="decimal";return}if(t.indexOf(":")!==-1){e.output="time";return}t.indexOf("o")!==-1&&(e.output="ordinal")}function f2(t,e){t.indexOf(",")!==-1&&(e.thousandSeparated=!0)}function g2(t,e){t.indexOf(" ")!==-1&&(e.spaceSeparated=!0,e.spaceSeparatedCurrency=!0,(e.average||e.forceAverage)&&(e.spaceSeparatedAbbreviation=!0))}function m2(t,e){let n=t.match(/[1-9]+[0-9]*/);n&&(e.totalLength=+n[0])}function p2(t,e){let r=t.split(".")[0].match(/0+/);r&&(e.characteristic=r[0].length)}function w2(t,e){let n=t.split(".")[1];if(n){let r=n.match(/0+/);r&&(e.mantissa=r[0].length)}}function v2(t,e){const n=t.split(".")[1];n&&(e.trimMantissa=n.indexOf("[")!==-1)}function C2(t,e){t.indexOf("a")!==-1&&(e.average=!0)}function y2(t,e){t.indexOf("K")!==-1?e.forceAverage="thousand":t.indexOf("M")!==-1?e.forceAverage="million":t.indexOf("B")!==-1?e.forceAverage="billion":t.indexOf("T")!==-1&&(e.forceAverage="trillion")}function b2(t,e){t.match(/\[\.]/)?e.optionalMantissa=!0:t.match(/\./)&&(e.optionalMantissa=!1)}function S2(t,e){if(t.indexOf(".")!==-1){let n=t.split(".")[0];e.optionalCharacteristic=n.indexOf("0")===-1}}function R2(t,e){t.match(/^\+?\([^)]*\)$/)&&(e.negative="parenthesis"),t.match(/^\+?-/)&&(e.negative="sign")}function E2(t,e){t.match(/^\+/)&&(e.forceSign=!0)}function T2(t,e={}){return typeof t!="string"?t:(t=c2(t,e),t=h2(t,e),d2(t,e),m2(t,e),p2(t,e),S2(t,e),C2(t,e),y2(t,e),w2(t,e),b2(t,e),v2(t,e),f2(t,e),g2(t,e),R2(t,e),E2(t,e),e)}var _S={parseFormat:T2};var MS,_A;function IS(){if(_A)return MS;_A=1;const t=u2(),e=TS(),n=_S;let r={},i,o={},s=null,a={};function l(c){i=c}function u(){return o[i]}return r.languages=()=>Object.assign({},o),r.currentLanguage=()=>i,r.currentBytes=()=>u().bytes||{},r.currentCurrency=()=>u().currency,r.currentAbbreviations=()=>u().abbreviations,r.currentDelimiters=()=>u().delimiters,r.currentOrdinal=()=>u().ordinal,r.currentDefaults=()=>Object.assign({},u().defaults,a),r.currentOrdinalDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().ordinalFormat),r.currentByteDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().byteFormat),r.currentPercentageDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().percentageFormat),r.currentCurrencyDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().currencyFormat),r.currentTimeDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().timeFormat),r.setDefaults=c=>{c=n.parseFormat(c),e.validateFormat(c)&&(a=c)},r.getZeroFormat=()=>s,r.setZeroFormat=c=>s=typeof c=="string"?c:null,r.hasZeroFormat=()=>s!==null,r.languageData=c=>{if(c){if(o[c])return o[c];throw new Error(`Unknown tag "${c}"`)}return u()},r.registerLanguage=(c,h=!1)=>{if(!e.validateLanguage(c))throw new Error("Invalid language data");o[c.languageTag]=c,h&&l(c.languageTag)},r.setLanguage=(c,h=t.languageTag)=>{if(!o[c]){let d=c.split("-")[0],f=Object.keys(o).find(m=>m.split("-")[0]===d);if(!o[f]){l(h);return}l(f);return}l(c)},r.registerLanguage(t),i=t.languageTag,MS=r,MS}function _2(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function M2(t,e){t.forEach(n=>{let r;try{r=_2(`../languages/${n}`)}catch{console.error(`Unable to load "${n}". No matching language file found.`)}r&&e.registerLanguage(r)})}var I2=t=>({loadLanguagesInNode:e=>M2(e,t)}),MA={exports:{}};(function(t){(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,s="[BigNumber Error] ",a=s+"Number primitive has more than 15 significant digits: ",l=1e14,u=14,c=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,f=1e9;function m(P){var D,K,Y,U=p.prototype={constructor:p,toString:null,valueOf:null},J=new p(1),ee=20,ae=4,ne=-7,se=21,ft=-1e7,pe=1e7,Ee=!1,gt=1,Wt=0,q={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},g="0123456789abcdefghijklmnopqrstuvwxyz",w=!0;function p(y,R){var C,N,O,L,j,k,F,B,V=this;if(!(V instanceof p))return new p(y,R);if(R==null){if(y&&y._isBigNumber===!0){V.s=y.s,!y.c||y.e>pe?V.c=V.e=null:y.e<ft?V.c=[V.e=0]:(V.e=y.e,V.c=y.c.slice());return}if((k=typeof y=="number")&&y*0==0){if(V.s=1/y<0?(y=-y,-1):1,y===~~y){for(L=0,j=y;j>=10;j/=10,L++);L>pe?V.c=V.e=null:(V.e=L,V.c=[y]);return}B=String(y)}else{if(!r.test(B=String(y)))return Y(V,B,k);V.s=B.charCodeAt(0)==45?(B=B.slice(1),-1):1}(L=B.indexOf("."))>-1&&(B=B.replace(".","")),(j=B.search(/e/i))>0?(L<0&&(L=j),L+=+B.slice(j+1),B=B.substring(0,j)):L<0&&(L=B.length)}else{if(v(R,2,g.length,"Base"),R==10&&w)return V=new p(y),W(V,ee+V.e+1,ae);if(B=String(y),k=typeof y=="number"){if(y*0!=0)return Y(V,B,k,R);if(V.s=1/y<0?(B=B.slice(1),-1):1,p.DEBUG&&B.replace(/^0\.0*|\./,"").length>15)throw Error(a+y)}else V.s=B.charCodeAt(0)===45?(B=B.slice(1),-1):1;for(C=g.slice(0,R),L=j=0,F=B.length;j<F;j++)if(C.indexOf(N=B.charAt(j))<0){if(N=="."){if(j>L){L=F;continue}}else if(!O&&(B==B.toUpperCase()&&(B=B.toLowerCase())||B==B.toLowerCase()&&(B=B.toUpperCase()))){O=!0,j=-1,L=0;continue}return Y(V,String(y),k,R)}k=!1,B=K(B,R,10,V.s),(L=B.indexOf("."))>-1?B=B.replace(".",""):L=B.length}for(j=0;B.charCodeAt(j)===48;j++);for(F=B.length;B.charCodeAt(--F)===48;);if(B=B.slice(j,++F)){if(F-=j,k&&p.DEBUG&&F>15&&(y>c||y!==o(y)))throw Error(a+V.s*y);if((L=L-j-1)>pe)V.c=V.e=null;else if(L<ft)V.c=[V.e=0];else{if(V.e=L,V.c=[],j=(L+1)%u,L<0&&(j+=u),j<F){for(j&&V.c.push(+B.slice(0,j)),F-=u;j<F;)V.c.push(+B.slice(j,j+=u));j=u-(B=B.slice(j)).length}else j-=F;for(;j--;B+="0");V.c.push(+B)}}else V.c=[V.e=0]}p.clone=m,p.ROUND_UP=0,p.ROUND_DOWN=1,p.ROUND_CEIL=2,p.ROUND_FLOOR=3,p.ROUND_HALF_UP=4,p.ROUND_HALF_DOWN=5,p.ROUND_HALF_EVEN=6,p.ROUND_HALF_CEIL=7,p.ROUND_HALF_FLOOR=8,p.EUCLID=9,p.config=p.set=function(y){var R,C;if(y!=null)if(typeof y=="object"){if(y.hasOwnProperty(R="DECIMAL_PLACES")&&(C=y[R],v(C,0,f,R),ee=C),y.hasOwnProperty(R="ROUNDING_MODE")&&(C=y[R],v(C,0,8,R),ae=C),y.hasOwnProperty(R="EXPONENTIAL_AT")&&(C=y[R],C&&C.pop?(v(C[0],-f,0,R),v(C[1],0,f,R),ne=C[0],se=C[1]):(v(C,-f,f,R),ne=-(se=C<0?-C:C))),y.hasOwnProperty(R="RANGE"))if(C=y[R],C&&C.pop)v(C[0],-f,-1,R),v(C[1],1,f,R),ft=C[0],pe=C[1];else if(v(C,-f,f,R),C)ft=-(pe=C<0?-C:C);else throw Error(s+R+" cannot be zero: "+C);if(y.hasOwnProperty(R="CRYPTO"))if(C=y[R],C===!!C)if(C)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))Ee=C;else throw Ee=!C,Error(s+"crypto unavailable");else Ee=C;else throw Error(s+R+" not true or false: "+C);if(y.hasOwnProperty(R="MODULO_MODE")&&(C=y[R],v(C,0,9,R),gt=C),y.hasOwnProperty(R="POW_PRECISION")&&(C=y[R],v(C,0,f,R),Wt=C),y.hasOwnProperty(R="FORMAT"))if(C=y[R],typeof C=="object")q=C;else throw Error(s+R+" not an object: "+C);if(y.hasOwnProperty(R="ALPHABET"))if(C=y[R],typeof C=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(C))w=C.slice(0,10)=="0123456789",g=C;else throw Error(s+R+" invalid: "+C)}else throw Error(s+"Object expected: "+y);return{DECIMAL_PLACES:ee,ROUNDING_MODE:ae,EXPONENTIAL_AT:[ne,se],RANGE:[ft,pe],CRYPTO:Ee,MODULO_MODE:gt,POW_PRECISION:Wt,FORMAT:q,ALPHABET:g}},p.isBigNumber=function(y){if(!y||y._isBigNumber!==!0)return!1;if(!p.DEBUG)return!0;var R,C,N=y.c,O=y.e,L=y.s;e:if({}.toString.call(N)=="[object Array]"){if((L===1||L===-1)&&O>=-f&&O<=f&&O===o(O)){if(N[0]===0){if(O===0&&N.length===1)return!0;break e}if(R=(O+1)%u,R<1&&(R+=u),String(N[0]).length==R){for(R=0;R<N.length;R++)if(C=N[R],C<0||C>=l||C!==o(C))break e;if(C!==0)return!0}}}else if(N===null&&O===null&&(L===null||L===1||L===-1))return!0;throw Error(s+"Invalid BigNumber: "+y)},p.maximum=p.max=function(){return A(arguments,-1)},p.minimum=p.min=function(){return A(arguments,1)},p.random=(function(){var y=9007199254740992,R=Math.random()*y&2097151?function(){return o(Math.random()*y)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(C){var N,O,L,j,k,F=0,B=[],V=new p(J);if(C==null?C=ee:v(C,0,f),j=i(C/u),Ee)if(crypto.getRandomValues){for(N=crypto.getRandomValues(new Uint32Array(j*=2));F<j;)k=N[F]*131072+(N[F+1]>>>11),k>=9e15?(O=crypto.getRandomValues(new Uint32Array(2)),N[F]=O[0],N[F+1]=O[1]):(B.push(k%1e14),F+=2);F=j/2}else if(crypto.randomBytes){for(N=crypto.randomBytes(j*=7);F<j;)k=(N[F]&31)*281474976710656+N[F+1]*1099511627776+N[F+2]*4294967296+N[F+3]*16777216+(N[F+4]<<16)+(N[F+5]<<8)+N[F+6],k>=9e15?crypto.randomBytes(7).copy(N,F):(B.push(k%1e14),F+=7);F=j/7}else throw Ee=!1,Error(s+"crypto unavailable");if(!Ee)for(;F<j;)k=R(),k<9e15&&(B[F++]=k%1e14);for(j=B[--F],C%=u,j&&C&&(k=h[u-C],B[F]=o(j/k)*k);B[F]===0;B.pop(),F--);if(F<0)B=[L=0];else{for(L=-1;B[0]===0;B.splice(0,1),L-=u);for(F=1,k=B[0];k>=10;k/=10,F++);F<u&&(L-=u-F)}return V.e=L,V.c=B,V}})(),p.sum=function(){for(var y=1,R=arguments,C=new p(R[0]);y<R.length;)C=C.plus(R[y++]);return C},K=(function(){var y="0123456789";function R(C,N,O,L){for(var j,k=[0],F,B=0,V=C.length;B<V;){for(F=k.length;F--;k[F]*=N);for(k[0]+=L.indexOf(C.charAt(B++)),j=0;j<k.length;j++)k[j]>O-1&&(k[j+1]==null&&(k[j+1]=0),k[j+1]+=k[j]/O|0,k[j]%=O)}return k.reverse()}return function(C,N,O,L,j){var k,F,B,V,G,le,de,Pe,$e=C.indexOf("."),Ue=ee,be=ae;for($e>=0&&(V=Wt,Wt=0,C=C.replace(".",""),Pe=new p(N),le=Pe.pow(C.length-$e),Wt=V,Pe.c=R(T(S(le.c),le.e,"0"),10,O,y),Pe.e=Pe.c.length),de=R(C,N,O,j?(k=g,y):(k=y,g)),B=V=de.length;de[--V]==0;de.pop());if(!de[0])return k.charAt(0);if($e<0?--B:(le.c=de,le.e=B,le.s=L,le=D(le,Pe,Ue,be,O),de=le.c,G=le.r,B=le.e),F=B+Ue+1,$e=de[F],V=O/2,G=G||F<0||de[F+1]!=null,G=be<4?($e!=null||G)&&(be==0||be==(le.s<0?3:2)):$e>V||$e==V&&(be==4||G||be==6&&de[F-1]&1||be==(le.s<0?8:7)),F<1||!de[0])C=G?T(k.charAt(1),-Ue,k.charAt(0)):k.charAt(0);else{if(de.length=F,G)for(--O;++de[--F]>O;)de[F]=0,F||(++B,de=[1].concat(de));for(V=de.length;!de[--V];);for($e=0,C="";$e<=V;C+=k.charAt(de[$e++]));C=T(C,B,k.charAt(0))}return C}})(),D=(function(){function y(N,O,L){var j,k,F,B,V=0,G=N.length,le=O%d,de=O/d|0;for(N=N.slice();G--;)F=N[G]%d,B=N[G]/d|0,j=de*F+B*le,k=le*F+j%d*d+V,V=(k/L|0)+(j/d|0)+de*B,N[G]=k%L;return V&&(N=[V].concat(N)),N}function R(N,O,L,j){var k,F;if(L!=j)F=L>j?1:-1;else for(k=F=0;k<L;k++)if(N[k]!=O[k]){F=N[k]>O[k]?1:-1;break}return F}function C(N,O,L,j){for(var k=0;L--;)N[L]-=k,k=N[L]<O[L]?1:0,N[L]=k*j+N[L]-O[L];for(;!N[0]&&N.length>1;N.splice(0,1));}return function(N,O,L,j,k){var F,B,V,G,le,de,Pe,$e,Ue,be,Fe,It,yo,bo,So,Pt,Qn,ut=N.s==O.s?1:-1,wt=N.c,We=O.c;if(!wt||!wt[0]||!We||!We[0])return new p(!N.s||!O.s||(wt?We&&wt[0]==We[0]:!We)?NaN:wt&&wt[0]==0||!We?ut*0:ut/0);for($e=new p(ut),Ue=$e.c=[],B=N.e-O.e,ut=L+B+1,k||(k=l,B=b(N.e/u)-b(O.e/u),ut=ut/u|0),V=0;We[V]==(wt[V]||0);V++);if(We[V]>(wt[V]||0)&&B--,ut<0)Ue.push(1),G=!0;else{for(bo=wt.length,Pt=We.length,V=0,ut+=2,le=o(k/(We[0]+1)),le>1&&(We=y(We,le,k),wt=y(wt,le,k),Pt=We.length,bo=wt.length),yo=Pt,be=wt.slice(0,Pt),Fe=be.length;Fe<Pt;be[Fe++]=0);Qn=We.slice(),Qn=[0].concat(Qn),So=We[0],We[1]>=k/2&&So++;do{if(le=0,F=R(We,be,Pt,Fe),F<0){if(It=be[0],Pt!=Fe&&(It=It*k+(be[1]||0)),le=o(It/So),le>1)for(le>=k&&(le=k-1),de=y(We,le,k),Pe=de.length,Fe=be.length;R(de,be,Pe,Fe)==1;)le--,C(de,Pt<Pe?Qn:We,Pe,k),Pe=de.length,F=1;else le==0&&(F=le=1),de=We.slice(),Pe=de.length;if(Pe<Fe&&(de=[0].concat(de)),C(be,de,Fe,k),Fe=be.length,F==-1)for(;R(We,be,Pt,Fe)<1;)le++,C(be,Pt<Fe?Qn:We,Fe,k),Fe=be.length}else F===0&&(le++,be=[0]);Ue[V++]=le,be[0]?be[Fe++]=wt[yo]||0:(be=[wt[yo]],Fe=1)}while((yo++<bo||be[0]!=null)&&ut--);G=be[0]!=null,Ue[0]||Ue.splice(0,1)}if(k==l){for(V=1,ut=Ue[0];ut>=10;ut/=10,V++);W($e,L+($e.e=V+B*u-1)+1,j,G)}else $e.e=B,$e.r=+G;return $e}})();function _(y,R,C,N){var O,L,j,k,F;if(C==null?C=ae:v(C,0,8),!y.c)return y.toString();if(O=y.c[0],j=y.e,R==null)F=S(y.c),F=N==1||N==2&&(j<=ne||j>=se)?M(F,j):T(F,j,"0");else if(y=W(new p(y),R,C),L=y.e,F=S(y.c),k=F.length,N==1||N==2&&(R<=L||L<=ne)){for(;k<R;F+="0",k++);F=M(F,L)}else if(R-=j,F=T(F,L,"0"),L+1>k){if(--R>0)for(F+=".";R--;F+="0");}else if(R+=L-k,R>0)for(L+1==k&&(F+=".");R--;F+="0");return y.s<0&&O?"-"+F:F}function A(y,R){for(var C,N,O=1,L=new p(y[0]);O<y.length;O++)N=new p(y[O]),(!N.s||(C=E(L,N))===R||C===0&&L.s===R)&&(L=N);return L}function $(y,R,C){for(var N=1,O=R.length;!R[--O];R.pop());for(O=R[0];O>=10;O/=10,N++);return(C=N+C*u-1)>pe?y.c=y.e=null:C<ft?y.c=[y.e=0]:(y.e=C,y.c=R),y}Y=(function(){var y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,R=/^([^.]+)\.$/,C=/^\.([^.]+)$/,N=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(L,j,k,F){var B,V=k?j:j.replace(O,"");if(N.test(V))L.s=isNaN(V)?null:V<0?-1:1;else{if(!k&&(V=V.replace(y,function(G,le,de){return B=(de=de.toLowerCase())=="x"?16:de=="b"?2:8,!F||F==B?le:G}),F&&(B=F,V=V.replace(R,"$1").replace(C,"0.$1")),j!=V))return new p(V,B);if(p.DEBUG)throw Error(s+"Not a"+(F?" base "+F:"")+" number: "+j);L.s=null}L.c=L.e=null}})();function W(y,R,C,N){var O,L,j,k,F,B,V,G=y.c,le=h;if(G){e:{for(O=1,k=G[0];k>=10;k/=10,O++);if(L=R-O,L<0)L+=u,j=R,F=G[B=0],V=o(F/le[O-j-1]%10);else if(B=i((L+1)/u),B>=G.length)if(N){for(;G.length<=B;G.push(0));F=V=0,O=1,L%=u,j=L-u+1}else break e;else{for(F=k=G[B],O=1;k>=10;k/=10,O++);L%=u,j=L-u+O,V=j<0?0:o(F/le[O-j-1]%10)}if(N=N||R<0||G[B+1]!=null||(j<0?F:F%le[O-j-1]),N=C<4?(V||N)&&(C==0||C==(y.s<0?3:2)):V>5||V==5&&(C==4||N||C==6&&(L>0?j>0?F/le[O-j]:0:G[B-1])%10&1||C==(y.s<0?8:7)),R<1||!G[0])return G.length=0,N?(R-=y.e+1,G[0]=le[(u-R%u)%u],y.e=-R||0):G[0]=y.e=0,y;if(L==0?(G.length=B,k=1,B--):(G.length=B+1,k=le[u-L],G[B]=j>0?o(F/le[O-j]%le[j])*k:0),N)for(;;)if(B==0){for(L=1,j=G[0];j>=10;j/=10,L++);for(j=G[0]+=k,k=1;j>=10;j/=10,k++);L!=k&&(y.e++,G[0]==l&&(G[0]=1));break}else{if(G[B]+=k,G[B]!=l)break;G[B--]=0,k=1}for(L=G.length;G[--L]===0;G.pop());}y.e>pe?y.c=y.e=null:y.e<ft&&(y.c=[y.e=0])}return y}function z(y){var R,C=y.e;return C===null?y.toString():(R=S(y.c),R=C<=ne||C>=se?M(R,C):T(R,C,"0"),y.s<0?"-"+R:R)}return U.absoluteValue=U.abs=function(){var y=new p(this);return y.s<0&&(y.s=1),y},U.comparedTo=function(y,R){return E(this,new p(y,R))},U.decimalPlaces=U.dp=function(y,R){var C,N,O,L=this;if(y!=null)return v(y,0,f),R==null?R=ae:v(R,0,8),W(new p(L),y+L.e+1,R);if(!(C=L.c))return null;if(N=((O=C.length-1)-b(this.e/u))*u,O=C[O])for(;O%10==0;O/=10,N--);return N<0&&(N=0),N},U.dividedBy=U.div=function(y,R){return D(this,new p(y,R),ee,ae)},U.dividedToIntegerBy=U.idiv=function(y,R){return D(this,new p(y,R),0,1)},U.exponentiatedBy=U.pow=function(y,R){var C,N,O,L,j,k,F,B,V,G=this;if(y=new p(y),y.c&&!y.isInteger())throw Error(s+"Exponent not an integer: "+z(y));if(R!=null&&(R=new p(R)),k=y.e>14,!G.c||!G.c[0]||G.c[0]==1&&!G.e&&G.c.length==1||!y.c||!y.c[0])return V=new p(Math.pow(+z(G),k?y.s*(2-I(y)):+z(y))),R?V.mod(R):V;if(F=y.s<0,R){if(R.c?!R.c[0]:!R.s)return new p(NaN);N=!F&&G.isInteger()&&R.isInteger(),N&&(G=G.mod(R))}else{if(y.e>9&&(G.e>0||G.e<-1||(G.e==0?G.c[0]>1||k&&G.c[1]>=24e7:G.c[0]<8e13||k&&G.c[0]<=9999975e7)))return L=G.s<0&&I(y)?-0:0,G.e>-1&&(L=1/L),new p(F?1/L:L);Wt&&(L=i(Wt/u+2))}for(k?(C=new p(.5),F&&(y.s=1),B=I(y)):(O=Math.abs(+z(y)),B=O%2),V=new p(J);;){if(B){if(V=V.times(G),!V.c)break;L?V.c.length>L&&(V.c.length=L):N&&(V=V.mod(R))}if(O){if(O=o(O/2),O===0)break;B=O%2}else if(y=y.times(C),W(y,y.e+1,1),y.e>14)B=I(y);else{if(O=+z(y),O===0)break;B=O%2}G=G.times(G),L?G.c&&G.c.length>L&&(G.c.length=L):N&&(G=G.mod(R))}return N?V:(F&&(V=J.div(V)),R?V.mod(R):L?W(V,Wt,ae,j):V)},U.integerValue=function(y){var R=new p(this);return y==null?y=ae:v(y,0,8),W(R,R.e+1,y)},U.isEqualTo=U.eq=function(y,R){return E(this,new p(y,R))===0},U.isFinite=function(){return!!this.c},U.isGreaterThan=U.gt=function(y,R){return E(this,new p(y,R))>0},U.isGreaterThanOrEqualTo=U.gte=function(y,R){return(R=E(this,new p(y,R)))===1||R===0},U.isInteger=function(){return!!this.c&&b(this.e/u)>this.c.length-2},U.isLessThan=U.lt=function(y,R){return E(this,new p(y,R))<0},U.isLessThanOrEqualTo=U.lte=function(y,R){return(R=E(this,new p(y,R)))===-1||R===0},U.isNaN=function(){return!this.s},U.isNegative=function(){return this.s<0},U.isPositive=function(){return this.s>0},U.isZero=function(){return!!this.c&&this.c[0]==0},U.minus=function(y,R){var C,N,O,L,j=this,k=j.s;if(y=new p(y,R),R=y.s,!k||!R)return new p(NaN);if(k!=R)return y.s=-R,j.plus(y);var F=j.e/u,B=y.e/u,V=j.c,G=y.c;if(!F||!B){if(!V||!G)return V?(y.s=-R,y):new p(G?j:NaN);if(!V[0]||!G[0])return G[0]?(y.s=-R,y):new p(V[0]?j:ae==3?-0:0)}if(F=b(F),B=b(B),V=V.slice(),k=F-B){for((L=k<0)?(k=-k,O=V):(B=F,O=G),O.reverse(),R=k;R--;O.push(0));O.reverse()}else for(N=(L=(k=V.length)<(R=G.length))?k:R,k=R=0;R<N;R++)if(V[R]!=G[R]){L=V[R]<G[R];break}if(L&&(O=V,V=G,G=O,y.s=-y.s),R=(N=G.length)-(C=V.length),R>0)for(;R--;V[C++]=0);for(R=l-1;N>k;){if(V[--N]<G[N]){for(C=N;C&&!V[--C];V[C]=R);--V[C],V[N]+=l}V[N]-=G[N]}for(;V[0]==0;V.splice(0,1),--B);return V[0]?$(y,V,B):(y.s=ae==3?-1:1,y.c=[y.e=0],y)},U.modulo=U.mod=function(y,R){var C,N,O=this;return y=new p(y,R),!O.c||!y.s||y.c&&!y.c[0]?new p(NaN):!y.c||O.c&&!O.c[0]?new p(O):(gt==9?(N=y.s,y.s=1,C=D(O,y,0,3),y.s=N,C.s*=N):C=D(O,y,0,gt),y=O.minus(C.times(y)),!y.c[0]&&gt==1&&(y.s=O.s),y)},U.multipliedBy=U.times=function(y,R){var C,N,O,L,j,k,F,B,V,G,le,de,Pe,$e,Ue,be=this,Fe=be.c,It=(y=new p(y,R)).c;if(!Fe||!It||!Fe[0]||!It[0])return!be.s||!y.s||Fe&&!Fe[0]&&!It||It&&!It[0]&&!Fe?y.c=y.e=y.s=null:(y.s*=be.s,!Fe||!It?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(N=b(be.e/u)+b(y.e/u),y.s*=be.s,F=Fe.length,G=It.length,F<G&&(Pe=Fe,Fe=It,It=Pe,O=F,F=G,G=O),O=F+G,Pe=[];O--;Pe.push(0));for($e=l,Ue=d,O=G;--O>=0;){for(C=0,le=It[O]%Ue,de=It[O]/Ue|0,j=F,L=O+j;L>O;)B=Fe[--j]%Ue,V=Fe[j]/Ue|0,k=de*B+V*le,B=le*B+k%Ue*Ue+Pe[L]+C,C=(B/$e|0)+(k/Ue|0)+de*V,Pe[L--]=B%$e;Pe[L]=C}return C?++N:Pe.splice(0,1),$(y,Pe,N)},U.negated=function(){var y=new p(this);return y.s=-y.s||null,y},U.plus=function(y,R){var C,N=this,O=N.s;if(y=new p(y,R),R=y.s,!O||!R)return new p(NaN);if(O!=R)return y.s=-R,N.minus(y);var L=N.e/u,j=y.e/u,k=N.c,F=y.c;if(!L||!j){if(!k||!F)return new p(O/0);if(!k[0]||!F[0])return F[0]?y:new p(k[0]?N:O*0)}if(L=b(L),j=b(j),k=k.slice(),O=L-j){for(O>0?(j=L,C=F):(O=-O,C=k),C.reverse();O--;C.push(0));C.reverse()}for(O=k.length,R=F.length,O-R<0&&(C=F,F=k,k=C,R=O),O=0;R;)O=(k[--R]=k[R]+F[R]+O)/l|0,k[R]=l===k[R]?0:k[R]%l;return O&&(k=[O].concat(k),++j),$(y,k,j)},U.precision=U.sd=function(y,R){var C,N,O,L=this;if(y!=null&&y!==!!y)return v(y,1,f),R==null?R=ae:v(R,0,8),W(new p(L),y,R);if(!(C=L.c))return null;if(O=C.length-1,N=O*u+1,O=C[O]){for(;O%10==0;O/=10,N--);for(O=C[0];O>=10;O/=10,N++);}return y&&L.e+1>N&&(N=L.e+1),N},U.shiftedBy=function(y){return v(y,-c,c),this.times("1e"+y)},U.squareRoot=U.sqrt=function(){var y,R,C,N,O,L=this,j=L.c,k=L.s,F=L.e,B=ee+4,V=new p("0.5");if(k!==1||!j||!j[0])return new p(!k||k<0&&(!j||j[0])?NaN:j?L:1/0);if(k=Math.sqrt(+z(L)),k==0||k==1/0?(R=S(j),(R.length+F)%2==0&&(R+="0"),k=Math.sqrt(+R),F=b((F+1)/2)-(F<0||F%2),k==1/0?R="5e"+F:(R=k.toExponential(),R=R.slice(0,R.indexOf("e")+1)+F),C=new p(R)):C=new p(k+""),C.c[0]){for(F=C.e,k=F+B,k<3&&(k=0);;)if(O=C,C=V.times(O.plus(D(L,O,B,1))),S(O.c).slice(0,k)===(R=S(C.c)).slice(0,k))if(C.e<F&&--k,R=R.slice(k-3,k+1),R=="9999"||!N&&R=="4999"){if(!N&&(W(O,O.e+ee+2,0),O.times(O).eq(L))){C=O;break}B+=4,k+=4,N=1}else{(!+R||!+R.slice(1)&&R.charAt(0)=="5")&&(W(C,C.e+ee+2,1),y=!C.times(C).eq(L));break}}return W(C,C.e+ee+1,ae,y)},U.toExponential=function(y,R){return y!=null&&(v(y,0,f),y++),_(this,y,R,1)},U.toFixed=function(y,R){return y!=null&&(v(y,0,f),y=y+this.e+1),_(this,y,R)},U.toFormat=function(y,R,C){var N,O=this;if(C==null)y!=null&&R&&typeof R=="object"?(C=R,R=null):y&&typeof y=="object"?(C=y,y=R=null):C=q;else if(typeof C!="object")throw Error(s+"Argument not an object: "+C);if(N=O.toFixed(y,R),O.c){var L,j=N.split("."),k=+C.groupSize,F=+C.secondaryGroupSize,B=C.groupSeparator||"",V=j[0],G=j[1],le=O.s<0,de=le?V.slice(1):V,Pe=de.length;if(F&&(L=k,k=F,F=L,Pe-=L),k>0&&Pe>0){for(L=Pe%k||k,V=de.substr(0,L);L<Pe;L+=k)V+=B+de.substr(L,k);F>0&&(V+=B+de.slice(L)),le&&(V="-"+V)}N=G?V+(C.decimalSeparator||"")+((F=+C.fractionGroupSize)?G.replace(new RegExp("\\d{"+F+"}\\B","g"),"$&"+(C.fractionGroupSeparator||"")):G):V}return(C.prefix||"")+N+(C.suffix||"")},U.toFraction=function(y){var R,C,N,O,L,j,k,F,B,V,G,le,de=this,Pe=de.c;if(y!=null&&(k=new p(y),!k.isInteger()&&(k.c||k.s!==1)||k.lt(J)))throw Error(s+"Argument "+(k.isInteger()?"out of range: ":"not an integer: ")+z(k));if(!Pe)return new p(de);for(R=new p(J),B=C=new p(J),N=F=new p(J),le=S(Pe),L=R.e=le.length-de.e-1,R.c[0]=h[(j=L%u)<0?u+j:j],y=!y||k.comparedTo(R)>0?L>0?R:B:k,j=pe,pe=1/0,k=new p(le),F.c[0]=0;V=D(k,R,0,1),O=C.plus(V.times(N)),O.comparedTo(y)!=1;)C=N,N=O,B=F.plus(V.times(O=B)),F=O,R=k.minus(V.times(O=R)),k=O;return O=D(y.minus(C),N,0,1),F=F.plus(O.times(B)),C=C.plus(O.times(N)),F.s=B.s=de.s,L=L*2,G=D(B,N,L,ae).minus(de).abs().comparedTo(D(F,C,L,ae).minus(de).abs())<1?[B,N]:[F,C],pe=j,G},U.toNumber=function(){return+z(this)},U.toPrecision=function(y,R){return y!=null&&v(y,1,f),_(this,y,R,2)},U.toString=function(y){var R,C=this,N=C.s,O=C.e;return O===null?N?(R="Infinity",N<0&&(R="-"+R)):R="NaN":(y==null?R=O<=ne||O>=se?M(S(C.c),O):T(S(C.c),O,"0"):y===10&&w?(C=W(new p(C),ee+O+1,ae),R=T(S(C.c),C.e,"0")):(v(y,2,g.length,"Base"),R=K(T(S(C.c),O,"0"),10,y,N,!0)),N<0&&C.c[0]&&(R="-"+R)),R},U.valueOf=U.toJSON=function(){return z(this)},U._isBigNumber=!0,P!=null&&p.set(P),p}function b(P){var D=P|0;return P>0||P===D?D:D-1}function S(P){for(var D,K,Y=1,U=P.length,J=P[0]+"";Y<U;){for(D=P[Y++]+"",K=u-D.length;K--;D="0"+D);J+=D}for(U=J.length;J.charCodeAt(--U)===48;);return J.slice(0,U+1||1)}function E(P,D){var K,Y,U=P.c,J=D.c,ee=P.s,ae=D.s,ne=P.e,se=D.e;if(!ee||!ae)return null;if(K=U&&!U[0],Y=J&&!J[0],K||Y)return K?Y?0:-ae:ee;if(ee!=ae)return ee;if(K=ee<0,Y=ne==se,!U||!J)return Y?0:!U^K?1:-1;if(!Y)return ne>se^K?1:-1;for(ae=(ne=U.length)<(se=J.length)?ne:se,ee=0;ee<ae;ee++)if(U[ee]!=J[ee])return U[ee]>J[ee]^K?1:-1;return ne==se?0:ne>se^K?1:-1}function v(P,D,K,Y){if(P<D||P>K||P!==o(P))throw Error(s+(Y||"Argument")+(typeof P=="number"?P<D||P>K?" out of range: ":" not an integer: ":" not a primitive number: ")+String(P))}function I(P){var D=P.c.length-1;return b(P.e/u)==D&&P.c[D]%2!=0}function M(P,D){return(P.length>1?P.charAt(0)+"."+P.slice(1):P)+(D<0?"e":"e+")+D}function T(P,D,K){var Y,U;if(D<0){for(U=K+".";++D;U+=K);P=U+P}else if(Y=P.length,++D>Y){for(U=K,D-=Y;--D;U+=K);P+=U}else D<Y&&(P=P.slice(0,D)+"."+P.slice(D));return P}n=m(),n.default=n.BigNumber=n,t.exports?t.exports=n:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=n)})(a2)})(MA);var IA=MA.exports;const pi=IS(),P2=TS(),O2=_S,x2=IA,_n={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},zc={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:PA,decimalSuffixes:Gf}=pi.currentBytes(),PS={general:{scale:1024,suffixes:Gf},binary:{scale:1024,suffixes:PA},decimal:{scale:1e3,suffixes:Gf}};function A2(t,e={},n){if(typeof e=="string"&&(e=O2.parseFormat(e)),!P2.validateFormat(e))return"ERROR: invalid format";let i=e.prefix||"",o=e.postfix||"",s=H2(t,e,n);return s=Q2(s,i),s=J2(s,o),s}function H2(t,e,n){switch(e.output){case"currency":return e=tu(e,pi.currentCurrencyDefaultFormat()),W2(t,e,pi);case"percent":return e=tu(e,pi.currentPercentageDefaultFormat()),V2(t,e,pi,n);case"byte":return e=tu(e,pi.currentByteDefaultFormat()),L2(t,e,pi,n);case"time":return e=tu(e,pi.currentTimeDefaultFormat()),F2(t);case"ordinal":return e=tu(e,pi.currentOrdinalDefaultFormat()),$2(t,e,pi);default:return Yc({instance:t,providedFormat:e})}}function N2(t){let e=PS.decimal;return qf(t._value,e.suffixes,e.scale).suffix}function D2(t){let e=PS.binary;return qf(t._value,e.suffixes,e.scale).suffix}function k2(t){let e=PS.general;return qf(t._value,e.suffixes,e.scale).suffix}function qf(t,e,n){let r=e[0],i=Math.abs(t);if(i>=n){for(let o=1;o<e.length;++o){let s=Math.pow(n,o),a=Math.pow(n,o+1);if(i>=s&&i<a){r=e[o],t=t/s;break}}r===e[0]&&(t=t/Math.pow(n,e.length-1),r=e[e.length-1])}return{value:t,suffix:r}}function L2(t,e,n,r){let i=e.base||"binary",o=Object.assign({},zc,e);const{binarySuffixes:s,decimalSuffixes:a}=n.currentBytes();let u={general:{scale:1024,suffixes:a||Gf,marker:"bd"},binary:{scale:1024,suffixes:s||PA,marker:"b"},decimal:{scale:1e3,suffixes:a||Gf,marker:"d"}}[i],{value:c,suffix:h}=qf(t._value,u.suffixes,u.scale);return`${Yc({instance:r(c),providedFormat:e,state:n,defaults:n.currentByteDefaultFormat()})}${o.spaceSeparated?" ":""}${h}`}function $2(t,e,n){let r=n.currentOrdinal(),i=Object.assign({},zc,e),o=Yc({instance:t,providedFormat:e,state:n}),s=r(t._value);return`${o}${i.spaceSeparated?" ":""}${s}`}function F2(t){let e=Math.floor(t._value/60/60),n=Math.floor((t._value-e*60*60)/60),r=Math.round(t._value-e*60*60-n*60);return`${e}:${n<10?"0":""}${n}:${r<10?"0":""}${r}`}function V2(t,e,n,r){let i=e.prefixSymbol,o=Yc({instance:r(t._value*100),providedFormat:e,state:n}),s=Object.assign({},zc,e);return i?`%${s.spaceSeparated?" ":""}${o}`:`${o}${s.spaceSeparated?" ":""}%`}function W2(t,e,n){const r=n.currentCurrency();let i=Object.assign({},e),o=Object.assign({},zc,i),s,a="",l=!!o.totalLength||!!o.forceAverage||o.average,u=i.currencyPosition||r.position,c=i.currencySymbol||r.symbol;const h=o.spaceSeparatedCurrency!==void 0?o.spaceSeparatedCurrency:o.spaceSeparated;i.lowPrecision===void 0&&(i.lowPrecision=!1),h&&(a=" "),u==="infix"&&(s=a+c+a);let d=Yc({instance:t,providedFormat:i,state:n,decimalSeparator:s});return u==="prefix"&&(t._value<0&&o.negative==="sign"?d=`-${a}${c}${d.slice(1)}`:t._value>0&&o.forceSign?d=`+${a}${c}${d.slice(1)}`:d=c+a+d),(!u||u==="postfix")&&(a=!o.spaceSeparatedAbbreviation&&l?"":a,d=d+a+c),d}function B2({value:t,forceAverage:e,lowPrecision:n=!0,abbreviations:r,spaceSeparated:i=!1,totalLength:o=0,roundingFunction:s=Math.round}){let a="",l=Math.abs(t),u=-1;if(e&&r[e]&&_n[e]?(a=r[e],t=t/_n[e]):l>=_n.trillion||n&&s(l/_n.trillion)===1?(a=r.trillion,t=t/_n.trillion):l<_n.trillion&&l>=_n.billion||n&&s(l/_n.billion)===1?(a=r.billion,t=t/_n.billion):l<_n.billion&&l>=_n.million||n&&s(l/_n.million)===1?(a=r.million,t=t/_n.million):(l<_n.million&&l>=_n.thousand||n&&s(l/_n.thousand)===1)&&(a=r.thousand,t=t/_n.thousand),a&&(a=(i?" ":"")+a),o){let h=t<0,d=t.toString().split(".")[0],f=h?d.length-1:d.length;u=Math.max(o-f,0)}return{value:t,abbreviation:a,mantissaPrecision:u}}function j2({value:t,characteristicPrecision:e}){let[n,r]=t.toExponential().split("e"),i=+n;if(!e)return{value:i,abbreviation:`e${r}`};let o=1;return o<e&&(i=i*Math.pow(10,e-o),r=+r-(e-o),r=r>=0?`+${r}`:r),{value:i,abbreviation:`e${r}`}}function Kf(t){let e="";for(let n=0;n<t;n++)e+="0";return e}function U2(t,e){let n=t.toString(),[r,i]=n.split("e"),[o,s=""]=r.split(".");if(+i>0)n=o+s+Kf(i-s.length);else{let a=".";+o<0?a=`-0${a}`:a=`0${a}`;let l=(Kf(-i-1)+Math.abs(o)+s).substr(0,e);l.length<e&&(l+=Kf(e-l.length)),n=a+l}return+i>0&&e>0&&(n+=`.${Kf(e)}`),n}function z2(t,e,n=Math.round){return t.toString().indexOf("e")!==-1?U2(t,e):new x2(n(+`${t}e+${e}`)/Math.pow(10,e)).toFixed(e)}function Y2(t,e,n,r,i,o){if(r===-1)return t;let s=z2(e,r,o),[a,l=""]=s.toString().split(".");if(l.match(/^0+$/)&&(n||i))return a;let u=l.match(/0+$/);return i&&u?`${a}.${l.toString().slice(0,u.index)}`:s.toString()}function G2(t,e,n,r){let i=t,[o,s]=i.toString().split(".");if(o.match(/^-?0$/)&&n)return s?`${o.replace("0","")}.${s}`:o.replace("0","");const a=e<0&&o.indexOf("-")===0;if(a&&(o=o.slice(1),i=i.slice(1)),o.length<r){let l=r-o.length;for(let u=0;u<l;u++)i=`0${i}`}return a&&(i=`-${i}`),i.toString()}function q2(t,e){let n=[],r=0;for(let i=t;i>0;i--)r===e&&(n.unshift(i),r=0),r++;return n}function K2(t,e,n,r,i){let o=r.currentDelimiters(),s=o.thousands;i=i||o.decimal;let a=o.thousandsSize||3,l=t.toString(),u=l.split(".")[0],c=l.split(".")[1];const h=e<0&&u.indexOf("-")===0;return n&&(h&&(u=u.slice(1)),q2(u.length,a).forEach((f,m)=>{u=u.slice(0,f+m)+s+u.slice(f+m)}),h&&(u=`-${u}`)),c?l=u+i+c:l=u,l}function X2(t,e){return t+e}function Z2(t,e,n){return e===0?t:+t==0?t.replace("-",""):e>0?`+${t}`:n==="sign"?t:`(${t.replace("-","")})`}function Q2(t,e){return e+t}function J2(t,e){return t+e}function Yc({instance:t,providedFormat:e,state:n=pi,decimalSeparator:r,defaults:i=n.currentDefaults()}){let o=t._value;if(o===0&&n.hasZeroFormat())return n.getZeroFormat();if(!isFinite(o))return o.toString();let s=Object.assign({},zc,i,e),a=s.totalLength,l=a?0:s.characteristic,u=s.optionalCharacteristic,c=s.forceAverage,h=s.lowPrecision,d=!!a||!!c||s.average,f=a?-1:d&&e.mantissa===void 0?0:s.mantissa,m=a?!1:e.optionalMantissa===void 0?f===-1:s.optionalMantissa,b=s.trimMantissa,S=s.thousandSeparated,E=s.spaceSeparated,v=s.negative,I=s.forceSign,M=s.exponential,T=s.roundingFunction,P="";if(d){let K=B2({value:o,forceAverage:c,lowPrecision:h,abbreviations:n.currentAbbreviations(),spaceSeparated:E,roundingFunction:T,totalLength:a});o=K.value,P+=K.abbreviation,a&&(f=K.mantissaPrecision)}if(M){let K=j2({value:o,characteristicPrecision:l});o=K.value,P=K.abbreviation+P}let D=Y2(o.toString(),o,m,f,b,T);return D=G2(D,o,u,l),D=K2(D,o,S,n,r),(d||M)&&(D=X2(D,P)),(I||o<0)&&(D=Z2(D,o,v)),D}function tu(t,e){if(!t)return e;let n=Object.keys(t);return n.length===1&&n[0]==="output"?e:t}var eq=t=>({format:(...e)=>A2(...e,t),getByteUnit:(...e)=>k2(...e,t),getBinaryByteUnit:(...e)=>D2(...e,t),getDecimalByteUnit:(...e)=>N2(...e,t),formatOrDefault:tu});const Fo=IA;function tq(t,e,n){let r=new Fo(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Fo(i),t._value=r.plus(i).toNumber(),t}function OA(t,e,n){let r=new Fo(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Fo(i),t._value=r.minus(i).toNumber(),t}function nq(t,e,n){let r=new Fo(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Fo(i),t._value=r.times(i).toNumber(),t}function rq(t,e,n){let r=new Fo(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Fo(i),t._value=r.dividedBy(i).toNumber(),t}function iq(t,e,n){let r=e;return n.isNumbro(e)&&(r=e._value),t._value=r,t}function oq(t,e,n){let r=n(t._value);return OA(r,e,n),Math.abs(r._value)}var sq=t=>({add:(e,n)=>tq(e,n,t),subtract:(e,n)=>OA(e,n,t),multiply:(e,n)=>nq(e,n,t),divide:(e,n)=>rq(e,n,t),set:(e,n)=>iq(e,n,t),difference:(e,n)=>oq(e,n,t),BigNumber:Fo});const aq="2.5.0",Yi=IS(),lq=TS(),uq=I2(zt),cq=EA();let _a=eq(zt),Ma=sq(zt);const hq=_S;class xA{constructor(e){this._value=e}clone(){return zt(this._value)}format(e={}){return _a.format(this,e)}formatCurrency(e){return typeof e=="string"&&(e=hq.parseFormat(e)),e=_a.formatOrDefault(e,Yi.currentCurrencyDefaultFormat()),e.output="currency",_a.format(this,e)}formatTime(e={}){return e.output="time",_a.format(this,e)}binaryByteUnits(){return _a.getBinaryByteUnit(this)}decimalByteUnits(){return _a.getDecimalByteUnit(this)}byteUnits(){return _a.getByteUnit(this)}difference(e){return Ma.difference(this,e)}add(e){return Ma.add(this,e)}subtract(e){return Ma.subtract(this,e)}multiply(e){return Ma.multiply(this,e)}divide(e){return Ma.divide(this,e)}set(e){return Ma.set(this,AA(e))}value(){return this._value}valueOf(){return this._value}}function AA(t){let e=t;return zt.isNumbro(t)?e=t._value:typeof t=="string"?e=zt.unformat(t):isNaN(t)&&(e=NaN),e}function zt(t){return new xA(AA(t))}zt.version=aq,zt.isNumbro=function(t){return t instanceof xA},zt.language=Yi.currentLanguage,zt.registerLanguage=Yi.registerLanguage,zt.setLanguage=Yi.setLanguage,zt.languages=Yi.languages,zt.languageData=Yi.languageData,zt.zeroFormat=Yi.setZeroFormat,zt.defaultFormat=Yi.currentDefaults,zt.setDefaults=Yi.setDefaults,zt.defaultCurrencyFormat=Yi.currentCurrencyDefaultFormat,zt.validate=lq.validate,zt.loadLanguagesInNode=uq.loadLanguagesInNode,zt.unformat=cq.unformat,zt.BigNumber=Ma.BigNumber;var dq=zt,Ia=l2(dq);const fq="numeric";function HA(t,e){if(Bn(t)){const n=e.numericFormat,r=n&&n.culture||"-",i=n&&n.pattern;if(typeof r<"u"&&!Ia.languages()[r]){const o=r.replace("-",""),s=Ia.allLanguages?Ia.allLanguages[r]:Ia[o];s&&Ia.registerLanguage(s)}Ia.setLanguage(r),t=Ia(t).format(i||"0")}return t}function OS(t,e,n,r,i,o,s){let a=o;if(Bn(a)){let u=[];if(Array.isArray(s.className))u=s.className;else{var l;const c=(l=s.className)!==null&&l!==void 0?l:"";c.length&&(u=c.split(" "))}a=HA(a,s),u.indexOf("htLeft")<0&&u.indexOf("htCenter")<0&&u.indexOf("htRight")<0&&u.indexOf("htJustify")<0&&u.push("htRight"),u.indexOf("htNumeric")<0&&u.push("htNumeric"),s.className=u.join(" "),e.dir="ltr"}Lo(t,e,n,r,i,a,s)}OS.RENDERER_TYPE=fq;const gq="password";function xS(t,e,n,r,i,o,s){Lo.apply(this,[t,e,n,r,i,o,s]);const a=s.hashLength||e.innerHTML.length,l=s.hashSymbol||"*";let u="";fe(a-1,()=>{u+=l}),Gl(e,u)}xS.RENDERER_TYPE=gq;const mq="select";function AS(t,e,n,r,i,o,s){Lo.apply(this,[t,e,n,r,i,o,s])}AS.RENDERER_TYPE=mq;const pq="time";function HS(t,e,n,r,i,o,s){Lo.apply(this,[t,e,n,r,i,o,s]),e.dir="ltr"}HS.RENDERER_TYPE=pq;const{register:wq,getItem:vq,hasItem:NA,getNames:Ule,getValues:zle}=mi("renderers");function NS(t){if(typeof t=="function")return t;if(!NA(t))throw Error(`No registered renderer found under "${t}" name`);return vq(t)}function zr(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),wq(t,e)}function Cq(){zr(Ql),zr(Uc),zr(CS),zr(Zy),zr(bS),zr(Xy),zr(OS),zr(xS),zr(AS),zr(Lo),zr(HS)}const yq="autocomplete";function Xf(t,e){let n=t;if(n==null&&(n=""),this.allowEmpty&&n===""){e(!0);return}this.strict&&this.source?typeof this.source=="function"?this.source(n,DA(n,e)):DA(n,e)(this.source):e(!0)}Xf.VALIDATOR_TYPE=yq;function DA(t,e){const n=t;return function(r){let i=!1;for(let o=0,s=r.length;o<s;o++)if(n===r[o]){i=!0;break}e(i)}}function bq(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const Sq="date";function DS(t,e){const n=fA(Gx,this.instance);let r=t,i=!0;r==null&&(r="");let o=Z(r,this.dateFormat||n.defaultDateFormat,!0).isValid(),s=Z(new Date(r)).isValid()||o;if(this.allowEmpty&&r===""&&(s=!0,o=!0),s||(i=!1),!s&&o&&(i=!0),s&&!o)if(this.correctFormat===!0){const a=Rq(r,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,a,"dateValidator"),i=!0}else i=!1;e(i)}DS.VALIDATOR_TYPE=Sq;function Rq(t,e){const n=Z(bq(t)),r=Z(t,e),i=t.search(/[A-Za-z]/g)>-1;let o;return n.isValid()&&n.format("x")===r.format("x")||!r.isValid()||i?o=n:o=r,o.format(e)}const Eq="dropdown";function kS(t,e){Xf.apply(this,[t,e])}kS.VALIDATOR_TYPE=Eq;const Tq="numeric";function LS(t,e){let n=t;n==null&&(n=""),this.allowEmpty&&n===""?e(!0):e(n===""?!1:Bn(t))}LS.VALIDATOR_TYPE=Tq;const _q=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],Mq="time";function $S(t,e){const n=this.timeFormat||"h:mm:ss a";let r=!0,i=t;i===null&&(i=""),i=/^\d{3,}$/.test(i)?parseInt(i,10):i;const o=/^\d{1,2}$/.test(i);o&&(i+=":00");const s=Z(i,_q,!0).isValid()?Z(i):Z(i,n);let a=s.isValid(),l=Z(i,n,!0).isValid()&&!o;if(this.allowEmpty&&i===""&&(a=!0,l=!0),a||(r=!1),!a&&l&&(r=!0),a&&!l)if(this.correctFormat===!0){const u=s.format(n);this.instance.setDataAtCell(this.visualRow,this.visualCol,u,"timeValidator"),r=!0}else r=!1;e(r)}$S.VALIDATOR_TYPE=Mq;const{register:Iq,getItem:Pq,hasItem:kA,getNames:Yle,getValues:Gle}=mi("validators");function Oq(t){if(typeof t=="function")return t;if(!kA(t))throw Error(`No registered validator found under "${t}" name`);return Pq(t)}function nu(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),Iq(t,e)}function xq(){nu(Xf),nu(kS),nu(DS),nu(LS),nu($S)}const Aq={CELL_TYPE:"autocomplete",editor:Py,renderer:Ql,validator:Xf},Hq={CELL_TYPE:"checkbox",editor:Wx,renderer:CS},Nq="date";function LA(t,e,n,r,i,o,s){Ql.apply(this,[t,e,n,r,i,o,s])}LA.RENDERER_TYPE=Nq;const Dq={CELL_TYPE:"date",editor:Kx,renderer:LA,validator:DS},kq={CELL_TYPE:"dropdown",editor:Xx,renderer:Zy,validator:kS,filter:!1,strict:!0},Lq={CELL_TYPE:"handsontable",editor:Ry,renderer:bS},$q={CELL_TYPE:"numeric",editor:Zx,renderer:OS,validator:LS,dataType:"number"},Fq={CELL_TYPE:"password",editor:Qx,renderer:xS,copyable:!1},Vq={CELL_TYPE:"select",editor:eA,renderer:AS},$A={CELL_TYPE:"text",editor:Ea,renderer:Lo},Wq={CELL_TYPE:"time",editor:tA,renderer:HS,validator:$S},{register:Bq,getItem:jq,hasItem:FA,getNames:iue,getValues:oue}=mi("cellTypes");function Uq(t){if(!FA(t))throw Error(`You declared cell type "${t}" as a string that is not mapped to a known object.
31
- Cell type must be an object or a string mapped to an object registered by
32
- "Handsontable.cellTypes.registerCellType" method`);return jq(t)}function wi(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:n,renderer:r,validator:i}=e;n&&Tr(t,n),r&&zr(t,r),i&&nu(t,i),Bq(t,e)}function zq(){wi(Aq),wi(Hq),wi(Dq),wi(kq),wi(Lq),wi($q),wi(Fq),wi(Vq),wi($A),wi(Wq)}const FS="asc",Yq="desc",VA=new Map([[FS,[-1,1]],[Yq,[1,-1]]]),Gq=t=>`The priority '${t}' is already declared in a map.`,qq=t=>`The priority '${t}' is not a number.`;function Kq(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=new Map;t=rt(t)?t:Gq,e=rt(e)?e:qq;function r(o,s){if(!Bn(o))throw new Error(e(o));if(n.has(o))throw new Error(t(o));n.set(o,s)}function i(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:FS;const[s,a]=VA.get(o)||VA.get(FS);return[...n].sort((l,u)=>l[0]<u[0]?s:a).map(l=>l[1])}return{addItem:r,getItems:i}}const Xq=t=>`The id '${t}' is already declared in a map.`;function Zf(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=rt(t)?t:Xq;function n(u,c){if(l(u))throw new Error(t(u));e.set(u,c)}function r(u){return e.delete(u)}function i(){e.clear()}function o(u){const[c]=a().find(h=>{let[d,f]=h;return u===f?d:!1})||[null];return c}function s(u){return e.get(u)}function a(){return[...e]}function l(u){return e.has(u)}return{addItem:n,clear:i,getId:o,getItem:s,getItems:a,hasItem:l,removeItem:r}}const Zq=t=>`'${t}' value is already declared in a unique set.`;function Qq(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=rt(t)?t:Zq;function n(o){if(e.has(o))throw new Error(t(o));e.add(o)}function r(){return[...e]}function i(){e.clear()}return{addItem:n,clear:i,getItems:r}}const VS=t=>`There is already registered "${t}" plugin.`,WA=Kq({errorPriorityExists:t=>`There is already registered plugin on priority "${t}".`,errorPriorityNaN:t=>`The priority "${t}" is not a number.`}),BA=Qq({errorItemExists:VS}),WS=Zf({errorIdExists:VS});function jA(){return[...WA.getItems(),...BA.getItems()]}function BS(t){const e=hi(t);return WS.getItem(e)}function Jq(t){return!!BS(t)}function Ge(t,e,n){[t,e,n]=tK(t,e,n),BS(t)===void 0&&eK(t,e,n)}function eK(t,e,n){const r=hi(t);if(WS.hasItem(r))throw new Error(VS(r));n===void 0?BA.addItem(r):WA.addItem(n,r),WS.addItem(r,e)}function tK(t,e,n){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,n=e.PLUGIN_PRIORITY),[t,e,n]}function nK(t,e){UA(t,e),e.add(t)}function rK(t,e,n){UA(t,e),e.set(t,n)}function UA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ru(t,e,n){return(e=iK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iK(t){var e=oK(t,"string");return typeof e=="symbol"?e:e+""}function oK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function iu(t,e){return t.get(zA(t,e))}function zA(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 YA=new Map([["plugin",Jq],["cell-type",FA],["editor",dA],["renderer",NA],["validator",kA]]),GA=Symbol("mainSetting"),sK="base",Qf=[];let Pa=null;var Oa=new WeakMap,qA=new WeakSet;class Xe{static get PLUGIN_KEY(){return sK}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}constructor(e){nK(this,qA),ru(this,"eventManager",new gi(this)),ru(this,"pluginName",null),ru(this,"pluginsInitializedCallbacks",[]),ru(this,"isPluginsReady",!1),ru(this,"enabled",!1),ru(this,"initialized",!1),rK(this,Oa,{}),Ao(this,"hot",e,{writable:!1}),Pa=null,this.hot.addHook("afterPluginsInitialized",()=>this.onAfterPluginsInitialized()),this.hot.addHook("afterUpdateSettings",n=>this.onUpdateSettings(n)),this.hot.addHook("beforeInit",()=>this.init())}init(){this.pluginName=this.hot.getPluginName(this);const e=this.constructor.PLUGIN_DEPS,n=Array.isArray(e)?e:[];if(n.length>0){const i=[];if(n.forEach(o=>{const[s,a]=o.split(":");if(!YA.has(s))throw new Error(`Unknown plugin dependency type "${s}" was found.`);YA.get(s)(a)||i.push(` - ${a} (${s})`)}),i.length>0){const o=[`The ${this.pluginName} plugin requires the following modules:
33
- `,`${i.join(`
34
- `)}
35
- `].join("");Qf.push(o)}}if(Pa||(Pa=jA()),Pa.indexOf(this.pluginName)>=0&&Pa.splice(Pa.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),Pa.length===0){if(Qf.length>0){const i=[`${Qf.join(`
36
- `)}
37
- `,"You have to import and register them manually."].join("");throw Qf.length=0,new Error(i)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}enablePlugin(){this.enabled=!0}disablePlugin(){var e;(e=this.eventManager)===null||e===void 0||e.clear(),this.clearHooks(),this.enabled=!1}getSetting(e){const n=this.hot.getSettings()[this.constructor.PLUGIN_KEY];if(e===void 0)return n;const r=this.constructor.DEFAULT_SETTINGS;if((Array.isArray(n)||He(n))&&r[GA]===e){var i;return Array.isArray(n)?n:(i=n[e])!==null&&i!==void 0?i:r[e]}if(He(n)){var o;return(o=n[e])!==null&&o!==void 0?o:r[e]}return r[e]}addHook(e,n,r){iu(Oa,this)[e]=iu(Oa,this)[e]||[];const i=iu(Oa,this)[e];this.hot.addHook(e,n,r),i.push(n),iu(Oa,this)[e]=i}removeHooks(e){H(iu(Oa,this)[e]||[],n=>{this.hot.removeHook(e,n)})}clearHooks(){const e=iu(Oa,this);Ne(e,(n,r)=>this.removeHooks(r)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){H(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const n=zA(qA,this,aK).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&n&&this.updatePlugin(e))}updatePlugin(){}destroy(){var e;(e=this.eventManager)===null||e===void 0||e.destroy(),this.clearHooks(),Ne(this,(n,r)=>{r!=="hot"&&(this[r]=null)}),delete this.t,delete this.hot}}function aK(t){if(!t)return!1;const e=this.constructor.SETTING_KEYS;if(typeof e=="boolean")return e;for(let n=0;n<e.length;n++)if(t[e[n]]!==void 0)return!0;return!1}function xa(t,e,n){return(e=lK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lK(t){var e=uK(t,"string");return typeof e=="symbol"?e:e+""}function uK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let KA=class{constructor(e){xa(this,"hot",null),xa(this,"container",null),xa(this,"injected",!1),xa(this,"rows",[]),xa(this,"columns",[]),xa(this,"samples",null),xa(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,n){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={row:e};this.rows.push(r),this.samples=n,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol(e)),this.table.tr.appendChild(this.createRow(e)),e===0&&X(this.table.table,"htGhostTableFirstRow"),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}addColumnHeadersRow(e){const n=this.hot.getColHeader(0);if(n!=null){const r={row:-1};this.rows.push(r),this.container=this.createContainer(this.hot.rootElement.className),this.samples=e,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.appendColumnHeadersRow(),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}}addColumn(e,n){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={col:e};this.columns.push(r),this.samples=n,this.table=this.createTable(this.hot.table.className),this.getSetting("useHeaders")&&this.hot.getColHeader(e)!==null&&this.hot.view.appendColHeader(e,this.table.th,void 0,-1),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}getHeights(e){this.injected||this.injectTable(),H(this.rows,n=>{const{height:r}=n.table.getBoundingClientRect();e(n.row,Math.ceil(r))})}getWidths(e){this.injected||this.injectTable(),H(this.columns,n=>{const{width:r}=n.table.getBoundingClientRect();e(n.col,Math.ceil(r))})}setSettings(e){this.settings=e}setSetting(e,n){this.settings||(this.settings={}),this.settings[e]=n}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const n=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&n.appendChild(this.createColElement(-1,-1)),this.samples.forEach(r=>{H(r.strings,i=>{n.appendChild(this.createColElement(i.col,e))})}),n}createRow(e){const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,i),r.appendChild(i)),this.samples.forEach(o=>{H(o.strings,s=>{const a=s.col,l=this.hot.getCellMeta(e,a),u=this.hot.getCellRenderer(l),c=n.createElement("td");c.setAttribute("ghost-table",1),u(this.hot,c,e,a,this.hot.colToProp(a),s.value,l),r.appendChild(c)})}),r}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,n=e.createDocumentFragment(),r=[];if(this.hot.hasRowHeaders()){const i=e.createElement("th");r.push([-1,i]),n.appendChild(i)}this.samples.forEach(i=>{H(i.strings,o=>{const s=o.col,a=e.createElement("th");r.push([s,a]),n.appendChild(a)})}),this.table.tHead.appendChild(n),H(r,i=>{const[o,s]=i;this.hot.view.appendColHeader(o,s)})}createCol(e){const{rootDocument:n}=this.hot,r=n.createDocumentFragment();return this.samples.forEach(i=>{H(i.strings,o=>{const s=o.row,a=this.hot.getCellMeta(s,e),l=this.hot.getCellRenderer(a),u=n.createElement("td"),c=n.createElement("tr");u.setAttribute("ghost-table",1),l(this.hot,u,s,e,this.hot.colToProp(e),o.value,a),c.appendChild(u),r.appendChild(c)})}),r}clean(){this.rows.length=0,this.rows[-1]=void 0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()}injectTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)}removeTable(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)}createColElement(e,n){const r=this.hot.rootDocument.createElement("col");let i=0;n>=0&&e>=0&&(i=this.hot.getCellMeta(n,e).colspan);let o=this.hot.getColWidth(e);if(i>1)for(let s=e+1;s<e+i;s++)o+=this.hot.getColWidth(s);return r.style.width=`${o}px`,r}createTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("table"),o=n.createElement("thead"),s=n.createElement("tbody"),a=n.createElement("colgroup"),l=n.createElement("tr"),u=n.createElement("th");return this.isVertical()&&i.appendChild(a),this.isHorizontal()&&(l.appendChild(u),o.appendChild(l),i.style.tableLayout="auto",i.style.width="auto"),i.appendChild(o),this.isVertical()&&s.appendChild(l),i.appendChild(s),X(i,e),r.appendChild(i),{fragment:r,table:i,tHead:o,tBody:s,colGroup:a,tr:l,th:u}}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("div"),o=`htGhostTable htAutoSize ${e.trim()}`;return X(i,o),r.appendChild(i),{fragment:r,container:i}}isVertical(){return!!(this.rows.length&&!this.columns.length)}isHorizontal(){return!!(this.columns.length&&!this.rows.length)}};function Jf(t,e,n){return(e=cK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cK(t){var e=hK(t,"string");return typeof e=="symbol"?e:e+""}function hK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class eg{static get SAMPLE_COUNT(){return 3}constructor(e){Jf(this,"samples",null),Jf(this,"dataFactory",null),Jf(this,"customSampleCount",null),Jf(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:eg.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,n){return this.generateSamples("row",n,e)}generateColumnSamples(e,n){return this.generateSamples("col",n,e)}generateSamples(e,n,r){const i=new Map,{from:o,to:s}=typeof r=="number"?{from:r,to:r}:r;return fe(o,s,a=>{const l=this.generateSample(e,n,a);i.set(a,l)}),i}generateSample(e,n,r){if(e!=="row"&&e!=="col")throw new Error("Unsupported sample type");const i=new Map,o=e==="row"?"col":"row",s=[];return fe(n.from,n.to,a=>{const l=e==="row"?this.dataFactory(r,a):this.dataFactory(a,r);if(l===!1)return;const{value:u,bundleSeed:c}=l,h=typeof c=="string"&&c.length>0;let d;h?d=c:He(u)?d=`${Object.keys(u).length}`:Array.isArray(u)?d=`${u.length}`:d=`${xt(u).length}`,i.has(d)||i.set(d,{needed:this.getSampleCount(),strings:[]});const f=i.get(d);f.needed&&(!(s.indexOf(u)>-1)||this.allowDuplicates||h)&&(f.strings.push({value:u,[o]:a}),s.push(u),f.needed-=1)}),i}}var XA={},ZA;function dK(){if(ZA)return XA;ZA=1;var t=vt(),e=Il(),n=Ol(),r=pc(),i=Wf();return t({target:"Array",proto:!0},{at:function(s){var a=e(this),l=n(a),u=r(s),c=u>=0?u:l+u;return c<0||c>=l?void 0:a[c]}}),i("at"),XA}dK();var QA={},JA;function fK(){if(JA)return QA;JA=1;var t=vt(),e=Xt(),n=dc(),r=pc(),i=qd(),o=Rn(),s=e("".charAt),a=o(function(){return"𠮷".at(-2)!=="\uD842"});return t({target:"String",proto:!0,forced:a},{at:function(u){var c=i(n(this)),h=c.length,d=r(u),f=d>=0?d:h+d;return f<0||f>=h?void 0:s(c,f)}}),QA}fK();function Gc(t,e,n){return(e=gK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gK(t){var e=mK(t,"string");return typeof e=="symbol"?e:e+""}function mK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class pK{constructor(){Gc(this,"count",0),Gc(this,"startColumn",null),Gc(this,"endColumn",null),Gc(this,"startPosition",null),Gc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedWidth:r,zeroBasedScrollOffset:i,viewportWidth:o,columnWidth:s}=n,a=i>0?o+1:o;r>=i&&r+s<=i+a&&((this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e)}finalize(e){var n;const{scrollOffset:r,viewportWidth:i,inlineStartOffset:o,zeroBasedScrollOffset:s,totalColumns:a,needReverse:l,startPositions:u,columnWidth:c}=e;if(this.endColumn===a-1&&l)for(this.startColumn=this.endColumn;this.startColumn>0;){const m=u[this.endColumn]+c-u[this.startColumn-1];if(m<=i&&(this.startColumn-=1),m>=i)break}this.startPosition=(n=u[this.startColumn])!==null&&n!==void 0?n:null;const h=s>0?i+1:i,d=r+i-h,f=this.startColumn===null?0:e.getColumnWidth(this.startColumn);d<-1*o||r>u.at(-1)||-1*r-i>-1*f?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endColumn&&(this.endColumn=a-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function qc(t,e,n){return(e=wK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wK(t){var e=vK(t,"string");return typeof e=="symbol"?e:e+""}function vK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class CK{constructor(){qc(this,"count",0),qc(this,"startRow",null),qc(this,"endRow",null),qc(this,"startPosition",null),qc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedHeight:r,zeroBasedScrollOffset:i,innerViewportHeight:o,rowHeight:s}=n;r>=i&&r+s<=o&&(this.startRow===null&&(this.startRow=e),this.endRow=e)}finalize(e){var n;const{scrollOffset:r,viewportHeight:i,horizontalScrollbarHeight:o,totalRows:s,needReverse:a,startPositions:l,rowHeight:u}=e;if(this.endRow===s-1&&a)for(this.startRow=this.endRow;this.startRow>0;){const d=l[this.endRow]+u-l[this.startRow-1];if(d<=i-o&&(this.startRow-=1),d>=i-o)break}this.startPosition=(n=l[this.startRow])!==null&&n!==void 0?n:null;const c=r+i-o,h=this.startRow===null?0:e.getRowHeight(this.startRow);c<h||r>l.at(-1)?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function Kc(t,e,n){return(e=yK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yK(t){var e=bK(t,"string");return typeof e=="symbol"?e:e+""}function bK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class eH{constructor(){Kc(this,"count",0),Kc(this,"startColumn",null),Kc(this,"endColumn",null),Kc(this,"startPosition",null),Kc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedWidth:r,zeroBasedScrollOffset:i,viewportWidth:o}=n;r<=i&&(this.startColumn=e);const s=i>0?o+1:o;r>=i&&r<=i+s&&(this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e}finalize(e){var n;const{scrollOffset:r,viewportWidth:i,inlineStartOffset:o,zeroBasedScrollOffset:s,totalColumns:a,needReverse:l,startPositions:u,columnWidth:c}=e;if(this.endColumn===a-1&&l)for(this.startColumn=this.endColumn;this.startColumn>0;){const f=u[this.endColumn]+c-u[this.startColumn-1];if(this.startColumn-=1,f>i)break}this.startPosition=(n=u[this.startColumn])!==null&&n!==void 0?n:null;const h=s>0?i+1:i;r+i-h<-1*o||r>u.at(-1)+c||-1*r-i>0?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endColumn&&(this.endColumn=a-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function Xc(t,e,n){return(e=SK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function SK(t){var e=RK(t,"string");return typeof e=="symbol"?e:e+""}function RK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tH{constructor(){Xc(this,"count",0),Xc(this,"startRow",null),Xc(this,"endRow",null),Xc(this,"startPosition",null),Xc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedHeight:r,zeroBasedScrollOffset:i,innerViewportHeight:o}=n;r<=i&&(this.startRow=e),r>=i&&r<=o&&this.startRow===null&&(this.startRow=e),this.endRow=e}finalize(e){var n;const{scrollOffset:r,viewportHeight:i,horizontalScrollbarHeight:o,totalRows:s,needReverse:a,startPositions:l,rowHeight:u}=e;if(this.endRow===s-1&&a)for(this.startRow=this.endRow;this.startRow>0;){const h=l[this.endRow]+u-l[this.startRow-1];if(this.startRow-=1,h>=i-o)break}this.startPosition=(n=l[this.startRow])!==null&&n!==void 0?n:null,r+i-o<0||r>l.at(-1)+u?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function Zc(t,e,n){return(e=EK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function EK(t){var e=TK(t,"string");return typeof e=="symbol"?e:e+""}function TK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class _K{constructor(){Zc(this,"count",0),Zc(this,"startColumn",0),Zc(this,"endColumn",0),Zc(this,"startPosition",0),Zc(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalColumns:n}=e;this.count=n,this.endColumn=this.count-1}process(){}finalize(){}}function Qc(t,e,n){return(e=MK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function MK(t){var e=IK(t,"string");return typeof e=="symbol"?e:e+""}function IK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class PK{constructor(){Qc(this,"count",0),Qc(this,"startRow",0),Qc(this,"endRow",0),Qc(this,"startPosition",0),Qc(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalRows:n}=e;this.count=n,this.endRow=this.count-1}process(){}finalize(){}}function nH(t,e,n){return(e=OK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OK(t){var e=xK(t,"string");return typeof e=="symbol"?e:e+""}function xK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class AK extends eH{constructor(){super(...arguments),nH(this,"columnStartOffset",0),nH(this,"columnEndOffset",0)}finalize(e){var n;super.finalize(e);const{overrideFn:r,totalColumns:i,startPositions:o}=e;if(this.startColumn!==null&&typeof r=="function"){const s=this.startColumn,a=this.endColumn;r(this),this.columnStartOffset=s-this.startColumn,this.columnEndOffset=this.endColumn-a}this.startColumn<0&&(this.startColumn=0),this.startPosition=(n=o[this.startColumn])!==null&&n!==void 0?n:null,i<this.endColumn&&(this.endColumn=i-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function rH(t,e,n){return(e=HK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function HK(t){var e=NK(t,"string");return typeof e=="symbol"?e:e+""}function NK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class DK extends tH{constructor(){super(...arguments),rH(this,"rowStartOffset",0),rH(this,"rowEndOffset",0)}finalize(e){var n;super.finalize(e);const{overrideFn:r,totalRows:i,startPositions:o}=e;if(this.startRow!==null&&typeof r=="function"){const s=this.startRow,a=this.endRow;r(this),this.rowStartOffset=s-this.startRow,this.rowEndOffset=this.endRow-a}this.startRow<0&&(this.startRow=0),this.startPosition=(n=o[this.startRow])!==null&&n!==void 0?n:null,i<this.endRow&&(this.endRow=i-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function iH(t,e,n){return(e=kK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kK(t){var e=LK(t,"string");return typeof e=="symbol"?e:e+""}function LK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class oH{constructor(e){iH(this,"calculationTypes",[]),iH(this,"calculationResults",new Map),this.calculationTypes=e}_initialize(e){this.calculationTypes.forEach(n=>{let[r,i]=n;this.calculationResults.set(r,i),i.initialize(e)})}_process(e,n){this.calculationTypes.forEach(r=>{let[,i]=r;return i.process(e,n)})}_finalize(e){this.calculationTypes.forEach(n=>{let[,r]=n;return r.finalize(e)})}getResultsFor(e){return this.calculationResults.get(e)}}function vi(t,e,n){return(e=$K(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $K(t){var e=FK(t,"string");return typeof e=="symbol"?e:e+""}function FK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const ou=50;class VK extends oH{constructor(e){let{calculationTypes:n,viewportWidth:r,scrollOffset:i,totalColumns:o,columnWidthFn:s,overrideFn:a,inlineStartOffset:l}=e;super(n),vi(this,"viewportWidth",0),vi(this,"scrollOffset",0),vi(this,"zeroBasedScrollOffset",0),vi(this,"totalColumns",0),vi(this,"columnWidthFn",null),vi(this,"columnWidth",0),vi(this,"overrideFn",null),vi(this,"inlineStartOffset",0),vi(this,"totalCalculatedWidth",0),vi(this,"startPositions",[]),vi(this,"needReverse",!0),this.viewportWidth=r,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalColumns=o,this.columnWidthFn=s,this.overrideFn=a,this.inlineStartOffset=l,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalColumns;e++)if(this.columnWidth=this.getColumnWidth(e),this._process(e,this),this.startPositions.push(this.totalCalculatedWidth),this.totalCalculatedWidth+=this.columnWidth,this.totalCalculatedWidth>=this.zeroBasedScrollOffset+this.viewportWidth){this.needReverse=!1;break}this._finalize(this)}getColumnWidth(e){const n=this.columnWidthFn(e);return isNaN(n)?ou:n}}function Yr(t,e,n){return(e=WK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WK(t){var e=BK(t,"string");return typeof e=="symbol"?e:e+""}function BK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class jK extends oH{constructor(e){let{calculationTypes:n,viewportHeight:r,scrollOffset:i,totalRows:o,defaultRowHeight:s,rowHeightFn:a,overrideFn:l,horizontalScrollbarHeight:u}=e;super(n),Yr(this,"viewportHeight",0),Yr(this,"scrollOffset",0),Yr(this,"zeroBasedScrollOffset",0),Yr(this,"totalRows",0),Yr(this,"rowHeightFn",null),Yr(this,"rowHeight",0),Yr(this,"overrideFn",null),Yr(this,"horizontalScrollbarHeight",0),Yr(this,"innerViewportHeight",0),Yr(this,"totalCalculatedHeight",0),Yr(this,"startPositions",[]),Yr(this,"needReverse",!0),this.defaultHeight=s,this.viewportHeight=r,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalRows=o,this.rowHeightFn=a,this.overrideFn=l,this.horizontalScrollbarHeight=u??0,this.innerViewportHeight=this.zeroBasedScrollOffset+this.viewportHeight-this.horizontalScrollbarHeight,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalRows;e++)if(this.rowHeight=this.getRowHeight(e),this._process(e,this),this.startPositions.push(this.totalCalculatedHeight),this.totalCalculatedHeight+=this.rowHeight,this.totalCalculatedHeight>=this.innerViewportHeight){this.needReverse=!1;break}this._finalize(this)}getRowHeight(e){const n=this.rowHeightFn(e);return isNaN(n)?this.defaultHeight:n}}function UK(t,e,n){zK(t,e),e.set(t,n)}function zK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sH(t,e,n){return(e=YK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function YK(t){var e=GK(t,"string");return typeof e=="symbol"?e:e+""}function GK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function su(t,e){return t.get(lH(t,e))}function aH(t,e,n){return t.set(lH(t,e),n),n}function lH(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 Vo=new WeakMap;class Aa{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;sH(this,"row",null),sH(this,"col",null),UK(this,Vo,!1),aH(Vo,this,r),typeof e<"u"&&typeof n<"u"&&(this.row=e,this.col=n)}isValid(e){const{countRows:n,countCols:r,countRowHeaders:i,countColHeaders:o}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col)||this.row<-o||this.col<-i||this.row>=n||this.col>=r)}isEqual(e){return e===this?!0:this.row===e.row&&this.col===e.col}isHeader(){return!this.isCell()}isCell(){return this.row>=0&&this.col>=0}isRtl(){return su(Vo,this)}isSouthEastOf(e){return this.row>=e.row&&(su(Vo,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(su(Vo,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(su(Vo,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(su(Vo,this)?this.col<=e.col:this.col>=e.col)}normalize(){return this.row=this.row===null?this.row:Math.max(this.row,0),this.col=this.col===null?this.col:Math.max(this.col,0),this}assign(e){return Number.isInteger(e?.row)&&(this.row=e.row),Number.isInteger(e?.col)&&(this.col=e.col),e instanceof Aa&&aH(Vo,this,e.isRtl()),this}clone(){return new Aa(this.row,this.col,su(Vo,this))}toObject(){return{row:this.row,col:this.col}}}function qK(t,e,n){KK(t,e),e.set(t,n)}function KK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jS(t,e,n){return(e=XK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function XK(t){var e=ZK(t,"string");return typeof e=="symbol"?e:e+""}function ZK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gr(t,e){return t.get(uH(t,e))}function QK(t,e,n){return t.set(uH(t,e),n),n}function uH(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 rr=new WeakMap;class Jc{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;jS(this,"highlight",null),jS(this,"from",null),jS(this,"to",null),qK(this,rr,!1),this.highlight=e.clone(),this.from=n.clone(),this.to=r.clone(),QK(rr,this,i)}setHighlight(e){return this.highlight=e.clone(),this}setFrom(e){return this.from=e.clone(),this}setTo(e){return this.to=e.clone(),this}normalize(){return this.highlight.normalize(),this.from.normalize(),this.to.normalize(),this}isValid(e){return this.from.isValid(e)&&this.to.isValid(e)}isSingle(){return this.isSingleCell()||this.isSingleHeader()}isSingleCell(){return this.from.row>=0&&this.from.row===this.to.row&&this.from.col>=0&&this.from.col===this.to.col}isSingleHeader(){return(this.from.row<0||this.from.col<0)&&this.from.row===this.to.row&&this.from.col===this.to.col}isHeader(){return this.from.isHeader()&&this.to.isHeader()?!0:this.from.col<0&&this.to.col<0||this.from.row<0&&this.to.row<0}containsHeaders(){return this.from.isHeader()||this.to.isHeader()}getOuterHeight(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1}getOuterWidth(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1}getHeight(){if(this.from.row<0&&this.to.row<0)return 0;const e=Math.max(this.from.row,0),n=Math.max(this.to.row,0);return Math.max(e,n)-Math.min(e,n)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),n=Math.max(this.to.col,0);return Math.max(e,n)-Math.min(e,n)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:n,col:r}=e,i=this.getOuterTopStartCorner(),o=this.getOuterBottomEndCorner();return i.row<=n&&o.row>=n&&i.col<=r&&o.col>=r}includesRange(e){return this.includes(e.getOuterTopStartCorner())&&this.includes(e.getOuterBottomEndCorner())}isEqual(e){return Math.min(this.from.row,this.to.row)===Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)===Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)===Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)===Math.max(e.from.col,e.to.col)}overlaps(e){return e.isSouthEastOf(this.getOuterTopLeftCorner())&&e.isNorthWestOf(this.getOuterBottomRightCorner())}isSouthEastOf(e){return this.getOuterTopLeftCorner().isSouthEastOf(e)||this.getOuterBottomRightCorner().isSouthEastOf(e)}isNorthWestOf(e){return this.getOuterTopLeftCorner().isNorthWestOf(e)||this.getOuterBottomRightCorner().isNorthWestOf(e)}isOverlappingHorizontally(e){return this.getOuterTopEndCorner().col>=e.getOuterTopStartCorner().col&&this.getOuterTopEndCorner().col<=e.getOuterTopEndCorner().col||this.getOuterTopStartCorner().col<=e.getOuterTopEndCorner().col&&this.getOuterTopStartCorner().col>=e.getOuterTopStartCorner().col}isOverlappingVertically(e){return this.getOuterBottomStartCorner().row>=e.getOuterTopRightCorner().row&&this.getOuterBottomStartCorner().row<=e.getOuterBottomStartCorner().row||this.getOuterTopEndCorner().row<=e.getOuterBottomStartCorner().row&&this.getOuterTopEndCorner().row>=e.getOuterTopRightCorner().row}expand(e){const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();return e.row<n.row||e.col<n.col||e.row>r.row||e.col>r.col?(this.from=this._createCellCoords(Math.min(n.row,e.row),Math.min(n.col,e.col)),this.to=this._createCellCoords(Math.max(r.row,e.row),Math.max(r.col,e.col)),!0):!1}expandByRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(this.includesRange(e)||!this.overlaps(e))return!1;const r=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner(),o=this.getDirection(),s=e.getOuterTopStartCorner(),a=e.getOuterBottomEndCorner(),l=Math.min(r.row,s.row),u=Math.min(r.col,s.col),c=Math.max(i.row,a.row),h=Math.max(i.col,a.col),d=this._createCellCoords(l,u),f=this._createCellCoords(c,h);return this.from=d,this.to=f,this.setDirection(o),n&&(this.highlight.row===this.getOuterBottomRightCorner().row&&this.getVerticalDirection()==="N-S"&&this.flipDirectionVertically(),this.highlight.col===this.getOuterTopRightCorner().col&&this.getHorizontalDirection()==="W-E"&&this.flipDirectionHorizontally()),!0}getDirection(){if(this.from.isNorthWestOf(this.to))return"NW-SE";if(this.from.isNorthEastOf(this.to))return"NE-SW";if(this.from.isSouthEastOf(this.to))return"SE-NW";if(this.from.isSouthWestOf(this.to))return"SW-NE"}setDirection(e){switch(e){case"NW-SE":[this.from,this.to]=[this.getOuterTopLeftCorner(),this.getOuterBottomRightCorner()];break;case"NE-SW":[this.from,this.to]=[this.getOuterTopRightCorner(),this.getOuterBottomLeftCorner()];break;case"SE-NW":[this.from,this.to]=[this.getOuterBottomRightCorner(),this.getOuterTopLeftCorner()];break;case"SW-NE":[this.from,this.to]=[this.getOuterBottomLeftCorner(),this.getOuterTopRightCorner()];break}}getVerticalDirection(){return["NE-SW","NW-SE"].indexOf(this.getDirection())>-1?"N-S":"S-N"}getHorizontalDirection(){return["NW-SE","SW-NE"].indexOf(this.getDirection())>-1?"W-E":"E-W"}flipDirectionVertically(){switch(this.getDirection()){case"NW-SE":this.setDirection("SW-NE");break;case"NE-SW":this.setDirection("SE-NW");break;case"SE-NW":this.setDirection("NE-SW");break;case"SW-NE":this.setDirection("NW-SE");break}}flipDirectionHorizontally(){switch(this.getDirection()){case"NW-SE":this.setDirection("NE-SW");break;case"NE-SW":this.setDirection("NW-SE");break;case"SE-NW":this.setDirection("SW-NE");break;case"SW-NE":this.setDirection("SE-NW");break}}getTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getTopLeftCorner(){return Gr(rr,this)?this.getTopEndCorner():this.getTopStartCorner()}getBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getBottomRightCorner(){return Gr(rr,this)?this.getBottomStartCorner():this.getBottomEndCorner()}getTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getTopRightCorner(){return Gr(rr,this)?this.getTopStartCorner():this.getTopEndCorner()}getBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getBottomLeftCorner(){return Gr(rr,this)?this.getBottomEndCorner():this.getBottomStartCorner()}getOuterTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterTopLeftCorner(){return Gr(rr,this)?this.getOuterTopEndCorner():this.getOuterTopStartCorner()}getOuterBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterBottomRightCorner(){return Gr(rr,this)?this.getOuterBottomStartCorner():this.getOuterBottomEndCorner()}getOuterTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterTopRightCorner(){return Gr(rr,this)?this.getOuterTopStartCorner():this.getOuterTopEndCorner()}getOuterBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterBottomLeftCorner(){return Gr(rr,this)?this.getOuterBottomEndCorner():this.getOuterBottomStartCorner()}isCorner(e){return e.isEqual(this.getOuterTopLeftCorner())||e.isEqual(this.getOuterTopRightCorner())||e.isEqual(this.getOuterBottomLeftCorner())||e.isEqual(this.getOuterBottomRightCorner())}getOppositeCorner(e){if(!(e instanceof Aa))return!1;if(e.isEqual(this.getOuterBottomEndCorner()))return this.getOuterTopStartCorner();if(e.isEqual(this.getOuterTopStartCorner()))return this.getOuterBottomEndCorner();if(e.isEqual(this.getOuterTopEndCorner()))return this.getOuterBottomStartCorner();if(e.isEqual(this.getOuterBottomStartCorner()))return this.getOuterTopEndCorner()}getBordersSharedWith(e){if(!this.includesRange(e))return[];const n={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},r={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},i=[];return n.top===r.top&&i.push("top"),n.right===r.right&&i.push(Gr(rr,this)?"left":"right"),n.bottom===r.bottom&&i.push("bottom"),n.left===r.left&&i.push(Gr(rr,this)?"right":"left"),i}getInner(){const e=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),r=[];for(let i=e.row;i<=n.row;i++)for(let o=e.col;o<=n.col;o++)!(this.from.row===i&&this.from.col===o)&&!(this.to.row===i&&this.to.col===o)&&r.push(this._createCellCoords(i,o));return r}getAll(){const e=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),r=[];for(let i=e.row;i<=n.row;i++)for(let o=e.col;o<=n.col;o++)e.row===i&&e.col===o?r.push(e):n.row===i&&n.col===o?r.push(n):r.push(this._createCellCoords(i,o));return r}forAll(e){const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();for(let i=n.row;i<=r.row;i++)for(let o=n.col;o<=r.col;o++)if(e(i,o)===!1)return}clone(){return new Jc(this.highlight,this.from,this.to,Gr(rr,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,n){return new Aa(e,n,Gr(rr,this))}}function Gi(t,e,n){JK(t,e),e.set(t,n)}function JK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function me(t,e){return t.get(cH(t,e))}function Es(t,e,n){return t.set(cH(t,e),n),n}function cH(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 qr=new WeakMap,US=new WeakMap,Cn=new WeakMap,au=new WeakMap,tg=new WeakMap,Ci=new WeakMap,zS=new WeakMap,eh=new WeakMap,Ha=new WeakMap,qi=new WeakMap;let hH=class{constructor(e,n,r,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;Gi(this,qr,void 0),Gi(this,US,void 0),Gi(this,Cn,void 0),Gi(this,au,void 0),Gi(this,tg,void 0),Gi(this,Ci,void 0),Gi(this,zS,void 0),Gi(this,eh,void 0),Gi(this,Ha,[null,null]),Gi(this,qi,[null,null]),Es(qr,this,r),Es(US,this,n),Es(Cn,this,o),Es(au,this,s),Es(tg,this,a),Es(Ci,this,i),Es(zS,this,e),this.registerEvents()}registerEvents(){me(Ci,this).addEventListener(me(Cn,this).holder,"contextmenu",r=>this.onContextMenu(r)),me(Ci,this).addEventListener(me(Cn,this).TABLE,"mouseover",r=>this.onMouseOver(r)),me(Ci,this).addEventListener(me(Cn,this).TABLE,"mouseout",r=>this.onMouseOut(r));const e=()=>{me(Ci,this).addEventListener(me(Cn,this).holder,"touchstart",r=>this.onTouchStart(r)),me(Ci,this).addEventListener(me(Cn,this).holder,"touchend",r=>this.onTouchEnd(r)),this.momentumScrolling||(this.momentumScrolling={}),me(Ci,this).addEventListener(me(Cn,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||me(qr,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,me(qr,this).getSetting("onAfterMomentumScroll"))},200)})},n=()=>{me(Ci,this).addEventListener(me(Cn,this).holder,"mouseup",r=>this.onMouseUp(r)),me(Ci,this).addEventListener(me(Cn,this).holder,"mousedown",r=>this.onMouseDown(r))};ko()?e():(gx()&&e(),n())}selectedCellWasTouched(e){const r=this.parentCell(e).coords;if(me(eh,this)&&r){const[i,o]=[r.row,me(eh,this).from.row],[s,a]=[r.col,me(eh,this).from.col];return i===o&&s===a}return!1}parentCell(e){const n={},r=me(Cn,this).TABLE,i=Ef(e,["TD","TH"],r);return i?(n.coords=me(Cn,this).getCoords(i),n.TD=i):ye(e,"wtBorder")&&ye(e,"current")?(n.coords=me(au,this).getFocusSelection().cellRange.highlight,n.TD=me(Cn,this).getCell(n.coords)):ye(e,"wtBorder")&&ye(e,"area")&&me(au,this).getAreaSelection().cellRange&&(n.coords=me(au,this).getAreaSelection().cellRange.to,n.TD=me(Cn,this).getCell(n.coords)),n}onMouseDown(e){const n=me(US,this).rootDocument.activeElement,r=kx(Cz,e.target),i=e.target;if(!["TD","TH"].includes(n.nodeName)&&(i===n||r(0)===n||r(1)===n))return;const o=this.parentCell(i);ye(i,"corner")?me(qr,this).getSetting("onCellCornerMouseDown",e,i):o.TD&&me(qr,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,o.coords,o.TD),(e.button===0||this.touchApplied)&&o.TD&&(me(qi,this)[0]=o.TD,clearTimeout(me(Ha,this)[0]),me(Ha,this)[0]=setTimeout(()=>{me(qi,this)[0]=null},1e3))}onContextMenu(e){if(me(qr,this).has("onCellContextMenu")){const n=this.parentCell(e.target);n.TD&&this.callListener("onCellContextMenu",e,n.coords,n.TD)}}onMouseOver(e){if(!me(qr,this).has("onCellMouseOver"))return;const n=me(Cn,this).TABLE,r=Ef(e.target,["TD","TH"],n),i=me(tg,this)||this;r&&r!==i.lastMouseOver&&va(r,n)&&(i.lastMouseOver=r,this.callListener("onCellMouseOver",e,me(Cn,this).getCoords(r),r))}onMouseOut(e){if(!me(qr,this).has("onCellMouseOut"))return;const n=me(Cn,this).TABLE,r=Ef(e.target,["TD","TH"],n),i=Ef(e.relatedTarget,["TD","TH"],n),o=me(tg,this)||this;r&&r!==i&&va(r,n)&&(this.callListener("onCellMouseOut",e,me(Cn,this).getCoords(r),r),i===null&&(o.lastMouseOver=null))}onMouseUp(e){const n=this.parentCell(e.target);n.TD&&me(qr,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,n.coords,n.TD),!(e.button!==0&&!this.touchApplied)&&(n.TD===me(qi,this)[0]&&n.TD===me(qi,this)[1]?(ye(e.target,"corner")?this.callListener("onCellCornerDblClick",e,n.coords,n.TD):this.callListener("onCellDblClick",e,n.coords,n.TD),me(qi,this)[0]=null,me(qi,this)[1]=null):n.TD===me(qi,this)[0]&&(me(qi,this)[1]=n.TD,clearTimeout(me(Ha,this)[1]),me(Ha,this)[1]=setTimeout(()=>{me(qi,this)[1]=null},500)))}onTouchStart(e){Es(eh,this,me(au,this).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var n;const r=e.target,i=(n=this.parentCell(r))===null||n===void 0?void 0:n.coords,o=ce(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&o&&me(qr,this).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];px()&&(Uz()||zz())&&this.selectedCellWasTouched(r)&&!a.includes(r.tagName)?e.preventDefault():this.selectedCellWasTouched(r)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,n,r,i){const o=me(qr,this).getSettingPure(e);o&&o(n,r,i,me(zS,this).call(this))}destroy(){clearTimeout(me(Ha,this)[0]),clearTimeout(me(Ha,this)[1]),me(Ci,this).destroy()}};function YS(t,e,n){return(e=e3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e3(t){var e=t3(t,"string");return typeof e=="symbol"?e:e+""}function t3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class n3{constructor(e,n,r){YS(this,"offset",void 0),YS(this,"total",void 0),YS(this,"countTH",void 0),this.offset=e,this.total=n,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleRowHeadedColumnToSourceColumn(e){return this.renderedToSource(this.offsettedTH(e))}sourceColumnToVisibleRowHeadedColumn(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function GS(t,e,n){return(e=r3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r3(t){var e=i3(t,"string");return typeof e=="symbol"?e:e+""}function i3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class o3{constructor(e,n,r){GS(this,"offset",void 0),GS(this,"total",void 0),GS(this,"countTH",void 0),this.offset=e,this.total=n,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleColHeadedRowToSourceRow(e){return this.renderedToSource(this.offsettedTH(e))}sourceRowToVisibleColHeadedRow(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function ng(t,e,n){return(e=s3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s3(t){var e=a3(t,"string");return typeof e=="symbol"?e:e+""}function a3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class l3{constructor(){ng(this,"currentSize",0),ng(this,"nextSize",0),ng(this,"currentOffset",0),ng(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}const u3=0,dH=1,qS=2;function KS(t,e,n){return(e=c3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c3(t){var e=h3(t,"string");return typeof e=="symbol"?e:e+""}function h3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class d3{constructor(){KS(this,"size",new l3),KS(this,"workingSpace",u3),KS(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return this.sharedSize!==null}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=dH,e.workingSpace=qS,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=qS,e.workingSpace=dH,this.sharedSize=e.getViewSize()}}var fH={},XS,gH;function f3(){if(gH)return XS;gH=1;var t=Yd(),e=TypeError;return XS=function(n,r){if(!delete n[r])throw new e("Cannot delete property "+t(r)+" of "+t(n))},XS}var mH;function g3(){if(mH)return fH;mH=1;var t=vt(),e=Il(),n=Ol(),r=BM(),i=f3(),o=UM(),s=[].unshift(0)!==1,a=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(u){return u instanceof TypeError}},l=s||!a();return t({target:"Array",proto:!0,arity:1,forced:l},{unshift:function(c){var h=e(this),d=n(h),f=arguments.length;if(f){o(d+f);for(var m=d;m--;){var b=m+f;m in h?h[b]=h[m]:i(h,b)}for(var S=0;S<f;S++)h[S]=arguments[S]}return r(h,d+f)}}),fH}g3();function m3(t,e,n){return(e=p3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p3(t){var e=w3(t,"string");return typeof e=="symbol"?e:e+""}function w3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class pH{constructor(e,n){m3(this,"order",[]),this.order=[...Array(n).keys()].map(r=>e+r)}get length(){return this.order.length}has(e){return this.order.indexOf(e)>-1}get(e){return e<this.order.length?this.order[e]:-1}remove(e){this.order.splice(this.order.indexOf(e),1)}prepend(e){return this.order.unshift(e),this.order.pop()}}function v3(t,e,n){return(e=C3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C3(t){var e=y3(t,"string");return typeof e=="symbol"?e:e+""}function y3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class b3{constructor(e){v3(this,"sizeSet",void 0),this.sizeSet=e}diff(){const{sizeSet:e}=this,{currentSize:n,nextSize:r}=e.getViewSize();let i=Math.max(r,n);if(i===0)return[];const{currentOffset:o,nextOffset:s}=e.getViewSize(),a=new pH(o,n),l=new pH(s,r),u=[];for(let c=0;c<i;c++){const h=a.get(c),d=l.get(c);if(d===-1)u.push(["remove",h]);else if(h===-1)!e.isShared()||e.isShared()&&e.isPlaceOn(qS)?u.push(["append",d]):u.push(["prepend",d]);else if(d>h)a.has(d)&&(a.remove(d),r<=a.length&&(i-=1)),u.push(["replace",d,h]);else if(d<h){const f=a.prepend(d);u.push(["insert_before",d,h,f])}else u.push(["none",d])}return u}}function lu(t,e,n){return(e=S3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S3(t){var e=R3(t,"string");return typeof e=="symbol"?e:e+""}function R3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wH{constructor(e,n){lu(this,"rootNode",void 0),lu(this,"nodesPool",void 0),lu(this,"sizeSet",new d3),lu(this,"collectedNodes",[]),lu(this,"viewDiffer",new b3(this.sizeSet)),lu(this,"leads",[]),this.rootNode=e,this.nodesPool=n}setSize(e){return this.sizeSet.setSize(e),this}setOffset(e){return this.sizeSet.setOffset(e),this}isSharedViewSet(){return this.sizeSet.isShared()}getNode(e){return e<this.collectedNodes.length?this.collectedNodes[e]:null}getCurrentNode(){const e=this.collectedNodes.length;return e>0?this.collectedNodes[e-1]:null}applyCommand(e){const{rootNode:n}=this,[r,i,o,s]=e,a=this.nodesPool(i);switch(this.collectedNodes.push(a),r){case"prepend":n.insertBefore(a,n.firstChild);break;case"append":n.appendChild(a);break;case"insert_before":n.insertBefore(a,this.nodesPool(o)),n.removeChild(this.nodesPool(s));break;case"replace":n.replaceChild(a,this.nodesPool(o));break;case"remove":n.removeChild(a);break}}start(){this.collectedNodes.length=0,this.leads=this.viewDiffer.diff()}render(){this.leads.length>0&&this.applyCommand(this.leads.shift())}end(){for(;this.leads.length>0;)this.applyCommand(this.leads.shift())}}class vH extends wH{prependView(e){return this.sizeSet.prepend(e.sizeSet),e.sizeSet.append(this.sizeSet),this}appendView(e){return this.sizeSet.append(e.sizeSet),e.sizeSet.prepend(this.sizeSet),this}}function CH(t,e,n){return(e=E3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function E3(t){var e=T3(t,"string");return typeof e=="symbol"?e:e+""}function T3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class _3{constructor(e){CH(this,"nodeType",void 0),CH(this,"pool",new Map),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(e,n){const i=typeof n=="number"?`${e}x${n}`:e.toString();if(this.pool.has(i))return this.pool.get(i);const o=this.rootDocument.createElement(this.nodeType);return this.pool.set(i,o),o}}function th(t,e,n){return(e=M3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M3(t){var e=I3(t,"string");return typeof e=="symbol"?e:e+""}function I3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nh{constructor(e,n){th(this,"nodesPool",null),th(this,"nodeType",void 0),th(this,"rootNode",void 0),th(this,"table",null),th(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new _3(e):null,this.nodeType=e,this.rootNode=n}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function yH(t,e,n){return(e=P3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function P3(t){var e=O3(t,"string");return typeof e=="symbol"?e:e+""}function O3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class x3 extends nh{constructor(){super("TH"),yH(this,"orderViews",new WeakMap),yH(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new vH(e,r=>this.nodesPool.obtain(this.sourceRowIndex,r)),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,rowHeaderFunctions:n,rowHeadersCount:r,rows:i,cells:o}=this.table;for(let s=0;s<e;s++){const a=this.table.renderedRowToSource(s),l=i.getRenderedNode(s);this.sourceRowIndex=a;const u=this.obtainOrderView(l),c=o.obtainOrderView(l);u.appendView(c).setSize(r).setOffset(0).start();for(let h=r-1;h>=0;h--){u.render();const d=u.getCurrentNode();d.className="",d.removeAttribute("style"),Yl(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Se(d,[QU(),az(),gy(h+1),ma(-1)]),n[h](a,d,h)}u.end()}}}class A3 extends nh{constructor(e){super(null,e)}adjust(){const{columnHeadersCount:e,rowHeadersCount:n}=this.table;let r=this.rootNode.firstChild;if(e){const{columnsToRender:i}=this.table,o=i+n;for(let a=0,l=e;a<l;a++){for(r=this.rootNode.childNodes[a],r||(r=this.table.rootDocument.createElement("tr"),this.rootNode.appendChild(r)),this.renderedNodes=r.childNodes.length;this.renderedNodes<o;)r.appendChild(this.table.rootDocument.createElement("th")),this.renderedNodes+=1;for(;this.renderedNodes>o;)r.removeChild(r.lastChild),this.renderedNodes-=1}const s=this.rootNode.childNodes.length;if(s>e)for(let a=e;a<s;a++)this.rootNode.removeChild(this.rootNode.lastChild)}else r&&No(r)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&Se(this.rootNode,[YO()]);for(let n=0;n<e;n+=1){const{columnHeaderFunctions:r,columnsToRender:i,rowHeadersCount:o}=this.table,s=this.rootNode.childNodes[n];this.table.isAriaEnabled()&&Se(s,[fy(),XO(n+1)]);for(let a=-1*o;a<i;a+=1){const l=this.table.renderedColumnToSource(a),u=s.childNodes[a+o];u.className="",u.removeAttribute("style"),Yl(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Se(u,[gy(a+1+this.table.rowHeadersCount),ma(-1),JU(),...a>=0?[sz()]:[fy()]]),r[n](l,u,n)}}}}let bH=!1;class H3 extends nh{constructor(e){super(null,e)}adjust(){const{columnsToRender:e,rowHeadersCount:n}=this.table,r=e+n;for(;this.renderedNodes<r;)this.rootNode.appendChild(this.table.rootDocument.createElement("col")),this.renderedNodes+=1;for(;this.renderedNodes>r;)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();const{columnsToRender:e,rowHeadersCount:n}=this.table;!bH&&e>1e3&&(bH=!0,et(tt`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
38
- Consider limiting the number of rendered columns by specifying the table width and/or\x20
39
- turning off the "renderAllColumns" option.`));for(let i=0;i<n;i++){const o=this.table.renderedColumnToSource(i),s=this.table.columnUtils.getHeaderWidth(o);this.rootNode.childNodes[i].style.width=`${s}px`}for(let i=0;i<e;i++){const o=this.table.renderedColumnToSource(i),s=this.table.columnUtils.getWidth(o);this.rootNode.childNodes[i+n].style.width=`${s}px`}const r=this.rootNode.firstChild;r&&X(r,"rowHeader")}}function N3(t,e,n){return(e=D3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D3(t){var e=k3(t,"string");return typeof e=="symbol"?e:e+""}function k3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const uu={rowEven:"ht__row_even",rowOdd:"ht__row_odd"};let SH=!1;class L3 extends nh{constructor(e){super("TR",e),N3(this,"orderView",void 0),this.orderView=new wH(e,n=>this.nodesPool.obtain(n))}getRenderedNode(e){return this.orderView.getNode(e)}hasStaleContent(e){return this.orderView.hasStaleContent(e)}render(){const{rowsToRender:e}=this.table;!SH&&e>1e3&&(SH=!0,et(tt`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
40
- Consider limiting the number of rendered rows by specifying the table height and/or\x20
41
- turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&Se(this.rootNode,[YO()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let i=0;i<e;i++){this.orderView.render();const o=this.orderView.getCurrentNode(),s=this.table.renderedRowToSource(i);if(this.table.isAriaEnabled()){var n,r;Se(o,[fy(),XO(s+((n=(r=this.table.rowUtils)===null||r===void 0||(r=r.dataAccessObject)===null||r===void 0?void 0:r.columnHeaders.length)!==null&&n!==void 0?n:0)+1)])}(s+1)%2===0?ye(o,uu.rowEven)||(ve(o,uu.rowOdd),X(o,uu.rowEven)):ye(o,uu.rowOdd)||(ve(o,uu.rowEven),X(o,uu.rowOdd))}this.orderView.end()}}function RH(t,e,n){return(e=$3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $3(t){var e=F3(t,"string");return typeof e=="symbol"?e:e+""}function F3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class V3 extends nh{constructor(){super("TD"),RH(this,"orderViews",new WeakMap),RH(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new vH(e,r=>this.nodesPool.obtain(this.sourceRowIndex,r),this.nodeType),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,columnsToRender:n,rows:r,rowHeaders:i}=this.table;for(let a=0;a<e;a++){const l=this.table.renderedRowToSource(a),u=r.getRenderedNode(a);this.sourceRowIndex=l;const c=this.obtainOrderView(u),h=i.obtainOrderView(u);c.prependView(h).setSize(n).setOffset(0).start();for(let d=0;d<n;d++){c.render();const f=this.table.renderedColumnToSource(d),m=c.getCurrentNode();if(ye(m,"hide")||(m.className=""),m.removeAttribute("style"),m.removeAttribute("dir"),Yl(m,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,f,m),this.table.isAriaEnabled()){var o,s;Se(m,[...m.hasAttribute("role")?[]:[ZU()],ma(-1),gy(f+((o=(s=this.table.rowUtils)===null||s===void 0||(s=s.dataAccessObject)===null||s===void 0?void 0:s.rowHeaders.length)!==null&&o!==void 0?o:0)+1)])}}c.end()}}}function ln(t,e,n){return(e=W3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function W3(t){var e=B3(t,"string");return typeof e=="symbol"?e:e+""}function B3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class j3{constructor(e){let{cellRenderer:n,stylesHandler:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ln(this,"rootNode",void 0),ln(this,"rootDocument",void 0),ln(this,"rowHeaders",null),ln(this,"columnHeaders",null),ln(this,"colGroup",null),ln(this,"rows",null),ln(this,"cells",null),ln(this,"rowFilter",null),ln(this,"columnFilter",null),ln(this,"rowUtils",null),ln(this,"columnUtils",null),ln(this,"rowsToRender",0),ln(this,"columnsToRender",0),ln(this,"rowHeaderFunctions",[]),ln(this,"rowHeadersCount",0),ln(this,"columnHeaderFunctions",[]),ln(this,"columnHeadersCount",0),ln(this,"cellRenderer",void 0),ln(this,"activeOverlayName",void 0),ln(this,"stylesHandler",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=n,this.stylesHandler=r}setActiveOverlayName(e){this.activeOverlayName=e}setAxisUtils(e,n){this.rowUtils=e,this.columnUtils=n}setViewportSize(e,n){this.rowsToRender=e,this.columnsToRender=n}setFilters(e,n){this.rowFilter=e,this.columnFilter=n}setHeaderContentRenderers(e,n){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=n,this.columnHeadersCount=n.length}setRenderers(){let{rowHeaders:e,columnHeaders:n,colGroup:r,rows:i,cells:o}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.setTable(this),n.setTable(this),r.setTable(this),i.setTable(this),o.setTable(this),this.rowHeaders=e,this.columnHeaders=n,this.colGroup=r,this.rows=i,this.cells=o}renderedRowToSource(e){return this.rowFilter.renderedToSource(e)}renderedColumnToSource(e){return this.columnFilter.renderedToSource(e)}isAriaEnabled(){return this.rowUtils.wtSettings.getSetting("ariaTags")}render(){this.colGroup.adjust(),this.columnHeaders.adjust(),this.rows.adjust(),this.rowHeaders.adjust(),this.columnHeaders.render(),this.rows.render(),this.rowHeaders.render(),this.cells.render(),this.columnUtils.calculateWidths(),this.colGroup.render();const{rowsToRender:e,rows:n}=this;for(let r=0;r<e;r++){const i=n.getRenderedNode(r),o=this.rowUtils;if(i.firstChild){const s=this.renderedRowToSource(r),a=o.getHeightByOverlayName(s,this.activeOverlayName),u=this.stylesHandler.areCellsBorderBox()?0:1;a?i.firstChild.style.height=`${a-u}px`:i.firstChild.style.height=""}}}}class U3{constructor(){let{TABLE:e,THEAD:n,COLGROUP:r,TBODY:i,rowUtils:o,columnUtils:s,cellRenderer:a,stylesHandler:l}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.renderer=new j3(e,{cellRenderer:a,stylesHandler:l}),this.renderer.setRenderers({rowHeaders:new x3,columnHeaders:new A3(n),colGroup:new H3(r),rows:new L3(i),cells:new V3}),this.renderer.setAxisUtils(o,s)}setActiveOverlayName(e){return this.renderer.setActiveOverlayName(e),this}setFilters(e,n){return this.renderer.setFilters(e,n),this}setViewportSize(e,n){return this.renderer.setViewportSize(e,n),this}setHeaderContentRenderers(e,n){return this.renderer.setHeaderContentRenderers(e,n),this}adjust(){this.renderer.adjust()}render(){this.renderer.render()}}function ZS(t,e,n){return(e=z3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function z3(t){var e=Y3(t,"string");return typeof e=="symbol"?e:e+""}function Y3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class G3{constructor(e,n){ZS(this,"dataAccessObject",void 0),ZS(this,"wtSettings",void 0),ZS(this,"headerWidths",new Map),this.dataAccessObject=e,this.wtSettings=n}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getHeaderHeight(e){let n=this.dataAccessObject.stylesHandler.getDefaultRowHeight();const r=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return r!==void 0&&(n=n?Math.max(n,r):r),n}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}calculateWidths(){const{wtSettings:e}=this;let n=e.getSetting("rowHeaderWidth");if(n=e.getSetting("onModifyRowHeaderWidth",n),n!=null){const r=e.getSetting("rowHeaders").length,i=e.getSetting("defaultColumnWidth");for(let o=0;o<r;o++){let s=Array.isArray(n)?n[o]:n;s=s??i,this.headerWidths.set(o,s)}}}}function EH(t,e,n){return(e=q3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function q3(t){var e=K3(t,"string");return typeof e=="symbol"?e:e+""}function K3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class X3{constructor(e,n){EH(this,"dataAccessObject",void 0),EH(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=n}getHeight(e){let n=this.wtSettings.getSetting("rowHeight",e);const r=this.dataAccessObject.wtViewport.oversizedRows[e];return r!==void 0&&(n=n===void 0?r:Math.max(n,r)),n}getHeightByOverlayName(e,n){let r=this.wtSettings.getSetting("rowHeightByOverlayName",e,n);const i=this.dataAccessObject.wtViewport.oversizedRows[e];return i!==void 0&&(r=r===void 0?i:Math.max(r,i)),r}}function Ki(t,e,n){return(e=Z3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Z3(t){var e=Q3(t,"string");return typeof e=="symbol"?e:e+""}function Q3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class cu{constructor(e,n,r,i,o){Ki(this,"wtSettings",null),Ki(this,"domBindings",void 0),Ki(this,"TBODY",null),Ki(this,"THEAD",null),Ki(this,"COLGROUP",null),Ki(this,"hasTableHeight",!0),Ki(this,"hasTableWidth",!0),Ki(this,"isTableVisible",!1),Ki(this,"tableOffset",0),Ki(this,"holderOffset",0),this.domBindings=r,this.isMaster=o==="master",this.name=o,this.dataAccessObject=e,this.facadeGetter=n,this.wtSettings=i,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=r.rootTable,nx(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.isMaster&&this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.rowFilter=null,this.columnFilter=null,this.correctHeaderWidth=!1;const s=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",()=>this._modifyRowHeaderWidth(s)),this.rowUtils=new X3(this.dataAccessObject,this.wtSettings),this.columnUtils=new G3(this.dataAccessObject,this.wtSettings),this.tableRenderer=new U3({TABLE:this.TABLE,THEAD:this.THEAD,COLGROUP:this.COLGROUP,TBODY:this.TBODY,rowUtils:this.rowUtils,columnUtils:this.columnUtils,cellRenderer:this.wtSettings.getSettingPure("cellRenderer"),stylesHandler:this.dataAccessObject.stylesHandler})}is(e){return this.name===e}fixTableDomTree(){const e=this.domBindings.rootDocument;this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=e.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=e.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=e.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD))}createSpreader(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ye(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtSpreader",n&&n.insertBefore(r,e),r.appendChild(e)),r.style.position="relative",this.wtSettings.getSetting("ariaTags")&&Se(r,[Ho()]),r}createHider(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ye(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtHider",n&&n.insertBefore(r,e),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Se(r,[Ho()]),r}createHolder(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ye(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.style.position="relative",r.className="wtHolder",Se(r,[ma(-1)]),n&&n.insertBefore(r,e),this.isMaster&&(r.parentNode.className+="ht_master handsontable",r.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&Se(r.parentNode,[Ho()])),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Se(r,[Ho()]),r}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this,{wtOverlays:r,wtViewport:i}=this.dataAccessObject,o=n.getSetting("totalRows"),s=n.getSetting("totalColumns"),a=n.getSetting("rowHeaders"),l=a.length,u=n.getSetting("columnHeaders"),c=u.length;let h=e;if(this.isMaster&&(r.beforeDraw(),this.holderOffset=On(this.holder),h=i.createCalculators(h),l&&!n.getSetting("fixedColumnsStart"))){const f=r.inlineStartOverlay.getScrollPosition(),m=this.correctHeaderWidth;this.correctHeaderWidth=f!==0,m!==this.correctHeaderWidth&&(h=!1)}if(h)this.isMaster&&r.refresh(!0);else{this.isMaster?this.tableOffset=On(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const f=Math.max(this.getFirstRenderedRow(),0),m=Math.max(this.getFirstRenderedColumn(),0);this.rowFilter=new o3(f,o,c),this.columnFilter=new n3(m,s,l);let b=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const S={};this.wtSettings.getSetting("beforeDraw",!0,S),b=S.skipRender!==!0}b&&(this.tableRenderer.setHeaderContentRenderers(a,u),(this.is(Xi)||this.is(Ts))&&this.tableRenderer.setHeaderContentRenderers(a,[]),this.resetOversizedRows(),this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render(),this.isMaster&&this.markOversizedColumnHeaders(),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(Xi))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||i.createVisibleCalculators(),r.refresh(!1),r.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(Xi)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize())}let d=!1;return this.isMaster&&(d=r.topOverlay.resetFixedPosition(),r.bottomOverlay.clone&&(d=r.bottomOverlay.resetFixedPosition()||d),d=r.inlineStartOverlay.resetFixedPosition()||d,r.topInlineStartCornerOverlay&&r.topInlineStartCornerOverlay.resetFixedPosition(),r.bottomInlineStartCornerOverlay&&r.bottomInlineStartCornerOverlay.clone&&r.bottomInlineStartCornerOverlay.resetFixedPosition()),d?(r.refreshAll(),r.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(h),this.isMaster&&r.afterDraw(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const n=this.columnFilter.renderedToSource(e);let r=this.wtSettings.getSetting("columnHeaders").length;const i=this.dataAccessObject.stylesHandler.getDefaultRowHeight();let o,s,a;const l=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;r;)r-=1,o=this.getColumnHeaderHeight(r),s=this.getColumnHeader(n,r),s&&(a=Wc(s),(!o&&i<a||o<a)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=a),Array.isArray(l)?l[r]!==null&&l[r]!==void 0&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=l[r]):isNaN(l)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=l),this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]<(l[r]||l)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=l[r]||l))}adjustColumnHeaderHeights(){const{wtSettings:e}=this,n=this.THEAD.childNodes,r=this.dataAccessObject.wtViewport.oversizedColumnHeaders,i=e.getSetting("columnHeaders");for(let o=0,s=i.length;o<s;o++)if(r[o]){if(!n[o]||n[o].childNodes.length===0)return;n[o].childNodes[0].style.height=`${r[o]}px`}}resetOversizedRows(){const{wtSettings:e}=this,{wtViewport:n}=this.dataAccessObject;if(!(!this.isMaster&&!this.is(Xi))&&!e.getSetting("externalRowCalculator")){const r=this.getRenderedRowsCount();for(let i=0;i<r;i++){const o=this.rowFilter.renderedToSource(i);n.oversizedRows&&n.oversizedRows[o]&&(n.oversizedRows[o]=void 0)}}}getCell(e){let n=e.row,r=e.col;const i=this.wtSettings.getSetting("onModifyGetCellCoords",n,r,!this.isMaster,"render");if(i&&Array.isArray(i)&&([n,r]=i),this.isRowBeforeRenderedRows(n))return-1;if(this.isRowAfterRenderedRows(n))return-2;if(this.isColumnBeforeRenderedColumns(r))return-3;if(this.isColumnAfterRenderedColumns(r))return-4;const o=this.getRow(n);if(!o&&n>=0)throw new Error("TR was expected to be rendered but is not");const s=o.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(r)];if(!s&&r>=0)throw new Error("TD or TH was expected to be rendered but is not");return s}getRow(e){let n=null,r=null;if(e<0){var i;n=(i=this.rowFilter)===null||i===void 0?void 0:i.sourceRowToVisibleColHeadedRow(e),r=this.THEAD}else{var o;n=(o=this.rowFilter)===null||o===void 0?void 0:o.sourceToRendered(e),r=this.TBODY}return n!==void 0&&r!==void 0?r.childNodes.length<n+1?!1:r.childNodes[n]:!1}getColumnHeader(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.THEAD.childNodes[n];return r?.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const n=[],r=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach(i=>{const o=i.childNodes[r];o&&n.push(o)}),n}getRowHeader(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.wtSettings.getSetting("rowHeaders").length;if(n>=r)return;const i=this.rowFilter.sourceToRendered(e),o=i<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):i,a=(i<0?this.THEAD:this.TBODY).childNodes[o];return a?.childNodes[n]}getRowHeaders(e){const n=[],r=this.wtSettings.getSetting("rowHeaders").length;for(let i=0;i<r;i++){const o=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)],s=o?.childNodes[i];s&&n.push(s)}return n}getCoords(e){let n=e;if(n.nodeName!=="TD"&&n.nodeName!=="TH"&&(n=wa(n,["TD","TH"])),n===null)return null;const r=n.parentNode;if(!r)return null;const i=r.parentNode;let o=Sz(r),s=n.cellIndex;Ca(ka,n,this.wtRootElement)||Ca(Na,n,this.wtRootElement)?i.nodeName==="THEAD"&&(o-=i.childNodes.length):Ca(Ts,n,this.wtRootElement)||Ca(Xi,n,this.wtRootElement)?o=this.wtSettings.getSetting("totalRows")-i.childNodes.length+o:i===this.THEAD?o=this.rowFilter.visibleColHeadedRowToSourceRow(o):this.rowFilter&&(o=this.rowFilter.renderedToSource(o)),Ca(ka,n,this.wtRootElement)||Ca(Da,n,this.wtRootElement)||Ca(Ts,n,this.wtRootElement)?s=this.columnFilter.offsettedTH(s):this.columnFilter&&(s=this.columnFilter.visibleRowHeadedColumnToSourceColumn(s));const a=this.wtSettings.getSetting("onModifyGetCoordsElement",o,s);return a&&Array.isArray(a)&&([o,s]=a),this.wot.createCellCoords(o,s)}markOversizedRows(){if(this.wtSettings.getSetting("externalRowCalculator"))return;let e=this.TBODY.childNodes.length;const n=e*this.dataAccessObject.stylesHandler.getDefaultRowHeight(),r=Wc(this.TBODY)-1,i=this.wot.stylesHandler.areCellsBorderBox(),o=i?an:Wc,s=i?0:1,a=i?1:0;let l,u,c,h,d;if(!(n===r&&!this.wtSettings.getSetting("fixedRowsBottom")))for(;e;){e-=1,c=this.rowFilter.renderedToSource(e),l=this.getRowHeight(c),h=this.getTrForRow(c),d=h.querySelector("th");const f=c===0?a:0;d?u=o(d):u=o(h)-s,(!l&&this.dataAccessObject.stylesHandler.getDefaultRowHeight()<u-f||l<u)&&(i||(u+=1),this.dataAccessObject.wtViewport.oversizedRows[c]=u)}}getTrForRow(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]}isColumnHeaderRendered(e){if(e>=0)return!1;const r=this.wtSettings.getSetting("rowHeaders").length;return Math.abs(e)<=r}isRowHeaderRendered(e){if(e>=0)return!1;const r=this.wtSettings.getSetting("columnHeaders").length;return Math.abs(e)<=r}isRowBeforeRenderedRows(e){const n=this.getFirstRenderedRow();return e<0&&n<=0?!this.isRowHeaderRendered(e):e<n}isRowAfterRenderedRows(e){return e>this.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){const n=this.getFirstRenderedColumn();return e<0&&n<=0?!this.isColumnHeaderRendered(e):e<n}isColumnAfterRenderedColumns(e){return this.columnFilter&&e>this.getLastRenderedColumn()}isColumnAfterViewport(e){return this.columnFilter&&e>this.getLastVisibleColumn()}isRowAfterViewport(e){return this.rowFilter&&e>this.getLastVisibleRow()}isColumnBeforeViewport(e){return this.columnFilter&&this.columnFilter.sourceToRendered(e)<0&&e>=0}isLastRowFullyVisible(){return this.getLastVisibleRow()===this.getLastRenderedRow()}isLastColumnFullyVisible(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()}allRowsInViewport(){return this.wtSettings.getSetting("totalRows")===this.getVisibleRowsCount()}allColumnsInViewport(){return this.wtSettings.getSetting("totalColumns")===this.getVisibleColumnsCount()}getRowHeight(e){return this.rowUtils.getHeight(e)}getColumnHeaderHeight(e){return this.columnUtils.getHeaderHeight(e)}getColumnWidth(e){return this.columnUtils.getWidth(e)}hasDefinedSize(){return this.hasTableHeight&&this.hasTableWidth}getWidth(){return Qt(this.TABLE)}getHeight(){return an(this.TABLE)}getTotalWidth(){const e=Qt(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=an(this.hider);return e!==0?e:this.getHeight()}isVisible(){return ql(this.TABLE)}_modifyRowHeaderWidth(e){let n=rt(e)?e():null;return Array.isArray(n)?(n=[...n],n[n.length-1]=this._correctRowHeaderWidth(n[n.length-1])):n=this._correctRowHeaderWidth(n),n}_correctRowHeaderWidth(e){let n=e;return typeof e!="number"&&(n=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(n+=1),n}}const J3="stickyRowsBottom",QS={getFirstRenderedRow(){const t=this.getRenderedRowsCount();return t===0?-1:this.wtSettings.getSetting("totalRows")-t},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()===0?-1:this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsBottom"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return 0}};Ao(QS,"MIXIN_NAME",J3,{writable:!1,enumerable:!1});const eX="stickyColumnsStart",rg={getFirstRenderedColumn(){return this.getRenderedColumnsCount()===0?-1:0},getFirstVisibleColumn(){return this.getFirstRenderedColumn()},getFirstPartiallyVisibleColumn(){return this.getFirstRenderedColumn()},getLastRenderedColumn(){return this.getRenderedColumnsCount()-1},getLastVisibleColumn(){return this.getLastRenderedColumn()},getLastPartiallyVisibleColumn(){return this.getLastRenderedColumn()},getRenderedColumnsCount(){return Math.min(this.wtSettings.getSetting("totalColumns"),this.wtSettings.getSetting("fixedColumnsStart"))},getVisibleColumnsCount(){return this.getRenderedColumnsCount()},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};Ao(rg,"MIXIN_NAME",eX,{writable:!1,enumerable:!1});class JS extends cu{constructor(e,n,r,i){super(e,n,r,i,Ts)}}ct(JS,QS),ct(JS,rg);const Na="top",Xi="bottom",Da="inline_start",ka="top_inline_start_corner",Ts="bottom_inline_start_corner",TH=[Na,Xi,Da,ka,Ts],tX=new Map([[Na,`ht_clone_${Na}`],[Xi,`ht_clone_${Xi}`],[Da,`ht_clone_${Da} ht_clone_left`],[ka,`ht_clone_${ka} ht_clone_top_left_corner`],[Ts,`ht_clone_${Ts} ht_clone_bottom_left_corner`]]);function nX(t,e){rX(t,e),e.add(t)}function rX(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function iX(t,e,n){return(e=oX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oX(t){var e=sX(t,"string");return typeof e=="symbol"?e:e+""}function sX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ig(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 rh=new WeakSet;class aX{constructor(e){nX(this,rh),iX(this,"dataAccessObject",void 0),this.dataAccessObject=e}scrollViewport(e,n,r){if(e.col<0||e.row<0)return!1;const i=this.scrollViewportHorizontally(e.col,n),o=this.scrollViewportVertically(e.row,r);return i||o}scrollViewportHorizontally(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:r,totalColumns:i}=this.dataAccessObject;if(!r)return!1;const o=br(n);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e,o),!Number.isInteger(e)||e<0||e>i)return!1;n=o.value;const{fixedColumnsStart:s,inlineStartOverlay:a}=this.dataAccessObject,l=n==="auto";if(l&&e<s)return!1;const u=this.getFirstVisibleColumn(),c=this.getLastVisibleColumn();let h=!1;return(l&&(e<u||e>c)||!l)&&(h=a.scrollTo(e,l?e>=this.getLastPartiallyVisibleColumn():n==="end")),h}scrollViewportVertically(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:r,totalRows:i}=this.dataAccessObject;if(!r)return!1;const o=br(n);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e,o),!Number.isInteger(e)||e<0||e>i)return!1;n=o.value;const{fixedRowsBottom:s,fixedRowsTop:a,topOverlay:l}=this.dataAccessObject,u=n==="auto";if(u&&(e<a||e>i-s-1))return!1;const c=this.getFirstVisibleRow(),h=this.getLastVisibleRow();let d=!1;return(u&&(e<c||e>h)||!u)&&(d=l.scrollTo(e,u?e>=this.getLastPartiallyVisibleRow():n==="bottom")),d}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return ig(rh,this,MH).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return ig(rh,this,MH).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return ig(rh,this,_H).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return ig(rh,this,_H).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function _H(t){const{wtSettings:e,inlineStartOverlay:n,wtTable:r,wtViewport:i,totalColumns:o,rootWindow:s}=this.dataAccessObject;if(n.mainTableScrollableElement===s){const a=e.getSetting("rtlMode");let l=null;if(a){const c=r.TABLE.getBoundingClientRect(),d=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;l=Math.abs(c.right-d)}else l=On(r.wtRootElement).left;const u=Math.abs(ix(s,s));if(l>u){const c=ox(s);let h=i.getRowHeaderWidth();for(let d=1;d<=o;d++)if(h+=n.sumCellSizes(d-1,d),l+h-u>=c){t=d-2;break}}}return t}function MH(t){const{topOverlay:e,wtTable:n,wtViewport:r,totalRows:i,rootWindow:o}=this.dataAccessObject;if(e.mainTableScrollableElement===o){const s=On(n.wtRootElement),a=wy(o,o);if(s.top>a){const l=Wc(o);let u=r.getColumnHeaderHeight();for(let c=1;c<=i;c++)if(u+=e.sumCellSizes(c-1,c),s.top+u-a>=l){t=c-2;break}}}return t}function Kr(t,e,n){return(e=lX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lX(t){var e=uX(t,"string");return typeof e=="symbol"?e:e+""}function uX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class eR{get eventManager(){return new gi(this)}constructor(e,n){Kr(this,"wtTable",void 0),Kr(this,"wtScroll",void 0),Kr(this,"wtViewport",void 0),Kr(this,"wtOverlays",void 0),Kr(this,"selectionManager",void 0),Kr(this,"wtEvent",void 0),Kr(this,"guid",`wt_${BO()}`),Kr(this,"drawInterrupted",!1),Kr(this,"drawn",!1),Kr(this,"activeOverlayName","master"),Kr(this,"domBindings",void 0),Kr(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=n,this.wtScroll=new aX(this.createScrollDao())}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let n=0,r=this.wtTable.THEAD.childNodes[0].childNodes.length;n<r;n++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(n,r){ya(r,e[n])}])}}createCellCoords(e,n){return new Aa(e,n,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,n,r){return new Jc(e,n,r,this.wtSettings.getSetting("rtlMode"))}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.drawInterrupted=!1,!this.wtTable.isVisible()||Ez(this.wtTable.wtRootElement.parentNode)?this.drawInterrupted=!0:this.wtTable.draw(e),this}getCell(e){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1))return this.wtTable.getCell(e);const r=this.wtSettings.getSetting("totalRows"),i=this.wtSettings.getSetting("fixedRowsTop"),o=this.wtSettings.getSetting("fixedRowsBottom"),s=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<i&&e.col<s)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<i)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<s&&e.row>=r-o){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col<s)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);if(e.row<r&&e.row>=r-o&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,n,r){return this.wtScroll.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this.wtScroll.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this.wtScroll.scrollViewportVertically(e,n)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){const e=this;return{get drawn(){return e.drawn},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get wtTable(){return e.wtTable},get wtViewport(){return e.wtViewport},get wtSettings(){return e.wtSettings},get rootWindow(){return e.domBindings.rootWindow},get totalRows(){return e.wtSettings.getSetting("totalRows")},get totalColumns(){return e.wtSettings.getSetting("totalColumns")},get fixedRowsTop(){return e.wtSettings.getSetting("fixedRowsTop")},get fixedRowsBottom(){return e.wtSettings.getSetting("fixedRowsBottom")},get fixedColumnsStart(){return e.wtSettings.getSetting("fixedColumnsStart")}}}getTableDao(){const e=this;return{get wot(){return e},get parentTableOffset(){return e.cloneSource.wtTable.tableOffset},get cloneSource(){return e.cloneSource},get workspaceWidth(){return e.wtViewport.getWorkspaceWidth()},get wtViewport(){return e.wtViewport},get wtOverlays(){return e.wtOverlays},get selectionManager(){return e.selectionManager},get stylesHandler(){return e.stylesHandler},get drawn(){return e.drawn},set drawn(n){e.drawn=n},get wtTable(){return e.wtTable},get startColumnRendered(){return e.wtViewport.columnsRenderCalculator.startColumn},get startColumnVisible(){return e.wtViewport.columnsVisibleCalculator.startColumn},get startColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.startColumn},get endColumnRendered(){return e.wtViewport.columnsRenderCalculator.endColumn},get endColumnVisible(){return e.wtViewport.columnsVisibleCalculator.endColumn},get endColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.endColumn},get countColumnsRendered(){return e.wtViewport.columnsRenderCalculator.count},get countColumnsVisible(){return e.wtViewport.columnsVisibleCalculator.count},get startRowRendered(){return e.wtViewport.rowsRenderCalculator.startRow},get startRowVisible(){return e.wtViewport.rowsVisibleCalculator.startRow},get startRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.startRow},get endRowRendered(){return e.wtViewport.rowsRenderCalculator.endRow},get endRowVisible(){return e.wtViewport.rowsVisibleCalculator.endRow},get endRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.endRow},get countRowsRendered(){return e.wtViewport.rowsRenderCalculator.count},get countRowsVisible(){return e.wtViewport.rowsVisibleCalculator.count},get columnHeaders(){return e.wtSettings.getSetting("columnHeaders")},get rowHeaders(){return e.wtSettings.getSetting("rowHeaders")}}}}function IH(t,e,n){return(e=cX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cX(t){var e=hX(t,"string");return typeof e=="symbol"?e:e+""}function hX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class dX extends eR{constructor(e,n,r){super(e,n),IH(this,"cloneSource",void 0),IH(this,"cloneOverlay",void 0);const i=this.wtSettings.getSetting("facade",this);this.cloneSource=r.source,this.cloneOverlay=r.overlay,this.stylesHandler=r.stylesHandler,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=r.viewport,this.selectionManager=r.selectionManager,this.wtEvent=new hH(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,r.event),this.findOriginalHeaders()}}function fX(t,e,n){return(e=gX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gX(t){var e=mX(t,"string");return typeof e=="symbol"?e:e+""}function mX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ih{constructor(e,n,r,i,o){fX(this,"wtSettings",null),Ao(this,"wot",e,{writable:!1}),this.domBindings=o,this.facadeGetter=n,this.wtSettings=i;const{TABLE:s,hider:a,spreader:l,holder:u,wtRootElement:c}=this.wot.wtTable;this.instance=this.wot,this.type=r,this.mainTableScrollableElement=null,this.TABLE=s,this.hider=a,this.spreader=l,this.holder=u,this.wtRootElement=c,this.trimmingContainer=Vc(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.clone=this.makeClone()}hasRenderingStateChanged(){return this.needFullRender!==this.shouldBeRendered()}updateStateOfRendering(e){e==="before"&&this.shouldBeRendered()?this.needFullRender=!0:e==="after"&&!this.shouldBeRendered()&&(this.needFullRender=!1)}shouldBeRendered(){return!0}updateTrimmingContainer(){this.trimmingContainer=Vc(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:n}=this.domBindings;n.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=Tf(e.TABLE)}getRelativeCellPosition(e,n,r){if(this.clone.wtTable.holder.contains(e)===!1){et(`The provided element is not a child of the ${this.type} overlay`);return}const i=this.mainTableScrollableElement===this.domBindings.rootWindow,o=r<this.wtSettings.getSetting("fixedColumnsStart"),s=n<this.wtSettings.getSetting("fixedRowsTop"),a=n>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),l=this.clone.wtTable.spreader,u={start:this.getRelativeStartPosition(l),top:l.offsetTop},c={start:this.getRelativeStartPosition(e),top:e.offsetTop};let h=null;return i?h=this.getRelativeCellPositionWithinWindow(s,o,c,u):h=this.getRelativeCellPositionWithinHolder(s,a,o,c,u),h}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,n,r,i){const o=this.wot.wtTable.wtRootElement.getBoundingClientRect();let s=0,a=0;if(!n)s=i.start;else{let l=o.left;this.isRtl()&&(l=this.domBindings.rootWindow.innerWidth-(o.left+o.width+vn())),s=l<=0?-1*l:0}return e?a=this.clone.wtTable.TABLE.getBoundingClientRect().top-o.top:a=i.top,{start:r.start+s,top:r.top+a}}getRelativeCellPositionWithinHolder(e,n,r,i,o){const s={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let a=0,l=0;if(r||(a=s.horizontal-o.start),n){const u=this.wot.wtTable.wtRootElement.getBoundingClientRect();l=this.clone.wtTable.TABLE.getBoundingClientRect().top*-1+u.top}else e||(l=s.vertical-o.top);return{start:i.start-a,top:i.top-l}}makeClone(){if(TH.indexOf(this.type)===-1)throw new Error(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,o=r.createElement("div"),s=r.createElement("table"),a=e.wtRootElement.parentNode;o.className=`${tX.get(this.type)} handsontable`,o.setAttribute("dir",this.isRtl()?"rtl":"ltr"),o.style.position="absolute",o.style.top=0,o.style.overflow="visible",this.isRtl()?o.style.right=0:o.style.left=0,n.getSetting("ariaTags")&&Se(o,[Ho()]),s.className=e.TABLE.className,e.TABLE.getAttribute("role")&&s.setAttribute("role",e.TABLE.getAttribute("role")),o.appendChild(s),a.appendChild(o);const u=this.wtSettings.getSetting("preventOverflow");return u===!0||u==="horizontal"&&this.type===Na||u==="vertical"&&this.type===Da?this.mainTableScrollableElement=i:i.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=Tf(e.TABLE),new dX(s,this.wtSettings,{source:this.wot,overlay:this,viewport:this.wot.wtViewport,event:this.wot.wtEvent,selectionManager:this.wot.selectionManager,stylesHandler:this.wot.stylesHandler})}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.needFullRender){const n=this.clone.cloneSource;n.activeOverlayName=this.clone.wtTable.name,this.clone.draw(e),n.activeOverlayName="master"}}reset(){const e=this.clone.wtTable.holder,n=this.clone.wtTable.hider,r=e.style,i=n.style,o=e.parentNode.style;[r,i,o].forEach(s=>{s.width="",s.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}class pX extends ih{constructor(e,n,r,i,o,s){super(e,n,Ts,r,i),this.bottomOverlay=o,this.inlineStartOverlay=s}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new JS(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wot:e}=this;if(this.updateTrimmingContainer(),!e.wtTable.holder.parentNode)return!1;const n=this.clone.wtTable.holder.parentNode;if(n.style.top="",this.trimmingContainer===this.domBindings.rootWindow){const o=this.inlineStartOverlay.getOverlayOffset(),s=this.bottomOverlay.getOverlayOffset();n.style[this.isRtl()?"right":"left"]=`${o}px`,n.style.bottom=`${s}px`}else If(n),this.repositionOverlay();let r=an(this.clone.wtTable.TABLE);const i=Qt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(r=0),n.style.height=`${r}px`,n.style.width=`${i}px`,!1}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;n.hasVerticalScroll()||(o+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(o+=vn(r)),i.style.bottom=`${o}px`}}const wX="calculatedColumns",og={getFirstRenderedColumn(){const t=this.dataAccessObject.startColumnRendered;return t===null?-1:t},getFirstVisibleColumn(){const t=this.dataAccessObject.startColumnVisible;return t===null?-1:t},getFirstPartiallyVisibleColumn(){const t=this.dataAccessObject.startColumnPartiallyVisible;return t===null?-1:t},getLastRenderedColumn(){const t=this.dataAccessObject.endColumnRendered;return t===null?-1:t},getLastVisibleColumn(){const t=this.dataAccessObject.endColumnVisible;return t===null?-1:t},getLastPartiallyVisibleColumn(){const t=this.dataAccessObject.endColumnPartiallyVisible;return t===null?-1:t},getRenderedColumnsCount(){return this.dataAccessObject.countColumnsRendered},getVisibleColumnsCount(){return this.dataAccessObject.countColumnsVisible},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};Ao(og,"MIXIN_NAME",wX,{writable:!1,enumerable:!1});class tR extends cu{constructor(e,n,r,i){super(e,n,r,i,Xi)}}ct(tR,QS),ct(tR,og);function vX(t,e,n){return(e=CX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function CX(t){var e=yX(t,"string");return typeof e=="symbol"?e:e+""}function yX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bX extends ih{constructor(e,n,r,i){super(e,n,Xi,r,i),vX(this,"cachedFixedRowsBottom",-1),this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new tR(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,n=this.clone.wtTable.holder.parentNode;n.style.top="";let r=0;const i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!i||i!=="vertical")?(r=this.getOverlayOffset(),n.style.bottom=`${r}px`):(r=this.getScrollPosition(),this.repositionOverlay());const o=this.adjustHeaderBordersPosition(r);return this.adjustElementsSize(),o}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;n.hasVerticalScroll()||(o+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(o+=vn(r)),i.style.bottom=`${o}px`}setScrollPosition(e){const{rootWindow:n}=this.domBindings,r=this.mainTableScrollableElement;let i=!1;if(r===n&&e!==n.scrollY){const o=n.scrollY;n.scrollTo(py(n),top),i=o!==n.scrollY}else if(e!==r.scrollTop){const o=r.scrollTop;r.scrollTop=e,i=o!==r.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const{wtTable:r,stylesHandler:i}=this.wot,o=i.getDefaultRowHeight();let s=e,a=0;for(;s<n;){const l=r.getRowHeight(s);a+=l===void 0?o:l,s+=1}return a}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=n.getWorkspaceWidth();n.hasVerticalScroll()&&(u-=vn(r)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=an(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=e.parentNode.style.height}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:n}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?n.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:n.style[e]=""}scrollTo(e,n){let r=this.getTableParentOffset();const o=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let s=0;n&&o.offsetHeight!==o.clientHeight&&(s=vn(this.domBindings.rootDocument)),n?(r+=this.sumCellSizes(0,e+1),r-=this.wot.wtViewport.getViewportHeight(),r+=1):r+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),r+=s,this.setScrollPosition(r)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return wy(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),o=this.clone.wtTable.getTotalHeight(),s=i-o,a=this.domBindings.rootDocument.documentElement.clientHeight;r=Math.max(this.getTableParentOffset()-this.getScrollPosition()-a+i,0),r>s&&(r=0)}return r}adjustHeaderBordersPosition(e){const n=this.wtSettings.getSetting("fixedRowsBottom"),r=this.cachedFixedRowsBottom!==n,i=this.wtSettings.getSetting("columnHeaders");let o=!1;if((r||n===0)&&i.length>0){const s=this.wot.wtTable.holder.parentNode,a=ye(s,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(X(s,"innerBorderBottom"),o=!a):(ve(s,"innerBorderBottom"),o=a)}return o}}const SX="calculatedRows",nR={getFirstRenderedRow(){const t=this.dataAccessObject.startRowRendered;return t===null?-1:t},getFirstVisibleRow(){const t=this.dataAccessObject.startRowVisible;return t===null?-1:t},getFirstPartiallyVisibleRow(){const t=this.dataAccessObject.startRowPartiallyVisible;return t===null?-1:t},getLastRenderedRow(){const t=this.dataAccessObject.endRowRendered;return t===null?-1:t},getLastVisibleRow(){const t=this.dataAccessObject.endRowVisible;return t===null?-1:t},getLastPartiallyVisibleRow(){const t=this.dataAccessObject.endRowPartiallyVisible;return t===null?-1:t},getRenderedRowsCount(){return this.dataAccessObject.countRowsRendered},getVisibleRowsCount(){return this.dataAccessObject.countRowsVisible},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};Ao(nR,"MIXIN_NAME",SX,{writable:!1,enumerable:!1});class rR extends cu{constructor(e,n,r,i){super(e,n,r,i,Da)}}ct(rR,nR),ct(rR,rg);const RX="localHooks",Mn={_localHooks:Object.create(null),addLocalHook(t,e){return this._localHooks[t]||(this._localHooks[t]=[]),this._localHooks[t].push(e),this},runLocalHooks(t,e,n,r,i,o,s){if(this._localHooks[t]){const a=this._localHooks[t].length;for(let l=0;l<a;l++)Ey(this._localHooks[t][l],this,e,n,r,i,o,s)}},clearLocalHooks(){return this._localHooks={},this}};Ao(Mn,"MIXIN_NAME",RX,{writable:!1,enumerable:!1});let PH=class{constructor(e,n){this.settings=e,this.cellRange=n||null}isEmpty(){return this.cellRange===null}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,n){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=n,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=n,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){const e=this.cellRange.getOuterTopStartCorner(),n=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,n.row,n.col]}destroy(){this.runLocalHooks("destroy")}};ct(PH,Mn);const OH="active-header",iR="header",oR="area",oh="focus",EX="fill",TX="row",_X="column",MX="custom-selection",sR=t=>{const e=t.stylesHandler;if(e.isClassicTheme())return Object.freeze({width:6,height:6,borderWidth:1,borderStyle:"solid",borderColor:"#FFF"});const n=e.getCSSVariableValue("cell-autofill-size"),r=e.getCSSVariableValue("cell-autofill-border-width"),i=e.getCSSVariableValue("cell-autofill-border-color");return Object.freeze({width:n,height:n,borderWidth:r,borderStyle:"solid",borderColor:i})};var xH={},AH;function IX(){if(AH)return xH;AH=1;var t=Wf();return t("flat"),xH}IX();function PX(t,e){NH(t,e),e.add(t)}function HH(t,e,n){NH(t,e),e.set(t,n)}function NH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nt(t,e){return t.get(sh(t,e))}function DH(t,e,n){return t.set(sh(t,e),n),n}function sh(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 yi=new WeakMap,xn=new WeakMap,sg=new WeakSet;class OX{constructor(){PX(this,sg),HH(this,yi,void 0),HH(this,xn,void 0)}setActiveOverlay(e){return DH(xn,this,e),this}setActiveSelection(e){return DH(yi,this,e),this}scan(){const e=Nt(yi,this).settings.selectionType,n=new Set;return e==="active-header"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r))):e==="area"?this.scanCellsRange(r=>n.add(r)):e==="focus"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r)),this.scanCellsRange(r=>n.add(r))):e==="fill"?this.scanCellsRange(r=>n.add(r)):e==="header"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r))):e==="row"?(this.scanRowsInHeadersRange(r=>n.add(r)),this.scanRowsInCellsRange(r=>n.add(r))):e==="column"&&(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanColumnsInCellsRange(r=>n.add(r))),n}scanColumnsInHeadersRange(e){const[n,r,i,o]=Nt(yi,this).getCorners(),{wtTable:s}=Nt(xn,this),a=s.getRenderedColumnsCount(),l=s.getColumnHeadersCount();let u=0;for(let c=-s.getRowHeadersCount();c<a;c++){const h=s.columnFilter.renderedToSource(c);if(!(h<r||h>o)){for(let d=-l;d<0;d++){if(d<n||d>i)continue;const f=d+l;let m=s.getColumnHeader(h,f);const b=Nt(xn,this).getSetting("onBeforeHighlightingColumnHeader",h,f,{selectionType:Nt(yi,this).settings.selectionType,columnCursor:u,selectionWidth:o-r+1});b!==null&&(b!==h&&(m=s.getColumnHeader(b,f)),e(m))}u+=1}}}scanRowsInHeadersRange(e){const[n,r,i,o]=Nt(yi,this).getCorners(),{wtTable:s}=Nt(xn,this),a=s.getRenderedRowsCount(),l=s.getRowHeadersCount();let u=0;for(let c=-s.getColumnHeadersCount();c<a;c++){const h=s.rowFilter.renderedToSource(c);if(!(h<n||h>i)){for(let d=-l;d<0;d++){if(d<r||d>o)continue;const f=d+l;let m=s.getRowHeader(h,f);const b=Nt(xn,this).getSetting("onBeforeHighlightingRowHeader",h,f,{selectionType:Nt(yi,this).settings.selectionType,rowCursor:u,selectionHeight:i-n+1});b!==null&&(b!==h&&(m=s.getRowHeader(b,f)),e(m))}u+=1}}}scanCellsRange(e){const{wtTable:n}=Nt(xn,this);sh(sg,this,xX).call(this,(r,i)=>{const o=n.getCell(Nt(xn,this).createCellCoords(r,i)),s=Nt(xn,this).getSetting("onAfterDrawSelection",r,i,Nt(yi,this).settings.layerLevel);typeof s=="string"&&X(o,s),e(o)})}scanRowsInCellsRange(e){const[n,,r]=Nt(yi,this).getCorners(),{wtTable:i}=Nt(xn,this);sh(sg,this,kH).call(this,(o,s)=>{if(o>=n&&o<=r){const a=i.getCell(Nt(xn,this).createCellCoords(o,s));e(a)}})}scanColumnsInCellsRange(e){const[,n,,r]=Nt(yi,this).getCorners(),{wtTable:i}=Nt(xn,this);sh(sg,this,kH).call(this,(o,s)=>{if(s>=n&&s<=r){const a=i.getCell(Nt(xn,this).createCellCoords(o,s));e(a)}})}}function xX(t){let[e,n,r,i]=Nt(yi,this).getCorners();if(e<0&&r<0||n<0&&i<0)return;const{wtTable:o}=Nt(xn,this),s=e!==r||n!==i;if(n=Math.max(n,0),i=Math.max(i,0),e=Math.max(e,0),r=Math.max(r,0),s){if(n=Math.max(n,o.getFirstRenderedColumn()),i=Math.min(i,o.getLastRenderedColumn()),e=Math.max(e,o.getFirstRenderedRow()),r=Math.min(r,o.getLastRenderedRow()),i<n||r<e)return}else{const a=o.getCell(Nt(xn,this).createCellCoords(e,n));if(!Do(a))return}for(let a=e;a<=r;a+=1)for(let l=n;l<=i;l+=1)t(a,l)}function kH(t){const{wtTable:e}=Nt(xn,this),n=e.getRenderedRowsCount(),r=e.getRenderedColumnsCount();for(let i=0;i<n;i+=1){const o=e.rowFilter.renderedToSource(i);for(let s=0;s<r;s+=1)t(o,e.columnFilter.renderedToSource(s))}}class LH{constructor(e,n){n&&(this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=n,this.mouseDown=!1,this.main=null,this.top=null,this.bottom=null,this.start=null,this.end=null,this.topStyle=null,this.bottomStyle=null,this.startStyle=null,this.endStyle=null,this.cornerDefaultStyle=sR(this.instance),this.cornerCenterPointOffset=-Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),this.corner=null,this.cornerStyle=null,this.createBorders(n),this.registerListeners())}registerListeners(){const e=this.wot.rootDocument.body;this.eventManager.addEventListener(e,"mousedown",()=>this.onMouseDown()),this.eventManager.addEventListener(e,"mouseup",()=>this.onMouseUp());for(let n=0,r=this.main.childNodes.length;n<r;n++){const i=this.main.childNodes[n];this.eventManager.addEventListener(i,"mouseenter",o=>this.onMouseEnter(o,this.main.childNodes[n]))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,n){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),fi(e);const r=this,i=this.wot.rootDocument.body,o=n.getBoundingClientRect();n.style.display="none";function s(l){if(l.clientY<Math.floor(o.top)||l.clientY>Math.ceil(o.top+o.height)||l.clientX<Math.floor(o.left)||l.clientX>Math.ceil(o.left+o.width))return!0}function a(l){s(l)&&(r.eventManager.removeEventListener(i,"mousemove",a),n.style.display="block")}this.eventManager.addEventListener(i,"mousemove",a)}createBorders(e){const{rootDocument:n}=this.wot;this.main=n.createElement("div");const r=["top","start","bottom","end","corner"];let i=this.main.style;i.position="absolute",i.top=0,i.left=0;for(let a=0;a<5;a++){const l=r[a],u=n.createElement("div");u.className=`wtBorder ${this.settings.className||""}`,this.settings[l]&&this.settings[l].hide&&(u.className+=" hidden"),i=u.style,i.backgroundColor=this.settings[l]&&this.settings[l].color?this.settings[l].color:e.border.color,i.height=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,i.width=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,this.main.appendChild(u)}this.top=this.main.childNodes[0],this.start=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.end=this.main.childNodes[3],this.topStyle=this.top.style,this.startStyle=this.start.style,this.bottomStyle=this.bottom.style,this.endStyle=this.end.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=`${this.cornerDefaultStyle.width}px`,this.cornerStyle.height=`${this.cornerDefaultStyle.height}px`,this.cornerStyle.border=[`${this.cornerDefaultStyle.borderWidth}px`,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),ko()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:o}=this.wot;let s=o.bordersHolder;s||(s=n.createElement("div"),s.className="htBorders",o.bordersHolder=s,o.spreader.appendChild(s)),s.appendChild(this.main)}createMultipleSelectorHandles(){const{rootDocument:e,stylesHandler:n}=this.wot,r=n.getCSSVariableValue("cell-mobile-handle-size"),i=n.getCSSVariableValue("cell-mobile-handle-border-radius"),o=n.getCSSVariableValue("cell-mobile-handle-background-color"),s=n.getCSSVariableValue("cell-mobile-handle-border-width"),a=n.getCSSVariableValue("cell-mobile-handle-border-color");this.selectionHandles={top:e.createElement("DIV"),topHitArea:e.createElement("DIV"),bottom:e.createElement("DIV"),bottomHitArea:e.createElement("DIV")};const l=10,u=40;this.selectionHandles.top.className="topSelectionHandle topLeftSelectionHandle",this.selectionHandles.topHitArea.className="topSelectionHandle-HitArea topLeftSelectionHandle-HitArea",this.selectionHandles.bottom.className="bottomSelectionHandle bottomRightSelectionHandle",this.selectionHandles.bottomHitArea.className="bottomSelectionHandle-HitArea bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={top:this.selectionHandles.top.style,topHitArea:this.selectionHandles.topHitArea.style,bottom:this.selectionHandles.bottom.style,bottomHitArea:this.selectionHandles.bottomHitArea.style};const c={position:"absolute",height:`${u}px`,width:`${u}px`,"border-radius":`${parseInt(u/1.5,10)}px`};Ne(c,(d,f)=>{this.selectionHandles.styles.bottomHitArea[f]=d,this.selectionHandles.styles.topHitArea[f]=d});const h=n.isClassicTheme()?{position:"absolute",height:`${l}px`,width:`${l}px`,"border-radius":`${parseInt(l/1.5,10)}px`,background:"#F5F5FF",border:"1px solid #4285c8"}:{position:"absolute",height:`${r}px`,width:`${r}px`,"border-radius":`${i}px`,background:`${o}`,border:`${s}px solid ${a}`};Ne(h,(d,f)=>{this.selectionHandles.styles.bottom[f]=d,this.selectionHandles.styles.top[f]=d}),this.main.appendChild(this.selectionHandles.top),this.main.appendChild(this.selectionHandles.bottom),this.main.appendChild(this.selectionHandles.topHitArea),this.main.appendChild(this.selectionHandles.bottomHitArea)}isPartRange(e,n){const r=this.wot.selectionManager.getAreaSelection();return!!(r.cellRange&&(e!==r.cellRange.to.row||n!==r.cellRange.to.col))}updateMultipleSelectionHandlesPosition(e,n,r,i,o,s){const l=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:u,topHitArea:c,bottom:h,bottomHitArea:d}=this.selectionHandles.styles,f=parseInt(u.borderWidth,10),m=parseInt(u.width,10),b=parseInt(c.width,10),S=this.wot.wtTable.getWidth(),E=this.wot.wtTable.getHeight();u.top=`${parseInt(r-m-1,10)}px`,u[l]=`${parseInt(i-m-1,10)}px`,c.top=`${parseInt(r-b/4*3,10)}px`,c[l]=`${parseInt(i-b/4*3,10)}px`;const v=Math.min(parseInt(i+o,10),S-m-f*2),I=Math.min(parseInt(i+o-b/4,10),S-b-f*2);h[l]=`${v}px`,d[l]=`${I}px`;const M=Math.min(parseInt(r+s,10),E-m-f*2),T=Math.min(parseInt(r+s-b/4,10),E-b-f*2);h.top=`${M}px`,d.top=`${T}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(u.display="block",c.display="block",this.isPartRange(e,n)?(h.display="none",d.display="none"):(h.display="block",d.display="block")):(u.display="none",h.display="none",c.display="none",d.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||n===this.wot.wtSettings.getSetting("fixedColumnsStart")?(u.zIndex="9999",c.zIndex="9999"):(u.zIndex="",c.zIndex="")}appear(e){if(this.disabled)return;let[n,r,i,o]=e;if(n<0&&i<0||r<0&&o<0){this.disappear();return}const{wtTable:s,rootDocument:a,rootWindow:l}=this.wot,u=n!==i||r!==o,c=s.getFirstRenderedRow(),h=s.getLastRenderedRow(),d=s.getFirstRenderedColumn(),f=s.getLastRenderedColumn();if(d<0&&f<0||c<0&&h<0){this.disappear();return}let m;if(u){if(r=Math.max(r,d),o=Math.min(o,f),n=Math.max(n,c),i=Math.min(i,h),o<r||i<n){this.disappear();return}m=s.getCell(this.wot.createCellCoords(n,r))}else if(m=s.getCell(this.wot.createCellCoords(n,r)),!Do(m)){this.disappear();return}const b=u?s.getCell(this.wot.createCellCoords(i,o)):m,S=On(m),E=u?On(b):S,v=On(s.TABLE),I=S.top,M=S.left,T=this.wot.wtSettings.getSetting("rtlMode");let P=0,D=0;if(T){const pe=Qt(s.TABLE),Ee=Qt(m),gt=l.innerWidth-v.left-pe;D=M+Ee-E.left,P=l.innerWidth-M-Ee-gt-1}else D=E.left+Qt(b)-M,P=M-v.left-1;if(this.isEntireColumnSelected(n,i)){const pe=n,Ee=this.getDimensionsFromHeader("columns",r,o,pe,v);let gt=null;Ee&&([gt,P,D]=Ee),gt&&(m=gt)}let K=I-v.top-1,Y=E.top+an(b)-I;if(this.isEntireRowSelected(r,o)){const pe=r,Ee=this.getDimensionsFromHeader("rows",n,i,pe,v);let gt=null;Ee&&([gt,K,Y]=Ee),gt&&(m=gt)}const U=l.getComputedStyle(m);parseInt(U.borderTopWidth,10)>0&&(K+=1,Y=Y>0?Y-1:0),parseInt(U[T?"borderRightWidth":"borderLeftWidth"],10)>0&&(P+=1,D=D>0?D-1:0);const J=T?"right":"left";this.topStyle.top=`${K}px`,this.topStyle[J]=`${P}px`,this.topStyle.width=`${D}px`,this.topStyle.display="block",this.startStyle.top=`${K}px`,this.startStyle[J]=`${P}px`,this.startStyle.height=`${Y}px`,this.startStyle.display="block";const ee=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${K+Y-ee}px`,this.bottomStyle[J]=`${P}px`,this.bottomStyle.width=`${D}px`,this.bottomStyle.display="block",this.endStyle.top=`${K}px`,this.endStyle[J]=`${P+D-ee}px`,this.endStyle.height=`${Y+1}px`,this.endStyle.display="block";let ae=this.settings.border.cornerVisible;ae=typeof ae=="function"?ae(this.settings.layerLevel):ae;const ne=this.wot.getSetting("onModifyGetCellCoords",i,o,!1,"render");let[se,ft]=[i,o];if(ne&&Array.isArray(ne)&&([,,se,ft]=ne),ko()||!ae||this.isPartRange(se,ft))this.cornerStyle.display="none";else{this.cornerStyle.top=`${K+Y+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle[J]=`${P+D+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderRightWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderLeftWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderBottomWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="none";let pe=Vc(s.TABLE);const Ee=pe===l;Ee&&(pe=a.documentElement);const gt=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,Wt=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),q=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(o===this.wot.getSetting("totalColumns")-1){const g=Ee?b.getBoundingClientRect().left:b.offsetLeft;let w=!1,p=0;T?(p=g-parseInt(this.cornerDefaultStyle.width,10)/2,w=p<0):(p=g+Qt(b)+parseInt(this.cornerDefaultStyle.width,10)/2,w=p>=ox(pe)),w&&(this.cornerStyle[J]=`${Math.floor(P+D+this.cornerCenterPointOffset-Wt-gt)}px`,this.cornerStyle[T?"borderLeftWidth":"borderRightWidth"]=0)}if(i===this.wot.getSetting("totalRows")-1){const p=(Ee?b.getBoundingClientRect().top:b.offsetTop)+an(b)+parseInt(this.cornerDefaultStyle.height,10)/2>=Wc(pe),_=this.wot.stylesHandler.isClassicTheme();if(p){const A=Math.floor(K+Y+this.cornerCenterPointOffset-q-gt);_?(this.cornerStyle.top=`${A}px`,this.cornerStyle.borderBottomWidth=0):this.cornerStyle.top=`${A-1}px`}}this.cornerStyle.display="block"}ko()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(i,o,K,P,D,Y)}isEntireColumnSelected(e,n){return e===this.wot.wtTable.getFirstRenderedRow()&&n===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,n){return e===this.wot.wtTable.getFirstRenderedColumn()&&n===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,n,r,i,o){const{wtTable:s}=this.wot,a=s.wtRootElement.parentNode;let l=null,u=null,c=null,h=null,d=null,f=null,m=null,b=null;switch(e){case"rows":l=function(){return s.getRowHeader(...arguments)},u=function(){return an(...arguments)},c="ht__selection--rows",f="top";break;case"columns":l=function(){return s.getColumnHeader(...arguments)},u=function(){return Qt(...arguments)},c="ht__selection--columns",f="left";break}if(a.classList.contains(c)){const S=this.wot.getSetting("columnHeaders").length;if(m=l(n,S-i),b=l(r,S-i),!m||!b)return!1;const E=On(m),v=On(b);return m&&b&&(h=E[f]-o[f]-1,d=v[f]+u(b)-E[f]),[m,h,d]}return!1}changeBorderStyle(e,n){const r=this[e].style,i=n[e];!i||i.hide?X(this[e],"hidden"):(ye(this[e],"hidden")&&ve(this[e],"hidden"),r.backgroundColor=i.color,(e==="top"||e==="bottom")&&(r.height=`${i.width}px`),(e==="start"||e==="end")&&(r.width=`${i.width}px`))}changeBorderToDefaultStyle(e){const n={width:1,color:"#000"},r=this[e].style;r.backgroundColor=n.color,r.width=`${n.width}px`,r.height=`${n.width}px`}toggleHiddenClass(e,n){this.changeBorderToDefaultStyle(e),n?X(this[e],"hidden"):ve(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",ko()&&this.instance.getSetting("isDataViewInstance")&&(this.selectionHandles.styles.top.display="none",this.selectionHandles.styles.topHitArea.display="none",this.selectionHandles.styles.bottom.display="none",this.selectionHandles.styles.bottomHitArea.display="none")}destroy(){this.eventManager.destroyWithOwnEventsOnly(),this.main.parentNode.removeChild(this.main)}}function AX(t,e){$H(t,e),e.add(t)}function hu(t,e,n){$H(t,e),e.set(t,n)}function $H(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function De(t,e){return t.get(aR(t,e))}function FH(t,e,n){return t.set(aR(t,e),n),n}function aR(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 An=new WeakMap,ir=new WeakMap,lR=new WeakMap,ah=new WeakMap,uR=new WeakMap,La=new WeakMap,VH=new WeakSet;class HX{constructor(e){AX(this,VH),hu(this,An,void 0),hu(this,ir,void 0),hu(this,lR,new OX),hu(this,ah,new WeakMap),hu(this,uR,new WeakSet),hu(this,La,new Map),FH(ir,this,e)}setActiveOverlay(e){return FH(An,this,e),De(lR,this).setActiveOverlay(De(An,this)),De(ah,this).has(De(An,this))||De(ah,this).set(De(An,this),new Set),this}getFocusSelection(){return De(ir,this)!==null?De(ir,this).getFocus():null}getAreaSelection(){return De(ir,this)!==null?De(ir,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(De(La,this).has(e)){const r=De(La,this).get(e);if(r.has(De(An,this)))return r.get(De(An,this));const i=new LH(De(An,this),e.settings);return r.set(De(An,this),i),i}const n=new LH(De(An,this),e.settings);return De(La,this).set(e,new Map([[De(An,this),n]])),n}getBorderInstances(e){var n,r;return Array.from((n=(r=De(La,this).get(e))===null||r===void 0?void 0:r.values())!==null&&n!==void 0?n:[])}destroyBorders(e){De(La,this).get(e).forEach(n=>n.destroy()),De(La,this).delete(e)}render(e){if(De(ir,this)===null)return;e&&aR(VH,this,NX).call(this);const n=Array.from(De(ir,this)),r=new Map,i=new Map;for(let o=0;o<n.length;o++){const s=n[o],{className:a,headerAttributes:l,createLayers:u,selectionType:c}=s.settings;De(uR,this).has(s)||(De(uR,this).add(s),s.addLocalHook("destroy",()=>this.destroyBorders(s)));const h=this.getBorderInstance(s);if(s.isEmpty()){h?.disappear();continue}a&&De(lR,this).setActiveSelection(s).scan().forEach(m=>{if(r.has(m)){const b=r.get(m);b.has(a)&&u===!0?b.set(a,b.get(a)+1):b.set(a,1)}else r.set(m,new Map([[a,1]]));l&&(i.has(m)||i.set(m,[]),m.nodeName==="TH"&&i.get(m).push(...l))});const d=s.getCorners();De(An,this).getSetting("onBeforeDrawBorders",d,c),h?.appear(d)}r.forEach((o,s)=>{var a;const l=Array.from(o).map(u=>{let[c,h]=u;return h===1?c:[c,...Array.from({length:h-1},(d,f)=>`${c}-${f+1}`)]}).flat();l.forEach(u=>De(ah,this).get(De(An,this)).add(u)),X(s,l),s.nodeName==="TD"&&Array.isArray((a=De(ir,this).options)===null||a===void 0?void 0:a.cellAttributes)&&Se(s,De(ir,this).options.cellAttributes)}),Array.from(i.keys()).forEach(o=>{Se(o,[...i.get(o)])})}}function NX(){const t=De(ah,this).get(De(An,this)),e=De(An,this).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(e))for(let n=0;n<e.length;n++)t.add(e[n]);t.forEach(n=>{var r,i;const o=De(An,this).wtTable.TABLE.querySelectorAll(`.${n}`);let s=[];Array.isArray((r=De(ir,this).options)===null||r===void 0?void 0:r.cellAttributes)&&(s=De(ir,this).options.cellAttributes.map(a=>a[0])),Array.isArray((i=De(ir,this).options)===null||i===void 0?void 0:i.headerAttributes)&&(s=[...s,...De(ir,this).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=o.length;a<l;a++)ve(o[a],n),Yl(o[a],s)}),t.clear()}class DX extends ih{constructor(e,n,r,i){super(e,n,Da,r,i)}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new rR(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wtTable:e}=this.wot;if(!this.needFullRender||!this.shouldBeRendered()||!e.holder.parentNode)return!1;const{rootWindow:n}=this.domBindings,r=this.clone.wtTable.holder.parentNode,i=this.wtSettings.getSetting("preventOverflow");let o=0;this.trimmingContainer===n&&(!i||i!=="horizontal")?(o=this.getOverlayOffset()*(this.isRtl()?-1:1),Cy(r,`${o}px`,"0px")):(o=this.getScrollPosition(),If(r));const s=this.adjustHeaderBordersPosition(o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:n}=this.domBindings;let r=!1;this.isRtl()&&(e=-e);const i=this.mainTableScrollableElement;if(i===n&&e!==n.scrollX){const o=n.scrollX;n.scrollTo(e,rx(n)),r=o!==n.scrollX}else if(e!==i.scrollLeft){const o=i.scrollLeft;i.scrollLeft=e,r=o!==i.scrollLeft}return r}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,n){const r=this.wtSettings.getSetting("defaultColumnWidth");let i=e,o=0;for(;i<n;)o+=this.wot.wtTable.getColumnWidth(i)||r,i+=1;return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="vertical"){let u=n.getWorkspaceHeight();n.hasHorizontalScroll()&&(u-=vn(r)),u=Math.min(u,e.wtRootElement.scrollHeight),s.height=`${u}px`}else s.height="";this.clone.wtTable.holder.style.height=s.height;const l=Qt(this.clone.wtTable.TABLE);s.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=sR(this.wot),r=this.wot.selectionManager.getFocusSelection()?parseInt(n.width,10)/2:0;this.clone.wtTable.hider.style.height=this.hider.style.height,e.style.height=e.parentNode.style.height,e.style.width=`${parseInt(e.parentNode.style.width,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalColumns"),n=this.isRtl()?"right":"left";if(typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number")this.spreader.style[n]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style[n]="0";else throw new Error("Incorrect value of the columnsRenderCalculator");this.isRtl()?this.spreader.style.left="":this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number"?this.clone.wtTable.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`:this.clone.wtTable.spreader.style.top=""}scrollTo(e,n){const{wtSettings:r}=this,i=r.getSetting("rowHeaders"),o=r.getSetting("fixedColumnsStart"),a=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder,l=o===0&&i.length>0&&!ye(a.parentNode,"innerBorderInlineStart")?1:0;let u=this.getTableParentOffset(),c=0;if(n){const h=this.wot.wtTable.getColumnWidth(e),d=this.wot.wtViewport.getViewportWidth();h>d&&(n=!1)}return n&&a.offsetWidth!==a.clientWidth&&(c=vn(this.domBindings.rootDocument)),n?(u+=this.sumCellSizes(0,e+1),u-=this.wot.wtViewport.getViewportWidth(),u+=l):u+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),u+=c,_z(this.mainTableScrollableElement)===u-l&&l>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(l),this.setScrollPosition(u)}getTableParentOffset(){const e=this.wtSettings.getSetting("preventOverflow");let n=0;return!e&&this.trimmingContainer===this.domBindings.rootWindow&&(n=this.wot.wtTable.holderOffset.left),n}getScrollPosition(){return Math.abs(ix(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="horizontal")){this.isRtl()?r=Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):r=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);const i=this.wot.wtTable.getTotalWidth(),o=this.clone.wtTable.getTotalWidth(),s=i-o;r>s&&(r=0)}return r}adjustHeaderBordersPosition(e){const{wtSettings:n}=this,r=this.wot.wtTable.holder.parentNode,i=n.getSetting("rowHeaders"),o=n.getSetting("fixedColumnsStart"),s=n.getSetting("totalRows"),a=n.getSetting("preventOverflow")==="vertical";s?ve(r,"emptyRows"):X(r,"emptyRows");let l=!1;if(!a){if(o&&!i.length)X(r,"innerBorderLeft innerBorderInlineStart");else if(!o&&i.length){const u=ye(r,"innerBorderInlineStart");e?(X(r,"innerBorderLeft innerBorderInlineStart"),l=!u):(ve(r,"innerBorderLeft innerBorderInlineStart"),l=u)}}return l}}const kX="stickyRowsTop",cR={getFirstRenderedRow(){return this.getRenderedRowsCount()===0?-1:0},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsTop"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};Ao(cR,"MIXIN_NAME",kX,{writable:!1,enumerable:!1});class hR extends cu{constructor(e,n,r,i){super(e,n,r,i,ka)}}ct(hR,cR),ct(hR,rg);function WH(t,e,n){return(e=LX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LX(t){var e=$X(t,"string");return typeof e=="symbol"?e:e+""}function $X(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class FX extends ih{constructor(e,n,r,i,o,s){super(e,n,ka,r,i),WH(this,"topOverlay",void 0),WH(this,"inlineStartOverlay",void 0),this.topOverlay=o,this.inlineStartOverlay=s}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new hR(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){if(this.updateTrimmingContainer(),!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode;if(this.trimmingContainer===this.domBindings.rootWindow){const i=this.inlineStartOverlay.getOverlayOffset()*(this.isRtl()?-1:1),o=this.topOverlay.getOverlayOffset();Cy(e,`${i}px`,`${o}px`)}else If(e);let n=an(this.clone.wtTable.TABLE);const r=Qt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),e.style.height=`${n}px`,e.style.width=`${r}px`,!1}}class dR extends cu{constructor(e,n,r,i){super(e,n,r,i,Na)}}ct(dR,cR),ct(dR,og);function VX(t,e,n){return(e=WX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WX(t){var e=BX(t,"string");return typeof e=="symbol"?e:e+""}function BX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class jX extends ih{constructor(e,n,r,i){super(e,n,Na,r,i),VX(this,"cachedFixedRowsTop",-1),this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new dR(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode,{rootWindow:n}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let i=0,o=!1;if(this.trimmingContainer===n&&(!r||r!=="vertical")){const{wtTable:a}=this.wot,l=a.hider.getBoundingClientRect(),u=Math.ceil(l.bottom),c=e.offsetHeight;o=u===c,i=this.getOverlayOffset(),Cy(e,"0px",`${i}px`)}else i=this.getScrollPosition(),If(e);const s=this.adjustHeaderBordersPosition(i,o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:n}=this.domBindings,r=this.mainTableScrollableElement;let i=!1;if(r===n&&e!==n.scrollY){const o=n.scrollY;n.scrollTo(py(n),e),i=o!==n.scrollY}else if(e!==r.scrollTop){const o=r.scrollTop;r.scrollTop=e,i=o!==r.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const r=this.wot.stylesHandler.getDefaultRowHeight();let i=e,o=0;for(;i<n;){const s=this.wot.wtTable.getRowHeight(i);o+=s===void 0?r:s,i+=1}return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=n.getWorkspaceWidth();n.hasVerticalScroll()&&(u-=vn(r)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=an(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=sR(this.wot),r=this.wot.selectionManager.getFocusSelection()?parseInt(n.height,10)/2:0;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=`${parseInt(e.parentNode.style.height,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:n}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?n.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:n.style[e]=""}scrollTo(e,n){const{wot:r,wtSettings:i}=this,s=(r.cloneSource?r.cloneSource:r).wtTable.holder,a=i.getSetting("columnHeaders"),u=i.getSetting("fixedRowsTop")===0&&a.length>0&&!ye(s.parentNode,"innerBorderTop")?1:0;let c=this.getTableParentOffset(),h=0;if(n){const d=this.wot.wtTable.getRowHeight(e),f=this.wot.wtViewport.getViewportHeight();d>f&&(n=!1)}if(n&&s.offsetHeight!==s.clientHeight&&(h=vn(this.domBindings.rootDocument)),n){const d=i.getSetting("fixedRowsBottom"),f=i.getSetting("totalRows");c+=this.sumCellSizes(0,e+1),c-=r.wtViewport.getViewportHeight()-this.sumCellSizes(f-d,f),c+=1,c+=u}else c+=this.sumCellSizes(i.getSetting("fixedRowsTop"),e);return c+=h,Tz(this.mainTableScrollableElement)===c-u&&u>0&&this.wot.wtOverlays.expandHiderVerticallyBy(u),this.setScrollPosition(c)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return wy(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),o=this.clone.wtTable.getTotalHeight(),s=i-o;r=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),r>s&&(r=0)}return r}adjustHeaderBordersPosition(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{wtSettings:r}=this,i=this.wot.wtTable.holder.parentNode,o=r.getSetting("totalColumns"),s=r.getSetting("preventOverflow")==="horizontal";o?ve(i,"emptyColumns"):X(i,"emptyColumns");let a=!1;if(!n&&!s){const l=r.getSetting("fixedRowsTop"),u=this.cachedFixedRowsTop!==l,c=r.getSetting("columnHeaders");if((u||l===0)&&c.length>0){const h=ye(i,"innerBorderTop");this.cachedFixedRowsTop=r.getSetting("fixedRowsTop"),e||r.getSetting("totalRows")===0?(X(i,"innerBorderTop"),a=!h):(ve(i,"innerBorderTop"),a=h)}}return a}}function ag(t,e,n){UX(t,e),e.set(t,n)}function UX(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wo(t,e,n){return(e=zX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zX(t){var e=YX(t,"string");return typeof e=="symbol"?e:e+""}function YX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $a(t,e,n){return t.set(BH(t,e),n),n}function Bo(t,e){return t.get(BH(t,e))}function BH(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 du=new WeakMap,lg=new WeakMap,fu=new WeakMap,ug=new WeakMap;class GX{constructor(e,n,r,i,o,s){Wo(this,"wot",null),ag(this,du,[]),Wo(this,"topOverlay",null),Wo(this,"bottomOverlay",null),Wo(this,"inlineStartOverlay",null),Wo(this,"topInlineStartCornerOverlay",null),Wo(this,"bottomInlineStartCornerOverlay",null),Wo(this,"browserLineHeight",void 0),Wo(this,"wtSettings",null),ag(this,lg,!1),ag(this,fu,0),ag(this,ug,null),Wo(this,"resizeObserver",new ResizeObserver(c=>{Of(()=>{!Array.isArray(c)||!c.length||($a(fu,this,Bo(fu,this)+1),Bo(fu,this)===100&&(et("The ResizeObserver callback was fired too many times in direct succession.\nThis may be due to an infinite loop caused by setting a dynamic height/width (for example, with the `dvh` units) to a Handsontable container's parent. \nThe observer will be disconnected."),this.resizeObserver.disconnect()),Bo(ug,this)!==null&&clearTimeout(Bo(ug,this)),$a(ug,this,setTimeout(()=>{$a(fu,this,0)},100)),this.wtSettings.getSetting("onContainerElementResize"))})})),this.wot=e,this.wtSettings=i,this.domBindings=r,this.facadeGetter=n,this.wtTable=s;const{rootDocument:a,rootWindow:l}=this.domBindings;this.instance=this.wot,this.eventManager=o,this.scrollbarSize=vn(a);const u=l.getComputedStyle(s.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden";this.scrollableElement=u?s.holder:Tf(s.TABLE),this.initOverlays(),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.initBrowserLineHeight(),this.registerListeners(),this.lastScrollX=l.scrollX,this.lastScrollY=l.scrollY}getOverlays(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=[...Bo(du,this)];return e&&n.push(this.wtTable),n}initBrowserLineHeight(){const{rootWindow:e,rootDocument:n}=this.domBindings,r=e.getComputedStyle(n.body),i=parseInt(r.lineHeight,10),o=parseInt(r.fontSize,10)*1.2;this.browserLineHeight=i||o}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new jX(...e),this.bottomOverlay=new bX(...e),this.inlineStartOverlay=new DX(...e),this.topInlineStartCornerOverlay=new FX(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new pX(...e,this.bottomOverlay,this.inlineStartOverlay),$a(du,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){$a(lg,this,Bo(du,this).reduce((e,n)=>n.hasRenderingStateChanged()||e,!1)),Bo(du,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),Bo(du,this).forEach(e=>{const n=e.hasRenderingStateChanged();e.updateStateOfRendering("after"),n&&!e.needFullRender&&e.reset()})}refreshAll(){if(this.wot.drawn){if(!this.wtTable.holder.parentNode){this.destroy();return}this.wot.draw(!0),this.verticalScrolling&&this.inlineStartOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}}registerListeners(){const{rootDocument:e,rootWindow:n}=this.domBindings,{mainTableScrollableElement:r}=this.topOverlay,{mainTableScrollableElement:i}=this.inlineStartOverlay;this.eventManager.addEventListener(e.documentElement,"keydown",h=>this.onKeyDown(h)),this.eventManager.addEventListener(e.documentElement,"keyup",()=>this.onKeyUp()),this.eventManager.addEventListener(e,"visibilitychange",()=>this.onKeyUp()),this.eventManager.addEventListener(r,"scroll",h=>this.onTableScroll(h),{passive:!0}),r!==i&&this.eventManager.addEventListener(i,"scroll",h=>this.onTableScroll(h),{passive:!0});const o=n.devicePixelRatio&&n.devicePixelRatio>1,s=this.scrollableElement===n,a=this.wtSettings.getSetting("preventWheel"),l={passive:s};(a||o||!mx())&&this.eventManager.addEventListener(this.wtTable.wtRootElement,"wheel",h=>this.onCloneWheel(h,a),l),[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay].forEach(h=>{this.eventManager.addEventListener(h.clone.wtTable.holder,"wheel",d=>this.onCloneWheel(d,a),l)});let c;this.eventManager.addEventListener(n,"resize",()=>{Of(()=>{clearTimeout(c),this.wtSettings.getSetting("onWindowResize"),c=setTimeout(()=>{$a(fu,this,0)},200)})}),s||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}onTableScroll(e){const n=this.domBindings.rootWindow,r=this.inlineStartOverlay.mainTableScrollableElement,i=this.topOverlay.mainTableScrollableElement,o=e.target;this.keyPressed&&(i!==n&&o!==n&&!e.target.contains(i)||r!==n&&o!==n&&!e.target.contains(r))||this.syncScrollPositions(e)}onCloneWheel(e,n){const{rootWindow:r}=this.domBindings,i=this.inlineStartOverlay.mainTableScrollableElement,o=this.topOverlay.mainTableScrollableElement,s=e.target,a=o!==r&&s!==r&&!s.contains(o),l=i!==r&&s!==r&&!s.contains(i);if(this.keyPressed&&(a||l)||this.scrollableElement===r)return;const u=this.translateMouseWheelToScroll(e);(n||this.scrollableElement!==r&&u)&&e.preventDefault()}onKeyDown(e){this.keyPressed=jc(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let n=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,r=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;e.deltaMode===1&&(r+=r*this.browserLineHeight,n+=n*this.browserLineHeight);const i=this.scrollVertically(n),o=this.scrollHorizontally(r);return i||o}scrollVertically(e){const n=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,n!==this.scrollableElement.scrollTop}scrollHorizontally(e){const n=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,n!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const e=this.topOverlay.clone.wtTable.holder,n=this.inlineStartOverlay.clone.wtTable.holder;let r=this.scrollableElement.scrollLeft,i=this.scrollableElement.scrollTop;if(this.wot.wtViewport.isHorizontallyScrollableByWindow()&&(r=this.scrollableElement.scrollX),this.wot.wtViewport.isVerticallyScrollableByWindow()&&(i=this.scrollableElement.scrollY),this.horizontalScrolling=this.lastScrollX!==r,this.verticalScrolling=this.lastScrollY!==i,this.lastScrollX=r,this.lastScrollY=i,this.horizontalScrolling){e.scrollLeft=r;const o=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;o&&(o.scrollLeft=r)}this.verticalScrolling&&(n.scrollTop=i),this.refreshAll()}syncScrollWithMaster(){if(!Bo(lg,this))return;const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:n,scrollTop:r}=e;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=n),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=n),this.inlineStartOverlay.needFullRender&&(this.inlineStartOverlay.clone.wtTable.holder.scrollTop=r),$a(lg,this,!1)}updateMainScrollableElements(){this.eventManager.clearEvents(!0),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:n}=this.domBindings;n.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.scrollableElement=e.holder:this.scrollableElement=Tf(e.TABLE),this.registerListeners()}destroy(){this.resizeObserver.disconnect(),this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.inlineStartOverlay.destroy(),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.destroy(),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.destroy(),this.destroyed=!0}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.updateLastSpreaderSize()&&this.adjustElementsSize(),this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.inlineStartOverlay.refresh(e),this.topOverlay.refresh(e),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.refresh(e),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.refresh(e)}updateLastSpreaderSize(){const e=this.wtTable.spreader,n=e.clientWidth,r=e.clientHeight,i=n!==this.spreaderLastSize.width||r!==this.spreaderLastSize.height;return i&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=r),i}adjustElementsSize(){const{wtViewport:e}=this.wot,{wtTable:n}=this,{rootWindow:r}=this.domBindings,i=this.scrollableElement===r,o=this.wtSettings.getSetting("totalColumns"),s=this.wtSettings.getSetting("totalRows"),a=e.getRowHeaderWidth(),u=e.getColumnHeaderHeight()+this.topOverlay.sumCellSizes(0,s)+1,c=a+this.inlineStartOverlay.sumCellSizes(0,o),d=n.hider.style,f=()=>i?!1:this.scrollableElement.scrollTop>Math.max(0,u-n.holder.clientHeight),m=()=>i?!1:this.scrollableElement.scrollLeft>Math.max(0,c-n.holder.clientWidth),b=f()?1:0,S=m()?1:0;d.width=`${c+S}px`,d.height=`${u+b}px`,this.topOverlay.adjustElementsSize(),this.inlineStartOverlay.adjustElementsSize(),this.bottomOverlay.adjustElementsSize()}expandHiderVerticallyBy(e){const{wtTable:n}=this;n.hider.style.height=`${parseInt(n.hider.style.height,10)+e}px`}expandHiderHorizontallyBy(e){const{wtTable:n}=this;n.hider.style.width=`${parseInt(n.hider.style.width,10)+e}px`}applyToDOM(){this.wtTable.isVisible()&&(this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.inlineStartOverlay.applyToDOM())}getParentOverlay(e){if(!e)return null;const n=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let r=null;return H(n,i=>{i&&i.clone&&i.clone.wtTable.TABLE.contains(e)&&(r=i.clone)}),r}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,n=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];H(n,r=>{r&&(r.clone.wtTable.TABLE.className=e.className)})}}function jH(t,e,n){return(e=qX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qX(t){var e=KX(t,"string");return typeof e=="symbol"?e:e+""}function KX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class XX{constructor(e){jH(this,"settings",{}),jH(this,"defaults",Object.freeze(this.getDefaults())),Ne(this.defaults,(n,r)=>{if(e[r]!==void 0)this.settings[r]=e[r];else{if(n===void 0)throw new Error(`A required setting "${r}" was not provided`);this.settings[r]=n}})}getDefaults(){return{facade:void 0,table:void 0,isDataViewInstance:!0,externalRowCalculator:!1,currentRowClassName:null,currentColumnClassName:null,preventOverflow(){return!1},preventWheel:!1,data:void 0,fixedColumnsStart:0,fixedRowsTop:0,fixedRowsBottom:0,shouldRenderInlineStartOverlay:()=>this.getSetting("fixedColumnsStart")>0||this.getSetting("rowHeaders").length>0,shouldRenderTopOverlay:()=>this.getSetting("fixedRowsTop")>0||this.getSetting("columnHeaders").length>0,shouldRenderBottomOverlay:()=>this.getSetting("fixedRowsBottom")>0,minSpareRows:0,rowHeaders(){return[]},columnHeaders(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:(e,n,r)=>{const i=this.getSetting("data",e,n);ya(r,i??"")},columnWidth(){},rowHeight(){},rowHeightByOverlayName(){},defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,viewportRowRenderingThreshold:null,viewportColumnRenderingThreshold:null,onCellMouseDown:null,onCellContextMenu:null,onCellMouseOver:null,onCellMouseOut:null,onCellMouseUp:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeRemoveCellClassNames:null,onAfterDrawSelection:null,onBeforeDrawBorders:null,onBeforeViewportScrollHorizontally:e=>e,onBeforeViewportScrollVertically:e=>e,onScrollHorizontally:null,onScrollVertically:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,onModifyRowHeaderWidth:null,onModifyGetCellCoords:null,onModifyGetCoordsElement:null,onModifyGetCoords:null,onBeforeHighlightingRowHeader:e=>e,onBeforeHighlightingColumnHeader:e=>e,onWindowResize:null,onContainerElementResize:null,renderAllColumns:!1,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null,headerClassName:null,rtlMode:!1,ariaTags:!0}}update(e,n){return n===void 0?Ne(e,(r,i)=>{this.settings[i]=r}):this.settings[e]=n,this}getSetting(e,n,r,i,o){return typeof this.settings[e]=="function"?this.settings[e](n,r,i,o):n!==void 0&&Array.isArray(this.settings[e])?this.settings[e][n]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}}class fR extends cu{constructor(e,n,r,i){super(e,n,r,i,"master")}alignOverlaysWithTrimmingContainer(){const e=Vc(this.wtRootElement),{rootWindow:n}=this.domBindings;if(e===n)this.wtSettings.getSetting("preventOverflow")||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible");else{const r=e.parentElement,i=_f(e,"height",n),o=_f(e,"overflow",n),s=this.holder.style,{scrollWidth:a,scrollHeight:l}=e;let u=e.offsetWidth,c=e.offsetHeight;if(r&&["auto","hidden","scroll"].includes(o)){const d=e.cloneNode(!1);d.style.overflow="auto",d.style.position="absolute",e.nextElementSibling?r.insertBefore(d,e.nextElementSibling):r.appendChild(d);const f=parseInt(n.getComputedStyle(d).height,10);r.removeChild(d),f===0&&(c=0)}c=Math.min(c,l),s.height=i==="auto"?"auto":`${c}px`,u=Math.min(u,a),s.width=`${u}px`,s.overflow="",this.hasTableHeight=s.height==="auto"?!0:c>0,this.hasTableWidth=u>0}this.isTableVisible=ql(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:n}=this.dataAccessObject,r="master",o=e.getSetting("columnHeaders").length;if(o&&!n.hasOversizedColumnHeadersMarked[r]){const a=e.getSetting("rowHeaders").length,l=this.getRenderedColumnsCount();for(let u=0;u<o;u++)for(let c=-1*a;c<l;c++)this.markIfOversizedColumnHeader(c);n.hasOversizedColumnHeadersMarked[r]=!0}}}ct(fR,nR),ct(fR,og);class ZX{constructor(e,n,r,i,o){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=n,this.wtSettings=r,this.wtTable=o,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.hasOversizedColumnHeadersMarked={},this.clientHeight=0,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.rowsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllRows")?new PK:new DK],["fullyVisible",()=>new CK],["partiallyVisible",()=>new tH]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new _K:new AK],["fullyVisible",()=>new pK],["partiallyVisible",()=>new eH]]),this.eventManager=i,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",()=>{this.clientHeight=this.getWorkspaceHeight()})}getWorkspaceHeight(){const e=this.domBindings.rootDocument,n=this.dataAccessObject.topOverlayTrimmingContainer;let r=0;return n===this.domBindings.rootWindow?r=e.documentElement.clientHeight:r=an(n)>0&&n.clientHeight>0?n.clientHeight:1/0,r}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const n=this.getColumnHeaderHeight();return n>0&&(e-=n),e}getWorkspaceWidth(){const{rootDocument:e,rootWindow:n}=this.domBindings,r=this.dataAccessObject.inlineStartOverlayTrimmingContainer;let i;if(r===n){const o=this.wtSettings.getSetting("totalColumns");i=this.wtTable.holder.offsetWidth,this.getRowHeaderWidth()+this.sumColumnWidths(0,o)>i&&(i=e.documentElement.clientWidth)}else i=r.clientWidth;return i}getViewportWidth(){const e=this.getWorkspaceWidth();if(e===1/0)return e;const n=this.getRowHeaderWidth();return n>0?e-n:e}hasVerticalScroll(){if(this.isVerticallyScrollableByWindow()){const o=this.domBindings.rootDocument.documentElement;return o.scrollHeight>o.clientHeight}const{holder:e,hider:n}=this.wtTable,r=e.clientHeight,i=n.offsetHeight;return r<i?!0:i>this.getWorkspaceHeight()}hasHorizontalScroll(){if(this.isVerticallyScrollableByWindow()){const o=this.domBindings.rootDocument.documentElement;return o.scrollWidth>o.clientWidth}const{holder:e,hider:n}=this.wtTable,r=e.clientWidth,i=n.offsetWidth;return r<i?!0:i>this.getWorkspaceWidth()}isVerticallyScrollableByWindow(){return this.dataAccessObject.topOverlayTrimmingContainer===this.domBindings.rootWindow}isHorizontallyScrollableByWindow(){return this.dataAccessObject.inlineStartOverlayTrimmingContainer===this.domBindings.rootWindow}sumColumnWidths(e,n){let r=0,i=e;for(;i<n;)r+=this.wtTable.getColumnWidth(i),i+=1;return r}getWorkspaceOffset(){return On(this.wtTable.holder)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=an(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getRowHeaderWidth(){const e=this.wtSettings.getSetting("rowHeaderWidth"),n=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let r=0,i=n.length;r<i;r++)this.rowHeaderWidth+=e[r]||e}if(isNaN(this.rowHeaderWidth))if(n.length){let r=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let i=0,o=n.length;i<o;i++)r?(this.rowHeaderWidth+=Qt(r),r=r.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}createRowsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:n,wtTable:r}=this;let i=this.getViewportHeight(),o,s;this.rowHeaderWidth=NaN;let a=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const l=n.getSetting("fixedRowsTop"),u=n.getSetting("fixedRowsBottom"),c=n.getSetting("totalRows");return l&&a>=0&&(s=this.dataAccessObject.topOverlay.sumCellSizes(0,l),a+=s,i-=s),u&&this.dataAccessObject.bottomOverlay.clone&&(s=this.dataAccessObject.bottomOverlay.sumCellSizes(c-u,c),i-=s),r.holder.clientHeight===r.holder.offsetHeight?o=0:o=vn(this.domBindings.rootDocument),new jK({calculationTypes:e.map(h=>[h,this.rowsCalculatorTypes.get(h)()]),viewportHeight:i,scrollOffset:a,totalRows:n.getSetting("totalRows"),defaultRowHeight:this.instance.stylesHandler.getDefaultRowHeight(),rowHeightFn:h=>r.getRowHeight(h),overrideFn:n.getSettingPure("viewportRowCalculatorOverride"),horizontalScrollbarHeight:o})}createColumnsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:n,wtTable:r}=this;let i=this.getViewportWidth(),o=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const s=n.getSetting("fixedColumnsStart");if(s&&o>=0){const a=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,s);o+=a,i-=a}return r.holder.clientWidth!==r.holder.offsetWidth&&(i-=vn(this.domBindings.rootDocument)),new VK({calculationTypes:e.map(a=>[a,this.columnsCalculatorTypes.get(a)()]),viewportWidth:i,scrollOffset:o,totalColumns:n.getSetting("totalColumns"),columnWidthFn:a=>r.getColumnWidth(a),overrideFn:n.getSettingPure("viewportColumnCalculatorOverride"),inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createCalculators(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this,r=this.createRowsCalculator(),i=this.createColumnsCalculator();if(e&&!n.getSetting("renderAllRows")){const o=r.getResultsFor("fullyVisible");e=this.areAllProposedVisibleRowsAlreadyRendered(o)}if(e&&!n.getSetting("renderAllColumns")){const o=i.getResultsFor("fullyVisible");e=this.areAllProposedVisibleColumnsAlreadyRendered(o)}return e||(this.rowsRenderCalculator=r.getResultsFor("rendered"),this.columnsRenderCalculator=i.getResultsFor("rendered")),this.rowsVisibleCalculator=r.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=i.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=r.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=i.getResultsFor("partiallyVisible"),e}createVisibleCalculators(){const e=this.createRowsCalculator(["fullyVisible","partiallyVisible"]),n=this.createColumnsCalculator(["fullyVisible","partiallyVisible"]);this.rowsVisibleCalculator=e.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=n.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=e.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=n.getResultsFor("partiallyVisible")}areAllProposedVisibleRowsAlreadyRendered(e){if(!this.rowsVisibleCalculator)return!1;let{startRow:n,endRow:r}=e;if(n===null&&r===null){if(!e.isVisibleInTrimmingContainer)return!0;n=this.rowsPartiallyVisibleCalculator.startRow,r=this.rowsPartiallyVisibleCalculator.endRow}const{startRow:i,endRow:o,rowStartOffset:s,rowEndOffset:a}=this.rowsRenderCalculator,l=this.wtSettings.getSetting("totalRows")-1,u=this.wtSettings.getSetting("viewportRowRenderingThreshold");return Number.isInteger(u)&&u>0?(n=Math.max(0,n-Math.min(s,u)),r=Math.min(l,r+Math.min(a,u))):u==="auto"&&(n=Math.max(0,n-Math.ceil(s/2)),r=Math.min(l,r+Math.ceil(a/2))),n<i||n===i&&n>0?!1:!(r>o||r===o&&r<l)}areAllProposedVisibleColumnsAlreadyRendered(e){if(!this.columnsVisibleCalculator)return!1;let{startColumn:n,endColumn:r}=e;if(n===null&&r===null){if(!e.isVisibleInTrimmingContainer)return!0;n=this.columnsPartiallyVisibleCalculator.startColumn,r=this.columnsPartiallyVisibleCalculator.endColumn}const{startColumn:i,endColumn:o,columnStartOffset:s,columnEndOffset:a}=this.columnsRenderCalculator,l=this.wtSettings.getSetting("totalColumns")-1,u=this.wtSettings.getSetting("viewportColumnRenderingThreshold");return Number.isInteger(u)&&u>0?(n=Math.max(0,n-Math.min(s,u)),r=Math.min(l,r+Math.min(a,u))):u==="auto"&&(n=Math.max(0,n-Math.ceil(s/2)),r=Math.min(l,r+Math.ceil(a/2))),n<i||n===i&&n>0?!1:!(r>o||r===o&&r<l)}resetHasOversizedColumnHeadersMarked(){Ne(this.hasOversizedColumnHeadersMarked,(e,n,r)=>{r[n]=void 0})}}function QX(t,e){UH(t,e),e.add(t)}function Fa(t,e,n){UH(t,e),e.set(t,n)}function UH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tt(t,e){return t.get(Si(t,e))}function bi(t,e,n){return t.set(Si(t,e),n),n}function Si(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 zH=23;var Zi=new WeakMap,jo=new WeakMap,gR=new WeakMap,mR=new WeakMap,_s=new WeakMap,lh=new WeakMap,uh=new WeakMap,Qi=new WeakSet;class JX{constructor(e){QX(this,Qi),Fa(this,Zi,void 0),Fa(this,jo,void 0),Fa(this,gR,void 0),Fa(this,mR,void 0),Fa(this,_s,!0),Fa(this,lh,{}),Fa(this,uh,{}),bi(jo,this,e.rootTable.parentElement.parentElement),bi(mR,this,e.rootDocument)}isClassicTheme(){return Tt(_s,this)}getCSSVariableValue(e){var n;if(Tt(_s,this))return null;if(Tt(lh,this)[`--ht-${e}`])return Tt(lh,this)[`--ht-${e}`];const r=(n=Si(Qi,this,r6).call(this,`--ht-${e}`))!==null&&n!==void 0?n:Si(Qi,this,GH).call(this,`--ht-${e}`);if(r!==null)return Tt(lh,this)[`--ht-${e}`]=r,r}getStyleForTD(e){var n;return(n=Tt(uh,this))===null||n===void 0?void 0:n.td[e]}getDefaultRowHeight(){if(Tt(_s,this))return zH;const e=Si(Qi,this,e6).call(this);return!e&&ye(Tt(jo,this),"ht-wrapper")?(et(`The "${Tt(Zi,this)}" theme is enabled, but its stylesheets are missing or not imported correctly. Import the correct CSS files in order to use that theme.`),bi(_s,this,!0),this.useTheme(),zH):e}areCellsBorderBox(){return this.getStyleForTD("box-sizing")==="border-box"}useTheme(e){if(!e){Si(Qi,this,YH).call(this),bi(_s,this,!0),bi(Zi,this,e||void 0);return}e&&e!==Tt(Zi,this)&&(Tt(Zi,this)&&Si(Qi,this,i6).call(this),bi(Zi,this,e),bi(_s,this,!1),Si(Qi,this,t6).call(this),Si(Qi,this,YH).call(this))}getThemeName(){return Tt(Zi,this)}removeClassNames(){ye(Tt(jo,this),Tt(Zi,this))&&ve(Tt(jo,this),Tt(Zi,this))}}function e6(){const t=this.getCSSVariableValue("line-height"),e=this.getCSSVariableValue("cell-vertical-padding"),n=Math.ceil(parseFloat(this.getStyleForTD("border-bottom-width")));return t===null||e===null||isNaN(n)?null:t+2*e+n}function t6(){ve(Tt(jo,this),/ht-theme-.*/g),X(Tt(jo,this),Tt(Zi,this))}function YH(){this.isClassicTheme()||bi(gR,this,getComputedStyle(Tt(jo,this)));const t=Si(Qi,this,n6).call(this,["box-sizing","border-bottom-width"]);Tt(uh,this).td={...Tt(uh,this).td,"box-sizing":t["box-sizing"],"border-bottom-width":t["border-bottom-width"]}}function n6(t){const e=Tt(mR,this),n=Tt(jo,this),r=e.createElement("table"),i=e.createElement("tbody"),o=e.createElement("tr"),s=e.createElement("tr"),a=e.createElement("td");s.appendChild(a),i.appendChild(o),i.appendChild(s),r.appendChild(i),n.appendChild(r);const l=getComputedStyle(a),u={};return t.forEach(c=>{u[c]=l.getPropertyValue(c)}),n.removeChild(r),u}function r6(t){const e=Math.ceil(parseFloat(Si(Qi,this,GH).call(this,t)));return Number.isNaN(e)?null:e}function GH(t){const e=Tt(gR,this).getPropertyValue(t);return e===""?null:e}function i6(){bi(uh,this,{}),bi(lh,this,{}),bi(_s,this,!0)}class o6 extends eR{constructor(e,n){super(e,new XX(n)),this.stylesHandler=new JX(this.domBindings);const r=this.wtSettings.getSetting("facade",this);this.wtTable=new fR(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=new ZX(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new HX(this.wtSettings.getSetting("selections")),this.wtEvent=new hH(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new GX(this,r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},n=[],r=[];Ne(e,(i,o)=>{this.wtSettings.getSetting(o).length&&r.push(i),n.push(i)}),ve(this.wtTable.wtRootElement.parentNode,n),X(this.wtTable.wtRootElement.parentNode,r)}getOverlayByName(e){var n;if(!TH.includes(e))return null;const r=e.replace(/_([a-z])/g,i=>i[1].toUpperCase());return(n=this.wtOverlays[`${r}Overlay`])!==null&&n!==void 0?n:null}getViewportDao(){const e=this;return{get wot(){return e},get topOverlayTrimmingContainer(){return e.wtOverlays.topOverlay.trimmingContainer},get inlineStartOverlayTrimmingContainer(){return e.wtOverlays.inlineStartOverlay.trimmingContainer},get topScrollPosition(){return e.wtOverlays.topOverlay.getScrollPosition()},get topParentOffset(){return e.wtOverlays.topOverlay.getTableParentOffset()},get inlineStartScrollPosition(){return e.wtOverlays.inlineStartOverlay.getScrollPosition()},get inlineStartParentOffset(){return e.wtOverlays.inlineStartOverlay.getTableParentOffset()},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get bottomOverlay(){return e.wtOverlays.bottomOverlay}}}}class pR{constructor(e){e instanceof eR?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=n=>{const r=new pR(n);return()=>r},this._wot=new o6(e.table,e)}get guid(){return this._wot.guid}get rootDocument(){return this._wot.domBindings.rootDocument}get rootWindow(){return this._wot.domBindings.rootWindow}get wtSettings(){return this._wot.wtSettings}get cloneSource(){return this._wot.cloneSource}get cloneOverlay(){return this._wot.cloneOverlay}get selectionManager(){return this._wot.selectionManager}get wtViewport(){return this._wot.wtViewport}get wtOverlays(){return this._wot.wtOverlays}get wtTable(){return this._wot.wtTable}get wtEvent(){return this._wot.wtEvent}get wtScroll(){return this._wot.wtScroll}get drawn(){return this._wot.drawn}set drawn(e){this._wot.drawn=e}get activeOverlayName(){return this._wot.activeOverlayName}get drawInterrupted(){return this._wot.drawInterrupted}set drawInterrupted(e){this._wot.drawInterrupted=e}get lastMouseOver(){return this._wot.lastMouseOver}set lastMouseOver(e){this._wot.lastMouseOver=e}get momentumScrolling(){return this._wot.momentumScrolling}set momentumScrolling(e){this._wot.momentumScrolling=e}get touchApplied(){return this._wot.touchApplied}set touchApplied(e){this._wot.touchApplied=e}get domBindings(){return this._wot.domBindings}get eventListeners(){return this._wot.eventListeners}set eventListeners(e){this._wot.eventListeners=e}get eventManager(){return this._wot.eventManager}get stylesHandler(){return this._wot.stylesHandler}createCellCoords(e,n){return this._wot.createCellCoords(e,n)}createCellRange(e,n,r){return this._wot.createCellRange(e,n,r)}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._wot.draw(e),this}getCell(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this._wot.getCell(e,n)}scrollViewport(e,n,r){return this._wot.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this._wot.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this._wot.scrollViewportVertically(e,n)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}getOverlayByName(e){return this._wot.getOverlayByName(e)}exportSettingsAsClassNames(){return this._wot.exportSettingsAsClassNames()}update(e,n){return this._wot.wtSettings.update(e,n),this}getSetting(e,n,r,i,o){return this._wot.wtSettings.getSetting(e,n,r,i,o)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}}var qH={},KH={},XH;function s6(){if(XH)return KH;XH=1;var t=vt(),e=Al(),n=Jn(),r=nn(),i=Li();return t({target:"Iterator",proto:!0,real:!0},{some:function(s){r(this),n(s);var a=i(this),l=0;return e(a,function(u,c){if(s(u,l++))return c()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),KH}var ZH;function a6(){return ZH||(ZH=1,s6()),qH}a6();function QH(t,e,n){return(e=l6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l6(t){var e=u6(t,"string");return typeof e=="symbol"?e:e+""}function u6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Va{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;QH(this,"indexedValues",[]),QH(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){const n=this.indexedValues;if(e<n.length)return n[e]}setValues(e){this.indexedValues=e.slice(),this.runLocalHooks("change")}setValueAtIndex(e,n){return e<this.indexedValues.length?(this.indexedValues[e]=n,this.runLocalHooks("change"),!0):!1}clear(){this.setDefaultValues()}getLength(){return this.getValues().length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.indexedValues.length=0,rt(this.initValueOrFn)?fe(e-1,n=>this.indexedValues.push(this.initValueOrFn(n))):fe(e-1,()=>this.indexedValues.push(this.initValueOrFn)),this.runLocalHooks("change")}init(e){return this.setDefaultValues(e),this.runLocalHooks("init"),this}insert(){this.runLocalHooks("change")}remove(){this.runLocalHooks("change")}destroy(){this.clearLocalHooks(),this.indexedValues=null,this.initValueOrFn=null}}ct(Va,Mn);function wR(t,e,n,r){const i=n.length?n[0]:void 0;return[...t.slice(0,i),...n.map((o,s)=>rt(r)?r(o,s):r),...i===void 0?[]:t.slice(i)]}function vR(t,e){return ga(t,(n,r)=>e.includes(r)===!1)}class Ms extends Va{insert(e,n){this.indexedValues=wR(this.indexedValues,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){this.indexedValues=vR(this.indexedValues,e),super.remove(e)}}class cg extends Ms{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return tr(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}function CR(t,e,n){return[...t.slice(0,e),...n,...t.slice(e)]}function ch(t,e){return ga(t,n=>e.includes(n)===!1)}function yR(t,e){return je(t,n=>n-e.filter(r=>r<n).length)}function bR(t,e){const n=e[0],r=e.length;return je(t,i=>i>=n?i+r:i)}function c6(t,e,n){return(e=h6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h6(t){var e=d6(t,"string");return typeof e=="symbol"?e:e+""}function d6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class hg extends Va{constructor(){super(...arguments),c6(this,"orderOfIndexes",[])}getValues(){return this.orderOfIndexes.map(e=>this.indexedValues[e])}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.orderOfIndexes.length;return e<this.indexedValues.length?(this.indexedValues[e]=n,this.orderOfIndexes.includes(e)===!1&&this.orderOfIndexes.splice(r,0,e),this.runLocalHooks("change"),!0):!1}clearValue(e){this.orderOfIndexes=ch(this.orderOfIndexes,[e]),rt(this.initValueOrFn)?super.setValueAtIndex(e,this.initValueOrFn(e)):super.setValueAtIndex(e,this.initValueOrFn)}getLength(){return this.orderOfIndexes.length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.orderOfIndexes.length=0,super.setDefaultValues(e)}insert(e,n){this.indexedValues=wR(this.indexedValues,e,n,this.initValueOrFn),this.orderOfIndexes=bR(this.orderOfIndexes,n),super.insert(e,n)}remove(e){this.indexedValues=vR(this.indexedValues,e),this.orderOfIndexes=ch(this.orderOfIndexes,e),this.orderOfIndexes=yR(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class hh extends Ms{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return tr(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}const JH=new Map([["indexesSequence",{getListWithInsertedItems:CR,getListWithRemovedItems:ch}],["physicallyIndexed",{getListWithInsertedItems:wR,getListWithRemovedItems:vR}]]),e1=t=>{if(JH.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return JH.get(t)};class t1 extends Va{constructor(){super(e=>e)}insert(e,n){const r=bR(this.indexedValues,n);this.indexedValues=CR(r,e,n),super.insert(e,n)}remove(e){const n=ch(this.indexedValues,e);this.indexedValues=yR(n,e),super.remove(e)}}const n1=new Map([["hiding",cg],["index",Va],["linkedPhysicalIndexToValue",hg],["physicalIndexToValue",Ms],["trimming",hh]]);function f6(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!n1.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(n1.get(t))(e)}function g6(t,e,n){return(e=m6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m6(t){var e=p6(t,"string");return typeof e=="symbol"?e:e+""}function p6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class SR{constructor(){g6(this,"collection",new Map)}register(e,n){this.collection.has(e)===!1&&(this.collection.set(e,n),n.addLocalHook("change",()=>this.runLocalHooks("change",n)))}unregister(e){const n=this.collection.get(e);ce(n)&&(n.destroy(),this.collection.delete(e),this.runLocalHooks("change",n))}unregisterAll(){this.collection.forEach((e,n)=>this.unregister(n)),this.collection.clear()}get(e){return At(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach(n=>{n.remove(e)})}insertToEvery(e,n){this.collection.forEach(r=>{r.insert(e,n)})}initEvery(e){this.collection.forEach(n=>{n.init(e)})}}ct(SR,Mn);function RR(t,e,n){return(e=w6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w6(t){var e=v6(t,"string");return typeof e=="symbol"?e:e+""}function v6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class r1 extends SR{constructor(e,n){super(),RR(this,"mergedValuesCache",[]),RR(this,"aggregationFunction",void 0),RR(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=n}getMergedValues(){if((arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0)return this.mergedValuesCache;if(this.getLength()===0)return[];const n=je(this.get(),o=>o.getValues()),r=[],i=ce(n[0])&&n[0].length||0;for(let o=0;o<i;o+=1){const s=[];for(let a=0;a<this.getLength();a+=1)s.push(n[a][o]);r.push(s)}return je(r,this.aggregationFunction)}getMergedValueAtIndex(e,n){const r=this.getMergedValues(n)[e];return ce(r)?r:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function C6(t,e,n){y6(t,e),e.set(t,n)}function y6(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function b6(t,e,n){return t.set(i1(t,e),n),n}function S6(t,e){return t.get(i1(t,e))}function i1(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 ER=new WeakMap;class o1{constructor(){C6(this,ER,[])}subscribe(e){return this.addLocalHook("change",e),this._write(S6(ER,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){b6(ER,this,e)}}ct(o1,Mn);function s1(t,e){const n=[];let r=0,i=0;for(;r<t.length&&i<e.length;r++,i++)t[r]!==e[i]&&n.push({op:"replace",index:i,oldValue:t[r],newValue:e[i]});for(;r<e.length;r++)n.push({op:"insert",index:r,oldValue:void 0,newValue:e[r]});for(;i<t.length;i++)n.push({op:"remove",index:i,oldValue:t[i],newValue:void 0});return n}function dh(t,e,n){R6(t,e),e.set(t,n)}function R6(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xr(t,e){return t.get(a1(t,e))}function dg(t,e,n){return t.set(a1(t,e),n),n}function a1(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 fg=new WeakMap,fh=new WeakMap,gg=new WeakMap,mg=new WeakMap,pg=new WeakMap;class E6{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dh(this,fg,new Set),dh(this,fh,[]),dh(this,gg,[]),dh(this,mg,!1),dh(this,pg,!1),dg(pg,this,e??!1)}createObserver(){const e=new o1;return Xr(fg,this).add(e),e.addLocalHook("unsubscribe",()=>{Xr(fg,this).delete(e)}),e._writeInitialChanges(s1(Xr(fh,this),Xr(gg,this))),e}emit(e){let n=Xr(gg,this);(!Xr(mg,this)||Xr(fh,this).length!==e.length)&&(e.length===0?e=new Array(n.length).fill(Xr(pg,this)):dg(fh,this,new Array(e.length).fill(Xr(pg,this))),Xr(mg,this)||(dg(mg,this,!0),n=Xr(fh,this)));const r=s1(n,e);Xr(fg,this).forEach(i=>i._write(r)),dg(gg,this,e)}}function Un(t,e,n){return(e=T6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T6(t){var e=_6(t,"string");return typeof e=="symbol"?e:e+""}function _6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class TR{constructor(){Un(this,"indexesSequence",new t1),Un(this,"trimmingMapsCollection",new r1(e=>e.some(n=>n===!0),!1)),Un(this,"hidingMapsCollection",new r1(e=>e.some(n=>n===!0),!1)),Un(this,"variousMapsCollection",new SR),Un(this,"hidingChangesObservable",new E6({initialIndexValue:!1})),Un(this,"notTrimmedIndexesCache",[]),Un(this,"notHiddenIndexesCache",[]),Un(this,"isBatched",!1),Un(this,"indexesSequenceChanged",!1),Un(this,"indexesChangeSource",void 0),Un(this,"trimmedIndexesChanged",!1),Un(this,"hiddenIndexesChanged",!1),Un(this,"renderablePhysicalIndexesCache",[]),Un(this,"fromPhysicalToVisualIndexesCache",new Map),Un(this,"fromVisualToRenderableIndexesCache",new Map),this.indexesSequence.addLocalHook("change",()=>{this.indexesSequenceChanged=!0,this.updateCache(),this.runLocalHooks("indexesSequenceChange",this.indexesChangeSource),this.runLocalHooks("change",this.indexesSequence,null)}),this.trimmingMapsCollection.addLocalHook("change",e=>{this.trimmedIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.trimmingMapsCollection)}),this.hidingMapsCollection.addLocalHook("change",e=>{this.hiddenIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.hidingMapsCollection)}),this.variousMapsCollection.addLocalHook("change",e=>{this.runLocalHooks("change",e,this.variousMapsCollection)})}suspendOperations(){this.isBatched=!0}resumeOperations(){this.isBatched=!1,this.updateCache()}createChangesObserver(e){if(e!=="hiding")throw new Error(`Unsupported index map type "${e}".`);return this.hidingChangesObservable.createObserver()}createAndRegisterIndexMap(e,n,r){return this.registerMap(e,f6(n,r))}registerMap(e,n){if(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))throw Error(`Map with name "${e}" has been already registered.`);n instanceof hh?this.trimmingMapsCollection.register(e,n):n instanceof cg?this.hidingMapsCollection.register(e,n):this.variousMapsCollection.register(e,n);const r=this.getNumberOfIndexes();return r>0&&n.init(r),n}unregisterMap(e){this.trimmingMapsCollection.unregister(e),this.hidingMapsCollection.unregister(e),this.variousMapsCollection.unregister(e)}unregisterAll(){this.trimmingMapsCollection.unregisterAll(),this.hidingMapsCollection.unregisterAll(),this.variousMapsCollection.unregisterAll()}getPhysicalFromVisualIndex(e){const n=this.notTrimmedIndexesCache[e];return ce(n)?n:null}getPhysicalFromRenderableIndex(e){const n=this.renderablePhysicalIndexesCache[e];return ce(n)?n:null}getVisualFromPhysicalIndex(e){const n=this.fromPhysicalToVisualIndexesCache.get(e);return ce(n)?n:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const n=this.fromVisualToRenderableIndexesCache.get(e);return ce(n)?n:null}getNearestNotHiddenIndex(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.getPhysicalFromVisualIndex(e)===null)return null;if(this.fromVisualToRenderableIndexesCache.has(e))return e;const o=Array.from(this.fromVisualToRenderableIndexesCache.keys());let s=-1;return n>0?s=o.findIndex(a=>a>e):s=o.reverse().findIndex(a=>a<e),s===-1?r?this.getNearestNotHiddenIndex(e,-n,!1):null:o[s]}initToLength(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getNumberOfIndexes();this.notTrimmedIndexesCache=[...new Array(e).keys()],this.notHiddenIndexesCache=[...new Array(e).keys()],this.suspendOperations(),this.indexesChangeSource="init",this.indexesSequence.init(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.initEvery(e),this.resumeOperations(),this.suspendOperations(),this.hidingMapsCollection.initEvery(e),this.variousMapsCollection.initEvery(e),this.resumeOperations(),this.runLocalHooks("init")}fitToLength(e){const n=this.getNumberOfIndexes();if(e<n){const r=[...Array(this.getNumberOfIndexes()-e).keys()].map(i=>i+e);this.removeIndexes(r)}else this.insertIndexes(n,e-n)}getIndexesSequence(){return this.indexesSequence.getValues()}setIndexesSequence(e){this.indexesChangeSource===void 0&&(this.indexesChangeSource="update"),this.indexesSequence.setValues(e),this.indexesChangeSource==="update"&&(this.indexesChangeSource=void 0)}getNotTrimmedIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notTrimmedIndexesCache:this.getIndexesSequence().filter(r=>this.isTrimmed(r)===!1)}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notHiddenIndexesCache:this.getIndexesSequence().filter(r=>this.isHidden(r)===!1)}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(r=>this.isHidden(r)===!1)}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,n){typeof e=="number"&&(e=[e]);const r=je(e,u=>this.getPhysicalFromVisualIndex(u)),i=this.getNotTrimmedIndexesLength(),o=e.length,s=ch(this.getIndexesSequence(),r),a=s.filter(u=>this.isTrimmed(u)===!1);let l=s.indexOf(a[a.length-1])+1;if(n+o<i){const u=a[n];l=s.indexOf(u)}this.indexesChangeSource="move",this.setIndexesSequence(CR(s,l,r)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,n){const r=this.getNotTrimmedIndexes()[e],i=ce(r)?r:this.getNumberOfIndexes(),o=this.getIndexesSequence().includes(r)?this.getIndexesSequence().indexOf(r):this.getNumberOfIndexes(),s=je(new Array(n).fill(i),(a,l)=>a+l);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(o,s),this.indexesChangeSource=void 0,this.trimmingMapsCollection.insertToEvery(o,s),this.hidingMapsCollection.insertToEvery(o,s),this.variousMapsCollection.insertToEvery(o,s),this.resumeOperations()}removeIndexes(e){this.suspendOperations(),this.indexesChangeSource="remove",this.indexesSequence.remove(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.removeFromEvery(e),this.hidingMapsCollection.removeFromEvery(e),this.variousMapsCollection.removeFromEvery(e),this.resumeOperations()}updateCache(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(e===!0||this.isBatched===!1&&n===!0)&&(this.trimmingMapsCollection.updateCache(),this.hidingMapsCollection.updateCache(),this.notTrimmedIndexesCache=this.getNotTrimmedIndexes(!1),this.notHiddenIndexesCache=this.getNotHiddenIndexes(!1),this.renderablePhysicalIndexesCache=this.getRenderableIndexes(!1),this.cacheFromPhysicalToVisualIndexes(),this.cacheFromVisualToRenderableIndexes(),this.hiddenIndexesChanged&&this.hidingChangesObservable.emit(this.hidingMapsCollection.getMergedValues()),this.runLocalHooks("cacheUpdated",{indexesSequenceChanged:this.indexesSequenceChanged,trimmedIndexesChanged:this.trimmedIndexesChanged,hiddenIndexesChanged:this.hiddenIndexesChanged}),this.indexesSequenceChanged=!1,this.trimmedIndexesChanged=!1,this.hiddenIndexesChanged=!1)}cacheFromPhysicalToVisualIndexes(){const e=this.getNotTrimmedIndexesLength();this.fromPhysicalToVisualIndexesCache.clear();for(let n=0;n<e;n+=1){const r=this.getPhysicalFromVisualIndex(n);this.fromPhysicalToVisualIndexesCache.set(r,n)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let n=0;n<e;n+=1){const r=this.getPhysicalFromRenderableIndex(n),i=this.getVisualFromPhysicalIndex(r);this.fromVisualToRenderableIndexesCache.set(i,n)}}}ct(TR,Mn);function M6(t,e){l1(t,e),e.add(t)}function _R(t,e,n){l1(t,e),e.set(t,n)}function l1(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gh(t,e,n){return(e=I6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function I6(t){var e=P6(t,"string");return typeof e=="symbol"?e:e+""}function P6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Is(t,e){return t.get(or(t,e))}function wg(t,e,n){return t.set(or(t,e),n),n}function or(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")}re.getSingleton().register("modifyAutoColumnSizeSeed");const MR="autoColumnSize",O6=10,x6="autoColumnSize";var IR=new WeakMap,gu=new WeakMap,mu=new WeakMap,_r=new WeakSet;class mh extends Xe{static get PLUGIN_KEY(){return MR}static get PLUGIN_PRIORITY(){return O6}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){super(e),M6(this,_r),gh(this,"ghostTable",new KA(this.hot)),gh(this,"samplesGenerator",new eg((n,r)=>{const i=this.hot.toPhysicalRow(n),o=this.hot.toPhysicalColumn(r);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(o))return!1;const s=this.hot.getCellMeta(n,r);let a="";s.spanned||(a=this.hot.getDataAtCell(n,r));let l="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(l=this.hot.runHooks("modifyAutoColumnSizeSeed",l,s,a)),{value:a,bundleSeed:l}})),gh(this,"inProgress",!1),gh(this,"measuredColumns",0),gh(this,"columnWidthsMap",new Ms),_R(this,IR,!1),_R(this,gu,[]),_R(this,mu,[]),this.hot.columnIndexMapper.registerMap(x6,this.columnWidthsMap),this.addHook("beforeColumnResize",(n,r,i)=>or(_r,this,h1).call(this,n,r,i))}isEnabled(){return this.hot.getSettings()[MR]!==!1&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;this.ghostTable.setSetting("useHeaders",this.getSetting("useHeaders")),this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const n=this.getSetting("samplingRatio");n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return or(_r,e,N6).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return or(_r,e,D6).call(e,...i)}),this.addHook("afterFormulasValuesUpdate",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return or(_r,e,L6).call(e,...i)}),this.addHook("beforeRender",()=>or(_r,this,H6).call(this)),this.addHook("modifyColWidth",(r,i)=>this.getColumnWidth(i,r)),this.addHook("init",()=>or(_r,this,k6).call(this)),super.enablePlugin()}updatePlugin(){wg(mu,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,n,r)=>or(_r,this,h1).call(this,e,n,r))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const e=this.getFirstVisibleColumn(),n=this.getLastVisibleColumn();if(e===-1||n===-1)return;const r=this.hot.forceFullRender;this.calculateColumnsWidth({from:e,to:n},void 0,r)}calculateColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countRows()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof n=="number"?{from:n,to:n}:n;fe(i.from,i.to,s=>{let a=this.hot.toPhysicalColumn(s);a===null&&(a=s),(r||this.columnWidthsMap.getValueAtIndex(a)===null&&!this.hot._getColWidthFromSettings(a))&&or(_r,this,u1).call(this,s,o)}),this.ghostTable.columns.length&&(or(_r,this,c1).call(this),this.measuredColumns=i.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0;const i=this.hot.countCols()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){xf(o),this.inProgress=!1;return}this.calculateColumnsWidth({from:r,to:Math.min(r+mh.CALCULATION_STEP,i)},e,n),r=r+mh.CALCULATION_STEP+1,r<i?o=Of(s):(xf(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateColumnsWidth({from:0,to:a},e,n),r=a+1),r<i?s():this.inProgress=!1}recalculateAllColumnsWidth(){this.hot.view.isVisible()&&this.calculateAllColumnsWidth({from:0,to:this.hot.countRows()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[MR];let n=mh.SYNC_CALCULATION_LIMIT;const r=this.hot.countCols()-1;return He(e)&&(n=e.syncLimit,jO(n)?n=_x(r,n):n>>=0),Math.min(n,r)}getColumnWidth(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=n;return i===void 0&&(i=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),r&&typeof i=="number"&&(i=Math.max(i,ou))),i}getFirstVisibleColumn(){var e;return(e=this.hot.getFirstRenderedVisibleColumn())!==null&&e!==void 0?e:-1}getLastVisibleColumn(){var e;return(e=this.hot.getLastRenderedVisibleColumn())!==null&&e!==void 0?e:-1}findColumnsWhereHeaderWasChanged(){return this.hot.getColHeader().reduce((r,i,o)=>{const s=Is(gu,this).length;return(s-1<o||Is(gu,this)[o]!==i)&&r.push(this.hot.toVisualColumn(o)),s-1<o?Is(gu,this).push(i):Is(gu,this)[o]=i,r},[])}clearCache(e){Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(n=>{this.columnWidthsMap.setValueAtIndex(n,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!this.columnWidthsMap.getValues().slice(0,this.measuredColumns).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function A6(t){const e={from:0,to:this.hot.countRows()-1};t.forEach(n=>{const r=this.hot.toPhysicalColumn(n);r!==null&&(this.hot._getColWidthFromSettings(r)||or(_r,this,u1).call(this,n,e))}),this.ghostTable.columns.length&&(or(_r,this,c1).call(this),this.ghostTable.clean())}function u1(t,e){this.samplesGenerator.generateColumnSamples(t,e).forEach((r,i)=>this.ghostTable.addColumn(i,r))}function c1(){this.hot.batchExecution(()=>{this.ghostTable.getWidths((t,e)=>{const n=this.hot.toPhysicalColumn(t);this.columnWidthsMap.setValueAtIndex(n,e)})},!0)}function H6(){this.calculateVisibleColumnsWidth(),this.inProgress||(or(_r,this,A6).call(this,Is(mu,this)),wg(mu,this,[]))}function N6(t,e){e||this.recalculateAllColumnsWidth()}function D6(t){const e=t.reduce((n,r)=>{let[,i]=r;const o=this.hot.propToCol(i);return Number.isInteger(o)&&n.indexOf(o)===-1&&n.push(o),n},[]);Is(mu,this).push(...e)}function h1(t,e,n){let r=t;return n&&(this.calculateColumnsWidth(e,void 0,!0),r=this.getColumnWidth(e,void 0,!1)),r}function k6(){wg(gu,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth(),wg(IR,this,!0)}function L6(t){if(!Is(IR,this))return;const e=t.reduce((n,r)=>{var i;const o=(i=r.address)===null||i===void 0?void 0:i.col;if(Number.isInteger(o)){const s=this.hot.toVisualColumn(o);n.indexOf(s)===-1&&n.push(s)}return n},[]);Is(mu,this).push(...e)}const Wa={horizontal:"horizontal",vertical:"vertical"};function $6(t,e,n){let r,i,o;return e[0]===t[0]&&e[1]<t[1]?(o="left",r=n(e[0],e[1]),i=n(e[2],t[1]-1)):e[2]===t[2]&&e[0]===t[0]&&e[3]>t[3]?(o="right",r=n(e[0],t[3]+1),i=n(e[2],e[3])):e[0]<t[0]&&e[1]===t[1]?(o="up",r=n(e[0],e[1]),i=n(t[0]-1,e[3])):e[2]>t[2]&&e[1]===t[1]&&(o="down",r=n(t[2]+1,e[1]),i=n(e[2],e[3])),r&&r.normalize(),i&&i.normalize(),{directionOfDrag:o,startOfDragCoords:r,endOfDragCoords:i}}function F6(t){const e={};return t===!0?(e.directions=Object.keys(Wa),e.autoInsertRow=!0):He(t)?(ce(t.autoInsertRow)?t.direction===Wa.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,ce(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(Wa)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function V6(t,e){W6(t,e),e.add(t)}function W6(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pu(t,e,n){return(e=B6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function B6(t){var e=j6(t,"string");return typeof e=="symbol"?e:e+""}function j6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ph(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")}re.getSingleton().register("modifyAutofillRange"),re.getSingleton().register("beforeAutofill"),re.getSingleton().register("afterAutofill");const d1="autofill",U6=20,z6=["fillHandle"],Y6="insert_row_below",G6=200;var wu=new WeakSet;class q6 extends Xe{constructor(){super(...arguments),V6(this,wu),pu(this,"addingStarted",!1),pu(this,"mouseDownOnCellCorner",!1),pu(this,"mouseDragOutside",!1),pu(this,"handleDraggedCells",0),pu(this,"directions",[]),pu(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return d1}static get PLUGIN_PRIORITY(){return U6}static get SETTING_KEYS(){return[d1,...z6]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>ph(wu,this,X6).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>ph(wu,this,K6).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,n)=>ph(wu,this,Z6).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){const e=this.hot.getSelectedRangeLast(),{row:n,col:r}=e.getTopStartCorner(),{row:i,col:o}=e.getBottomEndCorner(),s=this.hot.runHooks("modifyCopyableRange",[{startRow:n,startCol:r,endRow:i,endCol:o}]),a=[],l=[],u=[];return H(s,c=>{for(let h=c.startRow;h<=c.endRow;h+=1)a.indexOf(h)===-1&&a.push(h);for(let h=c.startCol;h<=c.endCol;h+=1)l.indexOf(h)===-1&&l.push(h)}),H(a,c=>{const h=[];H(l,d=>{h.push(this.hot.getCopyableData(c,d))}),u.push(h)}),u}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,n,r,i]=this.hot.selection.highlight.getFill().getVisualCorners(),o=this.hot.getSelectedRangeLast(),s=o.getTopStartCorner(),a=o.getBottomEndCorner();this.resetSelectionOfDraggedArea();const l=[s.row,s.col,a.row,a.col],u=this.hot.runHooks("modifyAutofillRange",[Math.min(s.row,e),Math.min(s.col,n),Math.max(a.row,r),Math.max(a.col,i)],l),{directionOfDrag:c,startOfDragCoords:h,endOfDragCoords:d}=$6(l,u,(f,m)=>this.hot._createCellCoords(f,m));if(h&&h.row>-1&&h.col>-1){const f=this.getSelectionData(),m=o.clone(),b=this.hot._createCellRange(h,h,d),S=this.hot.runHooks("beforeAutofill",f,m,b,c);if(S===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let E=S;const v=S;if(["up","left"].indexOf(c)>-1&&!(v.length===1&&v[0].length===0))if(E=[],c==="up"){const I=d.row-h.row+1,M=I%v.length;for(let T=0;T<I;T++)E.push(v[(T+(v.length-M))%v.length])}else{const I=d.col-h.col+1,M=I%v[0].length;for(let T=0;T<v.length;T++){E.push([]);for(let P=0;P<I;P++)E[T].push(v[T][(P+(v[T].length-M))%v[T].length])}}this.hot.populateFromArray(h.row,h.col,E,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(u),this.hot.runHooks("afterAutofill",E,m,b,c),this.hot.render()}else this.hot.view.render();return!0}reduceSelectionAreaIfNeeded(e){return e.row<0&&(e.row=0),e.col<0&&(e.col=0),e}getCoordsOfDragAndDropBorders(e){const n=this.hot.getSelectedRangeLast(),r=n.getBottomEndCorner();let i=e;if(this.directions.includes(Wa.vertical)&&this.directions.includes(Wa.horizontal)){const o=n.getTopStartCorner();(r.col<=e.col||o.col>=e.col)&&(i=this.hot._createCellCoords(r.row,e.col)),(r.row<e.row||o.row>e.row)&&(i=this.hot._createCellCoords(e.row,r.col))}else if(this.directions.includes(Wa.vertical))i=this.hot._createCellCoords(e.row,r.col);else if(this.directions.includes(Wa.horizontal))i=this.hot._createCellCoords(r.row,e.col);else return;return this.reduceSelectionAreaIfNeeded(i)}showBorder(e){const n=this.getCoordsOfDragAndDropBorders(e);n&&this.redrawBorders(n)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter(Y6,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},G6)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&this.addingStarted===!1&&this.autoInsertRow){const e=this.hot.getSelectedLast(),n=this.hot.selection.highlight.getFill().getVisualCorners(),r=this.hot.countRows();e[2]<r-1&&n[2]===r-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){const n=this.hot.getData(),r=this.hot.countRows();let i;for(let o=e[2]+1;o<r;o++){for(let l=e[1];l<=e[3];l++){const u=n[o][l];if(!Bt(u))return-1}const s=n[o][e[1]-1],a=n[o][e[3]+1];(!Bt(s)||!Bt(a))&&(i=o)}return i}addSelectionFromStartAreaToSpecificRowIndex(e,n){this.hot.selection.highlight.getFill().clear().add(this.hot._createCellCoords(e[0],e[1])).add(this.hot._createCellCoords(n,e[3])).commit()}setSelection(e){this.hot.selectCell(...je(e,n=>Math.max(n,0)),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),n=this.getIndexOfLastAdjacentFilledInRow(e);return n===-1||n===void 0?!1:(this.addSelectionFromStartAreaToSpecificRowIndex(e,n),!0)}resetSelectionOfDraggedArea(){this.handleDraggedCells=0,this.hot.selection.highlight.getFill().clear()}redrawBorders(e){this.hot.selection.highlight.getFill().clear().add(this.hot.getSelectedRangeLast().from).add(this.hot.getSelectedRangeLast().to).add(e).commit(),this.hot.view.render()}getIfMouseWasDraggedOutside(e){const{documentElement:n}=this.hot.rootDocument,r=On(this.hot.table).top-(this.hot.rootWindow.pageYOffset||n.scrollTop)+an(this.hot.table),i=On(this.hot.table).left-(this.hot.rootWindow.pageXOffset||n.scrollLeft)+Qt(this.hot.table);return e.clientY>r&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>ph(wu,this,Q6).call(this)),this.eventManager.addEventListener(e,"mousemove",n=>ph(wu,this,J6).call(this,n))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=F6(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function K6(){this.selectAdjacent()&&this.fillIn()}function X6(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function Z6(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function Q6(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function J6(t){const e=this.getIfMouseWasDraggedOutside(t);this.addingStarted===!1&&this.handleDraggedCells>0&&e?(this.mouseDragOutside=!0,this.addingStarted=!0):this.mouseDragOutside=!1,this.mouseDragOutside&&this.autoInsertRow&&this.addRow()}function e4(t,e){g1(t,e),e.add(t)}function f1(t,e,n){g1(t,e),e.set(t,n)}function g1(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vu(t,e,n){return(e=t4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function t4(t){var e=n4(t,"string");return typeof e=="symbol"?e:e+""}function n4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function m1(t,e,n){return t.set(Ji(t,e),n),n}function vg(t,e){return t.get(Ji(t,e))}function Ji(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 PR="autoRowSize",r4=40,i4="autoRowSize";var wh=new WeakMap,OR=new WeakMap,Uo=new WeakSet;class vh extends Xe{static get PLUGIN_KEY(){return PR}static get PLUGIN_PRIORITY(){return r4}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){super(e),e4(this,Uo),vu(this,"headerHeight",null),vu(this,"ghostTable",new KA(this.hot)),vu(this,"samplesGenerator",new eg((n,r)=>{const i=this.hot.toPhysicalRow(n),o=this.hot.toPhysicalColumn(r);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(o)||n>=0&&r>=0&&this.hot.getCellMeta(n,r).hidden)return!1;let s;return n>=0?s=this.hot.getDataAtCell(n,r):n===-1&&(s=this.hot.getColHeader(r)),{value:s}})),vu(this,"inProgress",!1),vu(this,"measuredRows",0),vu(this,"rowHeightsMap",new Ms),f1(this,wh,[]),f1(this,OR,!1),this.hot.rowIndexMapper.registerMap(i4,this.rowHeightsMap),this.addHook("beforeRowResize",(n,r,i)=>Ji(Uo,this,p1).call(this,n,r,i))}isEnabled(){const e=this.hot.getSettings()[PR];return e===!0||He(e)}enablePlugin(){var e=this;if(this.enabled)return;this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const n=this.getSetting("samplingRatio");n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ji(Uo,e,a4).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ji(Uo,e,l4).call(e,...i)}),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("afterFormulasValuesUpdate",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ji(Uo,e,c4).call(e,...i)}),this.addHook("beforeRender",()=>Ji(Uo,this,s4).call(this)),this.addHook("modifyRowHeight",(r,i)=>this.getRowHeight(i,r)),this.addHook("init",()=>Ji(Uo,this,u4).call(this)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin()}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,n,r)=>Ji(Uo,this,p1).call(this,e,n,r))}calculateVisibleRowsHeight(){if(!this.hot.countCols())return;const e=this.getFirstVisibleRow(),n=this.getLastVisibleRow();if(e===-1||n===-1)return;const r=this.hot.forceFullRender;this.calculateRowsHeight({from:e,to:n},void 0,r)}calculateRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countCols()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof n=="number"?{from:n,to:n}:n;if(this.hot.getColHeader(0)!==null){const s=this.samplesGenerator.generateRowSamples(-1,o);this.ghostTable.addColumnHeadersRow(s.get(-1))}fe(i.from,i.to,s=>{let a=this.hot.toPhysicalRow(s);a===null&&(a=s),(r||this.rowHeightsMap.getValueAtIndex(a)===null)&&this.samplesGenerator.generateRowSamples(s,o).forEach((u,c)=>this.ghostTable.addRow(c,u))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((s,a)=>{s<0?this.headerHeight=a:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(s),a)})},!0),this.measuredRows=i.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0;const i=this.hot.countRows()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){xf(o),this.inProgress=!1;return}this.calculateRowsHeight({from:r,to:Math.min(r+vh.CALCULATION_STEP,i)},e,n),r=r+vh.CALCULATION_STEP+1,r<i?o=Of(s):(xf(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateRowsHeight({from:0,to:a},e,n),r=a+1),r<i?s():(this.inProgress=!1,this.hot.view.adjustElementsSize())}recalculateAllRowsHeight(){this.hot.view.isVisible()&&this.calculateAllRowsHeight({from:0,to:this.hot.countCols()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[PR];let n=vh.SYNC_CALCULATION_LIMIT;const r=this.hot.countRows()-1;return He(e)&&(n=e.syncLimit,jO(n)?n=_x(r,n):n>>=0),Math.min(n,r)}getRowHeight(e,n){const r=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let i=n;return r!==null&&r>(n||0)&&(i=r),i}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){var e;return(e=this.hot.getFirstRenderedVisibleRow())!==null&&e!==void 0?e:-1}getLastVisibleRow(){var e;return(e=this.hot.getLastRenderedVisibleRow())!==null&&e!==void 0?e:-1}clearCache(e){this.headerHeight=null,Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(n=>{this.rowHeightsMap.setValueAtIndex(n,null)})},!0):this.rowHeightsMap.clear()}clearCacheByRange(e){const{from:n,to:r}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{fe(Math.min(n,r),Math.max(n,r),i=>{this.rowHeightsMap.setValueAtIndex(i,null)})},!0)}isNeedRecalculate(){return!!this.rowHeightsMap.getValues().slice(0,this.measuredRows).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function o4(t){const e={from:0,to:this.hot.countCols()-1};t.forEach(n=>{this.samplesGenerator.generateRowSamples(n,e).forEach((i,o)=>this.ghostTable.addRow(o,i))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((n,r)=>{const i=this.hot.toPhysicalRow(n);this.rowHeightsMap.setValueAtIndex(i,r)})},!0),this.ghostTable.clean())}function s4(){this.calculateVisibleRowsHeight(),this.inProgress||(Ji(Uo,this,o4).call(this,vg(wh,this)),m1(wh,this,[]))}function p1(t,e,n){let r=t;return n&&(this.calculateRowsHeight(e,void 0,!0),r=this.getRowHeight(e)),r}function a4(t,e){e||this.recalculateAllRowsHeight()}function l4(t){const e=t.reduce((n,r)=>{let[i]=r;return n.indexOf(i)===-1&&n.push(i),n},[]);vg(wh,this).push(...e)}function u4(){this.recalculateAllRowsHeight(),m1(OR,this,!0)}function c4(t){if(!vg(OR,this))return;const e=t.reduce((n,r)=>{var i;const o=(i=r.address)===null||i===void 0?void 0:i.row;if(Number.isInteger(o)){const s=this.hot.toVisualRow(o);n.indexOf(s)===-1&&n.push(s)}return n},[]);vg(wh,this).push(...e)}const{getListWithInsertedItems:h4,getListWithRemovedItems:d4}=e1("physicallyIndexed");class f4 extends Va{constructor(){super(e=>e)}insert(e,n){const r=bR(this.indexedValues,n);this.indexedValues=h4(r,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){const n=d4(this.indexedValues,e);this.indexedValues=yR(n,e),super.remove(e)}}const{getListWithInsertedItems:g4,getListWithRemovedItems:m4}=e1("physicallyIndexed");class p4 extends Va{constructor(){super(e=>e)}insert(e,n){this.indexedValues=g4(this.indexedValues,e,n,(r,i)=>this.getNextValue(i)),super.insert(e,n)}remove(e){this.indexedValues=m4(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}function w4(t,e){v4(t,e),e.add(t)}function v4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function C4(t,e,n){return(e=y4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y4(t){var e=b4(t,"string");return typeof e=="symbol"?e:e+""}function b4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function S4(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 w1="bindRowsWithHeaders",R4=210,E4="loose",v1=new Map([["loose",f4],["strict",p4]]);var C1=new WeakSet;class T4 extends Xe{constructor(){super(...arguments),w4(this,C1),C4(this,"headerIndexes",null)}static get PLUGIN_KEY(){return w1}static get PLUGIN_PRIORITY(){return R4}isEnabled(){return!!this.hot.getSettings()[w1]}enablePlugin(){var e;if(this.enabled)return;const n=(e=v1.get(this.getSetting()))!==null&&e!==void 0?e:v1.get(E4);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new n),this.addHook("modifyRowHeader",r=>S4(C1,this,_4).call(this,r)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function _4(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function M4(t,e){y1(t,e),e.add(t)}function I4(t,e,n){y1(t,e),e.set(t,n)}function y1(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function b1(t,e,n){return(e=P4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function P4(t){var e=O4(t,"string");return typeof e=="symbol"?e:e+""}function O4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function S1(t,e){return t.get(Cu(t,e))}function xR(t,e,n){return t.set(Cu(t,e),n),n}function Cu(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 Cg="collapsibleColumns",x4=290,A4=["nestedHeaders"],yu="collapsibleIndicator",R1=Cg,E1=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var bu=new WeakMap,Ch=new WeakSet;class H4 extends Xe{constructor(){super(...arguments),M4(this,Ch),b1(this,"nestedHeadersPlugin",null),b1(this,"headerStateManager",null),I4(this,bu,null)}static get PLUGIN_KEY(){return Cg}static get PLUGIN_PRIORITY(){return x4}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[Cg,...A4]}isEnabled(){return!!this.hot.getSettings()[Cg]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();n||et("You need to configure the Nested Headers plugin in order to use collapsible headers."),xR(bu,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>Cu(Ch,this,k4).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Cu(Ch,e,L4).call(e,...i)}),this.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Cu(Ch,e,N4).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(r,i,o)=>Cu(Ch,this,D4).call(this,r,i,o)),this.registerShortcuts(),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(this.hot.view){if(!this.nestedHeadersPlugin.detectedOverlappedHeaders){const{collapsibleColumns:e}=this.hot.getSettings();typeof e=="boolean"?this.headerStateManager.mapState(n=>({collapsible:n.origColspan>1})):Array.isArray(e)&&(this.headerStateManager.mapState(()=>({collapsible:!1})),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),xR(bu,this,null),this.nestedHeadersPlugin=null,this.unregisterShortcuts(),this.clearButtons(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{var e;const{row:n,col:r}=this.hot.getSelectedRangeLast().highlight,{collapsible:i,isCollapsed:o,columnIndex:s}=(e=this.headerStateManager.getHeaderTreeNodeData(n,r))!==null&&e!==void 0?e:{};if(i)return o?this.expandSection({row:n,col:s}):this.collapseSection({row:n,col:s}),!1},runOnlyIf:()=>{var e,n;return((e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.isSingle())&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight.isHeader())},group:R1,relativeToGroup:Ss,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(R1)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,n=this.hot.view._wt.wtTable.THEAD,r=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,i=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,o=function(s){s&&s.parentNode.removeChild(s)};fe(0,e-1,s=>{const a=n.childNodes[s],l=r.childNodes[s],u=i?i.childNodes[s]:null;fe(0,a.childNodes.length-1,c=>{let h=a.childNodes[c].querySelector(`.${yu}`);o(h),l&&l.childNodes[c]&&(h=l.childNodes[c].querySelector(`.${yu}`),o(h)),i&&u&&u.childNodes[c]&&(h=u.childNodes[c].querySelector(`.${yu}`),o(h))})})}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const n=this.headerStateManager.mapNodes(r=>{const{collapsible:i,origColspan:o,headerLevel:s,columnIndex:a,isCollapsed:l}=r;if(i===!0&&o>1&&(l&&e==="expand"||!l&&e==="collapse"))return{row:this.headerStateManager.levelToRowCoords(s),col:a}});this.toggleCollapsibleSection(n,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,n){if(!E1.has(n))throw new Error(`Unsupported action is passed (${n}).`);if(!Array.isArray(e))return;const r=ga(e,f=>{let{row:m}=f;return m<0});let i=r.length>0;H(r,f=>{var m;let{row:b,col:S}=f;const{collapsible:E,isCollapsed:v}=(m=this.headerStateManager.getHeaderSettings(b,S))!==null&&m!==void 0?m:{};if(!E||v&&n==="collapse"||!v&&n==="expand")return i=!1,!1});const o=[],s=[];i&&H(r,f=>{let{row:m,col:b}=f;const{colspanCompensation:S,affectedColumns:E,rollbackModification:v}=this.headerStateManager.triggerNodeModification(n,m,b);S>0&&(s.push(...E),o.push(v))});const a=this.getCollapsedColumns();let l=[];n==="collapse"?l=dU([...a,...s]):n==="expand"&&(l=ga(a,f=>!s.includes(f)));const u=E1.get(n);if(this.hot.runHooks(u.beforeHook,a,l,i)===!1){H(o,f=>{f()});return}this.hot.batchExecution(()=>{H(s,f=>{S1(bu,this).setValueAtIndex(this.hot.toPhysicalColumn(f),u.hideColumn)})},!0);const h=this.getCollapsedColumns().length!==a.length,d=this.hot.getSelectedRangeLast();if(n==="collapse"&&h&&d){const{row:f,col:m}=d.highlight;if((this.hot.rowIndexMapper.isHidden(f)||this.hot.columnIndexMapper.isHidden(m))&&s.includes(m)){const S=f>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(f,1,!0):f,E=m>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(m,1,!0):m;S!==null&&E!==null&&this.hot.selectCell(S,E)}}this.hot.runHooks(u.afterHook,a,l,i,h),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return S1(bu,this).getHiddenIndexes()}destroy(){xR(bu,this,null),super.destroy()}}function N4(t,e,n){var r;const{collapsible:i,origColspan:o,isCollapsed:s}=(r=this.headerStateManager.getHeaderSettings(n,t))!==null&&r!==void 0?r:{},a=i&&o>1&&t>=this.hot.getSettings().fixedColumnsStart,l=this.hot.getSettings().ariaTags;let u=e.querySelector(`.${yu}`);if(Yl(e,[Br("")[0]]),a)u||(u=this.hot.rootDocument.createElement("div"),X(u,yu),e.querySelector("div:first-child").appendChild(u)),ve(u,["collapsed","expanded"]),s?(X(u,"collapsed"),ya(u,"+"),l&&Se(e,...Br(!1))):(X(u,"expanded"),ya(u,"-"),l&&Se(e,...Br(!0))),l&&Se(u,...pa());else{var c;(c=u)===null||c===void 0||c.remove()}}function D4(t,e){ye(t.target,yu)&&(ye(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):ye(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),fi(t))}function k4(){this.updatePlugin()}function L4(t,e){e||this.updatePlugin()}function Ba(t,e,n){return(e=$4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $4(t){var e=F4(t,"string");return typeof e=="symbol"?e:e+""}function F4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const V4=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],W4=!1,B4=!0,j4=!0;class U4{constructor(e,n){Ba(this,"hot",void 0),Ba(this,"sortingStates",new hg),Ba(this,"sortEmptyCells",W4),Ba(this,"indicator",B4),Ba(this,"headerAction",j4),Ba(this,"compareFunctionFactory",void 0),Ba(this,"mapName",void 0),this.hot=e,this.mapName=n,this.hot.columnIndexMapper.registerMap(n,this.sortingStates)}updateAllColumnsProperties(e){He(e)&&Ne(e,(n,r)=>{V4.includes(r)&&(this[r]=n)})}getAllColumnsProperties(){const e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return typeof this.compareFunctionFactory=="function"&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){var n;return(n=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))===null||n===void 0?void 0:n.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(n=>{let[r]=n;return r===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return this.getNumberOfSortedColumns()===0}isColumnSorted(e){return He(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return this.sortingStates===null?[]:this.sortingStates.getEntries().map(n=>{let[r,i]=n;return{column:this.hot.toVisualColumn(r),...i}})}getColumnSortState(e){const n=this.getSortOrderOfColumn(e);if(ce(n))return{column:e,sortOrder:n}}setSortStates(e){this.sortingStates.clear();for(let n=0;n<e.length;n+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[n].column),{sortOrder:e[n].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}}function T1(t,e,n){const r=e.locale;return function(i,o){const{sortEmptyCells:s}=n;return typeof i=="string"&&(i=i.toLocaleLowerCase(r)),typeof o=="string"&&(o=o.toLocaleLowerCase(r)),i===o?eo:Bt(i)?Bt(o)?eo:s&&t==="asc"?Dt:kt:Bt(o)?s&&t==="asc"?kt:Dt:isNaN(i)&&!isNaN(o)?t==="asc"?kt:Dt:!isNaN(i)&&isNaN(o)||(isNaN(i)||isNaN(o)||(i=parseFloat(i),o=parseFloat(o)),i<o)?t==="asc"?Dt:kt:i>o?t==="asc"?kt:Dt:eo}}const _1="default";function z4(t,e,n){return function(r,i){const o=parseFloat(r),s=parseFloat(i),{sortEmptyCells:a}=n;if(o===s||isNaN(o)&&isNaN(s))return eo;if(a){if(Bt(r))return t==="asc"?Dt:kt;if(Bt(i))return t==="asc"?kt:Dt}return isNaN(o)?kt:isNaN(s)?Dt:o<s?t==="asc"?Dt:kt:o>s?t==="asc"?kt:Dt:eo}}const Y4="numeric";function G4(t,e,n){const r=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:o}=n;return function(s,a){const l=Bt(s),u=Bt(a),c=l?i:s,h=u?i:a,d=c===i||c===r,f=h===i||h===r;if(o===!1){if(l&&u===!1)return kt;if(l===!1&&u)return Dt}return d===!1&&f?t==="asc"?Dt:kt:d&&f===!1?t==="asc"?kt:Dt:d===!1&&f===!1?T1(t,e,n)(s,a):c===i&&h===r?t==="asc"?Dt:kt:c===r&&h===i?t==="asc"?kt:Dt:eo}}const q4="checkbox";function K4(t,e,n){return N1(t,e.dateFormat,n)}const X4="date";function Z4(t,e,n){return N1(t,e.timeFormat,n)}const Q4="time",{register:yh,getItem:M1,hasItem:J4}=mi("sorting.compareFunctionFactory"),{register:I1,getItem:e9}=mi("sorting.mainSortComparator");function P1(t){return J4(t)?M1(t):M1(_1)}yh(q4,G4),yh(X4,K4),yh(_1,T1),yh(Y4,z4),yh(Q4,Z4);const eo=0,Dt=-1,kt=1;function t9(t,e){const n=e9(e);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];t.sort(n(...i))}const yg="asc",bg="desc",O1="colHeader";function n9(t){if(He(t)===!1)return!1;const{column:e,sortOrder:n}=t;return Number.isInteger(e)&&[yg,bg].includes(n)}function r9(t){if(t.some(n=>n9(n)===!1))return!1;const e=t.map(n=>{let{column:r}=n;return r});return new Set(e).size===e.length}function x1(t){if(t!==bg)return t===yg?bg:yg}function A1(t){return t.querySelector(`.${O1}`)}function H1(t,e){if(t<0||!e.parentNode)return!1;const n=e.parentNode.parentNode.childNodes;return Array.from(n).indexOf(e.parentNode)-n.length===-1}function AR(t,e,n){return t===-1&&e>=0&&Sa(n)===!1}function N1(t,e,n){return function(r,i){const{sortEmptyCells:o}=n;if(r===i)return eo;if(Bt(r))return Bt(i)?eo:o&&t==="asc"?Dt:kt;if(Bt(i))return o&&t==="asc"?kt:Dt;const s=Z(r,e),a=Z(i,e);return s.isValid()?a.isValid()?a.isAfter(s)?t==="asc"?Dt:kt:a.isBefore(s)?t==="asc"?kt:Dt:eo:Dt:kt}}function i9(t,e){et(tt`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20
42
- Only \`${t}\` will work. The \`${e}\` plugin will remain disabled.`)}const o9="ascending",s9="descending",D1="indicatorDisabled",k1="columnSorting",L1="sortAction",$1=new Map([[yg,o9],[bg,s9]]);function a9(t,e,n,r){const i=[k1];if(r&&i.push(L1),n===!1)return i.push(D1),i;const o=t.getSortOrderOfColumn(e);return ce(o)&&i.push($1.get(o)),i}function l9(){return Array.from($1.values()).concat(L1,D1,k1)}function u9(t,e){return function(n,r){const[,...i]=n,[,...o]=r;return(function(a){const l=t[a],u=e[a],c=i[a],h=o[a],d=u.columnSorting;return(d.compareFunctionFactory?d.compareFunctionFactory:P1(u.type))(l,u,d)(c,h)})(0)}}function c9(t,e){h9(t,e),e.add(t)}function h9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Sg(t,e,n){return(e=d9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d9(t){var e=f9(t,"string");return typeof e=="symbol"?e:e+""}function f9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Su(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 Rg="columnSorting",g9=50,Eg="append",m9="replace",F1=Rg;I1(Rg,u9),re.getSingleton().register("beforeColumnSort"),re.getSingleton().register("afterColumnSort");const bh=new WeakMap;var ja=new WeakSet;class V1 extends Xe{constructor(){super(...arguments),c9(this,ja),Sg(this,"columnStatesManager",null),Sg(this,"columnMetaCache",null),Sg(this,"pluginKey",Rg),Sg(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return Rg}static get PLUGIN_PRIORITY(){return g9}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;if(bh.has(this.hot)&&bh.get(this.hot)!==this.pluginKey){this.hot.updateSettings({[this.pluginKey]:!1}),i9(bh.get(this.hot),this.pluginKey);return}this.enabled||(bh.set(this.hot,this.pluginKey),this.columnStatesManager=new U4(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new Ms(n=>{let r=this.hot.toVisualColumn(n);return r===null&&(r=n),this.getMergedPluginSettings(r)}),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",(n,r)=>Su(ja,this,p9).call(this,n,r)),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Su(ja,e,v9).call(e,...r)}),this.addHook("afterOnCellMouseDown",(n,r)=>this.onAfterOnCellMouseDown(n,r)),this.addHook("afterInit",()=>Su(ja,this,HR).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Su(ja,e,w9).call(e,...r)}),this.hot.view&&Su(ja,this,HR).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(n,r)=>{const i=A1(r);H1(n,r)===!1||i===null||this.updateHeaderClasses(i)};bh.delete(this.hot),this.hot.addHook("afterGetColHeader",e),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("afterGetColHeader",e)}),this.hot.batchExecution(()=>{this.indexesSequenceCache!==null&&(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginKey),this.indexesSequenceCache=null)},!0),this.hot.columnIndexMapper.unregisterMap(`${this.pluginKey}.columnMeta`),this.columnStatesManager.destroy(),this.columnMetaCache=null,this.columnStatesManager=null,this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return this.sort(this.getColumnNextConfig(e.col)),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.row===-1&&r.col>=0},relativeToGroup:Ss,position:"before",group:F1})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(F1)}sort(e){const n=this.getSortConfig(),r=this.getNormalizedSortConfigs(e),i=this.areValidSortConfigs(r);this.hot.runHooks("beforeColumnSort",n,r,i)!==!1&&(n.length===0&&this.indexesSequenceCache===null&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new t1),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),i&&(this.columnStatesManager.setSortStates(r),this.sortByPresetSortStates(r),this.saveAllSortSettings(r)),this.hot.runHooks("afterColumnSort",n,i?r:n,i),i&&this.hot.render())}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return ce(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const n=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(n)&&this.columnStatesManager.setSortStates(n)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const n=this.hot.countCols();return r9(e)&&e.every(r=>{let{column:i}=r;return i<=n&&i>=0})}saveAllSortSettings(e){const n=this.columnStatesManager.getAllColumnsProperties(),r=i=>{let{column:o,...s}=i;return{column:this.hot.toPhysicalColumn(o),...s}};n.initialConfig=je(e,r),this.hot.runHooks("persistentStateSave","columnSorting",n)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const n=e.value,r=i=>{let{column:o,...s}=i;return{column:this.hot.toVisualColumn(o),...s}};return ce(n)&&Array.isArray(n.initialConfig)&&(n.initialConfig=je(n.initialConfig,r)),n}getColumnNextConfig(e){const n=this.columnStatesManager.getSortOrderOfColumn(e);if(ce(n)){const i=x1(n);return ce(i)?{column:e,sortOrder:i}:void 0}const r=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<r)return{column:e,sortOrder:x1()}}getNextSortConfig(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Eg;const r=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=r!==-1,o=this.getSortConfig(),s=this.getColumnNextConfig(e);if(i){if(At(s))return[...o.slice(0,r),...o.slice(r+1)];if(n===Eg)return[...o.slice(0,r),...o.slice(r+1),s];if(n===m9)return[...o.slice(0,r),s,...o.slice(r+1)]}return ce(s)?o.concat(s):o}getPluginColumnConfig(e){if(He(e)){const n=e[this.pluginKey];if(He(n))return n}return{}}getMergedPluginSettings(e){const n=this.hot.getSettings()[this.pluginKey],r=this.columnStatesManager.getAllColumnsProperties(),i=this.hot.getCellMeta(0,e),o=Object.getPrototypeOf(i);return Array.isArray(o.columns)?Object.assign(r,n,this.getPluginColumnConfig(o.columns[e])):rt(o.columns)?Object.assign(r,n,this.getPluginColumnConfig(o.columns(e))):Object.assign(r,n)}getFirstCellSettings(e){const n=this.hot.getCellMeta(0,e),r=Object.create(n);return r[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),r}getNumberOfRowsToSort(e){const n=this.hot.getSettings();return n.maxRows<=e?n.maxRows:e-n.minSpareRows}sortByPresetSortStates(e){if(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),e.length===0)return;const n=[],r=this.hot.countRows(),i=u=>je(e,c=>this.hot.getDataAtCell(u,c.column));for(let u=0;u<this.getNumberOfRowsToSort(r);u+=1)n.push([this.hot.toPhysicalRow(u)].concat(i(u)));const o=je(n,u=>u[0]);t9(n,this.pluginKey,je(e,u=>u.sortOrder),je(e,u=>this.getFirstCellSettings(u.column)));for(let u=n.length;u<r;u+=1)n.push([u].concat(i(u)));const s=je(n,u=>u[0]),a=new Map(je(o,(u,c)=>[u,s[c]])),l=je(this.hot.rowIndexMapper.getIndexesSequence(),u=>a.has(u)?a.get(u):u);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if(He(e)){this.columnStatesManager.updateAllColumnsProperties(e);const n=e.initialConfig;(Array.isArray(n)||He(n))&&this.sort(n)}else this.hot.render()}updateHeaderClasses(e){if(ve(e,l9()),this.enabled!==!1){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];X(e,a9(...r))}}onUpdateSettings(e){super.onUpdateSettings(e),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),ce(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,n){return this.getFirstCellSettings(n)[this.pluginKey].headerAction&&ye(e.target,O1)}onAfterOnCellMouseDown(e,n){if(AR(n.row,n.col,e)!==!1&&this.wasClickableHeaderClicked(e,n.col)){this.hot.getShortcutManager().isCtrlPressed()&&(this.hot.deselectCell(),this.hot.selectColumns(n.col));const r=this.hot.getActiveEditor(),i=this.getColumnNextConfig(n.col);r!=null&&r.isOpened()&&this.hot.getCellValidator(r.row,r.col)?this.hot.addHookOnce("postAfterValidate",()=>{this.sort(i)}):this.sort(i)}}destroy(){var e;(e=this.columnStatesManager)===null||e===void 0||e.destroy(),super.destroy()}}function HR(){const t=this.getAllSavedSortSettings();if(He(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function p9(t,e){const n=A1(e);if(H1(t,e)===!1||n===null)return;const r=this.getFirstCellSettings(t)[this.pluginKey],i=r.indicator,o=r.headerAction;if(this.updateHeaderClasses(n,this.columnStatesManager,t,i,o),this.hot.getSettings().ariaTags){const s=this.columnStatesManager.getSortOrderOfColumn(t);Se(e,...hz(s?`${s}ending`:"none"))}}function w9(t){t===!0&&this.hot.view&&Su(ja,this,HR).call(this)}function v9(t,e,n,r){AR(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(r.column=!0)}function Ua(t,e,n){return(e=C9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C9(t){var e=y9(t,"string");return typeof e=="symbol"?e:e+""}function y9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class b9{constructor(e,n){Ua(this,"plugin",void 0),Ua(this,"hot",void 0),Ua(this,"endpoints",[]),Ua(this,"settings",void 0),Ua(this,"settingsType","array"),Ua(this,"currentEndpoint",null),Ua(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=n}initEndpoints(){this.endpoints=this.parseSettings(),this.refreshAllEndpoints()}getEndpoint(e){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings)[e]:this.endpoints[e]}getAllEndpoints(){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings):this.endpoints}fillMissingEndpointData(e){return this.parseSettings(e.call(this))}parseSettings(e){const n=[];let r=e;if(!r&&typeof this.settings=="function"){this.settingsType="function";return}return r||(r=this.settings),H(r,i=>{const o={};this.assignSetting(i,o,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(i,o,"reversedRowCoords",!1),this.assignSetting(i,o,"destinationRow",new Error(`
43
- You must provide a destination row for the Column Summary plugin in order to work properly!
44
- `)),this.assignSetting(i,o,"destinationColumn",new Error(`
45
- You must provide a destination column for the Column Summary plugin in order to work properly!
46
- `)),this.assignSetting(i,o,"sourceColumn",i.destinationColumn),this.assignSetting(i,o,"type","sum"),this.assignSetting(i,o,"forceNumeric",!1),this.assignSetting(i,o,"suppressDataTypeErrors",!0),this.assignSetting(i,o,"customFunction",null),this.assignSetting(i,o,"readOnly",!0),this.assignSetting(i,o,"roundFloat",!1),n.push(o)}),n}assignSetting(e,n,r,i){if(r==="ranges"&&e[r]===void 0){n[r]=i;return}else if(r==="ranges"&&e[r].length===0)return;if(e[r]===void 0){if(i instanceof Error)throw i;n[r]=i}else r==="destinationRow"&&n.reversedRowCoords?n[r]=this.hot.countRows()-e[r]-1:n[r]=e[r]}resetSetupBeforeStructureAlteration(e,n,r){if(this.settingsType!=="function")return;const i=e.indexOf("row")>-1?"row":"col",o=this.getAllEndpoints();H(o,s=>{i==="row"&&s.destinationRow>=n&&(e==="insert_row"?s.alterRowOffset=r:e==="remove_row"&&(s.alterRowOffset=-1*r)),i==="col"&&s.destinationColumn>=n&&(e==="insert_col"?s.alterColumnOffset=r:e==="remove_col"&&(s.alterColumnOffset=-1*r))}),this.resetAllEndpoints(o,!1)}resetSetupAfterStructureAlteration(e,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(this.settingsType==="function"){const d=()=>(this.hot.removeHook("beforeViewRender",d),this.refreshAllEndpoints());this.hot.addHookOnce("beforeViewRender",d);return}const a=e.indexOf("row")>-1?"row":"col",l=e.indexOf("remove")>-1?-1:1,u=this.getAllEndpoints(),c=e.indexOf("move_row")===0,h=n;H(u,d=>{a==="row"&&d.destinationRow>=h&&(d.alterRowOffset=l*r),a==="col"&&d.destinationColumn>=h&&(d.alterColumnOffset=l*r)}),this.resetAllEndpoints(u,!c),c?H(u,d=>{this.extendEndpointRanges(d,h,i[0],i.length),this.recreatePhysicalRanges(d),this.clearOffsetInformation(d)}):H(u,d=>{this.shiftEndpointCoordinates(d,h)}),s&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,n,r,i){H(e.ranges,o=>{o[1]&&(n>=o[0]&&n<=o[1]?r>o[1]?o[1]+=i:r<o[0]&&(o[0]-=i):r>=o[0]&&r<=o[1]&&(o[1]-=i,n<=o[0]&&(o[0]+=1,o[1]+=1)))})}recreatePhysicalRanges(e){const n=e.ranges,r=[],i=[];H(n,o=>{const s=[];if(o[1])for(let a=o[0];a<=o[1];a++)s.push(this.hot.toPhysicalRow(a));else s.push(this.hot.toPhysicalRow(o[0]));i.push(s)}),H(i,o=>{let s=[];H(o,(a,l)=>{l===0?s.push(a):o[l]!==o[l-1]+1&&(s.push(o[l-1]),r.push(s),s=[],s.push(a)),l===o.length-1&&(s.push(a),r.push(s))})}),e.ranges=r}shiftEndpointCoordinates(e,n){e.alterRowOffset&&e.alterRowOffset!==0?(e.destinationRow+=e.alterRowOffset||0,H(e.ranges,r=>{H(r,(i,o)=>{i>=n&&(r[o]+=e.alterRowOffset||0)})})):e.alterColumnOffset&&e.alterColumnOffset!==0&&(e.destinationColumn+=e.alterColumnOffset||0,e.sourceColumn+=e.alterColumnOffset||0)}resetAllEndpoints(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getAllEndpoints(),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.some(i=>{const o=i.alterRowOffset||0,s=i.alterColumnOffset||0;return i.destinationRow+o>=this.hot.countRows()||i.destinationColumn+s>=this.hot.countCols()})||(this.cellsToSetCache=[],H(e,i=>{this.resetEndpointValue(i,n)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],H(this.getAllEndpoints(),e=>{this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e,"init")}),this.currentEndpoint=null,this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshChangedEndpoints(e){const n=[];this.cellsToSetCache=[],H(e,(r,i,o)=>{`${r[2]||""}`!=`${r[3]}`&&H(this.getAllEndpoints(),(s,a)=>{this.hot.propToCol(o[i][1])===s.sourceColumn&&n.indexOf(a)===-1&&n.push(a)})}),H(n,r=>{this.refreshEndpoint(this.getEndpoint(r))}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshCellMetas(){this.endpoints.forEach(e=>{const n=this.hot.toVisualRow(e.destinationRow);if(n!==null){const r=this.hot.getCellMeta(n,e.destinationColumn);r.readOnly=e.readOnly,r.className="columnSummaryResult"}})}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=e.alterRowOffset||0,i=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(n?r:0)),this.hot.toVisualColumn(e.destinationColumn+(n?i:0)),""])}setEndpointValue(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols()){this.throwOutOfBoundsWarning();return}const o=this.hot.toVisualRow(e.destinationRow);if(o!==null){const s=this.hot.getCellMeta(o,e.destinationColumn);(n==="init"||s.readOnly!==e.readOnly)&&(s.readOnly=e.readOnly,s.className="columnSummaryResult")}if((e.roundFloat===!0||Number.isInteger(e.roundFloat))&&!isNaN(e.result)){const s=e.roundFloat;let a=0;Number.isInteger(s)&&(a=Math.min(Math.max(0,s),100)),e.result=e.result.toFixed(a)}r?this.hot.setDataAtCell(i,e.destinationColumn,e.result,"ColumnSummary.set"):this.cellsToSetCache.push([i,e.destinationColumn,e.result]),e.alterRowOffset=void 0,e.alterColumnOffset=void 0}throwOutOfBoundsWarning(){et("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function NR(t){return t==null||isNaN(t)}function S9(t,e){R9(t,e),e.add(t)}function R9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function E9(t,e,n){return(e=T9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T9(t){var e=_9(t,"string");return typeof e=="symbol"?e:e+""}function _9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Tg(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 DR="columnSummary",M9=220;var Sh=new WeakSet;class I9 extends Xe{constructor(){super(...arguments),S9(this,Sh),E9(this,"endpoints",null)}static get PLUGIN_KEY(){return DR}static get PLUGIN_PRIORITY(){return M9}isEnabled(){return!!this.hot.getSettings()[DR]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[DR],this.endpoints=new b9(this,this.settings),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Tg(Sh,e,P9).call(e,...r)}),this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Tg(Sh,e,x9).call(e,...r)}),this.addHook("afterUpdateSettings",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Tg(Sh,e,O9).call(e,...r)}),this.addHook("beforeCreateRow",(n,r,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_row",n,r,null,i)),this.addHook("beforeCreateCol",(n,r,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",n,r,null,i)),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_row",...r)}),this.addHook("beforeRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_col",...r)}),this.addHook("afterCreateRow",(n,r,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_row",n,r,null,i)),this.addHook("afterCreateCol",(n,r,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",n,r,null,i)),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_row",...r)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_col",...r)}),this.addHook("afterRowMove",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Tg(Sh,e,A9).call(e,...r)}),super.enablePlugin())}disablePlugin(){this.endpoints=null,this.settings=null,this.currentEndpoint=null,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.endpoints.initEndpoints(),super.updatePlugin()}calculate(e){switch(e.type.toLowerCase()){case"sum":e.result=this.calculateSum(e);break;case"min":e.result=this.calculateMinMax(e,e.type);break;case"max":e.result=this.calculateMinMax(e,e.type);break;case"count":e.result=this.countEntries(e);break;case"average":e.result=this.calculateAverage(e);break;case"custom":e.result=e.customFunction.call(this,e);break}}calculateSum(e){let n=0;return Ne(e.ranges,r=>{n+=this.getPartialSum(r,e.sourceColumn)}),n}getPartialSum(e,n){let r=0,i=e[1]||e[0],o=null,s=0;do{if(o=this.getCellValue(i,n),o=NR(o)?null:o,o!==null){const a=(`${o}`.split(".")[1]||[]).length||1;a>s&&(s=a)}r+=o||0,i-=1}while(i>=e[0]);return Math.round(r*10**s)/10**s}calculateMinMax(e,n){let r=null;return Ne(e.ranges,i=>{const o=this.getPartialMinMax(i,e.sourceColumn,n);if(r===null&&o!==null&&(r=o),o!==null)switch(n){case"min":r=Math.min(r,o);break;case"max":r=Math.max(r,o);break}}),r===null?"Not enough data":r}getPartialMinMax(e,n,r){let i=null,o=e[1]||e[0],s;do{if(s=this.getCellValue(o,n),s=NR(s)?null:s,i===null)i=s;else if(s!==null)switch(r){case"min":i=Math.min(i,s);break;case"max":i=Math.max(i,s);break}o-=1}while(o>=e[0]);return i}countEmpty(e,n){let r,i=0,o=e[1]||e[0];do r=this.getCellValue(o,n),r=NR(r)?null:r,r===null&&(i+=1),o-=1;while(o>=e[0]);return i}countEntries(e){let n=0;const r=e.ranges;return Ne(r,i=>{const o=i[1]===void 0?1:i[1]-i[0]+1,s=this.countEmpty(i,e.sourceColumn);n+=o,n-=s}),n}calculateAverage(e){const n=this.calculateSum(e),r=this.countEntries(e);return n/r}getCellValue(e,n){const r=this.hot.toVisualRow(e),i=this.hot.toVisualColumn(n);let o=this.hot.getSourceDataAtCell(e,n),s="";if(r!==null&&i!==null&&(s=this.hot.getCellMeta(r,i).className||""),s.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&(typeof o=="string"&&(o=o.replace(/,/,".")),o=parseFloat(o)),isNaN(o)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw new Error(tt`ColumnSummary plugin: cell at (${e}, ${n}) is not in a\x20
47
- numeric format. Cannot do the calculation.`);return o}}function P9(){this.endpoints.initEndpoints()}function O9(t){t.columns!==void 0&&this.endpoints.refreshCellMetas()}function x9(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function A9(t,e){this.endpoints.resetSetupBeforeStructureAlteration("move_row",t[0],t.length,t,this.pluginName),this.endpoints.resetSetupAfterStructureAlteration("move_row",e,t.length,t,this.pluginName)}function H9(t,e){W1(t,e),e.add(t)}function kR(t,e,n){W1(t,e),e.set(t,n)}function W1(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ru(t,e){return t.get($R(t,e))}function LR(t,e,n){return t.set($R(t,e),n),n}function $R(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 _g=new WeakMap,Mg=new WeakMap,Ig=new WeakMap,B1=new WeakSet;class j1{constructor(){H9(this,B1),kR(this,_g,!0),kR(this,Mg,null),kR(this,Ig,new ResizeObserver(e=>$R(B1,this,N9).call(this,e)))}setObservedElement(e){LR(Mg,this,e)}unobserve(){Ru(Ig,this).unobserve(Ru(Mg,this))}observe(){LR(_g,this,!0),Ru(Ig,this).observe(Ru(Mg,this))}destroy(){Ru(Ig,this).disconnect()}}function N9(t){if(Ru(_g,this)||!Array.isArray(t)||!t.length){LR(_g,this,!1);return}t.forEach(e=>{let{borderBoxSize:n}=e;const{inlineSize:r,blockSize:i}=n[0];this.runLocalHooks("resize",r,i)})}ct(j1,Mn);function za(t,e,n){D9(t,e),e.set(t,n)}function D9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ht(t,e){return t.get(U1(t,e))}function zo(t,e,n){return t.set(U1(t,e),n),n}function U1(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 Ya=new WeakMap,FR=new WeakMap,Yo=new WeakMap,Ps=new WeakMap,Os=new WeakMap,Pg=new WeakMap,Eu=new WeakMap;class Ga{static get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"}static get CLASS_EDITOR(){return"htComments"}static get CLASS_INPUT(){return"htCommentTextArea"}static get CLASS_CELL(){return"htCommentCell"}constructor(e,n){var r=this;za(this,Ya,void 0),za(this,FR,!1),za(this,Yo,null),za(this,Ps,void 0),za(this,Os,void 0),za(this,Pg,!0),za(this,Eu,new j1),zo(Ya,this,e),zo(FR,this,n),zo(Ps,this,this.createEditor()),zo(Os,this,ht(Ps,this).style),ht(Eu,this).setObservedElement(this.getInputElement()),ht(Eu,this).addLocalHook("resize",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("resize",...o)}),this.hide()}setPosition(e,n){ht(Os,this).left=`${e}px`,ht(Os,this).top=`${n}px`}setSize(e,n){if(e&&n){const r=this.getInputElement();r.style.width=`${e}px`,r.style.height=`${n}px`}}getSize(){return{width:Qt(this.getInputElement()),height:an(this.getInputElement())}}observeSize(){ht(Eu,this).observe()}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const n=this.getInputElement();n.readOnly=e}show(){ht(Os,this).display="block",zo(Pg,this,!1)}hide(){ht(Eu,this).unobserve(),ht(Pg,this)||(ht(Os,this).display="none"),zo(Pg,this,!0)}isVisible(){return ht(Os,this).display==="block"}setValue(){const n=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"")||"";this.getInputElement().value=n}getValue(){return this.getInputElement().value}isFocused(){return ht(Ya,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=ht(Ya,this).createElement("div"),n=ht(Ya,this).createElement("textarea");return e.style.display="none",zo(Yo,this,ht(Ya,this).createElement("div")),ht(Yo,this).setAttribute("dir",ht(FR,this)?"rtl":"ltr"),X(ht(Yo,this),Ga.CLASS_EDITOR_CONTAINER),ht(Ya,this).body.appendChild(ht(Yo,this)),X(e,Ga.CLASS_EDITOR),X(n,Ga.CLASS_INPUT),n.setAttribute("data-hot-input",!0),e.appendChild(n),ht(Yo,this).appendChild(e),e}getInputElement(){return ht(Ps,this).querySelector(`.${Ga.CLASS_INPUT}`)}getEditorElement(){return ht(Ps,this)}destroy(){const e=ht(Yo,this)?ht(Yo,this).parentNode:null;ht(Ps,this).parentNode.removeChild(ht(Ps,this)),zo(Ps,this,null),zo(Os,this,null),ht(Eu,this).destroy(),e&&e.removeChild(ht(Yo,this))}}ct(Ga,Mn);function VR(t,e,n){return(e=k9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k9(t){var e=L9(t,"string");return typeof e=="symbol"?e:e+""}function L9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const $9=250,F9=250;class z1{constructor(e){VR(this,"wasLastActionShow",!0),VR(this,"showDebounced",null),VR(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},F9)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$9;this.showDebounced=Df(n=>{this.wasLastActionShow&&this.runLocalHooks("show",n.from.row,n.from.col)},e)}destroy(){this.clearLocalHooks()}}ct(z1,Mn);function V9(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function W9(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function qa(t,e){const n={};return H(t,r=>{r.forAll((i,o)=>{i>=0&&o>=0&&(n[i]||(n[i]=[]),n[i][o]=e(i,o))})}),n}function xs(t,e,n,r,i){H(t,o=>{o.forAll((s,a)=>{s>=0&&a>=0&&B9(s,a,e,n,r,i)})})}function B9(t,e,n,r,i,o){const s=i(t,e);let a=r;s.className&&(n==="vertical"?a=V9(s.className,r):a=W9(s.className,r)),o(t,e,"className",a)}function Y1(t){return`<span class="selected">✓</span>${t}`}function Og(t,e){let n=!1;return Array.isArray(t)&&H(t,r=>(r.forAll((i,o)=>{if(i>=0&&o>=0&&e(i,o))return n=!0,!1}),n)),n}function xg(t,e){const n={top:0,left:0};if(e!==t.ownerDocument){const{frameElement:r}=e.defaultView,{top:i,left:o}=r.getBoundingClientRect();n.top=i,n.left=o}return n}const ke="---------";function j9(){return{name:ke}}const Zr="alignment";function U9(){return{key:Zr,name(){return this.getTranslatedPhrase(bb)},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()?!0:!(this.getSelectedRange()&&!this.selection.isSelectedByCorner())},submenu:{items:[{key:`${Zr}:left`,name(){return this.getTranslatedPhrase(Sb)},callback(){const t=this.getSelectedRange(),e=qa(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",e,t,n,r),xs(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Zr}:center`,name(){return this.getTranslatedPhrase(Rb)},callback(){const t=this.getSelectedRange(),e=qa(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",e,t,n,r),xs(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Zr}:right`,name(){return this.getTranslatedPhrase(Eb)},callback(){const t=this.getSelectedRange(),e=qa(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htRight";this.runHooks("beforeCellAlignment",e,t,n,r),xs(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Zr}:justify`,name(){return this.getTranslatedPhrase(Tb)},callback(){const t=this.getSelectedRange(),e=qa(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",e,t,n,r),xs(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{name:ke},{key:`${Zr}:top`,name(){return this.getTranslatedPhrase(_b)},callback(){const t=this.getSelectedRange(),e=qa(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htTop";this.runHooks("beforeCellAlignment",e,t,n,r),xs(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Zr}:middle`,name(){return this.getTranslatedPhrase(Mb)},callback(){const t=this.getSelectedRange(),e=qa(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",e,t,n,r),xs(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Zr}:bottom`,name(){return this.getTranslatedPhrase(Ib)},callback(){const t=this.getSelectedRange(),e=qa(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htBottom";this.runHooks("beforeCellAlignment",e,t,n,r),xs(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1}]}}}const Ag="clear_column";function z9(){return{key:Ag,name(){return this.getTranslatedPhrase(ab)},callback(t,e){const n=e[0].start.col,r=e[0].end.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(e[0].start.row,e[0].end.row),r,"ContextMenu.clearColumn")},disabled(){const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.col<0||!this.selection.isSelectedByColumnHeader())return!0;let e=!1;return t.forAll((n,r)=>{if(n<0||r<0)return!0;const{readOnly:i}=this.getCellMeta(n,r);return i?!0:(e=!0,!1)}),!e}}}const Rh="col_left";function Y9(){return{key:Rh,name(){return this.getTranslatedPhrase(tb)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner(),e=this.isRtl()?"insert_col_end":"insert_col_start";this.alter(e,t.col,1,"ContextMenu.columnLeft")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();return!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols?!0:this.selection.isSelectedByCorner()?this.countCols()===0:!1},hidden(){return!this.getSettings().allowInsertColumn}}}const Eh="col_right";function G9(){return{key:Eh,name(){return this.getTranslatedPhrase(nb)},callback(){const t=this.getSelectedRangeLast().getTopRightCorner(),e=this.isRtl()?"insert_col_start":"insert_col_end";this.alter(e,t.col,1,"ContextMenu.columnRight")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();return!!(!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols)},hidden(){return!this.getSettings().allowInsertColumn}}}const Th="make_read_only";function q9(){return{key:Th,checkable:!0,ariaChecked(){return Og(this.getSelectedRange(),(e,n)=>this.getCellMeta(e,n).readOnly)},ariaLabel(){return this.getTranslatedPhrase(jf)},name(){let t=this.getTranslatedPhrase(jf);return Og(this.getSelectedRange(),(n,r)=>this.getCellMeta(n,r).readOnly)&&(t=Y1(t)),t},callback(){const t=this.getSelectedRange(),e=Og(t,(n,r)=>this.getCellMeta(n,r).readOnly);H(t,n=>{n.forAll((r,i)=>{r>=0&&i>=0&&this.setCellMeta(r,i,"readOnly",!e)})}),this.render()},disabled(){const t=this.getSelectedRangeLast();return!!(!t||t.isSingleHeader()||this.selection.isSelectedByCorner()||this.countRows()===0||this.countCols()===0||!this.getSelectedRange()||this.getSelectedRange().length===0)}}}const Hg="redo";function K9(){return{key:Hg,name(){return this.getTranslatedPhrase(sb)},callback(){this.getPlugin("undoRedo").redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const Ng=0,Dg=1,G1=2,WR=3,X9=[WR,G1],Z9=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],BR=Symbol("root"),q1=Symbol("child");function Tu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:BR;if(e!==BR&&e!==q1)throw new Error("The second argument is used internally only and cannot be overwritten.");const n=Array.isArray(t),r=e===BR;let i=Ng;if(n){const o=t[0];t.length===0?i=Dg:r&&o instanceof Jc?i=WR:r&&Array.isArray(o)?i=Tu(o,q1):t.length>=2&&t.length<=4&&!t.some((a,l)=>!Z9[l].includes(typeof a))&&(i=G1)}return i}function _h(t){let{createCellCoords:e,createCellRange:n,keepDirection:r=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!X9.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(o){const s=t===WR;let a=s?o.from.row:o[0],l=s?o.from.col:o[1],u=s?o.to.row:o[2],c=s?o.to.col:o[3];if(typeof i=="function"&&(typeof l=="string"&&(l=i(l)),typeof c=="string"&&(c=i(c))),At(u)&&(u=a),At(c)&&(c=l),!r){const f=a,m=l,b=u,S=c;a=Math.min(f,b),l=Math.min(m,S),u=Math.max(f,b),c=Math.max(m,S)}const h=e(a,l),d=e(u,c);return n(h,h,d)}}function Q9(t){const e=Tu(t.getSelected());if(e===Ng||e===Dg)return[];const n=_h(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;H(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.col,0),c=l.col-u+1;H(Array.from(new Array(c),(h,d)=>u+d),h=>{r.has(h)||r.add(h)})});const i=Array.from(r).sort((s,a)=>s-a);return tr(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function J9(t){const e=Tu(t.getSelected());if(e===Ng||e===Dg)return[];const n=_h(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;H(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.row,0),c=l.row-u+1;H(Array.from(new Array(c),(h,d)=>u+d),h=>{r.has(h)||r.add(h)})});const i=Array.from(r).sort((s,a)=>s-a);return tr(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}const Mh="remove_col";function e8(){return{key:Mh,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[,n,,r]=t[0];n-r!==0&&(e=1)}return this.getTranslatedPhrase(ib,e)},callback(){this.alter("remove_col",Q9(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.col<0)return!0;const e=this.countCols();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByRowHeader()||e===0},hidden(){return!this.getSettings().allowRemoveColumn}}}const kg="remove_row";function t8(){return{key:kg,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[n,,r]=t[0];n-r!==0&&(e=1)}return this.getTranslatedPhrase(rb,e)},callback(){this.alter("remove_row",J9(this),1,"ContextMenu.removeRow")},disabled(){const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.row<0)return!0;const e=this.countRows();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByColumnHeader()||e===0},hidden(){return!this.getSettings().allowRemoveRow}}}const Lg="row_above";function n8(){return{key:Lg,name(){return this.getTranslatedPhrase(Jy)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner();this.alter("insert_row_above",t.row,1,"ContextMenu.rowAbove")},disabled(){const t=this.getSelectedRangeLast();return!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows?!0:this.selection.isSelectedByCorner()?this.countRows()===0:!1},hidden(){return!this.getSettings().allowInsertRow}}}const $g="row_below";function r8(){return{key:$g,name(){return this.getTranslatedPhrase(eb)},callback(){const t=this.getSelectedRangeLast().getBottomRightCorner();this.alter("insert_row_below",t.row,1,"ContextMenu.rowBelow")},disabled(){const t=this.getSelectedRangeLast();return!!(!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows)},hidden(){return!this.getSettings().allowInsertRow}}}const Ih="no_items";function i8(){return{key:Ih,name(){return this.getTranslatedPhrase(Qy)},disabled:!0,isCommand:!1}}const Fg="undo";function o8(){return{key:Fg,name(){return this.getTranslatedPhrase(ob)},callback(){this.getPlugin("undoRedo").undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const s8=[Lg,$g,Rh,Eh,Ag,kg,Mh,Fg,Hg,Th,Zr,ke,Ih],a8={[ke]:j9,[Ih]:i8,[Lg]:n8,[$g]:r8,[Rh]:Y9,[Eh]:G9,[Ag]:z9,[kg]:t8,[Mh]:e8,[Fg]:o8,[Hg]:K9,[Th]:q9,[Zr]:U9};function K1(){const t={};return Ne(a8,(e,n)=>{t[n]=e()}),t}function l8(t){return{key:"commentsAddEdit",name(){var e;const n=(e=this.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n!=null&&n.isCell()&&t.getCommentAtCell(n.row,n.col)?this.getTranslatedPhrase(vb):this.getTranslatedPhrase(wb)},callback(){const e=this.getSelectedRangeLast();t.setRange(e),t.show(),t.focusEditor()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function u8(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(Cb)},callback(){this.getSelectedRangeLast().forAll((n,r)=>{n>=0&&r>=0&&t.removeCommentAtCell(n,r,!1)}),this.render()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function c8(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(yb);return Og(this.getSelectedRange(),(r,i)=>t.getCommentMeta(r,i,Wg))?Y1(e):e},callback(){this.getSelectedRangeLast().forAll((n,r)=>{if(n>=0&&r>=0){const i=!!t.getCommentMeta(n,r,Wg);t.updateCommentMeta(n,r,{[Wg]:!i})}})},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||!t.getCommentAtCell(e.highlight.row,e.highlight.col)||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function h8(t,e){X1(t,e),e.add(t)}function _u(t,e,n){X1(t,e),e.set(t,n)}function X1(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function d8(t,e,n){return(e=f8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f8(t){var e=g8(t,"string");return typeof e=="symbol"?e:e+""}function g8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function As(t,e,n){return t.set(sr(t,e),n),n}function Ae(t,e){return t.get(sr(t,e))}function sr(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 Vg="comments",m8=60,Go="comment",Ph="value",Z1="style",Wg="readOnly",Oh=Vg,jR=`plugin:${Vg}`;var it=new WeakMap,to=new WeakMap,Bg=new WeakMap,jg=new WeakMap,UR=new WeakMap,Ug=new WeakMap,Mr=new WeakSet;class p8 extends Xe{constructor(){super(...arguments),h8(this,Mr),d8(this,"range",{}),_u(this,it,null),_u(this,to,null),_u(this,Bg,!1),_u(this,jg,!1),_u(this,UR,null),_u(this,Ug,"")}static get PLUGIN_KEY(){return Vg}static get PLUGIN_PRIORITY(){return m8}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[Vg]}enablePlugin(){var e=this;this.enabled||(Ae(it,this)||(As(it,this,new Ga(this.hot.rootDocument,this.hot.isRtl())),Ae(it,this).addLocalHook("resize",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sr(Mr,e,E8).call(e,...r)})),Ae(to,this)||As(to,this,new z1(this.getSetting("displayDelay"))),this.addHook("afterContextMenuDefaultOptions",n=>this.addToContextMenu(n)),this.addHook("afterRenderer",(n,r,i,o,s,a)=>sr(Mr,this,b8).call(this,n,a)),this.addHook("afterScroll",()=>sr(Mr,this,T8).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",n=>sr(Mr,this,Q1).call(this,n)),this.addHook("beforeCompositionStart",n=>sr(Mr,this,Q1).call(this,n)),this.addHook("afterSetTheme",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sr(Mr,e,_8).call(e,...r)}),Ae(to,this).addLocalHook("hide",()=>this.hide()),Ae(to,this).addLocalHook("show",(n,r)=>this.showAtCell(n,r)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){Ae(to,this).updateDelay(this.getSetting("displayDelay")),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),n=e.getContext("grid"),r=e.addContext(jR);n.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeLast();As(jg,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(jR),this.hot._registerTimeout(()=>{As(jg,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell()},group:Oh}),r.addShortcut({keys:[["Escape"]],callback:()=>{Ae(it,this).setValue(Ae(Ug,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ae(it,this).isVisible()&&Ae(it,this).isFocused(),group:Oh}),r.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ae(it,this).isVisible()&&Ae(it,this).isFocused(),group:Oh}),r.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{Ae(it,this).setValue(Ae(it,this).getValue()),this.hide(),e.setActiveContextName("grid")},group:Oh})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Oh)}registerListeners(){const{rootDocument:e}=this.hot,n=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",r=>sr(Mr,this,C8).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>sr(Mr,this,w8).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>sr(Mr,this,y8).call(this)),this.eventManager.addEventListener(n,"focus",()=>sr(Mr,this,R8).call(this)),this.eventManager.addEventListener(n,"blur",()=>sr(Mr,this,S8).call(this)),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",r=>sr(Mr,this,v8).call(this,r))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const n=wa(e.target,"TD","TBODY");return!!(n&&ye(n,"htCommentCell")&&wa(n,[this.hot.rootElement]))}targetIsCommentTextArea(e){return this.getEditorInputElement()===e.target}setComment(e){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const n=Ae(it,this).getValue();let r="";e!=null?r=e:n!=null&&(r=n);const i=this.range.from.row,o=this.range.from.col;this.updateCommentMeta(i,o,{[Ph]:r}),this.hot.render()}setCommentAtCell(e,n,r){this.setRange({from:this.hot._createCellCoords(e,n)}),this.setComment(r)}removeComment(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.setCellMeta(this.range.from.row,this.range.from.col,Go),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this.setRange({from:this.hot._createCellCoords(e,n)}),this.removeComment(r)}getComment(){const e=this.range.from.row,n=this.range.from.col;return this.getCommentMeta(e,n,Ph)}getCommentAtCell(e,n){return this.getCommentMeta(e,n,Ph)}show(){var e;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{from:{row:n,col:r}}=this.range;if(n<0||n>this.hot.countSourceRows()-1||r<0||r>this.hot.countSourceCols()-1)return!1;const i=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return Ae(to,this).cancelHiding(),Ae(it,this).setValue((e=i[Go]?i[Go][Ph]:null)!==null&&e!==void 0?e:""),Ae(it,this).show(),this.refreshEditor(!0),!0}showAtCell(e,n){return this.setRange({from:this.hot._createCellCoords(e,n)}),this.show()}hide(){Ae(it,this).hide()}refreshEditor(){if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!Ae(it,this).isVisible()))return;const{rowIndexMapper:n,columnIndexMapper:r}=this.hot,{row:i,col:o}=this.range.from;let s=n.getRenderableFromVisualIndex(i),a=r.getRenderableFromVisualIndex(o);const l=s===null;Ae(it,this).setPosition(0,0),s===null&&(s=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(i,-1))),a===null&&(a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(o,-1)));const u=s===null,c=a===null;s=s??0,a=a??0;const{rootWindow:h,view:{_wt:d}}=this.hot,{wtTable:f}=d,m=d.getCell({row:s,col:a},!0),b=this.getCommentMeta(i,o,Z1);b?Ae(it,this).setSize(b.width,b.height):Ae(it,this).resetSize();const S=c?0:f.getColumnWidth(a),E=l&&!u?an(m):0,{left:v,top:I,width:M,height:T}=m.getBoundingClientRect(),{width:P,height:D}=Ae(it,this).getSize(),{innerWidth:K,innerHeight:Y}=this.hot.rootWindow,U=this.hot.rootDocument.documentElement,J=vn(this.hot.rootDocument),ee=lx(this.hot.rootWindow)?J:0,ae=ux(this.hot.rootWindow)?J:0;let ne=v+h.scrollX+S,se=I+h.scrollY+E;this.hot.isRtl()&&(ne-=P+S),this.hot.isLtr()&&v+M+P>K-ee?ne=v+h.scrollX-P-1:this.hot.isRtl()&&ne<-(U.scrollWidth-U.clientWidth)&&(ne=v+h.scrollX+S+1),I+D>Y-ae&&(se-=D-T+1),Ae(it,this).setPosition(ne,se),Ae(it,this).setReadOnlyState(this.getCommentMeta(i,o,Wg)),Ae(it,this).observeSize()}focusEditor(){Ae(it,this).focus()}updateCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n)[Go];let o;i?(o=Fn(i),Cf(o,r)):o=r,this.hot.setCellMeta(e,n,Go,o)}getCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n);if(i[Go])return i[Go][r]}addToContextMenu(e){e.items.push({name:ke},l8(this),u8(this),c8(this))}getEditorInputElement(){return Ae(it,this).getInputElement()}destroy(){var e,n;(e=Ae(it,this))===null||e===void 0||e.destroy(),(n=Ae(to,this))===null||n===void 0||n.destroy(),super.destroy()}}function w8(t){if(!(!this.hot.view||!this.hot.view._wt)&&!Ae(Bg,this)&&!this.targetIsCommentTextArea(t)){const e=wa(t.target,"TD","TBODY");let n=null;e&&(n=this.hot.getCoords(e)),(!e||this.range.from&&n&&(this.range.from.row!==n.row||this.range.from.col!==n.col))&&this.hide()}}function v8(t){t.stopPropagation()}function C8(t){const{rootDocument:e}=this.hot;if(!(Ae(Bg,this)||Ae(it,this).isFocused()||ye(t.target,"wtBorder")||Ae(UR,this)===t.target||!Ae(it,this)))if(As(UR,this,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const n=this.hot._createCellRange(this.hot.getCoords(t.target));Ae(to,this).show(n)}else va(t.target,e)&&!this.targetIsCommentTextArea(t)&&Ae(to,this).hide()}function y8(){As(Bg,this,!1)}function b8(t,e){e[Go]&&e[Go][Ph]&&X(t,e.commentedCellClassName)}function S8(){As(Ug,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function R8(){As(Ug,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(jR)}function E8(t,e){this.updateCommentMeta(this.range.from.row,this.range.from.col,{[Z1]:{width:t,height:e}})}function Q1(t){Ae(it,this).isFocused()&&fi(t)}function T8(){Ae(jg,this)||this.hide()}function _8(){const t=Ae(it,this).getEditorElement();ve(t,/ht-theme-.*/g),X(t,this.hot.getCurrentThemeName())}function zR(t,e,n){return(e=M8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M8(t){var e=I8(t,"string");return typeof e=="symbol"?e:e+""}function I8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class J1{constructor(e){zR(this,"hot",void 0),zR(this,"commands",{}),zR(this,"commonCallback",null),this.hot=e}registerCommand(e,n){this.commands[e]=n}setCommonCallback(e){this.commonCallback=e}execute(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];const o=e.split(":"),s=o[0],a=o.length===2?o[1]:null;let l=this.commands[s];if(!l)throw new Error(`Menu command '${s}' not exists.`);if(a&&l.submenu&&(l=P8(a,l.submenu.items)),l.disabled===!0||typeof l.disabled=="function"&&l.disabled.call(this.hot)===!0||on(l,"submenu"))return;const u=[];typeof l.callback=="function"&&u.push(l.callback),typeof this.commonCallback=="function"&&u.push(this.commonCallback),r.unshift(o.join(":")),H(u,c=>c.apply(this.hot,r))}}function P8(t,e){let n;return H(e,r=>{const i=r.key?r.key.split(":"):null;if(Array.isArray(i)&&i[1]===t)return n=r,!1}),n}function YR(t,e,n){return(e=O8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O8(t){var e=x8(t,"string");return typeof e=="symbol"?e:e+""}function x8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class eN{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;YR(this,"hot",void 0),YR(this,"predefinedItems",K1()),YR(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=n}setPredefinedItems(e){const n={};this.defaultOrderPattern.length=0,Ne(e,(r,i)=>{let o="";r.name===ke?(n[ke]=r,o=ke):isNaN(parseInt(i,10))?(r.key=r.key===void 0?i:r.key,n[i]=r,o=r.key):(n[r.key]=r,o=r.key),this.defaultOrderPattern.push(o)}),this.predefinedItems=n}getItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return A8(e,this.defaultOrderPattern,this.predefinedItems)}}function A8(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=[];let i=t;return i&&i.items?i=i.items:Array.isArray(i)||(i=e),He(i)?Ne(i,(o,s)=>{let a=n[typeof o=="string"?o:s];a||(a=o),He(o)?rn(a,o):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=s),r.push(a)}):H(i,(o,s)=>{let a=n[o];!a&&s8.indexOf(o)>=0||(a||(a={name:o,key:`${s}`}),He(o)&&rn(a,o),a.key===void 0&&(a.key=s),r.push(a))}),r}function Hs(t,e,n){return(e=H8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function H8(t){var e=N8(t,"string");return typeof e=="symbol"?e:e+""}function N8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class D8{constructor(e,n){Hs(this,"top",void 0),Hs(this,"topRelative",void 0),Hs(this,"left",void 0),Hs(this,"leftRelative",void 0),Hs(this,"scrollTop",void 0),Hs(this,"scrollLeft",void 0),Hs(this,"cellHeight",void 0),Hs(this,"cellWidth",void 0);const r=n.scrollY,i=n.scrollX;let o,s,a,l,u,c;this.rootWindow=n,this.type=this.getSourceType(e),this.type==="literal"?(o=parseInt(e.top,10),a=parseInt(e.left,10),u=e.height||0,c=e.width||0,s=o,l=a,o+=r,a+=i):this.type==="event"&&(o=parseInt(e.pageY,10),a=parseInt(e.pageX,10),u=e.target.clientHeight,c=e.target.clientWidth,s=o-r,l=a-i),this.top=o,this.topRelative=s,this.left=a,this.leftRelative=l,this.scrollTop=r,this.scrollLeft=i,this.cellHeight=u,this.cellWidth=c}getSourceType(e){let n="literal";return e instanceof Event&&(n="event"),n}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=n}fitsOnRight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=n}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function xh(t,e,n){k8(t,e),e.set(t,n)}function k8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ie(t,e){return t.get(tN(t,e))}function zg(t,e,n){return t.set(tN(t,e),n),n}function tN(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 zn=new WeakMap,ar=new WeakMap,lr=new WeakMap,GR=new WeakMap,Mu=new WeakMap;class L8{constructor(e){xh(this,zn,void 0),xh(this,ar,void 0),xh(this,lr,void 0),xh(this,GR,!1),xh(this,Mu,{above:0,below:0,left:0,right:0}),zg(GR,this,e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Ie(Mu,this)[e]=n,this}setElement(e){return zg(zn,this,e),this}setParentElement(e){return zg(ar,this,e),this}updatePosition(e){zg(lr,this,new D8(e,Ie(zn,this).ownerDocument.defaultView)),Ie(GR,this)?(Ie(lr,this).fitsBelow(Ie(zn,this))?this.setPositionBelowCursor():Ie(lr,this).fitsAbove(Ie(zn,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){Ie(zn,this).dir==="rtl"?Ie(lr,this).fitsOnLeft(Ie(zn,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Ie(lr,this).fitsOnRight(Ie(zn,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Ie(Mu,this).above+Ie(lr,this).top-Ie(zn,this).offsetHeight;if(Ie(ar,this)){const r=Ie(ar,this).ownerDocument.defaultView.getComputedStyle(Ie(ar,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),o=Number.parseInt(r.borderTop,10);e=Ie(lr,this).top+Ie(lr,this).cellHeight-Ie(zn,this).scrollHeight+i+o}Ie(zn,this).style.top=`${e}px`}setPositionBelowCursor(){let e=Ie(Mu,this).below+Ie(lr,this).top+1;if(Ie(ar,this)){const r=Ie(ar,this).ownerDocument.defaultView.getComputedStyle(Ie(ar,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),o=Number.parseInt(r.borderTop,10);e=Ie(lr,this).top-i-o-1}Ie(zn,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=Ie(lr,this).left;if(Ie(ar,this)){const n=Ie(ar,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(Ie(ar,this).querySelector(".htCore")).borderRightWidth,10);e+=Ie(lr,this).cellWidth+r}else e+=Ie(Mu,this).right;Ie(zn,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=Ie(Mu,this).left+Ie(lr,this).left-Ie(zn,this).offsetWidth;if(Ie(ar,this)){const n=Ie(ar,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(Ie(ar,this).querySelector(".htCore")).borderLeftWidth,10);e-=r}Ie(zn,this).style.left=`${e}px`}}function nN(t){let{initialPage:e=-1,size:n=()=>0,onItemSelect:r=()=>{},onClear:i=()=>{}}=t;const o=new Set;let s=ze(e,-1,m()-1);function a(S,E){const v=m()-1;return S<0&&(S=v),S>v&&(S=0),o.has(S)?-1:(o.add(S),r(S,!1)===!1&&(S=a(E===1?++S:--S,E)),S)}function l(S){S>-1&&S<m()&&r(S,!0)!==!1&&(s=S)}function u(){return s}function c(){m()>0&&(o.clear(),s=a(0,1))}function h(){m()>0&&(o.clear(),s=a(m()-1,-1))}function d(){m()>0&&(o.clear(),s=a(++s,1))}function f(){m()>0&&(o.clear(),s=a(--s,-1))}function m(){return Math.max(n(),0)}function b(){o.clear(),s=e,i()}return{setCurrentPage:l,getCurrentPage:u,toFirstItem:c,toLastItem:h,toNextItem:d,toPreviousItem:f,getSize:m,clear:b}}function $8(t){return je(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function qR(t){return on(t,"submenu")}function KR(t){return new RegExp(ke,"i").test(t.name)}function Yg(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function rN(t){return on(t,"disableSelection")}function F8(t){return ye(t,"htSeparator")}function V8(t){return ye(t,"htSubmenu")}function W8(t){return ye(t,"htDisabled")}function B8(t){return ye(t,"htSelectionDisabled")}function j8(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function iN(t,e){const n=t.slice(0);for(let r=0;r<n.length&&n[r].name===e;)n.shift();return n}function U8(t,e){let n=t.slice(0);return n.reverse(),n=iN(n,e),n.reverse(),n}function z8(t){const e=[];return H(t,(n,r)=>{r>0?e[e.length-1].name!==n.name&&e.push(n):e.push(n)}),e}function Y8(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ke,n=t.slice(0);return n=iN(n,e),n=U8(n,e),n=z8(n),n}function G8(t){return t.checkable===!0}function q8(t){return nN({size:()=>t.countRows(),onItemSelect(e,n){const r=t.getCell(e,0);if(!r||F8(r)||W8(r)||B8(r))return!1;t.selectCell(e,0,...n?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function K8(t){const{hot:e,hotMenu:n}=t;return[{keys:[["Control/Meta","A"]],forwardToContext:e.getShortcutManager().getContext("grid"),callback:()=>t.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(r,i)=>{const o=e.getSettings(),s=typeof o.tabMoves=="function"?o.tabMoves(r):o.tabMoves;i.includes("shift")?e.selection.transformStart(-s.row,-s.col):e.selection.transformStart(s.row,s.col),t.close(!0)}},{keys:[["Escape"]],callback:()=>t.close()},{keys:[["ArrowDown"]],callback:()=>t.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>t.getNavigator().toPreviousItem()},{keys:[[e.isRtl()?"ArrowLeft":"ArrowRight"]],callback:()=>{const r=n.getSelectedLast();if(r){const i=t.openSubMenu(r[0]);i&&i.getNavigator().toFirstItem()}}},{keys:[[e.isRtl()?"ArrowRight":"ArrowLeft"]],callback:()=>{n.getSelectedLast()&&t.isSubMenu()&&(t.close(),t.isSubMenu()&&t.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>t.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>t.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:r=>{const i=n.getSelectedLast();i&&(n.getSourceDataAtRow(i[0]).submenu?t.openSubMenu(i[0]).getNavigator().toFirstItem():(t.executeCommand(r),t.close(!0)))}},{keys:[["PageUp"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(-n.countVisibleRows(),0):t.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(n.countVisibleRows(),0):t.getNavigator().toLastItem()}}]}const oN="menu",sN=oN;function X8(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];r(K8(t)),e.forEach(u=>{let{shortcuts:c,contextName:h}=u;i(c,h)});function r(u,c){a(c).addShortcuts(u,{group:oN})}function i(u,c){const h=a(c);u.forEach(d=>{let{keys:f}=d;f.forEach(m=>h.removeShortcutsByKeys(m))}),n.push({shortcuts:u,contextName:c}),r(u,c)}function o(){return[...n]}function s(u){return u?`${sN}:${u}`:sN}function a(u){var c;const h=t.hotMenu.getShortcutManager(),d=s(u);return(c=h.getContext(d))!==null&&c!==void 0?c:h.addContext(d)}function l(u){t.hotMenu.getShortcutManager().setActiveContextName(s(u))}return{addCustomShortcuts:i,getCustomShortcuts:o,getContext:a,listen:l}}function Z8(t){return(e,n,r,i,o,s)=>{const a=e.getSourceDataAtRow(r),l=t.rootDocument.createElement("div"),u=typeof s=="function"?s.call(t):s,c=typeof a.ariaLabel=="function"?a.ariaLabel.call(t):a.ariaLabel,h=typeof a.ariaChecked=="function"?a.ariaChecked.call(t):a.ariaChecked;if(No(n),X(l,"htItemWrapper"),t.getSettings().ariaTags){const d=!Yg(a,t)&&!rN(a)&&!KR(a);Se(n,[...G8(a)?[nz(),Fc(c),JO(h)]:[tz(),Fc(u)],...d?[ma(-1)]:[],...Yg(a,t)?[uz()]:[],...qR(a)?[Br(!1)]:[]])}n.className="",n.appendChild(l),KR(a)?X(n,"htSeparator"):typeof a.renderer=="function"?(X(n,"htCustomMenuRenderer"),n.appendChild(a.renderer(e,l,r,i,o,u))):Gl(l,u),Yg(a,t)?X(n,"htDisabled"):rN(a)?X(n,"htSelectionDisabled"):qR(a)&&X(n,"htSubmenu")}}function XR(t,e,n){Q8(t,e),e.set(t,n)}function Q8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function no(t,e,n){return(e=J8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function J8(t){var e=e7(t,"string");return typeof e=="symbol"?e:e+""}function e7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ZR(t,e,n){return t.set(aN(t,e),n),n}function Ka(t,e){return t.get(aN(t,e))}function aN(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 lN=215;var Ah=new WeakMap,Gg=new WeakMap,qg=new WeakMap;class Iu{get tableBorderWidth(){return Ka(qg,this)===void 0&&this.hotMenu&&ZR(qg,this,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),Ka(qg,this)}constructor(e,n){var r=this;no(this,"hot",void 0),no(this,"options",void 0),no(this,"eventManager",new gi(this)),no(this,"container",void 0),no(this,"positioner",void 0),no(this,"hotMenu",null),no(this,"hotSubMenus",{}),no(this,"parentMenu",void 0),no(this,"menuItems",null),no(this,"origOutsideClickDeselects",null),XR(this,Ah,void 0),XR(this,Gg,void 0),XR(this,qg,void 0),this.hot=e,this.options=n||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:lN,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new L8(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.parentMenu.runLocalHooks("afterSelectionChange",...o)}),this.hot.addHook("afterSetTheme",(i,o)=>{if(!o){var s;(s=this.hotMenu)===null||s===void 0||s.useTheme(i)}})}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",n=>this.onDocumentMouseDown(n)),this.eventManager.addEventListener(e.document,"touchstart",n=>this.onDocumentMouseDown(n)),this.eventManager.addEventListener(e.document,"contextmenu",n=>this.onDocumentContextMenu(n)),e=zl(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return Ka(Ah,this)}getKeyboardShortcutsCtrl(){return Ka(Gg,this)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedLast()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedLast())}isSubMenu(){return this.parentMenu!==null}open(){this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";const e=Df(a=>this.openSubMenu(a),300),n=this.options.minWidth||lN;let r=!1,i=ga(this.menuItems,a=>(a.key===Ih&&(r=!0),j8(a,this.hot)));if(i.length<1&&!r)i.push(K1()[Ih]);else if(i.length===0)return;i=Y8(i,ke);let o=!1;const s={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return ce(a)&&a<n?n:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:Z8(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,themeName:this.hot.getCurrentThemeName(),beforeRefreshDimensions:()=>!1,beforeOnCellMouseOver:(a,l)=>{Ka(Ah,this).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},afterOnCellContextMenu:a=>{a.preventDefault(),vx()&&o&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(a,l,u,c,h)=>{this.hotMenu.view.isMouseDown()&&(h.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:a=>{this.hasSelectedItem()&&(o=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(a))},afterOnCellMouseUp:a=>{(!vx()||!Sa(a))&&o&&this.hasSelectedItem()&&(ko()||wx()?this.hot._registerTimeout(()=>this.close(!0),325):this.close(!0))},afterUnlisten:()=>{!this.hasSelectedItem()&&this.isOpened()&&this.hotMenu.listen()}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new this.hot.constructor(this.container,s),this.hotMenu.addHook("afterInit",()=>this.onAfterInit()),this.hotMenu.init(),ZR(Ah,this,q8(this.hotMenu)),ZR(Gg,this,X8(this)),Ka(Gg,this).listen(),this.focus(),this.isSubMenu()&&this.addLocalHook("afterOpen",()=>this.parentMenu.runLocalHooks("afterSubmenuOpen",this)),this.runLocalHooks("afterOpen",this)}close(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isOpened()){if(e&&this.isSubMenu())this.parentMenu.close();else if(Ka(Ah,this).clear(),this.closeAllSubMenus(),this.container.style.display="none",this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose"),this.isSubMenu()){if(this.hot.getSettings().ariaTags){const n=this.parentMenu.hotMenu.getSelectedLast();if(n){const r=this.parentMenu.hotMenu.getCell(n[0],0);Se(r,[Br(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const n=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!n||!V8(n))return!1;const r=this.hotMenu.getSourceDataAtRow(e),i=new Iu(this.hot,{parent:this,name:r.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return i.setMenuItems(r.submenu.items),i.open(),i.setPosition(n.getBoundingClientRect()),this.hotSubMenus[r.key]=i,this.hot.getSettings().ariaTags&&Se(n,[Br(!0)]),i}closeSubMenu(e){const n=this.hotMenu.getSourceDataAtRow(e),r=this.hotSubMenus[n.key];if(r){r.destroy(),delete this.hotSubMenus[n.key];const i=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&Se(i,[Br(!1)])}}closeAllSubMenus(){H(this.hotMenu.getData(),(e,n)=>this.closeSubMenu(n))}isAllSubMenusClosed(){return Object.keys(this.hotSubMenus).length===0}focus(){this.isOpened()&&(this.hotMenu.rootElement.focus({preventScroll:!0}),this.getKeyboardShortcutsCtrl().listen(),this.hotMenu.listen())}destroy(){const e=this.container.parentNode;this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy(),e&&e.removeChild(this.container)}isOpened(){return this.hotMenu!==null}executeCommand(e){if(!this.isOpened()||!this.hasSelectedItem())return;const n=this.getSelectedItem();if(this.runLocalHooks("select",n,e),this.isCommandPassive(n))return;const r=this.hot.getSelectedRange(),i=r?$8(r):[];this.runLocalHooks("executeCommand",n.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",n.key,i,e)}isCommandPassive(e){return e.isCommand===!1||KR(e)||Yg(e,this.hot)||qR(e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.positioner.setOffset(e,n)}setPosition(e){this.isSubMenu()&&this.positioner.setParentElement(this.parentMenu.container),this.positioner.setElement(this.container).updatePosition(e)}updateMenuDimensions(){const e=this.hotMenu.view.getStylesHandler(),{wtTable:n}=this.hotMenu.view._wt,r=this.hotMenu.getSettings().data,i=n.hider.style,o=n.holder.style,s=parseInt(i.width,10),a=tr(r,(l,u,c)=>{const d=this.hotMenu.getCell(c,0)?an(this.hotMenu.getCell(c,0)):0;return l+(u.name===ke?1:d)},0);e.isClassicTheme()?(o.width=`${s+3}px`,o.height=`${a+3}px`):(o.width=`${s}px`,o.height=`${a}px`),i.height=o.height}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const n=this.options.container.ownerDocument;let r=e,i;return r&&(rt(r)&&(r=r.call(this.hot),r===null||At(r)?r="":r=r.toString()),r=r.replace(/[^A-Za-z0-9]/g,"_"),r=`${this.options.className}Sub_${r}`,i=n.querySelector(`.${this.options.className}.${r}`)),i||(i=n.createElement("div"),X(i,`htMenu handsontable ${this.options.className}`),r&&X(i,r),this.options.container.appendChild(i)),i}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&Se(this.hotMenu.rootElement,[ez(),ma(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!va(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!va(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&ye(e.target,"htCore")&&va(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}ct(Iu,Mn);function t7(t,e){n7(t,e),e.add(t)}function n7(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function QR(t,e,n){return(e=r7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r7(t){var e=i7(t,"string");return typeof e=="symbol"?e:e+""}function i7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Kg(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 Hh="contextMenu",o7=70,uN=Hh;re.getSingleton().register("afterContextMenuDefaultOptions"),re.getSingleton().register("beforeContextMenuShow"),re.getSingleton().register("afterContextMenuShow"),re.getSingleton().register("afterContextMenuHide"),re.getSingleton().register("afterContextMenuExecute");var Nh=new WeakSet;class Xg extends Xe{constructor(){super(...arguments),t7(this,Nh),QR(this,"commandExecutor",new J1(this.hot)),QR(this,"itemsFactory",null),QR(this,"menu",null)}static get PLUGIN_KEY(){return Hh}static get PLUGIN_PRIORITY(){return o7}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Lg,$g,ke,Rh,Eh,ke,kg,Mh,ke,Fg,Hg,ke,Th,ke,Zr]}isEnabled(){return!!this.hot.getSettings()[Hh]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[Hh];typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.menu=new Iu(this.hot,{className:"htContextMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>Kg(Nh,this,a7).call(this)),this.menu.addLocalHook("afterOpen",()=>Kg(Nh,this,l7).call(this)),this.menu.addLocalHook("afterClose",()=>Kg(Nh,this,u7).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return e.executeCommand.call(e,...i)}),this.addHook("afterOnCellContextMenu",r=>Kg(Nh,this,s7).call(this,r)),this.registerShortcuts(),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&(this.menu.destroy(),this.menu=null),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control/Meta","Shift","Backslash"],["Shift","F10"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();this.hot.scrollToFocusedCell();const n=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),r=xg(this.menu.container,this.hot.rootDocument);this.open({left:n.left+r.left,top:n.top+r.top-1+n.height},{left:n.width,above:-n.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&this.hot.selection.isCellVisible(n)&&!this.menu.isOpened()},group:uN})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(uN)}open(e){var n;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};if((n=this.menu)!==null&&n!==void 0&&n.isOpened())return;this.prepareMenuItems(),this.menu.open();const i=this.menu.tableBorderWidth>0;Ne(r,(o,s)=>{const a=["below","right"].includes(s)?o+1:o-1;this.menu.setOffset(s,i?o:a)}),this.menu.setPosition(e)}close(){var e;(e=this.menu)===null||e===void 0||e.close(),this.itemsFactory=null}executeCommand(e){this.itemsFactory===null&&this.prepareMenuItems();for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.commandExecutor.execute(e,...r)}prepareMenuItems(){this.itemsFactory=new eN(this.hot,Xg.DEFAULT_ITEMS);const e=this.hot.getSettings()[Hh],n={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",n),this.itemsFactory.setPredefinedItems(n.items);const r=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",r),this.menu.setMenuItems(r),H(r,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function s7(t){const e=this.hot.getSettings(),n=e.rowHeaders,r=e.colHeaders;function i(a){return a.nodeName==="TD"||a.parentNode.nodeName==="TD"}const o=t.target;if(this.close(),ye(o,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(n||r)&&!i(o)&&!(ye(o,"current")&&ye(o,"wtBorder"))))return;const s=xg(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+s.top,left:t.clientX+s.left})}function a7(){this.hot.runHooks("beforeContextMenuShow",this)}function l7(){this.hot.runHooks("afterContextMenuShow",this)}function u7(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}Xg.SEPARATOR={name:ke};const cN=/^(\r\n|\n\r|\r|\n)/,c7=/^[^\t\r\n]+/,hN=/^\t/;function h7(t){const e=[[""]];if(t.length===0)return e;let n=0,r=0,i;for(;t.length>0&&i!==t.length;)if(i=t.length,t.match(hN))t=t.replace(hN,""),n+=1,e[r][n]="";else if(t.match(cN))t=t.replace(cN,""),n=0,r+=1,e[r]=[""];else{let o="";if(t.startsWith('"')){let s=0,a=!0;for(;a;){const l=t.slice(0,1);l==='"'&&(s+=1),o+=l,t=t.slice(1),(t.length===0||t.match(/^[\t\r\n]/)&&s%2===0)&&(a=!1)}o=o.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,l=>new Array(Math.floor(l.length/2)).fill('"').join(""))}else{const s=t.match(c7);o=s?s[0]:"",t=t.slice(o.length)}e[r][n]=o}return e}function Dh(t){let e,n,r,i,o="",s;for(e=0,n=t.length;e<n;e+=1){for(i=t[e].length,r=0;r<i;r+=1)r>0&&(o+=" "),s=t[e][r],typeof s=="string"?s.indexOf(`
48
- `)>-1?o+=`"${s.replace(/"/g,'""')}"`:o+=s:s==null?o+="":o+=s;e!==n-1&&(o+=`
49
- `)}return o}function d7(t){return{key:"copy",name(){return this.getTranslatedPhrase(lb)},callback(){t.copyCellsOnly()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function f7(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),n=e?ze(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(hb,n)},callback(){t.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function g7(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),n=e?ze(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(cb,n)},callback(){t.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function m7(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),n=e?ze(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(ub,n)},callback(){t.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function p7(t){return{key:"cut",name(){return this.getTranslatedPhrase(db)},callback(){t.cut()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}class w7{constructor(){this.data={}}setData(e,n){this.data[e]=n}getData(e){return this.data[e]||void 0}}class v7{constructor(){this.clipboardData=new w7}preventDefault(){}composedPath(){return[]}}function C7(t,e){dN(t,e),e.add(t)}function Pu(t,e,n){dN(t,e),e.set(t,n)}function dN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yn(t,e){return t.get(xu(t,e))}function Ou(t,e,n){return t.set(xu(t,e),n),n}function xu(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 Ns=new WeakMap,JR=new WeakMap,kh=new WeakMap,eE=new WeakMap,tE=new WeakMap,Lh=new WeakMap,$h=new WeakSet;class y7{constructor(e){let{countRows:n,countColumns:r,rowsLimit:i,columnsLimit:o,countColumnHeaders:s}=e;C7(this,$h),Pu(this,Ns,void 0),Pu(this,JR,void 0),Pu(this,kh,void 0),Pu(this,eE,void 0),Pu(this,tE,void 0),Pu(this,Lh,void 0),Ou(JR,this,n),Ou(kh,this,r),Ou(eE,this,i),Ou(tE,this,o),Ou(Lh,this,s)}setSelectedRange(e){Ou(Ns,this,e)}getCellsRange(){if(Yn(JR,this).call(this)===0||Yn(kh,this).call(this)===0)return null;const{row:e,col:n}=Yn(Ns,this).getTopStartCorner(),{row:r,col:i}=Yn(Ns,this).getBottomEndCorner(),o=xu($h,this,b7).call(this,e,r),s=xu($h,this,nE).call(this,n,i);return{isRangeTrimmed:r!==o||i!==s,startRow:e,startCol:n,endRow:o,endCol:s}}getMostBottomColumnHeadersRange(){if(Yn(kh,this).call(this)===0||Yn(Lh,this).call(this)===0)return null;const{col:e}=Yn(Ns,this).getTopStartCorner(),{col:n}=Yn(Ns,this).getBottomEndCorner(),r=xu($h,this,nE).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-1,startCol:e,endRow:-1,endCol:r}}getAllColumnHeadersRange(){if(Yn(kh,this).call(this)===0||Yn(Lh,this).call(this)===0)return null;const{col:e}=Yn(Ns,this).getTopStartCorner(),{col:n}=Yn(Ns,this).getBottomEndCorner(),r=xu($h,this,nE).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-Yn(Lh,this).call(this),startCol:e,endRow:-1,endCol:r}}}function nE(t,e){return Math.min(e,Math.max(t+Yn(tE,this).call(this)-1,t))}function b7(t,e){return Math.min(e,Math.max(t+Yn(eE,this).call(this)-1,t))}function fN(t){const e=[],n=[];return H(t,r=>{const i=Math.min(r.startRow,r.endRow),o=Math.max(r.startRow,r.endRow);fe(i,o,l=>{e.indexOf(l)===-1&&e.push(l)});const s=Math.min(r.startCol,r.endCol),a=Math.max(r.startCol,r.endCol);fe(s,a,l=>{n.indexOf(l)===-1&&n.push(l)})}),{rows:e,columns:n}}var gN={},rE,mN;function S7(){if(mN)return rE;mN=1;var t=oi(),e=oa(),n=si(),r=n("match");return rE=function(i){var o;return t(i)&&((o=i[r])!==void 0?!!o:e(i)==="RegExp")},rE}var iE,pN;function R7(){if(pN)return iE;pN=1;var t=nn();return iE=function(){var e=t(this),n="";return e.hasIndices&&(n+="d"),e.global&&(n+="g"),e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.dotAll&&(n+="s"),e.unicode&&(n+="u"),e.unicodeSets&&(n+="v"),e.sticky&&(n+="y"),n},iE}var oE,wN;function E7(){if(wN)return oE;wN=1;var t=In(),e=Lr(),n=gc(),r=R7(),i=RegExp.prototype;return oE=function(o){var s=o.flags;return s===void 0&&!("flags"in i)&&!e(o,"flags")&&n(i,o)?t(r,o):s},oE}var sE,vN;function T7(){if(vN)return sE;vN=1;var t=Xt(),e=Il(),n=Math.floor,r=t("".charAt),i=t("".replace),o=t("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;return sE=function(l,u,c,h,d,f){var m=c+l.length,b=h.length,S=a;return d!==void 0&&(d=e(d),S=s),i(f,S,function(E,v){var I;switch(r(v,0)){case"$":return"$";case"&":return l;case"`":return o(u,0,c);case"'":return o(u,m);case"<":I=d[o(v,1,-1)];break;default:var M=+v;if(M===0)return E;if(M>b){var T=n(M/10);return T===0?E:T<=b?h[T-1]===void 0?r(v,1):h[T-1]+r(v,1):E}I=h[M-1]}return I===void 0?"":I})},sE}var CN;function _7(){if(CN)return gN;CN=1;var t=vt(),e=In(),n=Xt(),r=dc(),i=tn(),o=Ud(),s=S7(),a=qd(),l=mc(),u=E7(),c=T7(),h=si(),d=ps(),f=h("replace"),m=TypeError,b=n("".indexOf),S=n("".replace),E=n("".slice),v=Math.max;return t({target:"String",proto:!0},{replaceAll:function(M,T){var P=r(this),D,K,Y,U,J,ee,ae,ne,se,ft,pe=0,Ee="";if(!o(M)){if(D=s(M),D&&(K=a(r(u(M))),!~b(K,"g")))throw new m("`.replaceAll` does not allow non-global regexes");if(Y=l(M,f),Y)return e(Y,M,P,T);if(d&&D)return S(a(P),M,T)}for(U=a(P),J=a(M),ee=i(T),ee||(T=a(T)),ae=J.length,ne=v(1,ae),se=b(U,J);se!==-1;)ft=ee?a(T(J,se,U)):c(J,U,se,[],void 0,T),Ee+=E(U,pe,se)+ft,pe=se+ae,se=se+ne>U.length?-1:b(U,J,se+ne);return pe<U.length&&(Ee+=E(U,pe)),Ee}}),gN}_7();const yN={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">"},M7=new RegExp(Object.keys(yN).map(t=>`(${t})`).join("|"),"gi");function I7(t){return(t&&t.nodeName||"")==="TABLE"}function bN(t){const e=t.hasColHeaders(),n=t.hasRowHeaders(),r=[e?-1:0,n?-1:0,t.countRows()-1,t.countCols()-1],i=t.getData(...r),o=i.length,s=o>0?i[0].length:0,a=["<table>","</table>"],l=e?["<thead>","</thead>"]:[],u=["<tbody>","</tbody>"],c=n?1:0,h=e?1:0;for(let d=0;d<o;d+=1){const f=e&&d===0,m=[];for(let S=0;S<s;S+=1){const E=!f&&n&&S===0;let v="";if(f)v=`<th>${t.getColHeader(S-c)}</th>`;else if(E)v=`<th>${t.getRowHeader(d-h)}</th>`;else{const I=i[d][S],{hidden:M,rowspan:T,colspan:P}=t.getCellMeta(d-h,S-c);if(!M){const D=[];if(T&&D.push(`rowspan="${T}"`),P&&D.push(`colspan="${P}"`),Bt(I))v=`<td ${D.join(" ")}></td>`;else{const K=I.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
50
- `).replace(/\x20/gi,"&nbsp;").replace(/\t/gi,"&#9;");v=`<td ${D.join(" ")}>${K}</td>`}}}m.push(v)}const b=["<tr>",...m,"</tr>"].join("");f?l.splice(1,0,b):u.splice(-1,0,b)}return a.splice(1,0,l.join(""),u.join("")),a.join("")}function SN(t){const e=t.length,n=["<table>"];for(let r=0;r<e;r+=1){const i=t[r],o=i.length,s=[];r===0&&n.push("<tbody>");for(let a=0;a<o;a+=1){const l=i[a],u=Bt(l)?"":l.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
51
- `).replace(/\x20{2,}/gi,c=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(c.length-1)} </span>`).replace(/\t/gi,"&#9;");s.push(`<td>${u}</td>`)}n.push("<tr>",...s,"</tr>"),r+1===e&&n.push("</tbody>")}return n.push("</table>"),n.join("")}function P7(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;const n={},r=e.createDocumentFragment(),i=e.createElement("div");r.appendChild(i);let o=t;if(typeof o=="string"){const I=o.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,M=>{const T=M.match(/<td\b[^>]*?>/g)[0],P=/<p.*?>/g,D=M.substring(T.length,M.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(P,`
52
- `).replace(`
53
- `,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^&nbsp;$/mg,"");return`${T}${D}</td>`});i.insertAdjacentHTML("afterbegin",`${I}`),o=i.querySelector("table")}if(!o||!I7(o))return;const s=i.querySelector('meta[name$="enerator"]'),a=o.querySelector("tbody th")!==null,l=o.querySelector("tr"),u=l?Array.from(l.cells).reduce((I,M)=>I+M.colSpan,0)-(a?1:0):0,c=o.tFoot&&Array.from(o.tFoot.rows)||[],h=[];let d=!1,f=0,m=0;if(o.tHead){const I=Array.from(o.tHead.rows).filter(M=>{const T=M.querySelector("td")!==null;return T&&h.push(M),!T});f=I.length,d=f>0,f>1?n.nestedHeaders=Array.from(I).reduce((M,T)=>{const P=Array.from(T.cells).reduce((D,K,Y)=>{if(a&&Y===0)return D;const{colSpan:U,innerHTML:J}=K,ee=U>1?{label:J,colspan:U}:J;return D.push(ee),D},[]);return M.push(P),M},[]):d&&(n.colHeaders=Array.from(I[0].children).reduce((M,T,P)=>(a&&P===0||M.push(T.innerHTML),M),[]))}h.length&&(n.fixedRowsTop=h.length),c.length&&(n.fixedRowsBottom=c.length);const b=[...h,...Array.from(o.tBodies).reduce((I,M)=>(I.push(...Array.from(M.rows)),I),[]),...c];m=b.length;const S=new Array(m);for(let I=0;I<m;I++)S[I]=new Array(u);const E=[],v=[];for(let I=0;I<m;I++){const M=b[I],T=Array.from(M.cells),P=T.length;for(let D=0;D<P;D++){const K=T[D],{nodeName:Y,innerHTML:U,rowSpan:J,colSpan:ee}=K,ae=S[I].findIndex(ne=>ne===void 0);if(Y==="TD"){if(J>1||ee>1){for(let pe=I;pe<I+J;pe++)if(pe<m)for(let Ee=ae;Ee<ae+ee;Ee++)S[pe][Ee]=null;const se=K.getAttribute("style");se&&se.includes("mso-ignore:colspan")||E.push({col:ae,row:I,rowspan:J,colspan:ee})}let ne="";s&&/excel/gi.test(s.content)?ne=U.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
54
- `):ne=U.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
55
- `),S[I][ae]=ne.replace(M7,se=>yN[se])}else v.push(U)}}return E.length&&(n.mergeCells=E),v.length&&(n.rowHeaders=v),S.length&&(n.data=S),n}function O7(t,e){RN(t,e),e.add(t)}function Ds(t,e,n){RN(t,e),e.set(t,n)}function RN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fh(t,e,n){return(e=x7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function x7(t){var e=A7(t,"string");return typeof e=="symbol"?e:e+""}function A7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ur(t,e){return t.get(cr(t,e))}function Ri(t,e,n){return t.set(cr(t,e),n),n}function cr(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")}re.getSingleton().register("afterCopyLimit"),re.getSingleton().register("modifyCopyableRange"),re.getSingleton().register("beforeCut"),re.getSingleton().register("afterCut"),re.getSingleton().register("beforePaste"),re.getSingleton().register("afterPaste"),re.getSingleton().register("beforeCopy"),re.getSingleton().register("afterCopy");const aE="copyPaste",H7=80,N7=["fragmentSelection"],EN=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var lE=new WeakMap,uE=new WeakMap,cE=new WeakMap,Au=new WeakMap,Zg=new WeakMap,Qg=new WeakMap,Hu=new WeakMap,Jg=new WeakMap,Ir=new WeakSet;class D7 extends Xe{constructor(){super(...arguments),O7(this,Ir),Fh(this,"columnsLimit",1/0),Fh(this,"rowsLimit",1/0),Fh(this,"pasteMode","overwrite"),Fh(this,"uiContainer",this.hot.rootDocument.body),Ds(this,lE,!1),Ds(this,uE,!1),Ds(this,cE,!1),Ds(this,Au,"cells-only"),Ds(this,Zg,!1),Ds(this,Qg,!1),Ds(this,Hu,new y7({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),Ds(this,Jg,!1),Fh(this,"copyableRanges",[])}static get PLUGIN_KEY(){return aE}static get SETTING_KEYS(){return[aE,...N7]}static get PLUGIN_PRIORITY(){return H7}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[aE]}enablePlugin(){var e,n,r=this;this.enabled||(this.pasteMode=(e=this.getSetting("pasteMode"))!==null&&e!==void 0?e:this.pasteMode,this.rowsLimit=isNaN(this.getSetting("rowsLimit"))?this.rowsLimit:this.getSetting("rowsLimit"),this.columnsLimit=isNaN(this.getSetting("columnsLimit"))?this.columnsLimit:this.getSetting("columnsLimit"),Ri(lE,this,this.getSetting("copyColumnHeaders")),Ri(uE,this,this.getSetting("copyColumnGroupHeaders")),Ri(cE,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=(n=this.getSetting("uiContainer"))!==null&&n!==void 0?n:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",i=>cr(Ir,this,$7).call(this,i)),this.addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return cr(Ir,r,F7).call(r,...o)}),this.addHook("afterSelectionEnd",()=>cr(Ir,this,V7).call(this)),this.eventManager.addEventListener(this.hot.rootDocument,"copy",function(){return r.onCopy(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"cut",function(){return r.onCut(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"paste",function(){return r.onPaste(...arguments)}),Af()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return cr(Ir,r,W7).call(r,...o)}),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return cr(Ir,r,B7).call(r,...o)}),this.addHook("afterSelection",()=>cr(Ir,this,j7).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";Ri(Au,this,e),Ri(Zg,this,!0),cr(Ir,this,TN).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(){Ri(Qg,this,!0),cr(Ir,this,TN).call(this,"cut")}getRangedCopyableData(e){return Dh(this.getRangedData(e))}getRangedData(e){const n=[],{rows:r,columns:i}=fN(e);return H(r,o=>{const s=[];H(i,a=>{o<0?s.push(this.hot.getColHeader(a,o)):s.push(this.hot.getCopyableData(o,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 r=new v7;e&&r.clipboardData.setData("text/plain",e),n&&r.clipboardData.setData("text/html",n),this.onPaste(r)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}ur(Hu,this).setSelectedRange(e);const n=new Map([["headers",null],["cells",null]]);ur(Au,this)==="column-headers-only"?n.set("headers",ur(Hu,this).getMostBottomColumnHeadersRange()):(ur(Au,this)==="with-column-headers"?n.set("headers",ur(Hu,this).getMostBottomColumnHeadersRange()):ur(Au,this)==="with-column-group-headers"&&n.set("headers",ur(Hu,this).getAllColumnHeadersRange()),n.set("cells",ur(Hu,this).getCellsRange())),this.copyableRanges=Array.from(n.values()).filter(i=>i!==null).map(i=>{let{startRow:o,startCol:s,endRow:a,endCol:l}=i;return{startRow:o,startCol:s,endRow:a,endCol:l}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const r=n.get("cells");if(r!==null&&r.isRangeTrimmed){const{startRow:i,startCol:o,endRow:s,endCol:a}=r;this.hot.runHooks("afterCopyLimit",s-i+1,a-o+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 r=e.length,i=e[0].length,o=[],{row:s,col:a}=n.getTopStartCorner(),{row:l,col:u}=n.getBottomEndCorner();let c=s,h=a,d=s,f=a;for(;o.length<r||c<=l;){const{skipRowOnPaste:m,visualRow:b}=this.hot.getCellMeta(c,a);if(c=b+1,m===!0)continue;d=b,h=a;const S=[],E=o.length%r;for(;S.length<i||h<=u;){const{skipColumnOnPaste:v,visualCol:I}=this.hot.getCellMeta(s,h);if(h=I+1,v===!0)continue;f=I;const M=S.length%i;S.push(e[E][M])}o.push(S)}return Ri(Jg,this,!0),this.hot.populateFromArray(s,a,o,void 0,void 0,"CopyPaste.paste",this.pasteMode),[s,a,d,f]}onCopy(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n?.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!ur(Zg,this)||this.isEditorOpened()||Do(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Rf(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),Ri(Zg,this,!1);const o=this.getRangedData(this.copyableRanges),s=cr(Ir,this,k7).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",o,this.copyableRanges,s)){const l=Dh(o);if(e&&e.clipboardData){const u=SN(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",l),e.clipboardData.setData("text/html",[EN,u].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",l);this.hot.runHooks("afterCopy",o,this.copyableRanges,s)}Ri(Au,this,"cells-only")}onCut(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n?.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!ur(Qg,this)||this.isEditorOpened()||Do(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Rf(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),Ri(Qg,this,!1);const o=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",o,this.copyableRanges)){const a=Dh(o);if(e&&e.clipboardData){const l=SN(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",a),e.clipboardData.setData("text/html",[EN,l].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",a);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",o,this.copyableRanges)}}onPaste(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n?.hasAttribute("data-hot-input");if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||Do(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Rf(n,this.hot.rootElement)))return;e.preventDefault();let o;if(e&&typeof e.clipboardData<"u"){const c=dy(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});c&&/(<table)|(<TABLE)/g.test(c)?o=P7(c,this.hot.rootDocument).data:o=e.clipboardData.getData("text/plain")}else typeof ClipboardEvent>"u"&&typeof this.hot.rootWindow.clipboardData<"u"&&(o=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof o=="string"&&(o=h7(o)),o===void 0||o&&o.length===0||this.hot.runHooks("beforePaste",o,this.copyableRanges)===!1)return;const[s,a,l,u]=this.populateValues(o);this.hot.selectCell(s,a,Math.min(this.hot.countRows()-1,l),Math.min(this.hot.countCols()-1,u)),this.hot.runHooks("afterPaste",o,this.copyableRanges)}destroy(){super.destroy()}}function TN(t){if(Af()){const e=this.hot.getSelectedRangeLast();if(e){const{row:n,col:r}=e.highlight,i=this.hot.getCell(n,r,!0);i&&Oz(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function k7(t){const{rows:e}=fN(t);let n=0;for(let r=0;r<e.length&&!(e[r]>=0);r++)n+=1;return{columnHeadersCount:n}}function L7(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:n}=t.highlight,r=this.hot.getCell(e,n,!0);r&&dx(r)}}}function _N(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:n}=t.highlight,r=this.hot.getCell(e,n,!0);r!=null&&r.hasAttribute("contenteditable")&&fx(r)}}}function $7(t){t.items.push({name:"---------"},d7(this)),ur(lE,this)&&t.items.push(m7(this)),ur(uE,this)&&t.items.push(g7(this)),ur(cE,this)&&t.items.push(f7(this)),t.items.push(p7(this))}function F7(t,e,n,r,i){ur(Jg,this)&&(i.value=!0),Ri(Jg,this,!1)}function V7(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function W7(){cr(Ir,this,_N).call(this)}function B7(){cr(Ir,this,L7).call(this)}function j7(){cr(Ir,this,_N).call(this)}function MN(t,e){return`border_row${t}col${e}`}function Vh(){return{width:1,color:"#000"}}function qo(){return{hide:!0}}function U7(){return{width:1,color:"#000",cornerVisible:!1}}function hE(t){if(ce(t.start)||ce(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(ce(t.end)||ce(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 Wh(t){return ce(t.start)&&(t.left=t.start),ce(t.end)&&(t.right=t.end),t}function dE(t,e){return{id:MN(t,e),border:U7(),row:t,col:e,top:qo(),bottom:qo(),start:qo(),end:qo()}}function z7(t,e){return on(e,"border")&&e.border&&(t.border=e.border),on(e,"top")&&ce(e.top)&&(e.top?(He(e.top)||(e.top=Vh()),t.top=e.top):(e.top=qo(),t.top=e.top)),on(e,"bottom")&&ce(e.bottom)&&(e.bottom?(He(e.bottom)||(e.bottom=Vh()),t.bottom=e.bottom):(e.bottom=qo(),t.bottom=e.bottom)),on(e,"start")&&ce(e.start)&&(e.start?(He(e.start)||(e.start=Vh()),t.start=e.start):(e.start=qo(),t.start=e.start)),on(e,"end")&&ce(e.end)&&(e.end?(He(e.end)||(e.end=Vh()),t.end=e.end):(e.end=qo(),t.end=e.end)),t}function Ko(t,e){let n=!1;return H(t.getSelectedRange(),r=>{r.forAll((i,o)=>{if(i<0||o<0)return;const s=t.getCellMeta(i,o).borders;if(s)if(e){if(!on(s[e],"hide")||s[e].hide===!1)return n=!0,!1}else return n=!0,!1})}),n}function em(t){return`<span class="selected">✓</span>${t}`}function Y7(t){return t.some(e=>ce(e.left)||ce(e.right))}function G7(t){return t.some(e=>ce(e.start)||ce(e.end))}const q7=new Map([["left","start"],["right","end"]]);function K7(t){var e;return(e=q7.get(t))!==null&&e!==void 0?e:t}function X7(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(Ab);return Ko(this,"bottom")&&(e=em(e)),e},callback(e,n){const r=Ko(this,"bottom");t.prepareBorder(n,"bottom",r)}}}function Z7(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let n=this.getTranslatedPhrase(Hb);return Ko(this,e)&&(n=em(n)),n},callback(n,r){const i=Ko(this,e);t.prepareBorder(r,e,i)}}}function Q7(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(Nb)},callback(e,n){t.prepareBorder(n,"noBorders")},disabled(){return!Ko(this)}}}function J7(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let n=this.getTranslatedPhrase(xb);return Ko(this,e)&&(n=em(n)),n},callback(n,r){const i=Ko(this,e);t.prepareBorder(r,e,i)}}}function e5(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(Ob);return Ko(this,"top")&&(e=em(e)),e},callback(e,n){const r=Ko(this,"top");t.prepareBorder(n,"top",r)}}}function t5(t,e,n){return(e=n5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n5(t){var e=r5(t,"string");return typeof e=="symbol"?e:e+""}function r5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Xo extends PH{constructor(e,n){super(e,null),t5(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:r}=e,i=this.getNearestNotHiddenCoords(n,1),o=this.getNearestNotHiddenCoords(r,-1);return i===null||o===null?null:((i.row>o.row||i.col>o.col)&&(i=n,o=r),this.settings.createCellRange(i,i,o))}getNearestNotHiddenCoords(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n;const i=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,n);if(i===null)return null;const o=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,r);return o===null?null:this.settings.createCellCoords(i,o)}getNearestNotHiddenIndex(e,n,r){return n<0?n:e.getNearestNotHiddenIndex(n,r)}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(),r=e.getVerticalDirection()==="N-S"?1:-1,i=e.getHorizontalDirection()==="W-E"?1:-1,o=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let s=null;if((o===null||o.col===null||o.row===null)&&(s=this.getNearestNotHiddenCoords(n,r,i)),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"&&o!==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 r=this.settings.visualToRenderableCoords(e),i=this.settings.visualToRenderableCoords(n);return r.row===null||r.col===null||i.row===null||i.col===null?null:this.settings.createCellRange(r,r,i)}}function fE(t){let{activeHeaderClassName:e,...n}=t;return new Xo({className:e,...n,selectionType:OH})}function i5(t){let{areaCornerVisible:e,...n}=t;return new Xo({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...n,selectionType:oR})}function o5(t){let{...e}=t;return new Xo({className:"highlight",...e,selectionType:oR})}function s5(t){let{columnClassName:e,...n}=t;return new Xo({className:e,...n,selectionType:_X})}function a5(t){let{cellCornerVisible:e,...n}=t;return new Xo({className:"current",headerAttributes:[my()],border:{width:2,color:"#4b89ff",cornerVisible:e},...n,selectionType:oh})}function l5(t){let{border:e,visualCellRange:n,...r}=t;return new Xo({...e,...r,selectionType:MX},n)}function u5(t){let{...e}=t;return new Xo({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:EX})}function IN(t){let{headerClassName:e,...n}=t;return new Xo({className:e,...n,selectionType:iR})}function c5(t){let{rowClassName:e,...n}=t;return new Xo({className:e,...n,selectionType:TX})}function h5(t,e){d5(t,e),e.add(t)}function d5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hr(t,e,n){return(e=f5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f5(t){var e=g5(t,"string");return typeof e=="symbol"?e:e+""}function g5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zo(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 ro=new WeakSet;class m5{constructor(e){h5(this,ro),hr(this,"options",void 0),hr(this,"layerLevel",0),hr(this,"focus",void 0),hr(this,"fill",void 0),hr(this,"layeredAreas",new Map),hr(this,"areas",new Map),hr(this,"rowHeaders",new Map),hr(this,"columnHeaders",new Map),hr(this,"activeRowHeaders",new Map),hr(this,"activeColumnHeaders",new Map),hr(this,"activeCornerHeaders",new Map),hr(this,"rowHighlights",new Map),hr(this,"columnHighlights",new Map),hr(this,"customSelections",[]),this.options=e,this.focus=a5(e),this.fill=u5(e)}isEnabledFor(e,n){let r=e;e===oh&&(r="current");let i=this.options.disabledCellSelection(n.row,n.col);return typeof i=="string"&&(i=[i]),i===!1||Array.isArray(i)&&!i.includes(r)}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 Zo(ro,this,Qo).call(this,this.layeredAreas,i5)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return Zo(ro,this,Qo).call(this,this.areas,o5)}getAreas(){return[...this.areas.values()]}createRowHeader(){return Zo(ro,this,Qo).call(this,this.rowHeaders,IN)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return Zo(ro,this,Qo).call(this,this.columnHeaders,IN)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return Zo(ro,this,Qo).call(this,this.activeRowHeaders,fE)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return Zo(ro,this,Qo).call(this,this.activeColumnHeaders,fE)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return Zo(ro,this,Qo).call(this,this.activeCornerHeaders,fE)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return Zo(ro,this,Qo).call(this,this.rowHighlights,c5)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return Zo(ro,this,Qo).call(this,this.columnHighlights,s5)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(l5({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),H(this.areas.values(),e=>{e.clear()}),H(this.layeredAreas.values(),e=>{e.clear()}),H(this.rowHeaders.values(),e=>{e.clear()}),H(this.columnHeaders.values(),e=>{e.clear()}),H(this.activeRowHeaders.values(),e=>{e.clear()}),H(this.activeColumnHeaders.values(),e=>{e.clear()}),H(this.activeCornerHeaders.values(),e=>{e.clear()}),H(this.rowHighlights.values(),e=>{e.clear()}),H(this.columnHighlights.values(),e=>{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 Qo(t,e){const n=this.layerLevel;if(t.has(n))return t.get(n);const r=e({layerLevel:n,...this.options});return t.set(n,r),r}function PN(t,e,n){return(e=p5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p5(t){var e=w5(t,"string");return typeof e=="symbol"?e:e+""}function w5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class v5{constructor(e){PN(this,"ranges",[]),PN(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&&e<this.size()&&(n=this.ranges[e]),n}[Symbol.iterator](){return this.ranges[Symbol.iterator]()}}function C5(t,e){ON(t,e),e.add(t)}function gE(t,e,n){ON(t,e),e.set(t,n)}function ON(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qe(t,e){return t.get(un(t,e))}function tm(t,e,n){return t.set(un(t,e),n),n}function un(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 nm=new WeakMap,yt=new WeakMap,Ei=new WeakMap,gn=new WeakSet;class mE{constructor(e,n){C5(this,gn),gE(this,nm,void 0),gE(this,yt,void 0),gE(this,Ei,{x:0,y:0}),tm(nm,this,e),tm(yt,this,n)}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=qe(yt,this).createCellCoords(e,n);let o=qe(nm,this).current().highlight;const s=qe(yt,this).visualToRenderableCoords(o);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),s.row!==null&&s.col!==null){const{width:u,height:c}=un(gn,this,AN).call(this),{row:h,col:d}=un(gn,this,HN).call(this,o),f=qe(yt,this).fixedRowsBottom(),m=qe(yt,this).minSpareRows(),b=qe(yt,this).minSpareCols(),S=qe(yt,this).autoWrapRow(),E=qe(yt,this).autoWrapCol(),v=qe(yt,this).createCellCoords(h+i.row,d+i.col);if(v.row>=c){const T=br(r&&m>0&&f===0),P=v.col+1,D=qe(yt,this).createCellCoords(v.row-c,P>=u?P-u:P);this.runLocalHooks("beforeColumnWrap",T,un(gn,this,Nu).call(this,D),P>=u),T.value?this.runLocalHooks("insertRowRequire",qe(yt,this).countRenderableRows()):E&&v.assign(D)}else if(v.row<0){const T=br(E),P=v.col-1,D=qe(yt,this).createCellCoords(c+v.row,P<0?u+P:P);this.runLocalHooks("beforeColumnWrap",T,un(gn,this,Nu).call(this,D),P<0),E&&v.assign(D)}if(v.col>=u){const T=br(r&&b>0),P=v.row+1,D=qe(yt,this).createCellCoords(P>=c?P-c:P,v.col-u);this.runLocalHooks("beforeRowWrap",T,un(gn,this,Nu).call(this,D),P>=c),T.value?this.runLocalHooks("insertColRequire",qe(yt,this).countRenderableColumns()):S&&v.assign(D)}else if(v.col<0){const T=br(S),P=v.row-1,D=qe(yt,this).createCellCoords(P<0?c+P:P,u+v.col);this.runLocalHooks("beforeRowWrap",T,un(gn,this,Nu).call(this,D),P<0),S&&v.assign(D)}const{rowDir:I,colDir:M}=un(gn,this,xN).call(this,v);a=I,l=M,o=un(gn,this,Nu).call(this,v)}return this.runLocalHooks("afterTransformStart",o,a,l),o}transformEnd(e,n){const r=qe(yt,this).createCellCoords(e,n),i=qe(nm,this).current(),o=qe(yt,this).visualToRenderableCoords(i.highlight),s=un(gn,this,pE).call(this,i.to.row,i.from.row),a=un(gn,this,wE).call(this,i.to.col,i.from.col),l=i.to.clone();let u=0,c=0;if(this.runLocalHooks("beforeTransformEnd",r),o.row!==null&&o.col!==null&&s!==null&&a!==null){const{row:h,col:d}=un(gn,this,HN).call(this,i.highlight),f=qe(yt,this).createCellCoords(s+r.row,a+r.col),m=i.getTopStartCorner(),b=i.getTopEndCorner(),S=i.getBottomEndCorner();if(r.col<0&&a>=d&&f.col<d){const M=f.col-d;f.col=un(gn,this,wE).call(this,m.col,b.col)+M}else if(r.col>0&&a<=d&&f.col>d){const M=un(gn,this,wE).call(this,b.col,m.col),T=Math.max(f.col-M,1);f.col=M+T}if(r.row<0&&s>=h&&f.row<h){const M=f.row-h;f.row=un(gn,this,pE).call(this,m.row,S.row)+M}else if(r.row>0&&s<=h&&f.row>h){const M=un(gn,this,pE).call(this,S.row,m.row),T=Math.max(f.row-M,1);f.row=M+T}const{rowDir:E,colDir:v}=un(gn,this,xN).call(this,f);u=E,c=v;const I=un(gn,this,Nu).call(this,f);r.row===0&&r.col!==0?l.col=I.col:r.row!==0&&r.col===0?l.row=I.row:(l.row=I.row,l.col=I.col)}return this.runLocalHooks("afterTransformEnd",l,u,c),l}setOffsetSize(e){let{x:n,y:r}=e;tm(Ei,this,{x:n,y:r})}resetOffsetSize(){tm(Ei,this,{x:0,y:0})}}function xN(t){const{width:e,height:n}=un(gn,this,AN).call(this);let r=0,i=0;return t.row<0?(r=-1,t.row=0):t.row>0&&t.row>=n&&(r=1,t.row=n-1),t.col<0?(i=-1,t.col=0):t.col>0&&t.col>=e&&(i=1,t.col=e-1),{rowDir:r,colDir:i}}function AN(){return{width:qe(Ei,this).x+qe(yt,this).countRenderableColumns(),height:qe(Ei,this).y+qe(yt,this).countRenderableRows()}}function pE(t,e){const n=qe(yt,this).findFirstNonHiddenRenderableRow(t,e);return n===null?null:qe(Ei,this).y+n}function wE(t,e){const n=qe(yt,this).findFirstNonHiddenRenderableColumn(t,e);return n===null?null:qe(Ei,this).x+n}function HN(t){const{row:e,col:n}=qe(yt,this).visualToRenderableCoords(t);if(e===null||n===null)throw new Error("Renderable coords are not visible.");return qe(yt,this).createCellCoords(qe(Ei,this).y+e,qe(Ei,this).x+n)}function Nu(t){const e=t.clone();return e.col=t.col-qe(Ei,this).x,e.row=t.row-qe(Ei,this).y,qe(yt,this).renderableToVisualCoords(e)}ct(mE,Mn);function Du(t,e,n){y5(t,e),e.set(t,n)}function y5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xa(t,e,n){return(e=b5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function b5(t){var e=S5(t,"string");return typeof e=="symbol"?e:e+""}function S5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _t(t,e){return t.get(NN(t,e))}function io(t,e,n){return t.set(NN(t,e),n),n}function NN(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 Hn=new WeakMap,Za=new WeakMap,rm=new WeakMap,Bh=new WeakMap,im=new WeakMap,jh=new WeakMap;class DN{constructor(e,n){var r=this;Xa(this,"settings",void 0),Xa(this,"tableProps",void 0),Xa(this,"inProgress",!1),Xa(this,"selectedRange",new v5((i,o,s)=>this.tableProps.createCellRange(i,o,s))),Xa(this,"highlight",void 0),Du(this,Hn,void 0),Du(this,Za,void 0),Xa(this,"selectedByRowHeader",new Set),Xa(this,"selectedByColumnHeader",new Set),Du(this,rm,!1),Du(this,Bh,!1),Du(this,im,"unknown"),Du(this,jh,-1),this.settings=e,this.tableProps=n,this.highlight=new m5({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[my()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(i,o)=>this.tableProps.isDisabledCellSelection(i,o),cellCornerVisible:function(){return r.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return r.isAreaCornerVisible(...arguments)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),createCellRange:(i,o,s)=>this.tableProps.createCellRange(i,o,s)}),io(Hn,this,new mE(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>this.tableProps.countRenderableRows(),countRenderableColumns:()=>this.tableProps.countRenderableColumns(),visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return r.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return r.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),io(Za,this,new mE(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableRowsInRange(0,i.getOuterBottomEndCorner().row)},countRenderableColumns:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableColumnsInRange(0,i.getOuterBottomEndCorner().col)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return r.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return r.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),_t(Hn,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformStart",...o)}),_t(Hn,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformStart",...o)}),_t(Hn,this).addLocalHook("beforeTransformEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformEnd",...o)}),_t(Hn,this).addLocalHook("afterTransformEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformEnd",...o)}),_t(Hn,this).addLocalHook("insertRowRequire",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("insertRowRequire",...o)}),_t(Hn,this).addLocalHook("insertColRequire",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("insertColRequire",...o)}),_t(Hn,this).addLocalHook("beforeRowWrap",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeRowWrap",...o)}),_t(Hn,this).addLocalHook("beforeColumnWrap",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeColumnWrap",...o)}),_t(Za,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformFocus",...o)}),_t(Za,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformFocus",...o)})}getSelectedRange(){return this.selectedRange}markSource(e){io(im,this,e)}markEndSource(){io(im,this,"unknown")}getSelectionSource(){return _t(im,this)}setExpectedLayers(e){io(jh,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,io(jh,this,-1)}isInProgress(){return this.inProgress}setRangeStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e;const o=this.settings.selectionMode==="multiple",s=At(n)?this.tableProps.getShortcutManager().isCtrlPressed():n,a=e.clone();io(rm,this,!1),this.runLocalHooks(`beforeSetRangeStart${r?"Only":""}`,a),(!o||o&&!s&&At(n))&&this.selectedRange.clear(),this.selectedRange.add(a).current().setHighlight(i.clone()),this.getLayerLevel()===0&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),r||this.setRangeEnd(e)}setRangeStartOnly(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.setRangeStart(e,n,!0,r)}setRangeEnd(e){if(this.selectedRange.isEmpty())return;const n=e.clone(),r=this.tableProps.countRows(),i=this.tableProps.countCols(),o=this.selectedRange.current().clone().setTo(e).isSingleHeader();if((r>0||i>0)&&(r===0&&n.col<0&&!o||i===0&&n.row<0&&!o))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(),u=s.getVerticalDirection(),c=this.isMultiple();s.setTo(n),c&&(l!==s.getHorizontalDirection()||s.getWidth()===1&&!s.includes(s.highlight))&&s.from.assign({col:s.highlight.col}),c&&(u!==s.getVerticalDirection()||s.getHeight()===1&&!s.includes(s.highlight))&&s.from.assign({row:s.highlight.row})}r>0&&i>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=_t(jh,this)===-1||this.selectedRange.size()===_t(jh,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 r=this.tableProps.countRows(),i=this.tableProps.countCols();n<this.highlight.layerLevel&&(H(this.highlight.getAreas(),m=>{m.clear()}),H(this.highlight.getLayeredAreas(),m=>{m.clear()}),H(this.highlight.getRowHeaders(),m=>{m.clear()}),H(this.highlight.getColumnHeaders(),m=>{m.clear()}),H(this.highlight.getActiveRowHeaders(),m=>{m.clear()}),H(this.highlight.getActiveColumnHeaders(),m=>{m.clear()}),H(this.highlight.getActiveCornerHeaders(),m=>{m.clear()}),H(this.highlight.getRowHighlights(),m=>{m.clear()}),H(this.highlight.getColumnHighlights(),m=>{m.clear()})),this.highlight.useLayerLevel(n);const o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();if(o.clear(),s.clear(),a.clear(),l.clear(),u.clear(),c.clear(),h.clear(),d.clear(),f.clear(),this.highlight.isEnabledFor(oR,e.highlight)&&(this.isMultiple()||n>=1)&&(o.add(e.from).add(e.to).commit(),s.add(e.from).add(e.to).commit(),n===1)){const m=this.selectedRange.previous();this.highlight.useLayerLevel(n-1),this.highlight.createArea().add(m.from).commit().syncWith(m),this.highlight.createLayeredArea().add(m.from).commit().syncWith(m),this.highlight.useLayerLevel(n)}if(this.highlight.isEnabledFor(iR,e.highlight)){if(!e.isSingleHeader()){const S=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),E=this.tableProps.createCellCoords(e.to.row,-1),v=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),I=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(a.add(S).commit(),l.add(v).commit(),d.add(S).commit(),f.add(v).commit()):(a.add(S).add(E).commit(),l.add(v).add(I).commit(),d.add(S).add(E).commit(),f.add(v).add(I).commit())}const m=!_t(Bh,this)&&this.isEntireRowSelected()&&(i>0&&i===e.getWidth()||i===0&&this.isSelectedByRowHeader()),b=!_t(Bh,this)&&this.isEntireColumnSelected()&&(r>0&&r===e.getHeight()||r===0&&this.isSelectedByColumnHeader());m&&u.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(),b&&c.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(),m&&b&&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 r=this.highlight.getFocus();r.clear(),n.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(oh,n.highlight)&&r.add(n.highlight).commit().syncWith(n),this.inProgress||(io(rm,this,!0),this.runLocalHooks("afterSetFocus",n.highlight))}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.settings.navigableHeaders?_t(Hn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):_t(Hn,this).resetOffsetSize(),this.setRangeStart(_t(Hn,this).transformStart(e,n,r))}transformEnd(e,n){this.settings.navigableHeaders?_t(Hn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):_t(Hn,this).resetOffsetSize(),this.setRangeEnd(_t(Hn,this).transformEnd(e,n))}transformFocus(e,n){const r=this.selectedRange.current(),{row:i,col:o}=r.getOuterTopStartCorner(),s=this.tableProps.countRenderableColumnsInRange(0,o-1),a=this.tableProps.countRenderableRowsInRange(0,i-1);r.highlight.isHeader()?_t(Za,this).setOffsetSize({x:o<0?Math.abs(o):-s,y:i<0?Math.abs(i):-a}):_t(Za,this).setOffsetSize({x:o<0?0:-s,y:i<0?0:-a});const l=_t(Za,this).transformStart(e,n);this.setRangeFocus(l.normalize())}shiftRows(e,n){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||r.getOuterTopStartCorner().row>=e){const{from:i,to:o,highlight:s}=r,a=this.tableProps.countRows(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=u?-1:0,h=u?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(ze(i.row+h,c,a-1),i.col),f=this.tableProps.createCellCoords(ze(o.row+n,c,a-1),o.col);this.markSource("shift"),s.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(ze(s.row+n,0,a-1),s.col)):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}shiftColumns(e,n){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||r.getOuterTopStartCorner().col>=e){const{from:i,to:o,highlight:s}=r,a=this.tableProps.countCols(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=l?-1:0,h=l?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(i.row,ze(i.col+h,c,a-1)),f=this.tableProps.createCellCoords(o.row,ze(o.col+n,c,a-1));this.markSource("shift"),s.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(s.row,ze(s.col+n,0,a-1))):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&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=br(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&_t(rm,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=i=>{const{col:o}=i.getOuterTopStartCorner(),s=this.tableProps.countRowHeaders(),a=this.tableProps.countCols();return(s>0&&o<0||s===0)&&i.getWidth()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>n(i));const r=this.selectedRange.peekByIndex(e);return r?n(r):!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=i=>{const{row:o}=i.getOuterTopStartCorner(),s=this.tableProps.countColHeaders(),a=this.tableProps.countRows();return(s>0&&o<0||s===0)&&i.getHeight()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>n(i));const r=this.selectedRange.peekByIndex(e);return r?n(r):!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,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1};const o=this.tableProps.countRows(),s=this.tableProps.countCols(),a=this.tableProps.countRowHeaders(),l=this.tableProps.countColHeaders(),u=r?-l:0,c=n?-a:0;if(u===0&&c===0&&(o===0||s===0))return;let h=(e=this.getSelectedRange().current())===null||e===void 0?void 0:e.highlight;const{focusPosition:d,disableHeadersHighlight:f}=i;io(Bh,this,f),d&&Number.isInteger(d?.row)&&Number.isInteger(d?.col)&&(h=this.tableProps.createCellCoords(ze(d.row,u,o-1),ze(d.col,c,s-1)));const m=this.tableProps.createCellCoords(u,c),b=this.tableProps.createCellCoords(o-1,s-1);this.clear(),this.setRangeStartOnly(m,void 0,h),c<0&&this.selectedByRowHeader.add(this.getLayerLevel()),u<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(b),this.finish(),io(Bh,this,!1)}selectCells(e){var n=this;const r=Tu(e);if(r===Dg)return!1;if(r===Ng)throw new Error(tt`Unsupported format of the selection ranges was passed. To select cells pass\x20
56
- the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
57
- columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const i=_h(r,{createCellCoords:function(){return n.tableProps.createCellCoords(...arguments)},createCellRange:function(){return n.tableProps.createCellRange(...arguments)},propToCol:l=>this.tableProps.propToCol(l),keepDirection:!0}),o=this.settings.navigableHeaders,s={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:o?this.tableProps.countRowHeaders():0,countColHeaders:o?this.tableProps.countColHeaders():0},a=!e.some(l=>{const u=i(l),c=u.isValid(s);return!(c&&!u.containsHeaders()||c&&u.containsHeaders()&&u.isSingleHeader())});return a&&(this.clear(),this.setExpectedLayers(e.length),H(e,l=>{const{from:u,to:c}=i(l);this.setRangeStartOnly(u.clone(),!1),this.setRangeEnd(c.clone())}),this.finish()),a}selectColumns(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=typeof e=="string"?this.tableProps.propToCol(e):e,o=typeof n=="string"?this.tableProps.propToCol(n):n,s=this.tableProps.countRows(),a=this.tableProps.countCols(),l=this.tableProps.countColHeaders(),u=l===0?0:-l,c=this.tableProps.createCellCoords(u,i),h=this.tableProps.createCellCoords(s-1,o),d=this.tableProps.createCellRange(c,c,h).isValid({countRows:s,countCols:a,countRowHeaders:0,countColHeaders:l});if(d){let f=0,m=0;Number.isInteger(r?.row)&&Number.isInteger(r?.col)?(f=ze(r.row,u,s-1),m=ze(r.col,Math.min(i,o),Math.max(i,o))):(f=ze(r,u,s-1),m=i);const b=this.tableProps.createCellCoords(f,m),S=l===0?0:ze(b.row,u,-1),E=s-1,v=this.tableProps.createCellCoords(S,i),I=this.tableProps.createCellCoords(E,o);this.runLocalHooks("beforeSelectColumns",v,I,b),v.row=S,I.row=E,this.setRangeStartOnly(v,void 0,b),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(I),this.runLocalHooks("afterSelectColumns",v,I,b),this.finish()}return d}selectRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=this.tableProps.countRows(),o=this.tableProps.countCols(),s=this.tableProps.countRowHeaders(),a=s===0?0:-s,l=this.tableProps.createCellCoords(e,a),u=this.tableProps.createCellCoords(n,o-1),c=this.tableProps.createCellRange(l,l,u).isValid({countRows:i,countCols:o,countRowHeaders:s,countColHeaders:0});if(c){let h=0,d=0;Number.isInteger(r?.row)&&Number.isInteger(r?.col)?(h=ze(r.row,Math.min(e,n),Math.max(e,n)),d=ze(r.col,a,o-1)):(h=e,d=ze(r,a,o-1));const f=this.tableProps.createCellCoords(h,d),m=s===0?0:ze(f.col,a,-1),b=o-1,S=this.tableProps.createCellCoords(e,m),E=this.tableProps.createCellCoords(n,b);this.runLocalHooks("beforeSelectRows",S,E,f),S.col=m,E.col=b,this.setRangeStartOnly(S,void 0,f),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(E),this.runLocalHooks("afterSelectRows",S,E,f),this.finish()}return c}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),n=this.tableProps.countCols();if(e===0||n===0){this.deselect();return}const r=this.selectedRange.peekByIndex(this.selectedRange.size()-1),{from:i,to:o,highlight:s}=r;this.clear(),s.assign({row:ze(s.row,-1/0,e-1),col:ze(s.col,-1/0,n-1)}),i.assign({row:ze(i.row,-1/0,e-1),col:ze(i.col,-1/0,n-1)}),o.assign({row:ze(o.row,0,e-1),col:ze(o.col,0,n-1)}),this.selectedRange.ranges.push(r),this.highlight.isEnabledFor(oh,this.selectedRange.current().highlight)&&this.highlight.getFocus().add(s).commit().syncWith(r),this.applyAndCommit(r)}commit(){if(this.highlight.getCustomSelections().forEach(i=>{i.commit()}),!this.isSelected())return;const n=this.getLayerLevel(),r=this.selectedRange.current();this.highlight.isEnabledFor(oh,r.highlight)&&this.highlight.getFocus().commit().syncWith(r);for(let i=0;i<this.selectedRange.size();i+=1){this.highlight.useLayerLevel(i);const o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();o.commit(),s.commit(),a.commit(),l.commit(),u.commit(),c.commit(),h.commit(),d.commit(),f.commit()}this.highlight.useLayerLevel(n)}}ct(DN,Mn);function kN(t){let{isShiftKey:e,isLeftClick:n,isRightClick:r,coords:i,selection:o,controller:s,cellCoordsFactory:a}=t;const l=o.isSelected()?o.getSelectedRange().current():null,u=o.isSelectedByCorner(),c=o.isSelectedByRowHeader();if(o.markSource("mouse"),e&&l)i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(i):(u||c)&&i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(a(i.row,i.col)):u&&i.row<0&&!s.column?o.setRangeEnd(a(l.to.row,i.col)):c&&i.col<0&&!s.row?o.setRangeEnd(a(i.row,l.to.col)):(!u&&!c&&i.col<0||u&&i.col<0)&&!s.row?o.selectRows(Math.max(l.from.row,0),i.row,i.col):(!u&&!c&&i.row<0||c&&i.row<0)&&!s.column&&o.selectColumns(Math.max(l.from.col,0),i.col,i.row);else{const h=!o.inInSelection(i),d=n||r&&h;i.row<0&&i.col>=0&&!s.column?d&&o.selectColumns(i.col,i.col,i.row):i.col<0&&i.row>=0&&!s.row?d&&o.selectRows(i.row,i.row,i.col):i.col>=0&&i.row>=0&&!s.cell?d&&o.setRangeStart(i):i.col<0&&i.row<0&&o.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}o.markEndSource()}function R5(t){let{isLeftClick:e,coords:n,selection:r,controller:i,cellCoordsFactory:o}=t;if(!e)return;const s=r.isSelectedByRowHeader(),a=r.isSelectedByColumnHeader(),l=r.tableProps.countCols(),u=r.tableProps.countRows();r.markSource("mouse"),a&&!i.column?r.setRangeEnd(o(u-1,n.col)):s&&!i.row?r.setRangeEnd(o(n.row,l-1)):i.cell||r.setRangeEnd(n),r.markEndSource()}const E5=new Map([["mousedown",kN],["mouseover",R5],["touchstart",kN]]);function LN(t,e){let{coords:n,selection:r,controller:i,cellCoordsFactory:o}=e;E5.get(t.type)({coords:n,selection:r,controller:i,cellCoordsFactory:o,isShiftKey:t.shiftKey,isLeftClick:yy(t)||t.type==="touchstart",isRightClick:Sa(t)})}function T5(t,e){_5(t,e),e.add(t)}function _5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function M5(t,e,n){return(e=I5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function I5(t){var e=P5(t,"string");return typeof e=="symbol"?e:e+""}function P5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $N(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 om="customBorders",O5=90;var vE=new WeakSet;class x5 extends Xe{constructor(){super(...arguments),T5(this,vE),M5(this,"savedBorders",[])}static get PLUGIN_KEY(){return om}static get PLUGIN_PRIORITY(){return O5}isEnabled(){return!!this.hot.getSettings()[om]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>$N(vE,this,A5).call(this,e)),this.addHook("init",()=>$N(vE,this,H5).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,n){let r=["top","bottom","start","end"],i=null;n&&(this.checkSettingsCohesion([n]),r=Object.keys(n),i=hE(n));const o=Tu(e),s=_h(o,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});H(e,a=>{s(a).forAll((l,u)=>{H(r,c=>{this.prepareBorderFromCustomAdded(l,u,i,K7(c))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const n=Tu(e),r=_h(n,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return H(e,o=>{r(o).forAll((s,a)=>{H(this.savedBorders,l=>{l.row===s&&l.col===a&&i.push(Wh(l))})})}),i}clearBorders(e){e?this.setBorders(e):(H(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 i=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,i,n)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:i})}prepareBorderFromCustomAdded(e,n,r,i){const o=this.hot.countRows(),s=this.hot.countCols();if(e>=o||n>=s)return;let a=dE(e,n);r&&(a=z7(a,r),H(this.hot.selection.highlight.customSelections,l=>{if(a.id===l.settings.id)return Object.assign(l.settings,r),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",Wh(a)),this.insertBorderIntoSettings(a,i)}prepareBorderFromCustomAddedRange(e,n){const r=Math.min(e.to.row,this.hot.countRows()-1),i=Math.min(e.to.col,this.hot.countCols()-1);fe(e.from.row,r,o=>{fe(e.from.col,i,s=>{const a=dE(o,s);let l=0;o===e.from.row&&on(n,"top")&&(l+=1,a.top=n.top),o===e.to.row&&on(n,"bottom")&&(l+=1,a.bottom=n.bottom),s===e.from.col&&on(n,"start")&&(l+=1,a.start=n.start),s===e.to.col&&on(n,"end")&&(l+=1,a.end=n.end),l>0&&(this.hot.setCellMeta(o,s,"borders",Wh(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,n){const r=MN(e,n);this.spliceBorder(r),this.clearBordersFromSelectionSettings(r),this.clearNullCellRange(),this.hot.removeCellMeta(e,n,"borders")}setBorder(e,n,r,i){let o=this.hot.getCellMeta(e,n).borders;!o||o.border===void 0?o=dE(e,n):o=hE(o),i?(o[r]=qo(),this.countHide(o)===4?this.removeAllBorders(e,n):(this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",Wh(o)))):(o[r]=Vh(),this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",Wh(o)))}prepareBorder(e,n,r){H(e,i=>{let{start:o,end:s}=i;if(o.row===s.row&&o.col===s.col)n==="noBorders"?this.removeAllBorders(o.row,o.col):this.setBorder(o.row,o.col,n,r);else switch(n){case"noBorders":fe(o.col,s.col,a=>{fe(o.row,s.row,l=>{this.removeAllBorders(l,a)})});break;case"top":fe(o.col,s.col,a=>{this.setBorder(o.row,a,n,r)});break;case"bottom":fe(o.col,s.col,a=>{this.setBorder(s.row,a,n,r)});break;case"start":fe(o.row,s.row,a=>{this.setBorder(a,o.col,n,r)});break;case"end":fe(o.row,s.row,a=>{this.setBorder(a,s.col,n,r)});break}})}createCustomBorders(e){H(e,n=>{const r=hE(n);n.range?this.prepareBorderFromCustomAddedRange(n.range,r):this.prepareBorderFromCustomAdded(n.row,n.col,r)})}countHide(e){const{top:n,bottom:r,start:i,end:o}=e;return tr([n,r,i,o],(a,l)=>{let u=a;return l&&l.hide&&(u+=1),u},0)}clearBordersFromSelectionSettings(e){const n=je(this.hot.selection.highlight.customSelections,r=>r.settings.id).indexOf(e);n>-1&&this.hot.selection.highlight.customSelections[n].clear()}clearNullCellRange(){H(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(){H(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const n=je(this.savedBorders,r=>r.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):H(this.savedBorders,(i,o)=>{if(e.id===i.id)return this.savedBorders[o]=e,n=!0,!1}),n}checkCustomSelectionsFromContextMenu(e,n,r){let i=!1;return H(this.hot.selection.highlight.customSelections,o=>{if(e.id===o.settings.id){const s=this.hot.view._wt.selectionManager.getBorderInstances(o);return H(s,a=>{a.toggleHiddenClass(n,r)}),i=!0,!1}}),i}checkCustomSelections(e,n,r){const i=this.countHide(e);let o=!1;return i===4?(this.removeAllBorders(e.row,e.col),o=!0):H(this.hot.selection.highlight.customSelections,s=>{if(e.id===s.settings.id){if(s.visualCellRange=n,s.commit(),r){const a=this.hot.view._wt.selectionManager.getBorderInstances(s);H(a,l=>{l.changeBorderStyle(r,e)})}return o=!0,!1}}),o}changeBorderSettings(){const e=this.hot.getSettings()[om];if(Array.isArray(e)){const n=Fn(e);this.checkSettingsCohesion(n),n.length||(this.savedBorders=n),this.createCustomBorders(n)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const n=Y7(e),r=G7(e);if(n&&r)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 A5(t){this.hot.getSettings()[om]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(Pb)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[e5(this),J7(this),X7(this),Z7(this),Q7(this)]}})}function H5(){this.changeBorderSettings()}function N5(t,e){D5(t,e),e.add(t)}function D5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function CE(t,e,n){return(e=k5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k5(t){var e=L5(t,"string");return typeof e=="symbol"?e:e+""}function L5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function FN(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 VN="dragToScroll",$5=100;var yE=new WeakSet;class F5 extends Xe{constructor(){super(...arguments),N5(this,yE),CE(this,"boundaries",null),CE(this,"callback",null),CE(this,"listening",!1)}static get PLUGIN_KEY(){return VN}static get PLUGIN_PRIORITY(){return $5}isEnabled(){return!!this.hot.getSettings()[VN]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>FN(yE,this,WN).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>FN(yE,this,WN).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 r=0,i=0;n<this.boundaries.top?i=n-this.boundaries.top:n>this.boundaries.bottom&&(i=n-this.boundaries.bottom),e<this.boundaries.left?r=e-this.boundaries.left:e>this.boundaries.right&&(r=e-this.boundaries.right),this.callback(r,i)}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",r=>this.onMouseMove(r)),n=zl(n)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function WN(t){if(Sa(t))return;const e=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(e!==this.hot.rootWindow?e.getBoundingClientRect():void 0),this.setCallback((n,r)=>{var i,o;const s=(i=e.scrollLeft)!==null&&i!==void 0?i:e.scrollX,a=(o=e.scrollTop)!==null&&o!==void 0?o:e.scrollY;e.scroll(s+Math.sign(n)*50,a+Math.sign(r)*20)}),this.listen()}function V5(t,e){BN(t,e),e.add(t)}function W5(t,e,n){BN(t,e),e.set(t,n)}function BN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bE(t,e,n){return(e=B5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function B5(t){var e=j5(t,"string");return typeof e=="symbol"?e:e+""}function j5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function U5(t,e){return t.get(Qr(t,e))}function jN(t,e,n){return t.set(Qr(t,e),n),n}function Qr(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")}re.getSingleton().register("afterDropdownMenuDefaultOptions"),re.getSingleton().register("beforeDropdownMenuShow"),re.getSingleton().register("afterDropdownMenuShow"),re.getSingleton().register("afterDropdownMenuHide"),re.getSingleton().register("afterDropdownMenuExecute");const sm="dropdownMenu",z5=230,Uh="changeType",SE=sm;var am=new WeakMap,Ti=new WeakSet;class lm extends Xe{static get PLUGIN_KEY(){return sm}static get PLUGIN_PRIORITY(){return z5}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Rh,Eh,ke,Mh,ke,Ag,ke,Th,ke,Zr]}constructor(e){super(e),V5(this,Ti),bE(this,"commandExecutor",new J1(this.hot)),bE(this,"itemsFactory",null),bE(this,"menu",null),W5(this,am,!1),this.hot.addHook("afterGetColHeader",(n,r)=>Qr(Ti,this,G5).call(this,n,r))}isEnabled(){return this.hot.getSettings()[sm]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new eN(this.hot,lm.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Qr(Ti,e,J5).call(e,...o)}),this.addHook("beforeViewportScrollHorizontally",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Qr(Ti,e,Q5).call(e,...o)});const n=this.hot.getSettings()[sm],r={items:this.itemsFactory.getItems(n)};this.registerEvents(),typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.registerShortcuts(),super.enablePlugin(),this.callOnPluginsReady(()=>{this.hot.runHooks("afterDropdownMenuDefaultOptions",r),this.itemsFactory.setPredefinedItems(r.items);const i=this.itemsFactory.getItems(n);this.menu&&this.menu.destroy(),this.menu=new Iu(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",i),this.menu.setMenuItems(i),this.menu.addLocalHook("beforeOpen",()=>Qr(Ti,this,q5).call(this)),this.menu.addLocalHook("afterOpen",()=>Qr(Ti,this,K5).call(this)),this.menu.addLocalHook("afterSubmenuOpen",o=>Qr(Ti,this,X5).call(this,o)),this.menu.addLocalHook("afterClose",()=>Qr(Ti,this,Z5).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return e.executeCommand.call(e,...s)}),H(i,o=>this.commandExecutor.registerCommand(o.key,o))})}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:r}=this.hot.getSelectedRangeLast();if((r.isHeader()&&r.row===-1||r.isCell())&&r.col>=0){this.hot.selectColumns(r.col,r.col,-1);const{from:i}=this.hot.getSelectedRangeLast(),o=xg(this.menu.container,this.hot.rootDocument),s=this.hot.getCell(-1,i.col,!0).querySelector(`.${Uh}`),a=s.getBoundingClientRect();this.open({left:a.left+o.left,top:a.top+s.offsetHeight+o.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 r;const i=(r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:SE},{keys:[["Shift","Alt","ArrowDown"]],callback:n,runOnlyIf:()=>{var r;const i=(r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isCell()&&!this.menu.isOpened()},group:SE}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(SE)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>Qr(Ti,this,Y5).call(this,e))}open(e){var n;let r=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(),Ne(r,(i,o)=>{this.menu.setOffset(o,i)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close()}executeCommand(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.commandExecutor.execute(e,...r)}setListening(){let e=arguments.length>0&&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 UN(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function Y5(t){if(ye(t.target,Uh)){const e=xg(this.menu.container,this.hot.rootDocument),n=t.target.getBoundingClientRect();t.stopPropagation(),jN(am,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 G5(t,e){const n=e.parentNode;if(!n)return;const r=n.parentNode.childNodes,i=Array.prototype.indexOf.call(r,n);if(t<0||i!==r.length-1)return;const o=e.querySelector(`.${Uh}`);if(this.enabled&&o)return;if(!this.enabled){o&&o.parentNode.removeChild(o);return}const s=this.hot.rootDocument.createElement("button");s.className=Uh,s.type="button",s.tabIndex=-1,this.hot.getSettings().ariaTags&&(Se(s,[pa(),Fc(" ")]),Se(e,[qO("menu")])),s.onclick=function(){return!1},e.firstChild.insertBefore(s,e.firstChild.firstChild)}function q5(){this.hot.runHooks("beforeDropdownMenuShow",this)}function K5(){this.hot.runHooks("afterDropdownMenuShow",this),Qr(Ti,this,UN).call(this,this.menu)}function X5(t){Qr(Ti,this,UN).call(this,t)}function Z5(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function Q5(t){return U5(am,this)?null:t}function J5(t){ye(t.target,Uh)&&jN(am,this,!0)}lm.SEPARATOR={name:ke};function zN(t,e,n){return(e=eZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eZ(t){var e=tZ(t,"string");return typeof e=="symbol"?e:e+""}function tZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nZ{constructor(e){zN(this,"hot",void 0),zN(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:n,endRow:r,endCol:i}=this._getDataRange(),o=this.options,s=[];return fe(e,r,a=>{const l=[];!o.exportHiddenRows&&this._isHiddenRow(a)||(fe(n,i,u=>{!o.exportHiddenColumns&&this._isHiddenColumn(u)||l.push(this.hot.getDataAtCell(a,u))}),s.push(l))}),s}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:n,endRow:r}=this._getDataRange(),i=this.hot.getRowHeader();fe(n,r,o=>{!this.options.exportHiddenRows&&this._isHiddenRow(o)||e.push(i[o])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:n,endCol:r}=this._getDataRange(),i=this.hot.getColHeader();fe(n,r,o=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(o)||e.push(i[o])})}return e}_getDataRange(){const e=this.hot.countCols()-1,n=this.hot.countRows()-1;let[r=0,i=0,o=n,s=e]=this.options.range;return r=Math.max(r,0),i=Math.max(i,0),o=Math.min(o,n),s=Math.min(s,e),{startRow:r,startCol:i,endRow:o,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 YN(t,e,n){return(e=rZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rZ(t){var e=iZ(t,"string");return typeof e=="symbol"?e:e+""}function iZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class RE{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){YN(this,"dataProvider",void 0),YN(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(n),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let n=ji(this.constructor.DEFAULT_OPTIONS);const r=new Date;return n=rn(ji(RE.DEFAULT_OPTIONS),n),n=rn(n,e),n.filename=UO(n.filename,{YYYY:r.getFullYear(),MM:`${r.getMonth()+1}`.padStart(2,"0"),DD:`${r.getDate()}`.padStart(2,"0")}),n}}function oZ(t,e){sZ(t,e),e.add(t)}function sZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function GN(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 qN="\r",aZ='"',lZ=`
58
- `,uZ="=",cZ="+",hZ="-",dZ="@",fZ=" ";var EE=new WeakSet;class gZ extends RE{constructor(){super(...arguments),oZ(this,EE)}static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
59
- `,sanitizeValues:!1}}export(){const e=this.options,n=this.dataProvider.getData();let r=this.dataProvider.getColumnHeaders();const i=r.length>0,o=this.dataProvider.getRowHeaders(),s=o.length>0;let a=e.bom?"\uFEFF":"";return i&&(r=je(r,l=>this._escapeCell(l,{force:!0,sanitizeValue:e.sanitizeValues})),s&&(a+=e.columnDelimiter),a+=r.join(e.columnDelimiter),a+=e.rowDelimiter),H(n,(l,u)=>{u>0&&(a+=e.rowDelimiter),s&&(a+=this._escapeCell(o[u],{sanitizeValue:e.sanitizeValues}),a+=e.columnDelimiter);const c=l.map(h=>this._escapeCell(h,{sanitizeValue:e.sanitizeValues})).join(e.columnDelimiter);a+=c}),a}_escapeCell(e){let{force:n=!1,sanitizeValue:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=xt(e);return i===""||(r&&(n=!0),r instanceof RegExp?i=GN(EE,this,pZ).call(this,i,r):typeof r=="function"?i=r(i):r&&(i=GN(EE,this,mZ).call(this,i)),(n||i.indexOf(qN)>=0||i.indexOf(aZ)>=0||i.indexOf(lZ)>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(new RegExp('"',"g"),'""'),i=`"${i}"`)),i}}function mZ(t){return t.startsWith(uZ)||t.startsWith(cZ)||t.startsWith(hZ)||t.startsWith(dZ)||t.startsWith(fZ)||t.startsWith(qN)?`'${t}`:t}function pZ(t,e){return e.test(t)?`'${t}`:t}const TE={csv:gZ};function wZ(t,e,n){return typeof TE[t]=="function"?new TE[t](e,n):null}const vZ="exportFile",CZ=240;class yZ extends Xe{static get PLUGIN_KEY(){return vZ}static get PLUGIN_PRIORITY(){return CZ}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:r,rootWindow:i}=this.hot,o=this._createTypeFormatter(e,n),s=this._createBlob(o),a=i.URL||i.webkitURL,l=r.createElement("a"),u=`${o.options.filename}.${o.options.fileExtension}`;if(l.download!==void 0){const c=a.createObjectURL(s);l.style.display="none",l.setAttribute("href",c),l.setAttribute("download",u),r.body.appendChild(l),l.dispatchEvent(new MouseEvent("click")),r.body.removeChild(l),setTimeout(()=>{a.revokeObjectURL(c)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(s,u)}_createTypeFormatter(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!TE[e])throw new Error(`Export format type "${e}" is not supported.`);return wZ(e,new nZ(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 ku(t,e,n){return(e=bZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bZ(t){var e=SZ(t,"string");return typeof e=="symbol"?e:e+""}function SZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class zh{constructor(e,n){let{id:r,stateless:i=!0}=n;ku(this,"hot",void 0),ku(this,"id",void 0),ku(this,"elements",[]),ku(this,"hidden",!1),ku(this,"stateId",""),ku(this,"state",void 0),this.hot=e,this.id=r,this.stateId=`Filters.component.${this.id}`,this.state=i?null:this.hot.columnIndexMapper.registerMap(this.stateId,new hg)}getElements(){return this.elements}reset(){H(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(),H(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}ct(zh,Mn);const Yh={};function ks(t,e){if(!Yh[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:n,descriptor:r}=Yh[t];let i=e;return r.inputValuesDecorator&&(i=r.inputValuesDecorator(i)),function(o){return n.apply(o.meta.instance,[].concat([o],[i]))}}function Qa(t){if(!Yh[t])throw Error(`Filter condition "${t}" does not exist.`);return Yh[t].descriptor}function Jt(t,e,n){n.key=t,Yh[t]={condition:e,descriptor:n}}const yn="none";function RZ(){return!0}Jt(yn,RZ,{name:Uf,inputsCount:0,showOperators:!1});const Gh="empty";function EZ(t){return Bt(t.value)}Jt(Gh,EZ,{name:Wb,inputsCount:0,showOperators:!0});const um="not_empty";function TZ(t,e){return!ks(Gh,e)(t)}Jt(um,TZ,{name:Bb,inputsCount:0,showOperators:!0});const qh="eq";function _Z(t,e){let[n]=e;return xt(t.value).toLocaleLowerCase(t.meta.locale)===xt(n)}Jt(qh,_Z,{name:jb,inputsCount:1,showOperators:!0});const cm="neq";function MZ(t,e){return!ks(qh,e)(t)}Jt(cm,MZ,{name:Ub,inputsCount:1,showOperators:!0});const KN="gt";function IZ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>r}Jt(KN,IZ,{name:Kb,inputsCount:1,showOperators:!0});const XN="gte";function PZ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>=r}Jt(XN,PZ,{name:Xb,inputsCount:1,showOperators:!0});const ZN="lt";function OZ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<r}Jt(ZN,OZ,{name:Zb,inputsCount:1,showOperators:!0});const QN="lte";function xZ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<=r}Jt(QN,xZ,{name:Qb,inputsCount:1,showOperators:!0});const _E="date_after";function AZ(t,e){let[n]=e;const r=Z(t.value,t.meta.dateFormat),i=Z(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)>=0}Jt(_E,AZ,{name:tS,inputsCount:1,showOperators:!0});const ME="date_before";function HZ(t,e){let[n]=e;const r=Z(t.value,t.meta.dateFormat),i=Z(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)<=0}Jt(ME,HZ,{name:nS,inputsCount:1,showOperators:!0});const hm="between";function NZ(t,e){let[n,r]=e,i=n,o=r;if(t.meta.type==="numeric"){const s=parseFloat(i,10),a=parseFloat(o,10);i=Math.min(s,a),o=Math.max(s,a)}else if(t.meta.type==="date"){const s=ks(ME,[o]),a=ks(_E,[i]);return s(t)&&a(t)}return t.value>=i&&t.value<=o}Jt(hm,NZ,{name:Jb,inputsCount:2,showOperators:!0});const JN="not_between";function DZ(t,e){return!ks(hm,e)(t)}Jt(JN,DZ,{name:eS,inputsCount:2,showOperators:!0});const eD="begins_with";function kZ(t,e){let[n]=e;return xt(t.value).toLocaleLowerCase(t.meta.locale).startsWith(xt(n))}Jt(eD,kZ,{name:zb,inputsCount:1,showOperators:!0});const tD="ends_with";function LZ(t,e){let[n]=e;return xt(t.value).toLocaleLowerCase(t.meta.locale).endsWith(xt(n))}Jt(tD,LZ,{name:Yb,inputsCount:1,showOperators:!0});const IE="contains";function $Z(t,e){let[n]=e;return xt(t.value).toLocaleLowerCase(t.meta.locale).indexOf(xt(n))>=0}Jt(IE,$Z,{name:Gb,inputsCount:1,showOperators:!0});const nD="not_contains";function FZ(t,e){return!ks(IE,e)(t)}Jt(nD,FZ,{name:qb,inputsCount:1,showOperators:!0});const rD="date_tomorrow";function VZ(t){const e=Z(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(Z().subtract(-1,"days").startOf("day"),"d"):!1}Jt(rD,VZ,{name:iS,inputsCount:0});const iD="date_today";function WZ(t){const e=Z(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(Z().startOf("day"),"d"):!1}Jt(iD,WZ,{name:rS,inputsCount:0});const oD="date_yesterday";function BZ(t){const e=Z(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(Z().subtract(1,"days").startOf("day"),"d"):!1}Jt(oD,BZ,{name:oS,inputsCount:0}),Wz();function jZ(t,e){let n=t;return n===""&&(n=`(${e})`),n}function Kh(t){const e=new Set(t);return function(n){return e.has(n)}}function PE(t){return t??""}function OE(t){return Array.from(new Set(t)).map(e=>PE(e)).sort((e,n)=>typeof e=="number"&&typeof n=="number"?e-n:e===n?0:e>n?1:-1)}function sD(t,e,n,r){const i=[],o=t===e;let s;return o||(s=Kh(e)),t.forEach(a=>{let l=!1;(o||s(a))&&(l=!0);const u={checked:l,value:a,visualValue:jZ(a,n)};r&&r(u),i.push(u)}),i}const Ja="by_value";function UZ(t,e){let[n]=e;return n(t.value)}Jt(Ja,UZ,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[Kh(e)]},showOperators:!1});const Xh={};function zZ(t){if(!Xh[t])throw Error(`Operation with id "${t}" does not exist.`);const e=Xh[t].func;return function(n,r){return e(n,r)}}function YZ(t){return Xh[t].name}function xE(t,e,n){Xh[t]={name:e,func:n}}const Ls="conjunction",GZ=lS;function qZ(t,e){return t.every(n=>n.func(e))}xE(Ls,GZ,qZ);const dm="disjunction",KZ=zf;function XZ(t,e){return t.some(n=>n.func(e))}xE(dm,KZ,XZ);const AE="disjunctionWithExtraCondition",ZZ=zf;function QZ(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)}xE(AE,ZZ,QZ);const JZ="numeric",aD="text",eQ="date",lD={[JZ]:[yn,ke,Gh,um,ke,qh,cm,ke,KN,XN,ZN,QN,hm,JN],[aD]:[yn,ke,Gh,um,ke,qh,cm,ke,eD,tD,ke,IE,nD],[eQ]:[yn,ke,Gh,um,ke,qh,cm,ke,ME,_E,hm,ke,rD,iD,oD]};function tQ(t){const e=[];let n=t;return lD[n]||(n=aD),H(lD[n],r=>{let i;r===ke?i={name:ke}:i=ji(Qa(r)),e.push(i)}),e}function Zh(t,e,n){return(e=nQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nQ(t){var e=rQ(t,"string");return typeof e=="symbol"?e:e+""}function rQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const HE="built",NE="building",uD=["click","input","keydown","keypress","keyup","focus","blur","change"];let _i=class nF{static get DEFAULTS(){return ji({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,n){Zh(this,"hot",void 0),Zh(this,"eventManager",new gi(this)),Zh(this,"options",void 0),Zh(this,"_element",void 0),Zh(this,"buildState",void 0),this.hot=e,this.options=rn(nF.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===NE?this._element:this.buildState===HE?(this.update(),this._element):(this.buildState=NE,this.build(),this.buildState=HE,this._element)}isBuilt(){return this.buildState===HE}translateIfPossible(e){return typeof e=="string"&&e.startsWith(jn)?this.hot.getTranslatedPhrase(e):e}build(){const e=(n,r)=>{this.eventManager.addEventListener(n,r,i=>this.runLocalHooks(r,i,this))};if(this.buildState||(this.buildState=NE),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&&X(this._element,this.options.className),this.options.children.length)H(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),Ne(this.options,(r,i)=>{n[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(n[i]=this.translateIfPossible(r))}),this._element.appendChild(n),H(uD,r=>e(n,r))}else H(uD,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}};ct(_i,Mn);function iQ(t,e){cD(t,e),e.add(t)}function oQ(t,e,n){cD(t,e),e.set(t,n)}function cD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fm(t,e){return t.get(DE(t,e))}function sQ(t,e,n){return t.set(DE(t,e),n),n}function DE(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 Lu=new WeakMap,hD=new WeakSet;class $s extends _i{static get DEFAULTS(){return ji({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,n){super(e,rn($s.DEFAULTS,n)),iQ(this,hD),oQ(this,Lu,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>DE(hD,this,aQ).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");sQ(Lu,this,this._element.firstChild),X(this._element,"htUIInput"),X(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(fm(Lu,this).type=this.options.type,fm(Lu,this).placeholder=this.translateIfPossible(this.options.placeholder),fm(Lu,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&fm(Lu,this).focus()}}function aQ(t){this.options.value=t.target.value}function lQ(t,e){dD(t,e),e.add(t)}function Qh(t,e,n){dD(t,e),e.set(t,n)}function dD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $u(t,e,n){return t.set(Jh(t,e),n),n}function Lt(t,e){return t.get(Jh(t,e))}function Jh(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 mn=new WeakMap,gm=new WeakMap,mm=new WeakMap,kE=new WeakMap,pm=new WeakMap,wm=new WeakSet;class ed extends _i{static get DEFAULTS(){return ji({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,n){super(e,rn(ed.DEFAULTS,n)),lQ(this,wm),Qh(this,mn,null),Qh(this,gm,[]),Qh(this,mm,void 0),Qh(this,kE,void 0),Qh(this,pm,void 0),this.registerHooks()}getMenu(){return Lt(mn,this)}registerHooks(){this.addLocalHook("click",()=>Jh(wm,this,hQ).call(this))}setItems(e){$u(gm,this,this.translateNames(e)),Lt(mn,this)&&Lt(mn,this).setMenuItems(Lt(gm,this))}translateNames(e){return H(e,n=>{n.name=this.translateIfPossible(n.name)}),e}build(){super.build(),$u(mn,this,new Iu(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),Lt(mn,this).setMenuItems(Lt(gm,this));const e=new _i(this.hot,{className:"htUISelectCaption"}),n=new _i(this.hot,{className:"htUISelectDropdown"});$u(mm,this,e),$u(kE,this,e.element),$u(pm,this,n),this.hot.getSettings().ariaTags&&(Se(n.element,[pa()]),Se(this._element,[GO()])),H([e,n],r=>this._element.appendChild(r.element)),Lt(mn,this).addLocalHook("select",r=>Jh(wm,this,uQ).call(this,r)),Lt(mn,this).addLocalHook("afterClose",()=>Jh(wm,this,cQ).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=Lt(mn,this).hot.getTranslatedPhrase(Uf),Lt(kE,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();Lt(mn,this)&&(Lt(mn,this).open(),Lt(mn,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),Lt(mn,this).getNavigator().toFirstItem(),Lt(mn,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:n=>{this.closeOptions(),this.runLocalHooks("tabKeydown",n)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){Lt(mn,this)&&Lt(mn,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){Lt(mn,this)&&(Lt(mn,this).destroy(),$u(mn,this,null)),Lt(mm,this)&&Lt(mm,this).destroy(),Lt(pm,this)&&Lt(pm,this).destroy(),super.destroy()}}function uQ(t){t.name!==ke&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function cQ(){this.runLocalHooks("afterClose")}function hQ(){this.openOptions()}function dQ(t,e){fQ(t,e),e.add(t)}function fQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fD(t,e,n){return(e=gQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gQ(t){var e=mQ(t,"string");return typeof e=="symbol"?e:e+""}function mQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gD(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 LE=new WeakSet;class $E extends zh{constructor(e,n){super(e,{id:n.id,stateless:!1}),dQ(this,LE),fD(this,"name",""),fD(this,"addSeparator",!1),this.name=n.name,this.addSeparator=n.addSeparator,this.elements.push(new ed(this.hot,{menuContainer:n.menuContainer})),this.elements.push(new $s(this.hot,{placeholder:gS})),this.elements.push(new $s(this.hot,{placeholder:mS})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>gD(LE,this,pQ).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),H(this.getInputElements(),e=>{e.addLocalHook("keydown",n=>gD(LE,this,wQ).call(this,n))})}setState(e){if(this.reset(),!e)return;const n=ji(e.command);n.name.startsWith(Ht)&&(n.name=this.hot.getTranslatedPhrase(n.name)),this.getSelectElement().setValue(n),H(e.args,(r,i)=>{if(i>n.inputsCount-1)return!1;const o=this.getInputElement(i);o.setValue(r),o[n.inputsCount>i?"show":"hide"](),i||this.hot._registerTimeout(()=>o.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||Qa(yn),n=[];return H(this.getInputElements(),(r,i)=>{e.inputsCount>i&&n.push(r.getValue())}),{command:e,args:n}}updateState(e,n){const r=Qa(e?e.name:yn);this.state.setValueAtIndex(n,{command:r,args:e?e.args:[]}),e||H(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof ed)[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 $s)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{X(n.parentNode,"htFiltersMenuCondition"),this.addSeparator&&X(n.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return X(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||H(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let n=[Qa(yn)];if(e!==null){const{visualIndex:r}=e;n=tQ(this.hot.getDataType(0,r,this.hot.countRows(),r))}H(this.getInputElements(),r=>r.hide()),this.getSelectElement().setItems(n),super.reset(),this.getSelectElement().setValue(n[0])}}function pQ(t){H(this.getInputElements(),(e,n)=>{e[t.inputsCount>n?"show":"hide"](),n===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function wQ(t){jc(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),fi(t))}function mD(t,e,n){vQ(t,e),e.set(t,n)}function vQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function td(t,e){return t.get(wD(t,e))}function pD(t,e,n){return t.set(wD(t,e),n),n}function wD(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 Fu=new WeakMap,FE=new WeakMap;class vm extends _i{static get DEFAULTS(){return ji({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,n){super(e,rn(vm.DEFAULTS,n)),mD(this,Fu,void 0),mD(this,FE,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),pD(FE,this,e),pD(Fu,this,this._element.firstChild),td(Fu,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(td(FE,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?td(Fu,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(td(Fu,this).checked=e)}focus(){this.isBuilt()&&td(Fu,this).focus()}}function CQ(t,e){yQ(t,e),e.add(t)}function yQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bQ(t,e,n){return(e=SQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function SQ(t){var e=RQ(t,"string");return typeof e=="symbol"?e:e+""}function RQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function EQ(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 vD=0;var CD=new WeakSet;class TQ extends zh{constructor(e,n){super(e,{id:n.id,stateless:!1}),CQ(this,CD),bQ(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)=>(X(n.parentNode,"htFiltersMenuOperators"),H(this.elements,r=>n.appendChild(r.element)),n)}}buildOperatorsElement(){const e=[Ls,dm];H(e,n=>{const r=new vm(this.hot,{name:"operator",label:{htmlFor:n,textContent:YZ(n)},value:n,checked:n===e[vD],id:n});r.addLocalHook("change",i=>EQ(CD,this,_Q).call(this,i)),this.elements.push(r)})}setChecked(e){if(this.elements.length<e)throw Error(tt`Radio button with index ${e} doesn't exist.`);H(this.elements,(n,r)=>{n.setChecked(r===e)})}getActiveOperationId(){const e=this.elements.find(n=>n instanceof vm&&n.isChecked());return e?e.getValue():Ls}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&H(this.elements,n=>{n.setChecked(n.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ls,n=arguments.length>1?arguments[1]:void 0,r=e;r===AE&&(r=dm),this.state.setValueAtIndex(n,r)}reset(){this.setChecked(vD)}}function _Q(t){this.setState(t.target.value)}const yD="ABCDEFGHIJKLMNOPQRSTUVWXYZ".length;function MQ(t){let e=t+1,n="",r;for(;e>0;)r=(e-1)%yD,n=String.fromCharCode(65+r)+n,e=parseInt((e-r)/yD,10);return n}function bD(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t;const r=[];return(!Array.isArray(t)||!Array.isArray(t[0]))&&(n=[t]),n.forEach((i,o)=>{Array.isArray(i)?i.forEach((s,a)=>{r.push([o+e,a,s])}):Object.keys(i).forEach(s=>{r.push([o+e,s,i[s]])})}),r}function SD(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&He(t[0])&&(e=iy(t[0]))),e}function IQ(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function PQ(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function OQ(t,e,n){xQ(t,e),e.set(t,n)}function xQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function VE(t,e){return t.get(RD(t,e))}function AQ(t,e,n){return t.set(RD(t,e),n),n}function RD(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 nd=new WeakMap;class rd extends _i{static get DEFAULTS(){return ji({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,n){super(e,rn(rd.DEFAULTS,n)),OQ(this,nd,void 0)}build(){super.build(),AQ(nd,this,this._element.firstChild)}update(){this.isBuilt()&&(VE(nd,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&VE(nd,this).focus()}activate(){VE(nd,this).click()}}function HQ(t,e){ED(t,e),e.add(t)}function Vu(t,e,n){ED(t,e),e.set(t,n)}function ED(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Me(t,e){return t.get(Wu(t,e))}function Mi(t,e,n){return t.set(Wu(t,e),n),n}function Wu(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 TD="multipleSelect.itemBox";var Ii=new WeakMap,Yt=new WeakMap,WE=new WeakMap,Jo=new WeakMap,Fs=new WeakMap,Vs=new WeakMap,id=new WeakSet;class od extends _i{static get DEFAULTS(){return ji({className:"htUIMultipleSelect",value:[]})}constructor(e,n){super(e,rn(od.DEFAULTS,n)),HQ(this,id),Vu(this,Ii,[]),Vu(this,Yt,void 0),Vu(this,WE,void 0),Vu(this,Jo,void 0),Vu(this,Fs,void 0),Vu(this,Vs,void 0),Mi(Jo,this,new $s(this.hot,{placeholder:fS,className:"htUIMultipleSelectSearch"})),Mi(Fs,this,new rd(this.hot,{textContent:uS,className:"htUISelectAll"})),Mi(Vs,this,new rd(this.hot,{textContent:cS,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return Me(Yt,this)}registerHooks(){Me(Jo,this).addLocalHook("keydown",e=>Wu(id,this,DQ).call(this,e)),Me(Jo,this).addLocalHook("input",e=>Wu(id,this,NQ).call(this,e)),Me(Fs,this).addLocalHook("click",e=>Wu(id,this,kQ).call(this,e)),Me(Vs,this).addLocalHook("click",e=>Wu(id,this,LQ).call(this,e))}setItems(e){var n;Mi(Ii,this,e),(n=Me(Yt,this))===null||n===void 0||n.loadData(Me(Ii,this))}setLocale(e){Mi(WE,this,e)}getLocale(){return Me(WE,this)}getItems(){return[...Me(Ii,this)]}getValue(){return FQ(Me(Ii,this))}getSearchInputElement(){return Me(Jo,this)}getSelectAllElement(){return Me(Fs,this)}getClearAllElement(){return Me(Vs,this)}isSelectedAllValues(){return Me(Ii,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,n=e.createElement("div"),r=new _i(this.hot,{className:"htUISelectionControls",children:[Me(Fs,this),Me(Vs,this)]});this._element.appendChild(Me(Jo,this).element),this._element.appendChild(r.element),this._element.appendChild(n);const i=o=>{var s;if(!this._element)return;(s=Me(Yt,this))===null||s===void 0||s.destroy(),X(o,"htUIMultipleSelectHot"),Mi(Yt,this,new this.hot.constructor(o,{data:Me(Ii,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(u,c,h,d,f,m)=>{u.title=m.instance.getDataAtRowProp(c,m.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{Me(Yt,this).listen()},modifyColWidth:u=>{const c=Me(Yt,this).container.scrollWidth-vn(e);return u!==void 0&&u<c?c:u},maxCols:1,autoWrapCol:!0,height:110,copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},themeName:this.hot.getCurrentThemeName(),layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),Me(Yt,this).init(),this.hot.addHook("afterSetTheme",(u,c)=>{c||Me(Yt,this).useTheme(u)});const l=Me(Yt,this).getShortcutManager().getContext("grid");l.removeShortcutsByKeys(["Tab"]),l.removeShortcutsByKeys(["Shift","Tab"]),l.addShortcut({keys:[["Escape"]],callback:u=>{this.runLocalHooks("keydown",u,this)},group:TD}),l.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:u=>{Me(Yt,this).deselectCell(),this.runLocalHooks("keydown",u,this),this.runLocalHooks("listTabKeydown",u,this)},group:TD})};i(n),this.hot._registerTimeout(()=>i(n),100)}focus(){this.isBuilt()&&Me(Yt,this).listen()}reset(){Me(Jo,this).reset(),Me(Fs,this).reset(),Me(Vs,this).reset()}update(){this.isBuilt()&&(Me(Yt,this).loadData($Q(Me(Ii,this),this.options.value)),super.update())}destroy(){var e;(e=Me(Yt,this))===null||e===void 0||e.destroy(),Me(Jo,this).destroy(),Me(Vs,this).destroy(),Me(Fs,this).destroy(),Mi(Jo,this,null),Mi(Vs,this,null),Mi(Fs,this,null),Mi(Yt,this,null),Mi(Ii,this,null),super.destroy()}}function NQ(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let n;e===""?n=[...Me(Ii,this)]:n=Me(Ii,this).filter(r=>`${r.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),Me(Yt,this).loadData(n)}function DQ(t){this.runLocalHooks("keydown",t,this),kx(jc,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),fi(t),Me(Yt,this).listen(),Me(Yt,this).selectCell(0,0))}function kQ(t){const e=[];t.preventDefault(),Me(Yt,this).getSourceData().forEach((n,r)=>{n.checked=!0,e.push(bD(n,r)[0])}),Me(Yt,this).setSourceDataAtCell(e)}function LQ(t){const e=[];t.preventDefault(),Me(Yt,this).getSourceData().forEach((n,r)=>{n.checked=!1,e.push(bD(n,r)[0])}),Me(Yt,this).setSourceDataAtCell(e)}function $Q(t,e){const n=Kh(e);return t.map(r=>(r.checked=n(r.value),r))}function FQ(t){const e=[];return t.forEach(n=>{n.checked&&e.push(n.value)}),e}function VQ(t,e){WQ(t,e),e.add(t)}function WQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function BQ(t,e,n){return(e=jQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jQ(t){var e=UQ(t,"string");return typeof e=="symbol"?e:e+""}function UQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Cm(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 sd=new WeakSet;class zQ extends zh{constructor(e,n){super(e,{id:n.id,stateless:!1}),VQ(this,sd),BQ(this,"name",""),this.name=n.name,this.elements.push(new od(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>Cm(sd,this,YQ).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,n)=>Cm(sd,this,GQ).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===Ja){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:Ja},args:[e.getValue()],itemsSnapshot:n}}updateState(e){const n=(r,i,o,s,a)=>{const[l]=ga(i,h=>h.name===Ja),u={},c=this.hot.getTranslatedPhrase(Yf);if(l){const h=s(r,a),d=je(h,v=>v.value),f=new Map(h.map(v=>[v.value,this.hot.getCellMeta(v.meta.visualRow,v.meta.visualCol)])),m=OE(d);o&&(l.args[0]=o);const b=[],S=sD(m,l.args[0],c,v=>{v.checked&&b.push(v.value),Cm(sd,this,_D).call(this,v,f)}),E=e.editedConditionStack.column;u.locale=this.hot.getCellMeta(0,E).locale,u.args=[b],u.command=Qa(Ja),u.itemsSnapshot=S}else u.args=[],u.command=Qa(yn);this.state.setValueAtIndex(r,u)};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 od)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{X(n.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return X(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||H(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getTranslatedPhrase(Yf),n=this._getColumnVisibleValues(),r=n.map(l=>l.value),i=new Map(n.map(l=>[l.value,l.meta])),o=OE(r),s=sD(o,o,e,l=>{Cm(sd,this,_D).call(this,l,i)});this.getMultipleSelectElement().setItems(s),super.reset(),this.getMultipleSelectElement().setValue(o);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?[]:je(this.hot.getDataAtCol(e.visualIndex),(n,r)=>({value:PE(n),meta:this.hot.getCellMeta(r,e.visualIndex)}))}}function YQ(t){jc(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),fi(t))}function _D(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function GQ(t,e){return e.type==="numeric"?HA(t,e):t}var MD;function qQ(t,e){KQ(t,e),e.add(t)}function KQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function XQ(t,e,n){return(e=ZQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ZQ(t){var e=QQ(t,"string");return typeof e=="symbol"?e:e+""}function QQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function JQ(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 ID=new WeakSet;class ad extends zh{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,n){super(e,{id:n.id,stateless:!0}),qQ(this,ID),XQ(this,"name",""),this.name=n.name,this.elements.push(new $s(this.hot,{type:"button",value:hS,className:"htUIButton htUIButtonOK",identifier:ad.BUTTON_OK})),this.elements.push(new $s(this.hot,{type:"button",value:dS,className:"htUIButton htUIButtonCancel",identifier:ad.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){H(this.elements,e=>{e.addLocalHook("click",(n,r)=>JQ(ID,this,eJ).call(this,n,r))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(X(n.parentNode,"htFiltersMenuActionBar"),H(this.elements,r=>n.appendChild(r.element)),n)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}MD=ad;function eJ(t,e){e.options.identifier===MD.BUTTON_OK?this.accept():this.cancel()}function BE(t,e,n){return(e=tJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tJ(t){var e=nJ(t,"string");return typeof e=="symbol"?e:e+""}function nJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const PD="ConditionCollection.filteringStates";class jE{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;BE(this,"hot",void 0),BE(this,"isMapRegistrable",void 0),BE(this,"filteringStates",new hg),this.hot=e,this.isMapRegistrable=n,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(PD,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return this.getFilteredColumns().length===0}isMatch(e,n){var r;const i=this.filteringStates.getValueAtIndex(n),o=(r=i?.conditions)!==null&&r!==void 0?r:[],s=i?.operation;return this.isMatchInConditions(o,e,s)}isMatchInConditions(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ls;return e.length?zZ(r)(e,n):!0}addCondition(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ls,i=arguments.length>3?arguments[3]:void 0;const o=this.hot.getCellMeta(0,e).locale,s=n.args.map(c=>typeof c=="string"?c.toLocaleLowerCase(o):c),a=n.name||n.command.key;this.runLocalHooks("beforeAdd",e);const l=this.getOperation(e);if(l){if(l!==r)throw Error(tt`The column of index ${e} has been already applied with a \`${l}\`\x20
60
- filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
61
- Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
62
- use it consequently for a particular column).`)}else if(At(Xh[r]))throw new Error(tt`Unexpected operation named \`${r}\`. Possible ones are\x20
63
- \`disjunction\` and \`conjunction\`.`);const u=this.getConditions(e);u.length===0?this.filteringStates.setValueAtIndex(e,{operation:r,conditions:[{name:a,args:s,func:ks(a,s)}]},i):u.push({name:a,args:s,func:ks(a,s)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var n,r;return(n=(r=this.filteringStates.getValueAtIndex(e))===null||r===void 0?void 0:r.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 this.filteringStates.getEntries().reduce((e,n)=>{let[r,{operation:i,conditions:o}]=n;return e.push({column:r,operation:i,conditions:o.map(s=>{let{name:a,args:l}=s;return{name:a,args:[...l]}})}),e},[])}importAllConditions(e){this.clean(),e.forEach(n=>{n.conditions.forEach(r=>this.addCondition(n.column,r))})}removeConditions(e){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 r=this.getConditions(e);return n?r.some(i=>i.name===n):r.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(PD),this.filteringStates=null,this.clearLocalHooks()}}ct(jE,Mn);function OD(t,e,n){return(e=rJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rJ(t){var e=iJ(t,"string");return typeof e=="symbol"?e:e+""}function iJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class xD{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];OD(this,"conditionCollection",void 0),OD(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=n}filter(){let e=[];return H(this.conditionCollection.getFilteredColumns(),(n,r)=>{let i=this.columnDataFactory(n);r&&(i=this._getIntersectData(i,e)),e=this.filterByColumn(n,i)}),e}filterByColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=[];return H(n,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&r.push(i)}),r}_getIntersectData(e,n){const r=[];return H(n,i=>{const o=i.meta.visualRow;e[o]!==void 0&&(r[o]=e[o])}),r}}function oJ(t,e){sJ(t,e),e.add(t)}function sJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function el(t,e,n){return(e=aJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aJ(t){var e=lJ(t,"string");return typeof e=="symbol"?e:e+""}function lJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function UE(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 ym=new WeakSet;class AD{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];oJ(this,ym),el(this,"hot",void 0),el(this,"conditionCollection",void 0),el(this,"columnDataFactory",void 0),el(this,"changes",[]),el(this,"grouping",!1),el(this,"latestEditedColumnPosition",-1),el(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=n,this.columnDataFactory=r,this.conditionCollection.addLocalHook("beforeRemove",i=>UE(ym,this,uJ).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>UE(ym,this,cJ).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>UE(ym,this,hJ).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,H(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,n){var r=this;if(this.grouping){this.changes.indexOf(e)===-1&&this.changes.push(e);return}const i=this.conditionCollection.exportAllConditions();let o=this.conditionCollection.getColumnStackPosition(e);o===-1&&(o=this.latestEditedColumnPosition);const s=i.slice(0,o),a=i.slice(o);a.length&&a[0].column===e&&a.shift();const l=tG(function(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const f=new jE(r.hot,!1),m=[].concat(c,d);f.importAllConditions(m);const b=r.columnDataFactory(h);let S;f.isEmpty()?S=b:S=new xD(f,v=>r.columnDataFactory(v)).filter(),S=je(S,v=>v.meta.visualRow);const E=Kh(S);return f.destroy(),ga(b,v=>E(v.meta.visualRow))})(s),u=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:u},dependentConditionStacks:a,filteredRowsFactory:l,conditionArgsChange:n})}destroy(){this.clearLocalHooks(),Ne(this,(e,n)=>{this[n]=null})}}function uJ(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function cJ(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function hJ(){H(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}ct(AD,Mn);function dJ(t){return nN({initialPage:0,size:()=>t.length,onItemSelect:(n,r)=>{const i=t[n];if(i instanceof od)return r;if(i.element&&!ql(i.element))return!1;i.focus()}})}const ld="filters";function fJ(t,e){let n=-1,r;const i=dJ(e),o=h=>()=>{r.isOpened()&&r.getKeyboardShortcutsCtrl().listen(ld),i.setCurrentPage(e.indexOf(h))};e.forEach(h=>{h instanceof _i&&(h.addLocalHook("click",o(h)),h.addLocalHook("focus",o(h)),h.addLocalHook("afterClose",o(h)))}),l(t);function s(h){const d=r.getKeyboardShortcutsCtrl(),f=h.getKeyboardShortcutsCtrl();i.clear(),f.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:d.getContext(ld),callback:()=>{h.isSubMenu()&&h.close(),d.listen(ld)}}]),!h.isSubMenu()&&d.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:m=>{const b=r.getNavigator();b.getCurrentPage()>-1&&(n=b.getCurrentPage()),b.clear(),m.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{r.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:m=>{const b=e[i.getCurrentPage()];b instanceof ed&&(b.openOptions(),m.preventDefault()),b instanceof rd&&(b.activate(),m.preventDefault()),b instanceof _i||m.preventDefault()}}],ld)}function a(){r.focus(),r.getKeyboardShortcutsCtrl().listen(ld)}function l(h){h.addLocalHook("afterSelectionChange",d=>{d.key.startsWith("filter_")||i.clear()}),h.addLocalHook("afterSubmenuOpen",s),h.addLocalHook("afterOpen",s),r=h}function u(){return r}function c(){return n}return{...i,listen:a,setMenu:l,getMenu:u,getLastMenuPage:c}}function gJ(t,e){HD(t,e),e.add(t)}function zE(t,e,n){HD(t,e),e.set(t,n)}function HD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ud(t,e,n){return(e=mJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mJ(t){var e=pJ(t,"string");return typeof e=="symbol"?e:e+""}function pJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bm(t,e,n){return t.set(dr(t,e),n),n}function Jr(t,e){return t.get(dr(t,e))}function dr(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 YE="filters",wJ=250,ND=YE;var es=new WeakMap,GE=new WeakMap,tl=new WeakMap,Pr=new WeakSet;class vJ extends Xe{static get PLUGIN_KEY(){return YE}static get PLUGIN_PRIORITY(){return wJ}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var n;super(e),n=this,gJ(this,Pr),ud(this,"dropdownMenuPlugin",null),ud(this,"conditionCollection",null),ud(this,"conditionUpdateObserver",null),ud(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),ud(this,"filtersRowsMap",null),zE(this,es,void 0),zE(this,GE,new WeakSet),zE(this,tl,[]),this.hot.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return dr(Pr,n,TJ).call(n,...i)})}isEnabled(){return!!this.hot.getSettings()[YE]}enablePlugin(){var e=this;if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new hh),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const n=this.hot.getSettings().dropdownMenu,r=n&&n.uiContainer||this.hot.rootDocument.body,i=a=>(a.addLocalHook("accept",()=>dr(Pr,this,DD).call(this,"accept")),a.addLocalHook("cancel",()=>dr(Pr,this,DD).call(this,"cancel")),a.addLocalHook("change",l=>dr(Pr,this,EJ).call(this,a,l)),a),o=()=>`${this.hot.getTranslatedPhrase(sS)}:`,s=()=>`${this.hot.getTranslatedPhrase(aS)}:`;if(!this.components.get("filter_by_condition")){const a=new $E(this.hot,{id:"filter_by_condition",name:o,addSeparator:!1,menuContainer:r});a.addLocalHook("afterClose",()=>dr(Pr,this,kD).call(this)),this.components.set("filter_by_condition",i(a))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new TQ(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const a=new $E(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:r});a.addLocalHook("afterClose",()=>dr(Pr,this,kD).call(this)),this.components.set("filter_by_condition2",i(a))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",i(new zQ(this.hot,{id:"filter_by_value",name:s}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",i(new ad(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new jE(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new AD(this.hot,this.conditionCollection,a=>this.getDataMapAtColumn(a)),this.conditionUpdateObserver.addLocalHook("update",a=>dr(Pr,this,_J).call(this,a))),this.components.forEach(a=>a.show()),this.addHook("afterDropdownMenuDefaultOptions",function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return dr(Pr,e,RJ).call(e,...l)}),this.addHook("beforeDropdownMenuShow",()=>dr(Pr,this,SJ).call(this)),this.addHook("afterDropdownMenuShow",()=>dr(Pr,this,yJ).call(this)),this.addHook("afterDropdownMenuHide",()=>dr(Pr,this,bJ).call(this)),this.addHook("afterChange",a=>dr(Pr,this,CJ).call(this,a)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!Jr(es,this)&&this.dropdownMenuPlugin.enabled){const a=[{focus:()=>{const u=Jr(es,this).getMenu(),c=u.getNavigator(),h=Jr(es,this).getLastMenuPage();u.focus(),h>0?c.setCurrentPage(h):c.toFirstItem()}},...Array.from(this.components).map(u=>{let[,c]=u;return c.getElements()}).flat()];bm(es,this,fJ(this.dropdownMenuPlugin.menu,a));const l=u=>{Jr(es,this).listen(),u.preventDefault(),jc(u.keyCode,"TAB")&&(u.shiftKey?Jr(es,this).toPreviousItem():Jr(es,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,r)=>{n.destroy(),this.components.set(r,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:ND})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(ND)}addCondition(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ls;const o=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(o,{command:{key:n},args:r},i)}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)}}importConditions(e){this.conditionCollection.importAllConditions(e)}exportConditions(){return this.conditionCollection.exportAllConditions()}filter(){const{navigableHeaders:e}=this.hot.getSettings(),n=this._createDataFilter(),r=!this.conditionCollection.isEmpty();let i=[];const o=this.exportConditions(),s=this.hot.runHooks("beforeFilter",o,Jr(tl,this));if(s!==!1&&r){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),i=je(n.filter(),u=>u.meta.visualRow);const l=Kh(i);fe(this.hot.countSourceRows()-1,u=>{l(u)||a.push(u)}),H(a,u=>{this.filtersRowsMap.setValueAtIndex(u,!0)})},!0),!e&&!i.length&&this.hot.deselectCell(),bm(tl,this,this.exportConditions())}else s!==!1&&!r?(bm(tl,this,this.exportConditions()),this.filtersRowsMap.clear()):this.importConditions(Jr(tl,this));this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col),s!==!1&&(this.hot.runHooks("afterFilter",o),this.hot.view.adjustElementsSize(),this.hot.render())}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),r=[];return H(this.hot.getSourceDataAtCol(n),(i,o)=>{var s;const{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:f,locale:m}=this.hot.getCellMeta(o,n),b=(s=this.hot.getDataAtCell(this.hot.toVisualRow(o),n))!==null&&s!==void 0?s:i;r.push({meta:{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:f,locale:m},value:PE(b)})}),r}updateValueComponentCondition(e){const n=this.hot.getDataAtCol(e),r=OE(n);this.conditionUpdateObserver.updateStatesAtColumn(e,r)}restoreComponents(e){var n;const r=(n=this.getSelectedColumn())===null||n===void 0?void 0:n.physicalIndex;e.forEach(i=>{i.isHidden()||i.restoreState(r)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,n,r,i){let o=e;return o===dm&&n.command.key!==yn&&r.command.key!==yn&&i.command.key!==yn?o=AE:i.command.key!==yn&&(n.command.key===yn||r.command.key===yn)&&(o=Ls),o}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:n}=e.getState(),r=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];n.showOperators?this.showComponents(...r):this.hideComponents(...r)}_createDataFilter(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.conditionCollection;return new xD(e,n=>this.getDataMapAtColumn(n))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const n=this.dropdownMenuPlugin.menu;for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return H(i,s=>{H(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 r=this.dropdownMenuPlugin.menu.hotMenu,i=r.getPlugin("hiddenRows");for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];const l=this.getIndexesOfComponents(...s);e?i.showRows(l):i.hideRows(l),r.render()}hideComponents(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.changeComponentsVisibility(!1,...n)}showComponents(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.changeComponentsVisibility(!0,...n)}destroy(){this.enabled&&(this.components.forEach((e,n)=>{e!==null&&(e.destroy(),this.components.set(n,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function CJ(t){t&&H(t,e=>{const[,n]=e,r=this.hot.propToCol(n);this.conditionCollection.hasConditions(r)&&this.updateValueComponentCondition(r)})}function yJ(){const t=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),t.updateMenuDimensions()}function bJ(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function SJ(){const t=this.dropdownMenuPlugin.menu;Jr(GE,this).has(t)||Jr(es,this).setMenu(t),Jr(GE,this).add(t)}function RJ(t){t.items.push({name:ke}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function DD(t){var e;if(t==="accept"){const r=this.getSelectedColumn();if(r===null){var n;(n=this.dropdownMenuPlugin)===null||n===void 0||n.close();return}const{physicalIndex:i}=r,o=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(),o,s,a);this.conditionUpdateObserver.groupChanges();let u=this.conditionCollection.getColumnStackPosition(i);u===-1&&(u=void 0),this.conditionCollection.removeConditions(i),o.command.key!==yn&&(this.conditionCollection.addCondition(i,o,l,u),s.command.key!==yn&&this.conditionCollection.addCondition(i,s,l,u)),a.command.key!==yn&&this.conditionCollection.addCondition(i,a,l,u),this.conditionUpdateObserver.flush(),this.components.forEach(c=>c.saveState(i)),this.filter()}(e=this.dropdownMenuPlugin)===null||e===void 0||e.close()}function EJ(t,e){const n=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),t.constructor===$E&&!e.inputsCount&&this.setListeningDropdownMenu(),n.updateMenuDimensions()}function kD(){this.setListeningDropdownMenu()}function TJ(t,e,n){const r=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(r)&&n===this.hot.view.getColumnHeadersCount()-1?X(e,"htFiltersActive"):ve(e,"htFiltersActive")}function _J(t){var e;if(!((e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled))return;const{editedConditionStack:{conditions:n,column:r},conditionArgsChange:i}=t;Array.isArray(i)&&bm(tl,this,Jr(tl,this).map(a=>(a.column===r&&n.length>0&&a.conditions.forEach(l=>{l.name==="by_value"&&(l.args=[[...i]])}),a)));const o=n.filter(a=>a.name===Ja),s=n.filter(a=>a.name!==Ja);if(o.length>=2||s.length>=3)et(tt`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
64
- The overall amount of conditions exceed the capability of the dropdown menu.\x20
65
- For more details see the documentation.`);else{const a=this.conditionCollection.getOperation(r);this.components.get("filter_by_condition").updateState(s[0],r),this.components.get("filter_by_condition2").updateState(s[1],r),this.components.get("filter_operators").updateState(a,r),this.components.get("filter_by_value").updateState(t)}}const LD="internal-use-in-handsontable",qE={licenseKey:LD,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 $D(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[Nn])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function FD(t){return Object.keys(t).reduce((e,n)=>(n!=="hyperformula"&&(e[n]=t[n]),e),{})}function MJ(t){var e;const n=t[Nn],r=FD(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=$D(t);return{...qE,...r,...i}}function IJ(t){var e;const n=t[Nn],r=FD(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=$D(t);return{...r,...i}}function PJ(t,e){return Object.keys(e).some(n=>e[n]!==void 0&&e[n]!==t[n])}function Sm(){const t="engine_relationship",e=mi(Nn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function KE(){const t="shared_engine_usage",e=mi(Nn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function OJ(t){const e=t.getSettings(),n=e[Nn],r=n?.engine;if(n===!0||At(r))return null;if(typeof r.hyperformula=="function"||typeof r=="function"){var i;return xJ((i=r.hyperformula)!==null&&i!==void 0?i:r,e,t)}else if(typeof r=="object"&&At(r.hyperformula)){const o=Sm(),s=KE().get(r);return o.has(r)||o.set(r,[]),o.get(r).push(t),s&&s.push(t.guid),r.getConfig().licenseKey||r.updateConfig({licenseKey:LD}),(r.getConfig().leapYear1900!==qE.leapYear1900||ny(r.getConfig().nullDate,qE.nullDate)===!1)&&et(tt`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
66
- settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),r}return null}function xJ(t,e,n){const r=e[Nn],i=MJ(e),o=Sm(),s=KE();AJ(t,r.functions),HJ(t,r.language);const a=t.buildEmpty(i);return o.set(a,[n]),s.set(a,[n.guid]),NJ(a,r.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function VD(t){var e;const n=Sm(),r=n.size===0?[]:Array.from((e=n.get(t))!==null&&e!==void 0?e:[]);return new Map(r.map(i=>[i.getPlugin("formulas").sheetId,i]))}function WD(t,e){if(t){const n=Sm(),r=n.get(t),i=KE(),o=i.get(t);r&&r.includes(e)&&(r.splice(r.indexOf(e),1),r.length===0&&n.delete(t)),o&&o.includes(e.guid)&&(o.splice(o.indexOf(e.guid),1),o.length===0&&(i.delete(t),t.destroy()))}}function AJ(t,e){e&&e.forEach(n=>{const{name:r,plugin:i,translations:o}=n;try{t.registerFunction(r,i,o)}catch(s){et(s.message)}})}function HJ(t,e){if(e){const{langCode:n}=e;try{t.registerLanguage(n,e)}catch(r){et(r.message)}}}function NJ(t,e){e&&(t.suspendEvaluation(),e.forEach(n=>{const{name:r,expression:i,scope:o,options:s}=n;try{t.addNamedExpression(r,i,o,s)}catch(a){et(a.message)}}),t.resumeEvaluation())}function DJ(t,e){return(At(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const BD="DD/MM/YYYY";function kJ(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function LJ(t){return kJ(t)?t.substr(1):t}function $J(t){return typeof t=="string"&&t.startsWith("=")}function XE(t,e){return typeof t=="string"&&e==="date"}function jD(t,e){return Z(t,e,!0).isValid()}function UD(t,e){return Z(t,e,!0).format(BD)}function FJ(t,e){return Z(t,BD,!0).format(e)}function zD(t,e){const r=new Date(Date.UTC(0,0,t+-1));return Z(r).format(e)}function VJ(t,e,n){const r=Array.from(Array(n).keys()).filter(o=>t.includes(o)===!1);if(e===0){var i;return(i=r[e])!==null&&i!==void 0?i:0}return r[e-1]+1}function WJ(t,e){const n=[];return t.forEach(r=>{const i={from:r,to:e};n.forEach(o=>{const s=o.from>o.to,a=o.to<=i.from;o.from>i.from&&a&&s&&(i.from+=1)}),i.from>=e&&(e+=1),n.push(i)}),n}function BJ(t){return t.forEach((e,n)=>{t.slice(n+1).forEach(i=>{const o=i.from<i.to;i.from>e.from&&o&&(i.from-=1)})}),t}function ZE(t,e,n){const r=WJ(t,VJ(t,e,n));return BJ(r)}function nl(t,e,n){jJ(t,e),e.set(t,n)}function jJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mt(t,e){return t.get(YD(t,e))}function Ws(t,e,n){return t.set(YD(t,e),n),n}function YD(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 cd=new WeakMap,Bs=new WeakMap,Or=new WeakMap,Rm=new WeakMap,QE=new WeakMap,JE=new WeakMap,Em=new WeakMap;class GD{constructor(e,n,r){nl(this,cd,void 0),nl(this,Bs,void 0),nl(this,Or,void 0),nl(this,Rm,[]),nl(this,QE,[]),nl(this,JE,void 0),nl(this,Em,[]),Ws(cd,this,e),Ws(Bs,this,n),Ws(Or,this,r)}setRemovedHfIndexes(e){return Ws(Em,this,e.map(n=>{const r=Mt(Bs,this).getVisualFromPhysicalIndex(n);return this.getHfIndexFromVisualIndex(r)})),Mt(Em,this)}getRemovedHfIndexes(){return Mt(Em,this)}getHfIndexFromVisualIndex(e){const n=Mt(Bs,this).getIndexesSequence(),r=Mt(Bs,this).getNotTrimmedIndexes();return n.indexOf(r[e],e)}syncMoves(e){const r=`move${hi(Mt(cd,this))}s`;Mt(Or,this).getEngine().batch(()=>{e.forEach(i=>{const o=i.from!==i.to,s=i.from+1!==i.to;o&&s&&Mt(Or,this).getEngine()[r](Mt(Or,this).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,n,r){r!==!1&&(Ws(QE,this,e.map(i=>this.getHfIndexFromVisualIndex(i))),Ws(JE,this,this.getHfIndexFromVisualIndex(n)))}calculateAndSyncMoves(e,n){if(Mt(Or,this).isPerformingUndoRedo()||e===!1||n===!1)return;const r=ZE(Mt(QE,this),Mt(JE,this),Mt(Bs,this).getNumberOfIndexes());Mt(Or,this).getSheetId()===null?Mt(Or,this).getPostponeAction(()=>this.syncMoves(r)):this.syncMoves(r)}getIndexesChangeSyncMethod(){const e=`set${hi(Mt(cd,this))}Order`;return n=>{if(Mt(Or,this).isPerformingUndoRedo())return;const r=Mt(Bs,this).getIndexesSequence();if(n==="update"&&r.length>0){const i=Mt(Rm,this).map(l=>r.indexOf(l)),o=Mt(Or,this).getEngine().getSheetDimensions(Mt(Or,this).getSheetId());let s;Mt(cd,this)==="row"?s=o.height:s=o.width;const a=i.length;for(let l=a;l<s;l+=1)i.push(l);Mt(Or,this).getEngine()[e](Mt(Or,this).getSheetId(),i)}Ws(Rm,this,r)}}init(){Ws(Rm,this,Mt(Bs,this).getIndexesSequence())}}function rl(t,e,n){UJ(t,e),e.set(t,n)}function UJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ts(t,e){return t.get(qD(t,e))}function il(t,e,n){return t.set(qD(t,e),n),n}function qD(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 Tm=new WeakMap,_m=new WeakMap,e0=new WeakMap,t0=new WeakMap,n0=new WeakMap,r0=new WeakMap,i0=new WeakMap;class zJ{constructor(e,n,r){rl(this,Tm,void 0),rl(this,_m,void 0),rl(this,e0,void 0),rl(this,t0,!1),rl(this,n0,!1),rl(this,r0,null),rl(this,i0,null),il(Tm,this,new GD("row",e,this)),il(_m,this,new GD("column",n,this)),il(e0,this,r)}getForAxis(e){return e==="row"?ts(Tm,this):ts(_m,this)}setPerformUndo(e){il(t0,this,e)}setPerformRedo(e){il(n0,this,e)}isPerformingUndoRedo(){return ts(t0,this)||ts(n0,this)}getSheetId(){return ts(i0,this)}getEngine(){return ts(r0,this)}getPostponeAction(){return ts(e0,this)}setupSyncEndpoint(e,n){il(r0,this,e),il(i0,this,n),ts(Tm,this).init(),ts(_m,this).init()}}function YJ(t,e){KD(t,e),e.add(t)}function ol(t,e,n){return(e=GJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GJ(t){var e=qJ(t,"string");return typeof e=="symbol"?e:e+""}function qJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function o0(t,e,n){KD(t,e),e.set(t,n)}function KD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function js(t,e,n){return t.set(Ke(t,e),n),n}function sl(t,e){return t.get(Ke(t,e))}function Ke(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 Nn="formulas",KJ=["maxRows","maxColumns","language"],XJ=260;re.getSingleton().register("afterNamedExpressionAdded"),re.getSingleton().register("afterNamedExpressionRemoved"),re.getSingleton().register("afterSheetAdded"),re.getSingleton().register("afterSheetRemoved"),re.getSingleton().register("afterSheetRenamed"),re.getSingleton().register("afterFormulasValuesUpdate");const Bu=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var ns=new WeakMap,Mm=new WeakMap,hd=new WeakMap,Ze=new WeakSet;class ZJ extends Xe{constructor(){var e;super(...arguments),e=this,YJ(this,Ze),o0(this,ns,!1),o0(this,Mm,!1),o0(this,hd,[["valuesUpdated",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ke(Ze,e,fee).call(e,...r)}],["namedExpressionAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ke(Ze,e,gee).call(e,...r)}],["namedExpressionRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ke(Ze,e,mee).call(e,...r)}],["sheetAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ke(Ze,e,pee).call(e,...r)}],["sheetRenamed",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ke(Ze,e,wee).call(e,...r)}],["sheetRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ke(Ze,e,vee).call(e,...r)}]]),ol(this,"staticRegister",mi("formulas")),ol(this,"engine",null),ol(this,"sheetId",null),ol(this,"sheetName",null),ol(this,"indexSyncer",null),ol(this,"rowAxisSyncer",null),ol(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return Nn}static get PLUGIN_PRIORITY(){return XJ}static get SETTING_KEYS(){return[Nn,...KJ]}isEnabled(){return!!this.hot.getSettings()[Nn]}enablePlugin(){var e,n=this;if(!this.enabled){if(this.engine=(e=OJ(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){et("Missing the required `engine` key in the Formulas settings. Please fill it with either an engine class or an engine instance.");return}if(this.sheetName!==null&&!this.engine.doesSheetExist(this.sheetName)){const r=this.addSheet(this.sheetName,this.hot.getSourceDataArray());r!==!1&&Ke(Ze,this,dd).call(this,r)}this.addHook("beforeLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,XD).call(n,...i)}),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,ZD).call(n,...i)}),this.addHook("beforeUpdateData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,XD).call(n,...i)}),this.addHook("afterUpdateData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,ZD).call(n,...i)}),this.addHook("modifyData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,tee).call(n,...i)}),this.addHook("modifySourceData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,nee).call(n,...i)}),this.addHook("beforeValidate",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,QJ).call(n,...i)}),this.addHook("afterSetSourceDataAtCell",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,ree).call(n,...i)}),this.addHook("afterSetDataAtCell",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,QD).call(n,...i)}),this.addHook("afterSetDataAtRowProp",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,QD).call(n,...i)}),this.addHook("beforeCreateRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,iee).call(n,...i)}),this.addHook("beforeCreateCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,oee).call(n,...i)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,lee).call(n,...i)}),this.addHook("afterCreateCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,uee).call(n,...i)}),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,see).call(n,...i)}),this.addHook("beforeRemoveCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,aee).call(n,...i)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,cee).call(n,...i)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,hee).call(n,...i)}),this.indexSyncer=new zJ(this.hot.rowIndexMapper,this.hot.columnIndexMapper,r=>{this.hot.addHookOnce("init",()=>{r()})}),this.rowAxisSyncer=this.indexSyncer.getForAxis("row"),this.columnAxisSyncer=this.indexSyncer.getForAxis("column"),this.hot.addHook("afterRowSequenceChange",this.rowAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("afterColumnSequenceChange",this.columnAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("beforeRowMove",(r,i,o,s)=>{this.rowAxisSyncer.storeMovesInformation(r,i,s)}),this.hot.addHook("beforeColumnMove",(r,i,o,s)=>{this.columnAxisSyncer.storeMovesInformation(r,i,s)}),this.hot.addHook("afterRowMove",(r,i,o,s,a)=>{this.rowAxisSyncer.calculateAndSyncMoves(s,a)}),this.hot.addHook("afterColumnMove",(r,i,o,s,a)=>{this.columnAxisSyncer.calculateAndSyncMoves(s,a)}),this.hot.addHook("beforeColumnFreeze",(r,i)=>{this.columnAxisSyncer.storeMovesInformation([r],this.hot.getSettings().fixedColumnsStart,i)}),this.hot.addHook("afterColumnFreeze",(r,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.hot.addHook("beforeColumnUnfreeze",(r,i)=>{this.columnAxisSyncer.storeMovesInformation([r],this.hot.getSettings().fixedColumnsStart-1,i)}),this.hot.addHook("afterColumnUnfreeze",(r,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.addHook("afterCellMetaReset",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,eee).call(n,...i)}),this.addHook("beforeUndo",()=>{this.indexSyncer.setPerformUndo(!0),this.engine.undo()}),this.addHook("beforeRedo",()=>{this.indexSyncer.setPerformRedo(!0),this.engine.redo()}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformUndo(!1)}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformRedo(!1)}),this.addHook("afterDetachChild",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,dee).call(n,...i)}),this.addHook("beforeAutofill",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ke(Ze,n,JJ).call(n,...i)}),sl(hd,this).forEach(r=>{let[i,o]=r;return this.engine.on(i,o)}),super.enablePlugin()}}disablePlugin(){sl(hd,this).forEach(e=>{let[n,r]=e;return this.engine.off(n,r)}),WD(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const n=IJ(this.hot.getSettings());PJ(this.engine.getConfig(),n)&&this.engine.updateConfig(n);const r=this.hot.getSettings()[Nn];if(ce(r)&&ce(r.sheetName)&&r.sheetName!==this.sheetName&&this.switchSheet(r.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[Nn].sheetName;if(i&&this.engine.doesSheetExist(i))this.switchSheet(this.sheetName);else{const o=this.addSheet(i??void 0,this.hot.getSourceDataArray());Ke(Ze,this,dd).call(this,o)}}super.updatePlugin(e)}destroy(){sl(hd,this).forEach(e=>{var n;let[r,i]=e;return(n=this.engine)===null||n===void 0?void 0:n.off(r,i)}),js(hd,this,null),WD(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,n){if(ce(n)&&!IQ(n))return et("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return et("Sheet with the provided name already exists."),!1;try{const r=this.engine.addSheet(e??void 0);return n&&this.engine.setSheetContent(this.engine.getSheetId(r),n),r}catch(r){return et(r.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){$y(`The sheet named \`${e}\` does not exist, switch aborted.`);return}Ke(Ze,this,dd).call(this,e);const n=this.engine.getSheetSerialized(this.sheetId);n.length>0&&this.hot.loadData(n,`${hi(Nn)}.switchSheet`)}getCellType(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;const i=this.hot.toPhysicalRow(e),o=this.hot.toPhysicalColumn(n);return i!==null&&o!==null?this.engine.getCellType({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n)}):"EMPTY"}isFormulaCellType(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n)})}renderDependentSheets(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=new Set;e.forEach(i=>{var o;const s=i==null||(o=i.address)===null||o===void 0?void 0:o.sheet;s!==void 0&&(r.has(s)||r.add(s))}),VD(this.engine).forEach((i,o)=>{if((n||o!==this.sheetId)&&r.has(o)){var s;i.render(),(s=i.view)===null||s===void 0||s.adjustElementsSize()}})}validateDependentCells(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=o=>{var s;const{row:a,col:l,sheet:u}=(s=o?.address)!==null&&s!==void 0?s:{};return ce(u)?`${u}:${a}x${l}`:""},i=new Set(n.map(o=>r(o)));e.forEach(o=>{var s,a;const{row:l,col:u}=(s=o.address)!==null&&s!==void 0?s:{};if(ce(l)===!1||ce(u)===!1||l>=this.hot.countRows()||u>=this.hot.countCols())return;const c=o==null||(a=o.address)===null||a===void 0?void 0:a.sheet,h=r(o);if(c!==void 0&&!i.has(h)){const d=VD(this.engine).get(c);if(!d)return;d.validateCell(d.getDataAtCell(l,u),d.getCellMeta(l,u),()=>{})}})}syncChangeWithEngine(e,n,r){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(i)){et(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const o=this.hot.getCellMeta(e,n);return XE(r,o.type)&&(jD(r,o.dateFormat)?r=UD(r,o.dateFormat):$J(r)===!1&&(r=`'${r}`)),this.engine.setCellContents(i,r)}}function dd(t){this.sheetName=t,this.sheetId=this.engine.getSheetId(this.sheetName)}function QJ(t,e,n){const r=this.hot.propToCol(n);if(this.isFormulaCellType(e,r)){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId},o=this.hot.getCellMeta(e,r);let s=this.engine.getCellValue(i);return o.type==="date"&&Bn(s)&&(s=zD(s,o.dateFormat)),typeof s=="object"&&s!==null?s.value:s}return t}function JJ(t,e,n){const{row:r,col:i}=e.getTopStartCorner(),{row:o,col:s}=e.getBottomEndCorner(),{row:a,col:l}=n.getTopStartCorner(),{row:u,col:c}=n.getBottomEndCorner(),h={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(r),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId}},d={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(a),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(u),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(c),sheet:this.sheetId}};if(this.engine.isItPossibleToSetCellContents(d)===!1)return!1;const f=this.engine.getFillRangeData(h,d),{row:m,col:b}=h.start,{row:S,col:E}=h.end,v=S-m+1,I=E-b+1;for(let M=0;M<f.length;M+=1)for(let T=0;T<f[M].length;T+=1){const P=f[M][T],D=m+M%v,K=b+T%I,Y=this.hot.getCellMeta(D,K);XE(P,Y.type)&&(P.startsWith("'")?f[M][T]=P.slice(1):this.isFormulaCellType(D,K,this.sheetId)===!1&&(f[M][T]=FJ(P,Y.dateFormat)))}return f}function XD(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(hi(Nn))||js(Mm,this,At(this.hot.getSettings().data))}function eee(){if(sl(Mm,this)){this.switchSheet(this.sheetName);return}const t=this.hot.getSourceDataArray();t.forEach((n,r)=>{n.forEach((i,o)=>{const s=this.hot.getCellMeta(r,o,{skipMetaExtension:!0}),a=s.dateFormat;XE(i,s.type)&&(jD(i,a)?t[r][o]=UD(i,a):i.startsWith("=")||(t[r][o]=`'${i}`))})}),js(ns,this,!0);const e=this.engine.setSheetContent(this.sheetId,t);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(e),js(ns,this,!1)}function ZD(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(n.includes(hi(Nn)))return;const r=DJ(this.engine,this.hot.getSettings()[Nn].sheetName);if(Ke(Ze,this,dd).call(this,r),n!=="updateSettings")if(sl(Mm,this))this.switchSheet(this.sheetName);else{const i=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,i)){js(ns,this,!0);const o=this.engine.setSheetContent(this.sheetId,i);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(o),js(ns,this,!1)}}}function tee(t,e,n,r){if(r!=="get"||sl(ns,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t);if(i===null||e===null)return;const o=this.getCellType(i,e);if(o==="VALUE"||o==="EMPTY"){n.value=LJ(n.value);return}const s={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let a=this.engine.getCellValue(s);const l=this.hot.getCellMeta(i,e,{skipMetaExtension:!0});l.type==="date"&&Bn(a)&&(a=zD(a,l.dateFormat)),n.value=typeof a=="object"&&a!==null?a.value:a}function nee(t,e,n,r){if(r!=="get"||sl(ns,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t),o=this.hot.propToCol(e);if(i===null||o===null)return;const s=this.getCellType(i,o);if(s==="VALUE"||s==="EMPTY")return;const a=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(a.width===0&&a.height===0)return;const l={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId};n.value=this.engine.getCellSerialized(l)}function QD(t,e){if(Bu(e))return;const n=[],r=[],i=this.engine.batch(()=>{t.forEach(o=>{let[s,a,,l]=o;const u=this.hot.propToCol(a),c=this.hot.toPhysicalRow(s),h=this.hot.toPhysicalColumn(u),d={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(u),sheet:this.sheetId};c!==null&&h!==null?this.syncChangeWithEngine(s,u,l):n.push([s,u,l]),r.push({address:d})})});n.length&&this.hot.addHookOnce("afterChange",()=>{const o=this.engine.batch(()=>{n.forEach(s=>{let[a,l,u]=s;this.syncChangeWithEngine(a,l,u)})});this.renderDependentSheets(o,!0)}),this.renderDependentSheets(i),this.validateDependentCells(i,r)}function ree(t,e){if(Bu(e))return;const n=[],r=[];t.forEach(i=>{let[o,s,,a]=i;const l=this.hot.propToCol(s);if(!Bn(l))return;const u={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(u)){et(`Not possible to set source cell data at ${JSON.stringify(u)}`);return}r.push({address:u}),n.push(...this.engine.setCellContents(u,a))}),this.renderDependentSheets(n),this.validateDependentCells(n,r)}function iee(t,e){let n=this.rowAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countRows()&&(n=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[n,e]))return!1}function oee(t,e){let n=this.columnAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countCols()&&(n=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[n,e]))return!1}function see(t,e,n){return this.rowAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveRows(this.sheetId,[o,1]))===!1?!1:void 0}function aee(t,e,n){return this.columnAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[o,1]))===!1?!1:void 0}function lee(t,e,n){if(Bu(n))return;const r=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function uee(t,e,n){if(Bu(n))return;const r=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function cee(t,e,n,r){if(Bu(r))return;const i=this.rowAxisSyncer.getRemovedHfIndexes().sort((s,a)=>a-s),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeRows(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function hee(t,e,n,r){if(Bu(r))return;const i=this.columnAxisSyncer.getRemovedHfIndexes().sort((s,a)=>a-s),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeColumns(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function dee(t,e,n){var r;js(ns,this,!0);const i=this.hot.getSourceDataArray(n,0,n+(((r=e.__children)===null||r===void 0?void 0:r.length)||0),this.hot.countSourceCols());js(ns,this,!1),i.forEach((o,s)=>{o.forEach((a,l)=>{this.engine.setCellContents({col:l,row:n+s,sheet:this.sheetId},[[a]])})})}function fee(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function gee(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function mee(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function pee(t){this.hot.runHooks("afterSheetAdded",t)}function wee(t,e){Ke(Ze,this,dd).call(this,e),this.hot.runHooks("afterSheetRenamed",t,e)}function vee(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function Cee(t){return{key:"hidden_columns_hide",name(){const e=this.getSelectedLast();let n=0;if(Array.isArray(e)){const[,r,,i]=e;r-i!==0&&(n=1)}return this.getTranslatedPhrase(Lb,n)},callback(){const{from:e,to:n}=this.getSelectedRangeLast(),r=Math.max(Math.min(e.col,n.col),0),i=Math.max(e.col,n.col),o=[];for(let l=r;l<=i;l+=1)o.push(l);t.hideColumns(o);const s=o[o.length-1],a=this.columnIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectColumns(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}}function yee(t){const e=[];return{key:"hidden_columns_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase($b,n)},callback(){var n,r;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(n=this.columnIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&n!==void 0?n:0,o=(r=this.columnIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&r!==void 0?r:this.countCols()-1,t.showColumns(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countCols()||this.selectColumns(i,o)},disabled:!1,hidden(){const n=je(t.getHiddenColumns(),h=>this.toPhysicalColumn(h));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const r=this.getSelectedRangeLast(),i=r.getTopStartCorner().col,o=r.getBottomEndCorner().col,s=this.columnIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(m=>n.includes(m)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countCols()));else{const h=this.countCols()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return H(c,h=>{e.push(this.toVisualColumn(h))}),e.length===0}}}function bee(t,e){JD(t,e),e.add(t)}function See(t,e,n){JD(t,e),e.set(t,n)}function JD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function al(t,e){return t.get(Us(t,e))}function ek(t,e,n){return t.set(Us(t,e),n),n}function Us(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")}re.getSingleton().register("beforeHideColumns"),re.getSingleton().register("afterHideColumns"),re.getSingleton().register("beforeUnhideColumns"),re.getSingleton().register("afterUnhideColumns");const tk="hiddenColumns",Ree=310;var oo=new WeakMap,ll=new WeakSet;class Eee extends Xe{constructor(){super(...arguments),bee(this,ll),See(this,oo,null)}static get PLUGIN_KEY(){return tk}static get PLUGIN_PRIORITY(){return Ree}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[tk]}enablePlugin(){var e=this;this.enabled||(ek(oo,this,new cg),al(oo,this).addLocalHook("init",()=>Us(ll,this,Oee).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,al(oo,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Us(ll,e,Pee).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>Us(ll,this,_ee).call(this,n,r,i)),this.addHook("modifyColWidth",(n,r)=>Us(ll,this,Tee).call(this,n,r),2),this.addHook("afterGetColHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Us(ll,e,Iee).call(e,...r)}),this.addHook("modifyCopyableRange",n=>Us(ll,this,Mee).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.columnIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;const o=al(oo,this).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalColumn(u));H(l,u=>{o[u]=!1}),i=tr(o,(u,c,h)=>(c&&u.push(this.hot.toVisualColumn(h)),u),[])}this.hot.runHooks("beforeUnhideColumns",n,i,r&&s)!==!1&&(r&&s&&al(oo,this).setValues(o),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",n,i,r&&s,r&&i.length<n.length))}showColumn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.showColumns(n)}hideColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeHideColumns",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{H(e,s=>{al(oo,this).setValueAtIndex(this.hot.toPhysicalColumn(s),!0)})},!0),this.hot.runHooks("afterHideColumns",n,i,r,r&&i.length>n.length))}hideColumn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.hideColumns(n)}getHiddenColumns(){return je(al(oo,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return al(oo,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const n=this.hot.countCols();return Array.isArray(e)&&e.length>0?e.every(r=>Number.isInteger(r)&&r>=0&&r<n):!1}resetCellsMeta(){H(this.hot.getCellsMeta(),e=>{e.skipColumnOnPaste=!1})}destroy(){ek(oo,this,null),super.destroy()}}function Tee(t,e){if(this.isHidden(e))return 0;if(this.getSetting("indicators")&&(this.isHidden(e+1)||this.isHidden(e-1))&&typeof t=="number"&&this.hot.hasColHeaders())return t+15}function _ee(t,e,n){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(e)&&(n.skipColumnOnPaste=!0),this.isHidden(e-1))n.className=n.className||"",n.className.indexOf("afterHiddenColumn")===-1&&(n.className+=" afterHiddenColumn");else if(n.className){const r=n.className.split(" ");if(r.length>0){const i=r.indexOf("afterHiddenColumn");i>-1&&r.splice(i,1),n.className=r.join(" ")}}}function Mee(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],n=(r,i,o,s)=>{e.push({startRow:r,endRow:i,startCol:o,endCol:s})};return H(t,r=>{let i=!0,o=0;fe(r.startCol,r.endCol,s=>{this.isHidden(s)?(i||n(r.startRow,r.endRow,o,s-1),i=!0):(i&&(o=s),s===r.endCol&&n(r.startRow,r.endRow,o,s),i=!1)})}),e}function Iee(t,e){if(!this.getSetting("indicators")||t<0)return;const n=[];t>=1&&this.isHidden(t-1)&&n.push("afterHiddenColumn"),t<this.hot.countCols()-1&&this.isHidden(t+1)&&n.push("beforeHiddenColumn"),X(e,n)}function Pee(t){t.items.push({name:ke},Cee(this),yee(this))}function Oee(){const t=this.getSetting("columns");Array.isArray(t)&&this.hideColumns(t)}function xee(t){return{key:"hidden_rows_hide",name(){const e=this.getSelectedLast();let n=0;if(Array.isArray(e)){const[r,,i]=e;r-i!==0&&(n=1)}return this.getTranslatedPhrase(Fb,n)},callback(){const{from:e,to:n}=this.getSelectedRangeLast(),r=Math.max(Math.min(e.row,n.row),0),i=Math.max(e.row,n.row),o=[];for(let l=r;l<=i;l+=1)o.push(l);t.hideRows(o);const s=o[o.length-1],a=this.rowIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectRows(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}}function Aee(t){const e=[];return{key:"hidden_rows_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(Vb,n)},callback(){var n,r;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(n=this.rowIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&n!==void 0?n:0,o=(r=this.rowIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&r!==void 0?r:this.countRows()-1,t.showRows(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countRows()||this.selectRows(i,o)},disabled:!1,hidden(){const n=je(t.getHiddenRows(),h=>this.toPhysicalRow(h));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const r=this.getSelectedRangeLast(),i=r.getTopStartCorner().row,o=r.getBottomEndCorner().row,s=this.rowIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(m=>n.includes(m)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countRows()));else{const h=this.countRows()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return H(c,h=>{e.push(this.toVisualRow(h))}),e.length===0}}}function Hee(t,e){nk(t,e),e.add(t)}function Nee(t,e,n){nk(t,e),e.set(t,n)}function nk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ul(t,e){return t.get(zs(t,e))}function rk(t,e,n){return t.set(zs(t,e),n),n}function zs(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")}re.getSingleton().register("beforeHideRows"),re.getSingleton().register("afterHideRows"),re.getSingleton().register("beforeUnhideRows"),re.getSingleton().register("afterUnhideRows");const ik="hiddenRows",Dee=320;var so=new WeakMap,cl=new WeakSet;class kee extends Xe{constructor(){super(...arguments),Hee(this,cl),Nee(this,so,null)}static get PLUGIN_KEY(){return ik}static get PLUGIN_PRIORITY(){return Dee}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[ik]}enablePlugin(){var e=this;this.enabled||(rk(so,this,new cg),ul(so,this).addLocalHook("init",()=>zs(cl,this,Bee).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,ul(so,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return zs(cl,e,Wee).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>zs(cl,this,$ee).call(this,n,r,i)),this.addHook("modifyRowHeight",(n,r)=>zs(cl,this,Lee).call(this,n,r)),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return zs(cl,e,Vee).call(e,...r)}),this.addHook("modifyCopyableRange",n=>zs(cl,this,Fee).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.rowIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;const o=ul(so,this).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalRow(u));H(l,u=>{o[u]=!1}),i=tr(o,(u,c,h)=>(c&&u.push(this.hot.toVisualRow(h)),u),[])}this.hot.runHooks("beforeUnhideRows",n,i,r&&s)!==!1&&(r&&s&&ul(so,this).setValues(o),this.hot.runHooks("afterUnhideRows",n,i,r&&s,r&&i.length<n.length))}showRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.showRows(n)}hideRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeHideRows",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{H(e,s=>{ul(so,this).setValueAtIndex(this.hot.toPhysicalRow(s),!0)})},!0),this.hot.runHooks("afterHideRows",n,i,r,r&&i.length>n.length))}hideRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.hideRows(n)}getHiddenRows(){return je(ul(so,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return ul(so,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const n=this.hot.countRows();return Array.isArray(e)&&e.length>0?e.every(r=>Number.isInteger(r)&&r>=0&&r<n):!1}resetCellsMeta(){H(this.hot.getCellsMeta(),e=>{e.skipRowOnPaste=!1})}destroy(){rk(so,this,null),super.destroy()}}function Lee(t,e){return this.isHidden(e)?0:t}function $ee(t,e,n){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(t)&&(n.skipRowOnPaste=!0),this.isHidden(t-1))n.className=n.className||"",n.className.indexOf("afterHiddenRow")===-1&&(n.className+=" afterHiddenRow");else if(n.className){const r=n.className.split(" ");if(r.length>0){const i=r.indexOf("afterHiddenRow");i>-1&&r.splice(i,1),n.className=r.join(" ")}}}function Fee(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],n=(r,i,o,s)=>{e.push({startRow:r,endRow:i,startCol:o,endCol:s})};return H(t,r=>{let i=!0,o=0;fe(r.startRow,r.endRow,s=>{this.isHidden(s)?(i||n(o,s-1,r.startCol,r.endCol),i=!0):(i&&(o=s),s===r.endRow&&n(o,s,r.startCol,r.endCol),i=!1)})}),e}function Vee(t,e){if(!this.getSetting("indicators")||t<0)return;const n=[];t>=1&&this.isHidden(t-1)&&n.push("afterHiddenRow"),t<this.hot.countRows()-1&&this.isHidden(t+1)&&n.push("beforeHiddenRow"),X(e,n)}function Wee(t){t.items.push({name:ke},xee(this),Aee(this))}function Bee(){const t=this.getSetting("rows");Array.isArray(t)&&this.hideRows(t)}function jee(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(fb)},callback(e,n){const[{start:{col:r}}]=n;t.freezeColumn(r),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let n=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(n=!0),n}}}function Uee(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(gb)},callback(e,n){const[{start:{col:r}}]=n;t.unfreezeColumn(r),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let n=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(n=!0),n}}}function zee(t,e){ok(t,e),e.add(t)}function Yee(t,e,n){ok(t,e),e.set(t,n)}function ok(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function s0(t,e){return t.get(Im(t,e))}function a0(t,e,n){return t.set(Im(t,e),n),n}function Im(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")}re.getSingleton().register("beforeColumnFreeze"),re.getSingleton().register("afterColumnFreeze"),re.getSingleton().register("beforeColumnUnfreeze"),re.getSingleton().register("afterColumnUnfreeze");const sk="manualColumnFreeze",Gee=110;var hl=new WeakMap,l0=new WeakSet;class qee extends Xe{constructor(){super(...arguments),zee(this,l0),Yee(this,hl,!1)}static get PLUGIN_KEY(){return sk}static get PLUGIN_PRIORITY(){return Gee}isEnabled(){return!!this.hot.getSettings()[sk]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>Im(l0,this,Kee).call(this,e)),this.addHook("beforeColumnMove",(e,n)=>Im(l0,this,Xee).call(this,e,n)),super.enablePlugin())}disablePlugin(){a0(hl,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const n=this.hot.getSettings(),r=n.fixedColumnsStart<this.hot.countCols()&&e>n.fixedColumnsStart-1;s0(hl,this)||a0(hl,this,!0),this.hot.runHooks("beforeColumnFreeze",e,r)!==!1&&(r&&(this.hot.columnIndexMapper.moveIndexes(e,n.fixedColumnsStart),n._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,r))}unfreezeColumn(e){const n=this.hot.getSettings(),r=n.fixedColumnsStart>0&&e<=n.fixedColumnsStart-1;s0(hl,this)||a0(hl,this,!0),this.hot.runHooks("beforeColumnUnfreeze",e,r)!==!1&&(r&&(n._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,n.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,r))}}function Kee(t){t.items.push({name:"---------"},jee(this),Uee(this))}function Xee(t,e){if(s0(hl,this)){const n=this.hot.getSettings().fixedColumnsStart;if(e<n||t.some(r=>r<n))return!1}}function Pm(t,e,n){return(e=Zee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zee(t){var e=Qee(t,"string");return typeof e=="symbol"?e:e+""}function Qee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const u0=0,ak=1,lk=2,ju="px";let uk=class{constructor(e){Pm(this,"hot",void 0),Pm(this,"_element",null),Pm(this,"state",u0),Pm(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=lk}build(){this.state===u0&&(this._element=this.hot.rootDocument.createElement("div"),this.state=ak)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=u0}isAppended(){return this.state===lk}isBuilt(){return this.state>=ak}setPosition(e,n){Bn(e)&&(this._element.style.top=e+ju),Bn(n)&&(this._element.style[this.inlineProperty]=n+ju)}getPosition(){const e=this._element.style;return{top:e.top?parseInt(e.top,10):0,start:e[this.inlineProperty]?parseInt(e[this.inlineProperty],10):0}}setSize(e,n){Bn(e)&&(this._element.style.width=e+ju),Bn(n)&&(this._element.style.height=n+ju)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,n){Bn(e)&&(this._element.style.marginTop=e+ju),Bn(n)&&(this._element.style[`margin${hi(this.inlineProperty)}`]=n+ju)}getOffset(){const e=this._element.style,n=`margin${hi(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[n]?parseInt(e[n],10):0}}};const Jee="ht__manualColumnMove--backlight";let ete=class extends uk{build(){super.build(),X(this._element,Jee)}};const tte="ht__manualColumnMove--guideline";let nte=class extends uk{build(){super.build(),X(this._element,tte)}};function rte(t,e){ck(t,e),e.add(t)}function Pi(t,e,n){ck(t,e),e.set(t,n)}function ck(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fr(t,e,n){return t.set(Ys(t,e),n),n}function he(t,e){return t.get(Ys(t,e))}function Ys(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")}re.getSingleton().register("beforeColumnMove"),re.getSingleton().register("afterColumnMove");const c0="manualColumnMove",ite=120,hk="ht__manualColumnMove",Om="show-ui",h0="on-moving--columns",d0="after-selection--columns";var Gn=new WeakMap,Gs=new WeakMap,rs=new WeakMap,xm=new WeakMap,qs=new WeakMap,qn=new WeakMap,Am=new WeakMap,ei=new WeakMap,Uu=new WeakMap,Hm=new WeakMap,fd=new WeakMap,dl=new WeakSet;class ote extends Xe{constructor(){super(...arguments),rte(this,dl),Pi(this,Gn,new ete(this.hot)),Pi(this,Gs,new nte(this.hot)),Pi(this,rs,[]),Pi(this,xm,0),Pi(this,qs,!1),Pi(this,qn,{}),Pi(this,Am,void 0),Pi(this,ei,void 0),Pi(this,Uu,void 0),Pi(this,Hm,void 0),Pi(this,fd,void 0)}static get PLUGIN_KEY(){return c0}static get PLUGIN_PRIORITY(){return ite}isEnabled(){return!!this.hot.getSettings()[c0]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ys(dl,e,ste).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ys(dl,e,lte).call(e,...r)}),this.addHook("afterScrollVertically",()=>Ys(dl,this,cte).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ys(dl,e,hte).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),X(this.hot.rootElement,hk),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){ve(this.hot.rootElement,hk),this.unregisterEvents(),he(Gn,this).destroy(),he(Gs,this).destroy(),super.disablePlugin()}moveColumn(e,n){return this.moveColumns([e],n)}moveColumns(e,n){const r=he(Am,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeColumnMove",e,n,r,i);if(fr(Am,this,void 0),o===!1)return;i&&this.hot.columnIndexMapper.moveIndexes(e,n);const s=i&&this.isColumnOrderChanged(e,n);return this.hot.runHooks("afterColumnMove",e,n,r,i,s),s}dragColumn(e,n){return this.dragColumns([e],n)}dragColumns(e,n){const r=this.countFinalIndex(e,n);return fr(Am,this,n),this.moveColumns(e,r)}isMovePossible(e,n){const r=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),i=e.length+n>r,o=n<0,s=e.some(l=>l<0),a=e.some(l=>l>=r);return!(i||o||s||a)}isColumnOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}countFinalIndex(e,n){const r=tr(e,(i,o)=>(o<n&&(i+=1),i),0);return n-r}getColumnsWidth(e,n){const r=this.hot.columnIndexMapper;let i=0;for(let o=e;o<=n;o+=1){const s=r.getRenderableFromVisualIndex(o);o<0?i+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:s!==null&&(i+=this.hot.view._wt.wtTable.getColumnWidth(s)||0)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[c0];if(Array.isArray(e))this.moveColumns(e,0);else if(e!==void 0){const n=this.persistentStateLoad();n.length&&this.moveColumns(n,0)}}isFixedColumnsStart(e){return e<this.hot.getSettings().fixedColumnsStart}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualColumnMove",this.hot.columnIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualColumnMove",e),e.value?e.value:[]}prepareColumnsToMoving(e,n){const r=[];return fe(e,n,i=>{r.push(i)}),r}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(he(ei,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const n=this.hot.view._wt.wtTable,r=this.hot.view._wt.wtOverlays.scrollableElement,i=typeof r.scrollX=="number"?r.scrollX:r.scrollLeft;let o=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,he(ei,this)-1);const s=n.hider.offsetWidth,a=n.TBODY.offsetLeft,l=he(Gn,this).getOffset().start,u=he(Gn,this).getSize().width;let c=0,h=0;if(this.hot.isRtl()){const m=this.hot.rootWindow,b=Qt(this.hot.rootElement),S=m.innerWidth-he(Uu,this)-b;h=m.innerWidth-he(qn,this).eventPageX-S-(r.scrollX===void 0?i:0)}else h=he(qn,this).eventPageX-(he(Uu,this)-(r.scrollX===void 0?i:0));if(he(Hm,this)&&(c=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(he(ei,this))&&(o+=i),o+=c,he(ei,this)<0)he(fd,this)>0?he(qn,this).col=0:he(qn,this).col=e>0?e-1:e;else if(he(qn,this).TD.offsetWidth/2+o<=h){const m=he(ei,this)>=he(xm,this)?he(xm,this)-1:he(ei,this);he(qn,this).col=m+1,o+=he(qn,this).TD.offsetWidth}else he(qn,this).col=he(ei,this);let d=h,f=o;h+u+l>=s?d=s-u-l:h+l<a+c&&(d=a+c+Math.abs(l)),o>=s-1?f=s-1:f===0?f=1:r.scrollX!==void 0&&he(ei,this)<he(fd,this)&&(f-=he(Uu,this)<=r.scrollX?he(Uu,this):0),he(Gn,this).setPosition(null,d),he(Gs,this).setPosition(null,f)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>Ys(dl,this,ate).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Ys(dl,this,ute).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){he(Gn,this).build(),he(Gs,this).build()}destroy(){he(Gn,this).destroy(),he(Gs,this).destroy(),super.destroy()}}function ste(t,e,n,r){const i=this.hot.view._wt.wtTable,o=this.hot.selection.isSelectedByColumnHeader(),s=this.hot.getSelectedRangeLast(),a=ye(t.target,"sortAction");if(!s||!o||he(qs,this)||t.button!==0||a){fr(qs,this,!1),he(rs,this).length=0,ve(this.hot.rootElement,[h0,Om]);return}const l=he(Gs,this).isBuilt()&&!he(Gs,this).isAppended(),u=he(Gn,this).isBuilt()&&!he(Gn,this).isAppended();l&&u&&(he(Gs,this).appendTo(i.hider),he(Gn,this).appendTo(i.hider));const{from:c,to:h}=s,d=Math.min(c.col,h.col),f=Math.max(c.col,h.col);if(e.row<0&&e.col>=d&&e.col<=f){r.column=!0,fr(qs,this,!0);const m=n.firstChild?Dz(t,n.firstChild).x:t.offsetX;he(qn,this).eventPageX=t.pageX,fr(ei,this,e.col),he(qn,this).TD=n,he(qn,this).col=e.col,fr(rs,this,this.prepareColumnsToMoving(d,f)),fr(Hm,this,!!this.hot.getSettings().rowHeaders),fr(xm,this,this.hot.countCols()),fr(fd,this,this.hot.getSettings().fixedColumnsStart),fr(Uu,this,On(this.hot.rootElement).left);const b=he(Hm,this)?-1:0,S=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,E=e.col<he(fd,this),v=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),I=Math.abs(m-(this.hot.isRtl()?n.offsetWidth:0)),M=this.getColumnsWidth(d,e.col-1)+I,T=this.getColumnsWidth(b,d-1)+(E?v:0)+M;he(Gn,this).setPosition(S,T),he(Gn,this).setSize(this.getColumnsWidth(d,f),i.hider.offsetHeight-S),he(Gn,this).setOffset(null,-M),X(this.hot.rootElement,h0)}else ve(this.hot.rootElement,d0),fr(qs,this,!1),he(rs,this).length=0}function ate(t){he(qs,this)&&(he(qn,this).eventPageX=t.pageX,this.refreshPositions())}function lte(t,e,n,r){!this.hot.getSelectedRangeLast()||!he(qs,this)||(he(rs,this).indexOf(e.col)>-1?ve(this.hot.rootElement,Om):X(this.hot.rootElement,Om),r.row=!0,r.column=!0,r.cell=!0,fr(ei,this,e.col),he(qn,this).TD=n)}function ute(){const t=he(qn,this).col,e=he(rs,this).length;if(fr(ei,this,void 0),fr(qs,this,!1),ve(this.hot.rootElement,[h0,Om,d0]),this.hot.selection.isSelectedByColumnHeader()&&X(this.hot.rootElement,d0),e<1||t===void 0)return;const n=he(rs,this)[0],r=this.hot.toPhysicalColumn(n),i=this.dragColumns(he(rs,this),t);if(he(rs,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const o=this.hot.toVisualColumn(r),s=o+e-1;this.hot.selectColumns(o,s)}}function cte(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,n=t.holder.scrollTop,r=e+n;he(Gn,this).setPosition(r),he(Gn,this).setSize(null,t.hider.offsetHeight-r)}function hte(){this.moveBySettingsOrLoad()}function dte(t,e){dk(t,e),e.add(t)}function Dn(t,e,n){dk(t,e),e.set(t,n)}function dk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gt(t,e,n){return t.set(Oi(t,e),n),n}function oe(t,e){return t.get(Oi(t,e))}function Oi(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 Nm="manualColumnResize",fte=130,fk="manualColumnWidths";var is=new WeakMap,Dm=new WeakMap,xr=new WeakMap,km=new WeakMap,ao=new WeakMap,gte=new WeakMap,zu=new WeakMap,Lm=new WeakMap,gr=new WeakMap,os=new WeakMap,fl=new WeakMap,$m=new WeakMap,gd=new WeakMap,md=new WeakMap,Ar=new WeakMap,pd=new WeakMap,lo=new WeakSet;class mte extends Xe{static get PLUGIN_KEY(){return Nm}static get PLUGIN_PRIORITY(){return fte}constructor(e){super(e),dte(this,lo),Dn(this,is,null),Dn(this,Dm,null),Dn(this,xr,[]),Dn(this,km,null),Dn(this,ao,null),Dn(this,gte,null),Dn(this,zu,null),Dn(this,Lm,null),Dn(this,gr,this.hot.rootDocument.createElement("DIV")),Dn(this,os,this.hot.rootDocument.createElement("DIV")),Dn(this,fl,null),Dn(this,$m,!1),Dn(this,gd,0),Dn(this,md,null),Dn(this,Ar,void 0),Dn(this,pd,void 0),X(oe(gr,this),"manualColumnResizer"),X(oe(os,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Nm]}enablePlugin(){var e=this;this.enabled||(Gt(Ar,this,new Ms),oe(Ar,this).addLocalHook("init",()=>Oi(lo,this,pte).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,oe(Ar,this)),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Oi(lo,e,Ste).call(e,...r)},1),this.addHook("beforeStretchingColumnWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Oi(lo,e,Rte).call(e,...r)},1),this.addHook("beforeColumnResize",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Oi(lo,e,Ete).call(e,...r)}),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Gt(pd,this,oe(Ar,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",fk,oe(Ar,this).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",fk,e),e.value}setManualSize(e,n){const r=Math.max(n,20),i=this.hot.toPhysicalColumn(e);return oe(Ar,this).setValueAtIndex(i,r),r}clearManualSize(e){const n=this.hot.toPhysicalColumn(e);oe(Ar,this).setValueAtIndex(n,null)}setupHandlePosition(e){if(!e.parentNode)return;Gt(is,this,e);const{_wt:n}=this.hot.view,r=n.wtTable.getCoords(oe(is,this)),i=r.col;if(i<0)return;const o=an(oe(is,this)),s=oe(is,this).getBoundingClientRect(),a=i<n.getSetting("fixedColumnsStart");let l;a&&(l=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(oe(is,this),r.row,r.col)),l||(l=n.wtOverlays.topOverlay.getRelativeCellPosition(oe(is,this),r.row,r.col)),Gt(Dm,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),Gt(xr,this,[]);const u=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&u){const c=this.hot.getSelectedRange();H(c,h=>{const d=h.getTopStartCorner().col,f=h.getBottomEndCorner().col;fe(d,f,m=>{oe(xr,this).includes(m)||oe(xr,this).push(m)})})}oe(xr,this).includes(oe(Dm,this))||Gt(xr,this,[oe(Dm,this)]),Gt(Lm,this,l.start-6),Gt(zu,this,parseInt(s.width,10)),oe(gr,this).style.top=`${l.top}px`,oe(gr,this).style[this.inlineDir]=`${oe(Lm,this)+oe(zu,this)}px`,oe(gr,this).style.height=`${o}px`,this.hot.rootElement.appendChild(oe(gr,this))}refreshHandlePosition(){oe(gr,this).style[this.inlineDir]=`${oe(Lm,this)+oe(km,this)}px`}setupGuidePosition(){const e=parseInt(an(oe(gr,this)),10),n=parseInt(oe(gr,this).style.top,10)+e,r=this.hot.view.getTableHeight();X(oe(gr,this),"active"),X(oe(os,this),"active"),oe(os,this).style.top=`${n}px`,this.refreshGuidePosition(),oe(os,this).style.height=`${r-e}px`,this.hot.rootElement.appendChild(oe(os,this))}refreshGuidePosition(){oe(os,this).style[this.inlineDir]=oe(gr,this).style[this.inlineDir]}hideHandleAndGuide(){ve(oe(gr,this),"active"),ve(oe(os,this),"active")}checkIfColumnHeader(e){const n=wa(e,["THEAD"],this.hot.rootElement),{topOverlay:r,topInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.THEAD,i.clone.wtTable.THEAD].includes(n)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},n=(r,i)=>{const o=this.hot.runHooks("beforeColumnResize",oe(ao,this),r,!0);o!==void 0&&Gt(ao,this,o),this.setManualSize(r,oe(ao,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",oe(ao,this),r,!0),i&&e()};oe(gd,this)>=2&&(oe(xr,this).length>1?(H(oe(xr,this),i=>{n(i)}),e()):H(oe(xr,this),i=>{n(i,!0)})),Gt(gd,this,0),Gt(md,this,null)}bindEvents(){const{rootWindow:e,rootElement:n}=this.hot;this.eventManager.addEventListener(n,"mouseover",r=>Oi(lo,this,wte).call(this,r)),this.eventManager.addEventListener(n,"mousedown",r=>Oi(lo,this,vte).call(this,r)),this.eventManager.addEventListener(e,"mousemove",r=>Oi(lo,this,Cte).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>Oi(lo,this,yte).call(this)),this.eventManager.addEventListener(oe(gr,this),"contextmenu",()=>Oi(lo,this,bte).call(this))}destroy(){super.destroy()}}function pte(){const t=this.hot.getSettings()[Nm],e=this.loadManualColumnWidths();typeof e<"u"?this.hot.batchExecution(()=>{e.forEach((n,r)=>{oe(Ar,this).setValueAtIndex(r,n)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((n,r)=>{oe(Ar,this).setValueAtIndex(r,n)})},!0),Gt(pd,this,t)):t===!0&&Array.isArray(oe(pd,this))&&this.hot.batchExecution(()=>{oe(pd,this).forEach((n,r)=>{oe(Ar,this).setValueAtIndex(r,n)})},!0)}function wte(t){if(!hx(t.target)&&oe($m,this)!==!0&&this.checkIfColumnHeader(t.target)){const e=this.getClosestTHParent(t.target);if(!e)return;const n=e.getAttribute("colspan");e&&(n===null||n==="1")&&(oe(fl,this)||this.setupHandlePosition(e))}}function vte(t){t.target.parentNode===this.hot.rootElement&&ye(t.target,"manualColumnResizer")&&(this.setupHandlePosition(oe(is,this)),this.setupGuidePosition(),Gt(fl,this,!0),oe(md,this)===null&&(Gt(md,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(oe(md,this))),Gt(gd,this,oe(gd,this)+1),this.startX=t.pageX,Gt(ao,this,oe(zu,this)))}function Cte(t){if(oe(fl,this)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();Gt(km,this,oe(zu,this)+e),H(oe(xr,this),n=>{Gt(ao,this,this.setManualSize(n,oe(km,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function yte(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(n,r)=>{this.hot.runHooks("beforeColumnResize",oe(ao,this),n,!1),r&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",oe(ao,this),n,!1)};oe(fl,this)&&(this.hideHandleAndGuide(),Gt(fl,this,!1),oe(ao,this)!==oe(zu,this)&&(oe(xr,this).length>1?(H(oe(xr,this),r=>{e(r)}),t()):H(oe(xr,this),r=>{e(r,!0)})),this.setupHandlePosition(oe(is,this)))}function bte(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(oe(gr,this)),this.hot.rootElement.removeChild(oe(os,this)),Gt(fl,this,!1),Gt($m,this,!0),this.hot._registerImmediate(()=>{Gt($m,this,!1)})}function Ste(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalColumn(e),i=oe(Ar,this).getValueAtIndex(r);this.hot.getSettings()[Nm]&&i&&(n=i)}return n}function Rte(t,e){const n=oe(Ar,this).getValueAtIndex(this.hot.toPhysicalColumn(e));return typeof n=="number"?n:t}function Ete(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function f0(t,e,n){return(e=Tte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tte(t){var e=_te(t,"string");return typeof e=="symbol"?e:e+""}function _te(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const g0=0,gk=1,mk=2,Yu="px";let pk=class{constructor(e){f0(this,"hot",void 0),f0(this,"_element",null),f0(this,"state",g0),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=mk}build(){this.state===g0&&(this._element=this.hot.rootDocument.createElement("div"),this.state=gk)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=g0}isAppended(){return this.state===mk}isBuilt(){return this.state>=gk}setPosition(e,n){e!==void 0&&(this._element.style.top=e+Yu),n!==void 0&&(this._element.style.left=n+Yu)}getPosition(){return{top:this._element.style.top?parseInt(this._element.style.top,10):0,left:this._element.style.left?parseInt(this._element.style.left,10):0}}setSize(e,n){e&&(this._element.style.width=e+Yu),n&&(this._element.style.height=n+Yu)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,n){e&&(this._element.style.marginTop=e+Yu),n&&(this._element.style.marginLeft=n+Yu)}getOffset(){return{top:this._element.style.marginTop?parseInt(this._element.style.marginTop,10):0,left:this._element.style.marginLeft?parseInt(this._element.style.marginLeft,10):0}}};const Mte="ht__manualRowMove--backlight";class Ite extends pk{build(){super.build(),X(this._element,Mte)}}const Pte="ht__manualRowMove--guideline";class Ote extends pk{build(){super.build(),X(this._element,Pte)}}function xte(t,e){wk(t,e),e.add(t)}function Gu(t,e,n){wk(t,e),e.set(t,n)}function wk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gl(t,e,n){return t.set(Ks(t,e),n),n}function Te(t,e){return t.get(Ks(t,e))}function Ks(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")}re.getSingleton().register("beforeRowMove"),re.getSingleton().register("afterRowMove");const m0="manualRowMove",Ate=140,vk="ht__manualRowMove",Fm="show-ui",p0="on-moving--rows",w0="after-selection--rows";var Kn=new WeakMap,Xs=new WeakMap,ss=new WeakMap,Zs=new WeakMap,mr=new WeakMap,Vm=new WeakMap,ml=new WeakSet;class Hte extends Xe{constructor(){super(...arguments),xte(this,ml),Gu(this,Kn,new Ite(this.hot)),Gu(this,Xs,new Ote(this.hot)),Gu(this,ss,[]),Gu(this,Zs,void 0),Gu(this,mr,{}),Gu(this,Vm,void 0)}static get PLUGIN_KEY(){return m0}static get PLUGIN_PRIORITY(){return Ate}isEnabled(){return!!this.hot.getSettings()[m0]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ks(ml,e,Nte).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ks(ml,e,kte).call(e,...r)}),this.addHook("afterScrollHorizontally",()=>Ks(ml,this,$te).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ks(ml,e,Fte).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),X(this.hot.rootElement,vk),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){ve(this.hot.rootElement,vk),this.unregisterEvents(),Te(Kn,this).destroy(),Te(Xs,this).destroy(),super.disablePlugin()}moveRow(e,n){return this.moveRows([e],n)}moveRows(e,n){const r=Te(Vm,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeRowMove",e,n,r,i);if(gl(Vm,this,void 0),o===!1)return;i&&this.hot.rowIndexMapper.moveIndexes(e,n);const s=i&&this.isRowOrderChanged(e,n);return this.hot.runHooks("afterRowMove",e,n,r,i,s),s}dragRow(e,n){return this.dragRows([e],n)}dragRows(e,n){const r=this.countFinalIndex(e,n);return gl(Vm,this,n),this.moveRows(e,r)}isMovePossible(e,n){const r=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),i=e.length+n>r,o=n<0,s=e.some(l=>l<0),a=e.some(l=>l>=r);return!(i||o||s||a)}isRowOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}countFinalIndex(e,n){const r=tr(e,(i,o)=>(o<n&&(i+=1),i),0);return n-r}getRowsHeight(e,n){const r=this.hot.rowIndexMapper;let i=0;for(let o=e;o<=n;o++){const s=r.getRenderableFromVisualIndex(o);s!==null&&(i+=this.hot.view._wt.wtTable.getRowHeight(s)||this.hot.view.getDefaultRowHeight())}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[m0];if(Array.isArray(e))this.moveRows(e,0);else if(e!==void 0){const n=this.persistentStateLoad();n.length&&this.moveRows(n,0)}}isFixedRowTop(e){return e<this.hot.getSettings().fixedRowsTop}isFixedRowBottom(e){return e>this.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualRowMove",this.hot.rowIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualRowMove",e),e.value?e.value:[]}prepareRowsToMoving(){const e=this.hot.getSelectedRangeLast(),n=[];if(!e)return n;const{from:r,to:i}=e,o=Math.min(r.row,i.row),s=Math.max(r.row,i.row);return fe(o,s,a=>{n.push(a)}),n}refreshPositions(){const e=Te(mr,this).coords,n=this.hot.getFirstFullyVisibleRow(),r=this.hot.getLastFullyVisibleRow(),i=this.hot.countRows();this.isFixedRowTop(e.row)&&n>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(n-1,-1)),this.isFixedRowBottom(e.row)&&r<i&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(r+1,1),void 0,!0);const o=this.hot.view._wt.wtTable,s=Te(mr,this).TD,a=this.hot.rootElement,l=On(a),u=Vc(a),c=o.holder.scrollTop,h=this.hot.rootWindow!==u?u.scrollTop:0,d=l.top-h,f=Te(mr,this).eventPageY-d+c,m=o.hider.offsetHeight,b=o.TBODY.offsetTop,S=Te(Kn,this).getOffset().top,E=Te(Kn,this).getSize().height,v=s.offsetHeight/2,I=s.offsetHeight;let M=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const T=f>=M+v;this.isFixedRowTop(e.row)&&(M+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?Te(mr,this).row=n>0?n-1:n:T?(Te(mr,this).row=e.row+1,M+=e.row===0?I-1:I):Te(mr,this).row=e.row;let P=f,D=M;f+E+S>=m?P=m-E-S:f+S<b&&(P=b+Math.abs(S)),M>=m-1&&(D=m-1),Te(Kn,this).setPosition(P),Te(Xs,this).setPosition(D)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>Ks(ml,this,Dte).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Ks(ml,this,Lte).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Te(Kn,this).build(),Te(Xs,this).build()}destroy(){Te(Kn,this).destroy(),Te(Xs,this).destroy(),super.destroy()}}function Nte(t,e,n,r){const{wtTable:i,wtViewport:o}=this.hot.view._wt,s=this.hot.selection.isSelectedByRowHeader(),a=this.hot.getSelectedRangeLast();if(!a||!s||Te(Zs,this)||t.button!==0){gl(Zs,this,!1),Te(ss,this).length=0,ve(this.hot.rootElement,[p0,Fm]);return}const l=Te(Xs,this).isBuilt()&&!Te(Xs,this).isAppended(),u=Te(Kn,this).isBuilt()&&!Te(Kn,this).isAppended();l&&u&&(Te(Xs,this).appendTo(i.hider),Te(Kn,this).appendTo(i.hider));const{from:c,to:h}=a,d=Math.min(c.row,h.row),f=Math.max(c.row,h.row);if(e.col<0&&e.row>=d&&e.row<=f){r.row=!0,gl(Zs,this,!0),Te(mr,this).eventPageY=t.pageY,Te(mr,this).coords=e,Te(mr,this).TD=n,gl(ss,this,this.prepareRowsToMoving());const m=i.holder.scrollLeft+o.getRowHeaderWidth(),b=this.getRowsHeight(d,e.row-1)+(t.clientY-n.getBoundingClientRect().top);Te(Kn,this).setPosition(null,m),Te(Kn,this).setSize(i.hider.offsetWidth-m,this.getRowsHeight(d,f)),Te(Kn,this).setOffset(-b,null),X(this.hot.rootElement,p0),this.refreshPositions()}else ve(this.hot.rootElement,w0),gl(Zs,this,!1),Te(ss,this).length=0}function Dte(t){Te(Zs,this)&&(Te(mr,this).eventPageY=t.pageY,this.refreshPositions())}function kte(t,e,n,r){!this.hot.getSelectedRangeLast()||!Te(Zs,this)||(Te(ss,this).indexOf(e.row)>-1?ve(this.hot.rootElement,Fm):X(this.hot.rootElement,Fm),r.row=!0,r.column=!0,r.cell=!0,Te(mr,this).coords=e,Te(mr,this).TD=n)}function Lte(){const t=Te(mr,this).row,e=Te(ss,this).length;if(gl(Zs,this,!1),ve(this.hot.rootElement,[p0,Fm,w0]),this.hot.selection.isSelectedByRowHeader()&&X(this.hot.rootElement,w0),e<1||t===void 0)return;const n=Te(ss,this)[0],r=this.hot.toPhysicalRow(n),i=this.dragRows(Te(ss,this),t);if(Te(ss,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const o=this.hot.toVisualRow(r),s=o+e-1;this.hot.selectRows(o,s)}}function $te(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),n=t.holder.scrollLeft,r=e+n;Te(Kn,this).setPosition(null,r),Te(Kn,this).setSize(t.hider.offsetWidth-r)}function Fte(){this.moveBySettingsOrLoad()}function Vte(t,e){Ck(t,e),e.add(t)}function kn(t,e,n){Ck(t,e),e.set(t,n)}function Ck(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $t(t,e,n){return t.set(as(t,e),n),n}function ie(t,e){return t.get(as(t,e))}function as(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 Wm="manualRowResize",Wte=30,yk="manualRowHeights";var uo=new WeakMap,Bm=new WeakMap,Hr=new WeakMap,wd=new WeakMap,Qs=new WeakMap,v0=new WeakMap,qu=new WeakMap,jm=new WeakMap,Xn=new WeakMap,co=new WeakMap,pl=new WeakMap,Um=new WeakMap,vd=new WeakMap,Cd=new WeakMap,xi=new WeakMap,yd=new WeakMap,Js=new WeakSet;class Bte extends Xe{static get PLUGIN_KEY(){return Wm}static get PLUGIN_PRIORITY(){return Wte}constructor(e){super(e),Vte(this,Js),kn(this,uo,null),kn(this,Bm,null),kn(this,Hr,[]),kn(this,wd,null),kn(this,Qs,null),kn(this,v0,null),kn(this,qu,null),kn(this,jm,null),kn(this,Xn,this.hot.rootDocument.createElement("DIV")),kn(this,co,this.hot.rootDocument.createElement("DIV")),kn(this,pl,!1),kn(this,Um,!1),kn(this,vd,0),kn(this,Cd,null),kn(this,xi,void 0),kn(this,yd,void 0),X(ie(Xn,this),"manualRowResizer"),X(ie(co,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Wm]}enablePlugin(){this.enabled||($t(xi,this,new Ms),ie(xi,this).addLocalHook("init",()=>as(Js,this,Kte).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,ie(xi,this)),this.addHook("modifyRowHeight",(e,n)=>as(Js,this,qte).call(this,e,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){$t(yd,this,ie(xi,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",yk,ie(xi,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",yk,e),e.value}setManualSize(e,n){const r=this.hot.toPhysicalRow(e),i=Math.max(n,this.hot.view.getDefaultRowHeight());return ie(xi,this).setValueAtIndex(r,i),i}getLastDesiredRowHeight(){return ie(wd,this)}setupHandlePosition(e){$t(uo,this,e);const{view:n}=this.hot,{_wt:r}=n,i=r.wtTable.getCoords(ie(uo,this)),o=i.row;if(o<0)return;const s=Qt(ie(uo,this)),a=ie(uo,this).getBoundingClientRect(),l=o<r.getSetting("fixedRowsTop"),u=o>=n.countNotHiddenRowIndexes(0,1)-r.getSetting("fixedRowsBottom");let c;l?c=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ie(uo,this),i.row,i.col):u&&(c=r.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(ie(uo,this),i.row,i.col)),c||(c=r.wtOverlays.inlineStartOverlay.getRelativeCellPosition(ie(uo,this),i.row,i.col)),$t(Bm,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(o)),$t(Hr,this,[]);const h=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&h){const d=this.hot.getSelectedRange();H(d,f=>{const m=f.getTopStartCorner().row,b=f.getBottomStartCorner().row;fe(m,b,S=>{ie(Hr,this).includes(S)||ie(Hr,this).push(S)})})}ie(Hr,this).includes(ie(Bm,this))||$t(Hr,this,[ie(Bm,this)]),$t(jm,this,c.top-6),$t(qu,this,parseInt(a.height,10)),ie(Xn,this).style.top=`${ie(jm,this)+ie(qu,this)}px`,ie(Xn,this).style[this.inlineDir]=`${c.start}px`,ie(Xn,this).style.width=`${s}px`,this.hot.rootElement.appendChild(ie(Xn,this))}refreshHandlePosition(){ie(Xn,this).style.top=`${ie(jm,this)+ie(wd,this)}px`}setupGuidePosition(){const e=parseInt(Qt(ie(Xn,this)),10),n=parseInt(ie(Xn,this).style[this.inlineDir],10)+e,r=this.hot.view.getTableWidth();X(ie(Xn,this),"active"),X(ie(co,this),"active"),ie(co,this).style.top=ie(Xn,this).style.top,ie(co,this).style[this.inlineDir]=`${n}px`,ie(co,this).style.width=`${r-e}px`,this.hot.rootElement.appendChild(ie(co,this))}refreshGuidePosition(){ie(co,this).style.top=ie(Xn,this).style.top}hideHandleAndGuide(){ve(ie(Xn,this),"active"),ve(ie(co,this),"active")}checkIfRowHeader(e){const n=wa(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:r,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:o}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.TBODY,i.clone.wtTable.TBODY,o.clone.wtTable.TBODY].includes(n)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const n=this.hot.view._wt.wtTable.getRowHeight(e);return n!==void 0&&ie(Qs,this)<n?n:ie(Qs,this)}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},n=(r,i)=>{const o=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(r),r,!0);o!==void 0&&$t(Qs,this,o),this.setManualSize(r,ie(Qs,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!0),i&&e()};ie(vd,this)>=2&&(ie(Hr,this).length>1?(H(ie(Hr,this),i=>{n(i)}),e()):H(ie(Hr,this),i=>{n(i,!0)})),$t(vd,this,0),$t(Cd,this,null)}bindEvents(){const{rootElement:e,rootWindow:n}=this.hot;this.eventManager.addEventListener(e,"mouseover",r=>as(Js,this,jte).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>as(Js,this,Ute).call(this,r)),this.eventManager.addEventListener(n,"mousemove",r=>as(Js,this,zte).call(this,r)),this.eventManager.addEventListener(n,"mouseup",()=>as(Js,this,Yte).call(this)),this.eventManager.addEventListener(ie(Xn,this),"contextmenu",()=>as(Js,this,Gte).call(this))}destroy(){super.destroy()}}function jte(t){if(!hx(t.target)&&ie(Um,this)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(ie(pl,this)||this.setupHandlePosition(e))}}function Ute(t){ye(t.target,"manualRowResizer")&&(this.setupHandlePosition(ie(uo,this)),this.setupGuidePosition(),$t(pl,this,!0),ie(Cd,this)===null&&($t(Cd,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ie(Cd,this))),$t(vd,this,ie(vd,this)+1),$t(v0,this,t.pageY),$t(Qs,this,ie(qu,this)))}function zte(t){ie(pl,this)&&($t(wd,this,ie(qu,this)+(t.pageY-ie(v0,this))),H(ie(Hr,this),e=>{$t(Qs,this,this.setManualSize(e,ie(wd,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function Yte(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(n,r)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(n),n,!1),r&&t(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(n),n,!1)};ie(pl,this)&&(this.hideHandleAndGuide(),$t(pl,this,!1),ie(Qs,this)!==ie(qu,this)&&(ie(Hr,this).length>1?(H(ie(Hr,this),r=>{e(r)}),t()):H(ie(Hr,this),r=>{e(r,!0)})),this.setupHandlePosition(ie(uo,this)))}function Gte(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ie(Xn,this)),this.hot.rootElement.removeChild(ie(co,this)),$t(pl,this,!1),$t(Um,this,!0),this.hot._registerImmediate(()=>{$t(Um,this,!1)})}function qte(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalRow(e),i=ie(xi,this).getValueAtIndex(r);this.hot.getSettings()[Wm]&&i&&(n=i)}return n}function Kte(){const t=this.hot.getSettings()[Wm],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e<"u"?e.forEach((n,r)=>{ie(xi,this).setValueAtIndex(r,n)}):Array.isArray(t)?(t.forEach((n,r)=>{ie(xi,this).setValueAtIndex(r,n)}),$t(yd,this,t)):t===!0&&Array.isArray(ie(yd,this))&&ie(yd,this).forEach((n,r)=>{ie(xi,this).setValueAtIndex(r,n)})},!0)}var bk={},Sk;function Xte(){if(Sk)return bk;Sk=1;var t=Wf();return t("flatMap"),bk}Xte();var Rk={},Ek={},C0,Tk;function Zte(){if(Tk)return C0;Tk=1;var t=In(),e=nn(),n=Li(),r=eC();return C0=function(i,o){(!o||typeof i!="string")&&e(i);var s=r(i);return n(e(s!==void 0?t(s,i):i))},C0}var _k;function Qte(){if(_k)return Ek;_k=1;var t=vt(),e=In(),n=Jn(),r=nn(),i=Li(),o=Zte(),s=Gv(),a=xl(),l=ps(),u=s(function(){for(var c=this.iterator,h=this.mapper,d,f;;){if(f=this.inner)try{if(d=r(e(f.next,f.iterator)),!d.done)return d.value;this.inner=null}catch(m){a(c,"throw",m)}if(d=r(e(this.next,c)),this.done=!!d.done)return;try{this.inner=o(h(d.value,this.counter++),!1)}catch(m){a(c,"throw",m)}}});return t({target:"Iterator",proto:!0,real:!0,forced:l},{flatMap:function(h){return r(this),n(h),new u(i(this),{mapper:h,inner:null})}}),Ek}var Mk;function Jte(){return Mk||(Mk=1,Qte()),Rk}Jte();function ene(t,e,n){tne(t,e),e.set(t,n)}function tne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wl(t,e,n){return(e=nne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nne(t){var e=rne(t,"string");return typeof e=="symbol"?e:e+""}function rne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ik(t,e){return t.get(Pk(t,e))}function zm(t,e,n){return t.set(Pk(t,e),n),n}function Pk(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 vl=new WeakMap;class ho{constructor(e,n,r,i,o,s){wl(this,"row",void 0),wl(this,"col",void 0),wl(this,"rowspan",void 0),wl(this,"colspan",void 0),wl(this,"removed",!1),wl(this,"cellCoordsFactory",void 0),wl(this,"cellRangeFactory",void 0),ene(this,vl,null),this.row=e,this.col=n,this.rowspan=r,this.colspan=i,this.cellCoordsFactory=o,this.cellRangeFactory=s}static NEGATIVE_VALUES_WARNING(e){let{row:n,col:r,rowspan:i,colspan:o}=e;return tt`The merged cell declared with {row: ${n}, col: ${r},\x20
67
- rowspan: ${i}, colspan: ${o}} contains negative values, which is\x20
68
- not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){let{row:n,col:r}=e;return tt`The merged cell declared at [${n}, ${r}] is positioned\x20
69
- (or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL(e){let{row:n,col:r}=e;return tt`The merged cell declared at [${n}, ${r}] has both "rowspan"\x20
70
- and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){let{row:n,col:r}=e;return tt`The merged cell declared at [${n}, ${r}] has "rowspan"\x20
71
- or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){let{row:n,col:r,rowspan:i,colspan:o}=e;return n<0||r<0||i<0||o<0}static isSingleCell(e){let{rowspan:n,colspan:r}=e;return r===1&&n===1}static containsZeroSpan(e){let{rowspan:n,colspan:r}=e;return r===0||n===0}static isOutOfBounds(e,n,r){return e.row<0||e.col<0||e.row>=n||e.row+e.rowspan-1>=n||e.col>=r||e.col+e.colspan-1>=r}normalize(e){const n=e.countRows(),r=e.countCols();this.row<0?this.row=0:this.row>n-1&&(this.row=n-1),this.col<0?this.col=0:this.col>r-1&&(this.col=r-1),this.row+this.rowspan>n-1&&(this.rowspan=n-this.row),this.col+this.colspan>r-1&&(this.colspan=r-this.col),zm(vl,this,null)}includes(e,n){return this.row<=e&&this.col<=n&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=n}includesHorizontally(e){return this.col<=e&&this.col+this.colspan-1>=e}includesVertically(e){return this.row<=e&&this.row+this.rowspan-1>=e}shift(e,n){const r=e[0]||e[1],i=n+Math.abs(e[0]||e[1])-1,o=e[0]?"colspan":"rowspan",s=e[0]?"col":"row",a=Math.min(n,i),l=Math.max(n,i),u=this[s],c=this[s]+this[o]-1;if(u>=n&&(this[s]+=r),r>0)n<=c&&n>u&&(this[o]+=r);else if(r<0){if(a<=u&&l>=c)return this.removed=!0,zm(vl,this,null),!1;if(u>=a&&u<=l){const h=l-u+1,d=Math.abs(r)-h;this[s]-=d+r,this[o]-=h}else if(u<=a&&c>=l)this[o]+=r;else if(u<=a&&c>=a&&c<l){const h=c-a+1;this[o]-=h}}return zm(vl,this,null),!0}isFarther(e,n){return e?n==="down"?e.row+e.rowspan-1<this.row+this.rowspan-1:n==="up"?e.row>this.row:n==="right"?e.col+e.colspan-1<this.col+this.colspan-1:n==="left"?e.col>this.col:null:!0}getLastRow(){return this.row+this.rowspan-1}getLastColumn(){return this.col+this.colspan-1}getRange(){return Ik(vl,this)||zm(vl,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),Ik(vl,this)}}function ine(t,e){one(t,e),e.add(t)}function one(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ym(t,e,n){return(e=sne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sne(t){var e=ane(t,"string");return typeof e=="symbol"?e:e+""}function ane(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Cl(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 ea=new WeakSet;class Gm{constructor(e){ine(this,ea),Ym(this,"plugin",void 0),Ym(this,"mergedCells",[]),Ym(this,"mergedCellsMatrix",new Map),Ym(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:n,col:r}=e;return tt`The merged cell declared at [${n}, ${r}], overlaps\x20
72
- with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
73
- fix your setup.`}get(e,n){var r;return this.mergedCellsMatrix.has(e)&&(r=this.mergedCellsMatrix.get(e).get(n))!==null&&r!==void 0?r:!1}getByRange(e){const{row:n,col:r}=e.getTopStartCorner(),{row:i,col:o}=e.getBottomEndCorner(),s=this.mergedCells.length;let a=!1;for(let l=0;l<s;l++){const u=this.mergedCells[l],{row:c,col:h,rowspan:d,colspan:f}=u;if(c>=n&&c+d-1<=i&&h>=r&&h+f-1<=o){a=u;break}}return a}filterOverlappingMergeCells(e){const n=new Set;return this.mergedCells.forEach(i=>{const{row:o,col:s,colspan:a,rowspan:l}=i;for(let u=o;u<o+l;u++)for(let c=s;c<s+a;c++)n.add(`r${u},c${c}`)}),e.filter(i=>{const{row:o,col:s,colspan:a,rowspan:l}=i,u=new Set;let c=!1;for(let h=o;h<o+l;h++){for(let d=s;d<s+a;d++){const f=`r${h},c${d}`;if(n.has(f)){et(Gm.IS_OVERLAPPING_WARNING(i)),c=!0;break}u.add(f)}if(c)break}return c||n.add(...u),!c})}getWithinRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{row:r,col:i}=e.getTopStartCorner(),{row:o,col:s}=e.getBottomEndCorner(),a=[];for(let l=r;l<=o;l++)for(let u=i;u<=s;u++){const c=this.get(l,u);c&&(n||!n&&c.row===l&&c.col===u)&&a.push(c)}return a}add(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=e.row,i=e.col,o=e.rowspan,s=e.colspan,a=new ho(r,i,o,s,this.hot._createCellCoords,this.hot._createCellRange),l=this.get(r,i),u=n?!1:this.isOverlapping(a);return!l&&!u?(this.hot&&a.normalize(this.hot),this.mergedCells.push(a),Cl(ea,this,Ok).call(this,a),a):(u&&et(Gm.IS_OVERLAPPING_WARNING(a)),!1)}remove(e,n){const r=this.get(e,n),i=r?this.mergedCells.indexOf(r):-1;return r&&i!==-1?(this.mergedCells.splice(i,1),Cl(ea,this,lne).call(this,r),r):!1}clear(){H(this.mergedCells,e=>{let{row:n,col:r,rowspan:i,colspan:o}=e;fe(n,n+i,s=>{fe(r,r+o,a=>{const l=this.hot.getCell(s,a);l&&(l.removeAttribute("rowspan"),l.removeAttribute("colspan"),l.style.display="")})})}),this.mergedCells.length=0,this.mergedCellsMatrix=new Map}isOverlapping(e){const n=e.getRange();for(let r=0;r<this.mergedCells.length;r++)if(this.mergedCells[r].getRange().overlaps(n))return!0;return!1}isFirstRenderableMergedCell(e,n){const r=this.get(e,n);if(!r)return!1;const{row:i,col:o,rowspan:s,colspan:a}=r,l=this.hot.view.getActiveOverlayName(),u=["top","top_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleRow(),c=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleColumn(),h=ze(u,i,i+s-1),d=ze(c,o,o+a-1);return this.hot.rowIndexMapper.getNearestNotHiddenIndex(h,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(d,1)===n}getFirstRenderableCoords(e,n){const r=this.get(e,n);if(!r||this.isFirstRenderableMergedCell(e,n))return this.hot._createCellCoords(e,n);const i=this.hot.rowIndexMapper.getNearestNotHiddenIndex(r.row,1),o=this.hot.columnIndexMapper.getNearestNotHiddenIndex(r.col,1);return this.hot._createCellCoords(i,o)}getStartMostColumnIndex(e,n){const r=Cl(ea,this,qm).call(this,e,"col",-1);let i=n;for(let o=0;o<r.length;o++)if(r[o]<=n){i=r[o];break}return i}getEndMostColumnIndex(e,n){const r=Cl(ea,this,qm).call(this,e,"col",1);let i=n;for(let o=0;o<r.length;o++)if(r[o]>=n){i=r[o];break}return i}getTopMostRowIndex(e,n){const r=Cl(ea,this,qm).call(this,e,"row",-1);let i=n;for(let o=0;o<r.length;o++)if(r[o]<=n){i=r[o];break}return i}getBottomMostRowIndex(e,n){const r=Cl(ea,this,qm).call(this,e,"row",1);let i=n;for(let o=0;o<r.length;o++)if(r[o]>=n){i=r[o];break}return i}shiftCollections(e,n,r){const i=[0,0];switch(e){case"right":i[0]+=r;break;case"left":i[0]-=r;break;case"down":i[1]+=r;break;case"up":i[1]-=r;break}const o=[];this.mergedCells.forEach(s=>{s.shift(i,n),s.removed&&o.push(s)}),o.forEach(s=>{this.mergedCells.splice(this.mergedCells.indexOf(s),1)}),this.mergedCellsMatrix.clear(),this.mergedCells.forEach(s=>{Cl(ea,this,Ok).call(this,s)})}}function qm(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const r=new Map,i=n===1?t.getTopStartCorner():t.getBottomEndCorner(),o=n===1?t.getBottomEndCorner():t.getTopStartCorner();for(let s=i.row;n===1?s<=o.row:s>=o.row;s+=n)for(let a=i.col;n===1?a<=o.col:a>=o.col;a+=n){const l=e==="row"?s:a,u=this.get(s,a);let c=l;u&&(c=n===1?u[e]+u[`${e}span`]-1:u[e]),r.has(l)||r.set(l,new Set),r.get(l).add(c)}return Array.from(new Set(Array.from(r.entries()).filter(s=>{let[,a]=s;return a.size===1}).flatMap(s=>{let[,a]=s;return Array.from(a)})))}function Ok(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let n=t.col;n<t.col+t.colspan;n++)this.mergedCellsMatrix.has(e)||this.mergedCellsMatrix.set(e,new Map),this.mergedCellsMatrix.get(e).set(n,t)}function lne(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let n=t.col;n<t.col+t.colspan;n++)this.mergedCellsMatrix.get(e).delete(n)}function y0(t,e,n){return(e=une(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function une(t){var e=cne(t,"string");return typeof e=="symbol"?e:e+""}function cne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class hne{constructor(e){y0(this,"plugin",void 0),y0(this,"mergedCellsCollection",void 0),y0(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}getDirection(e,n){let r=null;return n[0]===e[0]&&n[1]===e[1]&&n[3]===e[3]?r="down":n[2]===e[2]&&n[1]===e[1]&&n[3]===e[3]?r="up":n[1]===e[1]&&n[2]===e[2]?r="right":r="left",r}snapDragArea(e,n,r,i){const o=n.slice(0),s=this.getAutofillSize(e,n,r),[a,l,u,c]=e,d=["up","down"].indexOf(r)>-1?u-a+1:c-l+1,f=Math.floor(s/d)*d,m=s-f,b=this.getFarthestCollection(e,n,r,i);if(b){if(r==="down"){const S=b.row+b.rowspan-a-m;o[2]+S>=this.plugin.hot.countRows()?o[2]-=m:o[2]+=m?S:0}else if(r==="right"){const S=b.col+b.colspan-l-m;o[3]+S>=this.plugin.hot.countCols()?o[3]-=m:o[3]+=m?S:0}else if(r==="up"){const S=u-m-b.row+1;o[0]+S<0?o[0]+=m:o[0]-=m?S:0}else if(r==="left"){const S=c-m-b.col+1;o[1]+S<0?o[1]+=m:o[1]-=m?S:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:r,foundMergedCells:i,fillSize:s,dragArea:o,cycleLength:d}),o}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),rn(this.currentFillData,e)}getAutofillSize(e,n,r){const[i,o,s,a]=e,[l,u,c,h]=n;switch(r){case"up":return i-l;case"down":return c-s;case"left":return o-u;case"right":return h-a;default:return null}}getDragArea(e,n,r){const[i,o,s,a]=e,[l,u,c,h]=n;switch(r){case"up":return[l,u,i-1,a];case"down":{const d=this.mergedCellsCollection.get(c,a),f=d?d.rowspan-1:0;return[s+1,o,c+f,a]}case"left":return[l,u,s,o-1];case"right":{const d=this.mergedCellsCollection.get(c,a),f=d?d.colspan-1:0;return[i,a+f,c,h]}default:return null}}getFarthestCollection(e,n,r,i){const[o,s,a,l]=e,u=["up","down"].indexOf(r)>-1,c=u?a:l,h=u?o:s,d=this.getAutofillSize(e,n,r),f=u?a-o+1:l-s+1,m=Math.floor(d/f)*f,b=d-m;let S=null,E=null,v=null;switch(r){case"up":S="includesVertically",v=c-b+1;break;case"left":S="includesHorizontally",v=c-b+1;break;case"down":S="includesVertically",v=h+b-1;break;case"right":S="includesHorizontally",v=h+b-1;break}return H(i,I=>{I[S](v)&&I.isFarther(E,r)&&(E=I)}),E}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const n=this.getRangeFromChanges(e),r=this.currentFillData.foundMergedCells,i=this.currentFillData.dragDirection,o=(u,c)=>{switch(i){case"up":return u.row-c>=n.from.row;case"down":return u.row+u.rowspan-1+c<=n.to.row;case"left":return u.col-c>=n.from.column;case"right":return u.col+u.colspan-1+c<=n.to.column;default:return null}};let s=0,a=null,l=1;do for(let u=0;u<r.length;u+=1){if(a=r[u],s=l*this.currentFillData.cycleLength,o(a,s))switch(i){case"up":this.plugin.mergedCellsCollection.add({row:a.row-s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"down":this.plugin.mergedCellsCollection.add({row:a.row+s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"left":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col-s,colspan:a.colspan},!0);break;case"right":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col+s,colspan:a.colspan},!0);break}u===r.length-1&&(l+=1)}while(o(a,s));this.currentFillData=null,this.plugin.hot.render(),r.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const n={min:null,max:null},r={min:null,max:null};return H(e,i=>{const o=i[0],s=this.plugin.hot.propToCol(i[1]);(n.min===null||o<n.min)&&(n.min=o),(n.max===null||o>n.max)&&(n.max=o),(r.min===null||s<r.min)&&(r.min=s),(r.max===null||s>r.max)&&(r.max=s)}),{from:{row:n.min,column:r.min},to:{row:n.max,column:r.max}}}dragAreaOverlapsCollections(e,n,r){const i=this.getDragArea(e,n,r),[o,s,a,l]=i,u=this.plugin.hot._createCellCoords(o,s),c=this.plugin.hot._createCellCoords(a,l),h=this.plugin.hot._createCellRange(u,u,c);if(this.mergedCellsCollection.getWithinRange(h,!0).length===0)return!1;const f=this.mergedCellsCollection.getWithinRange(h,!1);return f.length===0?!0:r==="up"||r==="down"?!f.every(m=>{let{colspan:b}=m;return b===h.getWidth()}):!f.every(m=>{let{rowspan:b}=m;return b===h.getHeight()})}}function b0(t,e,n){return(e=dne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dne(t){var e=fne(t,"string");return typeof e=="symbol"?e:e+""}function fne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gne{constructor(e){b0(this,"plugin",void 0),b0(this,"hot",void 0),b0(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}getSelectedMergedCellClassName(e,n,r,i){const o=Math.min(r[0],r[2]),s=Math.min(r[1],r[3]),a=Math.max(r[0],r[2]),l=Math.max(r[1],r[3]);if(i===void 0||!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,n))return;const c=this.plugin.mergedCellsCollection.get(e,n);if(!c)return;const h=c.getLastRow(),d=c.getLastColumn();if(o<=c.row&&s<=c.col&&a>=h&&l>=d)return`${this.fullySelectedMergedCellClassName}-${i}`;if(this.isMergeCellFullySelected(c,this.plugin.hot.getSelectedRange()))return`${this.fullySelectedMergedCellClassName}-multiple`}isMergeCellFullySelected(e,n){const r=[];if(!n||!e)return!1;for(let i=0;i<e.rowspan;i+=1)for(let o=0;o<e.colspan;o+=1)r.push(this.hot._createCellCoords(e.row+i,e.col+o));for(let i=0;i<r.length;i+=1){const o=[];for(let s=0;s<n.length;s+=1)o[s]=n[s].includes(r[i]);if(!o.includes(!0))return!1}return!0}getSelectedMergedCellClassNameToRemove(){const e=[];for(let n=0;n<=7;n+=1)e.push(`${this.fullySelectedMergedCellClassName}-${n}`);return e.push(`${this.fullySelectedMergedCellClassName}-multiple`),e}}function mne(t){return{key:"mergeCells",name(){const e=this.getSelectedLast();if(e){const n=t.mergedCellsCollection.get(e[0],e[1]);if(n.row===e[0]&&n.col===e[1]&&n.row+n.rowspan-1===e[2]&&n.col+n.colspan-1===e[3])return this.getTranslatedPhrase(pb)}return this.getTranslatedPhrase(mb)},callback(){const e=this.getSelectedRangeLast();if(!e)return;e.setDirection(this.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=e;t.toggleMerge(e),this.selectCell(n.row,n.col,r.row,r.col,!1)},disabled(){const e=this.getSelectedLast();return e?ho.isSingleCell({row:e[0],col:e[1],rowspan:e[2]-e[0]+1,colspan:e[3]-e[1]+1})||this.selection.isSelectedByCorner():!0},hidden:!1}}function bd(t,e,n){return(e=pne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pne(t){var e=wne(t,"string");return typeof e=="symbol"?e:e+""}function wne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class xk{constructor(e){bd(this,"data",void 0),bd(this,"next",null),bd(this,"prev",null),this.data=e}}class Km{constructor(){bd(this,"first",null),bd(this,"last",null)}push(e){const n=new xk(e);if(this.first===null)this.first=n,this.last=n;else{const r=this.last;this.last=n,n.prev=r,r.next=n}return n}unshift(e){const n=new xk(e);if(this.first===null)this.first=n,this.last=n;else{const r=this.first;this.first=n,n.next=r,r.prev=n}}inorder(e){let n=this.first;for(;n;){const r=e(n);if(n===this.last||r===!0)break;n=n.next}}remove(e){if(this.first===null)return!1;let n=this.first,r,i;for(;n;){if(n.data===e)return r=n.next,i=n.prev,r&&(r.prev=i),i&&(i.next=r),n===this.first&&(this.first=r),n===this.last&&(this.last=i),!0;n=n.next}return!1}hasCycle(){let e=this.first,n=this.first;for(;;){if(e===null||(e=e.next,e===null))return!1;if(e=e.next,n=n.next,e===n)return!0}}pop(){if(this.last===null)return null;const e=this.last;return this.last=this.last.prev,e}shift(){if(this.first===null)return null;const e=this.first;return this.first=this.first.next,e}recursiveReverse(){function e(r,i){i&&(e(i,i.next),i.next=r)}if(!this.first)return;e(this.first,this.first.next),this.first.next=null;const n=this.first;this.first=this.last,this.last=n}reverse(){if(!this.first||!this.first.next)return;let e=this.first.next,n=this.first,r;for(;e;)r=e.next,e.next=n,n.prev=e,n=e,e=r;this.first.next=null,this.last.prev=null,r=this.first,this.first=n,this.last=r}}function vne(t,e){Ak(t,e),e.add(t)}function yl(t,e,n){Ak(t,e),e.set(t,n)}function Ak(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nt(t,e){return t.get(Xm(t,e))}function Nr(t,e,n){return t.set(Xm(t,e),n),n}function Xm(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 fo=new WeakMap,go=new WeakMap,mo=new WeakMap,po=new WeakMap,S0=new WeakMap,Zm=new WeakMap,Qm=new WeakMap,R0=new WeakSet;class Cne{constructor(e){let{mergedCellsGetter:n,rowIndexMapper:r,columnIndexMapper:i}=e;vne(this,R0),yl(this,fo,new Km),yl(this,go,new Km),yl(this,mo,null),yl(this,po,null),yl(this,S0,null),yl(this,Zm,null),yl(this,Qm,null),Nr(S0,this,n),Nr(Zm,this,r),Nr(Qm,this,i)}getCurrentVerticalNode(){return nt(po,this).data}getFirstVerticalNode(){return nt(go,this).first.data}getNextVerticalNode(){return nt(po,this).next.data}getPrevVerticalNode(){return nt(po,this).prev.data}getCurrentHorizontalNode(){return nt(mo,this).data}getFirstHorizontalNode(){return nt(fo,this).first.data}getNextHorizontalNode(){return nt(mo,this).next.data}getPrevHorizontalNode(){return nt(mo,this).prev.data}setPrevNodeAsActive(){Nr(po,this,nt(po,this).prev),Nr(mo,this,nt(mo,this).prev)}setNextNodeAsActive(){Nr(po,this,nt(po,this).next),Nr(mo,this,nt(mo,this).next)}buildFocusOrder(e){const n=e.getTopStartCorner(),r=e.getBottomEndCorner(),i=new WeakSet;Nr(fo,this,new Km);for(let s=n.row;s<=r.row;s++)if(!nt(Zm,this).isHidden(s))for(let a=n.col;a<=r.col;a++){if(nt(Qm,this).isHidden(a))continue;const l=Xm(R0,this,Hk).call(this,e,nt(fo,this),i,s,a);l&&Nr(mo,this,l)}nt(fo,this).first&&(nt(fo,this).first.prev=nt(fo,this).last,nt(fo,this).last.next=nt(fo,this).first);const o=new WeakSet;Nr(go,this,new Km);for(let s=n.col;s<=r.col;s++)if(!nt(Qm,this).isHidden(s))for(let a=n.row;a<=r.row;a++){if(nt(Zm,this).isHidden(a))continue;const l=Xm(R0,this,Hk).call(this,e,nt(go,this),o,a,s);l&&Nr(po,this,l)}nt(go,this).first&&(nt(go,this).first.prev=nt(go,this).last,nt(go,this).last.next=nt(go,this).first)}setActiveNode(e,n){return nt(fo,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return Nr(mo,this,r),!1}),nt(go,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return Nr(po,this,r),!1}),this}}function Hk(t,e,n,r,i){const o=t.getTopStartCorner(),s=t.getBottomEndCorner(),a=t.highlight.clone().normalize(),l=nt(S0,this).call(this,r,i);if(l&&n.has(l))return null;const u={colStart:i,colEnd:i,rowStart:r,rowEnd:r};if(l){if(n.add(l),l.row<o.row||l.row+l.rowspan-1>s.row||l.col<o.col||l.col+l.colspan-1>s.col)return null;u.colStart=l.col,u.colEnd=l.col+l.colspan-1,u.rowStart=l.row,u.rowEnd=l.row+l.rowspan-1}const c=e.push(u);return r===a.row&&i===a.col||l&&a.row>=l.row&&a.row<=l.row+l.rowspan-1&&a.col>=l.col&&a.col<=l.col+l.colspan-1?c:null}function Nk(t,e,n){const{view:r,rowIndexMapper:i}=t,o=r.getStylesHandler(),s=r.getDefaultRowHeight();let a=0;for(let u=e;u<e+n;u++)if(!i.isHidden(u)){var l;a+=(l=t.getRowHeight(u))!==null&&l!==void 0?l:s,u===0&&!o.isClassicTheme()&&(a+=1)}return a}function yne(t){const{hot:e}=t,{rowIndexMapper:n,columnIndexMapper:r}=e,i=new Map;function o(){}function s(a,l,u){const c=t.mergedCellsCollection.get(l,u);if(!He(c)){a.removeAttribute("rowspan"),a.removeAttribute("colspan"),Af()&&i.has(l)&&!e.getSettings().rowHeaders&&(a.style.height=`${i.get(l)}px`,i.delete(l)),a.style.display="";return}const{row:h,col:d,colspan:f,rowspan:m}=c,[b,S]=t.translateMergedCellToRenderable(h,m,d,f),E=t.getSetting("virtualized");if(Af()&&d===0&&!e.getSettings().rowHeaders){const U=Nk(e,h,m);i.set(l,U/m)}const v=n.getRenderableFromVisualIndex(l),I=r.getRenderableFromVisualIndex(u),M=b-v+1,T=S-I+1;let P=n.getNearestNotHiddenIndex(h,1),D=r.getNearestNotHiddenIndex(d,1);if(E){const U=e.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(U)||(P=Math.max(P,e.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(U)||(D=Math.max(D,e.getFirstRenderedVisibleColumn()))}const K=Math.min(m,M),Y=Math.min(f,T);P===l&&D===u?(a.setAttribute("rowspan",K),a.setAttribute("colspan",Y)):(a.removeAttribute("rowspan"),a.removeAttribute("colspan"),a.style.display="none")}return{before:o,after:s}}function bne(t,e){Dk(t,e),e.add(t)}function Jm(t,e,n){Dk(t,e),e.set(t,n)}function Dk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function E0(t,e,n){return(e=Sne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sne(t){var e=Rne(t,"string");return typeof e=="symbol"?e:e+""}function Rne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Sd(t,e,n){return t.set(ot(t,e),n),n}function Ct(t,e){return t.get(ot(t,e))}function ot(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")}re.getSingleton().register("beforeMergeCells"),re.getSingleton().register("afterMergeCells"),re.getSingleton().register("beforeUnmergeCells"),re.getSingleton().register("afterUnmergeCells");const T0="mergeCells",Ene=150,kk=T0;var ti=new WeakMap,ni=new WeakMap,wo=new WeakMap,Lk=new WeakMap,dt=new WeakSet;class Tne extends Xe{constructor(){super(...arguments),bne(this,dt),E0(this,"mergedCellsCollection",null),E0(this,"autofillCalculations",null),E0(this,"selectionCalculations",null),Jm(this,ti,null),Jm(this,ni,{row:0,col:0}),Jm(this,wo,new Cne({mergedCellsGetter:(e,n)=>this.mergedCellsCollection.get(e,n),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),Jm(this,Lk,yne(this))}static get PLUGIN_KEY(){return T0}static get PLUGIN_PRIORITY(){return Ene}static get DEFAULT_SETTINGS(){return{[GA]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[T0]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new Gm(this),this.autofillCalculations=new hne(this),this.selectionCalculations=new gne(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,_ne).call(e,...r)}),this.addHook("modifyTransformFocus",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Ine).call(e,...r)}),this.addHook("modifyTransformStart",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Pne).call(e,...r)}),this.addHook("modifyTransformEnd",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,One).call(e,...r)}),this.addHook("beforeSelectionHighlightSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,xne).call(e,...r)}),this.addHook("beforeSetRangeStart",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Fk).call(e,...r)}),this.addHook("beforeSetRangeStartOnly",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Fk).call(e,...r)}),this.addHook("beforeSelectionFocusSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Hne).call(e,...r)}),this.addHook("afterSelectionFocusSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Nne).call(e,...r)}),this.addHook("afterSelectionEnd",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Dne).call(e,...r)}),this.addHook("modifyGetCellCoords",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,$k).call(e,...r)}),this.addHook("modifyGetCoordsElement",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,$k).call(e,...r)}),this.addHook("afterIsMultipleSelection",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Mne).call(e,...r)}),this.addHook("afterRenderer",function(){return Ct(Lk,e).after(...arguments)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Ane).call(e,...r)}),this.addHook("afterGetCellMeta",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,kne).call(e,...r)}),this.addHook("afterViewportRowCalculatorOverride",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Lne).call(e,...r)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,$ne).call(e,...r)}),this.addHook("modifyAutofillRange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Fne).call(e,...r)}),this.addHook("afterCreateCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Vne).call(e,...r)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Wne).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Bne).call(e,...r)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,jne).call(e,...r)}),this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Une).call(e,...r)}),this.addHook("beforeDrawBorders",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,zne).call(e,...r)}),this.addHook("afterDrawSelection",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Yne).call(e,...r)}),this.addHook("beforeRemoveCellClassNames",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Gne).call(e,...r)}),this.addHook("beforeBeginEditing",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,qne).call(e,...r)}),this.addHook("modifyRowHeightByOverlayName",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ot(dt,e,Kne).call(e,...r)}),this.addHook("beforeUndoStackChange",(n,r)=>{if(r==="MergeCells")return!1}),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(),super.updatePlugin()}ifChromeForceRepaint(){if(!mx())return;const e=[];let n=[];this.mergedCellsCollection.mergedCells.forEach(r=>{const{row:i,rowspan:o}=r;for(let s=i+1;s<i+o;s++)n.push(s)}),n=[...new Set(n)],n.forEach(r=>{const i=this.hot.rowIndexMapper.getRenderableFromVisualIndex(r);this.hot.view._wt.wtOverlays.getOverlays(!0).map(o=>o?.name==="master"?o:o.clone.wtTable).forEach(o=>{const s=o.getRow(i);s&&(s.style.background=_f(s,"backgroundColor").replace(")",", 0.99)"),e.push(s))})}),this.hot._registerTimeout(()=>{e.forEach(r=>{var i;r.style.background=(i=_f(r,"backgroundColor"))===null||i===void 0?void 0:i.replace(", 0.99)",")")})},1)}validateSetting(e){return e?ho.containsNegativeValues(e)?(et(ho.NEGATIVE_VALUES_WARNING(e)),!1):ho.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(et(ho.IS_OUT_OF_BOUNDS_WARNING(e)),!1):ho.isSingleCell(e)?(et(ho.IS_SINGLE_CELL(e)),!1):ho.containsZeroSpan(e)?(et(ho.ZERO_SPAN_WARNING(e)),!1):!0:!1}generateFromSettings(){const e=this.getSetting("cells").filter(i=>this.validateSetting(i)),n=this.mergedCellsCollection.filterOverlappingMergeCells(e),r=[];n.forEach(i=>{const{row:o,col:s,rowspan:a,colspan:l}=i,u=this.hot._createCellCoords(o,s),c=this.hot._createCellCoords(o+a-1,s+l-1),h=this.hot._createCellRange(u,u,c);this.mergeRange(h,!0,!0);for(let d=o;d<o+a;d++)for(let f=s;f<s+l;f++)(d!==o||f!==s)&&r.push([d,f,null])}),r.length!==0&&this.hot.setDataAtCell(r,void 0,void 0,this.pluginName)}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?!0:this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}unmergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:n,to:r}=e;this.unmergeRange(e,!0),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}mergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=e.getTopStartCorner(),o=e.getBottomEndCorner(),s={row:i.row,col:i.col,rowspan:o.row-i.row+1,colspan:o.col-i.col+1},a=[];let l=null;return this.canMergeRange(s,n)?(this.hot.runHooks("beforeMergeCells",e,n),fe(0,s.rowspan-1,c=>{fe(0,s.colspan-1,h=>{let d=null;a[c]||(a[c]=[]),c===0&&h===0?d=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s.row),this.hot.toPhysicalColumn(s.col)):this.hot.setCellMeta(s.row+c,s.col+h,"hidden",!0),a[c][h]=d})}),this.hot.setCellMeta(s.row,s.col,"spanned",!0),this.mergedCellsCollection.add(s,n)?(r?l=[s.row,s.col,a]:this.hot.populateFromArray(s.row,s.col,a,void 0,void 0,this.pluginName),n||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,s,n),l):!0):!1}unmergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.mergedCellsCollection.getWithinRange(e);r.length!==0&&(this.hot.runHooks("beforeUnmergeCells",e,n),H(r,i=>{this.mergedCellsCollection.remove(i.row,i.col),fe(0,i.rowspan-1,o=>{fe(0,i.colspan-1,s=>{this.hot.removeCellMeta(i.row+o,i.col+s,"hidden"),this.hot.removeCellMeta(i.row+o,i.col+s,"copyable")})}),this.hot.removeCellMeta(i.row,i.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,n),this.hot.render())}toggleMerge(e){const{from:n,to:r}=e.clone().normalize(),i=this.mergedCellsCollection.get(n.row,n.col);i.row===n.row&&i.col===n.col&&i.row+i.rowspan-1===r.row&&i.col+i.colspan-1===r.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,n,r,i){const o=this.hot._createCellCoords(e,n),s=this.hot._createCellCoords(r,i);this.mergeRange(this.hot._createCellRange(o,o,s))}unmerge(e,n,r,i){const o=this.hot._createCellCoords(e,n),s=this.hot._createCellCoords(r,i);this.unmergeRange(this.hot._createCellRange(o,o,s))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const r=this.hot.getSelectedRangeLast();r&&!r.isSingleHeader()&&(this.toggleMerge(r),this.hot.render())},runOnlyIf:r=>!r.altKey,group:kk})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(kk)}modifyViewportRowStart(e,n){const r=this.hot.rowIndexMapper,i=r.getVisualFromRenderableIndex(e.startRow);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(i,o);if(He(s)){const a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(s.row,1));if(a<e.startRow){e.startRow=a,this.modifyViewportRowStart(e,n);return}}}}modifyViewportRowEnd(e,n){const r=this.hot.rowIndexMapper,i=r.getVisualFromRenderableIndex(e.endRow);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(i,o);if(He(s)){const a=s.row+s.rowspan-1,l=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(a,-1));if(l>e.endRow){e.endRow=l,this.modifyViewportRowEnd(e,n);return}}}}modifyViewportColumnStart(e,n){const r=this.hot.columnIndexMapper,i=r.getVisualFromRenderableIndex(e.startColumn);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(o,i);if(He(s)){const a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(s.col,1));if(a<e.startColumn){e.startColumn=a,this.modifyViewportColumnStart(e,n);return}}}}modifyViewportColumnEnd(e,n){const r=this.hot.columnIndexMapper,i=r.getVisualFromRenderableIndex(e.endColumn);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(o,i);if(He(s)){const a=s.col+s.colspan-1,l=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(a,-1));if(l>e.endColumn){e.endColumn=l,this.modifyViewportColumnEnd(e,n);return}}}}translateMergedCellToRenderable(e,n,r,i){const{rowIndexMapper:o,columnIndexMapper:s}=this.hot;let a,l;n===0?a=o.getNearestNotHiddenIndex(e,1):a=o.getNearestNotHiddenIndex(e+n-1,-1),i===0?l=s.getNearestNotHiddenIndex(r,1):l=s.getNearestNotHiddenIndex(r+i-1,-1);const u=e>=0?o.getRenderableFromVisualIndex(a):e,c=r>=0?s.getRenderableFromVisualIndex(l):r;return[u,c]}}function _ne(){this.generateFromSettings(),this.hot.render()}function Mne(t){if(t){const e=this.mergedCellsCollection.mergedCells,n=this.hot.getSelectedRangeLast(),r=n.getTopStartCorner(),i=n.getBottomEndCorner();for(let o=0;o<e.length;o+=1)if(r.row===e[o].row&&r.col===e[o].col&&i.row===e[o].row+e[o].rowspan-1&&i.col===e[o].col+e[o].colspan-1)return!1}return t}function Ine(t){Ct(ni,this).row=t.row,Ct(ni,this).col=t.col}function Pne(t){const e=this.hot.getSelectedRangeLast(),{highlight:n}=e,{columnIndexMapper:r,rowIndexMapper:i}=this.hot;Ct(ti,this)&&(i.getRenderableFromVisualIndex(Ct(ti,this).row)!==null&&(n.row=Ct(ti,this).row),r.getRenderableFromVisualIndex(Ct(ti,this).col)!==null&&(n.col=Ct(ti,this).col),Sd(ti,this,null));const o=this.mergedCellsCollection.get(n.row,n.col);if(!o)return;const s=o.col,a=o.col+o.colspan-1;if(t.col<0){const c=n.col>=s&&n.col<=a?s-1:a,h=r.getNearestNotHiddenIndex(c,-1);h===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,n.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(h,n.col)-1,1)}else if(t.col>0){const c=n.col>=s&&n.col<=a?a+1:s,h=r.getNearestNotHiddenIndex(c,1);h===null?t.col=this.hot.view.countRenderableColumnsInRange(n.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(n.col,h)-1,1)}const l=o.row,u=o.row+o.rowspan-1;if(t.row<0){const c=n.row>=l&&n.row<=u?l-1:u,h=i.getNearestNotHiddenIndex(c,-1);h===null?t.row=-this.hot.view.countRenderableRowsInRange(0,n.row):t.row=-Math.max(this.hot.view.countRenderableRowsInRange(h,n.row)-1,1)}else if(t.row>0){const c=n.row>=l&&n.row<=u?u+1:l,h=i.getNearestNotHiddenIndex(c,1);h===null?t.row=this.hot.view.countRenderableRowsInRange(n.row,this.hot.countRows()):t.row=Math.max(this.hot.view.countRenderableRowsInRange(n.row,h)-1,1)}}function One(t){const e=this.hot.getSelectedRangeLast(),n=e.clone(),{to:r}=e,{columnIndexMapper:i,rowIndexMapper:o}=this.hot,s=(a,l)=>{n.expand(this.hot._createCellCoords(a,l));for(let u=0;u<this.mergedCellsCollection.mergedCells.length;u+=1)n.expandByRange(this.mergedCellsCollection.mergedCells[u].getRange())};if(t.col<0){let a=this.mergedCellsCollection.getStartMostColumnIndex(e,r.col)+t.col;s(r.row,a),e.getHorizontalDirection()==="E-W"&&n.getHorizontalDirection()==="E-W"&&(a=n.getTopStartCorner().col);const l=i.getNearestNotHiddenIndex(a,1);l!==null&&(t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(l,r.col)-1,1))}else if(t.col>0){let a=this.mergedCellsCollection.getEndMostColumnIndex(e,r.col)+t.col;s(r.row,a),e.getHorizontalDirection()==="W-E"&&n.getHorizontalDirection()==="W-E"&&(a=n.getBottomEndCorner().col);const l=i.getNearestNotHiddenIndex(a,-1);l!==null&&(t.col=Math.max(this.hot.view.countRenderableColumnsInRange(r.col,l)-1,1))}if(t.row<0){let a=this.mergedCellsCollection.getTopMostRowIndex(e,r.row)+t.row;s(a,r.col),e.getVerticalDirection()==="S-N"&&n.getVerticalDirection()==="S-N"&&(a=n.getTopStartCorner().row);const l=o.getNearestNotHiddenIndex(a,1);l!==null&&(t.row=-Math.max(this.hot.view.countRenderableRowsInRange(l,r.row)-1,1))}else if(t.row>0){let a=this.mergedCellsCollection.getBottomMostRowIndex(e,r.row)+t.row;s(a,r.col),e.getVerticalDirection()==="N-S"&&n.getVerticalDirection()==="N-S"&&(a=n.getBottomStartCorner().row);const l=o.getNearestNotHiddenIndex(a,-1);l!==null&&(t.row=Math.max(this.hot.view.countRenderableRowsInRange(r.row,l)-1,1))}}function xne(){const t=this.hot.getSelectedRangeLast(),{highlight:e}=t;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){Sd(ti,this,e.clone());return}for(let r=0;r<this.mergedCellsCollection.mergedCells.length;r+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange(),!1);for(let r=0;r<this.mergedCellsCollection.mergedCells.length;r+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange(),!1);const n=this.mergedCellsCollection.get(e.row,e.col);Sd(ti,this,e.clone()),n&&e.assign(n)}function $k(t,e,n,r){if(t<0||e<0)return;const i=this.mergedCellsCollection.get(t,e);if(!i)return;const{row:o,col:s,colspan:a,rowspan:l}=i,u=o,c=s,h=o+l-1,d=s+a-1;if(r==="render"&&this.getSetting("virtualized")){const f=this.hot.view.getActiveOverlayName(),m=["top","top_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleRow(),b=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleColumn();return[ze(m,u,h),ze(b,c,d),ze(this.hot.getLastRenderedVisibleRow(),u,h),ze(this.hot.getLastRenderedVisibleColumn(),c,d)]}return[u,c,h,d]}function Ane(t){t.items.push({name:"---------"},mne(this))}function Fk(){Sd(ti,this,null)}function Hne(){if(Ct(ti,this).isCell())return;const t=this.hot.getSelectedRangeLast(),e=t.getVerticalDirection(),n=t.getHorizontalDirection(),r=Ct(ti,this).clone().normalize();Ct(wo,this).setActiveNode(r.row,r.col),Ct(ni,this).row>0||Ct(ni,this).col>0?Ct(wo,this).setPrevNodeAsActive():(n==="E-W"&&Ct(ni,this).col<0||e==="S-N"&&Ct(ni,this).row<0)&&Ct(wo,this).setNextNodeAsActive()}function Nne(t,e){const n=this.hot.getSelectedRangeLast(),{columnIndexMapper:r,rowIndexMapper:i}=this.hot;let o=null,s=null;if(Ct(ni,this).col<0){const{rowEnd:a,colEnd:l}=Ct(wo,this).getPrevHorizontalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(Ct(ni,this).col>0){const{rowStart:a,colStart:l}=Ct(wo,this).getNextHorizontalNode();s=r.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}else if(Ct(ni,this).row<0){const{rowEnd:a,colEnd:l}=Ct(wo,this).getPrevVerticalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(Ct(ni,this).row>0){const{rowStart:a,colStart:l}=Ct(wo,this).getNextVerticalNode();s=r.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}if(o!==null||s!==null){const a=this.hot._createCellCoords(o,s),l=this.mergedCellsCollection.get(a.row,a.col),u=this.hot.selection.highlight.getFocus();t=a.row,e=a.col,l?n.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(l.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(l.col,1)}):n.highlight.assign(a),u.clear(),u.add(a).commit()}Ct(wo,this).setActiveNode(t,e),Sd(ni,this,{row:0,col:0})}function Dne(){this.hot.getSelectedRangeLast().isHeader()||Ct(wo,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function kne(t,e,n){const r=this.mergedCellsCollection.get(t,e);r&&(r.row!==t||r.col!==e?n.copyable=!1:(n.rowspan=r.rowspan,n.colspan=r.colspan))}function Lne(t){if(this.getSetting("virtualized"))return;const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function $ne(t){if(this.getSetting("virtualized"))return;const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function Fne(t,e){const n=this.autofillCalculations.getDirection(e,t);if(this.autofillCalculations.dragAreaOverlapsCollections(e,t,n))return e;const r=this.hot._createCellCoords(e[0],e[1]),i=this.hot._createCellCoords(e[2],e[3]),o=this.hot._createCellRange(r,r,i),s=this.mergedCellsCollection.getWithinRange(o);return s.length===0?t:this.autofillCalculations.snapDragArea(e,t,n,s)}function Vne(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function Wne(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function Bne(t,e,n){n!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function jne(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function Une(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function zne(t,e){if(e&&e==="area"){const n=this.hot.getSelectedRangeLast(),r=this.mergedCellsCollection.getWithinRange(n);H(r,i=>{n.getBottomEndCorner().row===i.getLastRow()&&n.getBottomEndCorner().col===i.getLastColumn()&&(t[2]=i.row,t[3]=i.col)})}}function Yne(t,e,n,r){if(n)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,n,r)}function Gne(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function qne(t,e,n,r){if(!(r instanceof MouseEvent))return;const i=this.hot.getSelectedRangeLast(),o=this.mergedCellsCollection.getByRange(i);if(!o)return;const s=this.hot._createCellCoords(o.row,o.col),a=this.hot._createCellCoords(o.row+o.rowspan-1,o.col+o.colspan-1);return this.hot.selection.getLayerLevel()===0&&i.isEqual(this.hot._createCellRange(s,s,a))}function Kne(t,e,n){if(this.hot.getSettings().rowHeaders||n==="bottom"||n==="bottom_inline_start_corner")return t;let r,i;if(n==="master")r=this.hot.getFirstRenderedVisibleColumn(),i=this.hot.getLastRenderedVisibleColumn();else{const d=this.hot.view.getOverlayByName(n);r=this.hot.columnIndexMapper.getVisualFromRenderableIndex(d.clone.wtTable.getFirstRenderedColumn()),i=this.hot.columnIndexMapper.getVisualFromRenderableIndex(d.clone.wtTable.getLastRenderedColumn())}if(!this.mergedCellsCollection.get(e,r))return t;const s=this.hot._createCellCoords(e,r),a=this.hot._createCellCoords(e,i),l=this.hot._createCellRange(s,s,a),u=this.mergedCellsCollection.getWithinRange(l,!0),c=u.reduce((d,f)=>{let{rowspan:m}=f;return Math.max(d,m)},1);let h=0;return u.length>1&&u[0].rowspan<c&&(h=c-u[0].rowspan),u.forEach(d=>{let{rowspan:f}=d,m=0;n==="top"||n==="top_inline_start_corner"?m=Math.min(c,this.hot.view.countNotHiddenFixedRowsTop()-e):m=f-h,t=Math.max(t??0,Nk(this.hot,e,m))}),t}function Xne(t,e){return function(n,r){const[,...i]=n,[,...o]=r;return(function s(a){const l=t[a],u=e[a],c=i[a],h=o[a],d=u.multiColumnSorting,m=(d.compareFunctionFactory?d.compareFunctionFactory:P1(u.type))(l,u,d)(c,h);if(m===eo){const b=a+1;if(typeof e[b]<"u")return s(b)}return m})(0)}}const Vk="sort";function Zne(t,e,n){const r=[];return n===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&r.push(`${Vk}-${t.getIndexOfColumnInSortQueue(e)+1}`),r}function Qne(t){const e=t.className.split(" "),n=new RegExp(`^${Vk}-[0-9]{1,2}$`);return e.filter(r=>n.test(r))}function Jne(t,e,n){return(e=ere(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ere(t){var e=tre(t,"string");return typeof e=="symbol"?e:e+""}function tre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const ep="multiColumnSorting",nre=170,Wk=ep;I1(ep,Xne);class rre extends V1{constructor(){super(...arguments),Jne(this,"pluginKey",ep)}static get PLUGIN_KEY(){return ep}static get PLUGIN_PRIORITY(){return nre}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){super.enablePlugin()}disablePlugin(){super.disablePlugin()}registerShortcuts(){super.registerShortcuts(),this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Shift","Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return e.row===-1&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,Eg)),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.isHeader()},relativeToGroup:Ss,position:"before",group:Wk})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Wk)}sort(e){super.sort(e)}clearSort(){super.clearSort()}isSorted(){return super.isSorted()}getSortConfig(e){return super.getSortConfig(e)}setSortConfig(e){super.setSortConfig(e)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e:[e]}updateHeaderClasses(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];super.updateHeaderClasses(e,...r),ve(e,Qne(e)),this.enabled!==!1&&X(e,Zne(...r))}onAfterOnCellMouseDown(e,n){AR(n.row,n.col,e)!==!1&&this.wasClickableHeaderClicked(e,n.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(n.col),this.sort(this.getNextSortConfig(n.col,Eg))):this.sort(this.getColumnNextConfig(n.col)))}}function Bk(t,e,n){return(e=ire(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ire(t){var e=ore(t,"string");return typeof e=="symbol"?e:e+""}function ore(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const sre="multipleSelectionHandles",are=160;class lre extends Xe{constructor(){super(...arguments),Bk(this,"dragged",[]),Bk(this,"lastSetCell",null)}static get PLUGIN_KEY(){return sre}static get PLUGIN_PRIORITY(){return are}isEnabled(){return ko()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:n}=this.hot;function r(i){if(e.dragged.length===1)return e.dragged.splice(0,e.dragged.length),!0;const o=e.dragged.indexOf(i);if(o===-1)return!1;o===0?e.dragged=e.dragged.slice(0,1):o===1&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(n,"touchstart",i=>{let o;if(ye(i.target,"topSelectionHandle-HitArea"))return o=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},i.preventDefault(),!1;if(ye(i.target,"bottomSelectionHandle-HitArea"))return o=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},i.preventDefault(),!1}),this.eventManager.addEventListener(n,"touchend",i=>{if(ye(i.target,"topSelectionHandle-HitArea"))return r.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(ye(i.target,"bottomSelectionHandle-HitArea"))return r.call(e,"bottom"),e.touchStartRange=void 0,i.preventDefault(),!1}),this.eventManager.addEventListener(n,"touchmove",i=>{const{rootDocument:o}=this.hot;let s,a,l,u,c,h;if(e.dragged.length===0)return;const d=o.elementFromPoint(i.touches[0].clientX,i.touches[0].clientY);!d||d===e.lastSetCell||((d.nodeName==="TD"||d.nodeName==="TH")&&(s=e.hot.getCoords(d),s.col===-1&&(s.col=0),a=e.hot.getSelectedRangeLast(),l=a.getWidth(),u=a.getHeight(),c=a.getDirection(),l===1&&u===1&&e.hot.selection.setRangeEnd(s),h=e.getCurrentRangeCoords(a,s,e.touchStartRange.direction,c,e.dragged[0]),h.start!==null&&e.hot.selection.setRangeStart(h.start),e.hot.selection.setRangeEnd(h.end),e.lastSetCell=d),i.preventDefault())})}getCurrentRangeCoords(e,n,r,i,o){const s=e.getTopStartCorner(),a=e.getBottomEndCorner(),l=e.getBottomStartCorner(),u=e.getTopEndCorner();let c={start:null,end:null};switch(r){case"NE-SW":switch(i){case"NE-SW":case"NW-SE":o==="top"?c={start:this.hot._createCellCoords(n.row,e.highlight.col),end:this.hot._createCellCoords(l.row,n.col)}:c={start:this.hot._createCellCoords(e.highlight.row,n.col),end:this.hot._createCellCoords(n.row,s.col)};break;case"SE-NW":o==="bottom"&&(c={start:this.hot._createCellCoords(a.row,n.col),end:this.hot._createCellCoords(n.row,s.col)});break}break;case"NW-SE":switch(i){case"NE-SW":o==="top"?c={start:n,end:l}:c.end=n;break;case"NW-SE":o==="top"?c={start:n,end:a}:c.end=n;break;case"SE-NW":o==="top"?c={start:n,end:s}:c.end=n;break;case"SW-NE":o==="top"?c={start:n,end:u}:c.end=n;break}break;case"SW-NE":switch(i){case"NW-SE":o==="bottom"?c={start:this.hot._createCellCoords(n.row,s.col),end:this.hot._createCellCoords(l.row,n.col)}:c={start:this.hot._createCellCoords(s.row,n.col),end:this.hot._createCellCoords(n.row,a.col)};break;case"SW-NE":o==="top"?c={start:this.hot._createCellCoords(e.highlight.row,n.col),end:this.hot._createCellCoords(n.row,a.col)}:c={start:this.hot._createCellCoords(n.row,s.col),end:this.hot._createCellCoords(s.row,n.col)};break;case"SE-NW":o==="bottom"?c={start:this.hot._createCellCoords(n.row,u.col),end:this.hot._createCellCoords(s.row,n.col)}:o==="top"&&(c={start:l,end:n});break}break;case"SE-NW":switch(i){case"NW-SE":case"NE-SW":case"SW-NE":o==="top"&&(c.end=n);break;case"SE-NW":o==="top"?c.end=n:c={start:n,end:s};break}break}return c}isDragged(){return this.dragged.length>0}}function _0(){let{label:t="",colspan:e=1,origColspan:n=1,collapsible:r=!1,crossHiddenColumns:i=[],isCollapsed:o=!1,isHidden:s=!1,isRoot:a=!1,isPlaceholder:l=!1,headerClassNames:u=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{label:t,colspan:e,origColspan:n,collapsible:r,isCollapsed:o,crossHiddenColumns:i,isHidden:s,isRoot:a,isPlaceholder:l,headerClassNames:u}}function jk(){return{label:"",isPlaceholder:!0}}function ure(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const n=[];if(e===0)return n;H(t,i=>{const o=[];let s=0;n.push(o),H(i,a=>{const l=_0();if(He(a)){const{label:c,colspan:h,headerClassName:d}=a;l.label=xt(c),typeof h=="number"&&h>1&&(l.colspan=h,l.origColspan=h),typeof d=="string"&&(l.headerClassNames=[...d.split(" ")])}else l.label=xt(a);s+=l.origColspan;let u=!1;if(s>=e&&(l.colspan=l.origColspan-(s-e),l.origColspan=l.colspan,u=!0),o.push(l),l.colspan>1)for(let c=0;c<l.colspan-1;c++)o.push(jk());return!u})});const r=Math.max(...je(n,i=>i.length));return H(n,i=>{if(i.length<r){const o=je(new Array(r-i.length),()=>_0());i.splice(i.length,0,...o)}}),n}function M0(t,e,n){cre(t,e),e.set(t,n)}function cre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ai(t,e){return t.get(Uk(t,e))}function Rd(t,e,n){return t.set(Uk(t,e),n),n}function Uk(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 zk=["label","collapsible"];var ls=new WeakMap,bl=new WeakMap,I0=new WeakMap;class hre{constructor(){M0(this,ls,[]),M0(this,bl,0),M0(this,I0,1/0)}setColumnsLimit(e){Rd(I0,this,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Rd(ls,this,ure(e,Ai(I0,this))),Rd(bl,this,Ai(ls,this).length)}getData(){return Ai(ls,this)}mergeWith(e){H(e,n=>{let{row:r,col:i,...o}=n;const s=this.getHeaderSettings(r,i);s!==null&&rn(s,o,zk)})}map(e){H(Ai(ls,this),n=>{H(n,r=>{const i=e({...r});He(i)&&rn(r,i,zk)})})}getHeaderSettings(e,n){var r;if(e>=Ai(bl,this)||e<0)return null;const i=Ai(ls,this)[e];return Array.isArray(i)===!1||n>=i.length?null:(r=i[n])!==null&&r!==void 0?r:null}getHeadersSettings(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const i=[];if(e>=Ai(bl,this)||e<0)return i;const o=Ai(ls,this)[e];let s=0;for(let a=n;a<o.length;a++){const l=o[a];if(l.isPlaceholder)throw new Error("The first column settings cannot overlap the other header layers");if(s+=l.colspan,i.push(l),l.colspan>1&&(a+=l.colspan-1),s===r)break;if(s>r)throw new Error("The last column settings cannot overlap the other header layers")}return i}getLayersCount(){return Ai(bl,this)}getColumnsCount(){return Ai(bl,this)>0?Ai(ls,this)[0].length:0}clear(){Rd(ls,this,[]),Rd(bl,this,0)}}function P0(t,e,n){return(e=dre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dre(t){var e=fre(t,"string");return typeof e=="symbol"?e:e+""}function fre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Yk="DF-pre-order";function Gk(t,e){let n=t.call(e,this);for(let r=0;r<this.childs.length;r++){if(n===!1)return!1;n=Gk.call(this.childs[r],t,e)}return n}const gre="DF-post-order";function qk(t,e){for(let n=0;n<this.childs.length;n++)if(qk.call(this.childs[n],t,e)===!1)return!1;return t.call(e,this)}const Kk="BF";function mre(t,e){const n=[this];function r(){if(n.length===0)return;const i=n.shift();n.push(...i.childs),t.call(e,i)!==!1&&r()}r()}const pre=Kk,Xk=new Map([[Yk,Gk],[gre,qk],[Kk,mre]]);class tp{constructor(e){P0(this,"data",{}),P0(this,"parent",null),P0(this,"childs",[]),this.data=e}addChild(e){e.parent=this,this.childs.push(e)}cloneTree(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this;const n=new tp({...e.data});for(let r=0;r<e.childs.length;r++)n.addChild(this.cloneTree(e.childs[r]));return n}replaceTreeWith(e){this.data={...e.data},this.childs=[];for(let n=0;n<e.childs.length;n++)this.addChild(e.childs[n])}walkDown(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pre;if(!Xk.has(n))throw new Error(`Traversal strategy "${n}" does not exist`);Xk.get(n).call(this,e,this)}walkUp(e){const n=this,r=i=>{e.call(n,i)!==!1&&i.parent!==null&&r(i.parent)};r(this)}}function O0(t,e,n){wre(t,e),e.set(t,n)}function wre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zn(t,e){return t.get(Zk(t,e))}function vre(t,e,n){return t.set(Zk(t,e),n),n}function Zk(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 Ku=new WeakMap,Sl=new WeakMap,Xu=new WeakMap;class Cre{constructor(e){O0(this,Ku,new Map),O0(this,Sl,new Map),O0(this,Xu,null),vre(Xu,this,e)}getRoots(){return Array.from(Zn(Ku,this).values())}getRootByColumn(e){let n;return Zn(Sl,this).has(e)&&(n=Zn(Ku,this).get(Zn(Sl,this).get(e))),n}getNode(e,n){const r=this.getRootByColumn(n);if(!r)return;const i=n-Zn(Sl,this).get(n);let o=0,s;return r.walkDown(a=>{const{data:{origColspan:l,headerLevel:u}}=a;if(e===u){if(i>=o&&i<=o+l-1)return s=a,s.data.isRoot=n===s.data.columnIndex,!1;o+=l}}),s}rebuildTreeIndex(){let e=0;Zn(Sl,this).clear(),H(Zn(Ku,this),n=>{let[,{data:{colspan:r}}]=n;for(let i=e;i<e+r;i++)Zn(Sl,this).set(i,e);e+=r})}buildTree(){this.clear();const e=Zn(Xu,this).getColumnsCount();let n=0;for(;n<e;){const r=Zn(Xu,this).getHeaderSettings(0,n),i=new tp;Zn(Ku,this).set(n,i),this.buildLeaves(i,n,0,r.origColspan),n+=r.origColspan}this.rebuildTreeIndex()}buildLeaves(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;const o=Zn(Xu,this).getHeadersSettings(r,n,i);r+=1,H(o,s=>{const a={...s,headerLevel:r-1,columnIndex:n};let l;r===1?(e.data=a,l=e):(l=new tp(a),e.addChild(l)),r<Zn(Xu,this).getLayersCount()&&this.buildLeaves(l,n,r,s.origColspan),n+=s.origColspan})}clear(){Zn(Ku,this).clear(),Zn(Sl,this).clear()}}function Qk(t,e){t.walkDown(n=>{let{data:r,childs:i}=n;if(!r.isHidden&&(e(r.columnIndex),i.length===0))for(let o=1;o<r.colspan;o++)e(r.columnIndex+o)})}function np(t,e){let{childs:n}=t;if(n.length!==0)return n[0].data[e]}function rp(t){return np(t,"origColspan")===t.data.origColspan}function x0(t){const{data:e,childs:n}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(rp(t))return x0(n[0]);e.isCollapsed=!1;const i=n.slice(1),o=new Set;let s=0;if(i.length>0)H(i,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;s+=l.colspan,Qk(a,u=>{o.add(u)})});else{const{colspan:a,origColspan:l,columnIndex:u}=e;s=l-a;for(let c=1;c<l;c++)o.add(u+c)}return t.walkUp(a=>{const{data:l}=a;l.colspan+=s,l.colspan>=l.origColspan?(l.colspan=l.origColspan,l.isCollapsed=!1):rp(a)&&(l.isCollapsed=np(a,"isCollapsed"))}),{rollbackModification:()=>A0(t),affectedColumns:Array.from(o),colspanCompensation:s}}function A0(t){var e;const{data:n,childs:r}=t;if(n.isCollapsed||n.isHidden||n.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(rp(t))return A0(r[0]);n.isCollapsed=!0;const o=r.slice(1),s=new Set;if(o.length>0)H(o,l=>{Qk(l,u=>{s.add(u)}),l.data.clonedTree=l.cloneTree(),l.walkDown(u=>{let{data:c}=u;c.isHidden=!0})});else{const{origColspan:l,columnIndex:u}=n;for(let c=1;c<l;c++){const h=u+c;s.add(h)}}const a=n.colspan-((e=np(t,"colspan"))!==null&&e!==void 0?e:1);return t.walkUp(l=>{const{data:u}=l;u.colspan-=a,u.colspan<=1?(u.colspan=1,u.isCollapsed=!0):rp(l)&&(u.isCollapsed=np(l,"isCollapsed"))}),{rollbackModification:()=>x0(t),affectedColumns:Array.from(s),colspanCompensation:a}}function yre(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(tt`The passed node is not the last node on the tree. Only for\x20
74
- the last node, the hide column modification can be applied.`);const{crossHiddenColumns:n}=t.data;if(n.includes(e))return;let r=!1;t.walkUp(i=>{const{data:{collapsible:o}}=i;if(o)return r=!0,!1}),!r&&t.walkUp(i=>{const{data:o}=i;o.crossHiddenColumns.push(e),o.colspan>1?o.colspan-=1:o.isHidden=!0})}function bre(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(tt`The passed node is not the last node on the tree. Only for\x20
75
- the last node, the show column modification can be applied.`);const{crossHiddenColumns:n}=t.data;if(!n.includes(e))return;let r=!1;t.walkUp(i=>{const{data:{collapsible:o}}=i;if(o)return r=!0,!1}),!r&&t.walkUp(i=>{const{data:o}=i;o.crossHiddenColumns.splice(o.crossHiddenColumns.indexOf(e),1),!o.isHidden&&o.colspan<o.origColspan&&(o.colspan+=1),o.isHidden=!1})}const Jk=new Map([["collapse",A0],["expand",x0],["hide-column",yre],["show-column",bre]]);function Sre(t,e,n){if(!Jk.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return Jk.get(t)(e,n)}function ip(t){const e=[];return H(t,n=>{n.walkDown(r=>{const i=r.data,{origColspan:o,columnIndex:s,headerLevel:a,crossHiddenColumns:l}=i,u=Ere(e,a);let c=!1;for(let h=s;h<s+o;h++)if(l.includes(h)||c)u.push(jk());else{const f=Rre(i);f.isRoot=!0,u.push(f),c=!0}})}),e}function Rre(t){const{crossHiddenColumns:e,...n}=_0(t);return n}function Ere(t,e){let n;return Array.isArray(t[e])?n=t[e]:(n=[],t[e]=n),n}function H0(t,e,n){Tre(t,e),e.set(t,n)}function Tre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ed(t,e,n){return t.set(eL(t,e),n),n}function Ft(t,e){return t.get(eL(t,e))}function eL(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 vo=new WeakMap,pr=new WeakMap,Rl=new WeakMap;class _re{constructor(){H0(this,vo,new hre),H0(this,pr,new Cre(Ft(vo,this))),H0(this,Rl,[[]])}setState(e){Ft(vo,this).setData(e);let n=!1;try{Ft(pr,this).buildTree()}catch{Ft(pr,this).clear(),Ft(vo,this).clear(),n=!0}return Ed(Rl,this,ip(Ft(pr,this).getRoots())),n}setColumnsLimit(e){Ft(vo,this).setColumnsLimit(e)}mergeStateWith(e){const n=je(e,r=>{let{row:i,...o}=r;return{row:i<0?this.rowCoordsToLevel(i):i,...o}});Ft(vo,this).mergeWith(n),Ft(pr,this).buildTree(),Ed(Rl,this,ip(Ft(pr,this).getRoots()))}mapState(e){Ft(vo,this).map(e),Ft(pr,this).buildTree(),Ed(Rl,this,ip(Ft(pr,this).getRoots()))}mapNodes(e){return tr(Ft(pr,this).getRoots(),(n,r)=>(r.walkDown(i=>{const o=e(i.data);o!==void 0&&n.push(o)}),n),[])}triggerNodeModification(e,n,r){n<0&&(n=this.rowCoordsToLevel(n));const i=Ft(pr,this).getNode(n,r);let o;return i&&(o=Sre(e,i,r),Ed(Rl,this,ip(Ft(pr,this).getRoots()))),o}triggerColumnModification(e,n){return this.triggerNodeModification(e,-1,n)}rowCoordsToLevel(e){if(e>=0)return null;const n=e+Math.max(this.getLayersCount(),1);return n<0?null:n}levelToRowCoords(e){if(e<0)return null;const n=e-Math.max(this.getLayersCount(),1);return n>=0?null:n}getHeaderSettings(e,n){var r,i;return e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount()?null:(r=(i=Ft(Rl,this)[e])===null||i===void 0?void 0:i[n])!==null&&r!==void 0?r:null}getHeaderTreeNodeData(e,n){const r=this.getHeaderTreeNode(e,n);return r?{...r.data}:null}getHeaderTreeNode(e,n){if(e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount())return null;const r=Ft(pr,this).getNode(e,n);return r||null}findTopMostEntireHeaderLevel(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;const r=n-e+1;let i=!1,o=null;for(let s=e;s<=n;s++){const a=Ft(pr,this).getRootByColumn(s);if(!a)break;i=!0,a.walkDown(l=>{const{columnIndex:u,headerLevel:c,origColspan:h,isHidden:d}=l.data;d||h<=r&&u>=e&&u+h-1<=n&&(o===null||c<o)&&(o=c)},Yk)}return i&&o===null?-1:this.levelToRowCoords(o??0)}findLeftMostColumnIndex(e,n){var r;const{isRoot:i}=(r=this.getHeaderSettings(e,n))!==null&&r!==void 0?r:{isRoot:!0};if(i)return n;let o=n-1;for(;o>=0;){var s;const{isRoot:a}=(s=this.getHeaderSettings(e,o))!==null&&s!==void 0?s:{isRoot:!0};if(a)break;o-=1}return o}findRightMostColumnIndex(e,n){var r;const{isRoot:i,origColspan:o}=(r=this.getHeaderSettings(e,n))!==null&&r!==void 0?r:{isRoot:!0,origColspan:1};if(i)return n+o-1;let s=n+1;for(;s<this.getColumnsCount();){var a;const{isRoot:l}=(a=this.getHeaderSettings(e,s))!==null&&a!==void 0?a:{isRoot:!0};if(l)break;s+=1}return s-1}getLayersCount(){return Ft(vo,this).getLayersCount()}getColumnsCount(){return Ft(vo,this).getColumnsCount()}clear(){Ed(Rl,this,[]),Ft(vo,this).clear(),Ft(pr,this).clear()}}function Td(t,e,n){return(e=Mre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mre(t){var e=Ire(t,"string");return typeof e=="symbol"?e:e+""}function Ire(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Pre{constructor(e,n){Td(this,"hot",void 0),Td(this,"nestedHeaderSettingsGetter",void 0),Td(this,"layersCount",0),Td(this,"container",void 0),Td(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=n,this.widthsMap=this.hot.columnIndexMapper.createAndRegisterIndexMap("nestedHeaders.widthsMap","physicalIndexToValue")}setLayersCount(e){return this.layersCount=e,this}getWidth(e){return this.widthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e))}buildWidthsMap(){const e=this.hot.getCurrentThemeName();this.container=this.hot.rootDocument.createElement("div"),this.container.classList.add("handsontable","htGhostTable","htAutoSize"),e&&this.container.classList.add(e),this._buildGhostTable(this.container),this.hot.rootDocument.body.appendChild(this.container);const n=this.container.querySelectorAll("tr:last-of-type th"),r=n.length;this.widthsMap.clear();for(let i=0;i<r;i++){const o=this.hot.columnIndexMapper.getVisualFromRenderableIndex(i),s=this.hot.toPhysicalColumn(o);this.widthsMap.setValueAtIndex(s,n[i].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){const{rootDocument:n,columnIndexMapper:r}=this.hot,i=n.createDocumentFragment(),o=n.createElement("table"),s=!!this.hot.getSettings().dropdownMenu,a=r.getRenderableIndexesLength();for(let l=0;l<this.layersCount;l++){const u=n.createElement("tr");for(let c=0;c<a;c++){let h=r.getVisualFromRenderableIndex(c);h===null&&(h=c);const d=n.createElement("th"),f=this.nestedHeaderSettingsGetter(l,h);if(f&&(!f.isPlaceholder||f.isHidden)){let m=f.label;s&&(m+='<button class="changeType"></button>'),Gl(d,m),d.colSpan=f.colspan,u.appendChild(d)}}o.appendChild(u)}i.appendChild(o),e.appendChild(i)}clear(){this.widthsMap.clear(),this.container=null}}function Ore(t,e){nL(t,e),e.add(t)}function tL(t,e,n){return(e=xre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xre(t){var e=Are(t,"string");return typeof e=="symbol"?e:e+""}function Are(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _d(t,e,n){nL(t,e),e.set(t,n)}function nL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function us(t,e,n){return t.set(Vt(t,e),n),n}function Ve(t,e){return t.get(Vt(t,e))}function Vt(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 rL="nestedHeaders",Hre=280;var st=new WeakMap,ta=new WeakMap,Md=new WeakMap,op=new WeakMap,sp=new WeakMap,qt=new WeakSet;class Nre extends Xe{constructor(){super(...arguments),Ore(this,qt),_d(this,st,new _re),_d(this,ta,null),_d(this,Md,null),_d(this,op,!1),_d(this,sp,null),tL(this,"ghostTable",new Pre(this.hot,(e,n)=>this.getHeaderSettings(e,n))),tL(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return rL}static get PLUGIN_PRIORITY(){return Hre}isEnabled(){return!!this.hot.getSettings()[rL]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();(!Array.isArray(n)||!Array.isArray(n[0]))&&et(tt`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
76
- passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>Vt(qt,this,Xre).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,Zre).call(e,...i)}),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,$re).call(e,...i)}),this.addHook("afterOnCellMouseDown",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,Fre).call(e,...i)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,Vre).call(e,...i)}),this.addHook("beforeOnCellMouseUp",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,Wre).call(e,...i)}),this.addHook("beforeSelectionHighlightSet",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,Bre).call(e,...i)}),this.addHook("modifyTransformStart",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,jre).call(e,...i)}),this.addHook("afterSelection",()=>Vt(qt,this,ap).call(this)),this.addHook("afterSelectionFocusSet",()=>Vt(qt,this,ap).call(this)),this.addHook("beforeViewportScrollHorizontally",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,Dre).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",r=>Vt(qt,this,zre).call(this,r)),this.addHook("modifyColWidth",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,Gre).call(e,...i)}),this.addHook("modifyColumnHeaderValue",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,qre).call(e,...i)}),this.addHook("beforeHighlightingColumnHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,kre).call(e,...i)}),this.addHook("beforeCopy",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,Lre).call(e,...i)}),this.addHook("beforeSelectColumns",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,Ure).call(e,...i)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,Yre).call(e,...i)}),this.addHook("modifyFocusedElement",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Vt(qt,e,Kre).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>Vt(qt,this,ap).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>Vt(qt,this,ap).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();Ve(st,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=Ve(st,this).setState(e)),this.detectedOverlappedHeaders&&et(tt`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
77
- is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((n,r)=>{const i=n===!0?"hide-column":"show-column";Ve(st,this).triggerColumnModification(i,r)}),!Ve(ta,this)&&this.enabled&&us(ta,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(n=>{n.forEach(r=>{let{op:i,index:o,newValue:s}=r;if(i==="replace"){const a=s===!0?"hide-column":"show-column";Ve(st,this).triggerColumnModification(a,o)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),Ve(st,this).clear(),Ve(ta,this).unsubscribe(),us(ta,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return Ve(st,this)}getLayersCount(){return Ve(st,this).getLayersCount()}getHeaderSettings(e,n){return Ve(st,this).getHeaderSettings(e,n)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,n=e.getSetting("columnHeaders").length,r=e.wtTable.THEAD,i=e.wtOverlays.topOverlay.clone.wtTable.THEAD,o=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let s=0;s<n;s++){const a=r.childNodes[s];if(!a)break;const l=i.childNodes[s],u=o?o.childNodes[s]:null;for(let c=0,h=a.childNodes.length;c<h;c++)a.childNodes[c].removeAttribute("colspan"),ve(a.childNodes[c],"hiddenHeader"),l&&l.childNodes[c]&&(l.childNodes[c].removeAttribute("colspan"),ve(l.childNodes[c],"hiddenHeader")),o&&u&&u.childNodes[c]&&(u.childNodes[c].removeAttribute("colspan"),ve(u.childNodes[c],"hiddenHeader"))}}headerRendererFactory(e){var n=this;const r=this.hot.view._wt.getSetting("fixedColumnsStart");return(i,o)=>{var s;const{columnIndexMapper:a,view:l}=this.hot;let u=a.getVisualFromRenderableIndex(i);u===null&&(u=i),o.removeAttribute("colspan"),ve(o,"hiddenHeader"),ve(o,"hiddenHeaderText");const{colspan:c,isHidden:h,isPlaceholder:d,headerClassNames:f}=(s=Ve(st,this).getHeaderSettings(e,u))!==null&&s!==void 0?s:{};if(d||h)X(o,"hiddenHeader");else if(c>1){var m,b,S;const{wtOverlays:E}=l._wt,v=(m=E.topInlineStartCornerOverlay)===null||m===void 0?void 0:m.clone.wtTable.THEAD.contains(o),I=(b=E.inlineStartOverlay)===null||b===void 0?void 0:b.clone.wtTable.THEAD.contains(o);!((S=E.topOverlay)===null||S===void 0)&&S.clone.wtTable.THEAD.contains(o)&&u<r&&X(o,"hiddenHeaderText");const T=v||I?Math.min(c,r-i):c;T>1&&o.setAttribute("colspan",T)}if(this.hot.view.appendColHeader(u,o,function(){return n.getColumnHeaderValue(...arguments)},e),!d&&!h){const E=o.querySelector("div.relative");E&&f&&f.length>0&&(ve(E,this.hot.getColumnMeta(u).headerClassName),X(E,f))}}}getColumnHeaderValue(e,n){var r;const{isHidden:i,isPlaceholder:o}=(r=Ve(st,this).getHeaderSettings(n,e))!==null&&r!==void 0?r:{};return o||i?"":this.hot.getColHeader(e,n)}destroy(){us(st,this,null),Ve(ta,this)!==null&&(Ve(ta,this).unsubscribe(),us(ta,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return Ve(st,this).getHeaderTreeNodeData(e.row,e.col)}}function ap(){var t;const e=(t=this.hot)===null||t===void 0?void 0:t.getSelectedRangeLast();if(!e)return;const{highlight:n}=e;if(n.isHeader()&&n.col>=0){const i=Ve(st,this).findLeftMostColumnIndex(n.row,n.col),o=this.hot.selection.highlight.getFocus();o.visualCellRange.highlight.col=i,o.visualCellRange.from.col=i,o.visualCellRange.to.col=i,o.commit()}}function Dre(t,e){var n;const r=this.hot.getSelectedRangeLast();if(!r)return t;const{highlight:i}=r,{navigableHeaders:o}=this.hot.getSettings(),s=this.hot.selection.isSelectedByColumnHeader(),a=o?i.row:(n=Ve(sp,this))===null||n===void 0?void 0:n.row,l=s?t:i.col,u=a<0&&l>=0;if(us(sp,this,null),!u)return t;const c=this.hot.getFirstFullyVisibleColumn(),h=this.hot.getLastFullyVisibleColumn(),d=h-c+1,f=Ve(st,this).findLeftMostColumnIndex(a,l),m=Ve(st,this).findRightMostColumnIndex(a,l),b=m-f+1;if(f<c&&m>h)return f;if(s){let S=null;return f>=c&&m>h?b>d?(e.value="start",S=f):(e.value="end",S=m):f<c&&m<=h&&(b>d?(e.value="end",S=m):(e.value="start",S=f)),S}return f<=c?f:m}function kre(t,e,n){const r=Ve(st,this).getHeaderTreeNodeData(e,t);if(!r)return t;const{columnCursor:i,selectionType:o,selectionWidth:s}=n,{isRoot:a,colspan:l}=Ve(st,this).getHeaderSettings(e,t);if(o===iR){if(!a)return r.columnIndex}else if(o===OH&&(l>s-i||!a))return null;return t}function Lre(t,e,n){let{columnHeadersCount:r}=n;if(r!==0)for(let o=0;o<e.length;o++){const{startRow:s,startCol:a,endRow:l,endCol:u}=e[o],c=l-s+1,h=a-u+1;if(s>=0||h===1)break;for(let d=a;d<=u;d++)for(let f=s;f<=l;f++){var i;const m=c+f,b=d-a;if(b===0)continue;((i=Ve(st,this).getHeaderTreeNodeData(f,d))===null||i===void 0?void 0:i.isRoot)===!1&&(t[m][b]="")}}}function $re(t,e,n,r){this._getHeaderTreeNodeDataByCoords(e)&&(r.column=!0)}function Fre(t,e){const n=this._getHeaderTreeNodeDataByCoords(e);if(!n)return;us(Md,this,e.clone()),us(op,this,!0);const{selection:r}=this.hot,i=r.isSelected()?r.getSelectedRange().current():null,o=[],{columnIndex:s,origColspan:a}=n,l=!r.inInSelection(e);t.shiftKey&&i?e.col<i.from.col?o.push(i.getTopEndCorner().col,s,e.row):e.col>i.from.col?o.push(i.getTopStartCorner().col,s+a-1,e.row):o.push(s,s+a-1,e.row):(yy(t)||Sa(t)&&l||Nz(t))&&o.push(s,s+a-1,e.row),r.selectColumns(...o)}function Vre(t,e,n,r){if(!this.hot.view.isMouseDown()||r.column)return;const i=this._getHeaderTreeNodeDataByCoords(e);if(!i)return;const{columnIndex:o,origColspan:s}=i,a=this.hot.getSelectedRangeLast(),l=a.getTopStartCorner(),u=a.getBottomEndCorner(),{from:c}=a;r.column=!0,r.cell=!0;const h=[],d=ze(e.row,-1/0,-1);e.col<c.col?h.push(u.col,o,d):e.col>c.col?h.push(l.col,o+s-1,d):h.push(o,o+s-1,d),this.hot.selection.selectColumns(...h)}function Wre(){us(op,this,!1)}function Bre(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!Ve(op,this)||!t)return;const e=this.hot.getSelectedRangeLast(),n=e.getTopStartCorner().col,r=e.getBottomEndCorner().col,{columnIndex:i,origColspan:o}=Ve(st,this).getHeaderTreeNodeData(Ve(Md,this).row,Ve(Md,this).col);if(e.setHighlight(Ve(Md,this)),o>e.getWidth()||i<n||i+o-1>r){const s=Ve(st,this).findTopMostEntireHeaderLevel(ze(n,i,i+o-1),ze(r,i,i+o-1));e.highlight.row=s,e.highlight.col=e.from.col}}function jre(t){const{highlight:e}=this.hot.getSelectedRangeLast(),n=this.hot._createCellCoords(e.row+t.row,e.col+t.col);if(!(n.isHeader()&&n.col>=0))return;const i=Ve(st,this).findLeftMostColumnIndex(n.row,n.col),o=Ve(st,this).findRightMostColumnIndex(n.row,n.col);if(t.col<0){const s=e.col>=i&&e.col<=o?i-1:o,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,-1);a===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,e.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(a,e.col)-1,1)}else if(t.col>0){const s=e.col>=i&&e.col<=o?o+1:i,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,1);a===null?t.col=this.hot.view.countRenderableColumnsInRange(e.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(e.col,a)-1,1)}}function Ure(t,e,n){const r=t.row,i=this._getHeaderTreeNodeDataByCoords({row:r,col:t.col}),o=this._getHeaderTreeNodeDataByCoords({row:r,col:e.col});us(sp,this,n.clone()),e.col<t.col?(i&&(t.col=i.columnIndex+i.origColspan-1),o&&(e.col=o.columnIndex)):e.col>=t.col&&(i&&(t.col=i.columnIndex),o&&(e.col=o.columnIndex+o.origColspan-1))}function zre(t){if(Ve(st,this).getLayersCount()>0){t.length=0;for(let e=0;e<Ve(st,this).getLayersCount();e++)t.push(this.headerRendererFactory(e))}}function Yre(t){const e=Ve(st,this).getLayersCount();let n=t.startColumn,r=!!e;for(let i=0;i<e;i++){const o=Ve(st,this).findLeftMostColumnIndex(i,t.startColumn),s=this.hot.columnIndexMapper.getRenderableFromVisualIndex(o);if(o>=0&&(r=!1),Bn(s)&&s<t.startColumn){n=s;break}}t.startColumn=r?Ve(st,this).getHeaderTreeNodeData(0,n).columnIndex:n}function Gre(t,e){const n=this.ghostTable.getWidth(e);return t>n?t:n}function qre(t,e,n){var r;const{label:i}=(r=Ve(st,this).getHeaderTreeNodeData(n,e))!==null&&r!==void 0?r:{label:""};return i}function Kre(t,e){if(t<0)return this.hot.getCell(t,Ve(st,this).findLeftMostColumnIndex(t,e),!0)}function Xre(){this.updatePlugin()}function Zre(t,e){e||this.updatePlugin()}function Id(t,e,n){return(e=Qre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qre(t){var e=Jre(t,"string");return typeof e=="symbol"?e:e+""}function Jre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class eie{constructor(e,n){Id(this,"hot",void 0),Id(this,"data",null),Id(this,"plugin",void 0),Id(this,"parentReference",new WeakMap),Id(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=n,this.plugin=e}setData(e){this.data=e}getData(){return this.data}getRawSourceData(){let e=null;return this.plugin.disableCoreAPIModifiers(),e=this.hot.getSourceData(),this.plugin.enableCoreAPIModifiers(),e}updateWithData(e){this.setData(e),this.rewriteCache()}rewriteCache(){this.cache={levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap},fe(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,n,r){this.cache.levels[n]||(this.cache.levels[n]=[],this.cache.levelCount+=1),this.cache.levels[n].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:r,row:this.cache.rows.length-1,level:n}),this.hasChildren(e)&&H(e.__children,i=>{this.cacheNode(i,n+1,e)})}getDataObject(e){return e==null?null:this.cache.rows[e]}readTreeNodes(e,n,r,i){let o=!1,s=n;if(isNaN(s)&&s.end)return s;let a=e;return a||(a={__children:this.data},o=!0,s-=1),r!=null&&s===r?{result:a,end:!0}:i!=null&&a===i?{result:s,end:!0}:(s+=1,a.__children&&H(a.__children,l=>{if(this.parentReference.set(l,o?null:a),s=this.readTreeNodes(l,s,r,i),isNaN(s)&&s.end)return!1}),s)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return Ne(this.data[0],(n,r)=>{e[r]=null}),e}getRowIndex(e){return e==null?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let n=null;isNaN(e)?n=e:n=this.getDataObject(e);const r=this.getRowParent(e);return r==null?this.data.indexOf(n):r.__children.indexOf(n)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let n=0,r=e;return isNaN(r)||(r=this.getDataObject(r)),!r||!r.__children?0:(H(r.__children,i=>{n+=1,i.__children&&(n+=this.countChildren(i))}),n)}getRowParent(e){let n;return isNaN(e)?n=e:n=this.getDataObject(e),this.getRowObjectParent(n)}getRowObjectParent(e){return!e||typeof e!="object"?null:this.cache.nodeInfo.get(e).parent}getRowLevel(e){let n=null;return isNaN(e)?n=e:n=this.getDataObject(e),n?this.getRowObjectLevel(n):null}getRowObjectLevel(e){return e==null?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let n=e;return isNaN(n)||(n=this.getDataObject(n)),!!(n.__children&&n.__children.length)}isChild(e){return this.getRowParent(e)!==null}getChild(e,n){var r;return((r=e.__children)===null||r===void 0?void 0:r[n])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var n;let r=e;return isNaN(r)||(r=this.getDataObject(r)),r&&!!r.__children&&((n=r.__children)===null||n===void 0?void 0:n.length)!==0}addChild(e,n){let r=n;this.hot.runHooks("beforeAddChild",e,r);let i=null;e&&(i=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",i+this.countChildren(e)+1,1);let o=e;e||(o=this.mockParent()),o.__children||(o.__children=[]),r||(r=this.mockNode()),o.__children.push(r),this.rewriteCache();const s=this.getRowIndex(r);this.hot.rowIndexMapper.insertIndexes(s,1),this.hot.runHooks("afterCreateRow",s,1),this.hot.runHooks("afterAddChild",e,r)}addChildAtIndex(e,n,r){let i=r,o;if(i||(i=this.mockNode()),this.hot.runHooks("beforeAddChild",e,i,n),e){const a=this.getRowIndex(e)+n+1;this.hot.runHooks("beforeCreateRow",a,1),e.__children.splice(n,null,i),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(a,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",a,1),o=a}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",n,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),o=this.getRowIndex(this.data[n]);i=this.getDataObject(o),this.hot.runHooks("afterAddChild",e,i,n)}addSibling(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"below";const r=this.translateTrimmedRow(e),i=this.getRowParent(r),o=this.getRowIndexWithinParent(r);switch(n){case"below":this.addChildAtIndex(i,o+1,null);break;case"above":this.addChildAtIndex(i,o,null);break}}detachFromParent(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=null;const i=[];Array.isArray(e)?(fe(e[0],e[2],d=>{const f=this.translateTrimmedRow(d);i.push(this.getDataObject(f))}),fe(0,i.length-2,d=>{this.detachFromParent(i[d],!1)}),r=i[i.length-1]):r=e;const o=this.getRowIndex(r),s=this.countChildren(r),a=this.getRowIndexWithinParent(r),l=this.getRowParent(r),u=this.getRowParent(l),c=this.getRowIndex(u);let h=null;if(this.hot.runHooks("beforeDetachChild",l,r),a!=null){const d=Array.from(new Array(o+s+1).keys()).splice(-1*(s+1));if(this.hot.runHooks("beforeRemoveRow",o,s+1,d,this.plugin.pluginName),l.__children.splice(a,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",o,s+1,d,this.plugin.pluginName),u){h=c+this.countChildren(u);const f=this.getChild(u,this.countChildren(u)-1),m=this.getRowIndex(f);this.hot.runHooks("beforeCreateRow",m+1,s+1,this.plugin.pluginName),u.__children.push(r)}else h=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",h-2,s+1,this.plugin.pluginName),this.data.push(r)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",h-2,s+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",l,r,this.getRowIndex(r)),n&&this.hot.render()}filterData(e,n,r){const i=[];H(r,o=>{i.push(this.getDataObject(o))}),H(i,o=>{const s=this.getRowIndexWithinParent(o),a=this.getRowParent(o);a===null?this.data.splice(s,1):a.__children.splice(s,1)}),this.rewriteCache()}spliceData(e,n,r){const i=this.getDataObject(e-1);let o=null,s=e;i&&i.__children&&i.__children.length===0?(o=i,s=0):e<this.countAllRows()&&(o=this.getRowParent(e),s=this.getRowIndexWithinParent(e)),o?r?o.__children.splice(s,n,...r):o.__children.splice(s,n):r?this.data.splice(s,n,...r):this.data.splice(s,n),this.rewriteCache()}syncRowWithRawSource(e){let n=e,r=n;do r=this.getRowParent(r),r!==null&&(n=r);while(r!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(n),"__children",n.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,n,r,i){const o=n===this.hot.countRows(),s=this.getRowParent(e),a=this.getRowIndexWithinParent(e),l=s.__children.slice(a,a+1),u=e>n;let c=o?this.getRowParent(n-1):this.getRowParent(n);c==null&&(c=this.getRowParent(n-1)),c==null&&(c=this.getDataObject(n-1)),c?c.__children||(c.__children=[]):(c=this.getDataObject(n),c.__children=[]);const h=o||r||i?c.__children.length:this.getRowIndexWithinParent(n),d=s===c;c.__children.splice(h,0,l[0]),s.__children.splice(a+(u&&d?1:0),1),this.syncRowWithRawSource(s),d||this.syncRowWithRawSource(c)}translateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.translateTrimmedRow(e):e}untranslateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.untranslateTrimmedRow(e):e}}function iL(t,e,n){return(e=tie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tie(t){var e=nie(t,"string");return typeof e=="symbol"?e:e+""}function nie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class N0{constructor(e,n){iL(this,"hot",void 0),iL(this,"plugin",void 0),this.hot=n,this.plugin=e}}class Co extends N0{static get CSS_CLASSES(){return{indicatorContainer:"ht_nestingLevels",parent:"ht_nestingParent",indicator:"ht_nestingLevel",emptyIndicator:"ht_nestingLevel_empty",button:"ht_nestingButton",expandButton:"ht_nestingExpand",collapseButton:"ht_nestingCollapse"}}constructor(e,n){super(e,n),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,n){const r=this.hot.toPhysicalRow(e),i=this.dataManager.getRowLevel(r),o=this.dataManager.getDataObject(r),s=n.getElementsByTagName("DIV")[0],a=s.querySelector("span.rowHeader"),l=s.querySelectorAll('[class^="ht_nesting"]'),u=this.hot.getSettings().ariaTags;if(H(l,c=>{c&&s.removeChild(c)}),X(n,Co.CSS_CLASSES.indicatorContainer),i){const{rootDocument:c}=this.hot,h=a.cloneNode(!0);s.innerHTML="",fe(0,i-1,()=>{const d=c.createElement("SPAN");X(d,Co.CSS_CLASSES.emptyIndicator),s.appendChild(d)}),s.appendChild(h)}if(this.dataManager.hasChildren(o)){const c=this.hot.rootDocument.createElement("DIV");u&&Se(c,[pa()]),X(n,Co.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(r)?(X(c,`${Co.CSS_CLASSES.button} ${Co.CSS_CLASSES.expandButton}`),u&&Se(n,[Br(!1)])):(X(c,`${Co.CSS_CLASSES.button} ${Co.CSS_CLASSES.collapseButton}`),u&&Se(n,[Br(!0)])),s.appendChild(c)}}updateRowHeaderWidth(e){let n=e;n||(n=this.dataManager.cache.levelCount);const r=this.hot.view.getStylesHandler();let i=11;r.isClassicTheme()||(i=r.getCSSVariableValue("cell-horizontal-padding")*2),this.rowHeaderWidthCache=Math.max(50,i+10*n+25),this.hot.render()}}class rie extends N0{constructor(e,n){var r;super(e,n),r=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;r.lastCollapsedRows=r.collapsedRows.slice(0),r.expandMultipleChildren(r.lastCollapsedRows,i)},shiftStash:function(i,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;o==null&&(o=1/0),H(r.lastCollapsedRows,(a,l)=>{a>=i&&a<o&&(r.lastCollapsedRows[l]=a+s)})},applyStash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;r.collapseMultipleChildren(r.lastCollapsedRows,i),r.lastCollapsedRows=void 0},trimStash:(i,o)=>{fe(i,i+o-1,s=>{const a=this.lastCollapsedRows.indexOf(s);a>-1&&this.lastCollapsedRows.splice(a,1)})}}}collapseChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(o)):(o=this.dataManager.getDataObject(e),s=e),this.dataManager.hasChildren(o)&&H(o.__children,l=>{i.push(this.dataManager.getRowIndex(l))}),a=this.collapseRows(i,!0,!1),r&&this.trimRows(a),n&&this.renderAndAdjust(),this.collapsedRows.indexOf(s)===-1&&this.collapsedRows.push(s),a}collapseMultipleChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];H(e,o=>{i.push(...this.collapseChildren(o,!1,!1))}),r&&this.trimRows(i),n&&this.renderAndAdjust()}collapseRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.collapseRows([e],n)}collapseRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return H(e,o=>{i.push(o),n&&this.collapseChildRows(o,i)}),r&&this.trimRows(i),i}collapseChildRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);H(i.__children,o=>{const s=this.dataManager.getRowIndex(o);n.push(s),this.collapseChildRows(s,n)})}r&&this.trimRows(n)}expandRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.expandRows([e],n)}expandRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return H(e,o=>{i.push(o),n&&this.expandChildRows(o,i)}),r&&this.untrimRows(i),i}expandChildRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);H(i.__children,o=>{if(!this.isAnyParentCollapsed(o)){const s=this.dataManager.getRowIndex(o);n.push(s),this.expandChildRows(s,n)}})}r&&this.untrimRows(n)}expandChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(e)):(o=this.dataManager.getDataObject(e),s=e),this.collapsedRows.splice(this.collapsedRows.indexOf(s),1),this.dataManager.hasChildren(o)&&H(o.__children,l=>{const u=this.dataManager.getRowIndex(l);i.push(u)}),a=this.expandRows(i,!0,!1),r&&this.untrimRows(a),n&&this.renderAndAdjust(),a}expandMultipleChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];H(e,o=>{i.push(...this.expandChildren(o,!1,!1))}),r&&this.untrimRows(i),n&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),n=[];H(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.collapseMultipleChildren(n),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),n=[];H(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.expandMultipleChildren(n),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{H(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{H(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!1)})},!0)}areChildrenCollapsed(e){let n=isNaN(e)?e:this.dataManager.getDataObject(e),r=!0;return n===null&&(n={__children:this.dataManager.data}),this.dataManager.hasChildren(n)&&H(n.__children,i=>{const o=this.dataManager.getRowIndex(i);if(!this.plugin.collapsedRowsMap.getValueAtIndex(o))return r=!1,!1}),r}isAnyParentCollapsed(e){let n=e;for(;n!==null;){n=this.dataManager.getRowParent(n);const r=this.dataManager.getRowIndex(n);if(this.collapsedRows.indexOf(r)>-1)return!0}return!1}toggleState(e,n){if(n.col>=0)return;const r=this.translateTrimmedRow(n.row);ye(e.target,Co.CSS_CLASSES.button)&&(this.areChildrenCollapsed(r)?this.expandChildren(r):this.collapseChildren(r),fi(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}function iie(t,e,n){oie(t,e),e.set(t,n)}function oie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sie(t,e,n){return(e=aie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aie(t){var e=lie(t,"string");return typeof e=="symbol"?e:e+""}function lie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function uie(t,e){return t.get(cie(t,e))}function cie(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 oL=new WeakMap;class hie extends N0{constructor(){super(...arguments),sie(this,"dataManager",this.plugin.dataManager),iie(this,oL,{row_above:(e,n)=>{const r=n[n.length-1];this.dataManager.addSibling(r.start.row,"above")},row_below:(e,n)=>{const r=n[n.length-1];this.dataManager.addSibling(r.start.row,"below")}})}appendOptions(e){const n=[{key:"add_child",name(){return this.getTranslatedPhrase(Db)},callback:()=>{const r=this.dataManager.translateTrimmedRow(this.hot.getSelectedLast()[0]),i=this.dataManager.getDataObject(r);this.dataManager.addChild(i)},disabled:()=>{const r=this.hot.getSelectedLast();return!r||r[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(kb)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const r=this.hot.getSelectedLast(),i=this.dataManager.translateTrimmedRow(r[0]);return!this.dataManager.getRowParent(i)||!r||r[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return fe(0,e.items.length-1,r=>{if(r===0)return H(n,(i,o)=>{e.items.splice(r+o,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return fe(0,e.items.length-1,n=>{const r=uie(oL,this)[e.items[n].key];r!=null&&(e.items[n].callback=r)}),e}}function lp(t,e,n){return(e=die(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function die(t){var e=fie(t,"string");return typeof e=="symbol"?e:e+""}function fie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gie{constructor(e){lp(this,"plugin",void 0),lp(this,"hot",void 0),lp(this,"dataManager",void 0),lp(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,n,r,i){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:n,dropIndex:r,movePossible:i}))return!1;this.movedToCollapsed=!1;const s=r===this.hot.countRows(),a=s?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(r);let l=!0;const u=e.map(m=>{if(!l)return!1;const b=this.dataManager.translateTrimmedRow(m);return l=this.shouldAllowMoving(b,a),b}),c=u.indexOf(a)===-1;if(!l||!c)return!1;const h=this.getBaseParent(u),d=this.getTargetParent(s,a),f=h===d;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(d),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(u,a,f),this.moveRows(u,a,d),this.dataManager.rewriteCache(),this.moveCellsMeta(u,a),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,n,r,i,i&&this.isRowOrderChanged(e,n)),this.hot.render(),this.selectCells(e,r),!1}displayAPICompatibilityWarning(e){const{rows:n,finalIndex:r,dropIndex:i,movePossible:o}=e;let s=!1;return At(i)&&(et(tt`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
78
- when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",n,r,i,o,!1),s=!0),s}shouldAllowMoving(e,n){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===n||n===0)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,n){let r=this.dataManager.getRowParent(e?n-1:n);return r==null&&(r=this.dataManager.getRowParent(n-1)),r}shiftCollapsibleParentsLocations(e,n,r){r||(Math.max(...e)<=n?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],n,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(n,e[0],e.length))}moveRows(e,n,r){const i=n===this.dataManager.getRowIndex(r)+this.dataManager.countChildren(r)+1;this.hot.batchRender(()=>{e.forEach(o=>{this.dataManager.moveRow(o,n,this.movedToCollapsed,i)})})}moveCellsMeta(e,n){const r=[],i=Math.max(...e)<n;e.forEach(o=>{r.push(this.hot.getCellMetaAtRow(o))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(n-(i?r.length:0),0,...r)}selectCells(e,n){const r=e.length;let i=0,o=0;if(this.movedToCollapsed){let s=null;e[r-1]<n?s=this.dataManager.translateTrimmedRow(n-r):s=this.dataManager.translateTrimmedRow(n);const a=this.dataManager.getRowParent(s===null?this.hot.countSourceRows()-1:s-1),l=this.dataManager.getRowIndex(a);i=this.dataManager.untranslateTrimmedRow(l),o=i}else e[r-1]<n?(o=n-1,i=o-r+1):(i=n,o=i+r-1);this.hot.selectCells([[i,0,o,this.hot.countCols()-1]],!1)}isRowOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}}function mie(t,e){aL(t,e),e.add(t)}function sL(t,e,n){aL(t,e),e.set(t,n)}function aL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function D0(t,e,n){return(e=pie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pie(t){var e=wie(t,"string");return typeof e=="symbol"?e:e+""}function wie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function up(t,e){return t.get(pn(t,e))}function cp(t,e,n){return t.set(pn(t,e),n),n}function pn(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 hp="nestedRows",vie=300,lL=hp,Cie="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var dp=new WeakMap,Zu=new WeakMap,bn=new WeakSet;class yie extends Xe{constructor(){super(...arguments),mie(this,bn),D0(this,"dataManager",null),D0(this,"headersUI",null),D0(this,"collapsedRowsMap",null),sL(this,dp,!1),sL(this,Zu,!1)}static get PLUGIN_KEY(){return hp}static get PLUGIN_PRIORITY(){return vie}isEnabled(){return!!this.hot.getSettings()[hp]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new hh),this.dataManager=new eie(this,this.hot),this.collapsingUI=new rie(this,this.hot),this.headersUI=new Co(this,this.hot),this.contextMenuUI=new hie(this,this.hot),this.rowMoveController=new gie(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,Nie).call(e,...r)}),this.addHook("beforeViewRender",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,Die).call(e,...r)}),this.addHook("modifyRowData",function(){return e.onModifyRowData(...arguments)}),this.addHook("modifySourceLength",function(){return e.onModifySourceLength(...arguments)}),this.addHook("beforeDataSplice",function(){return e.onBeforeDataSplice(...arguments)}),this.addHook("filterData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,Rie).call(e,...r)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,Eie).call(e,...r)}),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,Tie).call(e,...r)}),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,Sie).call(e,...r)}),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,Iie).call(e,...r)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,Mie).call(e,...r)}),this.addHook("beforeAddChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,Pie).call(e,...r)}),this.addHook("afterAddChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,Oie).call(e,...r)}),this.addHook("beforeDetachChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,xie).call(e,...r)}),this.addHook("afterDetachChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,Aie).call(e,...r)}),this.addHook("modifyRowHeaderWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,_ie).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,Hie).call(e,...r)}),this.addHook("beforeRowMove",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pn(bn,e,bie).call(e,...r)}),this.addHook("beforeLoadData",n=>pn(bn,this,uL).call(this,n)),this.addHook("beforeUpdateData",n=>pn(bn,this,uL).call(this,n)),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("nestedRows"),this.unregisterShortcuts(),super.disablePlugin()}updatePlugin(){this.disablePlugin();const e=this.dataManager.getData();this.enablePlugin(),this.dataManager.updateWithData(e),super.updatePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast(),n=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(n)?this.collapsingUI.expandChildren(n):this.collapsingUI.collapseChildren(n),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.col===-1&&r.row>=0},group:lL,relativeToGroup:Ss,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(lL)}disableCoreAPIModifiers(){cp(Zu,this,!0)}enableCoreAPIModifiers(){cp(Zu,this,!1)}onModifyRowData(e){if(!up(Zu,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!up(Zu,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,n,r){return up(Zu,this)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,n,r),!1)}destroy(){super.destroy()}}function bie(t,e,n,r){return this.rowMoveController.onBeforeRowMove(t,e,n,r)}function Sie(t,e,n){this.collapsingUI.toggleState(t,e,n)}function Rie(t,e,n){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(n[0],e),this.collapsingUI.collapsedRowsStash.shiftStash(n[0],null,-1*e),this.dataManager.filterData(t,e,n),cp(dp,this,!0),this.dataManager.getData().slice()}function Eie(t){return this.contextMenuUI.appendOptions(t)}function Tie(t,e){this.headersUI.appendLevelIndicators(t,e)}function _ie(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function Mie(t,e,n,r){r!==this.pluginName&&this.hot._registerTimeout(()=>{cp(dp,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function Iie(t,e,n){const r=Array.from(n.reduce((i,o)=>{if(this.dataManager.isParent(o)){const s=this.dataManager.getDataObject(o).__children;return i.add(o),Array.isArray(s)&&s.forEach(a=>i.add(this.dataManager.getRowIndex(a))),i}return i.add(o)},new Set));n.length=0,n.push(...r)}function Pie(){this.collapsingUI.collapsedRowsStash.stash()}function Oie(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function xie(){this.collapsingUI.collapsedRowsStash.stash()}function Aie(t,e,n){this.collapsingUI.collapsedRowsStash.shiftStash(n,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function Hie(){this.dataManager.rewriteCache()}function Nie(){this.headersUI.updateRowHeaderWidth()}function Die(t,e){up(dp,this)&&(e.skipRender=!0)}function uL(t){if(!PQ(t)){$y(Cie),this.hot.getSettings()[hp]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function k0(t,e,n){return(e=kie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kie(t){var e=Lie(t,"string");return typeof e=="symbol"?e:e+""}function Lie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class $ie{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;k0(this,"rootWindow",void 0),k0(this,"prefix",void 0),k0(this,"savedKeys",[]),this.rootWindow=n,this.prefix=e,this.loadSavedKeys()}saveValue(e,n){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(n)),this.savedKeys.indexOf(e)===-1&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,n){const r=typeof e>"u"?n:e,i=this.rootWindow.localStorage.getItem(`${this.prefix}_${r}`);return i===null?void 0:JSON.parse(i)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){H(this.savedKeys,(e,n)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[n]}`)}),this.clearSavedKeys()}loadSavedKeys(){const e=this.rootWindow.localStorage.getItem(`${this.prefix}__persistentStateKeys`),n=typeof e=="string"?JSON.parse(e):void 0;this.savedKeys=n||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(`${this.prefix}__persistentStateKeys`,JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}}function Fie(t,e,n){return(e=Vie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vie(t){var e=Wie(t,"string");return typeof e=="symbol"?e:e+""}function Wie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}re.getSingleton().register("persistentStateSave"),re.getSingleton().register("persistentStateLoad"),re.getSingleton().register("persistentStateReset");const cL="persistentState",Bie=0;class jie extends Xe{constructor(){super(...arguments),Fie(this,"storage",void 0)}static get PLUGIN_KEY(){return cL}static get PLUGIN_PRIORITY(){return Bie}isEnabled(){return!!this.hot.getSettings()[cL]}enablePlugin(){this.enabled||(this.storage||(this.storage=new $ie(this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",(e,n)=>this.saveValue(e,n)),this.addHook("persistentStateLoad",(e,n)=>this.loadValue(e,n)),this.addHook("persistentStateReset",()=>this.resetValue()),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,n){n.value=this.storage.loadValue(e)}saveValue(e,n){this.storage.saveValue(e,n)}resetValue(e){typeof e>"u"?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}function Uie(t,e){zie(t,e),e.add(t)}function zie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function L0(t,e,n){return(e=Yie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yie(t){var e=Gie(t,"string");return typeof e=="symbol"?e:e+""}function Gie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hL(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 $0="search",qie=190,Kie="htSearchResult",Xie=function(t,e,n,r,i){t.getCellMeta(e,n).isSearchResult=i},Zie=function(t,e,n){return At(t)||t===null||!t.toLocaleLowerCase||t.length===0||At(e)||e===null?!1:e.toString().toLocaleLowerCase(n.locale).indexOf(t.toLocaleLowerCase(n.locale))!==-1};var F0=new WeakSet;class Qie extends Xe{constructor(){super(...arguments),Uie(this,F0),L0(this,"callback",Xie),L0(this,"queryMethod",Zie),L0(this,"searchResultClass",Kie)}static get PLUGIN_KEY(){return $0}static get PLUGIN_PRIORITY(){return qie}isEnabled(){return this.hot.getSettings()[$0]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[$0];this.updatePluginSettings(n),this.addHook("beforeRenderer",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return hL(F0,e,dL).call(e,...i)}),super.enablePlugin()}disablePlugin(){var e=this;const n=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return hL(F0,e,dL).call(e,...i)};this.hot.addHook("beforeRenderer",n),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("beforeRenderer",n)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getCallback(),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getQueryMethod();const i=this.hot.countRows(),o=this.hot.countCols(),s=[],a=this.hot;return fe(0,i-1,l=>{fe(0,o-1,u=>{const c=this.hot.getDataAtCell(l,u),h=this.hot.getCellMeta(l,u),d=h.search.callback||n,m=(h.search.queryMethod||r)(e,c,h);if(m){const b={row:l,col:u,data:c};s.push(b)}d&&d(a,l,u,c,m)})}),s}getCallback(){return this.callback}setCallback(e){this.callback=e}getQueryMethod(){return this.queryMethod}setQueryMethod(e){this.queryMethod=e}getSearchResultClass(){return this.searchResultClass}setSearchResultClass(e){this.searchResultClass=e}updatePluginSettings(e){He(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function dL(t,e,n,r,i,o){const s=o.className||[];let a=[];typeof s=="string"?a=s.split(" "):a.push(...s),this.isEnabled()&&o.isSearchResult?a.includes(this.searchResultClass)||a.push(`${this.searchResultClass}`):a.includes(this.searchResultClass)&&a.splice(a.indexOf(this.searchResultClass),1),o.className=a.join(" ")}function fp(t,e,n){return(e=Jie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jie(t){var e=eoe(t,"string");return typeof e=="symbol"?e:e+""}function eoe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class fL{constructor(e){fp(this,"viewportWidth",void 0),fp(this,"overwriteColumnWidthFn",void 0),fp(this,"baseWidths",new Map),fp(this,"stretchedWidths",new Map),this.overwriteColumnWidthFn=e}prepare(e){let{viewportWidth:n}=e;this.viewportWidth=n,this.baseWidths.clear(),this.stretchedWidths.clear()}setColumnBaseWidth(e,n){this.baseWidths.set(e,n)}calculate(){}getWidths(){return Array.from(this.stretchedWidths)}}class toe extends fL{calculate(){const e=Array.from(this.baseWidths).reduce((h,d)=>{let[,f]=d;return h+f},0);if(this.viewportWidth-e<0){this.stretchedWidths.clear();return}const r=this.viewportWidth/e,i=[],o=[];let s=this.viewportWidth,a=0;if(this.baseWidths.forEach((h,d)=>{const f=Math.round(h*r),m=this.overwriteColumnWidthFn(f,d);f===m&&f>=ou?(i.push([d,m]),a+=m):f!==m&&(i.push([d,m]),o.push(d),s-=m)}),s<=ou){this.stretchedWidths.clear();return}const l=s/a;let u=-1,c=0;i.forEach((h,d)=>{let[f,m]=h,b=m;o.includes(f)||(b=Math.round(m*l)),this.stretchedWidths.set(f,b),u=f,d<i.length-1&&(c+=b)}),this.stretchedWidths.size>1&&this.stretchedWidths.set(u,Math.round(this.viewportWidth-c))}}function gL(t,e,n){noe(t,e),e.set(t,n)}function noe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function V0(t,e){return t.get(mL(t,e))}function gp(t,e,n){return t.set(mL(t,e),n),n}function mL(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 mp=new WeakMap,Pd=new WeakMap;class roe extends fL{constructor(){super(...arguments),gL(this,mp,0),gL(this,Pd,-1)}prepare(e){super.prepare(e),gp(mp,this,0),gp(Pd,this,-1)}setColumnBaseWidth(e,n){super.setColumnBaseWidth(e,n),gp(Pd,this,e),gp(mp,this,n)}calculate(){if(V0(Pd,this)===-1)return;const e=Array.from(this.baseWidths).reduce((r,i)=>{let[,o]=i;return r+o},0),n=Math.max(this.viewportWidth-e+V0(mp,this),0);this.stretchedWidths.set(V0(Pd,this),n)}}function ioe(t,e){pL(t,e),e.add(t)}function pp(t,e,n){pL(t,e),e.set(t,n)}function pL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Kt(t,e){return t.get(Qu(t,e))}function W0(t,e,n){return t.set(Qu(t,e),n),n}function Qu(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 ooe="stretchColumns";var Ln=new WeakMap,Ju=new WeakMap,B0=new WeakMap,wp=new WeakMap,Od=new WeakSet;class soe{constructor(e){ioe(this,Od),pp(this,Ln,void 0),pp(this,Ju,void 0),pp(this,B0,new Map([["all",new toe(Qu(Od,this,wL).bind(this))],["last",new roe(Qu(Od,this,wL).bind(this))]])),pp(this,wp,"none"),W0(Ln,this,e),W0(Ju,this,Kt(Ln,this).columnIndexMapper.createAndRegisterIndexMap(ooe,"physicalIndexToValue"))}useStrategy(e){W0(wp,this,Kt(B0,this).has(e)?e:"none")}refreshStretching(){if(Kt(wp,this)==="none"){Kt(Ju,this).clear();return}Kt(Ln,this).batchExecution(()=>{Kt(Ju,this).clear();const e=Kt(B0,this).get(Kt(wp,this));let r=Kt(Ln,this).view.getViewportWidth();Qu(Od,this,aoe).call(this)&&(r-=vn(Kt(Ln,this).rootDocument)),e.prepare({viewportWidth:r});for(let i=0;i<Kt(Ln,this).countCols();i++)Kt(Ln,this).columnIndexMapper.isHidden(Kt(Ln,this).toPhysicalColumn(i))||e.setColumnBaseWidth(i,Qu(Od,this,loe).call(this,i));e.calculate(),e.getWidths().forEach(i=>{let[o,s]=i;Kt(Ju,this).setValueAtIndex(Kt(Ln,this).toPhysicalColumn(o),s)})},!0)}getStretchedWidth(e){return Kt(Ju,this).getValueAtIndex(Kt(Ln,this).toPhysicalColumn(e))}}function aoe(){const{view:t}=Kt(Ln,this);if(t.isVerticallyScrollableByWindow())return!1;const e=t.getViewportHeight(),n=Kt(Ln,this).countRows(),r=t.getStylesHandler().getDefaultRowHeight();let i=0,o=!1;for(let a=0;a<n;a++){var s;if(i+=((s=Kt(Ln,this).getRowHeight(a))!==null&&s!==void 0?s:r)+(a===0?1:0),i>e){o=!0;break}}return o}function loe(t){var e;return(e=Kt(Ln,this).getColWidth(t,"StretchColumns"))!==null&&e!==void 0?e:ou}function wL(t,e){return Kt(Ln,this).runHooks("beforeStretchingColumnWidth",t,e)}function uoe(t,e){vL(t,e),e.add(t)}function j0(t,e,n){vL(t,e),e.set(t,n)}function vL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function U0(t,e,n){return t.set(vp(t,e),n),n}function cs(t,e){return t.get(vp(t,e))}function vp(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 coe="stretchColumns",hoe=155;var ec=new WeakMap,Cp=new WeakMap,xd=new WeakMap,z0=new WeakSet;class doe extends Xe{constructor(){super(...arguments),uoe(this,z0),j0(this,ec,new soe(this.hot)),j0(this,Cp,null),j0(this,xd,new ResizeObserver(e=>{requestAnimationFrame(()=>{var n;(n=this.hot)!==null&&n!==void 0&&n.view.isHorizontallyScrollableByWindow()&&e.forEach(r=>{let{contentRect:i}=r;cs(Cp,this)!==null&&cs(Cp,this)!==i.width&&(this.hot.refreshDimensions(),this.hot.view.adjustElementsSize()),U0(Cp,this,i.width)})})}))}static get PLUGIN_KEY(){return coe}static get PLUGIN_PRIORITY(){return hoe}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(cs(ec,this).useStrategy(this.hot.getSettings().stretchH),cs(xd,this).observe(this.hot.rootElement),this.addHook("beforeRender",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return vp(z0,e,goe).call(e,...r)}),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return vp(z0,e,foe).call(e,...r)},10),super.enablePlugin())}updatePlugin(){cs(ec,this).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),cs(xd,this).unobserve(this.hot.rootElement)}getColumnWidth(e){return cs(ec,this).getStretchedWidth(e)}destroy(){cs(xd,this).disconnect(),U0(xd,this,null),U0(ec,this,null),super.destroy()}}function foe(t,e,n){if(n===this.pluginName)return;const r=this.getColumnWidth(e);return typeof r=="number"?r:t}function goe(t){t&&cs(ec,this).refreshStretching()}function moe(t,e){poe(t,e),e.add(t)}function poe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yp(t,e,n){return(e=woe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function woe(t){var e=voe(t,"string");return typeof e=="symbol"?e:e+""}function voe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Y0(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 Coe="touchScroll",yoe=200;var bp=new WeakSet;class boe extends Xe{constructor(){super(...arguments),moe(this,bp),yp(this,"scrollbars",[]),yp(this,"clones",[]),yp(this,"lockedCollection",!1),yp(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return Coe}static get PLUGIN_PRIORITY(){return yoe}static get SETTING_KEYS(){return!0}isEnabled(){return gx()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>Y0(bp,this,Soe).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>Y0(bp,this,Roe).call(this)),this.addHook("afterMomentumScroll",()=>Y0(bp,this,Eoe).call(this))}}function Soe(){if(this.lockedCollection)return;const{topOverlay:t,bottomOverlay:e,inlineStartOverlay:n,topInlineStartCornerOverlay:r,bottomInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(t),e.clone&&this.scrollbars.push(e),this.scrollbars.push(n),r&&this.scrollbars.push(r),i&&i.clone&&this.scrollbars.push(i),this.clones=[],t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),n.needFullRender&&this.clones.push(n.clone.wtTable.holder.parentNode),r&&this.clones.push(r.clone.wtTable.holder.parentNode),i&&i.clone&&this.clones.push(i.clone.wtTable.holder.parentNode)}function Roe(){this.freezeOverlays=!0,H(this.clones,t=>{X(t,"hide-tween")})}function Eoe(){this.freezeOverlays=!1,H(this.clones,t=>{ve(t,"hide-tween"),X(t,"show-tween")}),this.hot._registerTimeout(()=>{H(this.clones,t=>{ve(t,"show-tween")})},400),H(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function Toe(t,e){_oe(t,e),e.add(t)}function _oe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Moe(t,e,n){return(e=Ioe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ioe(t){var e=Poe(t,"string");return typeof e=="symbol"?e:e+""}function Poe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ooe(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 Sp="trimRows",xoe=330;var CL=new WeakSet;class Aoe extends Xe{constructor(){super(...arguments),Toe(this,CL),Moe(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return Sp}static get PLUGIN_PRIORITY(){return xoe}isEnabled(){return!!this.hot.getSettings()[Sp]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new hh),this.trimmedRowsMap.addLocalHook("init",()=>Ooe(CL,this,Hoe).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[Sp];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),H(e,n=>{this.trimmedRowsMap.setValueAtIndex(n,!0)})},!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const n=this.getTrimmedRows(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeTrimRow",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{H(e,s=>{this.trimmedRowsMap.setValueAtIndex(s,!0)})},!0),this.hot.runHooks("afterTrimRow",n,i,r,r&&i.length>n.length))}trimRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.trimRows(n)}untrimRows(e){const n=this.getTrimmedRows(),r=this.isValidConfig(e);let i=n;const o=this.trimmedRowsMap.getValues().slice(),s=e.length>0;r&&s&&(H(e,l=>{o[l]=!1}),i=tr(o,(l,u,c)=>(u&&l.push(c),l),[])),this.hot.runHooks("beforeUntrimRow",n,i,r&&s)!==!1&&(r&&s&&this.trimmedRowsMap.setValues(o),this.hot.runHooks("afterUntrimRow",n,i,r&&s,r&&i.length<n.length))}untrimRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.untrimRows(n)}isTrimmed(e){return this.trimmedRowsMap.getValueAtIndex(e)||!1}untrimAll(){this.untrimRows(this.getTrimmedRows())}isValidConfig(e){const n=this.hot.countSourceRows();return e.every(r=>Number.isInteger(r)&&r>=0&&r<n)}destroy(){super.destroy()}}function Hoe(){const t=this.hot.getSettings()[Sp];Array.isArray(t)&&this.hot.batchExecution(()=>{H(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}function Noe(t,e,n){return(e=Doe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Doe(t){var e=koe(t,"string");return typeof e=="symbol"?e:e+""}function koe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ri{constructor(e){Noe(this,"actionType",""),this.actionType=e}undo(){throw new Error("Not implemented")}redo(){throw new Error("Not implemented")}}function Rp(t,e,n){return(e=Loe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Loe(t){var e=$oe(t,"string");return typeof e=="symbol"?e:e+""}function $oe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class G0 extends ri{constructor(e){let{stateBefore:n,range:r,type:i,alignment:o}=e;super("cell_alignment"),Rp(this,"stateBefore",void 0),Rp(this,"range",void 0),Rp(this,"type",void 0),Rp(this,"alignment",void 0),this.stateBefore=n,this.range=r,this.type=i,this.alignment=o}static startRegisteringEvents(e,n){e.addHook("beforeCellAlignment",(r,i,o,s)=>{n.done(()=>new G0({stateBefore:r,range:i,type:o,alignment:s}))})}undo(e,n){H(this.range,r=>{r.forAll((i,o)=>{i>=0&&o>=0&&e.setCellMeta(i,o,"className",this.stateBefore[i][o]||" htLeft")})}),e.addHookOnce("afterViewRender",n),e.render()}redo(e,n){xs(this.range,this.type,this.alignment,(r,i)=>e.getCellMeta(r,i),(r,i,o,s)=>e.setCellMeta(r,i,o,s)),e.addHookOnce("afterViewRender",n),e.render()}}function yL(t,e,n){return(e=Foe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Foe(t){var e=Voe(t,"string");return typeof e=="symbol"?e:e+""}function Voe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class q0 extends ri{constructor(e){let{columns:n,finalIndex:r}=e;super("col_move"),yL(this,"columns",void 0),yL(this,"finalColumnIndex",void 0),this.columns=n.slice(),this.finalColumnIndex=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnMove",(r,i)=>{r!==!1&&n.done(()=>new q0({columns:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),ZE(this.columns,this.finalColumnIndex,e.columnIndexMapper.getNumberOfIndexes()).reverse().forEach(o=>{let{from:s,to:a}=o;s<a&&(a-=1),r.moveColumn(a,s)}),e.render(),e.deselectCell(),e.selectColumns(this.columns[0],this.columns[0]+this.columns.length-1)}redo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),r.moveColumns(this.columns.slice(),this.finalColumnIndex),e.render(),e.deselectCell(),e.selectColumns(this.finalColumnIndex,this.finalColumnIndex+this.columns.length-1)}}function bL(t,e,n){return(e=Woe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Woe(t){var e=Boe(t,"string");return typeof e=="symbol"?e:e+""}function Boe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class K0 extends ri{constructor(e){let{currentSortState:n,newSortState:r}=e;super("col_sort"),bL(this,"previousSortState",void 0),bL(this,"nextSortState",void 0),this.previousSortState=n,this.nextSortState=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnSort",(r,i,o)=>{o&&n.done(()=>new K0({currentSortState:r,newSortState:i}))})}undo(e,n){const r=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting"),o=i.isEnabled()?i:r;this.previousSortState.length?o.sort(this.previousSortState):o.clearSort(),n()}redo(e,n){const r=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting");(i.isEnabled()?i:r).sort(this.nextSortState),n()}}function SL(t,e,n){return(e=joe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function joe(t){var e=Uoe(t,"string");return typeof e=="symbol"?e:e+""}function Uoe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class X0 extends ri{constructor(e){let{index:n,amount:r}=e;super("insert_col"),SL(this,"index",void 0),SL(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateCol",(r,i,o)=>{n.done(()=>new X0({index:r,amount:i}),o)})}undo(e,n){e.addHookOnce("afterRemoveCol",n),e.alter("remove_col",this.index,this.amount,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterCreateCol",n),e.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")}}function RL(t,e,n){return(e=zoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zoe(t){var e=Yoe(t,"string");return typeof e=="symbol"?e:e+""}function Yoe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Z0 extends ri{constructor(e){let{index:n,amount:r}=e;super("insert_row"),RL(this,"index",void 0),RL(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateRow",(r,i,o)=>{n.done(()=>new Z0({index:r,amount:i}),o)})}undo(e,n){const r=e.countRows(),i=e.getSettings().minSpareRows;this.index>=r&&this.index-i<r&&(this.index-=i),e.addHookOnce("afterRemoveRow",n),e.alter("remove_row",this.index,this.amount,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterCreateRow",n),e.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")}}function Ep(t,e,n){return(e=Goe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Goe(t){var e=qoe(t,"string");return typeof e=="symbol"?e:e+""}function qoe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Q0 extends ri{constructor(e){let{changes:n,selected:r,countCols:i,countRows:o}=e;super("change"),Ep(this,"changes",void 0),Ep(this,"selected",void 0),Ep(this,"countCols",void 0),Ep(this,"countRows",void 0),this.changes=n,this.selected=r,this.countCols=i,this.countRows=o}static startRegisteringEvents(e,n){e.addHook("beforeChange",function(r,i){const o=r&&r.length;if(!o||!r.find(l=>{const[,,u,c]=l;return u!==c}))return;const a=()=>{const l=r.reduce((c,h)=>(c.push([...h]),c),[]);l.forEach(c=>{c[1]=e.propToCol(c[1])});const u=o>1?this.getSelected():[[l[0][0],l[0][1]]];return new Q0({changes:l,selected:u,countCols:e.countCols(),countRows:e.countRows()})};n.done(a,i)})}undo(e,n){const r=Fn(this.changes);for(let s=0,a=r.length;s<a;s++)r[s].splice(3,1);e.addHookOnce("afterChange",n),e.setDataAtCell(r,null,null,"UndoRedo.undo");const i=e.countRows()-this.countRows;i>0&&e.alter("remove_row",null,i,"UndoRedo.undo");const o=e.countCols()-this.countCols;o>0&&e.isColumnModificationAllowed()&&e.alter("remove_col",null,o,"UndoRedo.undo"),e.scrollToFocusedCell(),e.selectCells(this.selected,!1,!1)}redo(e,n){const r=Fn(this.changes);for(let i=0,o=r.length;i<o;i++)r[i].splice(2,1);e.addHookOnce("afterChange",n),e.setDataAtCell(r,null,null,"UndoRedo.redo"),this.selected&&e.selectCells(this.selected,!1,!1)}}function EL(t,e,n){return(e=Koe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Koe(t){var e=Xoe(t,"string");return typeof e=="symbol"?e:e+""}function Xoe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class J0 extends ri{constructor(e){let{conditionsStack:n,previousConditionsStack:r}=e;super("filter"),EL(this,"conditionsStack",void 0),EL(this,"previousConditionsStack",void 0),this.conditionsStack=n,this.previousConditionsStack=r}static startRegisteringEvents(e,n){e.addHook("beforeFilter",(r,i)=>{n.done(()=>new J0({conditionsStack:r,previousConditionsStack:i}))})}undo(e,n){const r=e.getPlugin("filters");e.addHookOnce("afterViewRender",n),r.importConditions(this.previousConditionsStack),r.filter()}redo(e,n){const r=e.getPlugin("filters");e.addHookOnce("afterViewRender",n),r.importConditions(this.conditionsStack),r.filter()}}function Zoe(t,e,n){return(e=Qoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qoe(t){var e=Joe(t,"string");return typeof e=="symbol"?e:e+""}function Joe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class eT extends ri{constructor(e){let{data:n,cellRange:r}=e;super("merge_cells"),Zoe(this,"cellRange",void 0),this.cellRange=r,this.data=n}static startRegisteringEvents(e,n){e.addHook("beforeMergeCells",(r,i)=>{if(i)return;const o=r.getTopStartCorner(),s=r.getBottomEndCorner(),a=e.getData(o.row,o.col,s.row,s.col);n.done(()=>new eT({data:a,cellRange:r}))})}undo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.unmergeRange(this.cellRange,!0);const i=this.cellRange.getTopStartCorner();e.populateFromArray(i.row,i.col,this.data,void 0,void 0,"MergeCells")}redo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.mergeRange(this.cellRange)}}var TL={},_L;function ese(){if(_L)return TL;_L=1;var t=vt(),e=Al(),n=eI();return t({target:"Object",stat:!0},{fromEntries:function(i){var o={};return e(i,function(s,a){n(o,s,a)},{AS_ENTRIES:!0}),o}}),TL}ese();function ML(t,e,n,r,i){const o=["visualRow","visualCol","row","col","prop"],s=o.length,a=[];return fe(r,i,l=>{fe(e,n,u=>{const c=t.getCellMeta(u,l);if(Object.keys(c).length!==s){const h=Object.fromEntries(Object.entries(c).filter(d=>{let[f]=d;return o.includes(f)===!1}));a.push([c.visualRow,c.visualCol,h])}})}),a}function hs(t,e,n){return(e=tse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tse(t){var e=nse(t,"string");return typeof e=="symbol"?e:e+""}function nse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tT extends ri{constructor(e){let{index:n,indexes:r,data:i,amount:o,headers:s,columnPositions:a,rowPositions:l,fixedColumnsStart:u,removedCellMetas:c}=e;super("remove_col"),hs(this,"index",void 0),hs(this,"indexes",void 0),hs(this,"data",void 0),hs(this,"amount",void 0),hs(this,"headers",void 0),hs(this,"columnPositions",void 0),hs(this,"rowPositions",void 0),hs(this,"fixedColumnsStart",void 0),hs(this,"removedCellMetas",void 0),this.index=n,this.indexes=r,this.data=i,this.amount=o,this.headers=s,this.columnPositions=a.slice(0),this.rowPositions=l.slice(0),this.fixedColumnsStart=u,this.removedCellMetas=c}static startRegisteringEvents(e,n){e.addHook("beforeRemoveCol",(r,i,o,s)=>{const a=()=>{const l=e.getSourceDataArray(),u=(e.countCols()+r)%e.countCols(),c=u+i-1,h=[],d=[],f=[];return fe(l.length-1,m=>{const b=[],S=l[m];fe(u,c,E=>{b.push(S[e.toPhysicalColumn(E)])}),h.push(b)}),fe(i-1,m=>{f.push(e.toPhysicalColumn(u+m))}),Array.isArray(e.getSettings().colHeaders)&&fe(i-1,m=>{d.push(e.getSettings().colHeaders[e.toPhysicalColumn(u+m)]||null)}),new tT({index:u,indexes:f,data:h,amount:i,headers:d,columnPositions:e.columnIndexMapper.getIndexesSequence(),rowPositions:e.rowIndexMapper.getIndexesSequence(),fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:ML(e,0,e.countRows(),u,c)})};n.done(a,s)})}undo(e,n){const r=e.getSettings();r.fixedColumnsStart=this.fixedColumnsStart;const i=this.indexes.slice(0).sort(),o=(c,h,d)=>d[this.indexes.indexOf(i[h])],s=this.data.length,a=[];for(let c=0;c<s;c++)a.push(je(this.data[c],o));const l=je(this.headers,o),u=[];e.columnIndexMapper.setIndexesSequence(this.columnPositions),e.alter("insert_col_start",e.toVisualColumn(this.indexes[0]),this.indexes.length,"UndoRedo.undo"),e.batchExecution(()=>{e.rowIndexMapper.setIndexesSequence(this.rowPositions),e.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),H(e.getSourceDataArray(),(c,h)=>{H(i,(d,f)=>{c[d]=a[h][f],u.push([h,d,c[d]])})}),typeof this.headers<"u"&&H(l,(c,h)=>{e.getSettings().colHeaders[i[h]]=c}),this.removedCellMetas.forEach(c=>{let[h,d,f]=c;e.setCellMetaObject(h,d,f)}),e.addHookOnce("afterViewRender",n),e.setSourceDataAtCell(u,null,null,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterRemoveCol",n),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}}function tc(t,e,n){return(e=rse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rse(t){var e=ise(t,"string");return typeof e=="symbol"?e:e+""}function ise(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nT extends ri{constructor(e){let{index:n,data:r,fixedRowsBottom:i,fixedRowsTop:o,rowIndexesSequence:s,removedCellMetas:a}=e;super("remove_row"),tc(this,"index",void 0),tc(this,"data",void 0),tc(this,"fixedRowsBottom",void 0),tc(this,"fixedRowsTop",void 0),tc(this,"rowIndexesSequence",void 0),tc(this,"removedCellMetas",void 0),this.index=n,this.data=r,this.fixedRowsBottom=i,this.fixedRowsTop=o,this.rowIndexesSequence=s,this.removedCellMetas=a}static startRegisteringEvents(e,n){e.addHook("beforeRemoveRow",(r,i,o,s)=>{const a=()=>{const l=e.toPhysicalRow(r),u=l+i-1,c=Fn(e.getSourceData(l,0,l+i-1,e.countSourceCols()-1));return new nT({index:l,data:c,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:ML(e,l,u,0,e.countCols()-1)})};n.done(a,s)})}undo(e,n){const r=e.getSettings(),i=[];r.fixedRowsBottom=this.fixedRowsBottom,r.fixedRowsTop=this.fixedRowsTop,this.data.forEach((o,s)=>{Object.keys(o).forEach(a=>{const l=parseInt(a,10);i.push([this.index+s,isNaN(l)?a:l,o[a]])})}),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),e.alter("insert_row_above",e.toVisualRow(this.index),this.data.length,"UndoRedo.undo"),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),this.removedCellMetas.forEach(o=>{let[s,a,l]=o;e.setCellMetaObject(s,a,l)}),e.addHookOnce("afterViewRender",n),e.setSourceDataAtCell(i,null,null,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterRemoveRow",n),e.alter("remove_row",e.toVisualRow(this.index),this.data.length,"UndoRedo.redo")}}function IL(t,e,n){return(e=ose(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ose(t){var e=sse(t,"string");return typeof e=="symbol"?e:e+""}function sse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rT extends ri{constructor(e){let{rows:n,finalIndex:r}=e;super("row_move"),IL(this,"rows",void 0),IL(this,"finalRowIndex",void 0),this.rows=n.slice(),this.finalRowIndex=r}static startRegisteringEvents(e,n){e.addHook("beforeRowMove",(r,i)=>{r!==!1&&n.done(()=>new rT({rows:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),ZE(this.rows,this.finalRowIndex,e.rowIndexMapper.getNumberOfIndexes()).reverse().forEach(o=>{let{from:s,to:a}=o;s<a&&(a-=1),r.moveRow(a,s)}),e.render(),e.deselectCell(),e.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)}redo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),r.moveRows(this.rows.slice(),this.finalRowIndex),e.render(),e.deselectCell(),e.selectRows(this.finalRowIndex,this.finalRowIndex+this.rows.length-1)}}function ase(t,e,n){return(e=lse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lse(t){var e=use(t,"string");return typeof e=="symbol"?e:e+""}function use(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class iT extends ri{constructor(e){let{cellRange:n}=e;super("unmerge_cells"),ase(this,"cellRange",void 0),this.cellRange=n}static startRegisteringEvents(e,n){e.addHook("afterUnmergeCells",(r,i)=>{i||n.done(()=>new iT({cellRange:r}))})}undo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.mergeRange(this.cellRange,!0)}redo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.unmergeRange(this.cellRange,!0),e.render()}}function cse(t,e){[G0,q0,K0,X0,Z0,Q0,J0,eT,tT,nT,rT,iT].forEach(n=>n.startRegisteringEvents(t,e))}function hse(t,e){dse(t,e),e.add(t)}function dse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oT(t,e,n){return(e=fse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fse(t){var e=gse(t,"string");return typeof e=="symbol"?e:e+""}function gse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sT(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 PL="undoRedo",mse="undoRedo",pse=1e3;re.getSingleton().register("beforeUndo"),re.getSingleton().register("afterUndo"),re.getSingleton().register("beforeRedo"),re.getSingleton().register("afterRedo");const OL=new Set;var Tp=new WeakSet;class wse extends Xe{static get PLUGIN_KEY(){return mse}static get PLUGIN_PRIORITY(){return pse}static get SETTING_KEYS(){return!0}constructor(e){super(e),hse(this,Tp),oT(this,"doneActions",[]),oT(this,"undoneActions",[]),oT(this,"ignoreNewActions",!1),cse(e,this)}isEnabled(){return!!this.hot.getSettings().undo}enablePlugin(){var e=this;this.enabled||(this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sT(Tp,e,vse).call(e,...r)}),this.registerShortcuts(),sT(Tp,this,Cse).call(this),super.enablePlugin())}disablePlugin(){super.disablePlugin(),this.clear(),this.unregisterShortcuts(),sT(Tp,this,yse).call(this)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("grid"),i={runOnlyIf:o=>!o.altKey,group:PL};n.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],i)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(PL)}done(e,n){if(this.ignoreNewActions||n==="UndoRedo.undo"||n==="UndoRedo.redo"||n==="auto")return;const i=this.doneActions.slice();if(this.hot.runHooks("beforeUndoStackChange",i,n)===!1)return;const s=e(),a=this.undoneActions.slice();this.doneActions.push(s),this.hot.runHooks("afterUndoStackChange",i,this.doneActions.slice()),this.hot.runHooks("beforeRedoStackChange",a),this.undoneActions.length=0,this.hot.runHooks("afterRedoStackChange",a,this.undoneActions.slice())}undo(){if(!this.isUndoAvailable())return;const e=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",e);const n=this.doneActions.pop();this.hot.runHooks("afterUndoStackChange",e,this.doneActions.slice());const r=Fn(n);if(this.hot.runHooks("beforeUndo",r)===!1)return;this.ignoreNewActions=!0;const o=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",o),n.undo(this.hot,()=>{this.ignoreNewActions=!1,this.undoneActions.push(n)}),this.hot.runHooks("afterRedoStackChange",o,this.undoneActions.slice()),this.hot.runHooks("afterUndo",r)}redo(){if(!this.isRedoAvailable())return;const e=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",e);const n=this.undoneActions.pop();this.hot.runHooks("afterRedoStackChange",e,this.undoneActions.slice());const r=Fn(n);if(this.hot.runHooks("beforeRedo",r)===!1)return;this.ignoreNewActions=!0;const o=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",o),n.redo(this.hot,()=>{this.ignoreNewActions=!1,this.doneActions.push(n)}),this.hot.runHooks("afterUndoStackChange",o,this.doneActions.slice()),this.hot.runHooks("afterRedo",r)}isUndoAvailable(){return this.doneActions.length>0}isRedoAvailable(){return this.undoneActions.length>0}clear(){this.doneActions.length=0,this.undoneActions.length=0}destroy(){this.clear(),this.doneActions=null,this.undoneActions=null,super.destroy()}}function vse(t,e){e==="loadData"&&this.clear()}function Cse(){const t=e=>{OL.has(e)||(et(tt`The "${e}" method is deprecated and it will be removed\x20
79
- from the Core API in the future. Please use the method from the UndoRedo plugin\x20
80
- (e.g. \`hotInstance.getPlugin("undoRedo").${e}()\`).`),OL.add(e))};this.hot.undo=()=>{t("undo"),this.undo()},this.hot.redo=()=>{t("redo"),this.redo()},this.hot.isUndoAvailable=()=>(t("isUndoAvailable"),this.isUndoAvailable()),this.hot.isRedoAvailable=()=>(t("isRedoAvailable"),this.isRedoAvailable()),this.hot.clearUndo=()=>{t("clear"),this.clear()},this.hot.undoRedo=this}function yse(){delete this.hot.undo,delete this.hot.redo,delete this.hot.isUndoAvailable,delete this.hot.isRedoAvailable,delete this.hot.clearUndo,delete this.hot.undoRedo}function bse(){Ge(mh),Ge(q6),Ge(vh),Ge(T4),Ge(H4),Ge(V1),Ge(I9),Ge(p8),Ge(Xg),Ge(D7),Ge(x5),Ge(F5),Ge(lm),Ge(yZ),Ge(vJ),Ge(ZJ),Ge(Eee),Ge(kee),Ge(qee),Ge(ote),Ge(mte),Ge(Hte),Ge(Bte),Ge(Tne),Ge(rre),Ge(lre),Ge(Nre),Ge(yie),Ge(jie),Ge(Qie),Ge(doe),Ge(boe),Ge(Aoe),Ge(wse)}function Sse(){UG(),Cq(),xq(),zq(),bse()}var xL={},AL={},aT,HL;function NL(){if(HL)return aT;HL=1;var t=TypeError;return aT=function(e,n){if(e<n)throw new t("Not enough arguments");return e},aT}var lT,DL;function Rse(){if(DL)return lT;DL=1;var t=zd();return lT=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),lT}var uT,kL;function LL(){if(kL)return uT;kL=1;var t=dn(),e=zd(),n=oa(),r=function(i){return e.slice(0,i.length)===i};return uT=(function(){return r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":t.Bun&&typeof Bun.version=="string"?"BUN":t.Deno&&typeof Deno.version=="object"?"DENO":n(t.process)==="process"?"NODE":t.window&&t.document?"BROWSER":"REST"})(),uT}var cT,$L;function Ese(){if($L)return cT;$L=1;var t=LL();return cT=t==="NODE",cT}var hT,FL;function VL(){if(FL)return hT;FL=1;var t=dn(),e=Gd(),n=TI(),r=tn(),i=Lr(),o=Rn(),s=iI(),a=ey(),l=Nw(),u=NL(),c=Rse(),h=Ese(),d=t.setImmediate,f=t.clearImmediate,m=t.process,b=t.Dispatch,S=t.Function,E=t.MessageChannel,v=t.String,I=0,M={},T="onreadystatechange",P,D,K,Y;o(function(){P=t.location});var U=function(ne){if(i(M,ne)){var se=M[ne];delete M[ne],se()}},J=function(ne){return function(){U(ne)}},ee=function(ne){U(ne.data)},ae=function(ne){t.postMessage(v(ne),P.protocol+"//"+P.host)};return(!d||!f)&&(d=function(se){u(arguments.length,1);var ft=r(se)?se:S(se),pe=a(arguments,1);return M[++I]=function(){e(ft,void 0,pe)},D(I),I},f=function(se){delete M[se]},h?D=function(ne){m.nextTick(J(ne))}:b&&b.now?D=function(ne){b.now(J(ne))}:E&&!c?(K=new E,Y=K.port2,K.port1.onmessage=ee,D=n(Y.postMessage,Y)):t.addEventListener&&r(t.postMessage)&&!t.importScripts&&P&&P.protocol!=="file:"&&!o(ae)?(D=ae,t.addEventListener("message",ee,!1)):T in l("script")?D=function(ne){s.appendChild(l("script"))[T]=function(){s.removeChild(this),U(ne)}}:D=function(ne){setTimeout(J(ne),0)}),hT={set:d,clear:f},hT}var WL;function Tse(){if(WL)return AL;WL=1;var t=vt(),e=dn(),n=VL().clear;return t({global:!0,bind:!0,enumerable:!0,forced:e.clearImmediate!==n},{clearImmediate:n}),AL}var BL={},dT,jL;function _se(){if(jL)return dT;jL=1;var t=dn(),e=Gd(),n=tn(),r=LL(),i=zd(),o=ey(),s=NL(),a=t.Function,l=/MSIE .\./.test(i)||r==="BUN"&&(function(){var u=t.Bun.version.split(".");return u.length<3||u[0]==="0"&&(u[1]<3||u[1]==="3"&&u[2]==="0")})();return dT=function(u,c){var h=c?2:1;return l?function(d,f){var m=s(arguments.length,1)>h,b=n(d)?d:a(d),S=m?o(arguments,h):[],E=m?function(){e(b,this,S)}:b;return c?u(E,f):u(E)}:u},dT}var UL;function Mse(){if(UL)return BL;UL=1;var t=vt(),e=dn(),n=VL().set,r=_se(),i=e.setImmediate?r(n,!1):n;return t({global:!0,bind:!0,enumerable:!0,forced:e.setImmediate!==i},{setImmediate:i}),BL}var zL;function Ise(){return zL||(zL=1,Tse(),Mse()),xL}Ise();function Pse(t,e){Ose(t,e),e.add(t)}function Ose(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function El(t,e,n){return(e=xse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xse(t){var e=Ase(t,"string");return typeof e=="symbol"?e:e+""}function Ase(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fT(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 _p=new WeakSet;class gT{constructor(e,n,r){Pse(this,_p),El(this,"hot",void 0),El(this,"tableMeta",void 0),El(this,"selection",void 0),El(this,"eventManager",void 0),El(this,"destroyed",!1),El(this,"activeEditor",void 0),El(this,"cellProperties",void 0),this.hot=e,this.tableMeta=n,this.selection=r,this.eventManager=new gi(e),this.hot.addHook("afterDocumentKeyDown",i=>fT(_p,this,YL).call(this,i)),this.hot.addHook("beforeCompositionStart",i=>fT(_p,this,YL).call(this,i)),this.hot.view._wt.update("onCellDblClick",(i,o,s)=>fT(_p,this,Hse).call(this,i,o,s))}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.activeEditor&&this.activeEditor.isWaiting()){this.closeEditor(!1,!1,u=>{u&&this.prepareEditor()});return}const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||n.isHeader())return;const{row:r,col:i}=n,o=this.hot.runHooks("modifyGetCellCoords",r,i,!1,"meta");let s=r,a=i;if(Array.isArray(o)&&([s,a]=o),this.cellProperties=this.hot.getCellMeta(s,a),!this.isCellEditable()){this.clearActiveEditor();return}const l=this.hot.getCell(r,i,!0);if(l){const u=this.hot.getCellEditor(this.cellProperties),c=this.hot.colToProp(a),h=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s),a);this.activeEditor=fA(u,this.hot),this.activeEditor.prepare(r,i,c,l,h,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(!this.isCellEditable()){this.clearActiveEditor();return}const i=this.hot.getSelectedRangeLast();let o=this.hot.runHooks("beforeBeginEditing",i.highlight.row,i.highlight.col,e,n,r);if(n instanceof MouseEvent&&typeof o!="boolean"&&(o=this.hot.selection.getLayerLevel()===0&&i.isSingle()),o===!1){this.clearActiveEditor();return}this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(r&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,n))}closeEditor(e,n,r){this.activeEditor?this.activeEditor.finishEditing(e,n,r):r&&r(!1)}closeEditorAndSaveChanges(e){this.closeEditor(!1,e)}closeEditorAndRestoreOriginalValue(e){this.closeEditor(!0,e)}clearActiveEditor(){this.activeEditor=void 0}isCellEditable(){const e=this.hot.getSelectedRangeLast();if(!e)return!1;const n=this.hot.getCellEditor(this.cellProperties),{row:r,col:i}=e.highlight,{rowIndexMapper:o,columnIndexMapper:s}=this.hot,a=o.isHidden(this.hot.toPhysicalRow(r))||s.isHidden(this.hot.toPhysicalColumn(i));return!(this.cellProperties.readOnly||!n||a)}moveSelectionAfterEnter(e){const n={...typeof this.tableMeta.enterMoves=="function"?this.tableMeta.enterMoves(e):this.tableMeta.enterMoves};e.shiftKey&&(n.row=-n.row,n.col=-n.col),this.hot.selection.isMultiple()?this.selection.transformFocus(n.row,n.col):this.selection.transformStart(n.row,n.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function YL(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||ba(t))return;const{keyCode:n}=t,r=(t.ctrlKey||t.metaKey)&&!t.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!Dx(n)&&!QY(n)&&!r&&!this.isEditorOpened()&&this.openEditor("",t)}function Hse(t,e){e.isCell()&&this.openEditor(null,t,!0)}const GL=new WeakMap;gT.getInstance=function(t,e,n){let r=GL.get(t);return r||(r=new gT(t,e,n),GL.set(t,r)),r};function Nse(t,e){qL(t,e),e.add(t)}function Ad(t,e,n){qL(t,e),e.set(t,n)}function qL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bt(t,e){return t.get(ds(t,e))}function Hd(t,e,n){return t.set(ds(t,e),n),n}function ds(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 nc=Object.freeze({CELL:"cell",MIXED:"mixed"});var cn=new WeakMap,Mp=new WeakMap,Ip=new WeakMap,Pp=new WeakMap,Op=new WeakMap,na=new WeakSet;class Dse{constructor(e){var n=this;Nse(this,na),Ad(this,cn,void 0),Ad(this,Mp,void 0),Ad(this,Ip,1),Ad(this,Pp,null),Ad(this,Op,new Map);const r=e.getSettings();Hd(cn,this,e),Hd(Mp,this,r.imeFastEdit?nc.MIXED:nc.CELL),bt(cn,this).addHook("afterUpdateSettings",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ds(na,n,Lse).call(n,...o)}),bt(cn,this).addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ds(na,n,KL).call(n,...o)}),bt(cn,this).addHook("afterSelectionFocusSet",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ds(na,n,KL).call(n,...o)}),bt(cn,this).addHook("afterSelectionEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ds(na,n,kse).call(n,...o)})}getFocusMode(){return bt(Mp,this)}setFocusMode(e){Object.values(nc).includes(e)?Hd(Mp,this,e):et(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return bt(Ip,this)}setRefocusDelay(e){Hd(Ip,this,e)}setRefocusElementGetter(e){Hd(Pp,this,e)}getRefocusElement(){var e;return typeof bt(Pp,this)=="function"?bt(Pp,this).call(this):(e=bt(cn,this).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const n=r=>{var i,o;const s=(i=bt(cn,this).getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;if(!s)return;let a=bt(cn,this).runHooks("modifyFocusedElement",s.row,s.col,r);Do(a)||(a=r),a&&!((o=bt(cn,this).getActiveEditor())!==null&&o!==void 0&&o.isOpened())&&a.focus({preventScroll:!0})};e?n(e):ds(na,this,mT).call(this,r=>n(r))}refocusToEditorTextarea(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bt(Ip,this);if(bt(cn,this).getSettings().imeFastEdit&&!((e=bt(cn,this).getActiveEditor())!==null&&e!==void 0&&e.isOpened())){var r,i;(r=bt(cn,this).getActiveEditor())===null||r===void 0||(i=r.refreshValue)===null||i===void 0||i.call(r),bt(Op,this).has(n)||bt(Op,this).set(n,Df(()=>{if(!bt(cn,this).isDestroyed){var o;(o=this.getRefocusElement())===null||o===void 0||o.select()}},n)),bt(Op,this).get(n)()}}}function mT(t){var e;const n=(e=bt(cn,this).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||!bt(cn,this).selection.isCellVisible(n)){t(null);return}const r=bt(cn,this).getCell(n.row,n.col,!0);r===null?bt(cn,this).addHookOnce("afterScroll",()=>{t(bt(cn,this).getCell(n.row,n.col,!0))}):t(r)}function KL(){ds(na,this,mT).call(this,t=>{const{activeElement:e}=bt(cn,this).rootDocument;e&&cx(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function kse(){ds(na,this,mT).call(this,t=>{this.getFocusMode()===nc.MIXED&&t?.nodeName==="TD"&&this.refocusToEditorTextarea()})}function Lse(t){typeof t.imeFastEdit=="boolean"&&this.setFocusMode(t.imeFastEdit?nc.MIXED:nc.CELL)}const XL=new WeakMap,pT=Symbol("rootInstance");function $se(t){XL.set(t,!0)}function Fse(t){return t===pT}function xp(t){return XL.has(t)}function Vse(t,e){ZL(t,e),e.add(t)}function ra(t,e,n){ZL(t,e),e.set(t,n)}function ZL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ia(t,e,n){return(e=Wse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wse(t){var e=Bse(t,"string");return typeof e=="symbol"?e:e+""}function Bse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function en(t,e){return t.get(rc(t,e))}function wr(t,e,n){return t.set(rc(t,e),n),n}function rc(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 wT=new WeakMap,Ap=new WeakMap,Hp=new WeakMap,fs=new WeakMap,Hi=new WeakMap,vT=new WeakMap,CT=new WeakMap,ic=new WeakMap,Nd=new WeakSet;class jse{constructor(e){Vse(this,Nd),ia(this,"hot",void 0),ia(this,"eventManager",void 0),ia(this,"settings",void 0),ia(this,"THEAD",void 0),ia(this,"TBODY",void 0),ia(this,"_wt",void 0),ia(this,"activeWt",void 0),ra(this,wT,0),ra(this,Ap,0),ia(this,"postponedAdjustElementsSize",!1),ra(this,Hp,!1),ra(this,fs,void 0),ra(this,Hi,void 0),ra(this,vT,0),ra(this,CT,0),ra(this,ic,null),this.hot=e,this.eventManager=new gi(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){if(!this.hot.isRenderSuspended()){const e=this.hot.forceFullRender;this.hot.runHooks("beforeRender",e),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize()),this._wt.draw(!e),rc(Nd,this,zse).call(this),this.hot.runHooks("afterRender",e),this.hot.forceFullRender=!1}}adjustElementsSize(){this.hot.isRenderSuspended()?this.postponedAdjustElementsSize=!0:this._wt.wtOverlays.adjustElementsSize()}getCellAtCoords(e,n){const r=this._wt.getCell(e,n);return r<0?null:r}scrollViewport(e,n,r){return this._wt.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this._wt.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this._wt.scrollViewportVertically(e,n)}createElements(){const{rootElement:e,rootDocument:n}=this.hot,r=e.getAttribute("style");r&&e.setAttribute("data-originalstyle",r),X(e,"handsontable"),wr(Hi,this,n.createElement("TABLE")),X(en(Hi,this),"htCore"),this.hot.getSettings().tableClassName&&X(en(Hi,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(Se(en(Hi,this),[Ho()]),Se(e,[XU(),KO(-1),Sf(this.hot.countCols()),cz()])),this.THEAD=n.createElement("THEAD"),en(Hi,this).appendChild(this.THEAD),this.TBODY=n.createElement("TBODY"),en(Hi,this).appendChild(this.TBODY),this.hot.table=en(Hi,this),this.hot.container.insertBefore(en(Hi,this),this.hot.container.firstChild)}registerEvents(){const{rootElement:e,rootDocument:n,selection:r,rootWindow:i}=this.hot,o=n.documentElement;this.eventManager.addEventListener(e,"mousedown",a=>{wr(Hp,this,!0),this.isTextSelectionAllowed(a.target)||(ax(i),a.preventDefault(),i.focus())}),this.eventManager.addEventListener(e,"mouseup",()=>{wr(Hp,this,!1)}),this.eventManager.addEventListener(e,"mousemove",a=>{en(Hp,this)&&!this.isTextSelectionAllowed(a.target)&&(this.settings.fragmentSelection&&ax(i),a.preventDefault())}),this.eventManager.addEventListener(o,"keyup",a=>{r.isInProgress()&&!a.shiftKey&&r.finish()}),this.eventManager.addEventListener(o,"mouseup",a=>{r.isInProgress()&&yy(a)&&r.finish(),wr(fs,this,!1);const l=cx(n.activeElement);Pf(n.activeElement)&&!l||(l||!r.isSelected()&&!r.isSelectedByAnyHeader()&&!e.contains(a.target)&&!Sa(a))&&this.hot.unlisten()}),this.eventManager.addEventListener(o,"contextmenu",a=>{r.isInProgress()&&Sa(a)&&(r.finish(),wr(fs,this,!1))}),this.eventManager.addEventListener(o,"touchend",()=>{r.isInProgress()&&r.finish(),wr(fs,this,!1)}),this.eventManager.addEventListener(o,"mousedown",a=>{const l=a.target,u=a.x||a.clientX,c=a.y||a.clientY;let h=a.target;if(en(fs,this)||!e||!this.hot.view)return;const{holder:d}=this._wt.wtTable;if(h===d){const m=vn(n);if(n.elementFromPoint(u+m,c)!==d||n.elementFromPoint(u,c+m)!==d)return}else for(;h!==o;){if(h===null){if(a.isTargetWebComponent)break;return}if(h===e)return;h=h.parentNode}(typeof this.settings.outsideClickDeselects=="function"?this.settings.outsideClickDeselects(l):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)});let s=zl(i);for(;s!==null;)this.eventManager.addEventListener(s.document.documentElement,"click",()=>{this.hot.unlisten()}),s=zl(s);this.eventManager.addEventListener(en(Hi,this),"selectstart",a=>{this.settings.fragmentSelection||Pf(a.target)||a.preventDefault()})}translateFromRenderableToVisualCoords(e){let{row:n,col:r}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(n,r))}translateFromRenderableToVisualIndex(e,n){let r=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,i=n>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(n):n;return r===null&&(r=e),i===null&&(i=n),[r,i]}countRenderableIndexes(e,n){const r=Math.min(e.getNotTrimmedIndexesLength(),n),i=e.getNearestNotHiddenIndex(r-1,-1);return i===null?0:e.getRenderableFromVisualIndex(i)+1}countRenderableColumns(){return this.countRenderableIndexes(this.hot.columnIndexMapper,this.settings.maxCols)}countRenderableRows(){return this.countRenderableIndexes(this.hot.rowIndexMapper,this.settings.maxRows)}countNotHiddenRowIndexes(e,n){return this.countNotHiddenIndexes(e,n,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,n){return this.countNotHiddenIndexes(e,n,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,n,r,i){if(isNaN(e)||e<0)return 0;const o=r.getNearestNotHiddenIndex(e,n),s=r.getRenderableFromVisualIndex(o);if(!Number.isInteger(s))return 0;let a=0;return n<0?a=s+1:n>0&&(a=i-s),a}countNotHiddenFixedColumnsStart(){const e=this.hot.countCols(),n=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(n,-1)}countNotHiddenFixedRowsTop(){const e=this.hot.countRows(),n=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(n,-1)}countNotHiddenFixedRowsBottom(){const e=this.hot.countRows(),n=Math.max(e-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(n,1)}countRenderableColumnsInRange(e,n){let r=0;for(let i=e;i<=n;i++)this.hot.columnIndexMapper.getRenderableFromVisualIndex(i)!==null&&(r+=1);return r}countRenderableRowsInRange(e,n){let r=0;for(let i=e;i<=n;i++)this.hot.rowIndexMapper.getRenderableFromVisualIndex(i)!==null&&(r+=1);return r}getStylesHandler(){return this._wt.stylesHandler}getDefaultRowHeight(){return this._wt.stylesHandler.getDefaultRowHeight()}addClassNameToLicenseElement(e){var n;const r=(n=this.hot.rootElement.parentNode)===null||n===void 0?void 0:n.querySelector(".hot-display-license-info");r&&X(r,e)}removeClassNameFromLicenseElement(e){var n;const r=(n=this.hot.rootElement.parentNode)===null||n===void 0?void 0:n.querySelector(".hot-display-license-info");r&&ve(r,e)}isMainTableNotFullyCoveredByOverlays(){const e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),n=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>n}initializeWalkontable(){const e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:en(Hi,this),isDataViewInstance:()=>xp(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,viewportColumnRenderingThreshold:()=>this.settings.viewportColumnRenderingThreshold,viewportRowRenderingThreshold:()=>this.settings.viewportRowRenderingThreshold,data:(o,s)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(o,s)),totalRows:()=>this.countRenderableRows(),totalColumns:()=>this.countRenderableColumns(),fixedColumnsStart:()=>this.countNotHiddenFixedColumnsStart(),fixedRowsTop:()=>this.countNotHiddenFixedRowsTop(),fixedRowsBottom:()=>this.countNotHiddenFixedRowsBottom(),shouldRenderInlineStartOverlay:()=>this.settings.fixedColumnsStart>0||e.rowHeaders().length>0,shouldRenderTopOverlay:()=>this.settings.fixedRowsTop>0||e.columnHeaders().length>0,shouldRenderBottomOverlay:()=>this.settings.fixedRowsBottom>0,minSpareRows:()=>this.settings.minSpareRows,renderAllRows:this.settings.renderAllRows,renderAllColumns:this.settings.renderAllColumns,rowHeaders:()=>{const o=[];return this.hot.hasRowHeaders()&&o.push((s,a)=>{const l=s>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(s):s;this.appendRowHeader(l,a)}),this.hot.runHooks("afterGetRowHeaderRenderers",o),wr(Ap,this,o.length),this.hot.getSettings().ariaTags&&rc(Nd,this,QL).call(this)===this.hot.countCols()&&rc(Nd,this,Use).call(this,en(Ap,this)),o},columnHeaders:()=>{const o=[];return this.hot.hasColHeaders()&&o.push((s,a)=>{const l=s>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(s):s;this.appendColHeader(l,a)}),this.hot.runHooks("afterGetColumnHeaderRenderers",o),wr(wT,this,o.length),o},columnWidth:o=>{const s=this.hot.columnIndexMapper.getVisualFromRenderableIndex(o);return this.hot.getColWidth(s===null?o:s)},rowHeight:o=>{const s=this.hot.rowIndexMapper.getVisualFromRenderableIndex(o);return this.hot.getRowHeight(s===null?o:s)},rowHeightByOverlayName:(o,s)=>{const a=this.hot.rowIndexMapper.getVisualFromRenderableIndex(o),l=a===null?o:a;return this.hot.runHooks("modifyRowHeightByOverlayName",this.hot.getRowHeight(l),l,s)},cellRenderer:(o,s,a)=>{const[l,u]=this.translateFromRenderableToVisualIndex(o,s),c=this.hot.runHooks("modifyGetCellCoords",l,u,!1,"meta");let h=l,d=u;Array.isArray(c)&&([h,d]=c);const f=this.hot.getCellMeta(h,d),m=this.hot.colToProp(d);let b=this.hot.getDataAtRowProp(h,m);this.hot.hasHook("beforeValueRender")&&(b=this.hot.runHooks("beforeValueRender",b,f)),this.hot.runHooks("beforeRenderer",a,l,u,m,b,f),this.hot.getCellRenderer(f)(this.hot,a,l,u,m,b,f),this.hot.runHooks("afterRenderer",a,l,u,m,b,f)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&ql(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s),c={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=l,wr(fs,this,!0),wr(ic,this,{x:o.clientX,y:o.clientY}),this.hot.runHooks("beforeOnCellMouseDown",o,u,a,c),!ba(o)&&(LN(o,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseDown",o,u,a),this.activeWt=this._wt)},onCellContextMenu:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,wr(fs,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",o,u,a),!ba(o)&&(this.hot.runHooks("afterOnCellContextMenu",o,u,a),this.activeWt=this._wt)},onCellMouseOut:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOut",o,u,a),!ba(o)&&(this.hot.runHooks("afterOnCellMouseOut",o,u,a),this.activeWt=this._wt)},onCellMouseOver:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s),c={row:!1,column:!1,cell:!1};this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOver",o,u,a,c),!ba(o)&&(en(fs,this)&&(!en(ic,this)||en(ic,this).x!==o.clientX||en(ic,this).y!==o.clientY)&&LN(o,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseOver",o,u,a),this.activeWt=this._wt,wr(ic,this,null))},onCellMouseUp:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",o,u,a),!(ba(o)||this.hot.isDestroyed)&&(this.hot.runHooks("afterOnCellMouseUp",o,u,a),this.activeWt=this._wt)},onCellCornerMouseDown:o=>{o.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",o)},onCellCornerDblClick:o=>{o.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",o)},beforeDraw:(o,s)=>this.beforeRender(o,s),onDraw:o=>this.afterRender(o),onBeforeViewportScrollVertically:(o,s)=>{const a=this.hot.rowIndexMapper,l=o<0;let u=o;return!l&&(u=a.getVisualFromRenderableIndex(o),u===null)?o:(u=this.hot.runHooks("beforeViewportScrollVertically",u,s),this.hot.runHooks("beforeViewportScroll"),l?u:a.getRenderableFromVisualIndex(u))},onBeforeViewportScrollHorizontally:(o,s)=>{const a=this.hot.columnIndexMapper,l=o<0;let u=o;return!l&&(u=a.getVisualFromRenderableIndex(o),u===null)?o:(u=this.hot.runHooks("beforeViewportScrollHorizontally",u,s),this.hot.runHooks("beforeViewportScroll"),l?u:a.getRenderableFromVisualIndex(u))},onScrollVertically:()=>{this.hot.runHooks("afterScrollVertically"),this.hot.runHooks("afterScroll")},onScrollHorizontally:()=>{this.hot.runHooks("afterScrollHorizontally"),this.hot.runHooks("afterScroll")},onBeforeRemoveCellClassNames:()=>this.hot.runHooks("beforeRemoveCellClassNames"),onBeforeHighlightingRowHeader:(o,s,a)=>{const l=this.hot.rowIndexMapper,u=o<0;let c=o;u||(c=l.getVisualFromRenderableIndex(o));const h=this.hot.runHooks("beforeHighlightingRowHeader",c,s,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onBeforeHighlightingColumnHeader:(o,s,a)=>{const l=this.hot.columnIndexMapper,u=o<0;let c=o;u||(c=l.getVisualFromRenderableIndex(o));const h=this.hot.runHooks("beforeHighlightingColumnHeader",c,s,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onAfterDrawSelection:(o,s,a)=>{let l;const[u,c]=this.translateFromRenderableToVisualIndex(o,s),h=this.hot.selection.getSelectedRange();if(h.size()>0){const f=h.peekByIndex(a??0);l=[f.from.row,f.from.col,f.to.row,f.to.col]}return this.hot.runHooks("afterDrawSelection",u,c,l,a)},onBeforeDrawBorders:(o,s)=>{const[a,l,u,c]=o,h=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(a),this.hot.columnIndexMapper.getVisualFromRenderableIndex(l),this.hot.rowIndexMapper.getVisualFromRenderableIndex(u),this.hot.columnIndexMapper.getVisualFromRenderableIndex(c)];return this.hot.runHooks("beforeDrawBorders",h,s)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onModifyRowHeaderWidth:o=>this.hot.runHooks("modifyRowHeaderWidth",o),onModifyGetCellCoords:(o,s,a,l)=>{const u=this.hot.rowIndexMapper,c=this.hot.columnIndexMapper,h=s>=0?c.getVisualFromRenderableIndex(s):s,d=o>=0?u.getVisualFromRenderableIndex(o):o,f=this.hot.runHooks("modifyGetCellCoords",d,h,a,l);if(Array.isArray(f)){const[m,b,S,E]=f;return[m>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(m,1)):m,b>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(b,1)):b,S>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(S,-1)):S,E>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(E,-1)):E]}},onModifyGetCoordsElement:(o,s)=>{const a=this.hot.rowIndexMapper,l=this.hot.columnIndexMapper,u=s>=0?l.getVisualFromRenderableIndex(s):s,c=o>=0?a.getVisualFromRenderableIndex(o):o,h=this.hot.runHooks("modifyGetCoordsElement",c,u);if(Array.isArray(h)){const[d,f]=h;return[d>=0?a.getRenderableFromVisualIndex(a.getNearestNotHiddenIndex(d,1)):d,f>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(f,1)):f]}},viewportRowCalculatorOverride:o=>{let s=this.settings.viewportRowRenderingOffset;if(s==="auto"&&this.settings.fixedRowsTop&&(s=10),s>0||s==="auto"){const a=this.countRenderableRows(),l=o.startRow,u=o.endRow;if(typeof s=="number")o.startRow=Math.max(l-s,0),o.endRow=Math.min(u+s,a-1);else if(s==="auto"){const c=Math.max(1,Math.ceil(u/a*12));o.startRow=Math.max(l-c,0),o.endRow=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",o)},viewportColumnCalculatorOverride:o=>{let s=this.settings.viewportColumnRenderingOffset;if(s==="auto"&&this.settings.fixedColumnsStart&&(s=10),s>0||s==="auto"){const a=this.countRenderableColumns(),l=o.startColumn,u=o.endColumn;if(typeof s=="number"&&(o.startColumn=Math.max(l-s,0),o.endColumn=Math.min(u+s,a-1)),s==="auto"){const c=Math.max(1,Math.ceil(u/a*6));o.startColumn=Math.max(l-c,0),o.endColumn=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",o)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const o=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||o}};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new pR(e),this.activeWt=this._wt;const n=this._wt.wtTable.spreader,{width:r,height:i}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(r,i),this.eventManager.addEventListener(n,"mousedown",o=>{o.target===n&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(n,"contextmenu",o=>{o.target===n&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&this.hot.render()})}isTextSelectionAllowed(e){if(Pf(e))return!0;const n=va(e,this._wt.wtTable.spreader);return!!(this.settings.fragmentSelection===!0&&n||this.settings.fragmentSelection==="cell"&&this.isSelectedOnlyCell()&&n||!this.settings.fragmentSelection&&this.isCellEdited()&&this.isSelectedOnlyCell())}isMouseDown(){return en(fs,this)}isSelectedOnlyCell(){var e,n;return(e=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingleCell())!==null&&e!==void 0?e:!1}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,n){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,n)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,n){if(n.firstChild){const r=n.firstChild;if(!ye(r,"relative")){No(n),this.appendRowHeader(e,n);return}this.updateCellHeader(r.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:r,getRowHeader:i}=this.hot,o=r.createElement("div"),s=r.createElement("span");o.className="relative",s.className="rowHeader",this.updateCellHeader(s,e,i),o.appendChild(s),n.appendChild(o)}this.hot.runHooks("afterGetRowHeader",e,n)}appendColHeader(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hot.getColHeader,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;const o=()=>{const s=e>=0?this.hot.getColumnMeta(e).headerClassName:null;return s?s.split(" "):[]};if(n.firstChild){const s=n.firstChild;ye(s,"relative")?(this.updateCellHeader(s.querySelector(".colHeader"),e,r,i),s.className="",X(s,["relative",...o()])):(No(n),this.appendColHeader(e,n,r,i))}else{const{rootDocument:s}=this.hot,a=s.createElement("div"),l=s.createElement("span"),u=o();a.classList.add("relative",...u),l.className="colHeader",this.settings.ariaTags&&(Se(a,...Ho()),Se(l,...Ho())),this.updateCellHeader(l,e,r,i),a.appendChild(l),n.appendChild(a)}this.hot.runHooks("afterGetColHeader",e,n,i)}updateCellHeader(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=n;const s=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&(ye(e,"colHeader")?o=s.wtTable.columnFilter.sourceToRendered(n):ye(e,"rowHeader")&&(o=s.wtTable.rowFilter.sourceToRendered(n))),o>-1?Gl(e,r(n,i)):(ya(e," "),X(e,"cornerHeader"))}maximumVisibleElementWidth(e){const r=this._wt.wtViewport.getWorkspaceWidth()-e;return r>0?r:0}maximumVisibleElementHeight(e){const r=this._wt.wtViewport.getWorkspaceHeight()-e;return r>0?r:0}setLastSize(e,n){wr(vT,this,e),wr(CT,this,n)}getLastSize(){return{width:en(vT,this),height:en(CT,this)}}getFirstRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());return e.getNearestNotHiddenIndex(n??0,1)}getLastRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());return e.getNearestNotHiddenIndex(n??this.hot.countRows()-1,-1)}getFirstRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());return e.getNearestNotHiddenIndex(n??0,1)}getLastRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());return e.getNearestNotHiddenIndex(n??this.hot.countCols()-1,-1)}getFirstFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleRow())}getLastFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleRow())}getFirstFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleColumn())}getLastFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleColumn())}getFirstPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleRow())}getLastPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleRow())}getFirstPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleColumn())}getLastPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleColumn())}getColumnHeadersCount(){return en(wT,this)}getRowHeadersCount(){return en(Ap,this)}getViewportWidth(){return this._wt.wtViewport.getViewportWidth()}getWorkspaceWidth(){return this._wt.wtViewport.getWorkspaceWidth()}getViewportHeight(){return this._wt.wtViewport.getViewportHeight()}getWorkspaceHeight(){return this._wt.wtViewport.getWorkspaceHeight()}getElementOverlayName(e){var n;return((n=this._wt.wtOverlays.getParentOverlay(e))!==null&&n!==void 0?n:this._wt).wtTable.name}getOverlayByName(e){return this._wt.getOverlayByName(e)}getActiveOverlayName(){return this._wt.activeOverlayName}isVisible(){return this._wt.wtTable.isVisible()}hasVerticalScroll(){return this._wt.wtViewport.hasVerticalScroll()}hasHorizontalScroll(){return this._wt.wtViewport.hasHorizontalScroll()}getTableWidth(){return this._wt.wtTable.getWidth()}getTableHeight(){return this._wt.wtTable.getHeight()}getTableOffset(){return this._wt.wtViewport.getWorkspaceOffset()}getRowHeaderWidth(){return this._wt.wtViewport.getRowHeaderWidth()}getColumnHeaderHeight(){return this._wt.wtViewport.getColumnHeaderHeight()}isVerticallyScrollableByWindow(){return this._wt.wtViewport.isVerticallyScrollableByWindow()}isHorizontallyScrollableByWindow(){return this._wt.wtViewport.isHorizontallyScrollableByWindow()}destroy(){this._wt.destroy(),this.eventManager.destroy()}}function QL(){return parseInt(this.hot.rootElement.getAttribute(Sf()[0]),10)}function Use(t){const e=rc(Nd,this,QL).call(this)+t;Se(this.hot.rootElement,...Sf(e))}function zse(){const t=this.hot.rootElement;this.hasVerticalScroll()?X(t,"htHasScrollY"):ve(t,"htHasScrollY"),this.hasHorizontalScroll()?X(t,"htHasScrollX"):ve(t,"htHasScrollX")}function Dd(t,e,n){return(e=Yse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yse(t){var e=Gse(t,"string");return typeof e=="symbol"?e:e+""}function Gse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class qse{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];Dd(this,"hot",void 0),Dd(this,"data",void 0),Dd(this,"dataType","array"),Dd(this,"colToProp",()=>{}),Dd(this,"propToCol",()=>{}),this.hot=e,this.data=n}modifyRowData(e){let n;return this.hot.hasHook("modifyRowData")&&(n=this.hot.runHooks("modifyRowData",e)),n!==void 0&&!Number.isInteger(n)?n:this.data[e]}getData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return!this.data||this.data.length===0?this.data:this.getByRange(null,null,e)}setData(e){this.data=e}getAtColumn(e){const n=[];return H(this.data,(r,i)=>{const o=this.getAtCell(i,e);n.push(o)}),n}getAtRow(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const o=n===void 0&&r===void 0,{dataDotNotation:s}=this.hot.getSettings();let a=null,l=null;if(a=this.modifyRowData(e),Array.isArray(a))l=[],o?a.forEach((u,c)=>{l[c]=this.getAtPhysicalCell(e,c,a)}):fe(n,r,u=>{l[u-n]=this.getAtPhysicalCell(e,u,a)});else if(He(a)||rt(a))if(i?l=[]:l={},!o||i){const c=this.countFirstRowKeys()-1;fe(0,c,h=>{const d=this.colToProp(h);if(h>=(n||0)&&h<=(r||c)&&!Number.isInteger(d)){const f=this.getAtPhysicalCell(e,d,a);i?l.push(f):s?ry(l,d,f):l[d]=f}})}else Ne(a,(u,c)=>{const h=this.getAtPhysicalCell(e,c,a);s?ry(l,c,h):l[c]=h});return l}setAtCell(e,n,r){if(!(e>=this.countRows()||n>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const i=br(r);this.hot.runHooks("modifySourceData",e,n,i,"set"),i.isTouched()&&(r=i.value)}["__proto__","constructor","prototype"].includes(e)||(Number.isInteger(n)?this.data[e][n]=r:ry(this.data[e],n,r))}}getAtPhysicalCell(e,n,r){let i=null;if(r)if(typeof n=="string"){const{dataDotNotation:o}=this.hot.getSettings();i=o?RU(r,n):r[n]}else typeof n=="function"?i=n(r):i=r[n];if(this.hot.hasHook("modifySourceData")){const o=br(i);this.hot.runHooks("modifySourceData",e,n,o,"get"),o.isTouched()&&(i=o.value)}return i}getAtCell(e,n){const r=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(n),r)}getByRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=!1,o=null,s=null,a=null,l=null;e===null||n===null?(i=!0,o=0,a=this.countRows()-1):(o=Math.min(e.row,n.row),s=Math.min(e.col,n.col),a=Math.max(e.row,n.row),l=Math.max(e.col,n.col));const u=[];return fe(o,a,c=>{u.push(i?this.getAtRow(c,void 0,void 0,r):this.getAtRow(c,s,l,r))}),u}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return SD(this.data)}destroy(){this.data=null,this.hot=null}}function Kse(t,e){return Ne(e,(n,r)=>{At(t[r])&&(t[r]=n)}),t}function JL(t){const n=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return n?`${n[1].toLowerCase()}-${n[2].toUpperCase()}`:t}function e$(t){ce(t)&&$y(tt`Language with code "${t}" was not found. You should register particular language\x20
81
- before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function Xse(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:Zse,getValues:Qse}=mi("phraseFormatters");function Jse(t,e){Zse(t,e)}function eae(){return Qse()}Jse("pluralize",Xse);const t$={languageCode:"en-US",[Qy]:"No available options",[Jy]:"Insert row above",[eb]:"Insert row below",[tb]:"Insert column left",[nb]:"Insert column right",[rb]:["Remove row","Remove rows"],[ib]:["Remove column","Remove columns"],[ob]:"Undo",[sb]:"Redo",[jf]:"Read only",[ab]:"Clear column",[bb]:"Alignment",[Sb]:"Left",[Rb]:"Center",[Eb]:"Right",[Tb]:"Justify",[_b]:"Top",[Mb]:"Middle",[Ib]:"Bottom",[fb]:"Freeze column",[gb]:"Unfreeze column",[Pb]:"Borders",[Ob]:"Top",[xb]:"Right",[Ab]:"Bottom",[Hb]:"Left",[Nb]:"Remove border(s)",[wb]:"Add comment",[vb]:"Edit comment",[Cb]:"Delete comment",[yb]:"Read-only comment",[mb]:"Merge cells",[pb]:"Unmerge cells",[lb]:"Copy",[ub]:["Copy with header","Copy with headers"],[cb]:["Copy with group header","Copy with group headers"],[hb]:["Copy header only","Copy headers only"],[db]:"Cut",[Db]:"Insert child row",[kb]:"Detach from parent",[Lb]:["Hide column","Hide columns"],[$b]:["Show column","Show columns"],[Fb]:["Hide row","Hide rows"],[Vb]:["Show row","Show rows"],[Uf]:"None",[Wb]:"Is empty",[Bb]:"Is not empty",[jb]:"Is equal to",[Ub]:"Is not equal to",[zb]:"Begins with",[Yb]:"Ends with",[Gb]:"Contains",[qb]:"Does not contain",[Kb]:"Greater than",[Xb]:"Greater than or equal to",[Zb]:"Less than",[Qb]:"Less than or equal to",[Jb]:"Is between",[eS]:"Is not between",[tS]:"After",[nS]:"Before",[rS]:"Today",[iS]:"Tomorrow",[oS]:"Yesterday",[Yf]:"Blank cells",[sS]:"Filter by condition",[aS]:"Filter by value",[lS]:"And",[zf]:"Or",[uS]:"Select all",[cS]:"Clear",[hS]:"OK",[dS]:"Cancel",[fS]:"Search",[gS]:"Value",[mS]:"Second value",[wS]:"Checked",[vS]:"Unchecked"},tae=ZG,yT=t$.languageCode,{register:nae,getItem:n$,hasItem:rae,getValues:iae}=mi("languagesDictionaries");r$(t$);function r$(t,e){let n=t,r=e;return He(t)&&(r=t,n=r.languageCode),oae(n,r),nae(n,Fn(r)),Fn(r)}function oae(t,e){t!==yT&&Kse(e,n$(yT))}function i$(t){return bT(t)?Fn(n$(t)):null}function bT(t){return rae(t)}function sae(){return iae()}function o$(t,e,n){const r=i$(t);if(r===null)return null;const i=r[e];if(At(i))return null;const o=aae(i,n);return Array.isArray(o)?o[0]:o}function aae(t,e){let n=t;return H(eae(),r=>{n=r(t,e)}),n}function lae(t){let e=JL(t);return bT(e)||(e=yT,e$(t)),e}function Tl(t,e,n){return(e=uae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uae(t){var e=cae(t,"string");return typeof e=="symbol"?e:e+""}function cae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class oc{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,n,r){Tl(this,"hot",void 0),Tl(this,"metaManager",void 0),Tl(this,"tableMeta",void 0),Tl(this,"dataSource",void 0),Tl(this,"duckSchema",void 0),Tl(this,"colToPropCache",void 0),Tl(this,"propToColCache",void 0),this.hot=e,this.metaManager=r,this.tableMeta=r.getTableMeta(),this.dataSource=n,this.refreshDuckSchema(),this.createMap()}createMap(){const e=this.getSchema();if(typeof e>"u")throw new Error("trying to create `columns` definition but you didn't provide `schema` nor `data`");const n=this.tableMeta.columns;let r;if(this.colToPropCache=[],this.propToColCache=new Map,n){let i=0,o=0,s=!1;if(typeof n=="function"){const a=iy(e);i=a>0?a:this.countFirstRowKeys(),s=!0}else{const a=this.tableMeta.maxCols;i=Math.min(a,n.length)}for(r=0;r<i;r++){const a=s?n(r):n[r];if(He(a)){if(typeof a.data<"u"){const l=s?o:r;this.colToPropCache[l]=a.data,this.propToColCache.set(a.data,l)}o+=1}}}else this.recursiveDuckColumns(e)}countFirstRowKeys(){return SD(this.dataSource)}recursiveDuckColumns(e,n,r){let i=n,o=r,s;return typeof i>"u"&&(i=0,o=""),typeof e=="object"&&!Array.isArray(e)&&Ne(e,(a,l)=>{a===null?(s=o+l,this.colToPropCache.push(s),this.propToColCache.set(s,i),i+=1):i=this.recursiveDuckColumns(a,i,`${l}.`)}),i}colToProp(e){if(Number.isInteger(e)===!1)return e;const n=this.hot.toPhysicalColumn(e);return n===null?e:this.colToPropCache&&ce(this.colToPropCache[n])?this.colToPropCache[n]:n}propToCol(e){const n=this.propToColCache.get(e);if(ce(n))return this.hot.toVisualColumn(n);const r=this.hot.toVisualColumn(e);return r===null?e:r}getSchema(){const e=this.tableMeta.dataSchema;return e?typeof e=="function"?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?Hc(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:r,mode:i="above"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.hot.countSourceRows();let s=o,a=0,l=e;if((typeof l!="number"||l>=o)&&(l=o),l<this.hot.countRows()&&(s=this.hot.toPhysicalRow(l)),this.hot.runHooks("beforeCreateRow",l,n,r)===!1||s===null)return{delta:0};const c=this.tableMeta.maxRows,h=this.getSchema().length,d=[];for(;a<n&&o+a<c;){let m=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?m=Fn(this.getSchema()):(m=[],fe(h-1,()=>m.push(null))):this.hot.dataType==="function"?m=this.tableMeta.dataSchema(l+a):(m={},Cf(m,this.getSchema())),d.push(m),a+=1}this.hot.rowIndexMapper.insertIndexes(l,a),i==="below"&&(s=Math.min(s+1,o)),this.spliceData(s,0,d);const f=this.hot.toVisualRow(s);return this.hot.countSourceRows()===d.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),a>0&&(e==null?this.metaManager.createRow(null,a):r!=="auto"&&this.metaManager.createRow(s,n)),this.hot.runHooks("afterCreateRow",f,a,r),{delta:a,startPhysicalIndex:s}}createCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:r,mode:i="start"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!this.hot.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");const o=this.dataSource,s=this.tableMeta.maxCols,a=this.hot.countSourceCols();let l=e;if((typeof l!="number"||l>=a)&&(l=a),this.hot.runHooks("beforeCreateCol",l,n,r)===!1)return{delta:0};let c=a;l<this.hot.countCols()&&(c=this.hot.toPhysicalColumn(l));const h=this.hot.countSourceRows();let d=this.hot.countCols(),f=0,m=c;i==="end"&&(m=Math.min(m+1,a));const b=m;for(;f<n&&d<s;){if(typeof l!="number"||l>=d)if(h>0)for(let E=0;E<h;E+=1)typeof o[E]>"u"&&(o[E]=[]),o[E].push(null);else o.push([null]);else for(let E=0;E<h;E++)o[E].splice(m,0,null);f+=1,m+=1,d+=1}this.hot.columnIndexMapper.insertIndexes(l,f),f>0&&(e==null?this.metaManager.createColumn(null,f):r!=="auto"&&this.metaManager.createColumn(b,n));const S=this.hot.toVisualColumn(b);return this.hot.runHooks("afterCreateCol",S,f,r),this.refreshDuckSchema(),{delta:f,startPhysicalIndex:b}}removeRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0,i=Number.isInteger(e)?e:-n;const o=this.visualRowsToPhysical(i,n),s=this.hot.countSourceRows();if(i=(s+i)%s,this.hot.runHooks("beforeRemoveRow",i,o.length,o,r)===!1)return!1;const l=o.length;if(this.filterData(i,l,o),i<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(o);const c=ce(this.tableMeta.columns)||ce(this.tableMeta.dataSchema)||this.tableMeta.colHeaders;this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&!c&&this.hot.columnIndexMapper.setIndexesSequence([])}return o.slice(0).sort((c,h)=>h-c).forEach(c=>{this.metaManager.removeRow(c,1)}),this.hot.runHooks("afterRemoveRow",i,l,o,r),!0}removeCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;if(this.hot.dataType==="object"||this.tableMeta.columns)throw new Error("cannot remove column with object data source or columns option specified");let i=typeof e!="number"?-n:e;i=(this.hot.countCols()+i)%this.hot.countCols();const o=this.visualColumnsToPhysical(i,n),s=o.slice(0).sort((h,d)=>d-h);if(this.hot.runHooks("beforeRemoveCol",i,n,o,r)===!1)return!1;let l=!0;const u=s.length,c=this.dataSource;for(let h=0;h<u;h++)l&&o[0]!==o[h]-h&&(l=!1);if(l)for(let h=0,d=this.hot.countSourceRows();h<d;h++)c[h].splice(o[0],n),h===0&&this.metaManager.removeColumn(o[0],n);else for(let h=0,d=this.hot.countSourceRows();h<d;h++)for(let f=0;f<u;f++)c[h].splice(s[f],1),h===0&&this.metaManager.removeColumn(s[f],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(o),!this.tableMeta.rowHeaders&&this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,n,o,r),this.refreshDuckSchema(),!0}spliceCol(e,n,r){const i=this.hot.getDataAtCol(e),o=i.slice(n,n+r),s=i.slice(n+r);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];cO(l,s);let c=0;for(;c<r;)l.push(null),c+=1;return hU(l),this.hot.populateFromArray(n,e,l,null,null,"spliceCol"),o}spliceRow(e,n,r){const i=this.hot.getSourceDataAtRow(e),o=i.slice(n,n+r),s=i.slice(n+r);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];cO(l,s);let c=0;for(;c<r;)l.push(null),c+=1;return this.hot.populateFromArray(e,n,[l],null,null,"spliceRow"),o}spliceData(e,n,r){if(this.hot.runHooks("beforeDataSplice",e,n,r)!==!1){const o=[...this.dataSource.slice(0,e),...r,...this.dataSource.slice(e)];this.dataSource.length=0,o.forEach(s=>this.dataSource.push(s))}}filterData(e,n,r){let i=this.hot.runHooks("filterData",e,n,r);Array.isArray(i)===!1&&(i=this.dataSource.filter((o,s)=>r.indexOf(s)===-1)),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,i)}get(e,n){const r=this.hot.toPhysicalRow(e);let i=this.dataSource[r];const o=this.hot.runHooks("modifyRowData",r);i=isNaN(o)?o:i;const{dataDotNotation:s}=this.hot.getSettings();let a=null;if(i&&i.hasOwnProperty&&on(i,n))a=i[n];else if(s&&typeof n=="string"&&n.indexOf(".")>-1){let l=i;if(!l)return null;const u=n.split(".");for(let c=0,h=u.length;c<h;c++)if(l=l[u[c]],typeof l>"u")return null;a=l}else typeof n=="function"&&(a=n(this.dataSource.slice(r,r+1)[0]));if(this.hot.hasHook("modifyData")){const l=br(a);this.hot.runHooks("modifyData",r,this.propToCol(n),l,"get"),l.isTouched()&&(a=l.value)}return a}getCopyable(e,n){return this.hot.getCellMeta(e,this.propToCol(n)).copyable?this.get(e,n):""}set(e,n,r){const i=this.hot.toPhysicalRow(e);let o=r,s=this.dataSource[i];const a=this.hot.runHooks("modifyRowData",i);if(s=isNaN(a)?a:s,this.hot.hasHook("modifyData")){const u=br(o);this.hot.runHooks("modifyData",i,this.propToCol(n),u,"set"),u.isTouched()&&(o=u.value)}const{dataDotNotation:l}=this.hot.getSettings();if(s&&s.hasOwnProperty&&on(s,n))s[n]=o;else if(l&&typeof n=="string"&&n.indexOf(".")>-1){let u=s,c=0,h;const d=n.split(".");for(c=0,h=d.length-1;c<h;c++){if(d[c]==="__proto__"||d[c]==="constructor"||d[c]==="prototype")return;typeof u[d[c]]>"u"&&(u[d[c]]={}),u=u[d[c]]}u[d[c]]=o}else if(typeof n=="function")n(this.dataSource.slice(i,i+1)[0],o);else{if(n==="__proto__"||n==="constructor"||n==="prototype")return;s[n]=o}}visualRowsToPhysical(e,n){const r=this.hot.countSourceRows(),i=[];let o=(r+e)%r,s=n,a;for(;o<r&&s;)a=this.hot.toPhysicalRow(o),i.push(a),s-=1,o+=1;return i}visualColumnsToPhysical(e,n){const r=this.hot.countCols(),i=[];let o=(r+e)%r,s=n;for(;o<r&&s;){const a=this.hot.toPhysicalColumn(o);i.push(a),s-=1,o+=1}return i}clear(){for(let e=0;e<this.hot.countSourceRows();e++)for(let n=0;n<this.hot.countCols();n++)this.set(e,this.colToProp(n),"")}getLength(){const e=this.tableMeta.maxRows;let n;e<0||e===0?n=0:n=e||1/0;const r=this.hot.rowIndexMapper.getNotTrimmedIndexesLength();return Math.min(r,n)}getAll(){const e={row:0,col:0},n={row:Math.max(this.hot.countRows()-1,0),col:Math.max(this.hot.countCols()-1,0)};return e.row-n.row===0&&!this.hot.countSourceRows()?[]:this.getRange(e,n,oc.DESTINATION_RENDERER)}countCachedColumns(){return this.colToPropCache.length}getRange(e,n,r){const i=[];let o,s,a;const l=this.tableMeta.maxRows,u=this.tableMeta.maxCols;if(l===0||u===0)return[];const c=r===oc.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,h=Math.min(Math.max(l-1,0),Math.max(e.row,n.row)),d=Math.min(Math.max(u-1,0),Math.max(e.col,n.col));for(o=Math.min(e.row,n.row);o<=h;o++){a=[];const f=o>=0?this.hot.toPhysicalRow(o):o;for(s=Math.min(e.col,n.col);s<=d&&f!==null;s++)a.push(c.call(this,o,this.colToProp(s)));f!==null&&i.push(a)}return i}getText(e,n){return Dh(this.getRange(e,n,oc.DESTINATION_RENDERER))}getCopyableText(e,n){return Dh(this.getRange(e,n,oc.DESTINATION_CLIPBOARD_GENERATOR))}destroy(){this.hot=null,this.metaManager=null,this.dataSource=null,this.duckSchema=null,this.colToPropCache.length=0,this.propToColCache.clear(),this.propToColCache=void 0}}function hae(t,e){var n;return t==="CELL_TYPE"?!1:((n=e._automaticallyAssignedMetaProps)===null||n===void 0?void 0:n.has(t))||!on(e,t)}function Np(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const r=typeof e.type=="string"?Uq(e.type):e.type;if(t._automaticallyAssignedMetaProps&&Ne(e,(o,s)=>{t._automaticallyAssignedMetaProps.delete(s)}),!He(r))return;n===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const i={};Ne(r,(o,s)=>{if(hae(s,n)){var a;i[s]=o,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(s)}}),rn(t,i)}function dae(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function n(){}SU(n,t);for(let r=0;r<e.length;r++)n.prototype[e[r]]=void 0;return n}function Dp(t){return Number.isInteger(t)&&t>=0}function kp(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function Lp(t){return t==null}const s$=()=>({_automaticallyAssignedMetaProps:void 0,activeHeaderClassName:"ht__active_highlight",allowEmpty:!0,allowHtml:!1,allowInsertColumn:!0,allowInsertRow:!0,allowInvalid:!0,allowRemoveColumn:!0,allowRemoveRow:!0,ariaTags:!0,autoColumnSize:void 0,autoRowSize:void 0,autoWrapCol:!1,autoWrapRow:!1,bindRowsWithHeaders:void 0,cell:[],cells:void 0,checkedTemplate:void 0,className:void 0,colHeaders:null,collapsibleColumns:void 0,columnHeaderHeight:void 0,columns:void 0,columnSorting:void 0,columnSummary:void 0,colWidths:void 0,commentedCellClassName:"htCommentCell",comments:!1,contextMenu:void 0,copyable:!0,copyPaste:!0,correctFormat:!1,currentColClassName:void 0,currentHeaderClassName:"ht__highlight",currentRowClassName:void 0,customBorders:!1,data:void 0,dataDotNotation:!0,dataSchema:void 0,dateFormat:"DD/MM/YYYY",timeFormat:"h:mm:ss a",datePickerConfig:void 0,defaultDate:void 0,disableVisualSelection:!1,dragToScroll:!0,dropdownMenu:void 0,editor:void 0,enterBeginsEditing:!0,enterMoves:{col:0,row:1},fillHandle:{autoInsertRow:!1},filter:!0,filteringCaseSensitive:!1,filters:void 0,fixedColumnsLeft:0,fixedColumnsStart:0,fixedRowsBottom:0,fixedRowsTop:0,formulas:void 0,fragmentSelection:!1,headerClassName:void 0,height:void 0,hiddenColumns:void 0,hiddenRows:void 0,invalidCellClassName:"htInvalid",imeFastEdit:!1,isEmptyCol(t){let e,n,r;for(e=0,n=this.countRows();e<n;e++)if(r=this.getDataAtCell(e,t),Bt(r)===!1)return!1;return!0},isEmptyRow(t){let e,n,r,i;for(e=0,n=this.countCols();e<n;e++)if(r=this.getDataAtCell(t,e),Bt(r)===!1)return typeof r=="object"?(i=this.getCellMeta(t,e),ny(this.getSchema()[i.prop],r)):!1;return!0},label:void 0,language:"en-US",layoutDirection:"inherit",licenseKey:void 0,locale:"en-US",manualColumnFreeze:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,maxCols:1/0,maxRows:1/0,mergeCells:!1,minCols:0,minRows:0,minSpareCols:0,minSpareRows:0,multiColumnSorting:void 0,navigableHeaders:!1,tabNavigation:!0,nestedHeaders:void 0,nestedRows:void 0,noWordWrapClassName:"htNoWrap",numericFormat:void 0,observeDOMVisibility:!0,outsideClickDeselects:!0,persistentState:void 0,placeholder:void 0,placeholderCellClassName:"htPlaceholder",preventOverflow:!1,preventWheel:!1,readOnly:!1,readOnlyCellClassName:"htDimmed",renderAllRows:!1,renderAllColumns:!1,renderer:void 0,rowHeaders:void 0,rowHeaderWidth:void 0,rowHeights:void 0,search:!1,selectionMode:"multiple",selectOptions:void 0,skipColumnOnPaste:!1,skipRowOnPaste:!1,sortByRelevance:!0,source:void 0,startCols:5,startRows:5,stretchH:"none",strict:void 0,tableClassName:void 0,themeName:void 0,tabMoves:{row:0,col:1},title:void 0,trimDropdown:!0,trimRows:void 0,trimWhitespace:!0,type:"text",uncheckedTemplate:void 0,undo:!0,validator:void 0,viewportColumnRenderingOffset:"auto",viewportRowRenderingOffset:"auto",viewportColumnRenderingThreshold:0,viewportRowRenderingThreshold:0,visibleRows:10,width:void 0,wordWrap:!0});function a$(t,e,n){return(e=fae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fae(t){var e=gae(t,"string");return typeof e=="symbol"?e:e+""}function gae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mae(){return class{}}class pae{constructor(e){a$(this,"metaCtor",mae()),a$(this,"meta",void 0),this.meta=this.metaCtor.prototype,rn(this.meta,s$()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var n;rn(this.meta,e),Np(this.meta,{...e,type:(n=e.type)!==null&&n!==void 0?n:this.meta.type},e)}}function wae(t,e,n){return(e=vae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vae(t){var e=Cae(t,"string");return typeof e=="symbol"?e:e+""}function Cae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class yae{constructor(e){wae(this,"meta",void 0);const n=e.getMetaConstructor();this.meta=new n}getMeta(){return this.meta}updateMeta(e){rn(this.meta,e),Np(this.meta,e,e)}}function $p(t,e,n){return(e=bae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bae(t){var e=Sae(t,"string");return typeof e=="symbol"?e:e+""}function Sae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Fp{constructor(e){$p(this,"valueFactory",void 0),$p(this,"data",[]),$p(this,"index",[]),$p(this,"holes",new Set),this.valueFactory=e}obtain(e){kp(()=>Dp(e),"Expecting an unsigned number.");const n=this._getStorageIndexByKey(e);let r;if(n>=0)r=this.data[n],r===void 0&&(r=this.valueFactory(e),this.data[n]=r);else if(r=this.valueFactory(e),this.holes.size>0){const i=this.holes.values().next().value;this.holes.delete(i),this.data[i]=r,this.index[e]=i}else this.data.push(r),this.index[e]=this.data.length-1;return r}insert(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;kp(()=>Dp(e)||Lp(e),"Expecting an unsigned number or null/undefined argument.");const r=[],i=this.data.length;for(let s=0;s<n;s++)r.push(i+s),this.data.push(void 0);const o=Lp(e)?this.index.length:e;this.index=[...this.index.slice(0,o),...r,...this.index.slice(o)]}remove(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;kp(()=>Dp(e)||Lp(e),"Expecting an unsigned number or null/undefined argument.");const r=this.index.splice(Lp(e)?this.index.length-n:e,n);for(let i=0;i<r.length;i++){const o=r[i];typeof o=="number"&&this.holes.add(o)}}size(){return this.data.length-this.holes.size}values(){return this.data.filter((e,n)=>e!==void 0&&!this.holes.has(n))[Symbol.iterator]()}entries(){const e=[];for(let r=0;r<this.data.length;r++){const i=this._getKeyByStorageIndex(r);i!==-1&&this.data[r]!==void 0&&e.push([i,this.data[r]])}let n=0;return{next:()=>{if(n<e.length){const r=e[n];return n+=1,{value:r,done:!1}}return{done:!0}}}}clear(){this.data=[],this.index=[],this.holes.clear()}_getStorageIndexByKey(e){return this.index.length>e?this.index[e]:-1}_getKeyByStorageIndex(e){return this.index.indexOf(e)}[Symbol.iterator](){return this.entries()}}function l$(t,e,n){return(e=Rae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rae(t){var e=Eae(t,"string");return typeof e=="symbol"?e:e+""}function Eae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Tae=["data","width"];class _ae{constructor(e){l$(this,"globalMeta",void 0),l$(this,"metas",new Fp(()=>this._createMeta())),this.globalMeta=e,this.metas=new Fp(()=>this._createMeta())}updateMeta(e,n){const r=this.getMeta(e);rn(r,n),Np(r,n)}createColumn(e,n){this.metas.insert(e,n)}removeColumn(e,n){this.metas.remove(e,n)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return dae(this.globalMeta.getMetaConstructor(),Tae).prototype}}function u$(t,e,n){return(e=Mae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mae(t){var e=Iae(t,"string");return typeof e=="symbol"?e:e+""}function Iae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Pae{constructor(e){u$(this,"columnMeta",void 0),u$(this,"metas",new Fp(()=>this._createRow())),this.columnMeta=e}updateMeta(e,n,r){const i=this.getMeta(e,n);rn(i,r),Np(i,r)}createRow(e,n){this.metas.insert(e,n)}createColumn(e,n){for(let r=0;r<this.metas.size();r++)this.metas.obtain(r).insert(e,n)}removeRow(e,n){this.metas.remove(e,n)}removeColumn(e,n){for(let r=0;r<this.metas.size();r++)this.metas.obtain(r).remove(e,n)}getMeta(e,n,r){const i=this.metas.obtain(e).obtain(n);return r===void 0?i:i[r]}setMeta(e,n,r,i){var o;const s=this.metas.obtain(e).obtain(n);(o=s._automaticallyAssignedMetaProps)===null||o===void 0||o.delete(r),s[r]=i}removeMeta(e,n,r){const i=this.metas.obtain(e).obtain(n);delete i[r]}getMetas(){const e=[],n=Array.from(this.metas.values());for(let r=0;r<n.length;r++)ce(n[r])&&e.push(...n[r].values());return e}getMetasAtRow(e){kp(()=>Dp(e),"Expecting an unsigned number.");const n=new Map(this.metas);return n.has(e)?Array.from(n.get(e).values()):[]}clearCache(){this.metas.clear()}_createRow(){return new Fp(e=>this._createMeta(e))}_createMeta(e){const n=this.columnMeta.getMetaConstructor(e);return new n}}class c${constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];this.hot=e,this.globalMeta=new pae(e),this.tableMeta=new yae(this.globalMeta),this.columnMeta=new _ae(this.globalMeta),this.cellMeta=new Pae(this.columnMeta),r.forEach(i=>new i(this)),this.globalMeta.updateMeta(n)}getGlobalMeta(){return this.globalMeta.getMeta()}updateGlobalMeta(e){this.globalMeta.updateMeta(e)}getTableMeta(){return this.tableMeta.getMeta()}updateTableMeta(e){this.tableMeta.updateMeta(e)}getColumnMeta(e){return this.columnMeta.getMeta(e)}updateColumnMeta(e,n){this.columnMeta.updateMeta(e,n)}getCellMeta(e,n,r){const i=this.cellMeta.getMeta(e,n);return i.visualRow=r.visualRow,i.visualCol=r.visualColumn,i.row=e,i.col=n,r.skipMetaExtension||this.runLocalHooks("afterGetCellMeta",i),i}getCellMetaKeyValue(e,n,r){if(typeof r!="string")throw new Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,n,r)}setCellMeta(e,n,r,i){this.cellMeta.setMeta(e,n,r,i)}updateCellMeta(e,n,r){this.cellMeta.updateMeta(e,n,r)}removeCellMeta(e,n,r){this.cellMeta.removeMeta(e,n,r)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createRow(e,n)}removeRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeRow(e,n)}createColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createColumn(e,n),this.columnMeta.createColumn(e,n)}removeColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeColumn(e,n),this.columnMeta.removeColumn(e,n)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}ct(c$,Mn);function h$(t,e,n,r){const{hotInstance:i,dataMap:o,dataSource:s,internalSource:a,source:l,metaManager:u,firstRun:c}=r,h=hi(a),d=i.getSettings();Array.isArray(d.dataSchema)?i.dataType="array":rt(d.dataSchema)?i.dataType="function":i.dataType="object",o&&o.destroy(),t=i.runHooks(`before${h}`,t,c,l);const f=new oc(i,t,u);if(e(f),typeof t=="object"&&t!==null)t.push&&t.splice||(t=[t]);else if(t===null){const m=f.getSchema();t=[];let b,S=0,E=0;for(S=0,E=d.startRows;S<E;S++)if((i.dataType==="object"||i.dataType==="function")&&d.dataSchema)b=Fn(m),t.push(b);else if(i.dataType==="array")b=Fn(m[0]),t.push(b);else{b=[];for(let v=0,I=d.startCols;v<I;v++)b.push(null);t.push(b)}}else throw new Error(`${a} only accepts array of objects or array of arrays (${typeof t} given)`);Array.isArray(t[0])&&(i.dataType="array"),d.data=t,f.dataSource=t,s.data=t,s.dataType=i.dataType,s.colToProp=f.colToProp.bind(f),s.propToCol=f.propToCol.bind(f),s.countCachedColumns=f.countCachedColumns.bind(f),n(f),i.runHooks(`after${h}`,t,c,l),c||(i.runHooks("afterChange",null,a),i.render()),i.getSettings().ariaTags&&Se(i.rootElement,[KO(-1),Sf(i.countCols()+(i.view?i.countRowHeaders():0))])}function d$(t,e,n){return(e=Oae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oae(t){var e=xae(t,"string");return typeof e=="symbol"?e:e+""}function xae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Aae{constructor(e){var n=this;d$(this,"metaManager",void 0),d$(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",function(){return n.extendCellMeta(...arguments)}),re.getSingleton().add("beforeRender",r=>{r&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var n;const{row:r,col:i}=e;if((n=this.metaSyncMemo.get(r))!==null&&n!==void 0&&n.has(i))return;const{visualRow:o,visualCol:s}=e,a=this.metaManager.hot,l=a.colToProp(s);e.prop=l,a.runHooks("beforeGetCellMeta",o,s,e);const u=on(e,"type")?e.type:null;let c=rt(e.cells)?e.cells(r,i,l):null;if(u)if(c){var h;c.type=(h=c.type)!==null&&h!==void 0?h:u}else c={type:u};c&&this.metaManager.updateCellMeta(r,i,c),a.runHooks("afterGetCellMeta",o,s,e),this.metaSyncMemo.has(r)||this.metaSyncMemo.set(r,new Set),this.metaSyncMemo.get(r).add(i)}}function Hae(t,e,n){Nae(t,e),e.set(t,n)}function Nae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ST(t,e,n){return(e=Dae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dae(t){var e=kae(t,"string");return typeof e=="symbol"?e:e+""}function kae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lae(t,e){return t.get($ae(t,e))}function $ae(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 f$=new WeakMap;class Fae{constructor(e){ST(this,"metaManager",void 0),ST(this,"usageTracker",new Set),ST(this,"propDescriptors",new Map([["ariaTags",{initOnly:!0}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(n){if(this.metaManager.hot.isRtl()&&n==="fixedColumnsLeft")throw new Error("The `fixedColumnsLeft` is not supported for RTL. Please use option `fixedColumnsStart`.");if(this.usageTracker.has("fixedColumnsLeft")&&this.usageTracker.has("fixedColumnsStart"))throw new Error("The `fixedColumnsLeft` and `fixedColumnsStart` should not be used together. Please use only the option `fixedColumnsStart`.")}}],["layoutDirection",{initOnly:!0}],["renderAllColumns",{initOnly:!0}],["renderAllRows",{initOnly:!0}]])),Hae(this,f$,(n,r,i)=>{if(!i)throw new Error(`The \`${n}\` option can not be updated after the Handsontable is initialized.`)}),this.metaManager=e,this.extendMetaProps()}extendMetaProps(){this.propDescriptors.forEach((e,n)=>{const{initOnly:r,target:i,onChange:o}=e,s=typeof i=="string",a=s?i:n,l=`_${a}`;this.metaManager.globalMeta.meta[l]=this.metaManager.globalMeta.meta[a],o?(this.installPropWatcher(n,l,o),s&&this.installPropWatcher(i,l,o)):r&&(this.installPropWatcher(n,l,Lae(f$,this)),this.metaManager.globalMeta.meta._initOnlySettings||(this.metaManager.globalMeta.meta._initOnlySettings=[]),this.metaManager.globalMeta.meta._initOnlySettings.push(n))})}installPropWatcher(e,n,r){const i=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[n]},set(o){const s=!i.usageTracker.has(e);i.usageTracker.add(e),r.call(i,e,o,s),this[n]=o},enumerable:!0,configurable:!0})}}function Vae(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.rootElement,r=g$(t),i=g$(t);return r.addEventListener("focus",()=>e?.onFocusFromTop()),i.addEventListener("focus",()=>e?.onFocusFromBottom()),n.firstChild.before(r),n.lastChild.after(i),{activate(){t._registerTimeout(()=>{r.tabIndex=0,i.tabIndex=0},10)},deactivate(){t._registerTimeout(()=>{r.tabIndex=-1,i.tabIndex=-1},10)}}}function g$(t){const n=t.rootDocument.createElement("input");return n.type="text",n.name="__htFocusCatcher",n.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&Se(n,[Fc("Focus catcher")]),n}function Wae(t){const e=Bae(t);let n;const{activate:r,deactivate:i}=Vae(t,{onFocusFromTop(){var h;const d=(h=e(n))!==null&&h!==void 0?h:RT(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_above",d),t.selectCell(d.row,d.col)),t.listen()},onFocusFromBottom(){var h;const d=(h=e(n))!==null&&h!==void 0?h:ET(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_below",d),t.selectCell(d.row,d.col)),t.listen()}}),o={wrapped:!1,flipped:!1};let s=!0,a=!1,l=!1;t.addHook("afterListen",()=>i()),t.addHook("afterUnlisten",()=>r()),t.addHook("afterSelection",(h,d,f,m,b)=>{if(a&&(o.wrapped&&o.flipped||l)&&(l=!1,b.value=!0),s){var S;n=(S=t.getSelectedRangeLast())===null||S===void 0?void 0:S.highlight}}),t.addHook("beforeRowWrap",(h,d,f)=>{o.wrapped=!0,o.flipped=f});function u(){o.wrapped=!1,o.flipped=!1,t.deselectCell(),t.unlisten()}const c={keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:Ax,group:"focusCatcher"};t.getShortcutManager().getContext("grid").addShortcuts([{...c,callback:()=>{const{tabNavigation:h}=t.getSettings();a=!0,t.getSelectedRangeLast()&&!h&&(s=!1),h||(l=!0)},position:"before"},{...c,callback:h=>{const{tabNavigation:d,autoWrapRow:f}=t.getSettings();if(a=!1,s=!0,!d||!t.selection.isSelected()||f&&o.wrapped&&o.flipped||!f&&o.wrapped)return f&&o.wrapped&&o.flipped&&(n=h.shiftKey?RT(t):ET(t)),u(),!1;h.preventDefault()},position:"after"}])}function RT(t){const{rowIndexMapper:e,columnIndexMapper:n}=t,{navigableHeaders:r}=t.getSettings();let i=r&&t.countColHeaders()>0?-t.countColHeaders():0,o=r&&t.countRowHeaders()>0?-t.countRowHeaders():0;return i===0&&(i=e.getVisualFromRenderableIndex(i)),o===0&&(o=n.getVisualFromRenderableIndex(o)),i===null||o===null?null:t._createCellCoords(i,o)}function ET(t){var e,n;const{rowIndexMapper:r,columnIndexMapper:i}=t,{navigableHeaders:o}=t.getSettings();let s=r.getRenderableIndexesLength()-1,a=i.getRenderableIndexesLength()-1;if(s<0){if(!o||t.countColHeaders()===0)return null;s=-1}if(a<0){if(!o||t.countColHeaders()===0)return null;a=-1}return t._createCellCoords((e=r.getVisualFromRenderableIndex(s))!==null&&e!==void 0?e:s,(n=i.getVisualFromRenderableIndex(a))!==null&&n!==void 0?n:a)}function Bae(t){return e=>{if(!e)return null;const n=RT(t),r=ET(t);return e.col<n.col&&(e.col=n.col),e.col>r.col&&(e.col=r.col),e.row<n.row&&(e.row=n.row),e.row>r.row&&(e.row=r.row),e}}function sc(t){Do(t)&&t.scrollIntoView({block:"nearest",inline:"nearest"})}function Vp(t){const{selection:e,view:n}=t,r=t.getSelectedRangeLast(),i=e.getSelectionSource(),o=n.getFirstFullyVisibleColumn(),s=n.getLastFullyVisibleColumn(),a=r.getTopStartCorner().col,l=r.getBottomEndCorner().col,u=a<=o,c=l>=s,h=n.getFirstFullyVisibleRow(),d=n.getLastFullyVisibleRow(),f=r.getTopStartCorner().row,m=r.getBottomEndCorner().row,b=f<=h,S=m>=d;return{getComputedColumnTarget(E){return i==="mouse"||i==="keyboard"?E.col:u&&c?r.highlight.col:u?a:c?l:E.col},getComputedRowTarget(E){return i==="mouse"||i==="keyboard"?E.row:b&&S?r.highlight.row:b?f:S?m:E.row}}}function jae(t){return e=>{const n=Vp(t).getComputedColumnTarget(e);t.scrollViewportTo({col:n},()=>{const r=!!t.getSettings().colHeaders;sc(t.getCell(r?-1:0,n,!0))})}}function Uae(){return()=>{}}function zae(t){return e=>{t.scrollViewportTo(e.toObject(),()=>{const{row:n,col:r}=t.getSelectedRangeLast().highlight;sc(t.getCell(n,r,!0))})}}function Yae(t){return e=>{const n=Vp(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:o}=r;sc(t.getCell(i,o,!0))})}}function Gae(t){return e=>{const n=Vp(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:o}=r;sc(t.getCell(i,o,!0))})}}function qae(t){return e=>{const n=Vp(t).getComputedRowTarget(e);t.scrollViewportTo({row:n},()=>{const r=!!t.getSettings().rowHeaders;sc(t.getCell(n,r?-1:0,!0))})}}function Kae(t){return e=>{const n=t.selection.getSelectionSource(),{row:r,col:i}=e,o=()=>{sc(t.getCell(r,i,!0))};if(r<0&&i>=0)t.scrollViewportTo({col:i},o);else if(i<0&&r>=0)t.scrollViewportTo({row:r},o);else{if(n==="mouse"&&(i===t.view.getLastPartiallyVisibleColumn()||r===t.view.getLastPartiallyVisibleRow()))return;t.scrollViewportTo({row:r,col:i},o)}}}function Xae(t){const{selection:e}=t;let n=!1,r=!1;return{resume(){r=!1},suspend(){r=!0},skipNextScrollCycle(){n=!0},scrollTo(i){var o;if(n||r){n=!1;return}let s;e.isFocusSelectionChanged()?s=zae(t):e.isSelectedByCorner()?s=Uae():e.isSelectedByRowHeader()?s=qae(t):e.isSelectedByColumnHeader()?s=jae(t):e.getSelectedRange().size()===1&&e.isMultiple()?s=Yae(t):e.getSelectedRange().size()===1&&!e.isMultiple()?s=Kae(t):e.getSelectedRange().size()>1&&(s=Gae(t)),(o=s)===null||o===void 0||o(i)}}}const m$=new Map([[" ","space"],["spacebar","space"],["scroll","scrolllock"],["del","delete"],["esc","escape"],["medianexttrack","mediatracknext"],["mediaprevioustrack","mediatrackprevious"],["volumeup","audiovolumeup"],["volumedown","audiovolumedown"],["volumemute","audiovolumemute"],["multiply","*"],["add","+"],["divide","/"],["subtract","-"],["left","arrowleft"],["right","arrowright"],["up","arrowup"],["down","arrowdown"]]),Wp=t=>t.map(e=>{const n=e.toLowerCase();return m$.has(n)?m$.get(n):n}).sort().join("+"),Zae=t=>t.split("+"),p$=new Map([[96,"numpad0"],[97,"numpad1"],[98,"numpad2"],[99,"numpad3"],[100,"numpad4"],[101,"numpad5"],[102,"numpad6"],[103,"numpad7"],[104,"numpad8"],[105,"numpad9"],[106,"multiply"],[107,"add"],[108,"decimal"],[109,"subtract"],[110,"decimal"],[111,"divide"],[112,"f1"],[113,"f2"],[114,"f3"],[115,"f4"],[116,"f5"],[117,"f6"],[118,"f7"],[119,"f8"],[120,"f9"],[121,"f10"],[122,"f11"],[123,"f12"],[186,"semicolon"],[187,"equal"],[188,"comma"],[189,"minus"],[190,"period"],[191,"slash"],[192,"backquote"],[219,"bracketleft"],[220,"backslash"],[221,"bracketright"],[222,"quote"]]),TT=t=>{let{which:e,key:n}=t;if(p$.has(e))return p$.get(e);const r=String.fromCharCode(e).toLowerCase();return/^[a-z0-9]$/.test(r)?r:n.toLowerCase()},w$=Symbol("shortcut-context");function v$(t){return He(t)&&t.__kindOf===w$}const Qae=t=>{const e=Zf({errorIdExists:l=>`The "${l}" shortcut is already registered in the "${t}" context.`}),n=function(){let{keys:l,callback:u,group:c,runOnlyIf:h=()=>!0,captureCtrl:d=!1,preventDefault:f=!0,stopPropagation:m=!1,relativeToGroup:b,position:S,forwardToContext:E}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(At(c))throw new Error("You need to define the shortcut's group.");if(rt(u)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(tt`Pass the shortcut\'s keys as an array of arrays,\x20
82
- using the KeyboardEvent.key properties:\x20
83
- https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const v={callback:u,group:c,runOnlyIf:h,captureCtrl:d,preventDefault:f,stopPropagation:m};ce(b)&&(v.relativeToGroup=b,v.position=S),v$(E)&&(v.forwardToContext=E),l.forEach(I=>{const M=Wp(I);if(e.hasItem(M)){const P=e.getItem(M);let D=P.findIndex(K=>K.group===b);D!==-1?S==="before"?D-=1:D+=1:D=P.length,P.splice(D,0,v)}else e.addItem(M,[v])})},r=function(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l.forEach(c=>{Ne(u,(h,d)=>{Object.prototype.hasOwnProperty.call(c,d)===!1&&(c[d]=u[d])}),n(c)})},i=l=>{const u=Wp(l);e.removeItem(u)};return{__kindOf:w$,addShortcut:n,addShortcuts:r,getShortcuts:l=>{const u=Wp(l),c=e.getItem(u);return ce(c)?c.slice():[]},hasShortcut:l=>{const u=Wp(l);return e.hasItem(u)},removeShortcutsByKeys:i,removeShortcutsByGroup:l=>{e.getItems().forEach(c=>{let[h,d]=c;const f=d.filter(m=>m.group!==l);f.length===0?i(Zae(h)):(d.length=0,d.push(...f))})}}};function Jae(){const t=new Set;return{press(e){t.add(e)},release(e){t.delete(e)},releaseAll(){t.clear()},isPressed(e){return t.has(e)}}}const ele=["meta","alt","shift","control"],kd=Jae(),Ld=[];let Bp=0;function tle(t,e,n,r,i){const o=f=>ele.includes(f),s=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const b=[];return f.altKey&&b.push("alt"),m&&(f.ctrlKey||f.metaKey)?b.push("control/meta"):(f.ctrlKey&&b.push("control"),f.metaKey&&b.push("meta")),f.shiftKey&&b.push("shift"),b},a=f=>{if(e(f)===!1||n(f)===!1||f.keyCode===229||typeof f.key!="string"||ba(f))return;const b=TT(f);let S=[];o(b)||(S=s(f));const E=[b].concat(S);!i(f,E)&&(Cx()&&S.includes("meta")||!Cx()&&S.includes("control"))&&i(f,[b].concat(s(f,!0))),r(f)},l=f=>{if(typeof f.key=="string"){const m=TT(f);o(m)&&kd.press(m)}},u=f=>{if(typeof f.key=="string"){const m=TT(f);o(m)&&kd.release(m)}},c=()=>{kd.releaseAll()};return{mount:()=>{let f=t;for(Bp+=1;f;)Bp===1&&(f.document.documentElement.addEventListener("keydown",l),Ld.push({event:"keydown",listener:l}),f.document.documentElement.addEventListener("keyup",u),Ld.push({event:"keyup",listener:u})),f.document.documentElement.addEventListener("keydown",a),f.document.documentElement.addEventListener("blur",c),f=zl(f)},unmount:()=>{let f=t;for(Bp-=1;f;){if(Bp===0){for(let m=0;m<Ld.length;m++){const{event:b,listener:S}=Ld[m];f.document.documentElement.removeEventListener(b,S)}Ld.length=0}f.document.documentElement.removeEventListener("keydown",a),f.document.documentElement.removeEventListener("blur",c),f=zl(f)}},isPressed:f=>kd.isPressed(f),releasePressedKeys:()=>kd.releaseAll()}}const nle=t=>{let{ownerWindow:e,handleEvent:n,beforeKeyDown:r,afterKeyDown:i}=t;const o=Zf({errorIdExists:m=>`The "${m}" context name is already registered.`});let s="grid";const a=m=>{const b=Qae(m);return o.addItem(m,b),b},l=()=>s,u=m=>o.getItem(m),c=m=>{if(!o.hasItem(m))throw new Error(tt`You've tried to activate the "${m}" shortcut context\x20
84
- that does not exist. Before activation, register the context using the "addContext" method.`);s=m};let h=!1;const d=function(m,b){let S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const E=v$(S)?S:u(S);let v=!1;if(!E.hasShortcut(b))return v;const I=E.getShortcuts(b);for(let M=0;M<I.length;M++){const{callback:T,runOnlyIf:P,preventDefault:D,stopPropagation:K,captureCtrl:Y,forwardToContext:U}=I[M];if(P(m)===!0){if(h=Y,v=T(m,b)===!1,h=!1,D&&m.preventDefault(),K&&(fi(m),m.stopPropagation()),v)break;U&&d(m,b,U)}}return v},f=tle(e,n,r,i,d);return f.mount(),{addContext:a,getActiveContextName:l,getContext:u,setActiveContextName:c,isCtrlPressed:()=>!h&&(f.isPressed("control")||f.isPressed("meta")),releasePressedKeys:()=>f.releasePressedKeys(),destroy:()=>f.unmount()}};function C$(t){const{classNames:e}=bz(t,/ht-theme-[a-zA-Z0-9_-]+/);return e.pop()}let _T=null;const MT=new Map;function y$(t,e){var n,r=this;let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this;const s=new gi(o);let a,l,u,c,h,d,f=!0;Fse(i)&&$se(this),this.rootElement=t,this.rootDocument=t.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const m=(n=e?.layoutDirection)!==null&&n!==void 0?n:"inherit",b=["rtl","ltr"].includes(m)?m:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",b),this.isRtl=function(){return b==="rtl"},this.isLtr=function(){return!o.isRtl()},this.getDirectionFactor=function(){return o.isLtr()?1:-1},e.language=lae(e.language);const S=Object.fromEntries(Object.entries(e).filter(g=>{let[w]=g;return!(re.getSingleton().isRegistered(w)||re.getSingleton().isDeprecated(w))})),E=new c$(o,S,[Aae,Fae]),v=E.getTableMeta(),I=E.getGlobalMeta(),M=Zf();this.container=this.rootDocument.createElement("div"),t.insertBefore(this.container,t.firstChild),xp(this)&&(pU(e.licenseKey,t),X(t,"ht-wrapper")),this.guid=`ht_${BO()}`,MT.set(this.guid,this),this.columnIndexMapper=new TR,this.rowIndexMapper=new TR,this.columnIndexMapper.addLocalHook("indexesSequenceChange",g=>{o.runHooks("afterColumnSequenceChange",g)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",g=>{o.runHooks("afterRowSequenceChange",g)}),s.addEventListener(this.rootDocument.documentElement,"compositionstart",g=>{o.runHooks("beforeCompositionStart",g)}),l=new qse(o),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const T=g=>{const{row:w,col:p}=g;return o._createCellCoords(w>=0?o.rowIndexMapper.getRenderableFromVisualIndex(w):w,p>=0?o.columnIndexMapper.getRenderableFromVisualIndex(p):p)},P=g=>{const{row:w,col:p}=g;return o._createCellCoords(w>=0?o.rowIndexMapper.getVisualFromRenderableIndex(w):w,p>=0?o.columnIndexMapper.getVisualFromRenderableIndex(p):p)},D=(g,w)=>{const p=w>g?1:-1,_=Math.min(g,w),A=Math.max(g,w),$=o.rowIndexMapper.getNearestNotHiddenIndex(g,p);return $===null||p===1&&$>A||p===-1&&$<_?null:$>=0?o.rowIndexMapper.getRenderableFromVisualIndex($):$},K=(g,w)=>{const p=w>g?1:-1,_=Math.min(g,w),A=Math.max(g,w),$=o.columnIndexMapper.getNearestNotHiddenIndex(g,p);return $===null||p===1&&$>A||p===-1&&$<_?null:$>=0?o.columnIndexMapper.getRenderableFromVisualIndex($):$};let Y=new DN(v,{rowIndexMapper:o.rowIndexMapper,columnIndexMapper:o.columnIndexMapper,countCols:()=>o.countCols(),countRows:()=>o.countRows(),propToCol:g=>a.propToCol(g),isEditorOpened:()=>o.getActiveEditor()?o.getActiveEditor().isOpened():!1,countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),countRenderableRowsInRange:function(){return r.view.countRenderableRowsInRange(...arguments)},countRenderableColumnsInRange:function(){return r.view.countRenderableColumnsInRange(...arguments)},getShortcutManager:()=>o.getShortcutManager(),createCellCoords:(g,w)=>o._createCellCoords(g,w),createCellRange:(g,w,p)=>o._createCellRange(g,w,p),visualToRenderableCoords:T,renderableToVisualCoords:P,findFirstNonHiddenRenderableRow:D,findFirstNonHiddenRenderableColumn:K,isDisabledCellSelection:(g,w)=>g<0||w<0?o.getSettings().disableVisualSelection:o.getCellMeta(g,w).disableVisualSelection});this.selection=Y;const U=g=>{let{hiddenIndexesChanged:w}=g;this.forceFullRender=!0,w&&this.selection.commit()};this.columnIndexMapper.addLocalHook("cacheUpdated",U),this.rowIndexMapper.addLocalHook("cacheUpdated",U),this.selection.addLocalHook("afterSetRangeEnd",(g,w)=>{const p=br(!1),_=this.selection.getSelectedRange(),{from:A,to:$}=_.current(),W=_.size()-1;this.runHooks("afterSelection",A.row,A.col,$.row,$.col,p,W),this.runHooks("afterSelectionByProp",A.row,o.colToProp(A.col),$.row,o.colToProp($.col),p,W),w&&(!p.isTouched()||p.isTouched()&&!p.value)&&d.scrollTo(g);const z=Y.isSelectedByRowHeader(),y=Y.isSelectedByColumnHeader();z&&y?X(this.rootElement,["ht__selection--rows","ht__selection--columns"]):z?(ve(this.rootElement,"ht__selection--columns"),X(this.rootElement,"ht__selection--rows")):y?(ve(this.rootElement,"ht__selection--rows"),X(this.rootElement,"ht__selection--columns")):ve(this.rootElement,["ht__selection--rows","ht__selection--columns"]),Y.getSelectionSource()!=="shift"&&c.closeEditor(null),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("beforeSetFocus",g=>{this.runHooks("beforeSelectionFocusSet",g.row,g.col)}),this.selection.addLocalHook("afterSetFocus",g=>{const w=br(!1);this.runHooks("afterSelectionFocusSet",g.row,g.col,w),(!w.isTouched()||w.isTouched()&&!w.value)&&d.scrollTo(g),c.closeEditor(),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("afterSelectionFinished",g=>{const w=g.length-1,{from:p,to:_}=g[w];this.runHooks("afterSelectionEnd",p.row,p.col,_.row,_.col,w),this.runHooks("afterSelectionEndByProp",p.row,o.colToProp(p.col),_.row,o.colToProp(_.col),w)}),this.selection.addLocalHook("afterIsMultipleSelection",g=>{const w=this.runHooks("afterIsMultipleSelection",g.value);g.value&&(g.value=w)}),this.selection.addLocalHook("afterDeselect",()=>{c.closeEditor(),o.view.render(),ve(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeStart",...w)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeStartOnly",...w)}).addLocalHook("beforeSetRangeEnd",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeEnd",...w)}).addLocalHook("beforeSelectColumns",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSelectColumns",...w)}).addLocalHook("afterSelectColumns",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterSelectColumns",...w)}).addLocalHook("beforeSelectRows",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSelectRows",...w)}).addLocalHook("afterSelectRows",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterSelectRows",...w)}).addLocalHook("beforeModifyTransformStart",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("modifyTransformStart",...w)}).addLocalHook("afterModifyTransformStart",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformStart",...w)}).addLocalHook("beforeModifyTransformFocus",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("modifyTransformFocus",...w)}).addLocalHook("afterModifyTransformFocus",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformFocus",...w)}).addLocalHook("beforeModifyTransformEnd",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("modifyTransformEnd",...w)}).addLocalHook("afterModifyTransformEnd",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformEnd",...w)}).addLocalHook("beforeRowWrap",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeRowWrap",...w)}).addLocalHook("beforeColumnWrap",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeColumnWrap",...w)}).addLocalHook("insertRowRequire",g=>this.alter("insert_row_above",g,1,"auto")).addLocalHook("insertColRequire",g=>this.alter("insert_col_start",g,1,"auto")),u={alter(g,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=arguments.length>3?arguments[3]:void 0,A=arguments.length>4?arguments[4]:void 0;const $=W=>{if(W.length===0)return[];const z=[...W];return z.sort((R,C)=>{let[N]=R,[O]=C;return N===O?0:N>O?1:-1}),tr(z,(R,C)=>{let[N,O]=C;const L=R[R.length-1],[j,k]=L,F=j+k;if(N<=F){const B=Math.max(O-(F-N),0);L[1]+=B}else R.push([N,O]);return R},[z[0]])};switch(g){case"insert_row_below":case"insert_row_above":const W=o.countSourceRows();if(v.maxRows===W)return;const z=g==="insert_row_below"?"below":"above";w=w??(z==="below"?W:0);const{delta:y,startPhysicalIndex:R}=a.createRow(w,p,{source:_,mode:z});Y.shiftRows(o.toVisualRow(R),y);break;case"insert_col_start":case"insert_col_end":const C=g==="insert_col_end"?"end":"start";w=w??(C==="end"?o.countSourceCols():0);const{delta:N,startPhysicalIndex:O}=a.createCol(w,p,{source:_,mode:C});if(N){if(Array.isArray(v.colHeaders)){const k=[o.toVisualColumn(O),0];k.length+=N,Array.prototype.splice.apply(v.colHeaders,k)}Y.shiftColumns(o.toVisualColumn(O),N)}break;case"remove_row":const L=k=>{let F=0;H(k,B=>{let[V,G]=B;const le=Bt(V)?o.countRows()-1:Math.max(V-F,0);if(Number.isInteger(V)&&(V=Math.max(V-F,0)),!a.removeRow(V,G,_))return;if(Y.isSelected()){const{row:be}=o.getSelectedRangeLast().highlight;be>=V&&be<=V+G-1&&c.closeEditor(!0)}const Pe=o.countRows(),$e=v.fixedRowsTop;$e>=le+1&&(v.fixedRowsTop-=Math.min(G,$e-le));const Ue=v.fixedRowsBottom;Ue&&le>=Pe-Ue&&(v.fixedRowsBottom-=Math.min(G,Ue)),Pe===0?Y.deselect():_==="ContextMenu.removeRow"?Y.refresh():Y.shiftRows(V,-G),F+=G})};Array.isArray(w)?L($(w)):L([[w,p]]);break;case"remove_col":const j=k=>{let F=0;H(k,B=>{let[V,G]=B;const le=Bt(V)?o.countCols()-1:Math.max(V-F,0);let de=o.toPhysicalColumn(le);if(Number.isInteger(V)&&(V=Math.max(V-F,0)),!a.removeCol(V,G,_))return;if(Y.isSelected()){const{col:be}=o.getSelectedRangeLast().highlight;be>=V&&be<=V+G-1&&c.closeEditor(!0)}o.countCols()===0?Y.deselect():_==="ContextMenu.removeColumn"?Y.refresh():Y.shiftColumns(V,-G);const Ue=v.fixedColumnsStart;Ue>=le+1&&(v.fixedColumnsStart-=Math.min(G,Ue-le)),Array.isArray(v.colHeaders)&&(typeof de>"u"&&(de=-1),v.colHeaders.splice(de,G)),F+=G})};Array.isArray(w)?j($(w)):j([[w,p]]);break;default:throw new Error(`There is no such action "${g}"`)}A||u.adjustRowsAndCols(),o.view.render(),o.view.adjustElementsSize()},adjustRowsAndCols(){const g=v.minRows,w=v.minSpareRows,p=v.minCols,_=v.minSpareCols;if(g){const A=o.countRows();A<g&&a.createRow(A,g-A,{source:"auto"})}if(w){const A=o.countEmptyRows(!0);if(A<w){const $=w-A,W=Math.min($,v.maxRows-o.countSourceRows());a.createRow(o.countRows(),W,{source:"auto"})}}{let A;(p||_)&&(A=o.countEmptyCols(!0));let $=o.countCols();if(p&&!v.columns&&$<p){const W=p-$;A+=W,a.createCol($,W,{source:"auto"})}if(_&&!v.columns&&o.dataType==="array"&&A<_){$=o.countCols();const W=_-A,z=Math.min(W,v.maxCols-$);a.createCol($,z,{source:"auto"})}}},populateFromArray(g,w,p,_,A){let $,W,z,y;const R=[],C={},N=[],O=g.row,L=g.col;if(W=w.length,W===0)return!1;let j=0,k=0;switch(He(p)&&(j=p.col-L+1,k=p.row-O+1),A){case"shift_down":const F=wf(w),B=F.length,V=Math.max(B,j),G=o.getData().slice(O),le=wf(G).slice(L,L+V);for(z=0;z<V;z+=1)if(z<B){for($=0,W=F[z].length;$<k-W;$+=1)F[z].push(F[z][$%W]);z<le.length?N.push(F[z].concat(le[z])):N.push(F[z].concat(new Array(G.length).fill(null)))}else N.push(F[z%B].concat(le[z]));o.populateFromArray(O,L,wf(N));break;case"shift_right":const de=w.length,Pe=Math.max(de,k),$e=o.getData().slice(O).map(Pt=>Pt.slice(L));for($=0;$<Pe;$+=1)if($<de){for(z=0,y=w[$].length;z<j-y;z+=1)w[$].push(w[$][z%y]);if($<$e.length)for(let Pt=0;Pt<$e[$].length;Pt+=1)w[$].push($e[$][Pt]);else w[$].push(...new Array($e[0].length).fill(null))}else w.push(w[$%W].slice(0,Pe).concat($e[$]));o.populateFromArray(O,L,w);break;default:C.row=g.row,C.col=g.col;let Ue=0,be=0,Fe=!0,It;const yo=function(Qn){let ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const wt=w[Qn%w.length];return ut!==null?wt[ut%wt.length]:wt},bo=w.length,So=p?p.row-g.row+1:0;for(p?W=So:W=Math.max(bo,So),$=0;$<W&&!(p&&C.row>p.row&&So>bo||!v.allowInsertRow&&C.row>o.countRows()-1||C.row>=v.maxRows);$++){const Pt=$-Ue,Qn=yo(Pt).length,ut=p?p.col-g.col+1:0;if(p?y=ut:y=Math.max(Qn,ut),C.col=g.col,It=o.getCellMeta(C.row,C.col),(_==="CopyPaste.paste"||_==="Autofill.fill")&&It.skipRowOnPaste){Ue+=1,C.row+=1,W+=1;continue}for(be=0,z=0;z<y&&!(p&&C.col>p.col&&ut>Qn||!v.allowInsertColumn&&C.col>o.countCols()-1||C.col>=v.maxCols);z++){if(It=o.getCellMeta(C.row,C.col),(_==="CopyPaste.paste"||_==="Autofill.fill")&&It.skipColumnOnPaste){be+=1,C.col+=1,y+=1;continue}if(It.readOnly&&_!=="UndoRedo.undo"){C.col+=1;continue}const wt=z-be;let We=yo(Pt,wt),vr=o.getDataAtCell(C.row,C.col);if(We!==null&&typeof We=="object")if(Array.isArray(We)&&vr===null&&(vr=[]),vr===null||typeof vr!="object")Fe=!1;else{const Yp=Hc(Array.isArray(vr)?vr:vr[0]||vr),uc=Hc(Array.isArray(We)?We:We[0]||We);ny(Yp,uc)||Array.isArray(Yp)&&Array.isArray(uc)?We=Fn(We):Fe=!1}else vr!==null&&typeof vr=="object"&&(Fe=!1);Fe&&R.push([C.row,C.col,We]),Fe=!0,C.col+=1}C.row+=1}o.setDataAtCell(R,null,null,_||"populateFromArray");break}}};function J(g){const w=JL(g);bT(w)?(o.runHooks("beforeLanguageChange",w),I.language=w,o.runHooks("afterLanguageChange",w)):e$(g)}function ee(g,w){const p=g==="className"?o.rootElement:o.table;if(f)X(p,w);else{let _=[],A=[];I[g]&&(_=Array.isArray(I[g])?I[g]:dO(I[g])),w&&(A=Array.isArray(w)?w:dO(w));const $=hO(_,A),W=hO(A,_);$.length&&ve(p,$),W.length&&X(p,W)}I[g]=w}this.init=function(){l.setData(v.data),o.runHooks("beforeInit"),(ko()||wx())&&X(o.rootElement,"mobile"),this.updateSettings(e,!0),this.view=new jse(this);const g=v.themeName||C$(o.rootElement);o.useTheme(g),o.view.addClassNameToLicenseElement(o.getCurrentThemeName()),c=gT.getInstance(o,v,Y),d=Xae(o),h=new Dse(o),xp(this)&&Wae(o),o.runHooks("init"),this.render(),f&&o.rootElement.offsetParent===null&&Pz(o.rootElement,()=>{o.view._wt.wtOverlays.updateLastSpreaderSize(),o.render(),o.view.adjustElementsSize()}),typeof f=="object"&&(o.runHooks("afterChange",f[0],f[1]),f=!1),o.runHooks("afterInit")};function ae(){let g=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,g=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&g===!1&&(g=!0,this.onQueueEmpty(this.valid))}}}function ne(g){const w=g.replace(",",".");return isNaN(parseFloat(w))===!1?parseFloat(w):g}function se(g,w,p){if(!g.length){p();return}const _=o.getActiveEditor(),A=new ae;let $=!0;A.onQueueEmpty=()=>{_&&$&&_.cancelChanges(),p()};for(let W=g.length-1;W>=0;W--){const[z,y]=g[W],R=a.propToCol(y);let C;Number.isInteger(R)?C=o.getCellMeta(z,R):C={...Object.getPrototypeOf(v),...v},o.getCellValidator(C)&&(A.addValidatorToQueue(),o.validateCell(g[W][3],C,(function(N,O){return function(L){if(typeof L!="boolean")throw new Error("Validation error: result is not boolean");L===!1&&O.allowInvalid===!1&&($=!1,g.splice(N,1),O.valid=!0),A.removeValidatorFormQueue()}})(W,C),w))}A.checkIfQueueIsEmpty()}function ft(g,w){for(let _=g.length-1;_>=0;_--){let A=!1;if(g[_]===null){g.splice(_,1);continue}if(!((g[_][2]===null||g[_][2]===void 0)&&(g[_][3]===null||g[_][3]===void 0))){if(v.allowInsertRow)for(;g[_][0]>o.countRows()-1;){const{delta:$}=a.createRow(void 0,void 0,{source:"auto"});if($===0){A=!0;break}}if(o.dataType==="array"&&(!v.columns||v.columns.length===0)&&v.allowInsertColumn)for(;a.propToCol(g[_][1])>o.countCols()-1;){const{delta:$}=a.createCol(void 0,void 0,{source:"auto"});if($===0){A=!0;break}}A||a.set(g[_][0],g[_][1],g[_][3])}}if(g.length>0){u.adjustRowsAndCols(),o.runHooks("beforeChangeRender",g,w),c.closeEditor(),o.render(),c.prepareEditor(),o.view.adjustElementsSize(),o.runHooks("afterChange",g,w||"edit");const _=o.getActiveEditor();_&&ce(_.refreshValue)&&_.refreshValue()}else o.render()}this._createCellCoords=function(g,w){return o.view._wt.createCellCoords(g,w)},this._createCellRange=function(g,w,p){return o.view._wt.createCellRange(g,w,p)},this.validateCell=function(g,w,p,_){let A=o.getCellValidator(w);function $(W){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||w.hidden===!0){p(W);return}const y=w.visualCol,R=w.visualRow,C=o.getCell(R,y,!0);if(C&&C.nodeName!=="TH"){const N=o.rowIndexMapper.getRenderableFromVisualIndex(R),O=o.columnIndexMapper.getRenderableFromVisualIndex(y);o.view._wt.getSetting("cellRenderer",N,O,C)}p(W)}fU(A)&&(A=(function(W){return function(z,y){y(W.test(z))}})(A)),rt(A)?(g=o.runHooks("beforeValidate",g,w.visualRow,w.prop,_),o._registerImmediate(()=>{A.call(w,g,W=>{o&&(W=o.runHooks("afterValidate",W,g,w.visualRow,w.prop,_),w.valid=W,$(W),o.runHooks("postAfterValidate",W,g,w.visualRow,w.prop,_))})})):o._registerImmediate(()=>{w.valid=!0,$(w.valid,!1)})};function pe(g,w,p){return Array.isArray(g)?g:[[g,w,p]]}function Ee(g,w){const p=o.runHooks("beforeChange",g,w||"edit"),_=g.filter($=>$!==null);if(p===!1||_.length===0){var A;return(A=o.getActiveEditor())===null||A===void 0||A.cancelChanges(),[]}for(let $=_.length-1;$>=0;$--){const[W,z,,y]=_[$],R=a.propToCol(z);let C;Number.isInteger(R)?C=o.getCellMeta(W,R):C={...Object.getPrototypeOf(v),...v};const{type:N,checkedTemplate:O,uncheckedTemplate:L}=C;if(N==="numeric"&&typeof y=="string"&&Xz(y)&&(_[$][3]=ne(y)),N==="checkbox"){const j=xt(y),k=j===xt(O),F=j===xt(L);(k||F)&&(_[$][3]=k?O:L)}}return _}this.setDataAtCell=function(g,w,p,_){const A=pe(g,w,p),$=[];let W=_,z,y,R;for(z=0,y=A.length;z<y;z++){if(typeof A[z]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof A[z][1]!="number")throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");A[z][1]>=this.countCols()?R=A[z][1]:R=a.colToProp(A[z][1]),$.push([A[z][0],R,l.getAtCell(this.toPhysicalRow(A[z][0]),A[z][1]),A[z][2]])}!W&&typeof g=="object"&&(W=w);const C=Ee($,W);o.runHooks("afterSetDataAtCell",C,W),se(C,W,()=>{ft(C,W)})},this.setDataAtRowProp=function(g,w,p,_){const A=pe(g,w,p),$=[];let W=_,z,y;for(z=0,y=A.length;z<y;z++)$.push([A[z][0],A[z][1],l.getAtCell(this.toPhysicalRow(A[z][0]),A[z][1]),A[z][2]]);!W&&typeof g=="object"&&(W=w);const R=Ee($,_);o.runHooks("afterSetDataAtRowProp",R,W),se(R,W,()=>{ft(R,W)})},this.listen=function(){o&&!o.isListening()&&(MT.forEach(g=>{o!==g&&g.unlisten()}),_T=o.guid,o.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(_T=null,o.runHooks("afterUnlisten"))},this.isListening=function(){return _T===o.guid},this.destroyEditor=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;c.closeEditor(g),o.view.render(),w&&Y.isSelected()&&c.prepareEditor()},this.populateFromArray=function(g,w,p,_,A,$,W){if(!(typeof p=="object"&&typeof p[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const z=typeof _=="number"?o._createCellCoords(_,A):null;return u.populateFromArray(o._createCellCoords(g,w),p,z,$,W)},this.spliceCol=function(g,w,p){for(var _=arguments.length,A=new Array(_>3?_-3:0),$=3;$<_;$++)A[$-3]=arguments[$];return a.spliceCol(g,w,p,...A)},this.spliceRow=function(g,w,p){for(var _=arguments.length,A=new Array(_>3?_-3:0),$=3;$<_;$++)A[$-3]=arguments[$];return a.spliceRow(g,w,p,...A)},this.getSelected=function(){if(Y.isSelected())return je(Y.getSelectedRange(),g=>{let{from:w,to:p}=g;return[w.row,w.col,p.row,p.col]})},this.getSelectedLast=function(){const g=this.getSelected();let w;return g&&g.length>0&&(w=g[g.length-1]),w},this.getSelectedRange=function(){if(Y.isSelected())return Array.from(Y.getSelectedRange())},this.getSelectedRangeLast=function(){const g=this.getSelectedRange();let w;return g&&g.length>0&&(w=g[g.length-1]),w},this.emptySelectedCells=function(g){if(!Y.isSelected()||this.countRows()===0||this.countCols()===0)return;const w=[];H(Y.getSelectedRange(),p=>{if(p.isSingleHeader())return;const _=p.getTopStartCorner(),A=p.getBottomEndCorner();fe(_.row,A.row,$=>{fe(_.col,A.col,W=>{this.getCellMeta($,W).readOnly||w.push([$,W,null])})})}),w.length>0&&this.setDataAtCell(w,g)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const g=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(g,0),!this.isRenderSuspended()&&g===this.renderSuspendedCounter&&o.view.render()},this.render=function(){this.view&&(this.forceFullRender=!0,this.isRenderSuspended()||o.view.render())},this.batchRender=function(g){this.suspendRender();const w=g();return this.resumeRender(),w},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const w=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(w,0),(!this.isExecutionSuspended()&&w===this.executionSuspendedCounter||g)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const p=g();return this.resumeExecution(w),p},this.batch=function(g){this.suspendRender(),this.suspendExecution();const w=g();return this.resumeExecution(),this.resumeRender(),w},this.refreshDimensions=function(){if(!o.view)return;const g=o.view,{width:w,height:p}=g.getLastSize(),{width:_,height:A}=o.rootElement.getBoundingClientRect(),$=_!==w||A!==p;o.runHooks("beforeRefreshDimensions",{width:w,height:p},{width:_,height:A},$)!==!1&&(($||g._wt.wtOverlays.scrollableElement===o.rootWindow)&&(g.setLastSize(_,A),o.render(),g.adjustElementsSize()),o.runHooks("afterRefreshDimensions",{width:w,height:p},{width:_,height:A},$))},this.updateData=function(g,w){h$(g,p=>{a=p},p=>{a=p,o.columnIndexMapper.fitToLength(this.getInitialColumnCount()),o.rowIndexMapper.fitToLength(this.countSourceRows()),u.adjustRowsAndCols(),Y.refresh()},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"updateData",source:w,metaManager:E,firstRun:f})},this.loadData=function(g,w){h$(g,p=>{a=p},()=>{E.clearCellsCache(),o.initIndexMappers(),u.adjustRowsAndCols(),Y.refresh(),f&&(f=[null,"loadData"])},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"loadData",source:w,metaManager:E,firstRun:f})},this.getInitialColumnCount=function(){const g=v.columns;let w=0;if(Array.isArray(g))w=g.length;else if(rt(g))if(o.dataType==="array"){const p=this.countSourceCols();for(let _=0;_<p;_+=1)g(_)&&(w+=1)}else(o.dataType==="object"||o.dataType==="function")&&(w=a.colToPropCache.length);else if(ce(v.dataSchema)){const p=a.getSchema();w=Array.isArray(p)?p.length:iy(p)}else w=this.countSourceCols();return w},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(g,w,p,_){return At(g)?a.getAll():a.getRange(o._createCellCoords(g,w),o._createCellCoords(p,_),a.DESTINATION_RENDERER)},this.getCopyableText=function(g,w,p,_){return a.getCopyableText(o._createCellCoords(g,w),o._createCellCoords(p,_))},this.getCopyableData=function(g,w){return a.getCopyable(g,a.colToProp(w))},this.getSchema=function(){return a.getSchema()},this.updateSettings=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const p=(f?o.loadData:o.updateData).bind(this);let _=!1,A,$;if(ce(g.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(ce(g.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(ce(g.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');g.language&&J(g.language);for(A in g)if(!(A==="data"||A==="language"))if(A==="className")ee("className",g.className);else if(A==="tableClassName"&&o.table)ee("tableClassName",g.tableClassName),o.view._wt.wtOverlays.syncOverlayTableClassNames();else if(re.getSingleton().isRegistered(A)||re.getSingleton().isDeprecated(A)){const C=g[A];rt(C)?(re.getSingleton().addAsFixed(A,C,o),v[A]=C):Array.isArray(C)&&(re.getSingleton().add(A,C,o),v[A]=C)}else!w&&on(g,A)&&(I[A]=g[A]);g.data===void 0&&v.data===void 0?p(null,"updateSettings"):g.data!==void 0?p(g.data,"updateSettings"):g.columns!==void 0&&(a.createMap(),o.initIndexMappers());const W=o.countCols(),z=v.columns;if(z&&rt(z)&&(_=!0),(g.cell!==void 0||g.cells!==void 0||g.columns!==void 0)&&E.clearCache(),W>0)for(A=0,$=0;A<W;A++){if(z){const C=_?z(A):z[$];C&&E.updateColumnMeta($,C)}$+=1}ce(g.cell)&&Ne(g.cell,C=>{o.setCellMetaObject(C.row,C.col,C)}),o.runHooks("afterCellMetaReset");let y=o.rootElement.style.height;y!==""&&(y=parseInt(o.rootElement.style.height,10));let R=g.height;if(rt(R)&&(R=R()),w&&o.rootElement.getAttribute("style")&&o.rootElement.setAttribute("data-initialstyle",o.rootElement.getAttribute("style")),R===null){const C=o.rootElement.getAttribute("data-initialstyle");C&&(C.indexOf("height")>-1||C.indexOf("overflow")>-1)?o.rootElement.setAttribute("style",C):(o.rootElement.style.height="",o.rootElement.style.overflow="")}else R!==void 0&&(o.rootElement.style.height=isNaN(R)?`${R}`:`${R}px`,o.rootElement.style.overflow="hidden");if(typeof g.width<"u"){let C=g.width;rt(C)&&(C=C()),o.rootElement.style.width=isNaN(C)?`${C}`:`${C}px`}if(!w){if(o.view){o.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),o.view._wt.exportSettingsAsClassNames();const C=o.getCurrentThemeName(),N=on(g,"themeName");C&&N&&C!==g.themeName&&(o.view.getStylesHandler().removeClassNames(),o.view.removeClassNameFromLicenseElement(C));const O=N&&g.themeName||C$(o.rootElement);o.useTheme(O),o.view.addClassNameToLicenseElement(o.getCurrentThemeName())}o.runHooks("afterUpdateSettings",g)}u.adjustRowsAndCols(),o.view&&!f&&(o.render(),o.view._wt.wtOverlays.adjustElementsSize()),!w&&o.view&&(y===""||R===""||R===void 0)&&y!==R&&o.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const g=o.getSelectedLast();if(v.getValue){if(rt(v.getValue))return v.getValue.call(o);if(g)return o.getData()[g[0][0]][v.getValue]}else if(g)return o.getDataAtCell(g[0],g[1])},this.getSettings=function(){return v},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(g,w,p,_,A){u.alter(g,w,p,_,A)},this.getCell=function(g,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,_=w,A=g;if(w>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(w)))return null;_=this.columnIndexMapper.getRenderableFromVisualIndex(w)}if(g>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(g)))return null;A=this.rowIndexMapper.getRenderableFromVisualIndex(g)}return A===null||_===null||A===void 0||_===void 0?null:o.view.getCellAtCoords(o._createCellCoords(A,_),p)},this.getCoords=function(g){const w=this.view._wt.wtTable.getCoords(g);if(w===null)return null;const{row:p,col:_}=w;let A=p,$=_;return p>=0&&(A=this.rowIndexMapper.getVisualFromRenderableIndex(p)),_>=0&&($=this.columnIndexMapper.getVisualFromRenderableIndex(_)),o._createCellCoords(A,$)},this.colToProp=function(g){return a.colToProp(g)},this.propToCol=function(g){return a.propToCol(g)},this.toVisualRow=g=>this.rowIndexMapper.getVisualFromPhysicalIndex(g),this.toVisualColumn=g=>this.columnIndexMapper.getVisualFromPhysicalIndex(g),this.toPhysicalRow=g=>this.rowIndexMapper.getPhysicalFromVisualIndex(g),this.toPhysicalColumn=g=>this.columnIndexMapper.getPhysicalFromVisualIndex(g),this.getDataAtCell=function(g,w){return a.get(g,a.colToProp(w))},this.getDataAtRowProp=function(g,w){return a.get(g,w)},this.getDataAtCol=function(g){const w=[],p=a.getRange(o._createCellCoords(0,g),o._createCellCoords(v.data.length-1,g),a.DESTINATION_RENDERER);for(let _=0;_<p.length;_+=1)for(let A=0;A<p[_].length;A+=1)w.push(p[_][A]);return w},this.getDataAtProp=function(g){const w=[],p=a.getRange(o._createCellCoords(0,a.propToCol(g)),o._createCellCoords(v.data.length-1,a.propToCol(g)),a.DESTINATION_RENDERER);for(let _=0;_<p.length;_+=1)for(let A=0;A<p[_].length;A+=1)w.push(p[_][A]);return w},this.getSourceData=function(g,w,p,_){let A;return g===void 0?A=l.getData():A=l.getByRange(o._createCellCoords(g,w),o._createCellCoords(p,_)),A},this.getSourceDataArray=function(g,w,p,_){let A;return g===void 0?A=l.getData(!0):A=l.getByRange(o._createCellCoords(g,w),o._createCellCoords(p,_),!0),A},this.getSourceDataAtCol=function(g){return l.getAtColumn(g)},this.setSourceDataAtCell=function(g,w,p,_){const A=pe(g,w,p),$=this.hasHook("afterSetSourceDataAtCell"),W=[];$&&H(A,y=>{let[R,C,N]=y;W.push([R,C,l.getAtCell(R,C),N])}),H(A,y=>{let[R,C,N]=y;l.setAtCell(R,C,N)}),$&&this.runHooks("afterSetSourceDataAtCell",W,_),this.render();const z=o.getActiveEditor();z&&ce(z.refreshValue)&&z.refreshValue()},this.getSourceDataAtRow=function(g){return l.getAtRow(g)},this.getSourceDataAtCell=function(g,w){return l.getAtCell(g,w)},this.getDataAtRow=function(g){return a.getRange(o._createCellCoords(g,0),o._createCellCoords(g,this.countCols()-1),a.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(g,w,p,_){const A=g===void 0?[0,0,this.countRows(),this.countCols()]:[g,w,p,_],[$,W]=A;let[,,z,y]=A,R=null,C=null;z===void 0&&(z=$),y===void 0&&(y=W);let N="mixed";return fe(Math.max(Math.min($,z),0),Math.max($,z),O=>{let L=!0;return fe(Math.max(Math.min(W,y),0),Math.max(W,y),j=>(C=this.getCellMeta(O,j).type,R?L=R===C:R=C,L)),N=L?C:"mixed",L}),N},this.removeCellMeta=function(g,w,p){const[_,A]=[this.toPhysicalRow(g),this.toPhysicalColumn(w)];let $=E.getCellMetaKeyValue(_,A,p);o.runHooks("beforeRemoveCellMeta",g,w,p,$)!==!1&&(E.removeCellMeta(_,A,p),o.runHooks("afterRemoveCellMeta",g,w,p,$)),$=null},this.spliceCellsMeta=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var p=arguments.length,_=new Array(p>2?p-2:0),A=2;A<p;A++)_[A-2]=arguments[A];if(_.length>0&&!Array.isArray(_[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");w>0&&E.removeRow(this.toPhysicalRow(g),w),_.length>0&&H(_.reverse(),$=>{E.createRow(this.toPhysicalRow(g)),H($,(W,z)=>this.setCellMetaObject(g,z,W))}),o.render()},this.setCellMetaObject=function(g,w,p){typeof p=="object"&&Ne(p,(_,A)=>{this.setCellMeta(g,w,A,_)})},this.setCellMeta=function(g,w,p,_){if(o.runHooks("beforeSetCellMeta",g,w,p,_)===!1)return;let $=g,W=w;g<this.countRows()&&($=this.toPhysicalRow(g)),w<this.countCols()&&(W=this.toPhysicalColumn(w)),E.setCellMeta($,W,p,_),o.runHooks("afterSetCellMeta",g,w,p,_)},this.getCellsMeta=function(){return E.getCellsMeta()},this.getCellMeta=function(g,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipMetaExtension:!1},_=this.toPhysicalRow(g),A=this.toPhysicalColumn(w);return _===null&&(_=g),A===null&&(A=w),E.getCellMeta(_,A,{visualRow:g,visualColumn:w,...p})},this.getColumnMeta=function(g){return E.getColumnMeta(this.toPhysicalColumn(g))},this.getCellMetaAtRow=function(g){return E.getCellsMetaAtRow(g)},this.isColumnModificationAllowed=function(){return!(o.dataType==="object"||v.columns)},this.getCellRenderer=function(g,w){const p=typeof g=="number"?o.getCellMeta(g,w).renderer:g.renderer;return typeof p=="string"?NS(p):At(p)?NS("text"):p},this.getCellEditor=function(g,w){const p=typeof g=="number"?o.getCellMeta(g,w).editor:g.editor;return typeof p=="string"?Ky(p):At(p)?Ky("text"):p},this.getCellValidator=function(g,w){const p=typeof g=="number"?o.getCellMeta(g,w).validator:g.validator;return typeof p=="string"?Oq(p):p},this.validateCells=function(g){this._validateCells(g)},this.validateRows=function(g,w){if(!Array.isArray(g))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(w,g)},this.validateColumns=function(g,w){if(!Array.isArray(g))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(w,void 0,g)},this._validateCells=function(g,w,p){const _=new ae;g&&(_.onQueueEmpty=g);let A=o.countRows()-1;for(;A>=0;){if(w!==void 0&&w.indexOf(A)===-1){A-=1;continue}let $=o.countCols()-1;for(;$>=0;){if(p!==void 0&&p.indexOf($)===-1){$-=1;continue}_.addValidatorToQueue(),o.validateCell(o.getDataAtCell(A,$),o.getCellMeta(A,$),W=>{if(typeof W!="boolean")throw new Error("Validation error: result is not boolean");W===!1&&(_.valid=!1),_.removeValidatorFormQueue()},"validateCells"),$-=1}A-=1}_.checkIfQueueIsEmpty()},this.getRowHeader=function(g){let w=v.rowHeaders,p=g;return p!==void 0&&(p=o.runHooks("modifyRowHeader",p)),p===void 0?(w=[],fe(o.countRows()-1,_=>{w.push(o.getRowHeader(_))})):Array.isArray(w)&&w[p]!==void 0?w=w[p]:rt(w)?w=w(p):w&&typeof w!="string"&&typeof w!="number"&&(w=p+1),w},this.hasRowHeaders=function(){return!!v.rowHeaders},this.hasColHeaders=function(){if(v.colHeaders!==void 0&&v.colHeaders!==null)return!!v.colHeaders;for(let g=0,w=o.countCols();g<w;g++)if(o.getColHeader(g))return!0;return!1},this.getColHeader=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const p=o.runHooks("modifyColHeader",g);if(p===void 0){const z=[],y=o.countCols();for(let R=0;R<y;R++)z.push(o.getColHeader(R));return z}let _=v.colHeaders;const A=function(z){const y=[],R=o.countCols();let C=0;for(;C<R;C++)rt(v.columns)&&v.columns(C)&&y.push(C);return y[z]},$=o.toPhysicalColumn(p),W=A($);return v.colHeaders===!1?_=null:v.columns&&rt(v.columns)&&v.columns(W)&&v.columns(W).title?_=v.columns(W).title:v.columns&&v.columns[$]&&v.columns[$].title?_=v.columns[$].title:Array.isArray(v.colHeaders)&&v.colHeaders[$]!==void 0?_=v.colHeaders[$]:rt(v.colHeaders)?_=v.colHeaders($):v.colHeaders&&typeof v.colHeaders!="string"&&typeof v.colHeaders!="number"&&(_=MQ(p)),_=o.runHooks("modifyColumnHeaderValue",_,g,w),_},this._getColWidthFromSettings=function(g){let w;if(g>=0&&(w=o.getCellMeta(0,g).width),(w===void 0||w===v.width)&&(w=v.colWidths),w!=null){switch(typeof w){case"object":w=w[g];break;case"function":w=w(g);break}typeof w=="string"&&(w=parseInt(w,10))}return w},this.getColWidth=function(g,w){let p=o._getColWidthFromSettings(g);return p=o.runHooks("modifyColWidth",p,g,w),p===void 0&&(p=ou),p},this._getRowHeightFromSettings=function(g){const w=this.view.getDefaultRowHeight();let p=v.rowHeights;if(p!=null){switch(typeof p){case"object":p=p[g];break;case"function":p=p(g);break}typeof p=="string"&&(p=parseInt(p,10))}return p!=null&&p<w?w:p},this.getRowHeight=function(g,w){let p=o._getRowHeightFromSettings(g);return p=o.runHooks("modifyRowHeight",p,g,w),p},this.countSourceRows=function(){return l.countRows()},this.countSourceCols=function(){return l.countFirstRowKeys()},this.countRows=function(){return a.getLength()},this.countCols=function(){const g=v.maxCols,w=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(g,w)},this.countRenderedRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=0;return Tx(o.countRows()-1,p=>{if(o.isEmptyRow(p))w+=1;else if(g===!0)return!1}),w},this.countEmptyCols=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=0;return Tx(o.countCols()-1,p=>{if(o.isEmptyCol(p))w+=1;else if(g===!0)return!1}),w},this.isEmptyRow=function(g){return v.isEmptyRow.call(o,g)},this.isEmptyCol=function(g){return v.isEmptyCol.call(o,g)},this.selectCell=function(g,w,p,_){let A=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,$=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return At(g)||At(w)?!1:this.selectCells([[g,w,p,_]],A,$)},this.selectCells=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;w===!1&&d.suspend();const _=Y.selectCells(g);return _&&p&&o.listen(),d.resume(),_},this.selectColumns=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,p=arguments.length>2?arguments[2]:void 0;return Y.selectColumns(g,w,p)},this.selectRows=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,p=arguments.length>2?arguments[2]:void 0;return Y.selectRows(g,w,p)},this.deselectCell=function(){Y.deselect()},this.selectAll=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,p=arguments.length>2?arguments[2]:void 0;d.skipNextScrollCycle(),Y.selectAll(g,w,p)};const gt=(g,w)=>g.getNearestNotHiddenIndex(w,1,!0);this.scrollViewportTo=function(g,w){if(typeof g=="number"){var p;g={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:(p=arguments[4])!==null&&p!==void 0?p:!0}}const{row:_,col:A,considerHiddenIndexes:$}=g??{};let W=_,z=A;if(rt(w)&&this.addHookOnce("afterScroll",w),$===void 0||$){const N=Number.isInteger(_)&&_>=0,O=Number.isInteger(A)&&A>=0,L=N?gt(this.rowIndexMapper,_):void 0,j=O?gt(this.columnIndexMapper,A):void 0;if(L===null||j===null)return!1;W=N?o.rowIndexMapper.getRenderableFromVisualIndex(L):_,z=O?o.columnIndexMapper.getRenderableFromVisualIndex(j):A}const y=Number.isInteger(W),R=Number.isInteger(z);let C=!1;return y&&W>=0&&R&&z>=0?C=o.view.scrollViewport(o._createCellCoords(W,z),g.horizontalSnap,g.verticalSnap):y&&W>=0&&(R&&z<0||!R)?C=o.view.scrollViewportVertically(W,g.verticalSnap):R&&z>=0&&(y&&W<0||!y)&&(C=o.view.scrollViewportHorizontally(z,g.horizontalSnap)),rt(w)&&(C?this.view.render():(this.removeHook("afterScroll",w),this._registerMicrotask(()=>w()))),C},this.scrollToFocusedCell=function(g){if(!this.selection.isSelected())return!1;rt(g)&&this.addHookOnce("afterScroll",g);const{highlight:w}=this.getSelectedRangeLast(),p=this.scrollViewportTo(w.toObject());return p?this.view.render():rt(g)&&(this.removeHook("afterScroll",g),this._registerMicrotask(()=>g())),p},this.destroy=function(){if(o._clearTimeouts(),o._clearImmediates(),o.view&&o.view.destroy(),l&&l.destroy(),l=null,this.getShortcutManager().destroy(),E.clearCache(),MT.delete(this.guid),xp(o)){const g=this.rootDocument.querySelector(".hot-display-license-info");g&&g.parentNode.removeChild(g)}No(o.rootElement),s.destroy(),c&&c.destroy(),o.batchExecution(()=>{o.rowIndexMapper.unregisterAll(),o.columnIndexMapper.unregisterAll(),M.getItems().forEach(g=>{let[,w]=g;w.destroy()}),M.clear(),o.runHooks("afterDestroy")},!0),re.getSingleton().destroy(o),Ne(o,(g,w,p)=>{rt(g)?p[w]=Wt(w):w!=="guid"&&(p[w]=null)}),o.isDestroyed=!0,a&&a.destroy(),a=null,u=null,Y=null,c=null,o=null};function Wt(g){return()=>{throw new Error(`The "${g}" method cannot be called because this Handsontable instance has been destroyed`)}}this.getActiveEditor=function(){return c.getActiveEditor()},this.getFirstRenderedVisibleRow=function(){return o.view.getFirstRenderedVisibleRow()},this.getLastRenderedVisibleRow=function(){return o.view.getLastRenderedVisibleRow()},this.getFirstRenderedVisibleColumn=function(){return o.view.getFirstRenderedVisibleColumn()},this.getLastRenderedVisibleColumn=function(){return o.view.getLastRenderedVisibleColumn()},this.getFirstFullyVisibleRow=function(){return o.view.getFirstFullyVisibleRow()},this.getLastFullyVisibleRow=function(){return o.view.getLastFullyVisibleRow()},this.getFirstFullyVisibleColumn=function(){return o.view.getFirstFullyVisibleColumn()},this.getLastFullyVisibleColumn=function(){return o.view.getLastFullyVisibleColumn()},this.getFirstPartiallyVisibleRow=function(){return o.view.getFirstPartiallyVisibleRow()},this.getLastPartiallyVisibleRow=function(){return o.view.getLastPartiallyVisibleRow()},this.getFirstPartiallyVisibleColumn=function(){return o.view.getFirstPartiallyVisibleColumn()},this.getLastPartiallyVisibleColumn=function(){return o.view.getLastPartiallyVisibleColumn()},this.getPlugin=function(g){return M.getItem(hi(g))},this.getPluginName=function(g){return g===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:M.getId(g)},this.getInstance=function(){return o},this.addHook=function(g,w,p){re.getSingleton().add(g,w,o,p)},this.hasHook=function(g){return re.getSingleton().has(g,o)||re.getSingleton().has(g)},this.addHookOnce=function(g,w,p){re.getSingleton().once(g,w,o,p)},this.removeHook=function(g,w){re.getSingleton().remove(g,w,o)},this.runHooks=function(g,w,p,_,A,$,W){return re.getSingleton().run(o,g,w,p,_,A,$,W)},this.getTranslatedPhrase=function(g,w){return o$(v.language,g,w)},this.toHTML=()=>bN(this),this.toTableElement=()=>{const g=this.rootDocument.createElement("div");return g.insertAdjacentHTML("afterbegin",bN(this)),g.firstElementChild},this.timeouts=[],this.useTheme=g=>{this.view.getStylesHandler().useTheme(g),this.runHooks("afterSetTheme",g,!!f)},this.getCurrentThemeName=()=>this.view.getStylesHandler().getThemeName(),this._registerTimeout=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=g;typeof p=="function"&&(p=setTimeout(p,w)),this.timeouts.push(p)},this._clearTimeouts=function(){H(this.timeouts,g=>{clearTimeout(g)})},this.immediates=[],this._registerImmediate=function(g){this.immediates.push(setImmediate(g))},this._clearImmediates=function(){H(this.immediates,g=>{clearImmediate(g)})},this._registerMicrotask=function(g){this.rootWindow.queueMicrotask(()=>{this.isDestroyed||g()})},this._getEditorManager=function(){return c};const q=nle({handleEvent(){return o.isListening()},beforeKeyDown:g=>this.runHooks("beforeKeyDown",g),afterKeyDown:g=>{this.isDestroyed||o.runHooks("afterDocumentKeyDown",g)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",g=>{g.ctrlKey===!1&&g.metaKey===!1&&q.releasePressedKeys()}),this.getShortcutManager=function(){return q},this.getFocusManager=function(){return h},jA().forEach(g=>{const w=BS(g);M.addItem(g,new w(this))}),qY(o),q.setActiveContextName("grid"),re.getSingleton().run(o,"construct")}wi($A),Le.editors={BaseEditor:Kl};function Le(t,e){const n=new y$(t,e||{},pT);return n.init(),n}Le.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new y$(t,e,pT)},Le.DefaultSettings=s$(),Le.hooks=re.getSingleton(),Le.CellCoords=Aa,Le.CellRange=Jc,Le.packageName="handsontable",Le.buildDate="24/04/2025 10:59:00",Le.version="15.3.0",Le.languages={dictionaryKeys:tae,getLanguageDictionary:i$,getLanguagesDictionaries:sae,registerLanguageDictionary:r$,getTranslatedPhrase:o$};function IT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function rle(t){if(Array.isArray(t))return IT(t)}function ile(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $d(t,e,n){return e=jp(e),hle(t,S$()?Reflect.construct(e,n||[],jp(t).constructor):e.apply(t,n))}function ac(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b$(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,E$(r.key),r)}}function lc(t,e,n){return e&&b$(t.prototype,e),n&&b$(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ole(t,e,n){return(e=E$(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jp(t){return jp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jp(t)}function Fd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&PT(t,e)}function S$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S$=function(){return!!t})()}function sle(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ale(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
85
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function lle(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?R$(Object(n),!0).forEach(function(r){ole(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):R$(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ule(t,e){if(t==null)return{};var n,r,i=cle(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function cle(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function hle(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ile(t)}function PT(t,e){return PT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},PT(t,e)}function dle(t){return rle(t)||sle(t)||gle(t)||ale()}function fle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function E$(t){var e=fle(t,"string");return typeof e=="symbol"?e:e+""}function Dr(t){"@babel/helpers - typeof";return Dr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dr(t)}function gle(t,e){if(t){if(typeof t=="string")return IT(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?IT(t,e):void 0}}var OT=null,mle="Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, which are not compatible with the component-based renderers`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.",ple="The Handsontable instance bound to this component was destroyed and cannot be used properly.",Up="global",wle="hot-wrapper-editor-container";function vle(){if(typeof console<"u"){var t;(t=console).warn.apply(t,arguments)}}function xT(t,e){var n=mt.Children.toArray(t),r=mt.Children.count(t),i=null;return r!==0&&(r===1&&n[0].props[e]?i=n[0]:i=n.find(function(o){return o.props[e]!==void 0})),i||null}function T$(t){return t?t.type.WrappedComponent?t.type.WrappedComponent:t.type:null}function _$(t,e){if(typeof t>"u"||e===null)return null;var n=I$(e.props,!1);return n.className="".concat(wle," ").concat(n.className),Wd.createPortal(mt.createElement("div",Object.assign({},n),e),t.body)}function M$(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Up,r=xT(t,"hot-editor"),i=T$(r);return r?mt.cloneElement(r,{emitEditorInstance:function(s,a){e.get(i)||e.set(i,new Map);var l=e.get(i);l.set(a??Up,s)},editorColumnScope:n,isEditor:!0}):null}function Cle(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;n||(n=document),OT||(OT=n.createDocumentFragment());var o=i??n.createElement("DIV");OT.appendChild(o);var s=mt.cloneElement(t,lle({key:"".concat(e.row,"-").concat(e.col)},e));return{portal:Wd.createPortal(s,o,r),portalContainer:o}}function I$(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return{id:t.id||(e?"hot-"+Math.random().toString(36).substring(5):void 0),className:t.className||"",style:t.style||{}}}function yle(){return typeof window<"u"}var P$=(function(){function t(){ac(this,t)}return lc(t,null,[{key:"getSettings",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.prevProps,o=i===void 0?{}:i,s=r.isInit,a=s===void 0?!1:s,l=r.initOnlySettingKeys,u=l===void 0?[]:l,c=function(S){return!a&&u.includes(S)?o[S]===n[S]:!1},h={};if(n.settings){var d=n.settings;for(var f in d)d.hasOwnProperty(f)&&!c(f)&&(h[f]=d[f])}for(var m in n)m!=="settings"&&m!=="children"&&!c(m)&&n.hasOwnProperty(m)&&(h[m]=n[m]);return h}}])})(),ble=(function(t){function e(){return ac(this,e),$d(this,e,arguments)}return Fd(e,t),lc(e,[{key:"getSettingsProps",value:function(){var r=this;return this.internalProps=["_componentRendererColumns","_emitColumnSettings","_columnIndex","_getChildElementByType","_getRendererWrapper","_getEditorClass","_getEditorCache","_getOwnerDocument","hot-renderer","hot-editor","children"],Object.keys(this.props).filter(function(i){return!r.internalProps.includes(i)}).reduce(function(i,o){return i[o]=r.props[o],i},{})}},{key:"getLocalEditorElement",value:function(){return M$(this.props.children,this.props._getEditorCache(),this.props._columnIndex)}},{key:"createColumnSettings",value:function(){var r=this.props._getChildElementByType(this.props.children,"hot-renderer"),i=this.getLocalEditorElement();this.columnSettings=P$.getSettings(this.getSettingsProps()),r!==null&&(this.columnSettings.renderer=this.props._getRendererWrapper(r),this.props._componentRendererColumns.set(this.props._columnIndex,!0)),i!==null&&(this.columnSettings.editor=this.props._getEditorClass(i,this.props._columnIndex))}},{key:"emitColumnSettings",value:function(){this.props._emitColumnSettings(this.columnSettings,this.props._columnIndex)}},{key:"componentDidMount",value:function(){this.createColumnSettings(),this.emitColumnSettings()}},{key:"componentDidUpdate",value:function(){this.createColumnSettings(),this.emitColumnSettings()}},{key:"render",value:function(){var r=this.props._getOwnerDocument(),i=_$(r,this.getLocalEditorElement());return mt.createElement(mt.Fragment,null,i)}}])})(mt.Component),Sle=(function(t){function e(){var n;return ac(this,e),n=$d(this,e,arguments),n.state={portals:[]},n}return Fd(e,t),lc(e,[{key:"render",value:function(){return mt.createElement(mt.Fragment,null,this.state.portals)}}])})(mt.Component),Rle="15.3.0";function Ele(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var AT={exports:{}},zp={exports:{}},at={},O$;function Tle(){if(O$)return at;O$=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,f=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,b=t?Symbol.for("react.block"):60121,S=t?Symbol.for("react.fundamental"):60117,E=t?Symbol.for("react.responder"):60118,v=t?Symbol.for("react.scope"):60119;function I(T){if(Dr(T)==="object"&&T!==null){var P=T.$$typeof;switch(P){case e:switch(T=T.type,T){case l:case u:case r:case o:case i:case h:return T;default:switch(T=T&&T.$$typeof,T){case a:case c:case m:case f:case s:return T;default:return P}}case n:return P}}}function M(T){return I(T)===u}return at.AsyncMode=l,at.ConcurrentMode=u,at.ContextConsumer=a,at.ContextProvider=s,at.Element=e,at.ForwardRef=c,at.Fragment=r,at.Lazy=m,at.Memo=f,at.Portal=n,at.Profiler=o,at.StrictMode=i,at.Suspense=h,at.isAsyncMode=function(T){return M(T)||I(T)===l},at.isConcurrentMode=M,at.isContextConsumer=function(T){return I(T)===a},at.isContextProvider=function(T){return I(T)===s},at.isElement=function(T){return Dr(T)==="object"&&T!==null&&T.$$typeof===e},at.isForwardRef=function(T){return I(T)===c},at.isFragment=function(T){return I(T)===r},at.isLazy=function(T){return I(T)===m},at.isMemo=function(T){return I(T)===f},at.isPortal=function(T){return I(T)===n},at.isProfiler=function(T){return I(T)===o},at.isStrictMode=function(T){return I(T)===i},at.isSuspense=function(T){return I(T)===h},at.isValidElementType=function(T){return typeof T=="string"||typeof T=="function"||T===r||T===u||T===o||T===i||T===h||T===d||Dr(T)==="object"&&T!==null&&(T.$$typeof===m||T.$$typeof===f||T.$$typeof===s||T.$$typeof===a||T.$$typeof===c||T.$$typeof===S||T.$$typeof===E||T.$$typeof===v||T.$$typeof===b)},at.typeOf=I,at}var lt={},x$;function _le(){return x$||(x$=1,process.env.NODE_ENV!=="production"&&(function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,f=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,b=t?Symbol.for("react.block"):60121,S=t?Symbol.for("react.fundamental"):60117,E=t?Symbol.for("react.responder"):60118,v=t?Symbol.for("react.scope"):60119;function I(C){return typeof C=="string"||typeof C=="function"||C===r||C===u||C===o||C===i||C===h||C===d||Dr(C)==="object"&&C!==null&&(C.$$typeof===m||C.$$typeof===f||C.$$typeof===s||C.$$typeof===a||C.$$typeof===c||C.$$typeof===S||C.$$typeof===E||C.$$typeof===v||C.$$typeof===b)}function M(C){if(Dr(C)==="object"&&C!==null){var N=C.$$typeof;switch(N){case e:var O=C.type;switch(O){case l:case u:case r:case o:case i:case h:return O;default:var L=O&&O.$$typeof;switch(L){case a:case c:case m:case f:case s:return L;default:return N}}case n:return N}}}var T=l,P=u,D=a,K=s,Y=e,U=c,J=r,ee=m,ae=f,ne=n,se=o,ft=i,pe=h,Ee=!1;function gt(C){return Ee||(Ee=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),Wt(C)||M(C)===l}function Wt(C){return M(C)===u}function q(C){return M(C)===a}function g(C){return M(C)===s}function w(C){return Dr(C)==="object"&&C!==null&&C.$$typeof===e}function p(C){return M(C)===c}function _(C){return M(C)===r}function A(C){return M(C)===m}function $(C){return M(C)===f}function W(C){return M(C)===n}function z(C){return M(C)===o}function y(C){return M(C)===i}function R(C){return M(C)===h}lt.AsyncMode=T,lt.ConcurrentMode=P,lt.ContextConsumer=D,lt.ContextProvider=K,lt.Element=Y,lt.ForwardRef=U,lt.Fragment=J,lt.Lazy=ee,lt.Memo=ae,lt.Portal=ne,lt.Profiler=se,lt.StrictMode=ft,lt.Suspense=pe,lt.isAsyncMode=gt,lt.isConcurrentMode=Wt,lt.isContextConsumer=q,lt.isContextProvider=g,lt.isElement=w,lt.isForwardRef=p,lt.isFragment=_,lt.isLazy=A,lt.isMemo=$,lt.isPortal=W,lt.isProfiler=z,lt.isStrictMode=y,lt.isSuspense=R,lt.isValidElementType=I,lt.typeOf=M})()),lt}var A$;function H$(){return A$||(A$=1,process.env.NODE_ENV==="production"?zp.exports=Tle():zp.exports=_le()),zp.exports}var HT,N$;function Mle(){if(N$)return HT;N$=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(c){return s[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return HT=i()?Object.assign:function(o,s){for(var a,l=r(o),u,c=1;c<arguments.length;c++){a=Object(arguments[c]);for(var h in a)e.call(a,h)&&(l[h]=a[h]);if(t){u=t(a);for(var d=0;d<u.length;d++)n.call(a,u[d])&&(l[u[d]]=a[u[d]])}}return l},HT}var NT,D$;function DT(){if(D$)return NT;D$=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return NT=t,NT}var kT,k$;function L$(){return k$||(k$=1,kT=Function.call.bind(Object.prototype.hasOwnProperty)),kT}var LT,$$;function Ile(){if($$)return LT;$$=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=DT(),n={},r=L$();t=function(s){var a="Warning: "+s;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(o,s,a,l,u){if(process.env.NODE_ENV!=="production"){for(var c in o)if(r(o,c)){var h;try{if(typeof o[c]!="function"){var d=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Dr(o[c])+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}h=o[c](s,c,l,a,null,e)}catch(m){h=m}if(h&&!(h instanceof Error)&&t((l||"React class")+": type specification of "+a+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+Dr(h)+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in n)){n[h.message]=!0;var f=u?u():"";t("Failed "+a+" type: "+h.message+(f??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},LT=i,LT}var $T,F$;function Ple(){if(F$)return $T;F$=1;var t=H$(),e=Mle(),n=DT(),r=L$(),i=Ile(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(l){var u="Warning: "+l;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function s(){return null}return $T=function(l,u){var c=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function d(q){var g=q&&(c&&q[c]||q[h]);if(typeof g=="function")return g}var f="<<anonymous>>",m={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:I(),arrayOf:M,element:T(),elementType:P(),instanceOf:D,node:J(),objectOf:Y,oneOf:K,oneOfType:U,shape:ae,exact:ne};function b(q,g){return q===g?q!==0||1/q===1/g:q!==q&&g!==g}function S(q,g){this.message=q,this.data=g&&Dr(g)==="object"?g:{},this.stack=""}S.prototype=Error.prototype;function E(q){if(process.env.NODE_ENV!=="production")var g={},w=0;function p(A,$,W,z,y,R,C){if(z=z||f,R=R||W,C!==n){if(u){var N=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw N.name="Invariant Violation",N}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var O=z+":"+W;!g[O]&&w<3&&(o("You are manually calling a React.PropTypes validation function for the `"+R+"` prop on `"+z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),g[O]=!0,w++)}}return $[W]==null?A?$[W]===null?new S("The "+y+" `"+R+"` is marked as required "+("in `"+z+"`, but its value is `null`.")):new S("The "+y+" `"+R+"` is marked as required in "+("`"+z+"`, but its value is `undefined`.")):null:q($,W,z,y,R)}var _=p.bind(null,!1);return _.isRequired=p.bind(null,!0),_}function v(q){function g(w,p,_,A,$,W){var z=w[p],y=pe(z);if(y!==q){var R=Ee(z);return new S("Invalid "+A+" `"+$+"` of type "+("`"+R+"` supplied to `"+_+"`, expected ")+("`"+q+"`."),{expectedType:q})}return null}return E(g)}function I(){return E(s)}function M(q){function g(w,p,_,A,$){if(typeof q!="function")return new S("Property `"+$+"` of component `"+_+"` has invalid PropType notation inside arrayOf.");var W=w[p];if(!Array.isArray(W)){var z=pe(W);return new S("Invalid "+A+" `"+$+"` of type "+("`"+z+"` supplied to `"+_+"`, expected an array."))}for(var y=0;y<W.length;y++){var R=q(W,y,_,A,$+"["+y+"]",n);if(R instanceof Error)return R}return null}return E(g)}function T(){function q(g,w,p,_,A){var $=g[w];if(!l($)){var W=pe($);return new S("Invalid "+_+" `"+A+"` of type "+("`"+W+"` supplied to `"+p+"`, expected a single ReactElement."))}return null}return E(q)}function P(){function q(g,w,p,_,A){var $=g[w];if(!t.isValidElementType($)){var W=pe($);return new S("Invalid "+_+" `"+A+"` of type "+("`"+W+"` supplied to `"+p+"`, expected a single ReactElement type."))}return null}return E(q)}function D(q){function g(w,p,_,A,$){if(!(w[p]instanceof q)){var W=q.name||f,z=Wt(w[p]);return new S("Invalid "+A+" `"+$+"` of type "+("`"+z+"` supplied to `"+_+"`, expected ")+("instance of `"+W+"`."))}return null}return E(g)}function K(q){if(!Array.isArray(q))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function g(w,p,_,A,$){for(var W=w[p],z=0;z<q.length;z++)if(b(W,q[z]))return null;var y=JSON.stringify(q,function(C,N){var O=Ee(N);return O==="symbol"?String(N):N});return new S("Invalid "+A+" `"+$+"` of value `"+String(W)+"` "+("supplied to `"+_+"`, expected one of "+y+"."))}return E(g)}function Y(q){function g(w,p,_,A,$){if(typeof q!="function")return new S("Property `"+$+"` of component `"+_+"` has invalid PropType notation inside objectOf.");var W=w[p],z=pe(W);if(z!=="object")return new S("Invalid "+A+" `"+$+"` of type "+("`"+z+"` supplied to `"+_+"`, expected an object."));for(var y in W)if(r(W,y)){var R=q(W,y,_,A,$+"."+y,n);if(R instanceof Error)return R}return null}return E(g)}function U(q){if(!Array.isArray(q))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var g=0;g<q.length;g++){var w=q[g];if(typeof w!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+gt(w)+" at index "+g+"."),s}function p(_,A,$,W,z){for(var y=[],R=0;R<q.length;R++){var C=q[R],N=C(_,A,$,W,z,n);if(N==null)return null;N.data&&r(N.data,"expectedType")&&y.push(N.data.expectedType)}var O=y.length>0?", expected one of type ["+y.join(", ")+"]":"";return new S("Invalid "+W+" `"+z+"` supplied to "+("`"+$+"`"+O+"."))}return E(p)}function J(){function q(g,w,p,_,A){return se(g[w])?null:new S("Invalid "+_+" `"+A+"` supplied to "+("`"+p+"`, expected a ReactNode."))}return E(q)}function ee(q,g,w,p,_){return new S((q||"React class")+": "+g+" type `"+w+"."+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+_+"`.")}function ae(q){function g(w,p,_,A,$){var W=w[p],z=pe(W);if(z!=="object")return new S("Invalid "+A+" `"+$+"` of type `"+z+"` "+("supplied to `"+_+"`, expected `object`."));for(var y in q){var R=q[y];if(typeof R!="function")return ee(_,A,$,y,Ee(R));var C=R(W,y,_,A,$+"."+y,n);if(C)return C}return null}return E(g)}function ne(q){function g(w,p,_,A,$){var W=w[p],z=pe(W);if(z!=="object")return new S("Invalid "+A+" `"+$+"` of type `"+z+"` "+("supplied to `"+_+"`, expected `object`."));var y=e({},w[p],q);for(var R in y){var C=q[R];if(r(q,R)&&typeof C!="function")return ee(_,A,$,R,Ee(C));if(!C)return new S("Invalid "+A+" `"+$+"` key `"+R+"` supplied to `"+_+"`.\nBad object: "+JSON.stringify(w[p],null," ")+`
86
- Valid keys: `+JSON.stringify(Object.keys(q),null," "));var N=C(W,R,_,A,$+"."+R,n);if(N)return N}return null}return E(g)}function se(q){switch(Dr(q)){case"number":case"string":case"undefined":return!0;case"boolean":return!q;case"object":if(Array.isArray(q))return q.every(se);if(q===null||l(q))return!0;var g=d(q);if(g){var w=g.call(q),p;if(g!==q.entries){for(;!(p=w.next()).done;)if(!se(p.value))return!1}else for(;!(p=w.next()).done;){var _=p.value;if(_&&!se(_[1]))return!1}}else return!1;return!0;default:return!1}}function ft(q,g){return q==="symbol"?!0:g?g["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&g instanceof Symbol:!1}function pe(q){var g=Dr(q);return Array.isArray(q)?"array":q instanceof RegExp?"object":ft(g,q)?"symbol":g}function Ee(q){if(typeof q>"u"||q===null)return""+q;var g=pe(q);if(g==="object"){if(q instanceof Date)return"date";if(q instanceof RegExp)return"regexp"}return g}function gt(q){var g=Ee(q);switch(g){case"array":case"object":return"an "+g;case"boolean":case"date":case"regexp":return"a "+g;default:return g}}function Wt(q){return!q.constructor||!q.constructor.name?f:q.constructor.name}return m.checkPropTypes=i,m.resetWarningCache=i.resetWarningCache,m.PropTypes=m,m},$T}var FT,V$;function Ole(){if(V$)return FT;V$=1;var t=DT();function e(){}function n(){}return n.resetWarningCache=e,FT=function(){function i(a,l,u,c,h,d){if(d!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}i.isRequired=i;function o(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:e};return s.PropTypes=s,s},FT}if(process.env.NODE_ENV!=="production"){var xle=H$(),Ale=!0;AT.exports=Ple()(xle.isElement,Ale)}else AT.exports=Ole()();var Hle=AT.exports,VT=Ele(Hle),WT=(function(t){function e(){var n;return ac(this,e),n=$d(this,e,arguments),n.id=null,n.__hotInstance=null,n.hotElementRef=null,n.columnSettings=[],n.renderersPortalManager=null,n.portalCache=new Map,n.portalContainerCache=new Map,n.renderedCellCache=new Map,n.editorCache=new Map,n.componentRendererColumns=new Map,n}return Fd(e,t),lc(e,[{key:"hotInstance",get:function(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn(ple),null)},set:function(r){this.__hotInstance=r}},{key:"_isHotInstanceDestroyed",value:function(){return this.__hotInstance&&this.__hotInstance.isDestroyed}},{key:"getPortalContainerCache",value:function(){return this.portalContainerCache}},{key:"getRenderedCellCache",value:function(){return this.renderedCellCache}},{key:"getEditorCache",value:function(){return this.editorCache}},{key:"clearCache",value:function(){this.getRenderedCellCache().clear(),this.componentRendererColumns.clear()}},{key:"getOwnerDocument",value:function(){return yle()?this.hotElementRef?this.hotElementRef.ownerDocument:document:null}},{key:"setHotElementRef",value:function(r){this.hotElementRef=r}},{key:"getRendererWrapper",value:function(r){var i=this;return function(s,a,l,u,c,h,d){var f=i.getRenderedCellCache(),m=i.getPortalContainerCache(),b="".concat(l,"-").concat(u),S=s.guid,E="".concat(S,"-").concat(b),v="".concat(b,"-").concat(S);if(f.has(b)&&(a.innerHTML=f.get(b).innerHTML),a&&!a.getAttribute("ghost-table")){for(var I=i.portalCache.get(v),M=m.get(E);a.firstChild;)a.removeChild(a.firstChild);if(I&&M)a.appendChild(M);else{var T=Cle(r,{TD:a,row:l,col:u,prop:c,value:h,cellProperties:d,isRenderer:!0},a.ownerDocument,v,M),P=T.portal,D=T.portalContainer;m.set(E,D),a.appendChild(D),i.portalCache.set(v,P)}}return f.set(b,a),a}}},{key:"getEditorClass",value:function(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Up,s=T$(r),a=(i=this.getEditorCache().get(s))===null||i===void 0?void 0:i.get(o);return this.makeEditorClass(a)}},{key:"makeEditorClass",value:function(r){var i=(function(o){function s(a){var l;return ac(this,s),l=$d(this,s,[a]),r.hotCustomEditorInstance=l,l.editorComponent=r,l}return Fd(s,o),lc(s,[{key:"focus",value:function(){}},{key:"getValue",value:function(){}},{key:"setValue",value:function(){}},{key:"open",value:function(){}},{key:"close",value:function(){}}])})(Le.editors.BaseEditor);return Object.getOwnPropertyNames(Le.editors.BaseEditor.prototype).forEach(function(o){o!=="constructor"&&(i.prototype[o]=function(){for(var s,a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return(s=r[o]).call.apply(s,[r].concat(l))})}),i}},{key:"getGlobalRendererElement",value:function(){return xT(this.props.children,"hot-renderer")}},{key:"getGlobalEditorElement",value:function(){return M$(this.props.children,this.getEditorCache())}},{key:"createNewGlobalSettings",value:function(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this._isHotInstanceDestroyed()?[]:((r=this.hotInstance)===null||r===void 0||(r=r.getSettings())===null||r===void 0?void 0:r._initOnlySettings)||[],a=P$.getSettings(this.props,{prevProps:o,isInit:i,initOnlySettingKeys:s}),l=this.getGlobalRendererElement(),u=this.getGlobalEditorElement();if(a.columns=this.columnSettings.length?this.columnSettings:a.columns,u)a.editor=this.getEditorClass(u,Up);else{var c;this.props.editor||(c=this.props.settings)!==null&&c!==void 0&&c.editor?a.editor=this.props.editor||this.props.settings.editor:a.editor=Ky("text")}if(l)a.renderer=this.getRendererWrapper(l),this.componentRendererColumns.set("global",!0);else{var h;this.props.renderer||(h=this.props.settings)!==null&&h!==void 0&&h.renderer?a.renderer=this.props.renderer||this.props.settings.renderer:a.renderer=NS("text")}return a}},{key:"displayAutoSizeWarning",value:function(r){var i,o;this.hotInstance&&((i=this.hotInstance.getPlugin("autoRowSize"))!==null&&i!==void 0&&i.enabled||(o=this.hotInstance.getPlugin("autoColumnSize"))!==null&&o!==void 0&&o.enabled)&&this.componentRendererColumns.size>0&&vle(mle)}},{key:"setHotColumnSettings",value:function(r,i){this.columnSettings[i]=r}},{key:"handsontableBeforeViewRender",value:function(){this.portalCache.clear(),this.getRenderedCellCache().clear()}},{key:"handsontableAfterViewRender",value:function(){this.renderersPortalManager.setState({portals:dle(this.portalCache.values())})}},{key:"updateHot",value:function(r){this.hotInstance&&this.hotInstance.updateSettings(r,!1)}},{key:"setRenderersPortalManagerRef",value:function(r){this.renderersPortalManager=r}},{key:"componentDidMount",value:function(){var r=this,i=this.createNewGlobalSettings(!0);this.hotInstance=new Le.Core(this.hotElementRef,i),this.hotInstance.addHook("beforeViewRender",function(){return r.handsontableBeforeViewRender()}),this.hotInstance.addHook("afterViewRender",function(){return r.handsontableAfterViewRender()}),this.hotInstance.init(),this.displayAutoSizeWarning(i)}},{key:"componentDidUpdate",value:function(r){this.clearCache();var i=this.createNewGlobalSettings(!1,r);this.updateHot(i),this.displayAutoSizeWarning(i)}},{key:"componentWillUnmount",value:function(){this.clearCache(),this.hotInstance&&this.hotInstance.destroy()}},{key:"render",value:function(){var r=this,i=function(c){return c.type===ble},o=mt.Children.toArray(this.props.children),s=o.filter(function(u){return i(u)}).map(function(u,c){return mt.cloneElement(u,{_componentRendererColumns:r.componentRendererColumns,_emitColumnSettings:r.setHotColumnSettings.bind(r),_columnIndex:c,_getChildElementByType:xT.bind(r),_getRendererWrapper:r.getRendererWrapper.bind(r),_getEditorClass:r.getEditorClass.bind(r),_getOwnerDocument:r.getOwnerDocument.bind(r),_getEditorCache:r.getEditorCache.bind(r),children:u.props.children})}),a=I$(this.props),l=_$(this.getOwnerDocument(),this.getGlobalEditorElement());return mt.createElement(mt.Fragment,null,mt.createElement("div",Object.assign({ref:this.setHotElementRef.bind(this)},a),s),mt.createElement(Sle,{ref:this.setRenderersPortalManagerRef.bind(this)}),l)}}],[{key:"version",get:function(){return Rle}}])})(mt.Component);WT.propTypes={style:VT.object,id:VT.string,className:VT.string};var Nle=["children"],W$=mt.forwardRef(function(t,e){var n,r=t.children,i=ule(t,Nle),o=typeof mt.useId=="function"?mt.useId():void 0,s=(n=i.id)!==null&&n!==void 0?n:o;return mt.createElement(WT,Object.assign({id:s},i,{ref:e}),r)});W$.version=WT.version,mt.Component,Sse();const B$="wds-editable-table__required-indicator",j$=ms.forwardRef(({autoWrapCol:t=!0,autoWrapRow:e=!0,afterRender:n,beforeContextMenuShow:r,requiredColumns:i=[],...o},s)=>{const a=ms.useRef(null),l=s??a;return ms.createElement("div",{onKeyDown:u=>{if(u.key==="Escape"){const c=l.current?.hotInstance?.getActiveEditor();c&&c.isOpened()&&(u.stopPropagation(),c.close(),c.finishEditing(!0))}}},ms.createElement(W$,{ref:l,height:"auto",className:"wds-editable-table",autoWrapRow:e,autoWrapCol:t,beforeContextMenuShow:u=>{u.menu?.container.classList.add("wds-editable-table"),r&&r(u)},afterRender:u=>{l.current?.hotElementRef.querySelectorAll(".htAutocomplete:not(.htDimmed)").forEach(c=>{const h=c.querySelector(".htAutocompleteArrow");h&&Wd.render(ms.createElement(GT.Icon,{icon:"chevron-down",size:"xs",color:"grey-medium"}),h)}),n&&n(u)},afterGetColHeader:(u,c)=>{if(i.includes(u)&&!c.querySelector(`.${B$}`)){const h=document.createElement("span");c.insertBefore(h,c.firstChild),Wd.render(ms.createElement(GT.Icon,{icon:"asterisk",size:"xs",color:"red-medium","aria-label":"Required",className:B$}),h)}},licenseKey:"c0365-d23e1-f7d91-a482d-2be12",...o}))}),Dle={"Editable Tables":{components:[j$],description:()=>ms.createElement(ms.Fragment,null),examples:{}}};ki.EditableTable=j$,ki.MANIFEST=Dle,Object.defineProperty(ki,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("@sps-woodland/core/editable-table"),require("react")):typeof define=="function"&&define.amd?define(["exports","@sps-woodland/core/editable-table","react"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.EditableTable={},e.editableTable,e.React))})(this,(function(e,n,l){"use strict";function c(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(o,a,i.get?i:{enumerable:!0,get:()=>t[a]})}}return o.default=t,Object.freeze(o)}const r=c(l),d={"Editable Tables":{components:[n.EditableTable],description:()=>r.createElement(r.Fragment,null),examples:{}}};e.MANIFEST=d,Object.keys(n).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:()=>n[t]})}),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));