@sps-woodland/editable-table 8.53.4 → 8.53.6
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/README.md +18 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +9 -59541
- package/lib/index.umd.cjs +1 -87
- package/lib/style.css +1 -1
- package/package.json +11 -15
- package/vite.config.mjs +5 -31
- package/lib/EditableTable.d.ts +0 -5
package/lib/index.umd.cjs
CHANGED
|
@@ -1,87 +1 @@
|
|
|
1
|
-
(function(Wi,wt){typeof exports=="object"&&typeof module<"u"?wt(exports,require("react"),require("react-dom"),require("@sps-woodland/core")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@sps-woodland/core"],wt):(Wi=typeof globalThis<"u"?globalThis:Wi||self,wt(Wi.EditableTable={},Wi.React,Wi.ReactDOM,Wi.core))})(this,(function(Wi,wt,Xd,c_){"use strict";function EF(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 Cs=EF(wt);var h_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d_={},bc,f_;function gn(){if(f_)return bc;f_=1;var t=function(e){return e&&e.Math===Math&&e};return bc=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof h_=="object"&&h_)||t(typeof bc=="object"&&bc)||(function(){return this})()||Function("return this")(),bc}var sw={},aw,g_;function Tn(){return g_||(g_=1,aw=function(t){try{return!!t()}catch{return!0}}),aw}var lw,m_;function Wr(){if(m_)return lw;m_=1;var t=Tn();return lw=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),lw}var uw,p_;function Zd(){if(p_)return uw;p_=1;var t=Tn();return uw=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),uw}var cw,w_;function An(){if(w_)return cw;w_=1;var t=Zd(),e=Function.prototype.call;return cw=t?e.bind(e):function(){return e.apply(e,arguments)},cw}var hw={},v_;function TF(){if(v_)return hw;v_=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);return hw.f=n?function(i){var o=e(this,i);return!!o&&o.enumerable}:t,hw}var dw,C_;function Qd(){return C_||(C_=1,dw=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),dw}var fw,y_;function Jt(){if(y_)return fw;y_=1;var t=Zd(),e=Function.prototype,n=e.call,r=t&&e.bind.bind(n,n);return fw=t?r:function(i){return function(){return n.apply(i,arguments)}},fw}var gw,b_;function da(){if(b_)return gw;b_=1;var t=Jt(),e=t({}.toString),n=t("".slice);return gw=function(r){return n(e(r),8,-1)},gw}var mw,S_;function _F(){if(S_)return mw;S_=1;var t=Jt(),e=Tn(),n=da(),r=Object,i=t("".split);return mw=e(function(){return!r("z").propertyIsEnumerable(0)})?function(o){return n(o)==="String"?i(o,""):r(o)}:r,mw}var pw,R_;function Jd(){return R_||(R_=1,pw=function(t){return t==null}),pw}var ww,E_;function Sc(){if(E_)return ww;E_=1;var t=Jd(),e=TypeError;return ww=function(n){if(t(n))throw new e("Can't call method on "+n);return n},ww}var vw,T_;function Rc(){if(T_)return vw;T_=1;var t=_F(),e=Sc();return vw=function(n){return t(e(n))},vw}var Cw,__;function on(){if(__)return Cw;__=1;var t=typeof document=="object"&&document.all;return Cw=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},Cw}var yw,M_;function ui(){if(M_)return yw;M_=1;var t=on();return yw=function(e){return typeof e=="object"?e!==null:t(e)},yw}var bw,I_;function Dl(){if(I_)return bw;I_=1;var t=gn(),e=on(),n=function(r){return e(r)?r:void 0};return bw=function(r,i){return arguments.length<2?n(t[r]):t[r]&&t[r][i]},bw}var Sw,P_;function Ec(){if(P_)return Sw;P_=1;var t=Jt();return Sw=t({}.isPrototypeOf),Sw}var Rw,O_;function ef(){if(O_)return Rw;O_=1;var t=gn(),e=t.navigator,n=e&&e.userAgent;return Rw=n?String(n):"",Rw}var Ew,x_;function MF(){if(x_)return Ew;x_=1;var t=gn(),e=ef(),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]))),Ew=a,Ew}var Tw,A_;function _w(){if(A_)return Tw;A_=1;var t=MF(),e=Tn(),n=gn(),r=n.String;return Tw=!!Object.getOwnPropertySymbols&&!e(function(){var i=Symbol("symbol detection");return!r(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&t&&t<41}),Tw}var Mw,H_;function N_(){if(H_)return Mw;H_=1;var t=_w();return Mw=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Mw}var Iw,D_;function Pw(){if(D_)return Iw;D_=1;var t=Dl(),e=on(),n=Ec(),r=N_(),i=Object;return Iw=r?function(o){return typeof o=="symbol"}:function(o){var s=t("Symbol");return e(s)&&n(s.prototype,i(o))},Iw}var Ow,k_;function tf(){if(k_)return Ow;k_=1;var t=String;return Ow=function(e){try{return t(e)}catch{return"Object"}},Ow}var xw,L_;function nr(){if(L_)return xw;L_=1;var t=on(),e=tf(),n=TypeError;return xw=function(r){if(t(r))return r;throw new n(e(r)+" is not a function")},xw}var Aw,$_;function Tc(){if($_)return Aw;$_=1;var t=nr(),e=Jd();return Aw=function(n,r){var i=n[r];return e(i)?void 0:t(i)},Aw}var Hw,F_;function IF(){if(F_)return Hw;F_=1;var t=An(),e=on(),n=ui(),r=TypeError;return Hw=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")},Hw}var Nw={exports:{}},Dw,V_;function ys(){return V_||(V_=1,Dw=!1),Dw}var kw,W_;function Lw(){if(W_)return kw;W_=1;var t=gn(),e=Object.defineProperty;return kw=function(n,r){try{e(t,n,{value:r,configurable:!0,writable:!0})}catch{t[n]=r}return r},kw}var B_;function $w(){if(B_)return Nw.exports;B_=1;var t=ys(),e=gn(),n=Lw(),r="__core-js_shared__",i=Nw.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"}),Nw.exports}var Fw,j_;function U_(){if(j_)return Fw;j_=1;var t=$w();return Fw=function(e,n){return t[e]||(t[e]=n||{})},Fw}var Vw,z_;function kl(){if(z_)return Vw;z_=1;var t=Sc(),e=Object;return Vw=function(n){return e(t(n))},Vw}var Ww,Y_;function Br(){if(Y_)return Ww;Y_=1;var t=Jt(),e=kl(),n=t({}.hasOwnProperty);return Ww=Object.hasOwn||function(i,o){return n(e(i),o)},Ww}var Bw,G_;function q_(){if(G_)return Bw;G_=1;var t=Jt(),e=0,n=Math.random(),r=t(1 .toString);return Bw=function(i){return"Symbol("+(i===void 0?"":i)+")_"+r(++e+n,36)},Bw}var jw,K_;function ci(){if(K_)return jw;K_=1;var t=gn(),e=U_(),n=Br(),r=q_(),i=_w(),o=N_(),s=t.Symbol,a=e("wks"),l=o?s.for||s:s&&s.withoutSetter||r;return jw=function(u){return n(a,u)||(a[u]=i&&n(s,u)?s[u]:l("Symbol."+u)),a[u]},jw}var Uw,X_;function PF(){if(X_)return Uw;X_=1;var t=An(),e=ui(),n=Pw(),r=Tc(),i=IF(),o=ci(),s=TypeError,a=o("toPrimitive");return Uw=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)},Uw}var zw,Z_;function Q_(){if(Z_)return zw;Z_=1;var t=PF(),e=Pw();return zw=function(n){var r=t(n,"string");return e(r)?r:r+""},zw}var Yw,J_;function Gw(){if(J_)return Yw;J_=1;var t=gn(),e=ui(),n=t.document,r=e(n)&&e(n.createElement);return Yw=function(i){return r?n.createElement(i):{}},Yw}var qw,eM;function tM(){if(eM)return qw;eM=1;var t=Wr(),e=Tn(),n=Gw();return qw=!t&&!e(function(){return Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a!==7}),qw}var nM;function rM(){if(nM)return sw;nM=1;var t=Wr(),e=An(),n=TF(),r=Qd(),i=Rc(),o=Q_(),s=Br(),a=tM(),l=Object.getOwnPropertyDescriptor;return sw.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])},sw}var Kw={},Xw,iM;function oM(){if(iM)return Xw;iM=1;var t=Wr(),e=Tn();return Xw=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Xw}var Zw,sM;function sn(){if(sM)return Zw;sM=1;var t=ui(),e=String,n=TypeError;return Zw=function(r){if(t(r))return r;throw new n(e(r)+" is not an object")},Zw}var aM;function bs(){if(aM)return Kw;aM=1;var t=Wr(),e=tM(),n=oM(),r=sn(),i=Q_(),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 S=a(d,f);S&&S[c]&&(d[f]=m.value,m={configurable:u in m?m[u]:S[u],enumerable:l in m?m[l]:S[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 Qw,lM;function Ll(){if(lM)return Qw;lM=1;var t=Wr(),e=bs(),n=Qd();return Qw=t?function(r,i,o){return e.f(r,i,n(1,o))}:function(r,i,o){return r[i]=o,r},Qw}var Jw={exports:{}},ev,uM;function OF(){if(uM)return ev;uM=1;var t=Wr(),e=Br(),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 ev={EXISTS:i,PROPER:o,CONFIGURABLE:s},ev}var tv,cM;function xF(){if(cM)return tv;cM=1;var t=Jt(),e=on(),n=$w(),r=t(Function.toString);return e(n.inspectSource)||(n.inspectSource=function(i){return r(i)}),tv=n.inspectSource,tv}var nv,hM;function AF(){if(hM)return nv;hM=1;var t=gn(),e=on(),n=t.WeakMap;return nv=e(n)&&/native code/.test(String(n)),nv}var rv,dM;function iv(){if(dM)return rv;dM=1;var t=U_(),e=q_(),n=t("keys");return rv=function(r){return n[r]||(n[r]=e(r))},rv}var ov,fM;function sv(){return fM||(fM=1,ov={}),ov}var av,gM;function mM(){if(gM)return av;gM=1;var t=AF(),e=gn(),n=ui(),r=Ll(),i=Br(),o=$w(),s=iv(),a=sv(),l="Object already initialized",u=e.TypeError,c=e.WeakMap,h,d,f,m=function(v){return f(v)?d(v):h(v,{})},S=function(v){return function(O){var P;if(!n(O)||(P=d(O)).type!==v)throw new u("Incompatible receiver, "+v+" required");return P}};if(t||o.state){var b=o.state||(o.state=new c);b.get=b.get,b.has=b.has,b.set=b.set,h=function(v,O){if(b.has(v))throw new u(l);return O.facade=v,b.set(v,O),O},d=function(v){return b.get(v)||{}},f=function(v){return b.has(v)}}else{var T=s("state");a[T]=!0,h=function(v,O){if(i(v,T))throw new u(l);return O.facade=v,r(v,T,O),O},d=function(v){return i(v,T)?v[T]:{}},f=function(v){return i(v,T)}}return av={set:h,get:d,has:f,enforce:m,getterFor:S},av}var pM;function wM(){if(pM)return Jw.exports;pM=1;var t=Jt(),e=Tn(),n=on(),r=Br(),i=Wr(),o=OF().CONFIGURABLE,s=xF(),a=mM(),l=a.enforce,u=a.get,c=String,h=Object.defineProperty,d=t("".slice),f=t("".replace),m=t([].join),S=i&&!e(function(){return h(function(){},"length",{value:8}).length!==8}),b=String(String).split("String"),T=Jw.exports=function(v,O,P){d(c(O),0,7)==="Symbol("&&(O="["+f(c(O),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),P&&P.getter&&(O="get "+O),P&&P.setter&&(O="set "+O),(!r(v,"name")||o&&v.name!==O)&&(i?h(v,"name",{value:O,configurable:!0}):v.name=O),S&&P&&r(P,"arity")&&v.length!==P.arity&&h(v,"length",{value:P.arity});try{P&&r(P,"constructor")&&P.constructor?i&&h(v,"prototype",{writable:!1}):v.prototype&&(v.prototype=void 0)}catch{}var _=l(v);return r(_,"source")||(_.source=m(b,typeof O=="string"?O:"")),v};return Function.prototype.toString=T(function(){return n(this)&&u(this).source||s(this)},"toString"),Jw.exports}var lv,vM;function uv(){if(vM)return lv;vM=1;var t=on(),e=bs(),n=wM(),r=Lw();return lv=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},lv}var cv={},hv,CM;function HF(){if(CM)return hv;CM=1;var t=Math.ceil,e=Math.floor;return hv=Math.trunc||function(r){var i=+r;return(i>0?e:t)(i)},hv}var dv,yM;function _c(){if(yM)return dv;yM=1;var t=HF();return dv=function(e){var n=+e;return n!==n||n===0?0:t(n)},dv}var fv,bM;function NF(){if(bM)return fv;bM=1;var t=_c(),e=Math.max,n=Math.min;return fv=function(r,i){var o=t(r);return o<0?e(o+i,0):n(o,i)},fv}var gv,SM;function DF(){if(SM)return gv;SM=1;var t=_c(),e=Math.min;return gv=function(n){var r=t(n);return r>0?e(r,9007199254740991):0},gv}var mv,RM;function $l(){if(RM)return mv;RM=1;var t=DF();return mv=function(e){return t(e.length)},mv}var pv,EM;function kF(){if(EM)return pv;EM=1;var t=Rc(),e=NF(),n=$l(),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 pv={includes:r(!0),indexOf:r(!1)},pv}var wv,TM;function _M(){if(TM)return wv;TM=1;var t=Jt(),e=Br(),n=Rc(),r=kF().indexOf,i=sv(),o=t([].push);return wv=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},wv}var vv,MM;function Cv(){return MM||(MM=1,vv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),vv}var IM;function LF(){if(IM)return cv;IM=1;var t=_M(),e=Cv(),n=e.concat("length","prototype");return cv.f=Object.getOwnPropertyNames||function(i){return t(i,n)},cv}var yv={},PM;function $F(){return PM||(PM=1,yv.f=Object.getOwnPropertySymbols),yv}var bv,OM;function FF(){if(OM)return bv;OM=1;var t=Dl(),e=Jt(),n=LF(),r=$F(),i=sn(),o=e([].concat);return bv=t("Reflect","ownKeys")||function(a){var l=n.f(i(a)),u=r.f;return u?o(l,u(a)):l},bv}var Sv,xM;function AM(){if(xM)return Sv;xM=1;var t=Br(),e=FF(),n=rM(),r=bs();return Sv=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))}},Sv}var Rv,HM;function VF(){if(HM)return Rv;HM=1;var t=Tn(),e=on(),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 Rv=r,Rv}var Ev,NM;function Ct(){if(NM)return Ev;NM=1;var t=gn(),e=rM().f,n=Ll(),r=uv(),i=Lw(),o=AM(),s=VF();return Ev=function(a,l){var u=a.target,c=a.global,h=a.stat,d,f,m,S,b,T;if(c?f=t:h?f=t[u]||i(u,{}):f=t[u]&&t[u].prototype,f)for(m in l){if(b=l[m],a.dontCallGetSet?(T=e(f,m),S=T&&T.value):S=f[m],d=s(c?m:u+(h?".":"#")+m,a.forced),!d&&S!==void 0){if(typeof b==typeof S)continue;o(b,S)}(a.sham||S&&S.sham)&&n(b,"sham",!0),r(f,m,b,a)}},Ev}var Tv,DM;function nf(){if(DM)return Tv;DM=1;var t=Zd(),e=Function.prototype,n=e.apply,r=e.call;return Tv=typeof Reflect=="object"&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),Tv}var _v,kM;function LM(){if(kM)return _v;kM=1;var t=Jt(),e=nr();return _v=function(n,r,i){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[i]))}catch{}},_v}var Mv,$M;function WF(){if($M)return Mv;$M=1;var t=ui();return Mv=function(e){return t(e)||e===null},Mv}var Iv,FM;function BF(){if(FM)return Iv;FM=1;var t=WF(),e=String,n=TypeError;return Iv=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")},Iv}var Pv,VM;function WM(){if(VM)return Pv;VM=1;var t=LM(),e=ui(),n=Sc(),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 Ov,BM;function jF(){if(BM)return Ov;BM=1;var t=bs().f;return Ov=function(e,n,r){r in e||t(e,r,{configurable:!0,get:function(){return n[r]},set:function(i){n[r]=i}})},Ov}var xv,jM;function UF(){if(jM)return xv;jM=1;var t=on(),e=ui(),n=WM();return xv=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},xv}var Av,UM;function zF(){if(UM)return Av;UM=1;var t=ci(),e=t("toStringTag"),n={};return n[e]="z",Av=String(n)==="[object z]",Av}var Hv,zM;function YM(){if(zM)return Hv;zM=1;var t=zF(),e=on(),n=da(),r=ci(),i=r("toStringTag"),o=Object,s=n((function(){return arguments})())==="Arguments",a=function(l,u){try{return l[u]}catch{}};return Hv=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},Hv}var Nv,GM;function rf(){if(GM)return Nv;GM=1;var t=YM(),e=String;return Nv=function(n){if(t(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(n)},Nv}var Dv,qM;function YF(){if(qM)return Dv;qM=1;var t=rf();return Dv=function(e,n){return e===void 0?arguments.length<2?"":n:t(e)},Dv}var kv,KM;function GF(){if(KM)return kv;KM=1;var t=ui(),e=Ll();return kv=function(n,r){t(r)&&"cause"in r&&e(n,"cause",r.cause)},kv}var Lv,XM;function qF(){if(XM)return Lv;XM=1;var t=Jt(),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 Lv=function(s,a){if(o&&typeof s=="string"&&!e.prepareStackTrace)for(;a--;)s=n(s,i,"");return s},Lv}var $v,ZM;function KF(){if(ZM)return $v;ZM=1;var t=Tn(),e=Qd();return $v=!t(function(){var n=new Error("a");return"stack"in n?(Object.defineProperty(n,"stack",e(1,7)),n.stack!==7):!0}),$v}var Fv,QM;function XF(){if(QM)return Fv;QM=1;var t=Ll(),e=qF(),n=KF(),r=Error.captureStackTrace;return Fv=function(i,o,s,a){n&&(r?r(i,o):t(i,"stack",e(s,a)))},Fv}var Vv,JM;function ZF(){if(JM)return Vv;JM=1;var t=Dl(),e=Br(),n=Ll(),r=Ec(),i=WM(),o=AM(),s=jF(),a=UF(),l=YF(),u=GF(),c=XF(),h=Wr(),d=ys();return Vv=function(f,m,S,b){var T="stackTraceLimit",v=b?2:1,O=f.split("."),P=O[O.length-1],_=t.apply(null,O);if(_){var M=_.prototype;if(!d&&e(M,"cause")&&delete M.cause,!S)return _;var H=t("Error"),X=m(function(G,U){var ne=l(b?U:G,void 0),ee=b?new _(G):new _;return ne!==void 0&&n(ee,"message",ne),c(ee,X,ee.stack,2),this&&r(M,this)&&a(ee,this,X),arguments.length>v&&u(ee,arguments[v]),ee});if(X.prototype=M,P!=="Error"?i?i(X,H):o(X,H,{name:!0}):h&&T in _&&(s(X,_,T),s(X,_,"prepareStackTrace")),o(X,_),!d)try{M.name!==P&&n(M,"name",P),M.constructor=X}catch{}return X}},Vv}var eI;function QF(){if(eI)return d_;eI=1;var t=Ct(),e=gn(),n=nf(),r=ZF(),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)}}),d_}QF();var tI={},Wv,nI;function rI(){if(nI)return Wv;nI=1;var t=da();return Wv=Array.isArray||function(n){return t(n)==="Array"},Wv}var Bv,iI;function oI(){if(iI)return Bv;iI=1;var t=Wr(),e=rI(),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 Bv=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},Bv}var jv,sI;function aI(){if(sI)return jv;sI=1;var t=TypeError,e=9007199254740991;return jv=function(n){if(n>e)throw t("Maximum allowed index exceeded");return n},jv}var lI;function JF(){if(lI)return tI;lI=1;var t=Ct(),e=kl(),n=$l(),r=oI(),i=aI(),o=Tn(),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}}),tI}JF();var uI={},cI={},Uv,hI;function eV(){if(hI)return Uv;hI=1;var t=Ec(),e=TypeError;return Uv=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")},Uv}var zv,dI;function tV(){if(dI)return zv;dI=1;var t=Tn();return zv=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),zv}var Yv,fI;function gI(){if(fI)return Yv;fI=1;var t=Br(),e=on(),n=kl(),r=iv(),i=tV(),o=r("IE_PROTO"),s=Object,a=s.prototype;return Yv=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},Yv}var Gv,mI;function nV(){if(mI)return Gv;mI=1;var t=wM(),e=bs();return Gv=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)},Gv}var qv,pI;function wI(){if(pI)return qv;pI=1;var t=Wr(),e=bs(),n=Qd();return qv=function(r,i,o){t?e.f(r,i,n(0,o)):r[i]=o},qv}var Kv={},Xv,vI;function rV(){if(vI)return Xv;vI=1;var t=_M(),e=Cv();return Xv=Object.keys||function(r){return t(r,e)},Xv}var CI;function iV(){if(CI)return Kv;CI=1;var t=Wr(),e=oM(),n=bs(),r=sn(),i=Rc(),o=rV();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 Zv,yI;function bI(){if(yI)return Zv;yI=1;var t=Dl();return Zv=t("document","documentElement"),Zv}var Qv,SI;function Jv(){if(SI)return Qv;SI=1;var t=sn(),e=iV(),n=Cv(),r=sv(),i=bI(),o=Gw(),s=iv(),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 O=v.parentWindow.Object;return v=null,O},S=function(){var v=o("iframe"),O="java"+c+":",P;return v.style.display="none",i.appendChild(v),v.src=String(O),P=v.contentWindow.document,P.open(),P.write(f("document.F=Object")),P.close(),P.F},b,T=function(){try{b=new ActiveXObject("htmlfile")}catch{}T=typeof document<"u"?document.domain&&b?m(b):S():m(b);for(var v=n.length;v--;)delete T[u][n[v]];return T()};return r[h]=!0,Qv=Object.create||function(O,P){var _;return O!==null?(d[u]=t(O),_=new d,d[u]=null,_[h]=O):_=T(),P===void 0?_:e.f(_,P)},Qv}var eC,RI;function EI(){if(RI)return eC;RI=1;var t=Tn(),e=on(),n=ui(),r=Jv(),i=gI(),o=uv(),s=ci(),a=ys(),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}),eC={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:u},eC}var TI;function oV(){if(TI)return cI;TI=1;var t=Ct(),e=gn(),n=eV(),r=sn(),i=on(),o=gI(),s=nV(),a=wI(),l=Tn(),u=Br(),c=ci(),h=EI().IteratorPrototype,d=Wr(),f=ys(),m="constructor",S="Iterator",b=c("toStringTag"),T=TypeError,v=e[S],O=f||!i(v)||v.prototype!==h||!l(function(){v({})}),P=function(){if(n(this,h),o(this)===h)throw new T("Abstract class Iterator not directly constructable")},_=function(M,H){d?s(h,M,{configurable:!0,get:function(){return H},set:function(X){if(r(this),this===h)throw new T("You can't redefine this property");u(this,M)?this[M]=X:a(this,M,X)}}):h[M]=H};return u(h,b)||_(b,S),(O||!u(h,m)||h[m]===Object)&&_(m,P),P.prototype=h,t({global:!0,constructor:!0,forced:O},{Iterator:P}),cI}var _I;function sV(){return _I||(_I=1,oV()),uI}sV();var MI={},II={},tC,PI;function Bi(){return PI||(PI=1,tC=function(t){return{iterator:t,next:t.next,done:!1}}),tC}var nC,OI;function aV(){if(OI)return nC;OI=1;var t=uv();return nC=function(e,n,r){for(var i in n)t(e,i,n[i],r);return e},nC}var rC,xI;function lV(){return xI||(xI=1,rC=function(t,e){return{value:t,done:e}}),rC}var iC,AI;function Fl(){if(AI)return iC;AI=1;var t=An(),e=sn(),n=Tc();return iC=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},iC}var oC,HI;function sC(){if(HI)return oC;HI=1;var t=An(),e=Jv(),n=Ll(),r=aV(),i=ci(),o=mM(),s=Tc(),a=EI().IteratorPrototype,l=lV(),u=Fl(),c=i("toStringTag"),h="IteratorHelper",d="WrapForValidIterator",f=o.set,m=function(T){var v=o.getterFor(T?d:h);return r(e(a),{next:function(){var P=v(this);if(T)return P.nextHandler();if(P.done)return l(void 0,!0);try{var _=P.nextHandler();return P.returnHandlerResult?_:l(_,P.done)}catch(M){throw P.done=!0,M}},return:function(){var O=v(this),P=O.iterator;if(O.done=!0,T){var _=s(P,"return");return _?t(_,P):l(void 0,!0)}if(O.inner)try{u(O.inner.iterator,"normal")}catch(M){return u(P,"throw",M)}return P&&u(P,"normal"),l(void 0,!0)}})},S=m(!0),b=m(!1);return n(b,c,"Iterator Helper"),oC=function(T,v,O){var P=function(M,H){H?(H.iterator=M.iterator,H.next=M.next):H=M,H.type=v?d:h,H.returnHandlerResult=!!O,H.nextHandler=T,H.counter=0,H.done=!1,f(this,H)};return P.prototype=v?S:b,P},oC}var aC,NI;function DI(){if(NI)return aC;NI=1;var t=sn(),e=Fl();return aC=function(n,r,i,o){try{return o?r(t(i)[0],i[1]):r(i)}catch(s){e(n,"throw",s)}},aC}var kI;function uV(){if(kI)return II;kI=1;var t=Ct(),e=An(),n=nr(),r=sn(),i=Bi(),o=sC(),s=DI(),a=ys(),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})}}),II}var LI;function cV(){return LI||(LI=1,uV()),MI}cV();var $I={},FI={},lC,VI;function hV(){if(VI)return lC;VI=1;var t=da(),e=Jt();return lC=function(n){if(t(n)==="Function")return e(n)},lC}var uC,WI;function BI(){if(WI)return uC;WI=1;var t=hV(),e=nr(),n=Zd(),r=t(t.bind);return uC=function(i,o){return e(i),o===void 0?i:n?r(i,o):function(){return i.apply(o,arguments)}},uC}var cC,jI;function UI(){return jI||(jI=1,cC={}),cC}var hC,zI;function dV(){if(zI)return hC;zI=1;var t=ci(),e=UI(),n=t("iterator"),r=Array.prototype;return hC=function(i){return i!==void 0&&(e.Array===i||r[n]===i)},hC}var dC,YI;function fC(){if(YI)return dC;YI=1;var t=YM(),e=Tc(),n=Jd(),r=UI(),i=ci(),o=i("iterator");return dC=function(s){if(!n(s))return e(s,o)||e(s,"@@iterator")||r[t(s)]},dC}var gC,GI;function fV(){if(GI)return gC;GI=1;var t=An(),e=nr(),n=sn(),r=tf(),i=fC(),o=TypeError;return gC=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")},gC}var mC,qI;function Vl(){if(qI)return mC;qI=1;var t=BI(),e=An(),n=sn(),r=tf(),i=dV(),o=$l(),s=Ec(),a=fV(),l=fC(),u=Fl(),c=TypeError,h=function(f,m){this.stopped=f,this.result=m},d=h.prototype;return mC=function(f,m,S){var b=S&&S.that,T=!!(S&&S.AS_ENTRIES),v=!!(S&&S.IS_RECORD),O=!!(S&&S.IS_ITERATOR),P=!!(S&&S.INTERRUPTED),_=t(m,b),M,H,X,G,U,ne,ee,he=function(ae){return M&&u(M,"normal",ae),new h(!0,ae)},ie=function(ae){return T?(n(ae),P?_(ae[0],ae[1],he):_(ae[0],ae[1])):P?_(ae,he):_(ae)};if(v)M=f.iterator;else if(O)M=f;else{if(H=l(f),!H)throw new c(r(f)+" is not iterable");if(i(H)){for(X=0,G=o(f);G>X;X++)if(U=ie(f[X]),U&&s(d,U))return U;return new h(!1)}M=a(f,H)}for(ne=v?f.next:M.next;!(ee=e(ne,M)).done;){try{U=ie(ee.value)}catch(ae){u(M,"throw",ae)}if(typeof U=="object"&&U&&s(d,U))return U}return new h(!1)},mC}var KI;function gV(){if(KI)return FI;KI=1;var t=Ct(),e=Vl(),n=nr(),r=sn(),i=Bi();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}}),FI}var XI;function mV(){return XI||(XI=1,gV()),$I}mV();var ZI={},QI={},JI;function pV(){if(JI)return QI;JI=1;var t=Ct(),e=Vl(),n=nr(),r=sn(),i=Bi(),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}}),QI}var eP;function wV(){return eP||(eP=1,pV()),ZI}wV();var tP;function Q(){return tP.apply(null,arguments)}function vV(t){tP=t}function hi(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function fa(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function tt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function pC(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(tt(t,e))return!1;return!0}function rr(t){return t===void 0}function Io(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function Mc(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function nP(t,e){var n=[],r,i=t.length;for(r=0;r<i;++r)n.push(e(t[r],r));return n}function Ss(t,e){for(var n in e)tt(e,n)&&(t[n]=e[n]);return tt(e,"toString")&&(t.toString=e.toString),tt(e,"valueOf")&&(t.valueOf=e.valueOf),t}function ji(t,e,n,r){return PP(t,e,n,r,!0).utc()}function CV(){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 He(t){return t._pf==null&&(t._pf=CV()),t._pf}var wC;Array.prototype.some?wC=Array.prototype.some:wC=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 vC(t){var e=null,n=!1,r=t._d&&!isNaN(t._d.getTime());if(r&&(e=He(t),n=wC.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 of(t){var e=ji(NaN);return t!=null?Ss(He(e),t):He(e).userInvalidated=!0,e}var rP=Q.momentProperties=[],CC=!1;function yC(t,e){var n,r,i,o=rP.length;if(rr(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),rr(e._i)||(t._i=e._i),rr(e._f)||(t._f=e._f),rr(e._l)||(t._l=e._l),rr(e._strict)||(t._strict=e._strict),rr(e._tzm)||(t._tzm=e._tzm),rr(e._isUTC)||(t._isUTC=e._isUTC),rr(e._offset)||(t._offset=e._offset),rr(e._pf)||(t._pf=He(e)),rr(e._locale)||(t._locale=e._locale),o>0)for(n=0;n<o;n++)r=rP[n],i=e[r],rr(i)||(t[r]=i);return t}function Ic(t){yC(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),CC===!1&&(CC=!0,Q.updateOffset(this),CC=!1)}function di(t){return t instanceof Ic||t!=null&&t._isAMomentObject!=null}function iP(t){Q.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function jr(t,e){var n=!0;return Ss(function(){if(Q.deprecationHandler!=null&&Q.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])tt(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[o];r.push(i)}iP(t+`
|
|
3
|
-
Arguments: `+Array.prototype.slice.call(r).join("")+`
|
|
4
|
-
`+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var oP={};function sP(t,e){Q.deprecationHandler!=null&&Q.deprecationHandler(t,e),oP[t]||(iP(e),oP[t]=!0)}Q.suppressDeprecationWarnings=!1,Q.deprecationHandler=null;function Ui(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function yV(t){var e,n;for(n in t)tt(t,n)&&(e=t[n],Ui(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 bC(t,e){var n=Ss({},t),r;for(r in e)tt(e,r)&&(fa(t[r])&&fa(e[r])?(n[r]={},Ss(n[r],t[r]),Ss(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)tt(t,r)&&!tt(e,r)&&fa(t[r])&&(n[r]=Ss({},n[r]));return n}function SC(t){t!=null&&this.set(t)}var RC;Object.keys?RC=Object.keys:RC=function(t){var e,n=[];for(e in t)tt(t,e)&&n.push(e);return n};var bV={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function SV(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return Ui(r)?r.call(e,n):r}function zi(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 EC=/(\[[^\[]*\])|(\\)?([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,sf=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,TC={},Wl={};function be(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(Wl[t]=i),e&&(Wl[e[0]]=function(){return zi(i.apply(this,arguments),e[1],e[2])}),n&&(Wl[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function RV(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function EV(t){var e=t.match(EC),n,r;for(n=0,r=e.length;n<r;n++)Wl[e[n]]?e[n]=Wl[e[n]]:e[n]=RV(e[n]);return function(i){var o="",s;for(s=0;s<r;s++)o+=Ui(e[s])?e[s].call(i,t):e[s];return o}}function af(t,e){return t.isValid()?(e=aP(e,t.localeData()),TC[e]=TC[e]||EV(e),TC[e](t)):t.localeData().invalidDate()}function aP(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(sf.lastIndex=0;n>=0&&sf.test(t);)t=t.replace(sf,r),sf.lastIndex=0,n-=1;return t}var TV={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 _V(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(EC).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var MV="Invalid date";function IV(){return this._invalidDate}var PV="%d",OV=/\d{1,2}/;function xV(t){return this._ordinal.replace("%d",t)}var AV={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 HV(t,e,n,r){var i=this._relativeTime[n];return Ui(i)?i(t,e,n,r):i.replace(/%d/i,t)}function NV(t,e){var n=this._relativeTime[t>0?"future":"past"];return Ui(n)?n(e):n.replace(/%s/i,e)}var lP={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 Ur(t){return typeof t=="string"?lP[t]||lP[t.toLowerCase()]:void 0}function _C(t){var e={},n,r;for(r in t)tt(t,r)&&(n=Ur(r),n&&(e[n]=t[r]));return e}var DV={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 kV(t){var e=[],n;for(n in t)tt(t,n)&&e.push({unit:n,priority:DV[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var uP=/\d/,Sr=/\d\d/,cP=/\d{3}/,MC=/\d{4}/,lf=/[+-]?\d{6}/,Et=/\d\d?/,hP=/\d\d\d\d?/,dP=/\d\d\d\d\d\d?/,uf=/\d{1,3}/,IC=/\d{1,4}/,cf=/[+-]?\d{1,6}/,Bl=/\d+/,hf=/[+-]?\d+/,LV=/Z|[+-]\d\d:?\d\d/gi,df=/Z|[+-]\d\d(?::?\d\d)?/gi,$V=/[+-]?\d+(\.\d{1,3})?/,Pc=/[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,jl=/^[1-9]\d?/,PC=/^([1-9]\d|\d)/,ff;ff={};function de(t,e,n){ff[t]=Ui(e)?e:function(r,i){return r&&n?n:e}}function FV(t,e){return tt(ff,t)?ff[t](e._strict,e._locale):new RegExp(VV(t))}function VV(t){return Po(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,o){return n||r||i||o}))}function Po(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function zr(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function Ue(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=zr(e)),n}var OC={};function vt(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),Io(e)&&(r=function(o,s){s[e]=Ue(o)}),i=t.length,n=0;n<i;n++)OC[t[n]]=r}function Oc(t,e){vt(t,function(n,r,i,o){i._w=i._w||{},e(n,i._w,i,o)})}function WV(t,e,n){e!=null&&tt(OC,t)&&OC[t](e,n._a,n,t)}function gf(t){return t%4===0&&t%100!==0||t%400===0}var Hn=0,Oo=1,Yi=2,mn=3,fi=4,xo=5,ga=6,BV=7,jV=8;be("Y",0,0,function(){var t=this.year();return t<=9999?zi(t,4):"+"+t}),be(0,["YY",2],0,function(){return this.year()%100}),be(0,["YYYY",4],0,"year"),be(0,["YYYYY",5],0,"year"),be(0,["YYYYYY",6,!0],0,"year"),de("Y",hf),de("YY",Et,Sr),de("YYYY",IC,MC),de("YYYYY",cf,lf),de("YYYYYY",cf,lf),vt(["YYYYY","YYYYYY"],Hn),vt("YYYY",function(t,e){e[Hn]=t.length===2?Q.parseTwoDigitYear(t):Ue(t)}),vt("YY",function(t,e){e[Hn]=Q.parseTwoDigitYear(t)}),vt("Y",function(t,e){e[Hn]=parseInt(t,10)});function xc(t){return gf(t)?366:365}Q.parseTwoDigitYear=function(t){return Ue(t)+(Ue(t)>68?1900:2e3)};var fP=Ul("FullYear",!0);function UV(){return gf(this.year())}function Ul(t,e){return function(n){return n!=null?(gP(this,t,n),Q.updateOffset(this,e),this):Ac(this,t)}}function Ac(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 gP(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&&!gf(o)?28:a,i?r.setUTCFullYear(o,s,a):r.setFullYear(o,s,a)}}function zV(t){return t=Ur(t),Ui(this[t])?this[t]():this}function YV(t,e){if(typeof t=="object"){t=_C(t);var n=kV(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=Ur(t),Ui(this[t]))return this[t](e);return this}function GV(t,e){return(t%e+e)%e}var en;Array.prototype.indexOf?en=Array.prototype.indexOf:en=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function xC(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=GV(e,12);return t+=(e-n)/12,n===1?gf(t)?29:28:31-n%7%2}be("M",["MM",2],"Mo",function(){return this.month()+1}),be("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),be("MMMM",0,0,function(t){return this.localeData().months(this,t)}),de("M",Et,jl),de("MM",Et,Sr),de("MMM",function(t,e){return e.monthsShortRegex(t)}),de("MMMM",function(t,e){return e.monthsRegex(t)}),vt(["M","MM"],function(t,e){e[Oo]=Ue(t)-1}),vt(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[Oo]=i:He(n).invalidMonth=t});var qV="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),mP="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),pP=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,KV=Pc,XV=Pc;function ZV(t,e){return t?hi(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||pP).test(e)?"format":"standalone"][t.month()]:hi(this._months)?this._months:this._months.standalone}function QV(t,e){return t?hi(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[pP.test(e)?"format":"standalone"][t.month()]:hi(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function JV(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=ji([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?e==="MMM"?(i=en.call(this._shortMonthsParse,s),i!==-1?i:null):(i=en.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=en.call(this._shortMonthsParse,s),i!==-1?i:(i=en.call(this._longMonthsParse,s),i!==-1?i:null)):(i=en.call(this._longMonthsParse,s),i!==-1?i:(i=en.call(this._shortMonthsParse,s),i!==-1?i:null))}function eW(t,e,n){var r,i,o;if(this._monthsParseExact)return JV.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=ji([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 wP(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=Ue(e);else if(e=t.localeData().monthsParse(e),!Io(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,xC(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function vP(t){return t!=null?(wP(this,t),Q.updateOffset(this,!0),this):Ac(this,"Month")}function tW(){return xC(this.year(),this.month())}function nW(t){return this._monthsParseExact?(tt(this,"_monthsRegex")||CP.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(tt(this,"_monthsShortRegex")||(this._monthsShortRegex=KV),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function rW(t){return this._monthsParseExact?(tt(this,"_monthsRegex")||CP.call(this),t?this._monthsStrictRegex:this._monthsRegex):(tt(this,"_monthsRegex")||(this._monthsRegex=XV),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function CP(){function t(l,u){return u.length-l.length}var e=[],n=[],r=[],i,o,s,a;for(i=0;i<12;i++)o=ji([2e3,i]),s=Po(this.monthsShort(o,"")),a=Po(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 iW(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 Hc(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 mf(t,e,n){var r=7+e-n,i=(7+Hc(t,0,r).getUTCDay()-e)%7;return-i+r-1}function yP(t,e,n,r,i){var o=(7+n-r)%7,s=mf(t,r,i),a=1+7*(e-1)+o+s,l,u;return a<=0?(l=t-1,u=xc(l)+a):a>xc(t)?(l=t+1,u=a-xc(t)):(l=t,u=a),{year:l,dayOfYear:u}}function Nc(t,e,n){var r=mf(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,o,s;return i<1?(s=t.year()-1,o=i+Ao(s,e,n)):i>Ao(t.year(),e,n)?(o=i-Ao(t.year(),e,n),s=t.year()+1):(s=t.year(),o=i),{week:o,year:s}}function Ao(t,e,n){var r=mf(t,e,n),i=mf(t+1,e,n);return(xc(t)-r+i)/7}be("w",["ww",2],"wo","week"),be("W",["WW",2],"Wo","isoWeek"),de("w",Et,jl),de("ww",Et,Sr),de("W",Et,jl),de("WW",Et,Sr),Oc(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=Ue(t)});function oW(t){return Nc(t,this._week.dow,this._week.doy).week}var sW={dow:0,doy:6};function aW(){return this._week.dow}function lW(){return this._week.doy}function uW(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function cW(t){var e=Nc(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}be("d",0,"do","day"),be("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),be("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),be("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),be("e",0,0,"weekday"),be("E",0,0,"isoWeekday"),de("d",Et),de("e",Et),de("E",Et),de("dd",function(t,e){return e.weekdaysMinRegex(t)}),de("ddd",function(t,e){return e.weekdaysShortRegex(t)}),de("dddd",function(t,e){return e.weekdaysRegex(t)}),Oc(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:He(n).invalidWeekday=t}),Oc(["d","e","E"],function(t,e,n,r){e[r]=Ue(t)});function hW(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function dW(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function AC(t,e){return t.slice(e,7).concat(t.slice(0,e))}var fW="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),bP="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),gW="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),mW=Pc,pW=Pc,wW=Pc;function vW(t,e){var n=hi(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?AC(n,this._week.dow):t?n[t.day()]:n}function CW(t){return t===!0?AC(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function yW(t){return t===!0?AC(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function bW(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=ji([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=en.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=en.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=en.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=en.call(this._weekdaysParse,s),i!==-1||(i=en.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=en.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=en.call(this._shortWeekdaysParse,s),i!==-1||(i=en.call(this._weekdaysParse,s),i!==-1)?i:(i=en.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=en.call(this._minWeekdaysParse,s),i!==-1||(i=en.call(this._weekdaysParse,s),i!==-1)?i:(i=en.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function SW(t,e,n){var r,i,o;if(this._weekdaysParseExact)return bW.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=ji([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 RW(t){if(!this.isValid())return t!=null?this:NaN;var e=Ac(this,"Day");return t!=null?(t=hW(t,this.localeData()),this.add(t-e,"d")):e}function EW(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 TW(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=dW(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function _W(t){return this._weekdaysParseExact?(tt(this,"_weekdaysRegex")||HC.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(tt(this,"_weekdaysRegex")||(this._weekdaysRegex=mW),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function MW(t){return this._weekdaysParseExact?(tt(this,"_weekdaysRegex")||HC.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(tt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=pW),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function IW(t){return this._weekdaysParseExact?(tt(this,"_weekdaysRegex")||HC.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(tt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=wW),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function HC(){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=ji([2e3,1]).day(o),a=Po(this.weekdaysMin(s,"")),l=Po(this.weekdaysShort(s,"")),u=Po(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 NC(){return this.hours()%12||12}function PW(){return this.hours()||24}be("H",["HH",2],0,"hour"),be("h",["hh",2],0,NC),be("k",["kk",2],0,PW),be("hmm",0,0,function(){return""+NC.apply(this)+zi(this.minutes(),2)}),be("hmmss",0,0,function(){return""+NC.apply(this)+zi(this.minutes(),2)+zi(this.seconds(),2)}),be("Hmm",0,0,function(){return""+this.hours()+zi(this.minutes(),2)}),be("Hmmss",0,0,function(){return""+this.hours()+zi(this.minutes(),2)+zi(this.seconds(),2)});function SP(t,e){be(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}SP("a",!0),SP("A",!1);function RP(t,e){return e._meridiemParse}de("a",RP),de("A",RP),de("H",Et,PC),de("h",Et,jl),de("k",Et,jl),de("HH",Et,Sr),de("hh",Et,Sr),de("kk",Et,Sr),de("hmm",hP),de("hmmss",dP),de("Hmm",hP),de("Hmmss",dP),vt(["H","HH"],mn),vt(["k","kk"],function(t,e,n){var r=Ue(t);e[mn]=r===24?0:r}),vt(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),vt(["h","hh"],function(t,e,n){e[mn]=Ue(t),He(n).bigHour=!0}),vt("hmm",function(t,e,n){var r=t.length-2;e[mn]=Ue(t.substr(0,r)),e[fi]=Ue(t.substr(r)),He(n).bigHour=!0}),vt("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[mn]=Ue(t.substr(0,r)),e[fi]=Ue(t.substr(r,2)),e[xo]=Ue(t.substr(i)),He(n).bigHour=!0}),vt("Hmm",function(t,e,n){var r=t.length-2;e[mn]=Ue(t.substr(0,r)),e[fi]=Ue(t.substr(r))}),vt("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[mn]=Ue(t.substr(0,r)),e[fi]=Ue(t.substr(r,2)),e[xo]=Ue(t.substr(i))});function OW(t){return(t+"").toLowerCase().charAt(0)==="p"}var xW=/[ap]\.?m?\.?/i,AW=Ul("Hours",!0);function HW(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var EP={calendar:bV,longDateFormat:TV,invalidDate:MV,ordinal:PV,dayOfMonthOrdinalParse:OV,relativeTime:AV,months:qV,monthsShort:mP,week:sW,weekdays:fW,weekdaysMin:gW,weekdaysShort:bP,meridiemParse:xW},Ot={},Dc={},kc;function NW(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 TP(t){return t&&t.toLowerCase().replace("_","-")}function DW(t){for(var e=0,n,r,i,o;e<t.length;){for(o=TP(t[e]).split("-"),n=o.length,r=TP(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=pf(o.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&NW(o,r)>=n-1)break;n--}e++}return kc}function kW(t){return!!(t&&t.match("^[^/\\\\]*$"))}function pf(t){var e=null,n;if(Ot[t]===void 0&&typeof module<"u"&&module&&module.exports&&kW(t))try{e=kc._abbr,n=require,n("./locale/"+t),Rs(e)}catch{Ot[t]=null}return Ot[t]}function Rs(t,e){var n;return t&&(rr(e)?n=Ho(t):n=DC(t,e),n?kc=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),kc._abbr}function DC(t,e){if(e!==null){var n,r=EP;if(e.abbr=t,Ot[t]!=null)sP("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=pf(e.parentLocale),n!=null)r=n._config;else return Dc[e.parentLocale]||(Dc[e.parentLocale]=[]),Dc[e.parentLocale].push({name:t,config:e}),null;return Ot[t]=new SC(bC(r,e)),Dc[t]&&Dc[t].forEach(function(i){DC(i.name,i.config)}),Rs(t),Ot[t]}else return delete Ot[t],null}function LW(t,e){if(e!=null){var n,r,i=EP;Ot[t]!=null&&Ot[t].parentLocale!=null?Ot[t].set(bC(Ot[t]._config,e)):(r=pf(t),r!=null&&(i=r._config),e=bC(i,e),r==null&&(e.abbr=t),n=new SC(e),n.parentLocale=Ot[t],Ot[t]=n),Rs(t)}else Ot[t]!=null&&(Ot[t].parentLocale!=null?(Ot[t]=Ot[t].parentLocale,t===Rs()&&Rs(t)):Ot[t]!=null&&delete Ot[t]);return Ot[t]}function Ho(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return kc;if(!hi(t)){if(e=pf(t),e)return e;t=[t]}return DW(t)}function $W(){return RC(Ot)}function kC(t){var e,n=t._a;return n&&He(t).overflow===-2&&(e=n[Oo]<0||n[Oo]>11?Oo:n[Yi]<1||n[Yi]>xC(n[Hn],n[Oo])?Yi:n[mn]<0||n[mn]>24||n[mn]===24&&(n[fi]!==0||n[xo]!==0||n[ga]!==0)?mn:n[fi]<0||n[fi]>59?fi:n[xo]<0||n[xo]>59?xo:n[ga]<0||n[ga]>999?ga:-1,He(t)._overflowDayOfYear&&(e<Hn||e>Yi)&&(e=Yi),He(t)._overflowWeeks&&e===-1&&(e=BV),He(t)._overflowWeekday&&e===-1&&(e=jV),He(t).overflow=e),t}var FW=/^\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)?)?$/,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)?)?$/,WW=/Z|[+-]\d\d(?::?\d\d)?/,wf=[["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]],LC=[["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,jW=/^(?:(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}))$/,UW={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function _P(t){var e,n,r=t._i,i=FW.exec(r)||VW.exec(r),o,s,a,l,u=wf.length,c=LC.length;if(i){for(He(t).iso=!0,e=0,n=u;e<n;e++)if(wf[e][1].exec(i[1])){s=wf[e][0],o=wf[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(i[3]){for(e=0,n=c;e<n;e++)if(LC[e][1].exec(i[3])){a=(i[2]||" ")+LC[e][0];break}if(a==null){t._isValid=!1;return}}if(!o&&a!=null){t._isValid=!1;return}if(i[4])if(WW.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=s+(a||"")+(l||""),FC(t)}else t._isValid=!1}function zW(t,e,n,r,i,o){var s=[YW(t),mP.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return o&&s.push(parseInt(o,10)),s}function YW(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function GW(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function qW(t,e,n){if(t){var r=bP.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return He(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function KW(t,e,n){if(t)return UW[t];if(e)return 0;var r=parseInt(n,10),i=r%100,o=(r-i)/100;return o*60+i}function MP(t){var e=jW.exec(GW(t._i)),n;if(e){if(n=zW(e[4],e[3],e[2],e[5],e[6],e[7]),!qW(e[1],n,t))return;t._a=n,t._tzm=KW(e[8],e[9],e[10]),t._d=Hc.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),He(t).rfc2822=!0}else t._isValid=!1}function XW(t){var e=BW.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(_P(t),t._isValid===!1)delete t._isValid;else return;if(MP(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:Q.createFromInputFallback(t)}Q.createFromInputFallback=jr("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 zl(t,e,n){return t??e??n}function ZW(t){var e=new Date(Q.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function $C(t){var e,n,r=[],i,o,s;if(!t._d){for(i=ZW(t),t._w&&t._a[Yi]==null&&t._a[Oo]==null&&QW(t),t._dayOfYear!=null&&(s=zl(t._a[Hn],i[Hn]),(t._dayOfYear>xc(s)||t._dayOfYear===0)&&(He(t)._overflowDayOfYear=!0),n=Hc(s,0,t._dayOfYear),t._a[Oo]=n.getUTCMonth(),t._a[Yi]=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[mn]===24&&t._a[fi]===0&&t._a[xo]===0&&t._a[ga]===0&&(t._nextDay=!0,t._a[mn]=0),t._d=(t._useUTC?Hc:iW).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[mn]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==o&&(He(t).weekdayMismatch=!0)}}function QW(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=zl(e.GG,t._a[Hn],Nc(Tt(),1,4).year),r=zl(e.W,1),i=zl(e.E,1),(i<1||i>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,u=Nc(Tt(),o,s),n=zl(e.gg,t._a[Hn],u.year),r=zl(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>Ao(n,o,s)?He(t)._overflowWeeks=!0:l!=null?He(t)._overflowWeekday=!0:(a=yP(n,r,i,o,s),t._a[Hn]=a.year,t._dayOfYear=a.dayOfYear)}Q.ISO_8601=function(){},Q.RFC_2822=function(){};function FC(t){if(t._f===Q.ISO_8601){_P(t);return}if(t._f===Q.RFC_2822){MP(t);return}t._a=[],He(t).empty=!0;var e=""+t._i,n,r,i,o,s,a=e.length,l=0,u,c;for(i=aP(t._f,t._locale).match(EC)||[],c=i.length,n=0;n<c;n++)o=i[n],r=(e.match(FV(o,t))||[])[0],r&&(s=e.substr(0,e.indexOf(r)),s.length>0&&He(t).unusedInput.push(s),e=e.slice(e.indexOf(r)+r.length),l+=r.length),Wl[o]?(r?He(t).empty=!1:He(t).unusedTokens.push(o),WV(o,r,t)):t._strict&&!r&&He(t).unusedTokens.push(o);He(t).charsLeftOver=a-l,e.length>0&&He(t).unusedInput.push(e),t._a[mn]<=12&&He(t).bigHour===!0&&t._a[mn]>0&&(He(t).bigHour=void 0),He(t).parsedDateParts=t._a.slice(0),He(t).meridiem=t._meridiem,t._a[mn]=JW(t._locale,t._a[mn],t._meridiem),u=He(t).era,u!==null&&(t._a[Hn]=t._locale.erasConvertYear(u,t._a[Hn])),$C(t),kC(t)}function JW(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 eB(t){var e,n,r,i,o,s,a=!1,l=t._f.length;if(l===0){He(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)o=0,s=!1,e=yC({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],FC(e),vC(e)&&(s=!0),o+=He(e).charsLeftOver,o+=He(e).unusedTokens.length*10,He(e).score=o,a?o<r&&(r=o,n=e):(r==null||o<r||s)&&(r=o,n=e,s&&(a=!0));Ss(t,n||e)}function tB(t){if(!t._d){var e=_C(t._i),n=e.day===void 0?e.date:e.day;t._a=nP([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),$C(t)}}function nB(t){var e=new Ic(kC(IP(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function IP(t){var e=t._i,n=t._f;return t._locale=t._locale||Ho(t._l),e===null||n===void 0&&e===""?of({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),di(e)?new Ic(kC(e)):(Mc(e)?t._d=e:hi(n)?eB(t):n?FC(t):rB(t),vC(t)||(t._d=null),t))}function rB(t){var e=t._i;rr(e)?t._d=new Date(Q.now()):Mc(e)?t._d=new Date(e.valueOf()):typeof e=="string"?XW(t):hi(e)?(t._a=nP(e.slice(0),function(n){return parseInt(n,10)}),$C(t)):fa(e)?tB(t):Io(e)?t._d=new Date(e):Q.createFromInputFallback(t)}function PP(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),(fa(t)&&pC(t)||hi(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,nB(o)}function Tt(t,e,n,r){return PP(t,e,n,r,!1)}var iB=jr("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Tt.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:of()}),oB=jr("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Tt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:of()});function OP(t,e){var n,r;if(e.length===1&&hi(e[0])&&(e=e[0]),!e.length)return Tt();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function sB(){var t=[].slice.call(arguments,0);return OP("isBefore",t)}function aB(){var t=[].slice.call(arguments,0);return OP("isAfter",t)}var lB=function(){return Date.now?Date.now():+new Date},Lc=["year","quarter","month","week","day","hour","minute","second","millisecond"];function uB(t){var e,n=!1,r,i=Lc.length;for(e in t)if(tt(t,e)&&!(en.call(Lc,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[Lc[r]]){if(n)return!1;parseFloat(t[Lc[r]])!==Ue(t[Lc[r]])&&(n=!0)}return!0}function cB(){return this._isValid}function hB(){return gi(NaN)}function vf(t){var e=_C(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=uB(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=Ho(),this._bubble()}function Cf(t){return t instanceof vf}function VC(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function dB(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++)Ue(t[s])!==Ue(e[s])&&o++;return o+i}function xP(t,e){be(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+zi(~~(n/60),2)+e+zi(~~n%60,2)})}xP("Z",":"),xP("ZZ",""),de("Z",df),de("ZZ",df),vt(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=WC(df,t)});var fB=/([\+\-]|\d\d)/gi;function WC(t,e){var n=(e||"").match(t),r,i,o;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(fB)||["-",0,0],o=+(i[1]*60)+Ue(i[2]),o===0?0:i[0]==="+"?o:-o)}function BC(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(di(t)||Mc(t)?t.valueOf():Tt(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),Q.updateOffset(n,!1),n):Tt(t).local()}function jC(t){return-Math.round(t._d.getTimezoneOffset())}Q.updateOffset=function(){};function gB(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=WC(df,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=jC(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?DP(this,gi(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Q.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:jC(this)}function mB(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function pB(t){return this.utcOffset(0,t)}function wB(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(jC(this),"m")),this}function vB(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=WC(LV,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function CB(t){return this.isValid()?(t=t?Tt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function yB(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function bB(){if(!rr(this._isDSTShifted))return this._isDSTShifted;var t={},e;return yC(t,this),t=IP(t),t._a?(e=t._isUTC?ji(t._a):Tt(t._a),this._isDSTShifted=this.isValid()&&dB(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function SB(){return this.isValid()?!this._isUTC:!1}function RB(){return this.isValid()?this._isUTC:!1}function AP(){return this.isValid()?this._isUTC&&this._offset===0:!1}var EB=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,TB=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function gi(t,e){var n=t,r=null,i,o,s;return Cf(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:Io(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=EB.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:Ue(r[Yi])*i,h:Ue(r[mn])*i,m:Ue(r[fi])*i,s:Ue(r[xo])*i,ms:Ue(VC(r[ga]*1e3))*i}):(r=TB.exec(t))?(i=r[1]==="-"?-1:1,n={y:ma(r[2],i),M:ma(r[3],i),w:ma(r[4],i),d:ma(r[5],i),h:ma(r[6],i),m:ma(r[7],i),s:ma(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(s=_B(Tt(n.from),Tt(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),o=new vf(n),Cf(t)&&tt(t,"_locale")&&(o._locale=t._locale),Cf(t)&&tt(t,"_isValid")&&(o._isValid=t._isValid),o}gi.fn=vf.prototype,gi.invalid=hB;function ma(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function HP(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 _B(t,e){var n;return t.isValid()&&e.isValid()?(e=BC(e,t),t.isBefore(e)?n=HP(t,e):(n=HP(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function NP(t,e){return function(n,r){var i,o;return r!==null&&!isNaN(+r)&&(sP(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=gi(n,r),DP(this,i,t),this}}function DP(t,e,n,r){var i=e._milliseconds,o=VC(e._days),s=VC(e._months);t.isValid()&&(r=r??!0,s&&wP(t,Ac(t,"Month")+s*n),o&&gP(t,"Date",Ac(t,"Date")+o*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&Q.updateOffset(t,o||s))}var MB=NP(1,"add"),IB=NP(-1,"subtract");function kP(t){return typeof t=="string"||t instanceof String}function PB(t){return di(t)||Mc(t)||kP(t)||Io(t)||xB(t)||OB(t)||t===null||t===void 0}function OB(t){var e=fa(t)&&!pC(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||tt(t,o);return e&&n}function xB(t){var e=hi(t),n=!1;return e&&(n=t.filter(function(r){return!Io(r)&&kP(t)}).length===0),e&&n}function AB(t){var e=fa(t)&&!pC(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||tt(t,o);return e&&n}function HB(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 NB(t,e){arguments.length===1&&(arguments[0]?PB(arguments[0])?(t=arguments[0],e=void 0):AB(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||Tt(),r=BC(n,this).startOf("day"),i=Q.calendarFormat(this,r)||"sameElse",o=e&&(Ui(e[i])?e[i].call(this,n):e[i]);return this.format(o||this.localeData().calendar(i,this,Tt(n)))}function DB(){return new Ic(this)}function kB(t,e){var n=di(t)?t:Tt(t);return this.isValid()&&n.isValid()?(e=Ur(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function LB(t,e){var n=di(t)?t:Tt(t);return this.isValid()&&n.isValid()?(e=Ur(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function $B(t,e,n,r){var i=di(t)?t:Tt(t),o=di(e)?e:Tt(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 FB(t,e){var n=di(t)?t:Tt(t),r;return this.isValid()&&n.isValid()?(e=Ur(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 VB(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function WB(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=BC(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=Ur(e),e){case"year":o=yf(this,r)/12;break;case"month":o=yf(this,r);break;case"quarter":o=yf(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:zr(o)}function yf(t,e){if(t.date()<e.date())return-yf(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}Q.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",Q.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function jB(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function UB(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?af(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Ui(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",af(n,"Z")):af(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function zB(){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 YB(t){t||(t=this.isUtc()?Q.defaultFormatUtc:Q.defaultFormat);var e=af(this,t);return this.localeData().postformat(e)}function GB(t,e){return this.isValid()&&(di(t)&&t.isValid()||Tt(t).isValid())?gi({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function qB(t){return this.from(Tt(),t)}function KB(t,e){return this.isValid()&&(di(t)&&t.isValid()||Tt(t).isValid())?gi({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function XB(t){return this.to(Tt(),t)}function LP(t){var e;return t===void 0?this._locale._abbr:(e=Ho(t),e!=null&&(this._locale=e),this)}var $P=jr("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 FP(){return this._locale}var bf=1e3,Yl=60*bf,Sf=60*Yl,VP=(365*400+97)*24*Sf;function Gl(t,e){return(t%e+e)%e}function WP(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-VP:new Date(t,e,n).valueOf()}function BP(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-VP:Date.UTC(t,e,n)}function ZB(t){var e,n;if(t=Ur(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?BP:WP,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-=Gl(e+(this._isUTC?0:this.utcOffset()*Yl),Sf);break;case"minute":e=this._d.valueOf(),e-=Gl(e,Yl);break;case"second":e=this._d.valueOf(),e-=Gl(e,bf);break}return this._d.setTime(e),Q.updateOffset(this,!0),this}function QB(t){var e,n;if(t=Ur(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?BP:WP,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+=Sf-Gl(e+(this._isUTC?0:this.utcOffset()*Yl),Sf)-1;break;case"minute":e=this._d.valueOf(),e+=Yl-Gl(e,Yl)-1;break;case"second":e=this._d.valueOf(),e+=bf-Gl(e,bf)-1;break}return this._d.setTime(e),Q.updateOffset(this,!0),this}function JB(){return this._d.valueOf()-(this._offset||0)*6e4}function ej(){return Math.floor(this.valueOf()/1e3)}function tj(){return new Date(this.valueOf())}function nj(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function rj(){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 ij(){return this.isValid()?this.toISOString():null}function oj(){return vC(this)}function sj(){return Ss({},He(this))}function aj(){return He(this).overflow}function lj(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}be("N",0,0,"eraAbbr"),be("NN",0,0,"eraAbbr"),be("NNN",0,0,"eraAbbr"),be("NNNN",0,0,"eraName"),be("NNNNN",0,0,"eraNarrow"),be("y",["y",1],"yo","eraYear"),be("y",["yy",2],0,"eraYear"),be("y",["yyy",3],0,"eraYear"),be("y",["yyyy",4],0,"eraYear"),de("N",UC),de("NN",UC),de("NNN",UC),de("NNNN",Cj),de("NNNNN",yj),vt(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?He(n).era=i:He(n).invalidEra=t}),de("y",Bl),de("yy",Bl),de("yyy",Bl),de("yyyy",Bl),de("yo",bj),vt(["y","yy","yyy","yyyy"],Hn),vt(["yo"],function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Hn]=n._locale.eraYearOrdinalParse(t,i):e[Hn]=parseInt(t,10)});function uj(t,e){var n,r,i,o=this._eras||Ho("en")._eras;for(n=0,r=o.length;n<r;++n)switch(typeof o[n].since==="string"&&(i=Q(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=Q(o[n].until).startOf("day").valueOf(),o[n].until=i.valueOf();break}return o}function cj(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 hj(t,e){var n=t.since<=t.until?1:-1;return e===void 0?Q(t.since).year():Q(t.since).year()+(e-t.offset)*n}function dj(){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 fj(){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 gj(){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 mj(){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()-Q(i[t].since).year())*n+i[t].offset;return this.year()}function pj(t){return tt(this,"_erasNameRegex")||zC.call(this),t?this._erasNameRegex:this._erasRegex}function wj(t){return tt(this,"_erasAbbrRegex")||zC.call(this),t?this._erasAbbrRegex:this._erasRegex}function vj(t){return tt(this,"_erasNarrowRegex")||zC.call(this),t?this._erasNarrowRegex:this._erasRegex}function UC(t,e){return e.erasAbbrRegex(t)}function Cj(t,e){return e.erasNameRegex(t)}function yj(t,e){return e.erasNarrowRegex(t)}function bj(t,e){return e._eraYearOrdinalRegex||Bl}function zC(){var t=[],e=[],n=[],r=[],i,o,s,a,l,u=this.eras();for(i=0,o=u.length;i<o;++i)s=Po(u[i].name),a=Po(u[i].abbr),l=Po(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")}be(0,["gg",2],0,function(){return this.weekYear()%100}),be(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Rf(t,e){be(0,[t,t.length],0,e)}Rf("gggg","weekYear"),Rf("ggggg","weekYear"),Rf("GGGG","isoWeekYear"),Rf("GGGGG","isoWeekYear"),de("G",hf),de("g",hf),de("GG",Et,Sr),de("gg",Et,Sr),de("GGGG",IC,MC),de("gggg",IC,MC),de("GGGGG",cf,lf),de("ggggg",cf,lf),Oc(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=Ue(t)}),Oc(["gg","GG"],function(t,e,n,r){e[r]=Q.parseTwoDigitYear(t)});function Sj(t){return jP.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Rj(t){return jP.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Ej(){return Ao(this.year(),1,4)}function Tj(){return Ao(this.isoWeekYear(),1,4)}function _j(){var t=this.localeData()._week;return Ao(this.year(),t.dow,t.doy)}function Mj(){var t=this.localeData()._week;return Ao(this.weekYear(),t.dow,t.doy)}function jP(t,e,n,r,i){var o;return t==null?Nc(this,r,i).year:(o=Ao(t,r,i),e>o&&(e=o),Ij.call(this,t,e,n,r,i))}function Ij(t,e,n,r,i){var o=yP(t,e,n,r,i),s=Hc(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}be("Q",0,"Qo","quarter"),de("Q",uP),vt("Q",function(t,e){e[Oo]=(Ue(t)-1)*3});function Pj(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}be("D",["DD",2],"Do","date"),de("D",Et,jl),de("DD",Et,Sr),de("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),vt(["D","DD"],Yi),vt("Do",function(t,e){e[Yi]=Ue(t.match(Et)[0])});var UP=Ul("Date",!0);be("DDD",["DDDD",3],"DDDo","dayOfYear"),de("DDD",uf),de("DDDD",cP),vt(["DDD","DDDD"],function(t,e,n){n._dayOfYear=Ue(t)});function Oj(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}be("m",["mm",2],0,"minute"),de("m",Et,PC),de("mm",Et,Sr),vt(["m","mm"],fi);var xj=Ul("Minutes",!1);be("s",["ss",2],0,"second"),de("s",Et,PC),de("ss",Et,Sr),vt(["s","ss"],xo);var Aj=Ul("Seconds",!1);be("S",0,0,function(){return~~(this.millisecond()/100)}),be(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),be(0,["SSS",3],0,"millisecond"),be(0,["SSSS",4],0,function(){return this.millisecond()*10}),be(0,["SSSSS",5],0,function(){return this.millisecond()*100}),be(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),be(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),be(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),be(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),de("S",uf,uP),de("SS",uf,Sr),de("SSS",uf,cP);var Es,zP;for(Es="SSSS";Es.length<=9;Es+="S")de(Es,Bl);function Hj(t,e){e[ga]=Ue(("0."+t)*1e3)}for(Es="S";Es.length<=9;Es+="S")vt(Es,Hj);zP=Ul("Milliseconds",!1),be("z",0,0,"zoneAbbr"),be("zz",0,0,"zoneName");function Nj(){return this._isUTC?"UTC":""}function Dj(){return this._isUTC?"Coordinated Universal Time":""}var te=Ic.prototype;te.add=MB,te.calendar=NB,te.clone=DB,te.diff=BB,te.endOf=QB,te.format=YB,te.from=GB,te.fromNow=qB,te.to=KB,te.toNow=XB,te.get=zV,te.invalidAt=aj,te.isAfter=kB,te.isBefore=LB,te.isBetween=$B,te.isSame=FB,te.isSameOrAfter=VB,te.isSameOrBefore=WB,te.isValid=oj,te.lang=$P,te.locale=LP,te.localeData=FP,te.max=oB,te.min=iB,te.parsingFlags=sj,te.set=YV,te.startOf=ZB,te.subtract=IB,te.toArray=nj,te.toObject=rj,te.toDate=tj,te.toISOString=UB,te.inspect=zB,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=ij,te.toString=jB,te.unix=ej,te.valueOf=JB,te.creationData=lj,te.eraName=dj,te.eraNarrow=fj,te.eraAbbr=gj,te.eraYear=mj,te.year=fP,te.isLeapYear=UV,te.weekYear=Sj,te.isoWeekYear=Rj,te.quarter=te.quarters=Pj,te.month=vP,te.daysInMonth=tW,te.week=te.weeks=uW,te.isoWeek=te.isoWeeks=cW,te.weeksInYear=_j,te.weeksInWeekYear=Mj,te.isoWeeksInYear=Ej,te.isoWeeksInISOWeekYear=Tj,te.date=UP,te.day=te.days=RW,te.weekday=EW,te.isoWeekday=TW,te.dayOfYear=Oj,te.hour=te.hours=AW,te.minute=te.minutes=xj,te.second=te.seconds=Aj,te.millisecond=te.milliseconds=zP,te.utcOffset=gB,te.utc=pB,te.local=wB,te.parseZone=vB,te.hasAlignedHourOffset=CB,te.isDST=yB,te.isLocal=SB,te.isUtcOffset=RB,te.isUtc=AP,te.isUTC=AP,te.zoneAbbr=Nj,te.zoneName=Dj,te.dates=jr("dates accessor is deprecated. Use date instead.",UP),te.months=jr("months accessor is deprecated. Use month instead",vP),te.years=jr("years accessor is deprecated. Use year instead",fP),te.zone=jr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mB),te.isDSTShifted=jr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",bB);function kj(t){return Tt(t*1e3)}function Lj(){return Tt.apply(null,arguments).parseZone()}function YP(t){return t}var nt=SC.prototype;nt.calendar=SV,nt.longDateFormat=_V,nt.invalidDate=IV,nt.ordinal=xV,nt.preparse=YP,nt.postformat=YP,nt.relativeTime=HV,nt.pastFuture=NV,nt.set=yV,nt.eras=uj,nt.erasParse=cj,nt.erasConvertYear=hj,nt.erasAbbrRegex=wj,nt.erasNameRegex=pj,nt.erasNarrowRegex=vj,nt.months=ZV,nt.monthsShort=QV,nt.monthsParse=eW,nt.monthsRegex=rW,nt.monthsShortRegex=nW,nt.week=oW,nt.firstDayOfYear=lW,nt.firstDayOfWeek=aW,nt.weekdays=vW,nt.weekdaysMin=yW,nt.weekdaysShort=CW,nt.weekdaysParse=SW,nt.weekdaysRegex=_W,nt.weekdaysShortRegex=MW,nt.weekdaysMinRegex=IW,nt.isPM=OW,nt.meridiem=HW;function Ef(t,e,n,r){var i=Ho(),o=ji().set(r,e);return i[n](o,t)}function GP(t,e,n){if(Io(t)&&(e=t,t=void 0),t=t||"",e!=null)return Ef(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Ef(t,r,n,"month");return i}function YC(t,e,n,r){typeof t=="boolean"?(Io(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,Io(e)&&(n=e,e=void 0),e=e||"");var i=Ho(),o=t?i._week.dow:0,s,a=[];if(n!=null)return Ef(e,(n+o)%7,r,"day");for(s=0;s<7;s++)a[s]=Ef(e,(s+o)%7,r,"day");return a}function $j(t,e){return GP(t,e,"months")}function Fj(t,e){return GP(t,e,"monthsShort")}function Vj(t,e,n){return YC(t,e,n,"weekdays")}function Wj(t,e,n){return YC(t,e,n,"weekdaysShort")}function Bj(t,e,n){return YC(t,e,n,"weekdaysMin")}Rs("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=Ue(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}}),Q.lang=jr("moment.lang is deprecated. Use moment.locale instead.",Rs),Q.langData=jr("moment.langData is deprecated. Use moment.localeData instead.",Ho);var No=Math.abs;function jj(){var t=this._data;return this._milliseconds=No(this._milliseconds),this._days=No(this._days),this._months=No(this._months),t.milliseconds=No(t.milliseconds),t.seconds=No(t.seconds),t.minutes=No(t.minutes),t.hours=No(t.hours),t.months=No(t.months),t.years=No(t.years),this}function qP(t,e,n,r){var i=gi(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function Uj(t,e){return qP(this,t,e,1)}function zj(t,e){return qP(this,t,e,-1)}function KP(t){return t<0?Math.floor(t):Math.ceil(t)}function Yj(){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+=KP(GC(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=zr(t/1e3),r.seconds=i%60,o=zr(i/60),r.minutes=o%60,s=zr(o/60),r.hours=s%24,e+=zr(s/24),l=zr(XP(e)),n+=l,e-=KP(GC(l)),a=zr(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function XP(t){return t*4800/146097}function GC(t){return t*146097/4800}function Gj(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=Ur(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+XP(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(GC(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 Do(t){return function(){return this.as(t)}}var ZP=Do("ms"),qj=Do("s"),Kj=Do("m"),Xj=Do("h"),Zj=Do("d"),Qj=Do("w"),Jj=Do("M"),eU=Do("Q"),tU=Do("y"),nU=ZP;function rU(){return gi(this)}function iU(t){return t=Ur(t),this.isValid()?this[t+"s"]():NaN}function pa(t){return function(){return this.isValid()?this._data[t]:NaN}}var oU=pa("milliseconds"),sU=pa("seconds"),aU=pa("minutes"),lU=pa("hours"),uU=pa("days"),cU=pa("months"),hU=pa("years");function dU(){return zr(this.days()/7)}var ko=Math.round,ql={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function fU(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function gU(t,e,n,r){var i=gi(t).abs(),o=ko(i.as("s")),s=ko(i.as("m")),a=ko(i.as("h")),l=ko(i.as("d")),u=ko(i.as("M")),c=ko(i.as("w")),h=ko(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,fU.apply(null,d)}function mU(t){return t===void 0?ko:typeof t=="function"?(ko=t,!0):!1}function pU(t,e){return ql[t]===void 0?!1:e===void 0?ql[t]:(ql[t]=e,t==="s"&&(ql.ss=e-1),!0)}function wU(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=ql,i,o;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},ql,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),o=gU(this,!n,r,i),n&&(o=i.pastFuture(+this,o)),i.postformat(o)}var qC=Math.abs;function Kl(t){return(t>0)-(t<0)||+t}function Tf(){if(!this.isValid())return this.localeData().invalidDate();var t=qC(this._milliseconds)/1e3,e=qC(this._days),n=qC(this._months),r,i,o,s,a=this.asSeconds(),l,u,c,h;return a?(r=zr(t/60),i=zr(r/60),t%=60,r%=60,o=zr(n/12),n%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=Kl(this._months)!==Kl(a)?"-":"",c=Kl(this._days)!==Kl(a)?"-":"",h=Kl(this._milliseconds)!==Kl(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 Ge=vf.prototype;Ge.isValid=cB,Ge.abs=jj,Ge.add=Uj,Ge.subtract=zj,Ge.as=Gj,Ge.asMilliseconds=ZP,Ge.asSeconds=qj,Ge.asMinutes=Kj,Ge.asHours=Xj,Ge.asDays=Zj,Ge.asWeeks=Qj,Ge.asMonths=Jj,Ge.asQuarters=eU,Ge.asYears=tU,Ge.valueOf=nU,Ge._bubble=Yj,Ge.clone=rU,Ge.get=iU,Ge.milliseconds=oU,Ge.seconds=sU,Ge.minutes=aU,Ge.hours=lU,Ge.days=uU,Ge.weeks=dU,Ge.months=cU,Ge.years=hU,Ge.humanize=wU,Ge.toISOString=Tf,Ge.toString=Tf,Ge.toJSON=Tf,Ge.locale=LP,Ge.localeData=FP,Ge.toIsoString=jr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Tf),Ge.lang=$P,be("X",0,0,"unix"),be("x",0,0,"valueOf"),de("x",hf),de("X",$V),vt("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),vt("x",function(t,e,n){n._d=new Date(Ue(t))});Q.version="2.30.1",vV(Tt),Q.fn=te,Q.min=sB,Q.max=aB,Q.now=lB,Q.utc=ji,Q.unix=kj,Q.months=$j,Q.isDate=Mc,Q.locale=Rs,Q.invalid=of,Q.duration=gi,Q.isMoment=di,Q.weekdays=Vj,Q.parseZone=Lj,Q.localeData=Ho,Q.isDuration=Cf,Q.monthsShort=Fj,Q.weekdaysMin=Bj,Q.defineLocale=DC,Q.updateLocale=LW,Q.locales=$W,Q.weekdaysShort=Wj,Q.normalizeUnits=Ur,Q.relativeTimeRounding=mU,Q.relativeTimeThreshold=pU,Q.calendarFormat=HB,Q.prototype=te,Q.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 QP={},KC,JP;function Gi(){if(JP)return KC;JP=1;var t=Jt(),e=Set.prototype;return KC={Set,add:t(e.add),has:t(e.has),remove:t(e.delete),proto:e},KC}var XC,eO;function wa(){if(eO)return XC;eO=1;var t=Gi().has;return XC=function(e){return t(e),e},XC}var ZC,tO;function va(){if(tO)return ZC;tO=1;var t=An();return ZC=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},ZC}var QC,nO;function $c(){if(nO)return QC;nO=1;var t=Jt(),e=va(),n=Gi(),r=n.Set,i=n.proto,o=t(i.forEach),s=t(i.keys),a=s(new r).next;return QC=function(l,u,c){return c?e({iterator:s(l),next:a},u):o(l,u)},QC}var JC,rO;function ey(){if(rO)return JC;rO=1;var t=Gi(),e=$c(),n=t.Set,r=t.add;return JC=function(i){var o=new n;return e(i,function(s){r(o,s)}),o},JC}var ty,iO;function Fc(){if(iO)return ty;iO=1;var t=LM(),e=Gi();return ty=t(e.proto,"size","get")||function(n){return n.size},ty}var ny,oO;function Ca(){if(oO)return ny;oO=1;var t=nr(),e=sn(),n=An(),r=_c(),i=Bi(),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)}},ny=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)},ny}var ry,sO;function vU(){if(sO)return ry;sO=1;var t=wa(),e=Gi(),n=ey(),r=Fc(),i=Ca(),o=$c(),s=va(),a=e.has,l=e.remove;return ry=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},ry}var iy,aO;function ya(){if(aO)return iy;aO=1;var t=Dl(),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 iy=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}},iy}var lO;function CU(){if(lO)return QP;lO=1;var t=Ct(),e=vU(),n=ya(),r=!n("difference",function(i){return i.size===0});return t({target:"Set",proto:!0,real:!0,forced:r},{difference:e}),QP}CU();var uO={},oy,cO;function yU(){if(cO)return oy;cO=1;var t=wa(),e=Gi(),n=Fc(),r=Ca(),i=$c(),o=va(),s=e.Set,a=e.add,l=e.has;return oy=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},oy}var hO;function bU(){if(hO)return uO;hO=1;var t=Ct(),e=Tn(),n=yU(),r=ya(),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}),uO}bU();var dO={},sy,fO;function SU(){if(fO)return sy;fO=1;var t=wa(),e=Gi().has,n=Fc(),r=Ca(),i=$c(),o=va(),s=Fl();return sy=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},sy}var gO;function RU(){if(gO)return dO;gO=1;var t=Ct(),e=SU(),n=ya(),r=!n("isDisjointFrom",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isDisjointFrom:e}),dO}RU();var mO={},ay,pO;function EU(){if(pO)return ay;pO=1;var t=wa(),e=Fc(),n=$c(),r=Ca();return ay=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},ay}var wO;function TU(){if(wO)return mO;wO=1;var t=Ct(),e=EU(),n=ya(),r=!n("isSubsetOf",function(i){return i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSubsetOf:e}),mO}TU();var vO={},ly,CO;function _U(){if(CO)return ly;CO=1;var t=wa(),e=Gi().has,n=Fc(),r=Ca(),i=va(),o=Fl();return ly=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},ly}var yO;function MU(){if(yO)return vO;yO=1;var t=Ct(),e=_U(),n=ya(),r=!n("isSupersetOf",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSupersetOf:e}),vO}MU();var bO={},uy,SO;function IU(){if(SO)return uy;SO=1;var t=wa(),e=Gi(),n=ey(),r=Ca(),i=va(),o=e.add,s=e.has,a=e.remove;return uy=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},uy}var RO;function PU(){if(RO)return bO;RO=1;var t=Ct(),e=IU(),n=ya();return t({target:"Set",proto:!0,real:!0,forced:!n("symmetricDifference")},{symmetricDifference:e}),bO}PU();var EO={},cy,TO;function OU(){if(TO)return cy;TO=1;var t=wa(),e=Gi().add,n=ey(),r=Ca(),i=va();return cy=function(s){var a=t(this),l=r(s).getIterator(),u=n(a);return i(l,function(c){e(u,c)}),u},cy}var _O;function xU(){if(_O)return EO;_O=1;var t=Ct(),e=OU(),n=ya();return t({target:"Set",proto:!0,real:!0,forced:!n("union")},{union:e}),EO}xU();function AU(t){const e=t.length;let n=0;for(;n<e;)t[n]=[t[n]],n+=1}function MO(t,e){const n=e.length;let r=0;for(;r<n;)t.push(e[r]),r+=1}function _f(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 ir(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 ba(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 ze(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 D(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 HU(t){const e=[];return D(t,n=>{e.indexOf(n)===-1&&e.push(n)}),e}function IO(){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 D(i,s=>{o=o.filter(a=>!s.includes(a))}),o}function PO(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function it(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 ir(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 fe(t){return typeof t<"u"}function At(t){return typeof t>"u"}function jt(t){return t===null||t===""||At(t)}function NU(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const Vc="length",Wc=t=>parseInt(t,16),OO=t=>parseInt(t,10),Mf=(t,e,n)=>t.substr(e,n),Bc=t=>t.codePointAt(0)-65,hy=t=>`${t}`.replace(/\-/g,""),DU=t=>Wc(Mf(hy(t),Wc("12"),Bc("F")))/(Wc(Mf(hy(t),Bc("B"),~~![][Vc]))||9),kU=()=>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 xO=!1;const AO={invalid:()=>it`
|
|
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 it`
|
|
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:()=>it`
|
|
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:()=>""},HO={invalid:()=>it`
|
|
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 it`
|
|
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:()=>it`
|
|
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 LU(t,e){const n=!jt(t),r=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",i="15.3.0";let o,s="invalid",a="invalid";t=hy(t||"");const l=$U(t);if(n||r||l)if(l){const u=Q("29/04/2025","DD/MM/YYYY"),c=Math.floor(u.toDate().getTime()/864e5),h=DU(t);o=Q((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(kU()&&(s="valid",a="valid"),!xO&&s!=="valid"&&(AO[s]({keyValidityDate:o,hotVersion:i})&&console[s==="non_commercial"?"info":"warn"](AO[s]({keyValidityDate:o,hotVersion:i})),xO=!0),a!=="valid"&&e.parentNode&&HO[a]({keyValidityDate:o,hotVersion:i})){const c=document.createElement("div");c.className="handsontable hot-display-license-info",c.innerHTML=HO[a]({keyValidityDate:o,hotVersion:i}),e.parentNode.insertBefore(c,e.nextSibling)}}function $U(t){let e=[][Vc],n=e;if(t[Vc]!==Bc("Z"))return!1;for(let r="",i="B<H4P+".split(""),o=Bc(i.shift());o;o=Bc(i.shift()||"A"))--o<""[Vc]?n=n|(OO(`${OO(Wc(r)+(Wc(Mf(t,Math.abs(o),2))+[]).padStart(2,"0"))}`)%97||2)>>1:r=Mf(t,o,o?i[Vc]===1?9:8:6);return n===e}var NO={},dy,DO;function fy(){if(DO)return dy;DO=1;var t=Jt();return dy=t([].slice),dy}var gy,kO;function FU(){if(kO)return gy;kO=1;var t=Jt(),e=rI(),n=on(),r=da(),i=rf(),o=t([].push);return gy=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 S=0;S<h;S++)if(l[S]===f)return m}}},gy}var LO;function VU(){if(LO)return NO;LO=1;var t=Ct(),e=Dl(),n=nf(),r=An(),i=Jt(),o=Tn(),s=on(),a=Pw(),l=fy(),u=FU(),c=_w(),h=String,d=e("JSON","stringify"),f=i(/./.exec),m=i("".charAt),S=i("".charCodeAt),b=i("".replace),T=i(1 .toString),v=/[\uD800-\uDFFF]/g,O=/^[\uD800-\uDBFF]$/,P=/^[\uDC00-\uDFFF]$/,_=!c||o(function(){var G=e("Symbol")("stringify detection");return d([G])!=="[null]"||d({a:G})!=="{}"||d(Object(G))!=="{}"}),M=o(function(){return d("\uDF06\uD834")!=='"\\udf06\\ud834"'||d("\uDEAD")!=='"\\udead"'}),H=function(G,U){var ne=l(arguments),ee=u(U);if(!(!s(ee)&&(G===void 0||a(G))))return ne[1]=function(he,ie){if(s(ee)&&(ie=r(ee,this,h(he),ie)),!a(ie))return ie},n(d,null,ne)},X=function(G,U,ne){var ee=m(ne,U-1),he=m(ne,U+1);return f(O,G)&&!f(P,he)||f(P,G)&&!f(O,ee)?"\\u"+T(S(G,0),16):G};return d&&t({target:"JSON",stat:!0,arity:3,forced:_||M},{stringify:function(U,ne,ee){var he=l(arguments),ie=n(_?H:d,null,he);return M&&typeof ie=="string"?b(ie,v,X):ie}}),NO}VU();var $O={},FO={},VO;function WU(){if(VO)return FO;VO=1;var t=Ct(),e=Vl(),n=nr(),r=sn(),i=Bi();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})}}),FO}var WO;function BU(){return WO||(WO=1,WU()),$O}BU();function jc(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},ke(t,(n,r)=>{r!=="__children"&&(n&&typeof n=="object"&&!Array.isArray(n)?e[r]=jc(n):Array.isArray(n)?n.length&&typeof n[0]=="object"&&!Array.isArray(n[0])?e[r]=[jc(n[0])]:e[r]=[]:e[r]=null)})),e}function jU(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function an(t,e,n){const r=Array.isArray(n);return ke(e,(i,o)=>{(r===!1||n.includes(o))&&(t[o]=i)}),t}function If(t,e){ke(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]={}),If(t[r],e[r])):t[r]=e[r]})}function jn(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function qi(t){const e={};return ke(t,(n,r)=>{e[r]=n}),e}function ft(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 D(n,i=>{t.MIXINS.push(i.MIXIN_NAME),ke(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 S=m;return(Array.isArray(S)||De(S))&&(S=jn(S)),S};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 my(t,e){return JSON.stringify(t)===JSON.stringify(e)}function De(t){return Object.prototype.toString.call(t)==="[object Object]"}function Lo(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 ke(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 UU(t,e){const n=e.split(".");let r=t;return ke(n,i=>{if(r=r[i],r===void 0)return r=void 0,!1}),r}function py(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?(ln(i,o)||(i[o]={}),i=i[o]):i[o]=n)})}function wy(t){if(!De(t))return 0;const e=function(n){let r=0;return De(n)?ke(n,(i,o)=>{o!=="__children"&&(r+=e(i))}):r+=1,r};return e(t)}function Rr(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 ln(t,e){return Object.prototype.hasOwnProperty.call(t,e)}const zU="hooksRefRegisterer",BO={_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){D(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){ke(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};Lo(BO,"MIXIN_NAME",zU,{writable:!1,enumerable:!1});function jO(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 YU(t){if(Array.isArray(t))return t}function GU(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function qU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KU(t,e){return YU(t)||GU(t,e)||XU(t,e)||qU()}function XU(t,e){if(t){if(typeof t=="string")return jO(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)?jO(t,e):void 0}}const UO=Object.entries,zO=Object.setPrototypeOf,ZU=Object.isFrozen,QU=Object.getPrototypeOf,JU=Object.getOwnPropertyDescriptor;let _n=Object.freeze,Mn=Object.seal,Xl=Object.create,YO=typeof Reflect<"u"&&Reflect,vy=YO.apply,Cy=YO.construct;_n||(_n=function(e){return e}),Mn||(Mn=function(e){return e}),vy||(vy=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)}),Cy||(Cy=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 Zl=un(Array.prototype.forEach),ez=un(Array.prototype.lastIndexOf),GO=un(Array.prototype.pop),Ql=un(Array.prototype.push),tz=un(Array.prototype.splice),Ts=Array.isArray,Uc=un(String.prototype.toLowerCase),yy=un(String.prototype.toString),qO=un(String.prototype.match),zc=un(String.prototype.replace),KO=un(String.prototype.indexOf),nz=un(String.prototype.trim),rz=un(Number.prototype.toString),iz=un(Boolean.prototype.toString),XO=typeof BigInt>"u"?null:un(BigInt.prototype.toString),ZO=typeof Symbol>"u"?null:un(Symbol.prototype.toString),Cn=un(Object.prototype.hasOwnProperty),Yc=un(Object.prototype.toString),yn=un(RegExp.prototype.test),Sa=oz(TypeError);function un(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 vy(t,e,r)}}function oz(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Cy(t,n)}}function qe(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Uc;if(zO&&zO(t,null),!Ts(e))return t;let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=n(i);o!==i&&(ZU(e)||(e[r]=o),i=o)}t[i]=!0}return t}function sz(t){for(let e=0;e<t.length;e++)Cn(t,e)||(t[e]=null);return t}function Un(t){const e=Xl(null);for(const r of UO(t)){var n=KU(r,2);const i=n[0],o=n[1];Cn(t,i)&&(Ts(o)?e[i]=sz(o):o&&typeof o=="object"&&o.constructor===Object?e[i]=Un(o):e[i]=o)}return e}function az(t){switch(typeof t){case"string":return t;case"number":return rz(t);case"boolean":return iz(t);case"bigint":return XO?XO(t):"0";case"symbol":return ZO?ZO(t):"Symbol()";case"undefined":return Yc(t);case"function":case"object":{if(t===null)return Yc(t);const e=t,n=Ki(e,"toString");if(typeof n=="function"){const r=n(e);return typeof r=="string"?r:Yc(r)}return Yc(t)}default:return Yc(t)}}function Ki(t,e){for(;t!==null;){const r=JU(t,e);if(r){if(r.get)return un(r.get);if(typeof r.value=="function")return un(r.value)}t=QU(t)}function n(){return null}return n}function lz(t){try{return yn(t,""),!0}catch{return!1}}const QO=_n(["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"]),by=_n(["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"]),Sy=_n(["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"]),uz=_n(["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"]),Ry=_n(["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"]),cz=_n(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),JO=_n(["#text"]),ex=_n(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","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"]),Ey=_n(["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","dominant-baseline","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-orientation","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"]),tx=_n(["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"]),Pf=_n(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hz=Mn(/{{[\w\W]*|^[\w\W]*}}/g),dz=Mn(/<%[\w\W]*|^[\w\W]*%>/g),fz=Mn(/\${[\w\W]*/g),gz=Mn(/^data-[\-\w.\u00B7-\uFFFF]+$/),mz=Mn(/^aria-[\-\w]+$/),nx=Mn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pz=Mn(/^(?:\w+script|data):/i),wz=Mn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vz=Mn(/^html$/i),Cz=Mn(/^[a-z][.\w]*(-[.\w]+)+$/i),rx=Mn(/<[/\w!]/g),ix=Mn(/<[/\w]/g),yz=Mn(/<\/no(script|embed|frames)/i),bz=Mn(/\/>/i),Er={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Sz=function(){return typeof window>"u"?null:window},Rz=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}},ox=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},_s=function(e,n,r,i){return Cn(e,n)&&Ts(e[n])?qe(i.base?Un(i.base):{},e[n],i.transform):r};function sx(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sz();const e=re=>sx(re);if(e.version="3.4.12",e.removed=[],!t||!t.document||t.document.nodeType!==Er.document||!t.Element)return e.isSupported=!1,e;let n=t.document;const r=n,i=r.currentScript;t.DocumentFragment;const o=t.HTMLTemplateElement,s=t.Node,a=t.Element,l=t.NodeFilter,u=t.NamedNodeMap;u===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const c=t.DOMParser,h=t.trustedTypes,d=a.prototype,f=Ki(d,"cloneNode"),m=Ki(d,"remove"),S=Ki(d,"nextSibling"),b=Ki(d,"childNodes"),T=Ki(d,"parentNode"),v=Ki(d,"shadowRoot"),O=Ki(d,"attributes"),P=s&&s.prototype?Ki(s.prototype,"nodeType"):null,_=s&&s.prototype?Ki(s.prototype,"nodeName"):null;if(typeof o=="function"){const re=n.createElement("template");re.content&&re.content.ownerDocument&&(n=re.content.ownerDocument)}let M,H="",X,G=!1,U=0;const ne=function(){if(U>0)throw Sa('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ee=function(E){ne(),U++;try{return M.createHTML(E)}finally{U--}},he=function(E){ne(),U++;try{return M.createScriptURL(E)}finally{U--}},ie=function(){return G||(X=Rz(h,i),G=!0),X},ae=n,st=ae.implementation,ve=ae.createNodeIterator,Ie=ae.createDocumentFragment,pt=ae.getElementsByTagName,Xt=r.importNode;let K=ox();e.isSupported=typeof UO=="function"&&typeof T=="function"&&st&&st.createHTMLDocument!==void 0;const g=hz,w=dz,p=fz,I=gz,k=mz,F=pz,j=wz,Y=Cz;let y=nx,R=null;const C=qe({},[...QO,...by,...Sy,...Ry,...JO]);let x=null;const A=qe({},[...ex,...Ey,...tx,...Pf]);let N=Object.seal(Xl(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}})),W=null,L=null;const $=Object.seal(Xl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let B=!0,V=!0,q=!1,ue=!0,ce=!1,Te=!0,Fe=!1,et=!1,_e=null,We=null,Rt=!1,yr=!1,$i=!1,li=!1,Wt=!0,Fr=!1;const Zt="user-content-";let Pt=!0,je=!1,xn={},Vr=null;const wc=qe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let uF=null;const cF=qe({},["audio","video","img","source","image","track"]);let t_=null;const hF=qe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ew="http://www.w3.org/1998/Math/MathML",tw="http://www.w3.org/2000/svg",_o="http://www.w3.org/1999/xhtml";let vc=_o,n_=!1,r_=null;const hue=qe({},[ew,tw,_o],yy),dF=_n(["mi","mo","mn","ms","mtext"]);let i_=qe({},dF);const fF=_n(["annotation-xml"]);let o_=qe({},fF);const due=qe({},["title","style","font","a","script"]);let qd=null;const fue=["application/xhtml+xml","text/html"],gue="text/html";let Bt=null,Cc=null;const mue=n.createElement("form"),gF=function(E){return E instanceof RegExp||E instanceof Function},s_=function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Cc&&Cc===E)return;(!E||typeof E!="object")&&(E={}),E=Un(E),qd=fue.indexOf(E.PARSER_MEDIA_TYPE)===-1?gue:E.PARSER_MEDIA_TYPE,Bt=qd==="application/xhtml+xml"?yy:Uc,R=_s(E,"ALLOWED_TAGS",C,{transform:Bt}),x=_s(E,"ALLOWED_ATTR",A,{transform:Bt}),r_=_s(E,"ALLOWED_NAMESPACES",hue,{transform:yy}),t_=_s(E,"ADD_URI_SAFE_ATTR",hF,{transform:Bt,base:hF}),uF=_s(E,"ADD_DATA_URI_TAGS",cF,{transform:Bt,base:cF}),Vr=_s(E,"FORBID_CONTENTS",wc,{transform:Bt}),W=_s(E,"FORBID_TAGS",Un({}),{transform:Bt}),L=_s(E,"FORBID_ATTR",Un({}),{transform:Bt}),xn=Cn(E,"USE_PROFILES")?E.USE_PROFILES&&typeof E.USE_PROFILES=="object"?Un(E.USE_PROFILES):E.USE_PROFILES:!1,B=E.ALLOW_ARIA_ATTR!==!1,V=E.ALLOW_DATA_ATTR!==!1,q=E.ALLOW_UNKNOWN_PROTOCOLS||!1,ue=E.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ce=E.SAFE_FOR_TEMPLATES||!1,Te=E.SAFE_FOR_XML!==!1,Fe=E.WHOLE_DOCUMENT||!1,yr=E.RETURN_DOM||!1,$i=E.RETURN_DOM_FRAGMENT||!1,li=E.RETURN_TRUSTED_TYPE||!1,Rt=E.FORCE_BODY||!1,Wt=E.SANITIZE_DOM!==!1,Fr=E.SANITIZE_NAMED_PROPS||!1,Pt=E.KEEP_CONTENT!==!1,je=E.IN_PLACE||!1,y=lz(E.ALLOWED_URI_REGEXP)?E.ALLOWED_URI_REGEXP:nx,vc=typeof E.NAMESPACE=="string"?E.NAMESPACE:_o,i_=Cn(E,"MATHML_TEXT_INTEGRATION_POINTS")&&E.MATHML_TEXT_INTEGRATION_POINTS&&typeof E.MATHML_TEXT_INTEGRATION_POINTS=="object"?Un(E.MATHML_TEXT_INTEGRATION_POINTS):qe({},dF),o_=Cn(E,"HTML_INTEGRATION_POINTS")&&E.HTML_INTEGRATION_POINTS&&typeof E.HTML_INTEGRATION_POINTS=="object"?Un(E.HTML_INTEGRATION_POINTS):qe({},fF);const z=Cn(E,"CUSTOM_ELEMENT_HANDLING")&&E.CUSTOM_ELEMENT_HANDLING&&typeof E.CUSTOM_ELEMENT_HANDLING=="object"?Un(E.CUSTOM_ELEMENT_HANDLING):Xl(null);if(N=Xl(null),Cn(z,"tagNameCheck")&&gF(z.tagNameCheck)&&(N.tagNameCheck=z.tagNameCheck),Cn(z,"attributeNameCheck")&&gF(z.attributeNameCheck)&&(N.attributeNameCheck=z.attributeNameCheck),Cn(z,"allowCustomizedBuiltInElements")&&typeof z.allowCustomizedBuiltInElements=="boolean"&&(N.allowCustomizedBuiltInElements=z.allowCustomizedBuiltInElements),Mn(N),ce&&(V=!1),$i&&(yr=!0),xn&&(R=qe({},JO),x=Xl(null),xn.html===!0&&(qe(R,QO),qe(x,ex)),xn.svg===!0&&(qe(R,by),qe(x,Ey),qe(x,Pf)),xn.svgFilters===!0&&(qe(R,Sy),qe(x,Ey),qe(x,Pf)),xn.mathMl===!0&&(qe(R,Ry),qe(x,tx),qe(x,Pf))),$.tagCheck=null,$.attributeCheck=null,Cn(E,"ADD_TAGS")&&(typeof E.ADD_TAGS=="function"?$.tagCheck=E.ADD_TAGS:Ts(E.ADD_TAGS)&&(R===C&&(R=Un(R)),qe(R,E.ADD_TAGS,Bt))),Cn(E,"ADD_ATTR")&&(typeof E.ADD_ATTR=="function"?$.attributeCheck=E.ADD_ATTR:Ts(E.ADD_ATTR)&&(x===A&&(x=Un(x)),qe(x,E.ADD_ATTR,Bt))),Cn(E,"ADD_URI_SAFE_ATTR")&&Ts(E.ADD_URI_SAFE_ATTR)&&qe(t_,E.ADD_URI_SAFE_ATTR,Bt),Cn(E,"FORBID_CONTENTS")&&Ts(E.FORBID_CONTENTS)&&(Vr===wc&&(Vr=Un(Vr)),qe(Vr,E.FORBID_CONTENTS,Bt)),Cn(E,"ADD_FORBID_CONTENTS")&&Ts(E.ADD_FORBID_CONTENTS)&&(Vr===wc&&(Vr=Un(Vr)),qe(Vr,E.ADD_FORBID_CONTENTS,Bt)),Pt&&(R["#text"]=!0),Fe&&qe(R,["html","head","body"]),R.table&&(qe(R,["tbody"]),delete W.tbody),E.TRUSTED_TYPES_POLICY){if(typeof E.TRUSTED_TYPES_POLICY.createHTML!="function")throw Sa('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof E.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Sa('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const J=M;M=E.TRUSTED_TYPES_POLICY;try{H=ee("")}catch(pe){throw M=J,pe}}else E.TRUSTED_TYPES_POLICY===null?(M=void 0,H=""):(M===void 0&&(M=ie()),M&&typeof H=="string"&&(H=ee("")));_n&&_n(E),Cc=E},mF=qe({},[...by,...Sy,...uz]),pF=qe({},[...Ry,...cz]),pue=function(E,z,J){return z.namespaceURI===_o?E==="svg":z.namespaceURI===ew?E==="svg"&&(J==="annotation-xml"||i_[J]):!!mF[E]},wue=function(E,z,J){return z.namespaceURI===_o?E==="math":z.namespaceURI===tw?E==="math"&&o_[J]:!!pF[E]},vue=function(E,z,J){return z.namespaceURI===tw&&!o_[J]||z.namespaceURI===ew&&!i_[J]?!1:!pF[E]&&(due[E]||!mF[E])},Cue=function(E){let z=T(E);(!z||!z.tagName)&&(z={namespaceURI:vc,tagName:"template"});const J=Uc(E.tagName),pe=Uc(z.tagName);return r_[E.namespaceURI]?E.namespaceURI===tw?pue(J,z,pe):E.namespaceURI===ew?wue(J,z,pe):E.namespaceURI===_o?vue(J,z,pe):!!(qd==="application/xhtml+xml"&&r_[E.namespaceURI]):!1},ha=function(E){Ql(e.removed,{element:E});try{T(E).removeChild(E)}catch{if(m(E),!T(E))throw Sa("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},nw=function(E){a_(E);const z=b(E);if(z){const pe=[];Zl(z,Ee=>{Ql(pe,Ee)}),Zl(pe,Ee=>{try{m(Ee)}catch{}})}const J=O(E);if(J)for(let pe=J.length-1;pe>=0;--pe){const Ee=J[pe],Pe=Ee&&Ee.name;if(typeof Pe=="string")try{E.removeAttribute(Pe)}catch{}}},Nl=function(E,z){try{Ql(e.removed,{attribute:z.getAttributeNode(E),from:z})}catch{Ql(e.removed,{attribute:null,from:z})}if(z.removeAttribute(E),E==="is")if(yr||$i)try{ha(z)}catch{}else try{z.setAttribute(E,"")}catch{}},yue=function(E){const z=O(E);if(z)for(let J=z.length-1;J>=0;--J){const pe=z[J],Ee=pe&&pe.name;if(!(typeof Ee!="string"||x[Bt(Ee)]))try{E.removeAttribute(Ee)}catch{}}},a_=function(E){const z=[E];for(;z.length>0;){const J=z.pop();(P?P(J):J.nodeType)===Er.element&&yue(J);const Ee=b(J);if(Ee)for(let Pe=Ee.length-1;Pe>=0;--Pe)z.push(Ee[Pe])}},bue=function(E){if(!Te)return;const z=[E];for(;z.length>0;){const J=z.pop(),pe=P?P(J):J.nodeType;if(pe===Er.processingInstruction||pe===Er.comment&&yn(ix,J.data)){try{m(J)}catch{}continue}if(pe===Er.element){const Pe=J,Qt=Bt(_?_(J):J.nodeName);try{Pe.hasAttribute&&Pe.hasAttribute("patchsrc")&&Pe.removeAttribute("patchsrc"),Pe.hasAttribute&&Pe.hasAttribute("for")&&Qt!=="label"&&Qt!=="output"&&Pe.removeAttribute("for")}catch{}}const Ee=b(J);if(Ee)for(let Pe=Ee.length-1;Pe>=0;--Pe)z.push(Ee[Pe])}},wF=function(E){let z=null,J=null;if(Rt)E="<remove></remove>"+E;else{const Pe=qO(E,/^[\r\n\t ]+/);J=Pe&&Pe[0]}qd==="application/xhtml+xml"&&vc===_o&&(E='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+E+"</body></html>");const pe=M?ee(E):E;if(vc===_o)try{z=new c().parseFromString(pe,qd)}catch{}if(!z||!z.documentElement){z=st.createDocument(vc,"template",null);try{z.documentElement.innerHTML=n_?H:pe}catch{}}const Ee=z.body||z.documentElement;return E&&J&&Ee.insertBefore(n.createTextNode(J),Ee.childNodes[0]||null),vc===_o?pt.call(z,Fe?"html":"body")[0]:Fe?z.documentElement:Ee},vF=function(E){return ve.call(E.ownerDocument||E,E,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},rw=function(E){return E=zc(E,g," "),E=zc(E,w," "),E=zc(E,p," "),E},l_=function(E){var z;E.normalize();const J=ve.call(E.ownerDocument||E,E,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let pe=J.nextNode();for(;pe;)pe.data=rw(pe.data),pe=J.nextNode();const Ee=(z=E.querySelectorAll)===null||z===void 0?void 0:z.call(E,"template");Ee&&Zl(Ee,Pe=>{yc(Pe.content)&&l_(Pe.content)})},iw=function(E){const z=_?_(E):null;return typeof z!="string"||Bt(z)!=="form"?!1:typeof E.nodeName!="string"||typeof E.textContent!="string"||typeof E.removeChild!="function"||E.attributes!==O(E)||typeof E.removeAttribute!="function"||typeof E.setAttribute!="function"||typeof E.namespaceURI!="string"||typeof E.insertBefore!="function"||typeof E.hasChildNodes!="function"||E.nodeType!==P(E)||E.childNodes!==b(E)},yc=function(E){if(!P||typeof E!="object"||E===null)return!1;try{return P(E)===Er.documentFragment}catch{return!1}},Kd=function(E){if(!P||typeof E!="object"||E===null)return!1;try{return typeof P(E)=="number"}catch{return!1}};function Mo(re,E,z){re.length!==0&&Zl(re,J=>{J.call(e,E,z,Cc)})}const Sue=function(E,z){return!!(Te&&E.hasChildNodes()&&!Kd(E.firstElementChild)&&yn(rx,E.textContent)&&yn(rx,E.innerHTML)||Te&&E.namespaceURI===_o&&z==="style"&&Kd(E.firstElementChild)||E.nodeType===Er.processingInstruction||Te&&E.nodeType===Er.comment&&yn(ix,E.data))},Rue=function(E,z){if(!W[z]&&bF(z)&&(N.tagNameCheck instanceof RegExp&&yn(N.tagNameCheck,z)||N.tagNameCheck instanceof Function&&N.tagNameCheck(z)))return!1;if(Pt&&!Vr[z]){const J=T(E),pe=b(E);if(pe&&J){const Ee=pe.length;for(let Pe=Ee-1;Pe>=0;--Pe){const Qt=je?pe[Pe]:f(pe[Pe],!0);J.insertBefore(Qt,S(E))}}}return ha(E),!0},CF=function(E,z){if(Mo(K.beforeSanitizeElements,E,null),E!==z&&T(E)===null)return!0;if(iw(E))return ha(E),!0;const J=Bt(_?_(E):E.nodeName);if(Mo(K.uponSanitizeElement,E,{tagName:J,allowedTags:R}),E!==z&&T(E)===null)return!0;if(Sue(E,J))return ha(E),!0;if(W[J]||!($.tagCheck instanceof Function&&$.tagCheck(J))&&!R[J]){const Ee=Rue(E,J);return Ee===!1&&Mo(K.afterSanitizeElements,E,null),Ee}if((P?P(E):E.nodeType)===Er.element&&!Cue(E)||(J==="noscript"||J==="noembed"||J==="noframes")&&yn(yz,E.innerHTML))return ha(E),!0;if(ce&&E.nodeType===Er.text){const Ee=rw(E.textContent);E.textContent!==Ee&&(Ql(e.removed,{element:E.cloneNode()}),E.textContent=Ee)}return Mo(K.afterSanitizeElements,E,null),!1},yF=function(E,z,J){if(L[z]||Te&&z==="patchsrc"||Te&&z==="for"&&E!=="label"&&E!=="output"||Wt&&(z==="id"||z==="name")&&(J in n||J in mue))return!1;const pe=x[z]||$.attributeCheck instanceof Function&&$.attributeCheck(z,E);if(!(V&&yn(I,z))){if(!(B&&yn(k,z))){if(pe){if(!t_[z]){if(!yn(y,zc(J,j,""))){if(!((z==="src"||z==="xlink:href"||z==="href")&&E!=="script"&&KO(J,"data:")===0&&uF[E])){if(!(q&&!yn(F,zc(J,j,"")))){if(J)return!1}}}}}else if(!(bF(E)&&(N.tagNameCheck instanceof RegExp&&yn(N.tagNameCheck,E)||N.tagNameCheck instanceof Function&&N.tagNameCheck(E))&&(N.attributeNameCheck instanceof RegExp&&yn(N.attributeNameCheck,z)||N.attributeNameCheck instanceof Function&&N.attributeNameCheck(z,E))||z==="is"&&N.allowCustomizedBuiltInElements&&(N.tagNameCheck instanceof RegExp&&yn(N.tagNameCheck,J)||N.tagNameCheck instanceof Function&&N.tagNameCheck(J))))return!1}}return!0},Eue=qe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),bF=function(E){return!Eue[Uc(E)]&&yn(Y,E)},Tue=function(E,z,J,pe){if(M&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!J)switch(h.getAttributeType(E,z)){case"TrustedHTML":return ee(pe);case"TrustedScriptURL":return he(pe)}return pe},_ue=function(E,z,J,pe){try{J?E.setAttributeNS(J,z,pe):E.setAttribute(z,pe),iw(E)?ha(E):GO(e.removed)}catch{Nl(z,E)}},SF=function(E){Mo(K.beforeSanitizeAttributes,E,null);const z=E.attributes;if(!z||iw(E))return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:x,forceKeepAttr:void 0};let pe=z.length;const Ee=Bt(E.nodeName);for(;pe--;){const Pe=z[pe],Qt=Pe.name,Bn=Pe.namespaceURI,Fi=Pe.value,br=Bt(Qt),Vi=Fi;let tr=Qt==="value"?Vi:nz(Vi);if(J.attrName=br,J.attrValue=tr,J.keepAttr=!0,J.forceKeepAttr=void 0,Mo(K.uponSanitizeAttribute,E,J),tr=J.attrValue,Fr&&(br==="id"||br==="name")&&KO(tr,Zt)!==0&&(Nl(Qt,E),tr=Zt+tr),Te&&yn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,tr)){Nl(Qt,E);continue}if(br==="attributename"&&qO(tr,"href")){Nl(Qt,E);continue}if(!J.forceKeepAttr){if(!J.keepAttr){Nl(Qt,E);continue}if(!ue&&yn(bz,tr)){Nl(Qt,E);continue}if(ce&&(tr=rw(tr)),!yF(Ee,br,tr)){Nl(Qt,E);continue}tr=Tue(Ee,br,Bn,tr),tr!==Vi&&_ue(E,Qt,Bn,tr)}}Mo(K.afterSanitizeAttributes,E,null)},ow=function(E){let z=null;const J=vF(E);for(Mo(K.beforeSanitizeShadowDOM,E,null);z=J.nextNode();)if(Mo(K.uponSanitizeShadowNode,z,null),CF(z,E),SF(z),yc(z.content)&&ow(z.content),(P?P(z):z.nodeType)===Er.element){const Ee=v(z);yc(Ee)&&(u_(Ee),ow(Ee))}Mo(K.afterSanitizeShadowDOM,E,null)},u_=function(E){const z=[{node:E,shadow:null}];for(;z.length>0;){const J=z.pop();if(J.shadow){ow(J.shadow);continue}const pe=J.node,Pe=(P?P(pe):pe.nodeType)===Er.element,Qt=b(pe);if(Qt)for(let Bn=Qt.length-1;Bn>=0;--Bn)z.push({node:Qt[Bn],shadow:null});if(Pe){const Bn=_?_(pe):null;if(typeof Bn=="string"&&Bt(Bn)==="template"){const Fi=pe.content;yc(Fi)&&z.push({node:Fi,shadow:null})}}if(Pe){const Bn=v(pe);yc(Bn)&&z.push({node:null,shadow:Bn},{node:Bn,shadow:null})}}};return e.sanitize=function(re){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=null,J=null,pe=null,Ee=null;if(n_=!re,n_&&(re="<!-->"),typeof re!="string"&&!Kd(re)&&(re=az(re),typeof re!="string"))throw Sa("dirty is not a string, aborting");if(!e.isSupported)return re;et?(R=_e,x=We):s_(E),(K.uponSanitizeElement.length>0||K.uponSanitizeAttribute.length>0)&&(R=Un(R)),K.uponSanitizeAttribute.length>0&&(x=Un(x)),e.removed=[];const Pe=je&&typeof re!="string"&&Kd(re);if(Pe){bue(re);const br=_?_(re):re.nodeName;if(typeof br=="string"){const Vi=Bt(br);if(!R[Vi]||W[Vi])throw nw(re),Sa("root node is forbidden and cannot be sanitized in-place")}if(iw(re))throw nw(re),Sa("root node is clobbered and cannot be sanitized in-place");try{u_(re)}catch(Vi){throw nw(re),Vi}}else if(Kd(re))z=wF("<!---->"),J=z.ownerDocument.importNode(re,!0),J.nodeType===Er.element&&J.nodeName==="BODY"||J.nodeName==="HTML"?z=J:z.appendChild(J),u_(J);else{if(!yr&&!ce&&!Fe&&re.indexOf("<")===-1)return M&&li?ee(re):re;if(z=wF(re),!z)return yr?null:li?H:""}z&&Rt&&ha(z.firstChild);const Qt=Pe?re:z,Bn=vF(Qt);try{for(;pe=Bn.nextNode();)CF(pe,Qt),SF(pe),yc(pe.content)&&ow(pe.content)}catch(br){throw Pe&&(nw(re),Zl(e.removed,Vi=>{Vi.element&&a_(Vi.element)})),br}if(Pe)return Zl(e.removed,br=>{br.element&&a_(br.element)}),ce&&l_(re),re;if(yr){if(ce&&l_(z),$i)for(Ee=Ie.call(z.ownerDocument);z.firstChild;)Ee.appendChild(z.firstChild);else Ee=z;return(x.shadowroot||x.shadowrootmode)&&(Ee=Xt.call(r,Ee,!0)),Ee}let Fi=Fe?z.outerHTML:z.innerHTML;return Fe&&R["!doctype"]&&z.ownerDocument&&z.ownerDocument.doctype&&z.ownerDocument.doctype.name&&yn(vz,z.ownerDocument.doctype.name)&&(Fi="<!DOCTYPE "+z.ownerDocument.doctype.name+`>
|
|
27
|
-
`+Fi),ce&&(Fi=rw(Fi)),M&&li?ee(Fi):Fi},e.setConfig=function(){let re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};s_(re),et=!0,_e=R,We=x},e.clearConfig=function(){Cc=null,et=!1,_e=null,We=null,M=X,H=""},e.isValidAttribute=function(re,E,z){Cc||s_({});const J=Bt(re),pe=Bt(E);return yF(J,pe,z)},e.addHook=function(re,E){typeof E=="function"&&Cn(K,re)&&Ql(K[re],E)},e.removeHook=function(re,E){if(Cn(K,re)){if(E!==void 0){const z=ez(K[re],E);return z===-1?void 0:tz(K[re],z,1)[0]}return GO(K[re])}},e.removeHooks=function(re){Cn(K,re)&&(K[re]=[])},e.removeAllHooks=function(){K=ox()},e}var Ez=sx();function mi(t){return t[0].toUpperCase()+t.substr(1)}function ax(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function lx(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function ux(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 cx(t){return Ty(`${t}`,{ALLOWED_TAGS:[]})}function Ty(t,e){return Ez.sanitize(t,e)}const Ra=t=>["tabindex",t],Tz=()=>["role","treegrid"],$o=()=>["role","presentation"],_z=()=>["role","gridcell"],Mz=()=>["role","rowheader"],hx=()=>["role","rowgroup"],Iz=()=>["role","columnheader"],_y=()=>["role","row"],Pz=()=>["role","menu"],Oz=()=>["role","menuitem"],xz=()=>["role","menuitemcheckbox"],Az=()=>["role","combobox"],dx=()=>["role","listbox"],Hz=()=>["role","option"],Nz=()=>["role","checkbox"],Dz=()=>["scope","col"],kz=()=>["scope","row"],Lz=()=>["type","text"],Gc=t=>["aria-label",t],Ea=()=>["aria-hidden","true"],$z=()=>["aria-disabled","true"],Fz=()=>["aria-multiselectable","true"],fx=t=>["aria-haspopup",t],gx=t=>["aria-rowcount",t],Of=t=>["aria-colcount",t],mx=t=>["aria-rowindex",t],My=t=>["aria-colindex",t],Yr=t=>["aria-expanded",t],Vz=t=>["aria-sort",t],px=()=>["aria-readonly","true"],wx=()=>["aria-invalid","true"],vx=t=>["aria-checked",t],Iy=()=>["aria-selected","true"],Wz=()=>["aria-autocomplete","list"],Bz=t=>["aria-controls",t],jz=t=>["aria-activedescendant",t],Uz=t=>["aria-live",t],zz=t=>["aria-relevant",t],Yz=t=>["aria-setsize",t],Gz=t=>["aria-posinset",t];function qz(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 xf(t,e){const n=t.closest(".handsontable");return!!n&&(n.parentNode===e||n===e)}function Kz(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function Jl(t){return Kz(t)&&t.parent}function Ta(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 Af(t,e,n){const r=[];let i=t;for(;i&&(i=Ta(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 Xz(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 _a(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 Zz(t){let e=0,n=t;if(n.previousSibling)for(;n=n.previousSibling;)e+=1;return e}function Ma(t,e,n){const r=n.parentElement.querySelector(`.ht_clone_${t}`);return r?r.contains(e):null}function Cx(t){return!t||!t.length?[]:t.filter(e=>!!e)}function yx(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 Se(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function Z(t,e){typeof e=="string"&&(e=e.split(" ")),e=Cx(e),e.length>0&&t.classList.add(...e)}function ye(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:n,regexes:r}=yx(e,!0);n=Cx(n),n.length>0&&t.classList.remove(...n),r.forEach(i=>{t.classList.forEach(o=>{i.test(o)&&t.classList.remove(o)})})}function Re(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 eu(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}=yx(e,!0);n.forEach(i=>{i!==""&&t.removeAttribute(i)}),r.forEach(i=>{t.getAttributeNames().forEach(o=>{i.test(o)&&t.removeAttribute(o)})})}function bx(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--)bx(e[n])}}function Fo(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const Qz=/(<(.*)>|&(.*);)/;function tu(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;Qz.test(e)?t.innerHTML=n?Ty(e):e:Ia(t,e)}function Ia(t,e){const n=t.firstChild;n&&n.nodeType===3&&n.nextSibling===null?n.textContent=e:(Fo(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function nu(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 nu(r.host.impl);if(r.host)return nu(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 Jz(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 Nn(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 Sx(){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 Oy(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?Sx(e):t.scrollTop}function Rx(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?Py(e):t.scrollLeft}function Hf(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 eY(t){return t.scrollHeight-t.clientHeight}function tY(t){return t.scrollWidth-t.clientWidth}function qc(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 Nf(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 tn(t){return t.offsetWidth}function cn(t){return t.offsetHeight}function Kc(t){return t.clientHeight||t.innerHeight}function Ex(t){return t.clientWidth||t.innerWidth}function Tx(t){return t.selectionStart?t.selectionStart:0}function nY(t){return t.selectionEnd?t.selectionEnd:0}function _x(){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 Df(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 xy;function rY(){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 bn(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return xy===void 0&&(xy=rY(t)),xy}function Mx(t){return t instanceof Window?t.document.body.scrollHeight>t.innerHeight:t.offsetWidth!==t.clientWidth}function Ix(t){return t instanceof Window?t.document.body.scrollWidth>t.innerWidth:t.offsetHeight!==t.clientHeight}function Ay(t,e,n){t.style.transform=`translate3d(${e},${n},0)`}function kf(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function Lf(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function Px(t){return Lf(t)&&t.hasAttribute("data-hot-input")===!1}function Ox(t){return!t.parentNode}function iY(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 xx(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();Re(t,"contenteditable",!0),n&&Re(t,...Ea()),e&&Z(t,"invisibleSelection"),i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i)}function Ax(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&&ye(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function oY(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;xx(t,n),e(),Ax(t,n)}function Vo(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 pi(t,e,n){return(e=sY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sY(t){var e=aY(t,"string");return typeof e=="symbol"?e:e+""}function aY(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 lY="base",Ut=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class ru{static get EDITOR_TYPE(){return lY}constructor(e){pi(this,"hot",void 0),pi(this,"state",Ut.VIRGIN),pi(this,"_opened",!1),pi(this,"_fullEditMode",!1),pi(this,"_closeCallback",null),pi(this,"TD",null),pi(this,"row",null),pi(this,"col",null),pi(this,"prop",null),pi(this,"originalValue",null),pi(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=Nn(n),a=tn(n),l=Nn(this.hot.rootElement),u=tn(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:S}=(e=r.getParentOverlay(n))!==null&&e!==void 0?e:this.hot.view._wt,b=S.name,T=["master","inline_start"].includes(b)?d:0,v=["master","top","bottom"].includes(b)?f:0,O=s.top===l.top?0:1;let P=s.top-l.top-O-T,_=0;this.hot.isRtl()?_=o.innerWidth-s.left-a-m-1+v:_=s.left-l.left-1-v,["top","top_inline_start_corner"].includes(b)&&(P+=r.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(b)&&(_+=Math.abs(r.inlineStartOverlay.getOverlayOffset()));const M=this.hot.hasColHeaders(),H=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),X=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),U=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(M&&H<=0||H===U)&&(P+=1),X<=0&&(_+=1);const ne=i.rowsRenderCalculator.startPosition,ee=i.columnsRenderCalculator.startPosition,he=Math.abs(r.inlineStartOverlay.getScrollPosition()),ie=r.topOverlay.getScrollPosition(),ae=bn(this.hot.rootDocument);let st=n.offsetTop;if(["inline_start","master"].includes(b)&&(st+=ne-ie),["bottom","bottom_inline_start_corner"].includes(b)){const{wtViewport:j,wtTable:Y}=r.bottomOverlay.clone;st+=j.getWorkspaceHeight()-Y.getHeight()-ae}let ve=n.offsetLeft;this.hot.isRtl()?(ve>=0?ve=S.getWidth()-n.offsetLeft:ve=Math.abs(ve),ve+=ee-he-a):["top","master","bottom"].includes(b)&&(ve+=ee-he);const Ie=o.getComputedStyle(this.TD),pt=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",Xt=parseInt(Ie[pt],10)>0?0:1,K=parseInt(Ie.borderTopWidth,10)>0?0:1,g=tn(n)+Xt,w=cn(n)+K,p=Mx(c)?ae:0,I=Ix(h)?ae:0,k=this.hot.view.maximumVisibleElementWidth(ve)-p+Xt,F=Math.max(this.hot.view.maximumVisibleElementHeight(st)-I+K,this.hot.view.getDefaultRowHeight());return{top:P,start:_,height:w,maxHeight:F,width:g,maxWidth:k}}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}}ft(ru,BO);function wi(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function Pa(t){return t.isImmediatePropagationEnabled===!1}function Oa(t){return t.button===2}function Hy(t){return t.button===0}function uY(t){return t instanceof TouchEvent}function cY(t,e){const n={x:t.offsetX,y:t.offsetY};let r=t.target;if(!Vo(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 hY(t,e,n){return(e=dY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dY(t){var e=fY(t,"string");return typeof e=="symbol"?e:e+""}function fY(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 vi{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;hY(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,gY(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 gY(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),wi(this)},t}function $f(t){return window.requestAnimationFrame(t)}function Ff(t){window.cancelAnimationFrame(t)}function Hx(){return"ontouchstart"in window}function mY(){return typeof window<"u"}let iu;function pY(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return iu||(typeof Intl=="object"?iu=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?iu=(n,r)=>`${n}`.localeCompare(r):iu=(n,r)=>n===r?0:n>r?-1:1,iu)}const Gr=t=>{const e={value:!1};return e.test=(n,r)=>{e.value=t(n,r)},e},Ms={chrome:Gr((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:Gr(t=>/CriOS/.test(t)),edge:Gr(t=>/Edge/.test(t)),edgeWebKit:Gr(t=>/EdgiOS/.test(t)),firefox:Gr(t=>/Firefox/.test(t)),firefoxWebKit:Gr(t=>/FxiOS/.test(t)),mobile:Gr(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:Gr((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},Xc={mac:Gr(t=>/^Mac/.test(t)),win:Gr(t=>/^Win/.test(t)),linux:Gr(t=>/^Linux/.test(t)),ios:Gr(t=>/iPhone|iPad|iPod/i.test(t))};function wY(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ke(Ms,n=>{let{test:r}=n;r(t,e)})}function vY(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ke(Xc,e=>{let{test:n}=e;n(t)})}mY()&&(wY(),vY());function Nx(){return Ms.chrome.value}function CY(){return Ms.chromeWebKit.value}function Ny(){return Ms.firefox.value}function yY(){return Ms.firefoxWebKit.value}function Vf(){return Ms.safari.value}function bY(){return Ms.edge.value}function Wo(){return Ms.mobile.value}function Dx(){return Xc.ios.value}function kx(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&Xc.mac.value}function Lx(){return Xc.win.value}function $x(){return Xc.mac.value}var Fx={},Vx={},Dy,Wx;function SY(){if(Wx)return Dy;Wx=1;var t=An(),e=nr(),n=sn(),r=Bi(),i=sC(),o=DI(),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 Dy=function(l){return n(this),e(l),new s(r(this),{mapper:l})},Dy}var Bx;function RY(){if(Bx)return Vx;Bx=1;var t=Ct(),e=SY(),n=ys();return t({target:"Iterator",proto:!0,real:!0,forced:n},{map:e}),Vx}var jx;function EY(){return jx||(jx=1,RY()),Fx}EY();function zn(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 TY(t){return zn(t,[","])}function me(t,e,n){let r=-1;for(typeof e=="function"?(n=e,e=t):r=t-1;++r<=e&&n(r)!==!1;);}function Ux(t,e,n){let r=t+1;for(typeof e=="function"&&(n=e,e=0);--r>=e&&n(r)!==!1;);}function zx(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function Ye(t,e,n){return Math.min(t,e)===t?e:Math.max(t,n)===t?n:t}function Yx(t,e,n){t.addEventListener(e,n,!1)}function Gx(t,e,n){t.removeEventListener(e,n,!1)}function Wf(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function qx(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=Wf(s).fontSize,o.style.fontFamily=Wf(s).fontFamily,o.style.whiteSpace="pre",r.appendChild(o);const f=parseInt(((h=Wf(s))===null||h===void 0?void 0:h.paddingInlineStart)||0,10),m=parseInt(((d=Wf(s))===null||d===void 0?void 0:d.paddingInlineEnd)||0,10),S=o.clientWidth+f+m+1;r.removeChild(o);const b=s.style;b.height=`${n.minHeight}px`,n.minWidth>S?b.width=`${n.minWidth}px`:S>n.maxWidth?b.width=`${n.maxWidth}px`:b.width=`${S}px`;const T=s.scrollHeight?s.scrollHeight-1:0;n.minHeight>T?b.height=`${n.minHeight}px`:n.maxHeight<T?(b.height=`${n.maxHeight}px`,b.overflowY="visible"):b.height=`${T}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&&(Yx(s,"input",a),Yx(s,"keydown",l)),a()}return{init:c,resize:a,unObserve(){Gx(s,"input",a),Gx(s,"keydown",l)}}}function Kx(t,e){const n=Tx(e),r=e.value.split(`
|
|
28
|
-
`);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}Df(e,i)}function xa(t,e,n){return(e=_Y(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _Y(t){var e=MY(t,"string");return typeof e=="symbol"?e:e+""}function MY(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 IY="ht_editor_visible",Bf="ht_editor_hidden",Xx="textEditor",PY="text";class Aa extends ru{static get EDITOR_TYPE(){return PY}constructor(e){super(e),xa(this,"eventManager",new vi(this)),xa(this,"autoResize",qx(this.hot.rootDocument)),xa(this,"TEXTAREA",void 0),xa(this,"textareaStyle",void 0),xa(this,"TEXTAREA_PARENT",void 0),xa(this,"textareaParentStyle",void 0),xa(this,"layerClass",void 0),this.eventManager=new vi(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(),xf(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(),Df(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),Re(this.TEXTAREA,[["data-hot-input",""],Ra(-1)]),Z(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"),Z(this.TEXTAREA_PARENT,"handsontableInputHolder"),Se(this.TEXTAREA_PARENT,this.layerClass)&&ye(this.TEXTAREA_PARENT,this.layerClass),Z(this.TEXTAREA_PARENT,Bf),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){bY()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",ye(this.TEXTAREA_PARENT,this.layerClass),Z(this.TEXTAREA_PARENT,Bf)}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;me(e.length-1,r=>{const i=e[r];if(Se(i,"handsontableEditor"))return n=!0,!1}),Se(this.TEXTAREA_PARENT,Bf)&&ye(this.TEXTAREA_PARENT,Bf),n?(this.layerClass=IY,Z(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),Z(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(){Dx()&&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:()=>fe(this.hot.getSelected()),group:Xx},i=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
|
|
29
|
-
`)};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;Kx(a,this.TEXTAREA)}},{keys:[["End"]],callback:(o,s)=>{let[a]=s;Kx(a,this.TEXTAREA)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(Xx)}}const Zx="gridDefault",Is="editorManager.handlingEditor",OY={name:"editorCloseAndSave",callback(t){t._getEditorManager().closeEditorAndSaveChanges()}},xY={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())}},AY={name:"editorCloseAndSaveByEnter",callback(t,e){const n=t._getEditorManager();n.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),n.moveSelectionAfterEnter(e)}},HY={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},NY={name:"editorFastOpen",callback(t,e){const{highlight:n}=t.getSelectedRangeLast();n.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},DY={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),wi(e))}};function kY(){return[OY,xY,AY,HY,NY,DY]}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())}},$Y={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"})}}},FY={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())}},VY={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())}},WY={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()}},BY={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()}}},jY={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()}}},UY={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()}}},zY={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()}}},YY={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()}}},GY={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()}}},qY={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()}},KY={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())}},XY={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 ZY(){return[LY,$Y,FY,VY,WY,BY,jY,UY,zY,YY,GY,qY,KY,XY]}const QY={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(1,0),e.markEndSource()}},JY={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})}},eG={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()}},tG={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()}},nG={name:"moveCellSelectionLeft",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,-1*t.getDirectionFactor()),e.markEndSource()}},rG={name:"moveCellSelectionRight",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,t.getDirectionFactor()),e.markEndSource()}},iG={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))}},oG={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()}},sG={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()}},aG={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()}},lG={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()}},uG={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()}},cG={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()}},hG={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()}},dG={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(-1,0),e.markEndSource()}},fG={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 gG(){return[QY,JY,eG,tG,nG,rG,iG,oG,sG,aG,lG,uG,cG,hG,dG,fG]}const mG={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},pG={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"})}}},wG={name:"selectAllCells",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!0}),e.markEndSource()}},vG={name:"selectAllCellsAndHeaders",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!1}),e.markEndSource()}},CG={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()))}},yG=[...kY(),...ZY(),...gG(),mG,pG,wG,vG,CG];function Qx(t){const e={};return yG.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 bG(t){const e=t.getShortcutManager().addContext("editor"),n=Qx(t),r={group:Is};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 SG(t){const e=t.getShortcutManager().addContext("grid"),n=Qx(t),r={runOnlyIf:()=>{const{navigableHeaders:i}=t.getSettings();return fe(t.getSelected())&&(i||!i&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:Zx};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:Is,runOnlyIf:()=>fe(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 RG(t){[SG,bG].forEach(e=>e(t))}const Jx="handsontableEditor",EG="handsontable";class ky extends Aa{static get EDITOR_TYPE(){return EG}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(),Df(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&&an(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:Jx,relativeToGroup:Is,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(),wi(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(Jx)}}const Ce={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:Ny()?182:174,AUDIO_MUTE:Ny()?181:173,AUDIO_UP:Ny()?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},TG=[Ce.ALT,Ce.ARROW_DOWN,Ce.ARROW_LEFT,Ce.ARROW_RIGHT,Ce.ARROW_UP,Ce.AUDIO_DOWN,Ce.AUDIO_MUTE,Ce.AUDIO_UP,Ce.BACKSPACE,Ce.CAPS_LOCK,Ce.DELETE,Ce.END,Ce.ENTER,Ce.ESCAPE,Ce.F1,Ce.F2,Ce.F3,Ce.F4,Ce.F5,Ce.F6,Ce.F7,Ce.F8,Ce.F9,Ce.F10,Ce.F11,Ce.F12,Ce.F13,Ce.F14,Ce.F15,Ce.F16,Ce.F17,Ce.F18,Ce.F19,Ce.HOME,Ce.INSERT,Ce.MEDIA_NEXT,Ce.MEDIA_PLAY_PAUSE,Ce.MEDIA_PREV,Ce.MEDIA_STOP,Ce.NULL,Ce.NUM_LOCK,Ce.PAGE_DOWN,Ce.PAGE_UP,Ce.PAUSE,Ce.SCROLL_LOCK,Ce.SHIFT,Ce.TAB];function _G(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 eA(t){return TG.includes(t)}function MG(t){return[Ce.CONTROL,Ce.COMMAND_LEFT,Ce.COMMAND_RIGHT,Ce.COMMAND_FIREFOX].includes(t)}function Zc(t,e){const n=e.split("|");let r=!1;return D(n,i=>{if(t===Ce[i])return r=!0,!1}),r}const IG="base";function Qc(t,e,n,r,i,o,s){const a=s.ariaTags,l=[],u=[],c=[],h=[];s.className&&Z(e,s.className),s.readOnly?(l.push(s.readOnlyCellClassName),a&&h.push(px())):a&&c.push(px()[0]),s.valid===!1&&s.invalidCellClassName?(l.push(s.invalidCellClassName),a&&h.push(wx())):(u.push(s.invalidCellClassName),a&&c.push(wx()[0])),s.wordWrap===!1&&s.noWordWrapClassName&&l.push(s.noWordWrapClassName),!o&&s.placeholder&&l.push(s.placeholderCellClassName),ye(e,u),Z(e,l),eu(e,c),Re(e,h)}Qc.RENDERER_TYPE=IG;const PG="text";function Bo(t,e,n,r,i,o,s){Qc.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()),Ia(e,a)}Bo.RENDERER_TYPE=PG;function at(t){return typeof t=="function"}function jf(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 tA(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 OG(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 Ly(t,e,n,r,i,o,s,a){return fe(a)?t.call(e,n,r,i,o,s,a):fe(s)?t.call(e,n,r,i,o,s):fe(o)?t.call(e,n,r,i,o):fe(i)?t.call(e,n,r,i):fe(r)?t.call(e,n,r):fe(n)?t.call(e,n):t.call(e)}function xG(t,e){rA(t,e),e.add(t)}function nA(t,e,n){rA(t,e),e.set(t,n)}function rA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Uf(t,e,n){return(e=AG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function AG(t){var e=HG(t,"string");return typeof e=="symbol"?e:e+""}function HG(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 $y(t,e){return t.get(Fy(t,e))}function Fy(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 NG="autocomplete";var Vy=new WeakMap,iA=new WeakMap,Wy=new WeakSet;class By extends ky{constructor(){super(...arguments),xG(this,Wy),Uf(this,"query",null),Uf(this,"strippedChoices",[]),Uf(this,"rawChoices",[]),nA(this,Vy,this.hot.guid.slice(0,9)),nA(this,iA,jf(()=>{this.focus()},100)),Uf(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=cx(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 NG}getValue(){const e=this.rawChoices.find(n=>this.stripValueIfNeeded(n)===this.TEXTAREA.value);return fe(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),Z(this.htContainer,"autocompleteEditor"),Z(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&Re(this.TEXTAREA,[Lz(),Az(),fx("listbox"),Wz()])}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.hot.getSettings().ariaTags&&Re(this.TEXTAREA,[Yr("false"),Bz(`${$y(Vy,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",$y(iA,this)),this.htEditor.updateSettings({colWidths:e?[tn(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(a,l,u,c,h,d,f)=>{Bo(a,l,u,c,h,d,f);const{filteringCaseSensitive:m,allowHtml:S,locale:b}=this.cellProperties,T=this.query;let v=xt(d),O,P;v&&!S&&(O=m===!0?v.indexOf(T):v.toLocaleLowerCase(b).indexOf(T.toLocaleLowerCase(b)),O!==-1&&(P=v.substr(O,T.length),v=v.replace(P,`<strong>${P}</strong>`))),n&&Re(l,[Hz(),...r?[Yz(i)]:[],...r?[Gz(r.indexOf(d)+1)]:[],["id",`${this.htEditor.rootElement.id}_${u}-${c}`]]),l.innerHTML=v},afterSelectionEnd:(a,l)=>{if(n){const u=h=>{Re(h,[Iy()]),Re(this.TEXTAREA,...jz(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&&(Re(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...$o()),Re(this.htEditor.rootElement,[dx(),Uz("polite"),zz("text"),["id",`${$y(Vy,this)}-listbox-${o}-${s}`]]),Re(this.TEXTAREA,...Yr("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&Re(this.TEXTAREA,[Yr("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=Tx(this.TEXTAREA),r=nY(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(_f([l])),l.length>0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(a)),this.hot.listen(),Df(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()}),Fy(Wy,this,oA).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),Fy(Wy,this,oA).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=ze(e,o=>xt(o));return ze(r,o=>n?o:cx(o))}allowKeyEventPropagation(e){const n=this.htEditor.getSelectedRangeLast(),r={row:n?n.from.row:-1};let i=!1;return e===Ce.ARROW_DOWN&&r.row>0&&r.row<this.htEditor.countRows()-1&&(i=!0),e===Ce.ARROW_UP&&r.row>-1&&(i=!0),i}onBeforeKeyDown(e){if(_G(e.keyCode)||e.keyCode===Ce.BACKSPACE||e.keyCode===Ce.DELETE||e.keyCode===Ce.INSERT){let n=10;if(e.keyCode===Ce.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(n+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},n)}}}function oA(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getWidth()+bn(this.hot.rootDocument)})}const DG="checkbox";class sA extends ru{static get EDITOR_TYPE(){return DG}beginEditing(e,n){if(n&&n.type==="mouseup"&&n.target.nodeName==="TD"){const r=this.TD.querySelector('input[type="checkbox"]');Se(r,"htBadValue")||r.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}const Ps=()=>window,qr=()=>window.document,jy=(t,e)=>window.setTimeout(t,e),Xi=function(t,e,n,r){t.addEventListener(e,n,!!r)},jo=function(t,e,n,r){t.removeEventListener(e,n,!!r)},kG=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},Tr=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},Uy=function(t,e){Tr(t,e)||(t.className=t.className===""?e:t.className+" "+e)},zy=function(t,e){t.className=kG((" "+t.className+" ").replace(" "+e+" "," "))},Yy=function(t){return/Array/.test(Object.prototype.toString.call(t))},_r=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},$G=function(t){return t%4===0&&t%100!==0||t%400===0},aA=function(t,e){return[31,$G(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},zf=function(t){_r(t)&&t.setHours(0,0,0,0)},Yf=function(t,e){return t.getTime()===e.getTime()},Gf=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?_r(e[r])?n&&(t[r]=new Date(e[r].getTime())):Yy(e[r])?n&&(t[r]=e[r].slice(0)):t[r]=Gf({},e[r],n):(n||!i)&&(t[r]=e[r]);return t},lA=function(t,e,n){let r=qr().createEvent("HTMLEvents");r.initEvent(e,!0,!1),r=Gf(r,n),t.dispatchEvent(r)},uA=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},cA=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},FG=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>"},VG=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)},WG=function(t,e,n,r,i){let o=new Date(r,n,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(o).isoWeek():VG(o,i))+"</td>"},BG=function(t,e,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},jG=function(t){return"<tbody>"+t.join("")+"</tbody>"},UG=function(t){let e,n=[];for(t.showWeekNumber&&n.push("<th></th>"),e=0;e<7;e++)n.push('<th scope="col"><abbr title="'+cA(t,e)+'">'+cA(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?n.reverse():n).join("")+"</tr></thead>"},zG=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,S=!0,b=!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>",Yy(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)&&(S=!1),h&&(r===11||u.maxMonth<=r)&&(b=!1),e===0&&(d+='<button class="pika-prev'+(S?"":" is-disabled")+'" type="button">'+u.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(d+='<button class="pika-next'+(b?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),d+="</div>"},YG=function(t,e,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+UG(t)+jG(e)+"</table>"};function Gy(t){let e=this,n=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||Ps().event;let o=i.target||i.srcElement;if(o)if(Tr(o,"is-disabled")||(Tr(o,"pika-button")&&!Tr(o,"is-empty")&&!Tr(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&&jy(function(){e.hide(),n.blurFieldOnSelect&&n.field&&n.field.blur()},100)):Tr(o,"pika-prev")?e.prevMonth():Tr(o,"pika-next")&&e.nextMonth()),Tr(o,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||Ps().event;let o=i.target||i.srcElement;o&&(Tr(o,"pika-select-month")?e.gotoMonth(o.value):Tr(o,"pika-select-year")&&e.gotoYear(o.value))},e._onKeyChange=function(i){if(i=i||Ps().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(),_r(o)&&e.setDate(o),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=qr().activeElement;do if(Tr(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=jy(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||Ps().event;let o=i.target||i.srcElement,s=o;if(o){!hasEventListeners&&Tr(o,"pika-select")&&(o.onchange||(o.setAttribute("onchange","return;"),Xi(o,"change",e._onChange)));do if(Tr(s,"pika-single")||s===n.trigger)return;while(s=s.parentNode);e._v&&o!==n.trigger&&s!==n.trigger&&e.hide()}},e.el=qr().createElement("div"),e.el.className="pika-single"+(n.isRTL?" is-rtl":"")+(n.theme?" "+n.theme:""),Xi(e.el,"mousedown",e._onMouseDown,!0),Xi(e.el,"touchend",e._onMouseDown,!0),Xi(e.el,"change",e._onChange),n.keyboardInput&&Xi(qr(),"keydown",e._onKeyChange),n.field&&(n.container?n.container.appendChild(e.el):n.bound?qr().body.appendChild(e.el):n.field.parentNode.insertBefore(e.el,n.field.nextSibling),Xi(n.field,"change",e._onInputChange),n.defaultDate||(n.defaultDate=e._parseFieldValue(),n.setDefaultDate=!0));let r=n.defaultDate;_r(r)?n.setDefaultDate?e.setDate(r,!0):e.gotoDate(r):e.gotoDate(new Date),n.bound?(this.hide(),e.el.className+=" is-bound",Xi(n.trigger,"click",e._onInputClick),Xi(n.trigger,"focus",e._onInputFocus),Xi(n.trigger,"blur",e._onInputBlur)):this.show()}Gy.prototype={config:function(t){this._o||(this._o=Gf({},Zi,!0));let e=Gf(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,_r(e.minDate)||(e.minDate=!1),_r(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),Yy(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,_r(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 _r(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="",lA(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!_r(t))return;let n=this._o.minDate,r=this._o.maxDate;_r(n)&&t<n?t=n:_r(r)&&t>r&&(t=r),this._d=new Date(t.getTime()),zf(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),lA(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(_r(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]=uA(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=uA({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?(zf(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?(zf(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">'+zG(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"&&jy(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=Ps().innerWidth||qr().documentElement.clientWidth,i=Ps().innerHeight||qr().documentElement.clientHeight,o=qr().body.scrollTop||qr().documentElement.scrollTop,u=!0,c=!0,l=t.getBoundingClientRect(),s=l.left+Ps().pageXOffset,a=l.bottom+Ps().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",Uy(this.el,u?"left-aligned":"right-aligned"),Uy(this.el,c?"bottom-aligned":"top-aligned"),zy(this.el,u?"right-aligned":"left-aligned"),zy(this.el,c?"top-aligned":"bottom-aligned"))},render:function(t,e,n){let r=this._o,i=new Date,o=aA(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];zf(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=aA(h,u),m=o+s,S=m;for(;S>7;)S-=7;m+=7-S;let b=!1;for(let T=0,v=0;T<m;T++){let O=new Date(t,e,1+(T-s)),P=_r(this._d)?Yf(O,this._d):!1,_=Yf(O,i),M=r.events.indexOf(O.toDateString())!==-1,H=T<s||T>=o+s,X=1+(T-s),G=e,U=t,ne=r.startRange&&Yf(r.startRange,O),ee=r.endRange&&Yf(r.endRange,O),he=r.startRange&&r.endRange&&r.startRange<O&&O<r.endRange,ie=r.minDate&&O<r.minDate||r.maxDate&&O>r.maxDate||r.disableWeekends&&LG(O)||r.disableDayFn&&r.disableDayFn(O);H&&(T<s?(X=f+X,G=u,U=h):(X=X-o,G=c,U=d));let ae={day:X,month:G,year:U,hasEvent:M,isSelected:P,isToday:_,isDisabled:ie,isEmpty:H,isStartRange:ne,isEndRange:ee,isInRange:he,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&P&&(b=!0),l.push(FG(ae)),++v===7&&(r.showWeekNumber&&l.unshift(WG(this,T-s,e,t,r.firstWeekOfYearMinDays)),a.push(BG(l,r.isRTL,r.pickWholeWeek,b)),l=[],v=0,b=!1)}return YG(r,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),zy(this.el,"is-hidden"),this._o.bound&&(Xi(qr(),"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&&jo(qr(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),Uy(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(),jo(this.el,"mousedown",this._onMouseDown,!0),jo(this.el,"touchend",this._onMouseDown,!0),jo(this.el,"change",this._onChange),t.keyboardInput&&jo(qr(),"keydown",this._onKeyChange),t.field&&(jo(t.field,"change",this._onInputChange),t.bound&&(jo(t.trigger,"click",this._onInputClick),jo(t.trigger,"focus",this._onInputFocus),jo(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function GG(t,e){qG(t,e),e.add(t)}function qG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hA(t,e,n){return(e=KG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KG(t){var e=XG(t,"string");return typeof e=="symbol"?e:e+""}function XG(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 qy(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 dA="date",fA="dateEditor",ZG="DD/MM/YYYY";var qf=new WeakSet;class gA extends Aa{constructor(){super(...arguments),GG(this,qf),hA(this,"parentDestroyed",!1),hA(this,"$datePicker",null)}static get EDITOR_TYPE(){return dA}init(){if(typeof Q!="function")throw new Error("You need to include moment.js to your project.");if(typeof Gy!="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||(ye(this.datePicker,/ht-theme-.*/g),Z(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"),Z(this.datePicker,"htDatepickerHolder");const e=this.hot.getCurrentThemeName();ye(this.datePicker,/ht-theme-.*/g),Z(this.datePicker,e),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",n=>{Se(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:fA})}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(fA),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=qy(qf,this,Ky).call(this),r=this.hot.view.isMouseDown(),i=e?eA(e.keyCode):!1;let o;this.datePicker.style.display="block",this.$datePicker=new Gy(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(Q),this.$datePicker._onInputFocus=function(){},this.originalValue?(o=this.originalValue,Q(o,n,!0).isValid()&&this.$datePicker.setMoment(Q(o,n),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!i&&!r&&this.setValue("")):this.cellProperties.defaultDate?(o=this.cellProperties.defaultDate,Q(o,n,!0).isValid()&&this.$datePicker.setMoment(Q(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&&If(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:qy(qf,this,Ky).call(this),r.reposition=r.reposition||!1,r.isRTL=!1,r.onSelect=s=>{let a=s;isNaN(a.getTime())||(a=Q(a).format(qy(qf,this,Ky).call(this))),this.setValue(a),i&&i(),Wo()&&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+cn(this.TD)}px`;let d=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?d+=h.right-tn(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:ZG}const QG="dropdown";class mA extends By{static get EDITOR_TYPE(){return QG}prepare(e,n,r,i,o,s){s.filter=!1,s.strict=!0,super.prepare(e,n,r,i,o,s)}}const JG="numeric";class pA extends Aa{static get EDITOR_TYPE(){return JG}}function e2(t,e,n){return(e=t2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function t2(t){var e=n2(t,"string");return typeof e=="symbol"?e:e+""}function n2(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 r2="password";class wA extends Aa{constructor(){super(...arguments),e2(this,"autoResize",qx(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}))}static get EDITOR_TYPE(){return r2}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,Fo(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const Xy="ht_editor_visible",vA="selectEditor",i2="select";class CA extends ru{static get EDITOR_TYPE(){return i2}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(...Ea()),e.appendChild(this.hot.rootDocument.createTextNode("▼")),Z(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",Se(this.selectWrapper,Xy)&&ye(this.selectWrapper,Xy),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),Fo(this.select),ke(l,(u,c)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=c,tu(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",Z(this.selectWrapper,Xy)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={group:vA};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(vA)}}const o2="time";class yA extends Aa{static get EDITOR_TYPE(){return o2}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.TEXTAREA.dir="ltr"}}function rt(){fe(console)&&console.warn(...arguments)}function Zy(){fe(console)&&console.error(...arguments)}const Ha=["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"],Qy=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"]]),Jy=new Map([[]]);var bA={},eb,SA;function s2(){if(SA)return eb;SA=1;var t=$l();return eb=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},eb}var tb,RA;function a2(){if(RA)return tb;RA=1;var t=gn();return tb=function(e,n){var r=t[e],i=r&&r.prototype;return i&&i[n]},tb}var nb,EA;function Kf(){if(EA)return nb;EA=1;var t=ci(),e=Jv(),n=bs().f,r=t("unscopables"),i=Array.prototype;return i[r]===void 0&&n(i,r,{configurable:!0,value:e(null)}),nb=function(o){i[r][o]=!0},nb}var TA;function l2(){if(TA)return bA;TA=1;var t=Ct(),e=Jt(),n=nr(),r=Rc(),i=s2(),o=a2(),s=Kf(),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"),bA}l2();function u2(t,e){_A(t,e),e.add(t)}function rb(t,e,n){_A(t,e),e.set(t,n)}function _A(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function MA(t,e,n){return t.set(Xf(t,e),n),n}function In(t,e){return t.get(Xf(t,e))}function Xf(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 c2=100;var Mr=new WeakMap,ou=new WeakMap,ib=new WeakMap,ob=new WeakSet;class IA{constructor(){u2(this,ob),rb(this,Mr,new Map),rb(this,ou,new Map),rb(this,ib,new Set),Ha.forEach(e=>Xf(ob,this,PA).call(this,e))}getHooks(e){var n;return(n=In(Mr,this).get(e))!==null&&n!==void 0?n:[]}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};In(Mr,this).has(e)||(Xf(ob,this,PA).call(this,e),Ha.push(e));const i=In(Mr,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=In(ib,this).has(e);!u&&o!==0&&(u=!0,In(ib,this).add(e)),u&&i.length>1&&In(Mr,this).set(e,i.toSorted((c,h)=>c.orderIndex-h.orderIndex))}}has(e){return In(Mr,this).has(e)&&In(Mr,this).get(e).length>0}remove(e,n){if(!In(Mr,this).has(e))return!1;const r=In(Mr,this).get(e),i=r.find(o=>o.callback===n);if(i){let o=In(ou,this).get(e);return i.skip=!0,o+=1,o>c2&&(In(Mr,this).set(e,r.filter(s=>!s.skip)),o=0),In(ou,this).set(e,o),!0}return!1}destroy(){In(Mr,this).clear(),In(ou,this).clear(),MA(Mr,this,null),MA(ou,this,null)}}function PA(t){In(Mr,this).set(t,[]),In(ou,this).set(t,0)}function h2(t,e,n){return(e=d2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d2(t){var e=f2(t,"string");return typeof e=="symbol"?e:e+""}function f2(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 g2=it`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
|
|
30
|
-
Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
|
|
31
|
-
learn about the migration path.`;class oe{constructor(){h2(this,"globalBucket",new IA)}static getSingleton(){return p2()}getBucket(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=new IA),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)?D(n,o=>this.add(e,o,r)):(Qy.has(e)&&rt(ux(g2,{hookName:e,removedInVersion:Qy.get(e)})),Jy.has(e)&&rt(Jy.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)?D(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)?D(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=Ly(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=Ly(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)||Ha.push(e)}deregister(e){this.isRegistered(e)&&Ha.splice(Ha.indexOf(e),1)}isDeprecated(e){return Jy.has(e)||Qy.has(e)}isRegistered(e){return Ha.indexOf(e)>=0}getRegistered(){return Ha}}const m2=new oe;function p2(){return m2}const sb=new Map;function Ci(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";sb.has(t)||sb.set(t,new Map);const e=sb.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 ab=new WeakMap,{register:w2,getItem:OA,hasItem:xA,getNames:Mue,getValues:Iue}=Ci("editors");function v2(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]},oe.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function AA(t,e){let n;if(typeof t=="function")ab.get(t)||Ir(null,t),n=ab.get(t);else if(typeof t=="string")n=OA(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 lb(t){if(typeof t=="function")return t;if(!xA(t))throw Error(`No registered editor found under "${t}" name`);return OA(t).getConstructor()}function Ir(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const n=new v2(e);typeof t=="string"&&w2(t,n),ab.set(e,n)}function C2(){Ir(ru),Ir(By),Ir(sA),Ir(gA),Ir(mA),Ir(ky),Ir(pA),Ir(wA),Ir(CA),Ir(Aa),Ir(yA)}const y2="html";function ub(t,e,n,r,i,o,s){Qc.apply(this,[t,e,n,r,i,o,s]),tu(e,o??"",!1)}ub.RENDERER_TYPE=y2;const b2="autocomplete";function su(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=s.allowHtml?ub:Bo,u=a.createElement("DIV"),c=t.getSettings().ariaTags;if(u.className="htAutocompleteArrow",c&&u.setAttribute(...Ea()),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),Z(e,"htAutocomplete"),!t.acArrowListener){const h=new vi(t);t.acArrowListener=function(d){Se(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()})}}su.RENDERER_TYPE=b2;const S2="dropdown";function cb(t,e,n,r,i,o,s){su.apply(this,[t,e,n,r,i,o,s])}cb.RENDERER_TYPE=S2;var HA={},NA={},DA;function R2(){if(DA)return NA;DA=1;var t=Ct(),e=Vl(),n=nr(),r=sn(),i=Bi();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}}),NA}var kA;function E2(){return kA||(kA=1,R2()),HA}E2();const LA="ContextMenu:items",Oe=LA,hb=`${Oe}.noItems`,db=`${Oe}.insertRowAbove`,fb=`${Oe}.insertRowBelow`,gb=`${Oe}.insertColumnOnTheLeft`,mb=`${Oe}.insertColumnOnTheRight`,pb=`${Oe}.removeRow`,wb=`${Oe}.removeColumn`,vb=`${Oe}.undo`,Cb=`${Oe}.redo`,Zf=`${Oe}.readOnly`,yb=`${Oe}.clearColumn`,bb=`${Oe}.copy`,Sb=`${Oe}.copyWithHeaders`,Rb=`${Oe}.copyWithGroupHeaders`,Eb=`${Oe}.copyHeadersOnly`,Tb=`${Oe}.cut`,_b=`${Oe}.freezeColumn`,Mb=`${Oe}.unfreezeColumn`,Ib=`${Oe}.mergeCells`,Pb=`${Oe}.unmergeCells`,Ob=`${Oe}.addComment`,xb=`${Oe}.editComment`,Ab=`${Oe}.removeComment`,Hb=`${Oe}.readOnlyComment`,Nb=`${Oe}.align`,Db=`${Oe}.align.left`,kb=`${Oe}.align.center`,Lb=`${Oe}.align.right`,$b=`${Oe}.align.justify`,Fb=`${Oe}.align.top`,Vb=`${Oe}.align.middle`,Wb=`${Oe}.align.bottom`,Bb=`${Oe}.borders`,jb=`${Oe}.borders.top`,Ub=`${Oe}.borders.right`,zb=`${Oe}.borders.bottom`,Yb=`${Oe}.borders.left`,Gb=`${Oe}.borders.remove`,qb=`${Oe}.nestedHeaders.insertChildRow`,Kb=`${Oe}.nestedHeaders.detachFromParent`,Xb=`${Oe}.hideColumn`,Zb=`${Oe}.showColumn`,Qb=`${Oe}.hideRow`,Jb=`${Oe}.showRow`,Yn="Filters:",Ht=`${Yn}conditions`,Qf=`${Ht}.none`,eS=`${Ht}.isEmpty`,tS=`${Ht}.isNotEmpty`,nS=`${Ht}.isEqualTo`,rS=`${Ht}.isNotEqualTo`,iS=`${Ht}.beginsWith`,oS=`${Ht}.endsWith`,sS=`${Ht}.contains`,aS=`${Ht}.doesNotContain`,T2=`${Ht}.byValue`,lS=`${Ht}.greaterThan`,uS=`${Ht}.greaterThanOrEqualTo`,cS=`${Ht}.lessThan`,hS=`${Ht}.lessThanOrEqualTo`,dS=`${Ht}.isBetween`,fS=`${Ht}.isNotBetween`,gS=`${Ht}.after`,mS=`${Ht}.before`,pS=`${Ht}.today`,wS=`${Ht}.tomorrow`,vS=`${Ht}.yesterday`,CS=`${Yn}labels.filterByCondition`,yS=`${Yn}labels.filterByValue`,bS=`${Yn}labels.conjunction`,Jf=`${Yn}labels.disjunction`,eg=`${Yn}values.blankCells`,SS=`${Yn}buttons.selectAll`,RS=`${Yn}buttons.clear`,ES=`${Yn}buttons.ok`,TS=`${Yn}buttons.cancel`,_S=`${Yn}buttons.placeholder.search`,MS=`${Yn}buttons.placeholder.value`,IS=`${Yn}buttons.placeholder.secondValue`,PS="CheckboxRenderer:",OS=`${PS}checked`,xS=`${PS}unchecked`,_2=Object.freeze(Object.defineProperty({__proto__:null,CHECKBOX_CHECKED:OS,CHECKBOX_RENDERER_NAMESPACE:PS,CHECKBOX_UNCHECKED:xS,CONTEXTMENU_ITEMS_ADD_COMMENT:Ob,CONTEXTMENU_ITEMS_ALIGNMENT:Nb,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:Wb,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:kb,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:$b,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:Db,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:Vb,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:Lb,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:Fb,CONTEXTMENU_ITEMS_BORDERS:Bb,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:zb,CONTEXTMENU_ITEMS_BORDERS_LEFT:Yb,CONTEXTMENU_ITEMS_BORDERS_RIGHT:Ub,CONTEXTMENU_ITEMS_BORDERS_TOP:jb,CONTEXTMENU_ITEMS_CLEAR_COLUMN:yb,CONTEXTMENU_ITEMS_COPY:bb,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:Eb,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:Rb,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:Sb,CONTEXTMENU_ITEMS_CUT:Tb,CONTEXTMENU_ITEMS_EDIT_COMMENT:xb,CONTEXTMENU_ITEMS_FREEZE_COLUMN:_b,CONTEXTMENU_ITEMS_HIDE_COLUMN:Xb,CONTEXTMENU_ITEMS_HIDE_ROW:Qb,CONTEXTMENU_ITEMS_INSERT_LEFT:gb,CONTEXTMENU_ITEMS_INSERT_RIGHT:mb,CONTEXTMENU_ITEMS_MERGE_CELLS:Ib,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:Kb,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:qb,CONTEXTMENU_ITEMS_NO_ITEMS:hb,CONTEXTMENU_ITEMS_READ_ONLY:Zf,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:Hb,CONTEXTMENU_ITEMS_REDO:Cb,CONTEXTMENU_ITEMS_REMOVE_BORDERS:Gb,CONTEXTMENU_ITEMS_REMOVE_COLUMN:wb,CONTEXTMENU_ITEMS_REMOVE_COMMENT:Ab,CONTEXTMENU_ITEMS_REMOVE_ROW:pb,CONTEXTMENU_ITEMS_ROW_ABOVE:db,CONTEXTMENU_ITEMS_ROW_BELOW:fb,CONTEXTMENU_ITEMS_SHOW_COLUMN:Zb,CONTEXTMENU_ITEMS_SHOW_ROW:Jb,CONTEXTMENU_ITEMS_UNDO:vb,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:Mb,CONTEXTMENU_ITEMS_UNMERGE_CELLS:Pb,CONTEXT_MENU_ITEMS_NAMESPACE:LA,FILTERS_BUTTONS_CANCEL:TS,FILTERS_BUTTONS_CLEAR:RS,FILTERS_BUTTONS_OK:ES,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:_S,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:IS,FILTERS_BUTTONS_PLACEHOLDER_VALUE:MS,FILTERS_BUTTONS_SELECT_ALL:SS,FILTERS_CONDITIONS_AFTER:gS,FILTERS_CONDITIONS_BEFORE:mS,FILTERS_CONDITIONS_BEGINS_WITH:iS,FILTERS_CONDITIONS_BETWEEN:dS,FILTERS_CONDITIONS_BY_VALUE:T2,FILTERS_CONDITIONS_CONTAINS:sS,FILTERS_CONDITIONS_EMPTY:eS,FILTERS_CONDITIONS_ENDS_WITH:oS,FILTERS_CONDITIONS_EQUAL:nS,FILTERS_CONDITIONS_GREATER_THAN:lS,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:uS,FILTERS_CONDITIONS_LESS_THAN:cS,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:hS,FILTERS_CONDITIONS_NAMESPACE:Ht,FILTERS_CONDITIONS_NONE:Qf,FILTERS_CONDITIONS_NOT_BETWEEN:fS,FILTERS_CONDITIONS_NOT_CONTAIN:aS,FILTERS_CONDITIONS_NOT_EMPTY:tS,FILTERS_CONDITIONS_NOT_EQUAL:rS,FILTERS_CONDITIONS_TODAY:pS,FILTERS_CONDITIONS_TOMORROW:wS,FILTERS_CONDITIONS_YESTERDAY:vS,FILTERS_DIVS_FILTER_BY_CONDITION:CS,FILTERS_DIVS_FILTER_BY_VALUE:yS,FILTERS_LABELS_CONJUNCTION:bS,FILTERS_LABELS_DISJUNCTION:Jf,FILTERS_NAMESPACE:Yn,FILTERS_VALUES_BLANK_CELLS:eg},Symbol.toStringTag,{value:"Module"})),$A=new WeakMap,FA=new WeakMap,M2="htBadValue",au="data-row",lu="data-col",I2="checkboxRenderer",VA="checkbox";oe.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,n){const{label:r,type:i,row:o,column:s,prop:a}=e;if(i===VA){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 AS(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=t.getSettings().ariaTags;Qc.apply(this,[t,e,n,r,i,o,s]),P2(t);let u=O2(a);const c=s.label;let h=!1;if(typeof s.checkedTemplate>"u"&&(s.checkedTemplate=!0),typeof s.uncheckedTemplate>"u"&&(s.uncheckedTemplate=!1),Fo(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:jt(o)?Z(u,"noValue"):(u.style.display="none",Z(u,M2),h=!0),Re(u,[[au,n],[lu,r]]),l&&Re(u,[Gc(u.checked?t.getTranslatedPhrase(OS):t.getTranslatedPhrase(xS)),vx(u.checked),Nz()]),!h&&c){let S="";if(c.value)S=typeof c.value=="function"?c.value.call(this,n,r,i,o):c.value;else if(c.property){const T=t.getDataAtRowProp(n,c.property);S=T!==null?T:""}const b=x2(a,S,c.separated!==!0);c.position==="before"?c.separated?(e.appendChild(b),e.appendChild(u)):(b.appendChild(u),u=b):(!c.position||c.position==="after")&&(c.separated?(e.appendChild(u),e.appendChild(b)):(b.insertBefore(u,b.firstChild),u=b))}(!c||c&&!c.separated)&&e.appendChild(u),h&&e.appendChild(a.createTextNode("#bad-value#")),$A.has(t)||($A.set(t,!0),d());function d(){const b=t.getShortcutManager().getContext("grid"),T={group:I2,relativeToGroup:Is,position:"before"};b.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()}}],T)}function f(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const b=t.getSelectedRange(),T=[],v=new Map;let O=[],P=0;if(b){for(let _=0;_<b.length;_++){const{row:M,col:H}=b[_].getTopStartCorner(),{row:X,col:G}=b[_].getBottomEndCorner();for(let U=M;U<=X;U+=1)for(let ne=H;ne<=G;ne+=1){const ee=t.getCellMeta(U,ne);if(ee.hidden)continue;const he={checkedTemplate:ee.checkedTemplate,uncheckedTemplate:ee.uncheckedTemplate};if(ee.type!=="checkbox"){S===!0&&!ee.readOnly&&(v.has(T.length)?v.set(T.length,[...v.get(T.length),[U,ne,null]]):v.set(T.length,[[U,ne,null]]));continue}if(ee.readOnly===!0)continue;typeof ee.checkedTemplate>"u"&&(ee.checkedTemplate=!0),typeof ee.uncheckedTemplate>"u"&&(ee.uncheckedTemplate=!1);const ie=t.getDataAtCell(U,ne);S===!1?[ee.checkedTemplate,ee.checkedTemplate.toString()].includes(ie)?O.push([U,ne,ee.uncheckedTemplate,he]):[ee.uncheckedTemplate,ee.uncheckedTemplate.toString(),null,void 0].includes(ie)&&O.push([U,ne,ee.checkedTemplate,he]):O.push([U,ne,ee.uncheckedTemplate,he]),P+=1}T.push(P),P=0}O.every(_=>{let[,,M]=_;return M===O[0][2]})?O=O.map(_=>{let[M,H,X]=_;return[M,H,X]}):O=O.map(_=>{let[M,H,,X]=_;return[M,H,X.checkedTemplate]}),O.length>0&&T.forEach((_,M)=>{let H=O.splice(0,_);v.size&&v.has(M)&&(H=[...H,...v.get(M)]),t.setDataAtCell(H)})}}function m(){const S=t.getSelectedRange();if(S){for(let b=0;b<S.length;b++){const T=S[b].getTopStartCorner(),v=S[b].getBottomEndCorner();for(let O=T.row;O<=v.row;O++)for(let P=T.col;P<=v.col;P++){if(t.getCellMeta(O,P).readOnly)continue;const M=t.getCell(O,P);if(Vo(M)&&M.querySelectorAll("input[type=checkbox]").length>0)return!0}}return!1}}}AS.RENDERER_TYPE=VA;function P2(t){let e=FA.get(t);if(!e){const{rootElement:n}=t;e=new vi(t),e.addEventListener(n,"click",r=>H2(r,t)),e.addEventListener(n,"mouseup",r=>A2(r,t)),e.addEventListener(n,"change",r=>N2(r,t)),FA.set(t,e)}return e}function O2(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function x2(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 A2(t,e){const{target:n}=t;HS(n)&&(!n.hasAttribute(au)||!n.hasAttribute(lu)||setTimeout(e.listen,10))}function H2(t,e){const{target:n}=t;if(!HS(n)||!n.hasAttribute(au)||!n.hasAttribute(lu))return;const r=parseInt(n.getAttribute(au),10),i=parseInt(n.getAttribute(lu),10);e.getCellMeta(r,i).readOnly&&t.preventDefault()}function N2(t,e){const{target:n}=t;if(!HS(n)||!n.hasAttribute(au)||!n.hasAttribute(lu))return;const r=parseInt(n.getAttribute(au),10),i=parseInt(n.getAttribute(lu),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 HS(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const D2="handsontable";function NS(t,e,n,r,i,o,s){su.apply(this,[t,e,n,r,i,o,s])}NS.RENDERER_TYPE=D2;var k2=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 DS,WA;function $2(){return WA||(WA=1,DS={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}}}),DS}var kS,BA;function jA(){if(BA)return kS;BA=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 S="",b=l.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(b!==l)return-1*n(b,u,c,h,d,f);for(let M=0;M<t.length;M++){let H=t[M];if(S=l.replace(RegExp(`([0-9 ])(${H.key})$`),"$1"),S!==l)return n(S,u,c,h,d,f)*H.factor}if(S=l.replace("%",""),S!==l)return n(S,u,c,h,d,f)/100;let T=parseFloat(l);if(isNaN(T))return;let v=h(T);if(v&&v!=="."&&(S=l.replace(new RegExp(`${e(v)}$`),""),S!==l))return n(S,u,c,h,d,f);let O={};Object.keys(f).forEach(M=>{O[f[M]]=M});let P=Object.keys(O).sort().reverse(),_=P.length;for(let M=0;M<_;M++){let H=P[M],X=O[H];if(S=l.replace(H,""),S!==l){let G;switch(X){case"thousand":G=Math.pow(10,3);break;case"million":G=Math.pow(10,6);break;case"billion":G=Math.pow(10,9);break;case"trillion":G=Math.pow(10,12);break}return n(S,u,c,h,d,f)*G}}}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 S=r(l,u,c);return n(S,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=WS();let h=c.currentDelimiters(),d=c.currentCurrency().symbol,f=c.currentOrdinal(),m=c.getZeroFormat(),S=c.currentAbbreviations(),b;if(typeof l=="string")o(l,h)?b=s(l):b=i(l,h,d,f,m,S);else if(typeof l=="number")b=l;else return;if(b!==void 0)return b}return kS={unformat:a},kS}var LS,UA;function $S(){if(UA)return LS;UA=1;let t=jA();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:(b,T)=>T.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:b=>b.output==="byte"},characteristic:{type:"number",restriction:b=>b>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:r},average:"boolean",lowPrecision:{type:"boolean",restriction:(b,T)=>T.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:b=>b>=0,message:"value must be positive"},{restriction:(b,T)=>!T.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:b=>b>=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:(b,T)=>T.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},c={languageTag:{type:"string",mandatory:!0,restriction:b=>b.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(b,T){let v=d(b),O=m(T);return v&&O}function d(b){return t.unformat(b)!==void 0}function f(b,T,v,O=!1){let P=Object.keys(b).map(_=>{if(!T[_])return console.error(`${v} Invalid key: ${_}`),!1;let M=b[_],H=T[_];if(typeof H=="string"&&(H={type:H}),H.type==="format"){if(!f(M,u,`[Validate ${_}]`,!0))return!1}else if(typeof M!==H.type)return console.error(`${v} ${_} type mismatched: "${H.type}" expected, "${typeof M}" provided`),!1;if(H.restrictions&&H.restrictions.length){let X=H.restrictions.length;for(let G=0;G<X;G++){let{restriction:U,message:ne}=H.restrictions[G];if(!U(M,b))return console.error(`${v} ${_} invalid value: ${ne}`),!1}}return H.restriction&&!H.restriction(M,b)?(console.error(`${v} ${_} invalid value: ${H.message}`),!1):H.validValues&&H.validValues.indexOf(M)===-1?(console.error(`${v} ${_} invalid value: must be among ${JSON.stringify(H.validValues)}, "${M}" provided`),!1):!(H.children&&!f(M,H.children,`[Validate ${_}]`))});return O||P.push(...Object.keys(T).map(_=>{let M=T[_];if(typeof M=="string"&&(M={type:M}),M.mandatory){let H=M.mandatory;if(typeof H=="function"&&(H=H(b)),H&&b[_]===void 0)return console.error(`${v} Missing mandatory key "${_}"`),!1}return!0})),P.reduce((_,M)=>_&&M,!0)}function m(b){return f(b,u,"[Validate format]")}function S(b){return f(b,c,"[Validate language]")}return LS={validate:h,validateFormat:m,validateInput:d,validateLanguage:S},LS}function F2(t,e){let n=t.match(/^{([^}]*)}/);return n?(e.prefix=n[1],t.slice(n[0].length)):t}function V2(t,e){let n=t.match(/{([^}]*)}$/);return n?(e.postfix=n[1],t.slice(0,-n[0].length)):t}function W2(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 B2(t,e){t.indexOf(",")!==-1&&(e.thousandSeparated=!0)}function j2(t,e){t.indexOf(" ")!==-1&&(e.spaceSeparated=!0,e.spaceSeparatedCurrency=!0,(e.average||e.forceAverage)&&(e.spaceSeparatedAbbreviation=!0))}function U2(t,e){let n=t.match(/[1-9]+[0-9]*/);n&&(e.totalLength=+n[0])}function z2(t,e){let r=t.split(".")[0].match(/0+/);r&&(e.characteristic=r[0].length)}function Y2(t,e){let n=t.split(".")[1];if(n){let r=n.match(/0+/);r&&(e.mantissa=r[0].length)}}function G2(t,e){const n=t.split(".")[1];n&&(e.trimMantissa=n.indexOf("[")!==-1)}function q2(t,e){t.indexOf("a")!==-1&&(e.average=!0)}function K2(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 X2(t,e){t.match(/\[\.]/)?e.optionalMantissa=!0:t.match(/\./)&&(e.optionalMantissa=!1)}function Z2(t,e){if(t.indexOf(".")!==-1){let n=t.split(".")[0];e.optionalCharacteristic=n.indexOf("0")===-1}}function Q2(t,e){t.match(/^\+?\([^)]*\)$/)&&(e.negative="parenthesis"),t.match(/^\+?-/)&&(e.negative="sign")}function J2(t,e){t.match(/^\+/)&&(e.forceSign=!0)}function eq(t,e={}){return typeof t!="string"?t:(t=F2(t,e),t=V2(t,e),W2(t,e),U2(t,e),z2(t,e),Z2(t,e),q2(t,e),K2(t,e),Y2(t,e),X2(t,e),G2(t,e),B2(t,e),j2(t,e),Q2(t,e),J2(t,e),e)}var FS={parseFormat:eq};var VS,zA;function WS(){if(zA)return VS;zA=1;const t=$2(),e=$S(),n=FS;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,VS=r,VS}function tq(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 nq(t,e){t.forEach(n=>{let r;try{r=tq(`../languages/${n}`)}catch{console.error(`Unable to load "${n}". No matching language file found.`)}r&&e.registerLanguage(r)})}var rq=t=>({loadLanguagesInNode:e=>nq(e,t)}),YA={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(M){var H,X,G,U=p.prototype={constructor:p,toString:null,valueOf:null},ne=new p(1),ee=20,he=4,ie=-7,ae=21,st=-1e7,ve=1e7,Ie=!1,pt=1,Xt=0,K={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},g="0123456789abcdefghijklmnopqrstuvwxyz",w=!0;function p(y,R){var C,x,A,N,W,L,$,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>ve?V.c=V.e=null:y.e<st?V.c=[V.e=0]:(V.e=y.e,V.c=y.c.slice());return}if((L=typeof y=="number")&&y*0==0){if(V.s=1/y<0?(y=-y,-1):1,y===~~y){for(N=0,W=y;W>=10;W/=10,N++);N>ve?V.c=V.e=null:(V.e=N,V.c=[y]);return}B=String(y)}else{if(!r.test(B=String(y)))return G(V,B,L);V.s=B.charCodeAt(0)==45?(B=B.slice(1),-1):1}(N=B.indexOf("."))>-1&&(B=B.replace(".","")),(W=B.search(/e/i))>0?(N<0&&(N=W),N+=+B.slice(W+1),B=B.substring(0,W)):N<0&&(N=B.length)}else{if(v(R,2,g.length,"Base"),R==10&&w)return V=new p(y),j(V,ee+V.e+1,he);if(B=String(y),L=typeof y=="number"){if(y*0!=0)return G(V,B,L,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),N=W=0,$=B.length;W<$;W++)if(C.indexOf(x=B.charAt(W))<0){if(x=="."){if(W>N){N=$;continue}}else if(!A&&(B==B.toUpperCase()&&(B=B.toLowerCase())||B==B.toLowerCase()&&(B=B.toUpperCase()))){A=!0,W=-1,N=0;continue}return G(V,String(y),L,R)}L=!1,B=X(B,R,10,V.s),(N=B.indexOf("."))>-1?B=B.replace(".",""):N=B.length}for(W=0;B.charCodeAt(W)===48;W++);for($=B.length;B.charCodeAt(--$)===48;);if(B=B.slice(W,++$)){if($-=W,L&&p.DEBUG&&$>15&&(y>c||y!==o(y)))throw Error(a+V.s*y);if((N=N-W-1)>ve)V.c=V.e=null;else if(N<st)V.c=[V.e=0];else{if(V.e=N,V.c=[],W=(N+1)%u,N<0&&(W+=u),W<$){for(W&&V.c.push(+B.slice(0,W)),$-=u;W<$;)V.c.push(+B.slice(W,W+=u));W=u-(B=B.slice(W)).length}else W-=$;for(;W--;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),he=C),y.hasOwnProperty(R="EXPONENTIAL_AT")&&(C=y[R],C&&C.pop?(v(C[0],-f,0,R),v(C[1],0,f,R),ie=C[0],ae=C[1]):(v(C,-f,f,R),ie=-(ae=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),st=C[0],ve=C[1];else if(v(C,-f,f,R),C)st=-(ve=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))Ie=C;else throw Ie=!C,Error(s+"crypto unavailable");else Ie=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),pt=C),y.hasOwnProperty(R="POW_PRECISION")&&(C=y[R],v(C,0,f,R),Xt=C),y.hasOwnProperty(R="FORMAT"))if(C=y[R],typeof C=="object")K=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:he,EXPONENTIAL_AT:[ie,ae],RANGE:[st,ve],CRYPTO:Ie,MODULO_MODE:pt,POW_PRECISION:Xt,FORMAT:K,ALPHABET:g}},p.isBigNumber=function(y){if(!y||y._isBigNumber!==!0)return!1;if(!p.DEBUG)return!0;var R,C,x=y.c,A=y.e,N=y.s;e:if({}.toString.call(x)=="[object Array]"){if((N===1||N===-1)&&A>=-f&&A<=f&&A===o(A)){if(x[0]===0){if(A===0&&x.length===1)return!0;break e}if(R=(A+1)%u,R<1&&(R+=u),String(x[0]).length==R){for(R=0;R<x.length;R++)if(C=x[R],C<0||C>=l||C!==o(C))break e;if(C!==0)return!0}}}else if(x===null&&A===null&&(N===null||N===1||N===-1))return!0;throw Error(s+"Invalid BigNumber: "+y)},p.maximum=p.max=function(){return k(arguments,-1)},p.minimum=p.min=function(){return k(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 x,A,N,W,L,$=0,B=[],V=new p(ne);if(C==null?C=ee:v(C,0,f),W=i(C/u),Ie)if(crypto.getRandomValues){for(x=crypto.getRandomValues(new Uint32Array(W*=2));$<W;)L=x[$]*131072+(x[$+1]>>>11),L>=9e15?(A=crypto.getRandomValues(new Uint32Array(2)),x[$]=A[0],x[$+1]=A[1]):(B.push(L%1e14),$+=2);$=W/2}else if(crypto.randomBytes){for(x=crypto.randomBytes(W*=7);$<W;)L=(x[$]&31)*281474976710656+x[$+1]*1099511627776+x[$+2]*4294967296+x[$+3]*16777216+(x[$+4]<<16)+(x[$+5]<<8)+x[$+6],L>=9e15?crypto.randomBytes(7).copy(x,$):(B.push(L%1e14),$+=7);$=W/7}else throw Ie=!1,Error(s+"crypto unavailable");if(!Ie)for(;$<W;)L=R(),L<9e15&&(B[$++]=L%1e14);for(W=B[--$],C%=u,W&&C&&(L=h[u-C],B[$]=o(W/L)*L);B[$]===0;B.pop(),$--);if($<0)B=[N=0];else{for(N=-1;B[0]===0;B.splice(0,1),N-=u);for($=1,L=B[0];L>=10;L/=10,$++);$<u&&(N-=u-$)}return V.e=N,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},X=(function(){var y="0123456789";function R(C,x,A,N){for(var W,L=[0],$,B=0,V=C.length;B<V;){for($=L.length;$--;L[$]*=x);for(L[0]+=N.indexOf(C.charAt(B++)),W=0;W<L.length;W++)L[W]>A-1&&(L[W+1]==null&&(L[W+1]=0),L[W+1]+=L[W]/A|0,L[W]%=A)}return L.reverse()}return function(C,x,A,N,W){var L,$,B,V,q,ue,ce,Te,Fe=C.indexOf("."),et=ee,_e=he;for(Fe>=0&&(V=Xt,Xt=0,C=C.replace(".",""),Te=new p(x),ue=Te.pow(C.length-Fe),Xt=V,Te.c=R(_(b(ue.c),ue.e,"0"),10,A,y),Te.e=Te.c.length),ce=R(C,x,A,W?(L=g,y):(L=y,g)),B=V=ce.length;ce[--V]==0;ce.pop());if(!ce[0])return L.charAt(0);if(Fe<0?--B:(ue.c=ce,ue.e=B,ue.s=N,ue=H(ue,Te,et,_e,A),ce=ue.c,q=ue.r,B=ue.e),$=B+et+1,Fe=ce[$],V=A/2,q=q||$<0||ce[$+1]!=null,q=_e<4?(Fe!=null||q)&&(_e==0||_e==(ue.s<0?3:2)):Fe>V||Fe==V&&(_e==4||q||_e==6&&ce[$-1]&1||_e==(ue.s<0?8:7)),$<1||!ce[0])C=q?_(L.charAt(1),-et,L.charAt(0)):L.charAt(0);else{if(ce.length=$,q)for(--A;++ce[--$]>A;)ce[$]=0,$||(++B,ce=[1].concat(ce));for(V=ce.length;!ce[--V];);for(Fe=0,C="";Fe<=V;C+=L.charAt(ce[Fe++]));C=_(C,B,L.charAt(0))}return C}})(),H=(function(){function y(x,A,N){var W,L,$,B,V=0,q=x.length,ue=A%d,ce=A/d|0;for(x=x.slice();q--;)$=x[q]%d,B=x[q]/d|0,W=ce*$+B*ue,L=ue*$+W%d*d+V,V=(L/N|0)+(W/d|0)+ce*B,x[q]=L%N;return V&&(x=[V].concat(x)),x}function R(x,A,N,W){var L,$;if(N!=W)$=N>W?1:-1;else for(L=$=0;L<N;L++)if(x[L]!=A[L]){$=x[L]>A[L]?1:-1;break}return $}function C(x,A,N,W){for(var L=0;N--;)x[N]-=L,L=x[N]<A[N]?1:0,x[N]=L*W+x[N]-A[N];for(;!x[0]&&x.length>1;x.splice(0,1));}return function(x,A,N,W,L){var $,B,V,q,ue,ce,Te,Fe,et,_e,We,Rt,yr,$i,li,Wt,Fr,Zt=x.s==A.s?1:-1,Pt=x.c,je=A.c;if(!Pt||!Pt[0]||!je||!je[0])return new p(!x.s||!A.s||(Pt?je&&Pt[0]==je[0]:!je)?NaN:Pt&&Pt[0]==0||!je?Zt*0:Zt/0);for(Fe=new p(Zt),et=Fe.c=[],B=x.e-A.e,Zt=N+B+1,L||(L=l,B=S(x.e/u)-S(A.e/u),Zt=Zt/u|0),V=0;je[V]==(Pt[V]||0);V++);if(je[V]>(Pt[V]||0)&&B--,Zt<0)et.push(1),q=!0;else{for($i=Pt.length,Wt=je.length,V=0,Zt+=2,ue=o(L/(je[0]+1)),ue>1&&(je=y(je,ue,L),Pt=y(Pt,ue,L),Wt=je.length,$i=Pt.length),yr=Wt,_e=Pt.slice(0,Wt),We=_e.length;We<Wt;_e[We++]=0);Fr=je.slice(),Fr=[0].concat(Fr),li=je[0],je[1]>=L/2&&li++;do{if(ue=0,$=R(je,_e,Wt,We),$<0){if(Rt=_e[0],Wt!=We&&(Rt=Rt*L+(_e[1]||0)),ue=o(Rt/li),ue>1)for(ue>=L&&(ue=L-1),ce=y(je,ue,L),Te=ce.length,We=_e.length;R(ce,_e,Te,We)==1;)ue--,C(ce,Wt<Te?Fr:je,Te,L),Te=ce.length,$=1;else ue==0&&($=ue=1),ce=je.slice(),Te=ce.length;if(Te<We&&(ce=[0].concat(ce)),C(_e,ce,We,L),We=_e.length,$==-1)for(;R(je,_e,Wt,We)<1;)ue++,C(_e,Wt<We?Fr:je,We,L),We=_e.length}else $===0&&(ue++,_e=[0]);et[V++]=ue,_e[0]?_e[We++]=Pt[yr]||0:(_e=[Pt[yr]],We=1)}while((yr++<$i||_e[0]!=null)&&Zt--);q=_e[0]!=null,et[0]||et.splice(0,1)}if(L==l){for(V=1,Zt=et[0];Zt>=10;Zt/=10,V++);j(Fe,N+(Fe.e=V+B*u-1)+1,W,q)}else Fe.e=B,Fe.r=+q;return Fe}})();function I(y,R,C,x){var A,N,W,L,$;if(C==null?C=he:v(C,0,8),!y.c)return y.toString();if(A=y.c[0],W=y.e,R==null)$=b(y.c),$=x==1||x==2&&(W<=ie||W>=ae)?P($,W):_($,W,"0");else if(y=j(new p(y),R,C),N=y.e,$=b(y.c),L=$.length,x==1||x==2&&(R<=N||N<=ie)){for(;L<R;$+="0",L++);$=P($,N)}else if(R-=W,$=_($,N,"0"),N+1>L){if(--R>0)for($+=".";R--;$+="0");}else if(R+=N-L,R>0)for(N+1==L&&($+=".");R--;$+="0");return y.s<0&&A?"-"+$:$}function k(y,R){for(var C,x,A=1,N=new p(y[0]);A<y.length;A++)x=new p(y[A]),(!x.s||(C=T(N,x))===R||C===0&&N.s===R)&&(N=x);return N}function F(y,R,C){for(var x=1,A=R.length;!R[--A];R.pop());for(A=R[0];A>=10;A/=10,x++);return(C=x+C*u-1)>ve?y.c=y.e=null:C<st?y.c=[y.e=0]:(y.e=C,y.c=R),y}G=(function(){var y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,R=/^([^.]+)\.$/,C=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(N,W,L,$){var B,V=L?W:W.replace(A,"");if(x.test(V))N.s=isNaN(V)?null:V<0?-1:1;else{if(!L&&(V=V.replace(y,function(q,ue,ce){return B=(ce=ce.toLowerCase())=="x"?16:ce=="b"?2:8,!$||$==B?ue:q}),$&&(B=$,V=V.replace(R,"$1").replace(C,"0.$1")),W!=V))return new p(V,B);if(p.DEBUG)throw Error(s+"Not a"+($?" base "+$:"")+" number: "+W);N.s=null}N.c=N.e=null}})();function j(y,R,C,x){var A,N,W,L,$,B,V,q=y.c,ue=h;if(q){e:{for(A=1,L=q[0];L>=10;L/=10,A++);if(N=R-A,N<0)N+=u,W=R,$=q[B=0],V=o($/ue[A-W-1]%10);else if(B=i((N+1)/u),B>=q.length)if(x){for(;q.length<=B;q.push(0));$=V=0,A=1,N%=u,W=N-u+1}else break e;else{for($=L=q[B],A=1;L>=10;L/=10,A++);N%=u,W=N-u+A,V=W<0?0:o($/ue[A-W-1]%10)}if(x=x||R<0||q[B+1]!=null||(W<0?$:$%ue[A-W-1]),x=C<4?(V||x)&&(C==0||C==(y.s<0?3:2)):V>5||V==5&&(C==4||x||C==6&&(N>0?W>0?$/ue[A-W]:0:q[B-1])%10&1||C==(y.s<0?8:7)),R<1||!q[0])return q.length=0,x?(R-=y.e+1,q[0]=ue[(u-R%u)%u],y.e=-R||0):q[0]=y.e=0,y;if(N==0?(q.length=B,L=1,B--):(q.length=B+1,L=ue[u-N],q[B]=W>0?o($/ue[A-W]%ue[W])*L:0),x)for(;;)if(B==0){for(N=1,W=q[0];W>=10;W/=10,N++);for(W=q[0]+=L,L=1;W>=10;W/=10,L++);N!=L&&(y.e++,q[0]==l&&(q[0]=1));break}else{if(q[B]+=L,q[B]!=l)break;q[B--]=0,L=1}for(N=q.length;q[--N]===0;q.pop());}y.e>ve?y.c=y.e=null:y.e<st&&(y.c=[y.e=0])}return y}function Y(y){var R,C=y.e;return C===null?y.toString():(R=b(y.c),R=C<=ie||C>=ae?P(R,C):_(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 T(this,new p(y,R))},U.decimalPlaces=U.dp=function(y,R){var C,x,A,N=this;if(y!=null)return v(y,0,f),R==null?R=he:v(R,0,8),j(new p(N),y+N.e+1,R);if(!(C=N.c))return null;if(x=((A=C.length-1)-S(this.e/u))*u,A=C[A])for(;A%10==0;A/=10,x--);return x<0&&(x=0),x},U.dividedBy=U.div=function(y,R){return H(this,new p(y,R),ee,he)},U.dividedToIntegerBy=U.idiv=function(y,R){return H(this,new p(y,R),0,1)},U.exponentiatedBy=U.pow=function(y,R){var C,x,A,N,W,L,$,B,V,q=this;if(y=new p(y),y.c&&!y.isInteger())throw Error(s+"Exponent not an integer: "+Y(y));if(R!=null&&(R=new p(R)),L=y.e>14,!q.c||!q.c[0]||q.c[0]==1&&!q.e&&q.c.length==1||!y.c||!y.c[0])return V=new p(Math.pow(+Y(q),L?y.s*(2-O(y)):+Y(y))),R?V.mod(R):V;if($=y.s<0,R){if(R.c?!R.c[0]:!R.s)return new p(NaN);x=!$&&q.isInteger()&&R.isInteger(),x&&(q=q.mod(R))}else{if(y.e>9&&(q.e>0||q.e<-1||(q.e==0?q.c[0]>1||L&&q.c[1]>=24e7:q.c[0]<8e13||L&&q.c[0]<=9999975e7)))return N=q.s<0&&O(y)?-0:0,q.e>-1&&(N=1/N),new p($?1/N:N);Xt&&(N=i(Xt/u+2))}for(L?(C=new p(.5),$&&(y.s=1),B=O(y)):(A=Math.abs(+Y(y)),B=A%2),V=new p(ne);;){if(B){if(V=V.times(q),!V.c)break;N?V.c.length>N&&(V.c.length=N):x&&(V=V.mod(R))}if(A){if(A=o(A/2),A===0)break;B=A%2}else if(y=y.times(C),j(y,y.e+1,1),y.e>14)B=O(y);else{if(A=+Y(y),A===0)break;B=A%2}q=q.times(q),N?q.c&&q.c.length>N&&(q.c.length=N):x&&(q=q.mod(R))}return x?V:($&&(V=ne.div(V)),R?V.mod(R):N?j(V,Xt,he,W):V)},U.integerValue=function(y){var R=new p(this);return y==null?y=he:v(y,0,8),j(R,R.e+1,y)},U.isEqualTo=U.eq=function(y,R){return T(this,new p(y,R))===0},U.isFinite=function(){return!!this.c},U.isGreaterThan=U.gt=function(y,R){return T(this,new p(y,R))>0},U.isGreaterThanOrEqualTo=U.gte=function(y,R){return(R=T(this,new p(y,R)))===1||R===0},U.isInteger=function(){return!!this.c&&S(this.e/u)>this.c.length-2},U.isLessThan=U.lt=function(y,R){return T(this,new p(y,R))<0},U.isLessThanOrEqualTo=U.lte=function(y,R){return(R=T(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,x,A,N,W=this,L=W.s;if(y=new p(y,R),R=y.s,!L||!R)return new p(NaN);if(L!=R)return y.s=-R,W.plus(y);var $=W.e/u,B=y.e/u,V=W.c,q=y.c;if(!$||!B){if(!V||!q)return V?(y.s=-R,y):new p(q?W:NaN);if(!V[0]||!q[0])return q[0]?(y.s=-R,y):new p(V[0]?W:he==3?-0:0)}if($=S($),B=S(B),V=V.slice(),L=$-B){for((N=L<0)?(L=-L,A=V):(B=$,A=q),A.reverse(),R=L;R--;A.push(0));A.reverse()}else for(x=(N=(L=V.length)<(R=q.length))?L:R,L=R=0;R<x;R++)if(V[R]!=q[R]){N=V[R]<q[R];break}if(N&&(A=V,V=q,q=A,y.s=-y.s),R=(x=q.length)-(C=V.length),R>0)for(;R--;V[C++]=0);for(R=l-1;x>L;){if(V[--x]<q[x]){for(C=x;C&&!V[--C];V[C]=R);--V[C],V[x]+=l}V[x]-=q[x]}for(;V[0]==0;V.splice(0,1),--B);return V[0]?F(y,V,B):(y.s=he==3?-1:1,y.c=[y.e=0],y)},U.modulo=U.mod=function(y,R){var C,x,A=this;return y=new p(y,R),!A.c||!y.s||y.c&&!y.c[0]?new p(NaN):!y.c||A.c&&!A.c[0]?new p(A):(pt==9?(x=y.s,y.s=1,C=H(A,y,0,3),y.s=x,C.s*=x):C=H(A,y,0,pt),y=A.minus(C.times(y)),!y.c[0]&&pt==1&&(y.s=A.s),y)},U.multipliedBy=U.times=function(y,R){var C,x,A,N,W,L,$,B,V,q,ue,ce,Te,Fe,et,_e=this,We=_e.c,Rt=(y=new p(y,R)).c;if(!We||!Rt||!We[0]||!Rt[0])return!_e.s||!y.s||We&&!We[0]&&!Rt||Rt&&!Rt[0]&&!We?y.c=y.e=y.s=null:(y.s*=_e.s,!We||!Rt?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(x=S(_e.e/u)+S(y.e/u),y.s*=_e.s,$=We.length,q=Rt.length,$<q&&(Te=We,We=Rt,Rt=Te,A=$,$=q,q=A),A=$+q,Te=[];A--;Te.push(0));for(Fe=l,et=d,A=q;--A>=0;){for(C=0,ue=Rt[A]%et,ce=Rt[A]/et|0,W=$,N=A+W;N>A;)B=We[--W]%et,V=We[W]/et|0,L=ce*B+V*ue,B=ue*B+L%et*et+Te[N]+C,C=(B/Fe|0)+(L/et|0)+ce*V,Te[N--]=B%Fe;Te[N]=C}return C?++x:Te.splice(0,1),F(y,Te,x)},U.negated=function(){var y=new p(this);return y.s=-y.s||null,y},U.plus=function(y,R){var C,x=this,A=x.s;if(y=new p(y,R),R=y.s,!A||!R)return new p(NaN);if(A!=R)return y.s=-R,x.minus(y);var N=x.e/u,W=y.e/u,L=x.c,$=y.c;if(!N||!W){if(!L||!$)return new p(A/0);if(!L[0]||!$[0])return $[0]?y:new p(L[0]?x:A*0)}if(N=S(N),W=S(W),L=L.slice(),A=N-W){for(A>0?(W=N,C=$):(A=-A,C=L),C.reverse();A--;C.push(0));C.reverse()}for(A=L.length,R=$.length,A-R<0&&(C=$,$=L,L=C,R=A),A=0;R;)A=(L[--R]=L[R]+$[R]+A)/l|0,L[R]=l===L[R]?0:L[R]%l;return A&&(L=[A].concat(L),++W),F(y,L,W)},U.precision=U.sd=function(y,R){var C,x,A,N=this;if(y!=null&&y!==!!y)return v(y,1,f),R==null?R=he:v(R,0,8),j(new p(N),y,R);if(!(C=N.c))return null;if(A=C.length-1,x=A*u+1,A=C[A]){for(;A%10==0;A/=10,x--);for(A=C[0];A>=10;A/=10,x++);}return y&&N.e+1>x&&(x=N.e+1),x},U.shiftedBy=function(y){return v(y,-c,c),this.times("1e"+y)},U.squareRoot=U.sqrt=function(){var y,R,C,x,A,N=this,W=N.c,L=N.s,$=N.e,B=ee+4,V=new p("0.5");if(L!==1||!W||!W[0])return new p(!L||L<0&&(!W||W[0])?NaN:W?N:1/0);if(L=Math.sqrt(+Y(N)),L==0||L==1/0?(R=b(W),(R.length+$)%2==0&&(R+="0"),L=Math.sqrt(+R),$=S(($+1)/2)-($<0||$%2),L==1/0?R="5e"+$:(R=L.toExponential(),R=R.slice(0,R.indexOf("e")+1)+$),C=new p(R)):C=new p(L+""),C.c[0]){for($=C.e,L=$+B,L<3&&(L=0);;)if(A=C,C=V.times(A.plus(H(N,A,B,1))),b(A.c).slice(0,L)===(R=b(C.c)).slice(0,L))if(C.e<$&&--L,R=R.slice(L-3,L+1),R=="9999"||!x&&R=="4999"){if(!x&&(j(A,A.e+ee+2,0),A.times(A).eq(N))){C=A;break}B+=4,L+=4,x=1}else{(!+R||!+R.slice(1)&&R.charAt(0)=="5")&&(j(C,C.e+ee+2,1),y=!C.times(C).eq(N));break}}return j(C,C.e+ee+1,he,y)},U.toExponential=function(y,R){return y!=null&&(v(y,0,f),y++),I(this,y,R,1)},U.toFixed=function(y,R){return y!=null&&(v(y,0,f),y=y+this.e+1),I(this,y,R)},U.toFormat=function(y,R,C){var x,A=this;if(C==null)y!=null&&R&&typeof R=="object"?(C=R,R=null):y&&typeof y=="object"?(C=y,y=R=null):C=K;else if(typeof C!="object")throw Error(s+"Argument not an object: "+C);if(x=A.toFixed(y,R),A.c){var N,W=x.split("."),L=+C.groupSize,$=+C.secondaryGroupSize,B=C.groupSeparator||"",V=W[0],q=W[1],ue=A.s<0,ce=ue?V.slice(1):V,Te=ce.length;if($&&(N=L,L=$,$=N,Te-=N),L>0&&Te>0){for(N=Te%L||L,V=ce.substr(0,N);N<Te;N+=L)V+=B+ce.substr(N,L);$>0&&(V+=B+ce.slice(N)),ue&&(V="-"+V)}x=q?V+(C.decimalSeparator||"")+(($=+C.fractionGroupSize)?q.replace(new RegExp("\\d{"+$+"}\\B","g"),"$&"+(C.fractionGroupSeparator||"")):q):V}return(C.prefix||"")+x+(C.suffix||"")},U.toFraction=function(y){var R,C,x,A,N,W,L,$,B,V,q,ue,ce=this,Te=ce.c;if(y!=null&&(L=new p(y),!L.isInteger()&&(L.c||L.s!==1)||L.lt(ne)))throw Error(s+"Argument "+(L.isInteger()?"out of range: ":"not an integer: ")+Y(L));if(!Te)return new p(ce);for(R=new p(ne),B=C=new p(ne),x=$=new p(ne),ue=b(Te),N=R.e=ue.length-ce.e-1,R.c[0]=h[(W=N%u)<0?u+W:W],y=!y||L.comparedTo(R)>0?N>0?R:B:L,W=ve,ve=1/0,L=new p(ue),$.c[0]=0;V=H(L,R,0,1),A=C.plus(V.times(x)),A.comparedTo(y)!=1;)C=x,x=A,B=$.plus(V.times(A=B)),$=A,R=L.minus(V.times(A=R)),L=A;return A=H(y.minus(C),x,0,1),$=$.plus(A.times(B)),C=C.plus(A.times(x)),$.s=B.s=ce.s,N=N*2,q=H(B,x,N,he).minus(ce).abs().comparedTo(H($,C,N,he).minus(ce).abs())<1?[B,x]:[$,C],ve=W,q},U.toNumber=function(){return+Y(this)},U.toPrecision=function(y,R){return y!=null&&v(y,1,f),I(this,y,R,2)},U.toString=function(y){var R,C=this,x=C.s,A=C.e;return A===null?x?(R="Infinity",x<0&&(R="-"+R)):R="NaN":(y==null?R=A<=ie||A>=ae?P(b(C.c),A):_(b(C.c),A,"0"):y===10&&w?(C=j(new p(C),ee+A+1,he),R=_(b(C.c),C.e,"0")):(v(y,2,g.length,"Base"),R=X(_(b(C.c),A,"0"),10,y,x,!0)),x<0&&C.c[0]&&(R="-"+R)),R},U.valueOf=U.toJSON=function(){return Y(this)},U._isBigNumber=!0,M!=null&&p.set(M),p}function S(M){var H=M|0;return M>0||M===H?H:H-1}function b(M){for(var H,X,G=1,U=M.length,ne=M[0]+"";G<U;){for(H=M[G++]+"",X=u-H.length;X--;H="0"+H);ne+=H}for(U=ne.length;ne.charCodeAt(--U)===48;);return ne.slice(0,U+1||1)}function T(M,H){var X,G,U=M.c,ne=H.c,ee=M.s,he=H.s,ie=M.e,ae=H.e;if(!ee||!he)return null;if(X=U&&!U[0],G=ne&&!ne[0],X||G)return X?G?0:-he:ee;if(ee!=he)return ee;if(X=ee<0,G=ie==ae,!U||!ne)return G?0:!U^X?1:-1;if(!G)return ie>ae^X?1:-1;for(he=(ie=U.length)<(ae=ne.length)?ie:ae,ee=0;ee<he;ee++)if(U[ee]!=ne[ee])return U[ee]>ne[ee]^X?1:-1;return ie==ae?0:ie>ae^X?1:-1}function v(M,H,X,G){if(M<H||M>X||M!==o(M))throw Error(s+(G||"Argument")+(typeof M=="number"?M<H||M>X?" out of range: ":" not an integer: ":" not a primitive number: ")+String(M))}function O(M){var H=M.c.length-1;return S(M.e/u)==H&&M.c[H]%2!=0}function P(M,H){return(M.length>1?M.charAt(0)+"."+M.slice(1):M)+(H<0?"e":"e+")+H}function _(M,H,X){var G,U;if(H<0){for(U=X+".";++H;U+=X);M=U+M}else if(G=M.length,++H>G){for(U=X,H-=G;--H;U+=X);M+=U}else H<G&&(M=M.slice(0,H)+"."+M.slice(H));return M}n=m(),n.default=n.BigNumber=n,t.exports?t.exports=n:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=n)})(k2)})(YA);var GA=YA.exports;const yi=WS(),iq=$S(),oq=FS,sq=GA,Pn={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},Jc={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:qA,decimalSuffixes:tg}=yi.currentBytes(),BS={general:{scale:1024,suffixes:tg},binary:{scale:1024,suffixes:qA},decimal:{scale:1e3,suffixes:tg}};function aq(t,e={},n){if(typeof e=="string"&&(e=oq.parseFormat(e)),!iq.validateFormat(e))return"ERROR: invalid format";let i=e.prefix||"",o=e.postfix||"",s=lq(t,e,n);return s=Mq(s,i),s=Iq(s,o),s}function lq(t,e,n){switch(e.output){case"currency":return e=uu(e,yi.currentCurrencyDefaultFormat()),pq(t,e,yi);case"percent":return e=uu(e,yi.currentPercentageDefaultFormat()),mq(t,e,yi,n);case"byte":return e=uu(e,yi.currentByteDefaultFormat()),dq(t,e,yi,n);case"time":return e=uu(e,yi.currentTimeDefaultFormat()),gq(t);case"ordinal":return e=uu(e,yi.currentOrdinalDefaultFormat()),fq(t,e,yi);default:return eh({instance:t,providedFormat:e})}}function uq(t){let e=BS.decimal;return ng(t._value,e.suffixes,e.scale).suffix}function cq(t){let e=BS.binary;return ng(t._value,e.suffixes,e.scale).suffix}function hq(t){let e=BS.general;return ng(t._value,e.suffixes,e.scale).suffix}function ng(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 dq(t,e,n,r){let i=e.base||"binary",o=Object.assign({},Jc,e);const{binarySuffixes:s,decimalSuffixes:a}=n.currentBytes();let u={general:{scale:1024,suffixes:a||tg,marker:"bd"},binary:{scale:1024,suffixes:s||qA,marker:"b"},decimal:{scale:1e3,suffixes:a||tg,marker:"d"}}[i],{value:c,suffix:h}=ng(t._value,u.suffixes,u.scale);return`${eh({instance:r(c),providedFormat:e,state:n,defaults:n.currentByteDefaultFormat()})}${o.spaceSeparated?" ":""}${h}`}function fq(t,e,n){let r=n.currentOrdinal(),i=Object.assign({},Jc,e),o=eh({instance:t,providedFormat:e,state:n}),s=r(t._value);return`${o}${i.spaceSeparated?" ":""}${s}`}function gq(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 mq(t,e,n,r){let i=e.prefixSymbol,o=eh({instance:r(t._value*100),providedFormat:e,state:n}),s=Object.assign({},Jc,e);return i?`%${s.spaceSeparated?" ":""}${o}`:`${o}${s.spaceSeparated?" ":""}%`}function pq(t,e,n){const r=n.currentCurrency();let i=Object.assign({},e),o=Object.assign({},Jc,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=eh({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 wq({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]&&Pn[e]?(a=r[e],t=t/Pn[e]):l>=Pn.trillion||n&&s(l/Pn.trillion)===1?(a=r.trillion,t=t/Pn.trillion):l<Pn.trillion&&l>=Pn.billion||n&&s(l/Pn.billion)===1?(a=r.billion,t=t/Pn.billion):l<Pn.billion&&l>=Pn.million||n&&s(l/Pn.million)===1?(a=r.million,t=t/Pn.million):(l<Pn.million&&l>=Pn.thousand||n&&s(l/Pn.thousand)===1)&&(a=r.thousand,t=t/Pn.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 vq({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 rg(t){let e="";for(let n=0;n<t;n++)e+="0";return e}function Cq(t,e){let n=t.toString(),[r,i]=n.split("e"),[o,s=""]=r.split(".");if(+i>0)n=o+s+rg(i-s.length);else{let a=".";+o<0?a=`-0${a}`:a=`0${a}`;let l=(rg(-i-1)+Math.abs(o)+s).substr(0,e);l.length<e&&(l+=rg(e-l.length)),n=a+l}return+i>0&&e>0&&(n+=`.${rg(e)}`),n}function yq(t,e,n=Math.round){return t.toString().indexOf("e")!==-1?Cq(t,e):new sq(n(+`${t}e+${e}`)/Math.pow(10,e)).toFixed(e)}function bq(t,e,n,r,i,o){if(r===-1)return t;let s=yq(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 Sq(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 Rq(t,e){let n=[],r=0;for(let i=t;i>0;i--)r===e&&(n.unshift(i),r=0),r++;return n}function Eq(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)),Rq(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 Tq(t,e){return t+e}function _q(t,e,n){return e===0?t:+t==0?t.replace("-",""):e>0?`+${t}`:n==="sign"?t:`(${t.replace("-","")})`}function Mq(t,e){return e+t}function Iq(t,e){return t+e}function eh({instance:t,providedFormat:e,state:n=yi,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({},Jc,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,S=s.trimMantissa,b=s.thousandSeparated,T=s.spaceSeparated,v=s.negative,O=s.forceSign,P=s.exponential,_=s.roundingFunction,M="";if(d){let X=wq({value:o,forceAverage:c,lowPrecision:h,abbreviations:n.currentAbbreviations(),spaceSeparated:T,roundingFunction:_,totalLength:a});o=X.value,M+=X.abbreviation,a&&(f=X.mantissaPrecision)}if(P){let X=vq({value:o,characteristicPrecision:l});o=X.value,M=X.abbreviation+M}let H=bq(o.toString(),o,m,f,S,_);return H=Sq(H,o,u,l),H=Eq(H,o,b,n,r),(d||P)&&(H=Tq(H,M)),(O||o<0)&&(H=_q(H,o,v)),H}function uu(t,e){if(!t)return e;let n=Object.keys(t);return n.length===1&&n[0]==="output"?e:t}var Pq=t=>({format:(...e)=>aq(...e,t),getByteUnit:(...e)=>hq(...e,t),getBinaryByteUnit:(...e)=>cq(...e,t),getDecimalByteUnit:(...e)=>uq(...e,t),formatOrDefault:uu});const Uo=GA;function Oq(t,e,n){let r=new Uo(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Uo(i),t._value=r.plus(i).toNumber(),t}function KA(t,e,n){let r=new Uo(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Uo(i),t._value=r.minus(i).toNumber(),t}function xq(t,e,n){let r=new Uo(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Uo(i),t._value=r.times(i).toNumber(),t}function Aq(t,e,n){let r=new Uo(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Uo(i),t._value=r.dividedBy(i).toNumber(),t}function Hq(t,e,n){let r=e;return n.isNumbro(e)&&(r=e._value),t._value=r,t}function Nq(t,e,n){let r=n(t._value);return KA(r,e,n),Math.abs(r._value)}var Dq=t=>({add:(e,n)=>Oq(e,n,t),subtract:(e,n)=>KA(e,n,t),multiply:(e,n)=>xq(e,n,t),divide:(e,n)=>Aq(e,n,t),set:(e,n)=>Hq(e,n,t),difference:(e,n)=>Nq(e,n,t),BigNumber:Uo});const kq="2.5.0",Qi=WS(),Lq=$S(),$q=rq(zt),Fq=jA();let Na=Pq(zt),Da=Dq(zt);const Vq=FS;class XA{constructor(e){this._value=e}clone(){return zt(this._value)}format(e={}){return Na.format(this,e)}formatCurrency(e){return typeof e=="string"&&(e=Vq.parseFormat(e)),e=Na.formatOrDefault(e,Qi.currentCurrencyDefaultFormat()),e.output="currency",Na.format(this,e)}formatTime(e={}){return e.output="time",Na.format(this,e)}binaryByteUnits(){return Na.getBinaryByteUnit(this)}decimalByteUnits(){return Na.getDecimalByteUnit(this)}byteUnits(){return Na.getByteUnit(this)}difference(e){return Da.difference(this,e)}add(e){return Da.add(this,e)}subtract(e){return Da.subtract(this,e)}multiply(e){return Da.multiply(this,e)}divide(e){return Da.divide(this,e)}set(e){return Da.set(this,ZA(e))}value(){return this._value}valueOf(){return this._value}}function ZA(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(ZA(t))}zt.version=kq,zt.isNumbro=function(t){return t instanceof XA},zt.language=Qi.currentLanguage,zt.registerLanguage=Qi.registerLanguage,zt.setLanguage=Qi.setLanguage,zt.languages=Qi.languages,zt.languageData=Qi.languageData,zt.zeroFormat=Qi.setZeroFormat,zt.defaultFormat=Qi.currentDefaults,zt.setDefaults=Qi.setDefaults,zt.defaultCurrencyFormat=Qi.currentCurrencyDefaultFormat,zt.validate=Lq.validate,zt.loadLanguagesInNode=$q.loadLanguagesInNode,zt.unformat=Fq.unformat,zt.BigNumber=Da.BigNumber;var Wq=zt,ka=L2(Wq);const Bq="numeric";function QA(t,e){if(zn(t)){const n=e.numericFormat,r=n&&n.culture||"-",i=n&&n.pattern;if(typeof r<"u"&&!ka.languages()[r]){const o=r.replace("-",""),s=ka.allLanguages?ka.allLanguages[r]:ka[o];s&&ka.registerLanguage(s)}ka.setLanguage(r),t=ka(t).format(i||"0")}return t}function jS(t,e,n,r,i,o,s){let a=o;if(zn(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=QA(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"}Bo(t,e,n,r,i,a,s)}jS.RENDERER_TYPE=Bq;const jq="password";function US(t,e,n,r,i,o,s){Bo.apply(this,[t,e,n,r,i,o,s]);const a=s.hashLength||e.innerHTML.length,l=s.hashSymbol||"*";let u="";me(a-1,()=>{u+=l}),tu(e,u)}US.RENDERER_TYPE=jq;const Uq="select";function zS(t,e,n,r,i,o,s){Bo.apply(this,[t,e,n,r,i,o,s])}zS.RENDERER_TYPE=Uq;const zq="time";function YS(t,e,n,r,i,o,s){Bo.apply(this,[t,e,n,r,i,o,s]),e.dir="ltr"}YS.RENDERER_TYPE=zq;const{register:Yq,getItem:Gq,hasItem:JA,getNames:Pue,getValues:Oue}=Ci("renderers");function GS(t){if(typeof t=="function")return t;if(!JA(t))throw Error(`No registered renderer found under "${t}" name`);return Gq(t)}function Kr(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),Yq(t,e)}function qq(){Kr(su),Kr(Qc),Kr(AS),Kr(cb),Kr(NS),Kr(ub),Kr(jS),Kr(US),Kr(zS),Kr(Bo),Kr(YS)}const Kq="autocomplete";function ig(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,eH(n,e)):eH(n,e)(this.source):e(!0)}ig.VALIDATOR_TYPE=Kq;function eH(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 Xq(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const Zq="date";function qS(t,e){const n=AA(dA,this.instance);let r=t,i=!0;r==null&&(r="");let o=Q(r,this.dateFormat||n.defaultDateFormat,!0).isValid(),s=Q(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=Qq(r,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,a,"dateValidator"),i=!0}else i=!1;e(i)}qS.VALIDATOR_TYPE=Zq;function Qq(t,e){const n=Q(Xq(t)),r=Q(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 Jq="dropdown";function KS(t,e){ig.apply(this,[t,e])}KS.VALIDATOR_TYPE=Jq;const eK="numeric";function XS(t,e){let n=t;n==null&&(n=""),this.allowEmpty&&n===""?e(!0):e(n===""?!1:zn(t))}XS.VALIDATOR_TYPE=eK;const tK=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],nK="time";function ZS(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=Q(i,tK,!0).isValid()?Q(i):Q(i,n);let a=s.isValid(),l=Q(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)}ZS.VALIDATOR_TYPE=nK;const{register:rK,getItem:iK,hasItem:tH,getNames:xue,getValues:Aue}=Ci("validators");function oK(t){if(typeof t=="function")return t;if(!tH(t))throw Error(`No registered validator found under "${t}" name`);return iK(t)}function cu(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),rK(t,e)}function sK(){cu(ig),cu(KS),cu(qS),cu(XS),cu(ZS)}const aK={CELL_TYPE:"autocomplete",editor:By,renderer:su,validator:ig},lK={CELL_TYPE:"checkbox",editor:sA,renderer:AS},uK="date";function nH(t,e,n,r,i,o,s){su.apply(this,[t,e,n,r,i,o,s])}nH.RENDERER_TYPE=uK;const cK={CELL_TYPE:"date",editor:gA,renderer:nH,validator:qS},hK={CELL_TYPE:"dropdown",editor:mA,renderer:cb,validator:KS,filter:!1,strict:!0},dK={CELL_TYPE:"handsontable",editor:ky,renderer:NS},fK={CELL_TYPE:"numeric",editor:pA,renderer:jS,validator:XS,dataType:"number"},gK={CELL_TYPE:"password",editor:wA,renderer:US,copyable:!1},mK={CELL_TYPE:"select",editor:CA,renderer:zS},rH={CELL_TYPE:"text",editor:Aa,renderer:Bo},pK={CELL_TYPE:"time",editor:yA,renderer:YS,validator:ZS},{register:wK,getItem:vK,hasItem:iH,getNames:jue,getValues:Uue}=Ci("cellTypes");function CK(t){if(!iH(t))throw Error(`You declared cell type "${t}" as a string that is not mapped to a known object.
|
|
32
|
-
Cell type must be an object or a string mapped to an object registered by
|
|
33
|
-
"Handsontable.cellTypes.registerCellType" method`);return vK(t)}function bi(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:n,renderer:r,validator:i}=e;n&&Ir(t,n),r&&Kr(t,r),i&&cu(t,i),wK(t,e)}function yK(){bi(aK),bi(lK),bi(cK),bi(hK),bi(dK),bi(fK),bi(gK),bi(mK),bi(rH),bi(pK)}const QS="asc",bK="desc",oH=new Map([[QS,[-1,1]],[bK,[1,-1]]]),SK=t=>`The priority '${t}' is already declared in a map.`,RK=t=>`The priority '${t}' is not a number.`;function EK(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=new Map;t=at(t)?t:SK,e=at(e)?e:RK;function r(o,s){if(!zn(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]:QS;const[s,a]=oH.get(o)||oH.get(QS);return[...n].sort((l,u)=>l[0]<u[0]?s:a).map(l=>l[1])}return{addItem:r,getItems:i}}const TK=t=>`The id '${t}' is already declared in a map.`;function og(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=at(t)?t:TK;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 _K=t=>`'${t}' value is already declared in a unique set.`;function MK(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=at(t)?t:_K;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 JS=t=>`There is already registered "${t}" plugin.`,sH=EK({errorPriorityExists:t=>`There is already registered plugin on priority "${t}".`,errorPriorityNaN:t=>`The priority "${t}" is not a number.`}),aH=MK({errorItemExists:JS}),eR=og({errorIdExists:JS});function lH(){return[...sH.getItems(),...aH.getItems()]}function tR(t){const e=mi(t);return eR.getItem(e)}function IK(t){return!!tR(t)}function Ke(t,e,n){[t,e,n]=OK(t,e,n),tR(t)===void 0&&PK(t,e,n)}function PK(t,e,n){const r=mi(t);if(eR.hasItem(r))throw new Error(JS(r));n===void 0?aH.addItem(r):sH.addItem(n,r),eR.addItem(r,e)}function OK(t,e,n){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,n=e.PLUGIN_PRIORITY),[t,e,n]}function xK(t,e){uH(t,e),e.add(t)}function AK(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 hu(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)}function du(t,e){return t.get(cH(t,e))}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")}const hH=new Map([["plugin",IK],["cell-type",iH],["editor",xA],["renderer",JA],["validator",tH]]),dH=Symbol("mainSetting"),DK="base",sg=[];let La=null;var $a=new WeakMap,fH=new WeakSet;class Qe{static get PLUGIN_KEY(){return DK}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}constructor(e){xK(this,fH),hu(this,"eventManager",new vi(this)),hu(this,"pluginName",null),hu(this,"pluginsInitializedCallbacks",[]),hu(this,"isPluginsReady",!1),hu(this,"enabled",!1),hu(this,"initialized",!1),AK(this,$a,{}),Lo(this,"hot",e,{writable:!1}),La=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(!hH.has(s))throw new Error(`Unknown plugin dependency type "${s}" was found.`);hH.get(s)(a)||i.push(` - ${a} (${s})`)}),i.length>0){const o=[`The ${this.pluginName} plugin requires the following modules:
|
|
34
|
-
`,`${i.join(`
|
|
35
|
-
`)}
|
|
36
|
-
`].join("");sg.push(o)}}if(La||(La=lH()),La.indexOf(this.pluginName)>=0&&La.splice(La.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),La.length===0){if(sg.length>0){const i=[`${sg.join(`
|
|
37
|
-
`)}
|
|
38
|
-
`,"You have to import and register them manually."].join("");throw sg.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)||De(n))&&r[dH]===e){var i;return Array.isArray(n)?n:(i=n[e])!==null&&i!==void 0?i:r[e]}if(De(n)){var o;return(o=n[e])!==null&&o!==void 0?o:r[e]}return r[e]}addHook(e,n,r){du($a,this)[e]=du($a,this)[e]||[];const i=du($a,this)[e];this.hot.addHook(e,n,r),i.push(n),du($a,this)[e]=i}removeHooks(e){D(du($a,this)[e]||[],n=>{this.hot.removeHook(e,n)})}clearHooks(){const e=du($a,this);ke(e,(n,r)=>this.removeHooks(r)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){D(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const n=cH(fH,this,kK).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(),ke(this,(n,r)=>{r!=="hot"&&(this[r]=null)}),delete this.t,delete this.hot}}function kK(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 Fa(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=$K(t,"string");return typeof e=="symbol"?e:e+""}function $K(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 gH=class{constructor(e){Fa(this,"hot",null),Fa(this,"container",null),Fa(this,"injected",!1),Fa(this,"rows",[]),Fa(this,"columns",[]),Fa(this,"samples",null),Fa(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&&Z(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(),D(this.rows,n=>{const{height:r}=n.table.getBoundingClientRect();e(n.row,Math.ceil(r))})}getWidths(e){this.injected||this.injectTable(),D(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=>{D(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=>{D(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=>{D(i.strings,o=>{const s=o.col,a=e.createElement("th");r.push([s,a]),n.appendChild(a)})}),this.table.tHead.appendChild(n),D(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=>{D(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),Z(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 Z(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 ag(t,e,n){return(e=FK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FK(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 lg{static get SAMPLE_COUNT(){return 3}constructor(e){ag(this,"samples",null),ag(this,"dataFactory",null),ag(this,"customSampleCount",null),ag(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:lg.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 me(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 me(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:De(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 mH={},pH;function WK(){if(pH)return mH;pH=1;var t=Ct(),e=kl(),n=$l(),r=_c(),i=Kf();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"),mH}WK();var wH={},vH;function BK(){if(vH)return wH;vH=1;var t=Ct(),e=Jt(),n=Sc(),r=_c(),i=rf(),o=Tn(),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)}}),wH}BK();function th(t,e,n){return(e=jK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jK(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)}class zK{constructor(){th(this,"count",0),th(this,"startColumn",null),th(this,"endColumn",null),th(this,"startPosition",null),th(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 nh(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)}class qK{constructor(){nh(this,"count",0),nh(this,"startRow",null),nh(this,"endRow",null),nh(this,"startPosition",null),nh(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 rh(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=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 CH{constructor(){rh(this,"count",0),rh(this,"startColumn",null),rh(this,"endColumn",null),rh(this,"startPosition",null),rh(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 ih(t,e,n){return(e=ZK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ZK(t){var e=QK(t,"string");return typeof e=="symbol"?e:e+""}function QK(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 yH{constructor(){ih(this,"count",0),ih(this,"startRow",null),ih(this,"endRow",null),ih(this,"startPosition",null),ih(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 oh(t,e,n){return(e=JK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JK(t){var e=e3(t,"string");return typeof e=="symbol"?e:e+""}function e3(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 t3{constructor(){oh(this,"count",0),oh(this,"startColumn",0),oh(this,"endColumn",0),oh(this,"startPosition",0),oh(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalColumns:n}=e;this.count=n,this.endColumn=this.count-1}process(){}finalize(){}}function sh(t,e,n){return(e=n3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n3(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 i3{constructor(){sh(this,"count",0),sh(this,"startRow",0),sh(this,"endRow",0),sh(this,"startPosition",0),sh(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalRows:n}=e;this.count=n,this.endRow=this.count-1}process(){}finalize(){}}function bH(t,e,n){return(e=o3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o3(t){var e=s3(t,"string");return typeof e=="symbol"?e:e+""}function s3(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 a3 extends CH{constructor(){super(...arguments),bH(this,"columnStartOffset",0),bH(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 SH(t,e,n){return(e=l3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l3(t){var e=u3(t,"string");return typeof e=="symbol"?e:e+""}function u3(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 c3 extends yH{constructor(){super(...arguments),SH(this,"rowStartOffset",0),SH(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 RH(t,e,n){return(e=h3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h3(t){var e=d3(t,"string");return typeof e=="symbol"?e:e+""}function d3(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(e){RH(this,"calculationTypes",[]),RH(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 Si(t,e,n){return(e=f3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f3(t){var e=g3(t,"string");return typeof e=="symbol"?e:e+""}function g3(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 fu=50;class m3 extends EH{constructor(e){let{calculationTypes:n,viewportWidth:r,scrollOffset:i,totalColumns:o,columnWidthFn:s,overrideFn:a,inlineStartOffset:l}=e;super(n),Si(this,"viewportWidth",0),Si(this,"scrollOffset",0),Si(this,"zeroBasedScrollOffset",0),Si(this,"totalColumns",0),Si(this,"columnWidthFn",null),Si(this,"columnWidth",0),Si(this,"overrideFn",null),Si(this,"inlineStartOffset",0),Si(this,"totalCalculatedWidth",0),Si(this,"startPositions",[]),Si(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)?fu:n}}function Xr(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 v3 extends EH{constructor(e){let{calculationTypes:n,viewportHeight:r,scrollOffset:i,totalRows:o,defaultRowHeight:s,rowHeightFn:a,overrideFn:l,horizontalScrollbarHeight:u}=e;super(n),Xr(this,"viewportHeight",0),Xr(this,"scrollOffset",0),Xr(this,"zeroBasedScrollOffset",0),Xr(this,"totalRows",0),Xr(this,"rowHeightFn",null),Xr(this,"rowHeight",0),Xr(this,"overrideFn",null),Xr(this,"horizontalScrollbarHeight",0),Xr(this,"innerViewportHeight",0),Xr(this,"totalCalculatedHeight",0),Xr(this,"startPositions",[]),Xr(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 C3(t,e,n){y3(t,e),e.set(t,n)}function y3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function TH(t,e,n){return(e=b3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function b3(t){var e=S3(t,"string");return typeof e=="symbol"?e:e+""}function S3(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 gu(t,e){return t.get(MH(t,e))}function _H(t,e,n){return t.set(MH(t,e),n),n}function MH(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 zo=new WeakMap;class Va{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;TH(this,"row",null),TH(this,"col",null),C3(this,zo,!1),_H(zo,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 gu(zo,this)}isSouthEastOf(e){return this.row>=e.row&&(gu(zo,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(gu(zo,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(gu(zo,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(gu(zo,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 Va&&_H(zo,this,e.isRtl()),this}clone(){return new Va(this.row,this.col,gu(zo,this))}toObject(){return{row:this.row,col:this.col}}}function R3(t,e,n){E3(t,e),e.set(t,n)}function E3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nR(t,e,n){return(e=T3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T3(t){var e=_3(t,"string");return typeof e=="symbol"?e:e+""}function _3(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){return t.get(IH(t,e))}function M3(t,e,n){return t.set(IH(t,e),n),n}function IH(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 or=new WeakMap;class ah{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;nR(this,"highlight",null),nR(this,"from",null),nR(this,"to",null),R3(this,or,!1),this.highlight=e.clone(),this.from=n.clone(),this.to=r.clone(),M3(or,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 Zr(or,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 Zr(or,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 Zr(or,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 Zr(or,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 Zr(or,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 Zr(or,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 Zr(or,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 Zr(or,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 Va))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(Zr(or,this)?"left":"right"),n.bottom===r.bottom&&i.push("bottom"),n.left===r.left&&i.push(Zr(or,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 ah(this.highlight,this.from,this.to,Zr(or,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,n){return new Va(e,n,Zr(or,this))}}function Ji(t,e,n){I3(t,e),e.set(t,n)}function I3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function we(t,e){return t.get(PH(t,e))}function Os(t,e,n){return t.set(PH(t,e),n),n}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")}var Qr=new WeakMap,rR=new WeakMap,Sn=new WeakMap,mu=new WeakMap,ug=new WeakMap,Ri=new WeakMap,iR=new WeakMap,lh=new WeakMap,Wa=new WeakMap,eo=new WeakMap;let OH=class{constructor(e,n,r,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;Ji(this,Qr,void 0),Ji(this,rR,void 0),Ji(this,Sn,void 0),Ji(this,mu,void 0),Ji(this,ug,void 0),Ji(this,Ri,void 0),Ji(this,iR,void 0),Ji(this,lh,void 0),Ji(this,Wa,[null,null]),Ji(this,eo,[null,null]),Os(Qr,this,r),Os(rR,this,n),Os(Sn,this,o),Os(mu,this,s),Os(ug,this,a),Os(Ri,this,i),Os(iR,this,e),this.registerEvents()}registerEvents(){we(Ri,this).addEventListener(we(Sn,this).holder,"contextmenu",r=>this.onContextMenu(r)),we(Ri,this).addEventListener(we(Sn,this).TABLE,"mouseover",r=>this.onMouseOver(r)),we(Ri,this).addEventListener(we(Sn,this).TABLE,"mouseout",r=>this.onMouseOut(r));const e=()=>{we(Ri,this).addEventListener(we(Sn,this).holder,"touchstart",r=>this.onTouchStart(r)),we(Ri,this).addEventListener(we(Sn,this).holder,"touchend",r=>this.onTouchEnd(r)),this.momentumScrolling||(this.momentumScrolling={}),we(Ri,this).addEventListener(we(Sn,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||we(Qr,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,we(Qr,this).getSetting("onAfterMomentumScroll"))},200)})},n=()=>{we(Ri,this).addEventListener(we(Sn,this).holder,"mouseup",r=>this.onMouseUp(r)),we(Ri,this).addEventListener(we(Sn,this).holder,"mousedown",r=>this.onMouseDown(r))};Wo()?e():(Hx()&&e(),n())}selectedCellWasTouched(e){const r=this.parentCell(e).coords;if(we(lh,this)&&r){const[i,o]=[r.row,we(lh,this).from.row],[s,a]=[r.col,we(lh,this).from.col];return i===o&&s===a}return!1}parentCell(e){const n={},r=we(Sn,this).TABLE,i=Af(e,["TD","TH"],r);return i?(n.coords=we(Sn,this).getCoords(i),n.TD=i):Se(e,"wtBorder")&&Se(e,"current")?(n.coords=we(mu,this).getFocusSelection().cellRange.highlight,n.TD=we(Sn,this).getCell(n.coords)):Se(e,"wtBorder")&&Se(e,"area")&&we(mu,this).getAreaSelection().cellRange&&(n.coords=we(mu,this).getAreaSelection().cellRange.to,n.TD=we(Sn,this).getCell(n.coords)),n}onMouseDown(e){const n=we(rR,this).rootDocument.activeElement,r=tA(qz,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);Se(i,"corner")?we(Qr,this).getSetting("onCellCornerMouseDown",e,i):o.TD&&we(Qr,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,o.coords,o.TD),(e.button===0||this.touchApplied)&&o.TD&&(we(eo,this)[0]=o.TD,clearTimeout(we(Wa,this)[0]),we(Wa,this)[0]=setTimeout(()=>{we(eo,this)[0]=null},1e3))}onContextMenu(e){if(we(Qr,this).has("onCellContextMenu")){const n=this.parentCell(e.target);n.TD&&this.callListener("onCellContextMenu",e,n.coords,n.TD)}}onMouseOver(e){if(!we(Qr,this).has("onCellMouseOver"))return;const n=we(Sn,this).TABLE,r=Af(e.target,["TD","TH"],n),i=we(ug,this)||this;r&&r!==i.lastMouseOver&&_a(r,n)&&(i.lastMouseOver=r,this.callListener("onCellMouseOver",e,we(Sn,this).getCoords(r),r))}onMouseOut(e){if(!we(Qr,this).has("onCellMouseOut"))return;const n=we(Sn,this).TABLE,r=Af(e.target,["TD","TH"],n),i=Af(e.relatedTarget,["TD","TH"],n),o=we(ug,this)||this;r&&r!==i&&_a(r,n)&&(this.callListener("onCellMouseOut",e,we(Sn,this).getCoords(r),r),i===null&&(o.lastMouseOver=null))}onMouseUp(e){const n=this.parentCell(e.target);n.TD&&we(Qr,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,n.coords,n.TD),!(e.button!==0&&!this.touchApplied)&&(n.TD===we(eo,this)[0]&&n.TD===we(eo,this)[1]?(Se(e.target,"corner")?this.callListener("onCellCornerDblClick",e,n.coords,n.TD):this.callListener("onCellDblClick",e,n.coords,n.TD),we(eo,this)[0]=null,we(eo,this)[1]=null):n.TD===we(eo,this)[0]&&(we(eo,this)[1]=n.TD,clearTimeout(we(Wa,this)[1]),we(Wa,this)[1]=setTimeout(()=>{we(eo,this)[1]=null},500)))}onTouchStart(e){Os(lh,this,we(mu,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=fe(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&o&&we(Qr,this).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];Dx()&&(CY()||yY())&&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=we(Qr,this).getSettingPure(e);o&&o(n,r,i,we(iR,this).call(this))}destroy(){clearTimeout(we(Wa,this)[0]),clearTimeout(we(Wa,this)[1]),we(Ri,this).destroy()}};function oR(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{constructor(e,n,r){oR(this,"offset",void 0),oR(this,"total",void 0),oR(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 sR(t,e,n){return(e=A3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A3(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 N3{constructor(e,n,r){sR(this,"offset",void 0),sR(this,"total",void 0),sR(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 cg(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)}class L3{constructor(){cg(this,"currentSize",0),cg(this,"nextSize",0),cg(this,"currentOffset",0),cg(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}const $3=0,xH=1,aR=2;function lR(t,e,n){return(e=F3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function F3(t){var e=V3(t,"string");return typeof e=="symbol"?e:e+""}function V3(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 W3{constructor(){lR(this,"size",new L3),lR(this,"workingSpace",$3),lR(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=xH,e.workingSpace=aR,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=aR,e.workingSpace=xH,this.sharedSize=e.getViewSize()}}var AH={},uR,HH;function B3(){if(HH)return uR;HH=1;var t=tf(),e=TypeError;return uR=function(n,r){if(!delete n[r])throw new e("Cannot delete property "+t(r)+" of "+t(n))},uR}var NH;function j3(){if(NH)return AH;NH=1;var t=Ct(),e=kl(),n=$l(),r=oI(),i=B3(),o=aI(),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 S=m+f;m in h?h[S]=h[m]:i(h,S)}for(var b=0;b<f;b++)h[b]=arguments[b]}return r(h,d+f)}}),AH}j3();function U3(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 DH{constructor(e,n){U3(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 G3(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){G3(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 DH(o,n),l=new DH(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(aR)?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 pu(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 kH{constructor(e,n){pu(this,"rootNode",void 0),pu(this,"nodesPool",void 0),pu(this,"sizeSet",new W3),pu(this,"collectedNodes",[]),pu(this,"viewDiffer",new X3(this.sizeSet)),pu(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 LH extends kH{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 $H(t,e,n){return(e=J3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function J3(t){var e=eX(t,"string");return typeof e=="symbol"?e:e+""}function eX(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 tX{constructor(e){$H(this,"nodeType",void 0),$H(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 uh(t,e,n){return(e=nX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nX(t){var e=rX(t,"string");return typeof e=="symbol"?e:e+""}function rX(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 ch{constructor(e,n){uh(this,"nodesPool",null),uh(this,"nodeType",void 0),uh(this,"rootNode",void 0),uh(this,"table",null),uh(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new tX(e):null,this.nodeType=e,this.rootNode=n}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function FH(t,e,n){return(e=iX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iX(t){var e=oX(t,"string");return typeof e=="symbol"?e:e+""}function oX(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 sX extends ch{constructor(){super("TH"),FH(this,"orderViews",new WeakMap),FH(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new LH(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"),eu(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Re(d,[Mz(),kz(),My(h+1),Ra(-1)]),n[h](a,d,h)}u.end()}}}class aX extends ch{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&&Fo(r)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&Re(this.rootNode,[hx()]);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()&&Re(s,[_y(),mx(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"),eu(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Re(u,[My(a+1+this.table.rowHeadersCount),Ra(-1),Iz(),...a>=0?[Dz()]:[_y()]]),r[n](l,u,n)}}}}let VH=!1;class lX extends ch{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;!VH&&e>1e3&&(VH=!0,rt(it`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
|
|
39
|
-
Consider limiting the number of rendered columns by specifying the table width and/or\x20
|
|
40
|
-
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&&Z(r,"rowHeader")}}function uX(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)}const wu={rowEven:"ht__row_even",rowOdd:"ht__row_odd"};let WH=!1;class dX extends ch{constructor(e){super("TR",e),uX(this,"orderView",void 0),this.orderView=new kH(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;!WH&&e>1e3&&(WH=!0,rt(it`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
|
|
41
|
-
Consider limiting the number of rendered rows by specifying the table height and/or\x20
|
|
42
|
-
turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&Re(this.rootNode,[hx()]),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;Re(o,[_y(),mx(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?Se(o,wu.rowEven)||(ye(o,wu.rowOdd),Z(o,wu.rowEven)):Se(o,wu.rowOdd)||(ye(o,wu.rowEven),Z(o,wu.rowOdd))}this.orderView.end()}}function BH(t,e,n){return(e=fX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fX(t){var e=gX(t,"string");return typeof e=="symbol"?e:e+""}function gX(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 mX extends ch{constructor(){super("TD"),BH(this,"orderViews",new WeakMap),BH(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new LH(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(Se(m,"hide")||(m.className=""),m.removeAttribute("style"),m.removeAttribute("dir"),eu(m,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,f,m),this.table.isAriaEnabled()){var o,s;Re(m,[...m.hasAttribute("role")?[]:[_z()],Ra(-1),My(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 hn(t,e,n){return(e=pX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pX(t){var e=wX(t,"string");return typeof e=="symbol"?e:e+""}function wX(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 vX{constructor(e){let{cellRenderer:n,stylesHandler:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};hn(this,"rootNode",void 0),hn(this,"rootDocument",void 0),hn(this,"rowHeaders",null),hn(this,"columnHeaders",null),hn(this,"colGroup",null),hn(this,"rows",null),hn(this,"cells",null),hn(this,"rowFilter",null),hn(this,"columnFilter",null),hn(this,"rowUtils",null),hn(this,"columnUtils",null),hn(this,"rowsToRender",0),hn(this,"columnsToRender",0),hn(this,"rowHeaderFunctions",[]),hn(this,"rowHeadersCount",0),hn(this,"columnHeaderFunctions",[]),hn(this,"columnHeadersCount",0),hn(this,"cellRenderer",void 0),hn(this,"activeOverlayName",void 0),hn(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 CX{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 vX(e,{cellRenderer:a,stylesHandler:l}),this.renderer.setRenderers({rowHeaders:new sX,columnHeaders:new aX(n),colGroup:new lX(r),rows:new dX(i),cells:new mX}),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 cR(t,e,n){return(e=yX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yX(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 SX{constructor(e,n){cR(this,"dataAccessObject",void 0),cR(this,"wtSettings",void 0),cR(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 jH(t,e,n){return(e=RX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function RX(t){var e=EX(t,"string");return typeof e=="symbol"?e:e+""}function EX(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 TX{constructor(e,n){jH(this,"dataAccessObject",void 0),jH(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 to(t,e,n){return(e=_X(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _X(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 vu{constructor(e,n,r,i,o){to(this,"wtSettings",null),to(this,"domBindings",void 0),to(this,"TBODY",null),to(this,"THEAD",null),to(this,"COLGROUP",null),to(this,"hasTableHeight",!0),to(this,"hasTableWidth",!0),to(this,"isTableVisible",!1),to(this,"tableOffset",0),to(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,bx(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 TX(this.dataAccessObject,this.wtSettings),this.columnUtils=new SX(this.dataAccessObject,this.wtSettings),this.tableRenderer=new CX({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||!Se(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")&&Re(r,[$o()]),r}createHider(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!Se(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtHider",n&&n.insertBefore(r,e),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Re(r,[$o()]),r}createHolder(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!Se(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.style.position="relative",r.className="wtHolder",Re(r,[Ra(-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")&&Re(r.parentNode,[$o()])),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Re(r,[$o()]),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=Nn(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=Nn(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const f=Math.max(this.getFirstRenderedRow(),0),m=Math.max(this.getFirstRenderedColumn(),0);this.rowFilter=new N3(f,o,c),this.columnFilter=new x3(m,s,l);let S=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const b={};this.wtSettings.getSetting("beforeDraw",!0,b),S=b.skipRender!==!0}S&&(this.tableRenderer.setHeaderContentRenderers(a,u),(this.is(no)||this.is(xs))&&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(no))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||i.createVisibleCalculators(),r.refresh(!1),r.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(no)&&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=Kc(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(no))&&!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=Ta(n,["TD","TH"])),n===null)return null;const r=n.parentNode;if(!r)return null;const i=r.parentNode;let o=Zz(r),s=n.cellIndex;Ma(Ua,n,this.wtRootElement)||Ma(Ba,n,this.wtRootElement)?i.nodeName==="THEAD"&&(o-=i.childNodes.length):Ma(xs,n,this.wtRootElement)||Ma(no,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)),Ma(Ua,n,this.wtRootElement)||Ma(ja,n,this.wtRootElement)||Ma(xs,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=Kc(this.TBODY)-1,i=this.wot.stylesHandler.areCellsBorderBox(),o=i?cn:Kc,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 tn(this.TABLE)}getHeight(){return cn(this.TABLE)}getTotalWidth(){const e=tn(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=cn(this.hider);return e!==0?e:this.getHeight()}isVisible(){return nu(this.TABLE)}_modifyRowHeaderWidth(e){let n=at(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 IX="stickyRowsBottom",hR={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}};Lo(hR,"MIXIN_NAME",IX,{writable:!1,enumerable:!1});const PX="stickyColumnsStart",hg={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}};Lo(hg,"MIXIN_NAME",PX,{writable:!1,enumerable:!1});class dR extends vu{constructor(e,n,r,i){super(e,n,r,i,xs)}}ft(dR,hR),ft(dR,hg);const Ba="top",no="bottom",ja="inline_start",Ua="top_inline_start_corner",xs="bottom_inline_start_corner",UH=[Ba,no,ja,Ua,xs],OX=new Map([[Ba,`ht_clone_${Ba}`],[no,`ht_clone_${no}`],[ja,`ht_clone_${ja} ht_clone_left`],[Ua,`ht_clone_${Ua} ht_clone_top_left_corner`],[xs,`ht_clone_${xs} ht_clone_bottom_left_corner`]]);function xX(t,e){AX(t,e),e.add(t)}function AX(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function HX(t,e,n){return(e=NX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function NX(t){var e=DX(t,"string");return typeof e=="symbol"?e:e+""}function DX(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 dg(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var hh=new WeakSet;class kX{constructor(e){xX(this,hh),HX(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=Rr(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=Rr(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 dg(hh,this,YH).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return dg(hh,this,YH).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return dg(hh,this,zH).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return dg(hh,this,zH).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function zH(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=Nn(r.wtRootElement).left;const u=Math.abs(Rx(s,s));if(l>u){const c=Ex(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 YH(t){const{topOverlay:e,wtTable:n,wtViewport:r,totalRows:i,rootWindow:o}=this.dataAccessObject;if(e.mainTableScrollableElement===o){const s=Nn(n.wtRootElement),a=Oy(o,o);if(s.top>a){const l=Kc(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 Jr(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 fR{get eventManager(){return new vi(this)}constructor(e,n){Jr(this,"wtTable",void 0),Jr(this,"wtScroll",void 0),Jr(this,"wtViewport",void 0),Jr(this,"wtOverlays",void 0),Jr(this,"selectionManager",void 0),Jr(this,"wtEvent",void 0),Jr(this,"guid",`wt_${ax()}`),Jr(this,"drawInterrupted",!1),Jr(this,"drawn",!1),Jr(this,"activeOverlayName","master"),Jr(this,"domBindings",void 0),Jr(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=n,this.wtScroll=new kX(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){Ia(r,e[n])}])}}createCellCoords(e,n){return new Va(e,n,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,n,r){return new ah(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()||Jz(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 GH(t,e,n){return(e=FX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FX(t){var e=VX(t,"string");return typeof e=="symbol"?e:e+""}function VX(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 WX extends fR{constructor(e,n,r){super(e,n),GH(this,"cloneSource",void 0),GH(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 OH(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,r.event),this.findOriginalHeaders()}}function BX(t,e,n){return(e=jX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jX(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 dh{constructor(e,n,r,i,o){BX(this,"wtSettings",null),Lo(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=qc(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=qc(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=Hf(e.TABLE)}getRelativeCellPosition(e,n,r){if(this.clone.wtTable.holder.contains(e)===!1){rt(`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+bn())),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(UH.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=`${OX.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")&&Re(o,[$o()]),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===Ba||u==="vertical"&&this.type===ja?this.mainTableScrollableElement=i:i.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=Hf(e.TABLE),new WX(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 zX extends dh{constructor(e,n,r,i,o,s){super(e,n,xs,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 dR(...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 kf(n),this.repositionOverlay();let r=cn(this.clone.wtTable.TABLE);const i=tn(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+=bn(r)),i.style.bottom=`${o}px`}}const YX="calculatedColumns",fg={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}};Lo(fg,"MIXIN_NAME",YX,{writable:!1,enumerable:!1});class gR extends vu{constructor(e,n,r,i){super(e,n,r,i,no)}}ft(gR,hR),ft(gR,fg);function GX(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 extends dh{constructor(e,n,r,i){super(e,n,no,r,i),GX(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 gR(...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+=bn(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-=bn(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=cn(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=bn(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 Oy(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=Se(s,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(Z(s,"innerBorderBottom"),o=!a):(ye(s,"innerBorderBottom"),o=a)}return o}}const ZX="calculatedRows",mR={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}};Lo(mR,"MIXIN_NAME",ZX,{writable:!1,enumerable:!1});class pR extends vu{constructor(e,n,r,i){super(e,n,r,i,ja)}}ft(pR,mR),ft(pR,hg);const QX="localHooks",On={_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++)Ly(this._localHooks[t][l],this,e,n,r,i,o,s)}},clearLocalHooks(){return this._localHooks={},this}};Lo(On,"MIXIN_NAME",QX,{writable:!1,enumerable:!1});let qH=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")}};ft(qH,On);const KH="active-header",wR="header",vR="area",fh="focus",JX="fill",e6="row",t6="column",n6="custom-selection",CR=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={},ZH;function r6(){if(ZH)return XH;ZH=1;var t=Kf();return t("flat"),XH}r6();function i6(t,e){JH(t,e),e.add(t)}function QH(t,e,n){JH(t,e),e.set(t,n)}function JH(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(gh(t,e))}function e1(t,e,n){return t.set(gh(t,e),n),n}function gh(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 Ei=new WeakMap,Dn=new WeakMap,gg=new WeakSet;class o6{constructor(){i6(this,gg),QH(this,Ei,void 0),QH(this,Dn,void 0)}setActiveOverlay(e){return e1(Dn,this,e),this}setActiveSelection(e){return e1(Ei,this,e),this}scan(){const e=Nt(Ei,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(Ei,this).getCorners(),{wtTable:s}=Nt(Dn,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 S=Nt(Dn,this).getSetting("onBeforeHighlightingColumnHeader",h,f,{selectionType:Nt(Ei,this).settings.selectionType,columnCursor:u,selectionWidth:o-r+1});S!==null&&(S!==h&&(m=s.getColumnHeader(S,f)),e(m))}u+=1}}}scanRowsInHeadersRange(e){const[n,r,i,o]=Nt(Ei,this).getCorners(),{wtTable:s}=Nt(Dn,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 S=Nt(Dn,this).getSetting("onBeforeHighlightingRowHeader",h,f,{selectionType:Nt(Ei,this).settings.selectionType,rowCursor:u,selectionHeight:i-n+1});S!==null&&(S!==h&&(m=s.getRowHeader(S,f)),e(m))}u+=1}}}scanCellsRange(e){const{wtTable:n}=Nt(Dn,this);gh(gg,this,s6).call(this,(r,i)=>{const o=n.getCell(Nt(Dn,this).createCellCoords(r,i)),s=Nt(Dn,this).getSetting("onAfterDrawSelection",r,i,Nt(Ei,this).settings.layerLevel);typeof s=="string"&&Z(o,s),e(o)})}scanRowsInCellsRange(e){const[n,,r]=Nt(Ei,this).getCorners(),{wtTable:i}=Nt(Dn,this);gh(gg,this,t1).call(this,(o,s)=>{if(o>=n&&o<=r){const a=i.getCell(Nt(Dn,this).createCellCoords(o,s));e(a)}})}scanColumnsInCellsRange(e){const[,n,,r]=Nt(Ei,this).getCorners(),{wtTable:i}=Nt(Dn,this);gh(gg,this,t1).call(this,(o,s)=>{if(s>=n&&s<=r){const a=i.getCell(Nt(Dn,this).createCellCoords(o,s));e(a)}})}}function s6(t){let[e,n,r,i]=Nt(Ei,this).getCorners();if(e<0&&r<0||n<0&&i<0)return;const{wtTable:o}=Nt(Dn,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(Dn,this).createCellCoords(e,n));if(!Vo(a))return}for(let a=e;a<=r;a+=1)for(let l=n;l<=i;l+=1)t(a,l)}function t1(t){const{wtTable:e}=Nt(Dn,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 n1{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=CR(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(),wi(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(" "),Wo()&&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`};ke(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}`};ke(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),S=parseInt(c.width,10),b=this.wot.wtTable.getWidth(),T=this.wot.wtTable.getHeight();u.top=`${parseInt(r-m-1,10)}px`,u[l]=`${parseInt(i-m-1,10)}px`,c.top=`${parseInt(r-S/4*3,10)}px`,c[l]=`${parseInt(i-S/4*3,10)}px`;const v=Math.min(parseInt(i+o,10),b-m-f*2),O=Math.min(parseInt(i+o-S/4,10),b-S-f*2);h[l]=`${v}px`,d[l]=`${O}px`;const P=Math.min(parseInt(r+s,10),T-m-f*2),_=Math.min(parseInt(r+s-S/4,10),T-S-f*2);h.top=`${P}px`,d.top=`${_}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)),!Vo(m)){this.disappear();return}const S=u?s.getCell(this.wot.createCellCoords(i,o)):m,b=Nn(m),T=u?Nn(S):b,v=Nn(s.TABLE),O=b.top,P=b.left,_=this.wot.wtSettings.getSetting("rtlMode");let M=0,H=0;if(_){const ve=tn(s.TABLE),Ie=tn(m),pt=l.innerWidth-v.left-ve;H=P+Ie-T.left,M=l.innerWidth-P-Ie-pt-1}else H=T.left+tn(S)-P,M=P-v.left-1;if(this.isEntireColumnSelected(n,i)){const ve=n,Ie=this.getDimensionsFromHeader("columns",r,o,ve,v);let pt=null;Ie&&([pt,M,H]=Ie),pt&&(m=pt)}let X=O-v.top-1,G=T.top+cn(S)-O;if(this.isEntireRowSelected(r,o)){const ve=r,Ie=this.getDimensionsFromHeader("rows",n,i,ve,v);let pt=null;Ie&&([pt,X,G]=Ie),pt&&(m=pt)}const U=l.getComputedStyle(m);parseInt(U.borderTopWidth,10)>0&&(X+=1,G=G>0?G-1:0),parseInt(U[_?"borderRightWidth":"borderLeftWidth"],10)>0&&(M+=1,H=H>0?H-1:0);const ne=_?"right":"left";this.topStyle.top=`${X}px`,this.topStyle[ne]=`${M}px`,this.topStyle.width=`${H}px`,this.topStyle.display="block",this.startStyle.top=`${X}px`,this.startStyle[ne]=`${M}px`,this.startStyle.height=`${G}px`,this.startStyle.display="block";const ee=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${X+G-ee}px`,this.bottomStyle[ne]=`${M}px`,this.bottomStyle.width=`${H}px`,this.bottomStyle.display="block",this.endStyle.top=`${X}px`,this.endStyle[ne]=`${M+H-ee}px`,this.endStyle.height=`${G+1}px`,this.endStyle.display="block";let he=this.settings.border.cornerVisible;he=typeof he=="function"?he(this.settings.layerLevel):he;const ie=this.wot.getSetting("onModifyGetCellCoords",i,o,!1,"render");let[ae,st]=[i,o];if(ie&&Array.isArray(ie)&&([,,ae,st]=ie),Wo()||!he||this.isPartRange(ae,st))this.cornerStyle.display="none";else{this.cornerStyle.top=`${X+G+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle[ne]=`${M+H+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 ve=qc(s.TABLE);const Ie=ve===l;Ie&&(ve=a.documentElement);const pt=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,Xt=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),K=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(o===this.wot.getSetting("totalColumns")-1){const g=Ie?S.getBoundingClientRect().left:S.offsetLeft;let w=!1,p=0;_?(p=g-parseInt(this.cornerDefaultStyle.width,10)/2,w=p<0):(p=g+tn(S)+parseInt(this.cornerDefaultStyle.width,10)/2,w=p>=Ex(ve)),w&&(this.cornerStyle[ne]=`${Math.floor(M+H+this.cornerCenterPointOffset-Xt-pt)}px`,this.cornerStyle[_?"borderLeftWidth":"borderRightWidth"]=0)}if(i===this.wot.getSetting("totalRows")-1){const p=(Ie?S.getBoundingClientRect().top:S.offsetTop)+cn(S)+parseInt(this.cornerDefaultStyle.height,10)/2>=Kc(ve),I=this.wot.stylesHandler.isClassicTheme();if(p){const k=Math.floor(X+G+this.cornerCenterPointOffset-K-pt);I?(this.cornerStyle.top=`${k}px`,this.cornerStyle.borderBottomWidth=0):this.cornerStyle.top=`${k-1}px`}}this.cornerStyle.display="block"}Wo()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(i,o,X,M,H,G)}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,S=null;switch(e){case"rows":l=function(){return s.getRowHeader(...arguments)},u=function(){return cn(...arguments)},c="ht__selection--rows",f="top";break;case"columns":l=function(){return s.getColumnHeader(...arguments)},u=function(){return tn(...arguments)},c="ht__selection--columns",f="left";break}if(a.classList.contains(c)){const b=this.wot.getSetting("columnHeaders").length;if(m=l(n,b-i),S=l(r,b-i),!m||!S)return!1;const T=Nn(m),v=Nn(S);return m&&S&&(h=T[f]-o[f]-1,d=v[f]+u(S)-T[f]),[m,h,d]}return!1}changeBorderStyle(e,n){const r=this[e].style,i=n[e];!i||i.hide?Z(this[e],"hidden"):(Se(this[e],"hidden")&&ye(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?Z(this[e],"hidden"):ye(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",Wo()&&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 a6(t,e){r1(t,e),e.add(t)}function Cu(t,e,n){r1(t,e),e.set(t,n)}function r1(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Le(t,e){return t.get(yR(t,e))}function i1(t,e,n){return t.set(yR(t,e),n),n}function yR(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 kn=new WeakMap,sr=new WeakMap,bR=new WeakMap,mh=new WeakMap,SR=new WeakMap,za=new WeakMap,o1=new WeakSet;class l6{constructor(e){a6(this,o1),Cu(this,kn,void 0),Cu(this,sr,void 0),Cu(this,bR,new o6),Cu(this,mh,new WeakMap),Cu(this,SR,new WeakSet),Cu(this,za,new Map),i1(sr,this,e)}setActiveOverlay(e){return i1(kn,this,e),Le(bR,this).setActiveOverlay(Le(kn,this)),Le(mh,this).has(Le(kn,this))||Le(mh,this).set(Le(kn,this),new Set),this}getFocusSelection(){return Le(sr,this)!==null?Le(sr,this).getFocus():null}getAreaSelection(){return Le(sr,this)!==null?Le(sr,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(Le(za,this).has(e)){const r=Le(za,this).get(e);if(r.has(Le(kn,this)))return r.get(Le(kn,this));const i=new n1(Le(kn,this),e.settings);return r.set(Le(kn,this),i),i}const n=new n1(Le(kn,this),e.settings);return Le(za,this).set(e,new Map([[Le(kn,this),n]])),n}getBorderInstances(e){var n,r;return Array.from((n=(r=Le(za,this).get(e))===null||r===void 0?void 0:r.values())!==null&&n!==void 0?n:[])}destroyBorders(e){Le(za,this).get(e).forEach(n=>n.destroy()),Le(za,this).delete(e)}render(e){if(Le(sr,this)===null)return;e&&yR(o1,this,u6).call(this);const n=Array.from(Le(sr,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;Le(SR,this).has(s)||(Le(SR,this).add(s),s.addLocalHook("destroy",()=>this.destroyBorders(s)));const h=this.getBorderInstance(s);if(s.isEmpty()){h?.disappear();continue}a&&Le(bR,this).setActiveSelection(s).scan().forEach(m=>{if(r.has(m)){const S=r.get(m);S.has(a)&&u===!0?S.set(a,S.get(a)+1):S.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();Le(kn,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=>Le(mh,this).get(Le(kn,this)).add(u)),Z(s,l),s.nodeName==="TD"&&Array.isArray((a=Le(sr,this).options)===null||a===void 0?void 0:a.cellAttributes)&&Re(s,Le(sr,this).options.cellAttributes)}),Array.from(i.keys()).forEach(o=>{Re(o,[...i.get(o)])})}}function u6(){const t=Le(mh,this).get(Le(kn,this)),e=Le(kn,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=Le(kn,this).wtTable.TABLE.querySelectorAll(`.${n}`);let s=[];Array.isArray((r=Le(sr,this).options)===null||r===void 0?void 0:r.cellAttributes)&&(s=Le(sr,this).options.cellAttributes.map(a=>a[0])),Array.isArray((i=Le(sr,this).options)===null||i===void 0?void 0:i.headerAttributes)&&(s=[...s,...Le(sr,this).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=o.length;a<l;a++)ye(o[a],n),eu(o[a],s)}),t.clear()}class c6 extends dh{constructor(e,n,r,i){super(e,n,ja,r,i)}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new pR(...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),Ay(r,`${o}px`,"0px")):(o=this.getScrollPosition(),kf(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,Sx(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-=bn(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=tn(this.clone.wtTable.TABLE);s.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=CR(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&&!Se(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=bn(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,tY(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(Rx(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?ye(r,"emptyRows"):Z(r,"emptyRows");let l=!1;if(!a){if(o&&!i.length)Z(r,"innerBorderLeft innerBorderInlineStart");else if(!o&&i.length){const u=Se(r,"innerBorderInlineStart");e?(Z(r,"innerBorderLeft innerBorderInlineStart"),l=!u):(ye(r,"innerBorderLeft innerBorderInlineStart"),l=u)}}return l}}const h6="stickyRowsTop",RR={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}};Lo(RR,"MIXIN_NAME",h6,{writable:!1,enumerable:!1});class ER extends vu{constructor(e,n,r,i){super(e,n,r,i,Ua)}}ft(ER,RR),ft(ER,hg);function s1(t,e,n){return(e=d6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d6(t){var e=f6(t,"string");return typeof e=="symbol"?e:e+""}function f6(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 g6 extends dh{constructor(e,n,r,i,o,s){super(e,n,Ua,r,i),s1(this,"topOverlay",void 0),s1(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 ER(...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();Ay(e,`${i}px`,`${o}px`)}else kf(e);let n=cn(this.clone.wtTable.TABLE);const r=tn(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),e.style.height=`${n}px`,e.style.width=`${r}px`,!1}}class TR extends vu{constructor(e,n,r,i){super(e,n,r,i,Ba)}}ft(TR,RR),ft(TR,fg);function m6(t,e,n){return(e=p6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p6(t){var e=w6(t,"string");return typeof e=="symbol"?e:e+""}function w6(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 v6 extends dh{constructor(e,n,r,i){super(e,n,Ba,r,i),m6(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 TR(...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(),Ay(e,"0px",`${i}px`)}else i=this.getScrollPosition(),kf(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-=bn(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=cn(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=CR(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&&!Se(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=bn(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,eY(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 Oy(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?ye(i,"emptyColumns"):Z(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=Se(i,"innerBorderTop");this.cachedFixedRowsTop=r.getSetting("fixedRowsTop"),e||r.getSetting("totalRows")===0?(Z(i,"innerBorderTop"),a=!h):(ye(i,"innerBorderTop"),a=h)}}return a}}function mg(t,e,n){C6(t,e),e.set(t,n)}function C6(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yo(t,e,n){return(e=y6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y6(t){var e=b6(t,"string");return typeof e=="symbol"?e:e+""}function b6(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 Ya(t,e,n){return t.set(a1(t,e),n),n}function Go(t,e){return t.get(a1(t,e))}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 yu=new WeakMap,pg=new WeakMap,bu=new WeakMap,wg=new WeakMap;class S6{constructor(e,n,r,i,o,s){Yo(this,"wot",null),mg(this,yu,[]),Yo(this,"topOverlay",null),Yo(this,"bottomOverlay",null),Yo(this,"inlineStartOverlay",null),Yo(this,"topInlineStartCornerOverlay",null),Yo(this,"bottomInlineStartCornerOverlay",null),Yo(this,"browserLineHeight",void 0),Yo(this,"wtSettings",null),mg(this,pg,!1),mg(this,bu,0),mg(this,wg,null),Yo(this,"resizeObserver",new ResizeObserver(c=>{$f(()=>{!Array.isArray(c)||!c.length||(Ya(bu,this,Go(bu,this)+1),Go(bu,this)===100&&(rt("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()),Go(wg,this)!==null&&clearTimeout(Go(wg,this)),Ya(wg,this,setTimeout(()=>{Ya(bu,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=bn(a);const u=l.getComputedStyle(s.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden";this.scrollableElement=u?s.holder:Hf(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=[...Go(yu,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 v6(...e),this.bottomOverlay=new XX(...e),this.inlineStartOverlay=new c6(...e),this.topInlineStartCornerOverlay=new g6(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new zX(...e,this.bottomOverlay,this.inlineStartOverlay),Ya(yu,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){Ya(pg,this,Go(yu,this).reduce((e,n)=>n.hasRenderingStateChanged()||e,!1)),Go(yu,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),Go(yu,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||!Nx())&&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",()=>{$f(()=>{clearTimeout(c),this.wtSettings.getSetting("onWindowResize"),c=setTimeout(()=>{Ya(bu,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=Zc(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(!Go(pg,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),Ya(pg,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=Hf(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),S=f()?1:0,b=m()?1:0;d.width=`${c+b}px`,d.height=`${u+S}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 D(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];D(n,r=>{r&&(r.clone.wtTable.TABLE.className=e.className)})}}function l1(t,e,n){return(e=R6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R6(t){var e=E6(t,"string");return typeof e=="symbol"?e:e+""}function E6(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 T6{constructor(e){l1(this,"settings",{}),l1(this,"defaults",Object.freeze(this.getDefaults())),ke(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);Ia(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?ke(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 _R extends vu{constructor(e,n,r,i){super(e,n,r,i,"master")}alignOverlaysWithTrimmingContainer(){const e=qc(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=Nf(e,"height",n),o=Nf(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=nu(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}}}ft(_R,mR),ft(_R,fg);class _6{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 i3:new c3],["fullyVisible",()=>new qK],["partiallyVisible",()=>new yH]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new t3:new a3],["fullyVisible",()=>new zK],["partiallyVisible",()=>new CH]]),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=cn(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 Nn(this.wtTable.holder)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=cn(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+=tn(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=bn(this.domBindings.rootDocument),new v3({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-=bn(this.domBindings.rootDocument)),new m3({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(){ke(this.hasOversizedColumnHeadersMarked,(e,n,r)=>{r[n]=void 0})}}function M6(t,e){u1(t,e),e.add(t)}function Ga(t,e,n){u1(t,e),e.set(t,n)}function u1(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _t(t,e){return t.get(_i(t,e))}function Ti(t,e,n){return t.set(_i(t,e),n),n}function _i(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 c1=23;var ro=new WeakMap,qo=new WeakMap,MR=new WeakMap,IR=new WeakMap,As=new WeakMap,ph=new WeakMap,wh=new WeakMap,io=new WeakSet;class I6{constructor(e){M6(this,io),Ga(this,ro,void 0),Ga(this,qo,void 0),Ga(this,MR,void 0),Ga(this,IR,void 0),Ga(this,As,!0),Ga(this,ph,{}),Ga(this,wh,{}),Ti(qo,this,e.rootTable.parentElement.parentElement),Ti(IR,this,e.rootDocument)}isClassicTheme(){return _t(As,this)}getCSSVariableValue(e){var n;if(_t(As,this))return null;if(_t(ph,this)[`--ht-${e}`])return _t(ph,this)[`--ht-${e}`];const r=(n=_i(io,this,A6).call(this,`--ht-${e}`))!==null&&n!==void 0?n:_i(io,this,d1).call(this,`--ht-${e}`);if(r!==null)return _t(ph,this)[`--ht-${e}`]=r,r}getStyleForTD(e){var n;return(n=_t(wh,this))===null||n===void 0?void 0:n.td[e]}getDefaultRowHeight(){if(_t(As,this))return c1;const e=_i(io,this,P6).call(this);return!e&&Se(_t(qo,this),"ht-wrapper")?(rt(`The "${_t(ro,this)}" theme is enabled, but its stylesheets are missing or not imported correctly. Import the correct CSS files in order to use that theme.`),Ti(As,this,!0),this.useTheme(),c1):e}areCellsBorderBox(){return this.getStyleForTD("box-sizing")==="border-box"}useTheme(e){if(!e){_i(io,this,h1).call(this),Ti(As,this,!0),Ti(ro,this,e||void 0);return}e&&e!==_t(ro,this)&&(_t(ro,this)&&_i(io,this,H6).call(this),Ti(ro,this,e),Ti(As,this,!1),_i(io,this,O6).call(this),_i(io,this,h1).call(this))}getThemeName(){return _t(ro,this)}removeClassNames(){Se(_t(qo,this),_t(ro,this))&&ye(_t(qo,this),_t(ro,this))}}function P6(){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 O6(){ye(_t(qo,this),/ht-theme-.*/g),Z(_t(qo,this),_t(ro,this))}function h1(){this.isClassicTheme()||Ti(MR,this,getComputedStyle(_t(qo,this)));const t=_i(io,this,x6).call(this,["box-sizing","border-bottom-width"]);_t(wh,this).td={..._t(wh,this).td,"box-sizing":t["box-sizing"],"border-bottom-width":t["border-bottom-width"]}}function x6(t){const e=_t(IR,this),n=_t(qo,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 A6(t){const e=Math.ceil(parseFloat(_i(io,this,d1).call(this,t)));return Number.isNaN(e)?null:e}function d1(t){const e=_t(MR,this).getPropertyValue(t);return e===""?null:e}function H6(){Ti(wh,this,{}),Ti(ph,this,{}),Ti(As,this,!0)}class N6 extends fR{constructor(e,n){super(e,new T6(n)),this.stylesHandler=new I6(this.domBindings);const r=this.wtSettings.getSetting("facade",this);this.wtTable=new _R(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=new _6(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new l6(this.wtSettings.getSetting("selections")),this.wtEvent=new OH(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new S6(this,r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},n=[],r=[];ke(e,(i,o)=>{this.wtSettings.getSetting(o).length&&r.push(i),n.push(i)}),ye(this.wtTable.wtRootElement.parentNode,n),Z(this.wtTable.wtRootElement.parentNode,r)}getOverlayByName(e){var n;if(!UH.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 fR?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=n=>{const r=new PR(n);return()=>r},this._wot=new N6(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 f1={},g1={},m1;function D6(){if(m1)return g1;m1=1;var t=Ct(),e=Vl(),n=nr(),r=sn(),i=Bi();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}}),g1}var p1;function k6(){return p1||(p1=1,D6()),f1}k6();function w1(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=$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 qa{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;w1(this,"indexedValues",[]),w1(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,at(this.initValueOrFn)?me(e-1,n=>this.indexedValues.push(this.initValueOrFn(n))):me(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}}ft(qa,On);function OR(t,e,n,r){const i=n.length?n[0]:void 0;return[...t.slice(0,i),...n.map((o,s)=>at(r)?r(o,s):r),...i===void 0?[]:t.slice(i)]}function xR(t,e){return ba(t,(n,r)=>e.includes(r)===!1)}class Hs extends qa{insert(e,n){this.indexedValues=OR(this.indexedValues,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){this.indexedValues=xR(this.indexedValues,e),super.remove(e)}}class vg extends Hs{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return ir(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}function AR(t,e,n){return[...t.slice(0,e),...n,...t.slice(e)]}function vh(t,e){return ba(t,n=>e.includes(n)===!1)}function HR(t,e){return ze(t,n=>n-e.filter(r=>r<n).length)}function NR(t,e){const n=e[0],r=e.length;return ze(t,i=>i>=n?i+r:i)}function F6(t,e,n){return(e=V6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V6(t){var e=W6(t,"string");return typeof e=="symbol"?e:e+""}function W6(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 Cg extends qa{constructor(){super(...arguments),F6(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=vh(this.orderOfIndexes,[e]),at(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=OR(this.indexedValues,e,n,this.initValueOrFn),this.orderOfIndexes=NR(this.orderOfIndexes,n),super.insert(e,n)}remove(e){this.indexedValues=xR(this.indexedValues,e),this.orderOfIndexes=vh(this.orderOfIndexes,e),this.orderOfIndexes=HR(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class Ch extends Hs{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return ir(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}const v1=new Map([["indexesSequence",{getListWithInsertedItems:AR,getListWithRemovedItems:vh}],["physicallyIndexed",{getListWithInsertedItems:OR,getListWithRemovedItems:xR}]]),C1=t=>{if(v1.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return v1.get(t)};class y1 extends qa{constructor(){super(e=>e)}insert(e,n){const r=NR(this.indexedValues,n);this.indexedValues=AR(r,e,n),super.insert(e,n)}remove(e){const n=vh(this.indexedValues,e);this.indexedValues=HR(n,e),super.remove(e)}}const b1=new Map([["hiding",vg],["index",qa],["linkedPhysicalIndexToValue",Cg],["physicalIndexToValue",Hs],["trimming",Ch]]);function B6(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!b1.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(b1.get(t))(e)}function j6(t,e,n){return(e=U6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function U6(t){var e=z6(t,"string");return typeof e=="symbol"?e:e+""}function z6(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 DR{constructor(){j6(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);fe(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)})}}ft(DR,On);function kR(t,e,n){return(e=Y6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Y6(t){var e=G6(t,"string");return typeof e=="symbol"?e:e+""}function G6(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 S1 extends DR{constructor(e,n){super(),kR(this,"mergedValuesCache",[]),kR(this,"aggregationFunction",void 0),kR(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=ze(this.get(),o=>o.getValues()),r=[],i=fe(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 ze(r,this.aggregationFunction)}getMergedValueAtIndex(e,n){const r=this.getMergedValues(n)[e];return fe(r)?r:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function q6(t,e,n){K6(t,e),e.set(t,n)}function K6(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function X6(t,e,n){return t.set(R1(t,e),n),n}function Z6(t,e){return t.get(R1(t,e))}function R1(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 LR=new WeakMap;class E1{constructor(){q6(this,LR,[])}subscribe(e){return this.addLocalHook("change",e),this._write(Z6(LR,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){X6(LR,this,e)}}ft(E1,On);function T1(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 yh(t,e,n){Q6(t,e),e.set(t,n)}function Q6(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ei(t,e){return t.get(_1(t,e))}function yg(t,e,n){return t.set(_1(t,e),n),n}function _1(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 bg=new WeakMap,bh=new WeakMap,Sg=new WeakMap,Rg=new WeakMap,Eg=new WeakMap;class J6{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yh(this,bg,new Set),yh(this,bh,[]),yh(this,Sg,[]),yh(this,Rg,!1),yh(this,Eg,!1),yg(Eg,this,e??!1)}createObserver(){const e=new E1;return ei(bg,this).add(e),e.addLocalHook("unsubscribe",()=>{ei(bg,this).delete(e)}),e._writeInitialChanges(T1(ei(bh,this),ei(Sg,this))),e}emit(e){let n=ei(Sg,this);(!ei(Rg,this)||ei(bh,this).length!==e.length)&&(e.length===0?e=new Array(n.length).fill(ei(Eg,this)):yg(bh,this,new Array(e.length).fill(ei(Eg,this))),ei(Rg,this)||(yg(Rg,this,!0),n=ei(bh,this)));const r=T1(n,e);ei(bg,this).forEach(i=>i._write(r)),yg(Sg,this,e)}}function Gn(t,e,n){return(e=e4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e4(t){var e=t4(t,"string");return typeof e=="symbol"?e:e+""}function t4(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 $R{constructor(){Gn(this,"indexesSequence",new y1),Gn(this,"trimmingMapsCollection",new S1(e=>e.some(n=>n===!0),!1)),Gn(this,"hidingMapsCollection",new S1(e=>e.some(n=>n===!0),!1)),Gn(this,"variousMapsCollection",new DR),Gn(this,"hidingChangesObservable",new J6({initialIndexValue:!1})),Gn(this,"notTrimmedIndexesCache",[]),Gn(this,"notHiddenIndexesCache",[]),Gn(this,"isBatched",!1),Gn(this,"indexesSequenceChanged",!1),Gn(this,"indexesChangeSource",void 0),Gn(this,"trimmedIndexesChanged",!1),Gn(this,"hiddenIndexesChanged",!1),Gn(this,"renderablePhysicalIndexesCache",[]),Gn(this,"fromPhysicalToVisualIndexesCache",new Map),Gn(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,B6(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 Ch?this.trimmingMapsCollection.register(e,n):n instanceof vg?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 fe(n)?n:null}getPhysicalFromRenderableIndex(e){const n=this.renderablePhysicalIndexesCache[e];return fe(n)?n:null}getVisualFromPhysicalIndex(e){const n=this.fromPhysicalToVisualIndexesCache.get(e);return fe(n)?n:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const n=this.fromVisualToRenderableIndexesCache.get(e);return fe(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=ze(e,u=>this.getPhysicalFromVisualIndex(u)),i=this.getNotTrimmedIndexesLength(),o=e.length,s=vh(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(AR(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=fe(r)?r:this.getNumberOfIndexes(),o=this.getIndexesSequence().includes(r)?this.getIndexesSequence().indexOf(r):this.getNumberOfIndexes(),s=ze(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)}}}ft($R,On);function n4(t,e){M1(t,e),e.add(t)}function FR(t,e,n){M1(t,e),e.set(t,n)}function M1(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=r4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r4(t){var e=i4(t,"string");return typeof e=="symbol"?e:e+""}function i4(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 Ns(t,e){return t.get(ar(t,e))}function Tg(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")}oe.getSingleton().register("modifyAutoColumnSizeSeed");const VR="autoColumnSize",o4=10,s4="autoColumnSize";var WR=new WeakMap,Su=new WeakMap,Ru=new WeakMap,Pr=new WeakSet;class Rh extends Qe{static get PLUGIN_KEY(){return VR}static get PLUGIN_PRIORITY(){return o4}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),n4(this,Pr),Sh(this,"ghostTable",new gH(this.hot)),Sh(this,"samplesGenerator",new lg((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}})),Sh(this,"inProgress",!1),Sh(this,"measuredColumns",0),Sh(this,"columnWidthsMap",new Hs),FR(this,WR,!1),FR(this,Su,[]),FR(this,Ru,[]),this.hot.columnIndexMapper.registerMap(s4,this.columnWidthsMap),this.addHook("beforeColumnResize",(n,r,i)=>ar(Pr,this,O1).call(this,n,r,i))}isEnabled(){return this.hot.getSettings()[VR]!==!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 ar(Pr,e,u4).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 ar(Pr,e,c4).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 ar(Pr,e,d4).call(e,...i)}),this.addHook("beforeRender",()=>ar(Pr,this,l4).call(this)),this.addHook("modifyColWidth",(r,i)=>this.getColumnWidth(i,r)),this.addHook("init",()=>ar(Pr,this,h4).call(this)),super.enablePlugin()}updatePlugin(){Tg(Ru,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,n,r)=>ar(Pr,this,O1).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;me(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))&&ar(Pr,this,I1).call(this,s,o)}),this.ghostTable.columns.length&&(ar(Pr,this,P1).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){Ff(o),this.inProgress=!1;return}this.calculateColumnsWidth({from:r,to:Math.min(r+Rh.CALCULATION_STEP,i)},e,n),r=r+Rh.CALCULATION_STEP+1,r<i?o=$f(s):(Ff(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()[VR];let n=Rh.SYNC_CALCULATION_LIMIT;const r=this.hot.countCols()-1;return De(e)&&(n=e.syncLimit,lx(n)?n=zx(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,fu))),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=Ns(Su,this).length;return(s-1<o||Ns(Su,this)[o]!==i)&&r.push(this.hot.toVisualColumn(o)),s-1<o?Ns(Su,this).push(i):Ns(Su,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 a4(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)||ar(Pr,this,I1).call(this,n,e))}),this.ghostTable.columns.length&&(ar(Pr,this,P1).call(this),this.ghostTable.clean())}function I1(t,e){this.samplesGenerator.generateColumnSamples(t,e).forEach((r,i)=>this.ghostTable.addColumn(i,r))}function P1(){this.hot.batchExecution(()=>{this.ghostTable.getWidths((t,e)=>{const n=this.hot.toPhysicalColumn(t);this.columnWidthsMap.setValueAtIndex(n,e)})},!0)}function l4(){this.calculateVisibleColumnsWidth(),this.inProgress||(ar(Pr,this,a4).call(this,Ns(Ru,this)),Tg(Ru,this,[]))}function u4(t,e){e||this.recalculateAllColumnsWidth()}function c4(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},[]);Ns(Ru,this).push(...e)}function O1(t,e,n){let r=t;return n&&(this.calculateColumnsWidth(e,void 0,!0),r=this.getColumnWidth(e,void 0,!1)),r}function h4(){Tg(Su,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth(),Tg(WR,this,!0)}function d4(t){if(!Ns(WR,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},[]);Ns(Ru,this).push(...e)}const Ka={horizontal:"horizontal",vertical:"vertical"};function f4(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 g4(t){const e={};return t===!0?(e.directions=Object.keys(Ka),e.autoInsertRow=!0):De(t)?(fe(t.autoInsertRow)?t.direction===Ka.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,fe(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(Ka)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function m4(t,e){p4(t,e),e.add(t)}function p4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Eu(t,e,n){return(e=w4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w4(t){var e=v4(t,"string");return typeof e=="symbol"?e:e+""}function v4(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 Eh(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")}oe.getSingleton().register("modifyAutofillRange"),oe.getSingleton().register("beforeAutofill"),oe.getSingleton().register("afterAutofill");const x1="autofill",C4=20,y4=["fillHandle"],b4="insert_row_below",S4=200;var Tu=new WeakSet;class R4 extends Qe{constructor(){super(...arguments),m4(this,Tu),Eu(this,"addingStarted",!1),Eu(this,"mouseDownOnCellCorner",!1),Eu(this,"mouseDragOutside",!1),Eu(this,"handleDraggedCells",0),Eu(this,"directions",[]),Eu(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return x1}static get PLUGIN_PRIORITY(){return C4}static get SETTING_KEYS(){return[x1,...y4]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>Eh(Tu,this,T4).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>Eh(Tu,this,E4).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,n)=>Eh(Tu,this,_4).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 D(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)}),D(a,c=>{const h=[];D(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}=f4(l,u,(f,m)=>this.hot._createCellCoords(f,m));if(h&&h.row>-1&&h.col>-1){const f=this.getSelectionData(),m=o.clone(),S=this.hot._createCellRange(h,h,d),b=this.hot.runHooks("beforeAutofill",f,m,S,c);if(b===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let T=b;const v=b;if(["up","left"].indexOf(c)>-1&&!(v.length===1&&v[0].length===0))if(T=[],c==="up"){const O=d.row-h.row+1,P=O%v.length;for(let _=0;_<O;_++)T.push(v[(_+(v.length-P))%v.length])}else{const O=d.col-h.col+1,P=O%v[0].length;for(let _=0;_<v.length;_++){T.push([]);for(let M=0;M<O;M++)T[_].push(v[_][(M+(v[_].length-P))%v[_].length])}}this.hot.populateFromArray(h.row,h.col,T,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(u),this.hot.runHooks("afterAutofill",T,m,S,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(Ka.vertical)&&this.directions.includes(Ka.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(Ka.vertical))i=this.hot._createCellCoords(e.row,r.col);else if(this.directions.includes(Ka.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(b4,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},S4)}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(!jt(u))return-1}const s=n[o][e[1]-1],a=n[o][e[3]+1];(!jt(s)||!jt(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(...ze(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=Nn(this.hot.table).top-(this.hot.rootWindow.pageYOffset||n.scrollTop)+cn(this.hot.table),i=Nn(this.hot.table).left-(this.hot.rootWindow.pageXOffset||n.scrollLeft)+tn(this.hot.table);return e.clientY>r&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>Eh(Tu,this,M4).call(this)),this.eventManager.addEventListener(e,"mousemove",n=>Eh(Tu,this,I4).call(this,n))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=g4(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function E4(){this.selectAdjacent()&&this.fillIn()}function T4(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function _4(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function M4(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function I4(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 P4(t,e){H1(t,e),e.add(t)}function A1(t,e,n){H1(t,e),e.set(t,n)}function H1(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(e=O4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O4(t){var e=x4(t,"string");return typeof e=="symbol"?e:e+""}function x4(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 N1(t,e,n){return t.set(oo(t,e),n),n}function _g(t,e){return t.get(oo(t,e))}function oo(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 BR="autoRowSize",A4=40,H4="autoRowSize";var Th=new WeakMap,jR=new WeakMap,Ko=new WeakSet;class _h extends Qe{static get PLUGIN_KEY(){return BR}static get PLUGIN_PRIORITY(){return A4}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),P4(this,Ko),_u(this,"headerHeight",null),_u(this,"ghostTable",new gH(this.hot)),_u(this,"samplesGenerator",new lg((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}})),_u(this,"inProgress",!1),_u(this,"measuredRows",0),_u(this,"rowHeightsMap",new Hs),A1(this,Th,[]),A1(this,jR,!1),this.hot.rowIndexMapper.registerMap(H4,this.rowHeightsMap),this.addHook("beforeRowResize",(n,r,i)=>oo(Ko,this,D1).call(this,n,r,i))}isEnabled(){const e=this.hot.getSettings()[BR];return e===!0||De(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 oo(Ko,e,k4).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 oo(Ko,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 oo(Ko,e,F4).call(e,...i)}),this.addHook("beforeRender",()=>oo(Ko,this,D4).call(this)),this.addHook("modifyRowHeight",(r,i)=>this.getRowHeight(i,r)),this.addHook("init",()=>oo(Ko,this,$4).call(this)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin()}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,n,r)=>oo(Ko,this,D1).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))}me(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){Ff(o),this.inProgress=!1;return}this.calculateRowsHeight({from:r,to:Math.min(r+_h.CALCULATION_STEP,i)},e,n),r=r+_h.CALCULATION_STEP+1,r<i?o=$f(s):(Ff(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()[BR];let n=_h.SYNC_CALCULATION_LIMIT;const r=this.hot.countRows()-1;return De(e)&&(n=e.syncLimit,lx(n)?n=zx(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(()=>{me(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 N4(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 D4(){this.calculateVisibleRowsHeight(),this.inProgress||(oo(Ko,this,N4).call(this,_g(Th,this)),N1(Th,this,[]))}function D1(t,e,n){let r=t;return n&&(this.calculateRowsHeight(e,void 0,!0),r=this.getRowHeight(e)),r}function k4(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},[]);_g(Th,this).push(...e)}function $4(){this.recalculateAllRowsHeight(),N1(jR,this,!0)}function F4(t){if(!_g(jR,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},[]);_g(Th,this).push(...e)}const{getListWithInsertedItems:V4,getListWithRemovedItems:W4}=C1("physicallyIndexed");class B4 extends qa{constructor(){super(e=>e)}insert(e,n){const r=NR(this.indexedValues,n);this.indexedValues=V4(r,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){const n=W4(this.indexedValues,e);this.indexedValues=HR(n,e),super.remove(e)}}const{getListWithInsertedItems:j4,getListWithRemovedItems:U4}=C1("physicallyIndexed");class z4 extends qa{constructor(){super(e=>e)}insert(e,n){this.indexedValues=j4(this.indexedValues,e,n,(r,i)=>this.getNextValue(i)),super.insert(e,n)}remove(e){this.indexedValues=U4(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}function Y4(t,e){G4(t,e),e.add(t)}function G4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function q4(t,e,n){return(e=K4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function K4(t){var e=X4(t,"string");return typeof e=="symbol"?e:e+""}function X4(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 Z4(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 k1="bindRowsWithHeaders",Q4=210,J4="loose",L1=new Map([["loose",B4],["strict",z4]]);var $1=new WeakSet;class e9 extends Qe{constructor(){super(...arguments),Y4(this,$1),q4(this,"headerIndexes",null)}static get PLUGIN_KEY(){return k1}static get PLUGIN_PRIORITY(){return Q4}isEnabled(){return!!this.hot.getSettings()[k1]}enablePlugin(){var e;if(this.enabled)return;const n=(e=L1.get(this.getSetting()))!==null&&e!==void 0?e:L1.get(J4);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new n),this.addHook("modifyRowHeader",r=>Z4($1,this,t9).call(this,r)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function t9(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function n9(t,e){F1(t,e),e.add(t)}function r9(t,e,n){F1(t,e),e.set(t,n)}function F1(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function V1(t,e,n){return(e=i9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i9(t){var e=o9(t,"string");return typeof e=="symbol"?e:e+""}function o9(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 W1(t,e){return t.get(Mu(t,e))}function UR(t,e,n){return t.set(Mu(t,e),n),n}function Mu(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 Mg="collapsibleColumns",s9=290,a9=["nestedHeaders"],Iu="collapsibleIndicator",B1=Mg,j1=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var Pu=new WeakMap,Mh=new WeakSet;class l9 extends Qe{constructor(){super(...arguments),n9(this,Mh),V1(this,"nestedHeadersPlugin",null),V1(this,"headerStateManager",null),r9(this,Pu,null)}static get PLUGIN_KEY(){return Mg}static get PLUGIN_PRIORITY(){return s9}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[Mg,...a9]}isEnabled(){return!!this.hot.getSettings()[Mg]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();n||rt("You need to configure the Nested Headers plugin in order to use collapsible headers."),UR(Pu,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>Mu(Mh,this,h9).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 Mu(Mh,e,d9).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 Mu(Mh,e,u9).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(r,i,o)=>Mu(Mh,this,c9).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),UR(Pu,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:B1,relativeToGroup:Is,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(B1)}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)};me(0,e-1,s=>{const a=n.childNodes[s],l=r.childNodes[s],u=i?i.childNodes[s]:null;me(0,a.childNodes.length-1,c=>{let h=a.childNodes[c].querySelector(`.${Iu}`);o(h),l&&l.childNodes[c]&&(h=l.childNodes[c].querySelector(`.${Iu}`),o(h)),i&&u&&u.childNodes[c]&&(h=u.childNodes[c].querySelector(`.${Iu}`),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(!j1.has(n))throw new Error(`Unsupported action is passed (${n}).`);if(!Array.isArray(e))return;const r=ba(e,f=>{let{row:m}=f;return m<0});let i=r.length>0;D(r,f=>{var m;let{row:S,col:b}=f;const{collapsible:T,isCollapsed:v}=(m=this.headerStateManager.getHeaderSettings(S,b))!==null&&m!==void 0?m:{};if(!T||v&&n==="collapse"||!v&&n==="expand")return i=!1,!1});const o=[],s=[];i&&D(r,f=>{let{row:m,col:S}=f;const{colspanCompensation:b,affectedColumns:T,rollbackModification:v}=this.headerStateManager.triggerNodeModification(n,m,S);b>0&&(s.push(...T),o.push(v))});const a=this.getCollapsedColumns();let l=[];n==="collapse"?l=HU([...a,...s]):n==="expand"&&(l=ba(a,f=>!s.includes(f)));const u=j1.get(n);if(this.hot.runHooks(u.beforeHook,a,l,i)===!1){D(o,f=>{f()});return}this.hot.batchExecution(()=>{D(s,f=>{W1(Pu,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 b=f>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(f,1,!0):f,T=m>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(m,1,!0):m;b!==null&&T!==null&&this.hot.selectCell(b,T)}}this.hot.runHooks(u.afterHook,a,l,i,h),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return W1(Pu,this).getHiddenIndexes()}destroy(){UR(Pu,this,null),super.destroy()}}function u9(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(`.${Iu}`);if(eu(e,[Yr("")[0]]),a)u||(u=this.hot.rootDocument.createElement("div"),Z(u,Iu),e.querySelector("div:first-child").appendChild(u)),ye(u,["collapsed","expanded"]),s?(Z(u,"collapsed"),Ia(u,"+"),l&&Re(e,...Yr(!1))):(Z(u,"expanded"),Ia(u,"-"),l&&Re(e,...Yr(!0))),l&&Re(u,...Ea());else{var c;(c=u)===null||c===void 0||c.remove()}}function c9(t,e){Se(t.target,Iu)&&(Se(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):Se(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),wi(t))}function h9(){this.updatePlugin()}function d9(t,e){e||this.updatePlugin()}function Xa(t,e,n){return(e=f9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f9(t){var e=g9(t,"string");return typeof e=="symbol"?e:e+""}function g9(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 m9=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],p9=!1,w9=!0,v9=!0;class C9{constructor(e,n){Xa(this,"hot",void 0),Xa(this,"sortingStates",new Cg),Xa(this,"sortEmptyCells",p9),Xa(this,"indicator",w9),Xa(this,"headerAction",v9),Xa(this,"compareFunctionFactory",void 0),Xa(this,"mapName",void 0),this.hot=e,this.mapName=n,this.hot.columnIndexMapper.registerMap(n,this.sortingStates)}updateAllColumnsProperties(e){De(e)&&ke(e,(n,r)=>{m9.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 De(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(fe(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 U1(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?so:jt(i)?jt(o)?so:s&&t==="asc"?Dt:kt:jt(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:so}}const z1="default";function y9(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 so;if(a){if(jt(r))return t==="asc"?Dt:kt;if(jt(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:so}}const b9="numeric";function S9(t,e,n){const r=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:o}=n;return function(s,a){const l=jt(s),u=jt(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?U1(t,e,n)(s,a):c===i&&h===r?t==="asc"?Dt:kt:c===r&&h===i?t==="asc"?kt:Dt:so}}const R9="checkbox";function E9(t,e,n){return J1(t,e.dateFormat,n)}const T9="date";function _9(t,e,n){return J1(t,e.timeFormat,n)}const M9="time",{register:Ih,getItem:Y1,hasItem:I9}=Ci("sorting.compareFunctionFactory"),{register:G1,getItem:P9}=Ci("sorting.mainSortComparator");function q1(t){return I9(t)?Y1(t):Y1(z1)}Ih(R9,S9),Ih(T9,E9),Ih(z1,U1),Ih(b9,y9),Ih(M9,_9);const so=0,Dt=-1,kt=1;function O9(t,e){const n=P9(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 Ig="asc",Pg="desc",K1="colHeader";function x9(t){if(De(t)===!1)return!1;const{column:e,sortOrder:n}=t;return Number.isInteger(e)&&[Ig,Pg].includes(n)}function A9(t){if(t.some(n=>x9(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!==Pg)return t===Ig?Pg:Ig}function Z1(t){return t.querySelector(`.${K1}`)}function Q1(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 zR(t,e,n){return t===-1&&e>=0&&Oa(n)===!1}function J1(t,e,n){return function(r,i){const{sortEmptyCells:o}=n;if(r===i)return so;if(jt(r))return jt(i)?so:o&&t==="asc"?Dt:kt;if(jt(i))return o&&t==="asc"?kt:Dt;const s=Q(r,e),a=Q(i,e);return s.isValid()?a.isValid()?a.isAfter(s)?t==="asc"?Dt:kt:a.isBefore(s)?t==="asc"?kt:Dt:so:Dt:kt}}function H9(t,e){rt(it`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20
|
|
43
|
-
Only \`${t}\` will work. The \`${e}\` plugin will remain disabled.`)}const N9="ascending",D9="descending",eN="indicatorDisabled",tN="columnSorting",nN="sortAction",rN=new Map([[Ig,N9],[Pg,D9]]);function k9(t,e,n,r){const i=[tN];if(r&&i.push(nN),n===!1)return i.push(eN),i;const o=t.getSortOrderOfColumn(e);return fe(o)&&i.push(rN.get(o)),i}function L9(){return Array.from(rN.values()).concat(nN,eN,tN)}function $9(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:q1(u.type))(l,u,d)(c,h)})(0)}}function F9(t,e){V9(t,e),e.add(t)}function V9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Og(t,e,n){return(e=W9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function W9(t){var e=B9(t,"string");return typeof e=="symbol"?e:e+""}function B9(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 Ou(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 xg="columnSorting",j9=50,Ag="append",U9="replace",iN=xg;G1(xg,$9),oe.getSingleton().register("beforeColumnSort"),oe.getSingleton().register("afterColumnSort");const Ph=new WeakMap;var Za=new WeakSet;class oN extends Qe{constructor(){super(...arguments),F9(this,Za),Og(this,"columnStatesManager",null),Og(this,"columnMetaCache",null),Og(this,"pluginKey",xg),Og(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return xg}static get PLUGIN_PRIORITY(){return j9}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;if(Ph.has(this.hot)&&Ph.get(this.hot)!==this.pluginKey){this.hot.updateSettings({[this.pluginKey]:!1}),H9(Ph.get(this.hot),this.pluginKey);return}this.enabled||(Ph.set(this.hot,this.pluginKey),this.columnStatesManager=new C9(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new Hs(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)=>Ou(Za,this,z9).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 Ou(Za,e,G9).call(e,...r)}),this.addHook("afterOnCellMouseDown",(n,r)=>this.onAfterOnCellMouseDown(n,r)),this.addHook("afterInit",()=>Ou(Za,this,YR).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 Ou(Za,e,Y9).call(e,...r)}),this.hot.view&&Ou(Za,this,YR).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(n,r)=>{const i=Z1(r);Q1(n,r)===!1||i===null||this.updateHeaderClasses(i)};Ph.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:Is,position:"before",group:iN})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(iN)}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 y1),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 fe(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 A9(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=ze(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 fe(n)&&Array.isArray(n.initialConfig)&&(n.initialConfig=ze(n.initialConfig,r)),n}getColumnNextConfig(e){const n=this.columnStatesManager.getSortOrderOfColumn(e);if(fe(n)){const i=X1(n);return fe(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]:Ag;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===Ag)return[...o.slice(0,r),...o.slice(r+1),s];if(n===U9)return[...o.slice(0,r),s,...o.slice(r+1)]}return fe(s)?o.concat(s):o}getPluginColumnConfig(e){if(De(e)){const n=e[this.pluginKey];if(De(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])):at(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=>ze(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=ze(n,u=>u[0]);O9(n,this.pluginKey,ze(e,u=>u.sortOrder),ze(e,u=>this.getFirstCellSettings(u.column)));for(let u=n.length;u<r;u+=1)n.push([u].concat(i(u)));const s=ze(n,u=>u[0]),a=new Map(ze(o,(u,c)=>[u,s[c]])),l=ze(this.hot.rowIndexMapper.getIndexesSequence(),u=>a.has(u)?a.get(u):u);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if(De(e)){this.columnStatesManager.updateAllColumnsProperties(e);const n=e.initialConfig;(Array.isArray(n)||De(n))&&this.sort(n)}else this.hot.render()}updateHeaderClasses(e){if(ye(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];Z(e,k9(...r))}}onUpdateSettings(e){super.onUpdateSettings(e),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),fe(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,n){return this.getFirstCellSettings(n)[this.pluginKey].headerAction&&Se(e.target,K1)}onAfterOnCellMouseDown(e,n){if(zR(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 YR(){const t=this.getAllSavedSortSettings();if(De(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function z9(t,e){const n=Z1(e);if(Q1(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);Re(e,...Vz(s?`${s}ending`:"none"))}}function Y9(t){t===!0&&this.hot.view&&Ou(Za,this,YR).call(this)}function G9(t,e,n,r){zR(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(r.column=!0)}function Qa(t,e,n){return(e=q9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function q9(t){var e=K9(t,"string");return typeof e=="symbol"?e:e+""}function K9(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 X9{constructor(e,n){Qa(this,"plugin",void 0),Qa(this,"hot",void 0),Qa(this,"endpoints",[]),Qa(this,"settings",void 0),Qa(this,"settingsType","array"),Qa(this,"currentEndpoint",null),Qa(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),D(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(`
|
|
44
|
-
You must provide a destination row for the Column Summary plugin in order to work properly!
|
|
45
|
-
`)),this.assignSetting(i,o,"destinationColumn",new Error(`
|
|
46
|
-
You must provide a destination column for the Column Summary plugin in order to work properly!
|
|
47
|
-
`)),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();D(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;D(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?D(u,d=>{this.extendEndpointRanges(d,h,i[0],i.length),this.recreatePhysicalRanges(d),this.clearOffsetInformation(d)}):D(u,d=>{this.shiftEndpointCoordinates(d,h)}),s&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,n,r,i){D(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=[];D(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)}),D(i,o=>{let s=[];D(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,D(e.ranges,r=>{D(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=[],D(e,i=>{this.resetEndpointValue(i,n)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],D(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=[],D(e,(r,i,o)=>{`${r[2]||""}`!=`${r[3]}`&&D(this.getAllEndpoints(),(s,a)=>{this.hot.propToCol(o[i][1])===s.sourceColumn&&n.indexOf(a)===-1&&n.push(a)})}),D(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(){rt("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function GR(t){return t==null||isNaN(t)}function Z9(t,e){Q9(t,e),e.add(t)}function Q9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function J9(t,e,n){return(e=e8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e8(t){var e=t8(t,"string");return typeof e=="symbol"?e:e+""}function t8(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 Hg(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 qR="columnSummary",n8=220;var Oh=new WeakSet;class r8 extends Qe{constructor(){super(...arguments),Z9(this,Oh),J9(this,"endpoints",null)}static get PLUGIN_KEY(){return qR}static get PLUGIN_PRIORITY(){return n8}isEnabled(){return!!this.hot.getSettings()[qR]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[qR],this.endpoints=new X9(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 Hg(Oh,e,i8).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 Hg(Oh,e,s8).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 Hg(Oh,e,o8).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 Hg(Oh,e,a8).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 ke(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=GR(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 ke(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=GR(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=GR(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 ke(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(it`ColumnSummary plugin: cell at (${e}, ${n}) is not in a\x20
|
|
48
|
-
numeric format. Cannot do the calculation.`);return o}}function i8(){this.endpoints.initEndpoints()}function o8(t){t.columns!==void 0&&this.endpoints.refreshCellMetas()}function s8(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function a8(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 l8(t,e){sN(t,e),e.add(t)}function KR(t,e,n){sN(t,e),e.set(t,n)}function sN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xu(t,e){return t.get(ZR(t,e))}function XR(t,e,n){return t.set(ZR(t,e),n),n}function ZR(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 Ng=new WeakMap,Dg=new WeakMap,kg=new WeakMap,aN=new WeakSet;class lN{constructor(){l8(this,aN),KR(this,Ng,!0),KR(this,Dg,null),KR(this,kg,new ResizeObserver(e=>ZR(aN,this,u8).call(this,e)))}setObservedElement(e){XR(Dg,this,e)}unobserve(){xu(kg,this).unobserve(xu(Dg,this))}observe(){XR(Ng,this,!0),xu(kg,this).observe(xu(Dg,this))}destroy(){xu(kg,this).disconnect()}}function u8(t){if(xu(Ng,this)||!Array.isArray(t)||!t.length){XR(Ng,this,!1);return}t.forEach(e=>{let{borderBoxSize:n}=e;const{inlineSize:r,blockSize:i}=n[0];this.runLocalHooks("resize",r,i)})}ft(lN,On);function Ja(t,e,n){c8(t,e),e.set(t,n)}function c8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gt(t,e){return t.get(uN(t,e))}function Xo(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 el=new WeakMap,QR=new WeakMap,Zo=new WeakMap,Ds=new WeakMap,ks=new WeakMap,Lg=new WeakMap,Au=new WeakMap;class tl{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;Ja(this,el,void 0),Ja(this,QR,!1),Ja(this,Zo,null),Ja(this,Ds,void 0),Ja(this,ks,void 0),Ja(this,Lg,!0),Ja(this,Au,new lN),Xo(el,this,e),Xo(QR,this,n),Xo(Ds,this,this.createEditor()),Xo(ks,this,gt(Ds,this).style),gt(Au,this).setObservedElement(this.getInputElement()),gt(Au,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){gt(ks,this).left=`${e}px`,gt(ks,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:tn(this.getInputElement()),height:cn(this.getInputElement())}}observeSize(){gt(Au,this).observe()}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const n=this.getInputElement();n.readOnly=e}show(){gt(ks,this).display="block",Xo(Lg,this,!1)}hide(){gt(Au,this).unobserve(),gt(Lg,this)||(gt(ks,this).display="none"),Xo(Lg,this,!0)}isVisible(){return gt(ks,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 gt(el,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=gt(el,this).createElement("div"),n=gt(el,this).createElement("textarea");return e.style.display="none",Xo(Zo,this,gt(el,this).createElement("div")),gt(Zo,this).setAttribute("dir",gt(QR,this)?"rtl":"ltr"),Z(gt(Zo,this),tl.CLASS_EDITOR_CONTAINER),gt(el,this).body.appendChild(gt(Zo,this)),Z(e,tl.CLASS_EDITOR),Z(n,tl.CLASS_INPUT),n.setAttribute("data-hot-input",!0),e.appendChild(n),gt(Zo,this).appendChild(e),e}getInputElement(){return gt(Ds,this).querySelector(`.${tl.CLASS_INPUT}`)}getEditorElement(){return gt(Ds,this)}destroy(){const e=gt(Zo,this)?gt(Zo,this).parentNode:null;gt(Ds,this).parentNode.removeChild(gt(Ds,this)),Xo(Ds,this,null),Xo(ks,this,null),gt(Au,this).destroy(),e&&e.removeChild(gt(Zo,this))}}ft(tl,On);function JR(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=d8(t,"string");return typeof e=="symbol"?e:e+""}function d8(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 f8=250,g8=250;class cN{constructor(e){JR(this,"wasLastActionShow",!0),JR(this,"showDebounced",null),JR(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},g8)}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]:f8;this.showDebounced=jf(n=>{this.wasLastActionShow&&this.runLocalHooks("show",n.from.row,n.from.col)},e)}destroy(){this.clearLocalHooks()}}ft(cN,On);function m8(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function p8(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function nl(t,e){const n={};return D(t,r=>{r.forAll((i,o)=>{i>=0&&o>=0&&(n[i]||(n[i]=[]),n[i][o]=e(i,o))})}),n}function Ls(t,e,n,r,i){D(t,o=>{o.forAll((s,a)=>{s>=0&&a>=0&&w8(s,a,e,n,r,i)})})}function w8(t,e,n,r,i,o){const s=i(t,e);let a=r;s.className&&(n==="vertical"?a=m8(s.className,r):a=p8(s.className,r)),o(t,e,"className",a)}function hN(t){return`<span class="selected">✓</span>${t}`}function $g(t,e){let n=!1;return Array.isArray(t)&&D(t,r=>(r.forAll((i,o)=>{if(i>=0&&o>=0&&e(i,o))return n=!0,!1}),n)),n}function Fg(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 $e="---------";function v8(){return{name:$e}}const ti="alignment";function C8(){return{key:ti,name(){return this.getTranslatedPhrase(Nb)},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:`${ti}:left`,name(){return this.getTranslatedPhrase(Db)},callback(){const t=this.getSelectedRange(),e=nl(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",e,t,n,r),Ls(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ti}:center`,name(){return this.getTranslatedPhrase(kb)},callback(){const t=this.getSelectedRange(),e=nl(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",e,t,n,r),Ls(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ti}:right`,name(){return this.getTranslatedPhrase(Lb)},callback(){const t=this.getSelectedRange(),e=nl(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htRight";this.runHooks("beforeCellAlignment",e,t,n,r),Ls(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ti}:justify`,name(){return this.getTranslatedPhrase($b)},callback(){const t=this.getSelectedRange(),e=nl(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",e,t,n,r),Ls(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{name:$e},{key:`${ti}:top`,name(){return this.getTranslatedPhrase(Fb)},callback(){const t=this.getSelectedRange(),e=nl(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htTop";this.runHooks("beforeCellAlignment",e,t,n,r),Ls(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ti}:middle`,name(){return this.getTranslatedPhrase(Vb)},callback(){const t=this.getSelectedRange(),e=nl(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",e,t,n,r),Ls(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${ti}:bottom`,name(){return this.getTranslatedPhrase(Wb)},callback(){const t=this.getSelectedRange(),e=nl(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htBottom";this.runHooks("beforeCellAlignment",e,t,n,r),Ls(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1}]}}}const Vg="clear_column";function y8(){return{key:Vg,name(){return this.getTranslatedPhrase(yb)},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 xh="col_left";function b8(){return{key:xh,name(){return this.getTranslatedPhrase(gb)},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 Ah="col_right";function S8(){return{key:Ah,name(){return this.getTranslatedPhrase(mb)},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 Hh="make_read_only";function R8(){return{key:Hh,checkable:!0,ariaChecked(){return $g(this.getSelectedRange(),(e,n)=>this.getCellMeta(e,n).readOnly)},ariaLabel(){return this.getTranslatedPhrase(Zf)},name(){let t=this.getTranslatedPhrase(Zf);return $g(this.getSelectedRange(),(n,r)=>this.getCellMeta(n,r).readOnly)&&(t=hN(t)),t},callback(){const t=this.getSelectedRange(),e=$g(t,(n,r)=>this.getCellMeta(n,r).readOnly);D(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 Wg="redo";function E8(){return{key:Wg,name(){return this.getTranslatedPhrase(Cb)},callback(){this.getPlugin("undoRedo").redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const Bg=0,jg=1,dN=2,eE=3,T8=[eE,dN],_8=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],tE=Symbol("root"),fN=Symbol("child");function Hu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:tE;if(e!==tE&&e!==fN)throw new Error("The second argument is used internally only and cannot be overwritten.");const n=Array.isArray(t),r=e===tE;let i=Bg;if(n){const o=t[0];t.length===0?i=jg:r&&o instanceof ah?i=eE:r&&Array.isArray(o)?i=Hu(o,fN):t.length>=2&&t.length<=4&&!t.some((a,l)=>!_8[l].includes(typeof a))&&(i=dN)}return i}function Nh(t){let{createCellCoords:e,createCellRange:n,keepDirection:r=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!T8.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(o){const s=t===eE;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,S=u,b=c;a=Math.min(f,S),l=Math.min(m,b),u=Math.max(f,S),c=Math.max(m,b)}const h=e(a,l),d=e(u,c);return n(h,h,d)}}function M8(t){const e=Hu(t.getSelected());if(e===Bg||e===jg)return[];const n=Nh(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;D(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.col,0),c=l.col-u+1;D(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 ir(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function I8(t){const e=Hu(t.getSelected());if(e===Bg||e===jg)return[];const n=Nh(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;D(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.row,0),c=l.row-u+1;D(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 ir(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}const Dh="remove_col";function P8(){return{key:Dh,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(wb,e)},callback(){this.alter("remove_col",M8(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 Ug="remove_row";function O8(){return{key:Ug,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(pb,e)},callback(){this.alter("remove_row",I8(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 zg="row_above";function x8(){return{key:zg,name(){return this.getTranslatedPhrase(db)},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 Yg="row_below";function A8(){return{key:Yg,name(){return this.getTranslatedPhrase(fb)},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 kh="no_items";function H8(){return{key:kh,name(){return this.getTranslatedPhrase(hb)},disabled:!0,isCommand:!1}}const Gg="undo";function N8(){return{key:Gg,name(){return this.getTranslatedPhrase(vb)},callback(){this.getPlugin("undoRedo").undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const D8=[zg,Yg,xh,Ah,Vg,Ug,Dh,Gg,Wg,Hh,ti,$e,kh],k8={[$e]:v8,[kh]:H8,[zg]:x8,[Yg]:A8,[xh]:b8,[Ah]:S8,[Vg]:y8,[Ug]:O8,[Dh]:P8,[Gg]:N8,[Wg]:E8,[Hh]:R8,[ti]:C8};function gN(){const t={};return ke(k8,(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(xb):this.getTranslatedPhrase(Ob)},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 $8(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(Ab)},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 F8(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(Hb);return $g(this.getSelectedRange(),(r,i)=>t.getCommentMeta(r,i,Kg))?hN(e):e},callback(){this.getSelectedRangeLast().forAll((n,r)=>{if(n>=0&&r>=0){const i=!!t.getCommentMeta(n,r,Kg);t.updateCommentMeta(n,r,{[Kg]:!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 V8(t,e){mN(t,e),e.add(t)}function Nu(t,e,n){mN(t,e),e.set(t,n)}function mN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function W8(t,e,n){return(e=B8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function B8(t){var e=j8(t,"string");return typeof e=="symbol"?e:e+""}function j8(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 $s(t,e,n){return t.set(lr(t,e),n),n}function Ne(t,e){return t.get(lr(t,e))}function lr(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 qg="comments",U8=60,Qo="comment",Lh="value",pN="style",Kg="readOnly",$h=qg,nE=`plugin:${qg}`;var lt=new WeakMap,ao=new WeakMap,Xg=new WeakMap,Zg=new WeakMap,rE=new WeakMap,Qg=new WeakMap,Or=new WeakSet;class z8 extends Qe{constructor(){super(...arguments),V8(this,Or),W8(this,"range",{}),Nu(this,lt,null),Nu(this,ao,null),Nu(this,Xg,!1),Nu(this,Zg,!1),Nu(this,rE,null),Nu(this,Qg,"")}static get PLUGIN_KEY(){return qg}static get PLUGIN_PRIORITY(){return U8}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[qg]}enablePlugin(){var e=this;this.enabled||(Ne(lt,this)||($s(lt,this,new tl(this.hot.rootDocument,this.hot.isRtl())),Ne(lt,this).addLocalHook("resize",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return lr(Or,e,J8).call(e,...r)})),Ne(ao,this)||$s(ao,this,new cN(this.getSetting("displayDelay"))),this.addHook("afterContextMenuDefaultOptions",n=>this.addToContextMenu(n)),this.addHook("afterRenderer",(n,r,i,o,s,a)=>lr(Or,this,X8).call(this,n,a)),this.addHook("afterScroll",()=>lr(Or,this,e7).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",n=>lr(Or,this,wN).call(this,n)),this.addHook("beforeCompositionStart",n=>lr(Or,this,wN).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 lr(Or,e,t7).call(e,...r)}),Ne(ao,this).addLocalHook("hide",()=>this.hide()),Ne(ao,this).addLocalHook("show",(n,r)=>this.showAtCell(n,r)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){Ne(ao,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(nE);n.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeLast();$s(Zg,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(nE),this.hot._registerTimeout(()=>{$s(Zg,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell()},group:$h}),r.addShortcut({keys:[["Escape"]],callback:()=>{Ne(lt,this).setValue(Ne(Qg,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ne(lt,this).isVisible()&&Ne(lt,this).isFocused(),group:$h}),r.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ne(lt,this).isVisible()&&Ne(lt,this).isFocused(),group:$h}),r.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{Ne(lt,this).setValue(Ne(lt,this).getValue()),this.hide(),e.setActiveContextName("grid")},group:$h})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup($h)}registerListeners(){const{rootDocument:e}=this.hot,n=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",r=>lr(Or,this,q8).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>lr(Or,this,Y8).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>lr(Or,this,K8).call(this)),this.eventManager.addEventListener(n,"focus",()=>lr(Or,this,Q8).call(this)),this.eventManager.addEventListener(n,"blur",()=>lr(Or,this,Z8).call(this)),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",r=>lr(Or,this,G8).call(this,r))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const n=Ta(e.target,"TD","TBODY");return!!(n&&Se(n,"htCommentCell")&&Ta(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=Ne(lt,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,{[Lh]: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,Qo),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,Lh)}getCommentAtCell(e,n){return this.getCommentMeta(e,n,Lh)}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 Ne(ao,this).cancelHiding(),Ne(lt,this).setValue((e=i[Qo]?i[Qo][Lh]:null)!==null&&e!==void 0?e:""),Ne(lt,this).show(),this.refreshEditor(!0),!0}showAtCell(e,n){return this.setRange({from:this.hot._createCellCoords(e,n)}),this.show()}hide(){Ne(lt,this).hide()}refreshEditor(){if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!Ne(lt,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;Ne(lt,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),S=this.getCommentMeta(i,o,pN);S?Ne(lt,this).setSize(S.width,S.height):Ne(lt,this).resetSize();const b=c?0:f.getColumnWidth(a),T=l&&!u?cn(m):0,{left:v,top:O,width:P,height:_}=m.getBoundingClientRect(),{width:M,height:H}=Ne(lt,this).getSize(),{innerWidth:X,innerHeight:G}=this.hot.rootWindow,U=this.hot.rootDocument.documentElement,ne=bn(this.hot.rootDocument),ee=Mx(this.hot.rootWindow)?ne:0,he=Ix(this.hot.rootWindow)?ne:0;let ie=v+h.scrollX+b,ae=O+h.scrollY+T;this.hot.isRtl()&&(ie-=M+b),this.hot.isLtr()&&v+P+M>X-ee?ie=v+h.scrollX-M-1:this.hot.isRtl()&&ie<-(U.scrollWidth-U.clientWidth)&&(ie=v+h.scrollX+b+1),O+H>G-he&&(ae-=H-_+1),Ne(lt,this).setPosition(ie,ae),Ne(lt,this).setReadOnlyState(this.getCommentMeta(i,o,Kg)),Ne(lt,this).observeSize()}focusEditor(){Ne(lt,this).focus()}updateCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n)[Qo];let o;i?(o=jn(i),If(o,r)):o=r,this.hot.setCellMeta(e,n,Qo,o)}getCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n);if(i[Qo])return i[Qo][r]}addToContextMenu(e){e.items.push({name:$e},L8(this),$8(this),F8(this))}getEditorInputElement(){return Ne(lt,this).getInputElement()}destroy(){var e,n;(e=Ne(lt,this))===null||e===void 0||e.destroy(),(n=Ne(ao,this))===null||n===void 0||n.destroy(),super.destroy()}}function Y8(t){if(!(!this.hot.view||!this.hot.view._wt)&&!Ne(Xg,this)&&!this.targetIsCommentTextArea(t)){const e=Ta(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 G8(t){t.stopPropagation()}function q8(t){const{rootDocument:e}=this.hot;if(!(Ne(Xg,this)||Ne(lt,this).isFocused()||Se(t.target,"wtBorder")||Ne(rE,this)===t.target||!Ne(lt,this)))if($s(rE,this,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const n=this.hot._createCellRange(this.hot.getCoords(t.target));Ne(ao,this).show(n)}else _a(t.target,e)&&!this.targetIsCommentTextArea(t)&&Ne(ao,this).hide()}function K8(){$s(Xg,this,!1)}function X8(t,e){e[Qo]&&e[Qo][Lh]&&Z(t,e.commentedCellClassName)}function Z8(){$s(Qg,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function Q8(){$s(Qg,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(nE)}function J8(t,e){this.updateCommentMeta(this.range.from.row,this.range.from.col,{[pN]:{width:t,height:e}})}function wN(t){Ne(lt,this).isFocused()&&wi(t)}function e7(){Ne(Zg,this)||this.hide()}function t7(){const t=Ne(lt,this).getEditorElement();ye(t,/ht-theme-.*/g),Z(t,this.hot.getCurrentThemeName())}function iE(t,e,n){return(e=n7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n7(t){var e=r7(t,"string");return typeof e=="symbol"?e:e+""}function r7(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 vN{constructor(e){iE(this,"hot",void 0),iE(this,"commands",{}),iE(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=i7(a,l.submenu.items)),l.disabled===!0||typeof l.disabled=="function"&&l.disabled.call(this.hot)===!0||ln(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(":")),D(u,c=>c.apply(this.hot,r))}}function i7(t,e){let n;return D(e,r=>{const i=r.key?r.key.split(":"):null;if(Array.isArray(i)&&i[1]===t)return n=r,!1}),n}function oE(t,e,n){return(e=o7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o7(t){var e=s7(t,"string");return typeof e=="symbol"?e:e+""}function s7(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 CN{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;oE(this,"hot",void 0),oE(this,"predefinedItems",gN()),oE(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=n}setPredefinedItems(e){const n={};this.defaultOrderPattern.length=0,ke(e,(r,i)=>{let o="";r.name===$e?(n[$e]=r,o=$e):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 a7(e,this.defaultOrderPattern,this.predefinedItems)}}function a7(){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),De(i)?ke(i,(o,s)=>{let a=n[typeof o=="string"?o:s];a||(a=o),De(o)?an(a,o):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=s),r.push(a)}):D(i,(o,s)=>{let a=n[o];!a&&D8.indexOf(o)>=0||(a||(a={name:o,key:`${s}`}),De(o)&&an(a,o),a.key===void 0&&(a.key=s),r.push(a))}),r}function Fs(t,e,n){return(e=l7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l7(t){var e=u7(t,"string");return typeof e=="symbol"?e:e+""}function u7(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 c7{constructor(e,n){Fs(this,"top",void 0),Fs(this,"topRelative",void 0),Fs(this,"left",void 0),Fs(this,"leftRelative",void 0),Fs(this,"scrollTop",void 0),Fs(this,"scrollLeft",void 0),Fs(this,"cellHeight",void 0),Fs(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 Fh(t,e,n){h7(t,e),e.set(t,n)}function h7(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ae(t,e){return t.get(yN(t,e))}function Jg(t,e,n){return t.set(yN(t,e),n),n}function yN(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 qn=new WeakMap,ur=new WeakMap,cr=new WeakMap,sE=new WeakMap,Du=new WeakMap;class d7{constructor(e){Fh(this,qn,void 0),Fh(this,ur,void 0),Fh(this,cr,void 0),Fh(this,sE,!1),Fh(this,Du,{above:0,below:0,left:0,right:0}),Jg(sE,this,e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Ae(Du,this)[e]=n,this}setElement(e){return Jg(qn,this,e),this}setParentElement(e){return Jg(ur,this,e),this}updatePosition(e){Jg(cr,this,new c7(e,Ae(qn,this).ownerDocument.defaultView)),Ae(sE,this)?(Ae(cr,this).fitsBelow(Ae(qn,this))?this.setPositionBelowCursor():Ae(cr,this).fitsAbove(Ae(qn,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){Ae(qn,this).dir==="rtl"?Ae(cr,this).fitsOnLeft(Ae(qn,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Ae(cr,this).fitsOnRight(Ae(qn,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Ae(Du,this).above+Ae(cr,this).top-Ae(qn,this).offsetHeight;if(Ae(ur,this)){const r=Ae(ur,this).ownerDocument.defaultView.getComputedStyle(Ae(ur,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),o=Number.parseInt(r.borderTop,10);e=Ae(cr,this).top+Ae(cr,this).cellHeight-Ae(qn,this).scrollHeight+i+o}Ae(qn,this).style.top=`${e}px`}setPositionBelowCursor(){let e=Ae(Du,this).below+Ae(cr,this).top+1;if(Ae(ur,this)){const r=Ae(ur,this).ownerDocument.defaultView.getComputedStyle(Ae(ur,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),o=Number.parseInt(r.borderTop,10);e=Ae(cr,this).top-i-o-1}Ae(qn,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=Ae(cr,this).left;if(Ae(ur,this)){const n=Ae(ur,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(Ae(ur,this).querySelector(".htCore")).borderRightWidth,10);e+=Ae(cr,this).cellWidth+r}else e+=Ae(Du,this).right;Ae(qn,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=Ae(Du,this).left+Ae(cr,this).left-Ae(qn,this).offsetWidth;if(Ae(ur,this)){const n=Ae(ur,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(Ae(ur,this).querySelector(".htCore")).borderLeftWidth,10);e-=r}Ae(qn,this).style.left=`${e}px`}}function bN(t){let{initialPage:e=-1,size:n=()=>0,onItemSelect:r=()=>{},onClear:i=()=>{}}=t;const o=new Set;let s=Ye(e,-1,m()-1);function a(b,T){const v=m()-1;return b<0&&(b=v),b>v&&(b=0),o.has(b)?-1:(o.add(b),r(b,!1)===!1&&(b=a(T===1?++b:--b,T)),b)}function l(b){b>-1&&b<m()&&r(b,!0)!==!1&&(s=b)}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 S(){o.clear(),s=e,i()}return{setCurrentPage:l,getCurrentPage:u,toFirstItem:c,toLastItem:h,toNextItem:d,toPreviousItem:f,getSize:m,clear:S}}function f7(t){return ze(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function aE(t){return ln(t,"submenu")}function lE(t){return new RegExp($e,"i").test(t.name)}function em(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function SN(t){return ln(t,"disableSelection")}function g7(t){return Se(t,"htSeparator")}function m7(t){return Se(t,"htSubmenu")}function p7(t){return Se(t,"htDisabled")}function w7(t){return Se(t,"htSelectionDisabled")}function v7(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function RN(t,e){const n=t.slice(0);for(let r=0;r<n.length&&n[r].name===e;)n.shift();return n}function C7(t,e){let n=t.slice(0);return n.reverse(),n=RN(n,e),n.reverse(),n}function y7(t){const e=[];return D(t,(n,r)=>{r>0?e[e.length-1].name!==n.name&&e.push(n):e.push(n)}),e}function b7(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$e,n=t.slice(0);return n=RN(n,e),n=C7(n,e),n=y7(n),n}function S7(t){return t.checkable===!0}function R7(t){return bN({size:()=>t.countRows(),onItemSelect(e,n){const r=t.getCell(e,0);if(!r||g7(r)||p7(r)||w7(r))return!1;t.selectCell(e,0,...n?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function E7(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 EN="menu",TN=EN;function T7(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];r(E7(t)),e.forEach(u=>{let{shortcuts:c,contextName:h}=u;i(c,h)});function r(u,c){a(c).addShortcuts(u,{group:EN})}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?`${TN}:${u}`:TN}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 _7(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(Fo(n),Z(l,"htItemWrapper"),t.getSettings().ariaTags){const d=!em(a,t)&&!SN(a)&&!lE(a);Re(n,[...S7(a)?[xz(),Gc(c),vx(h)]:[Oz(),Gc(u)],...d?[Ra(-1)]:[],...em(a,t)?[$z()]:[],...aE(a)?[Yr(!1)]:[]])}n.className="",n.appendChild(l),lE(a)?Z(n,"htSeparator"):typeof a.renderer=="function"?(Z(n,"htCustomMenuRenderer"),n.appendChild(a.renderer(e,l,r,i,o,u))):tu(l,u),em(a,t)?Z(n,"htDisabled"):SN(a)?Z(n,"htSelectionDisabled"):aE(a)&&Z(n,"htSubmenu")}}function uE(t,e,n){M7(t,e),e.set(t,n)}function M7(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lo(t,e,n){return(e=I7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function I7(t){var e=P7(t,"string");return typeof e=="symbol"?e:e+""}function P7(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 cE(t,e,n){return t.set(_N(t,e),n),n}function rl(t,e){return t.get(_N(t,e))}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 MN=215;var Vh=new WeakMap,tm=new WeakMap,nm=new WeakMap;class ku{get tableBorderWidth(){return rl(nm,this)===void 0&&this.hotMenu&&cE(nm,this,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),rl(nm,this)}constructor(e,n){var r=this;lo(this,"hot",void 0),lo(this,"options",void 0),lo(this,"eventManager",new vi(this)),lo(this,"container",void 0),lo(this,"positioner",void 0),lo(this,"hotMenu",null),lo(this,"hotSubMenus",{}),lo(this,"parentMenu",void 0),lo(this,"menuItems",null),lo(this,"origOutsideClickDeselects",null),uE(this,Vh,void 0),uE(this,tm,void 0),uE(this,nm,void 0),this.hot=e,this.options=n||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:MN,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new d7(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=Jl(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return rl(Vh,this)}getKeyboardShortcutsCtrl(){return rl(tm,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=jf(a=>this.openSubMenu(a),300),n=this.options.minWidth||MN;let r=!1,i=ba(this.menuItems,a=>(a.key===kh&&(r=!0),v7(a,this.hot)));if(i.length<1&&!r)i.push(gN()[kh]);else if(i.length===0)return;i=b7(i,$e);let o=!1;const s={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return fe(a)&&a<n?n:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:_7(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)=>{rl(Vh,this).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},afterOnCellContextMenu:a=>{a.preventDefault(),Lx()&&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=>{(!Lx()||!Oa(a))&&o&&this.hasSelectedItem()&&(Wo()||kx()?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(),cE(Vh,this,R7(this.hotMenu)),cE(tm,this,T7(this)),rl(tm,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(rl(Vh,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);Re(r,[Yr(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const n=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!n||!m7(n))return!1;const r=this.hotMenu.getSourceDataAtRow(e),i=new ku(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&&Re(n,[Yr(!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&&Re(i,[Yr(!1)])}}closeAllSubMenus(){D(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?f7(r):[];this.runLocalHooks("executeCommand",n.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",n.key,i,e)}isCommandPassive(e){return e.isCommand===!1||lE(e)||em(e,this.hot)||aE(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=ir(r,(l,u,c)=>{const d=this.hotMenu.getCell(c,0)?cn(this.hotMenu.getCell(c,0)):0;return l+(u.name===$e?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&&(at(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"),Z(i,`htMenu handsontable ${this.options.className}`),r&&Z(i,r),this.options.container.appendChild(i)),i}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&Re(this.hotMenu.rootElement,[Pz(),Ra(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!_a(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!_a(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&Se(e.target,"htCore")&&_a(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}ft(ku,On);function O7(t,e){x7(t,e),e.add(t)}function x7(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hE(t,e,n){return(e=A7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A7(t){var e=H7(t,"string");return typeof e=="symbol"?e:e+""}function H7(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 rm(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 Wh="contextMenu",N7=70,IN=Wh;oe.getSingleton().register("afterContextMenuDefaultOptions"),oe.getSingleton().register("beforeContextMenuShow"),oe.getSingleton().register("afterContextMenuShow"),oe.getSingleton().register("afterContextMenuHide"),oe.getSingleton().register("afterContextMenuExecute");var Bh=new WeakSet;class im extends Qe{constructor(){super(...arguments),O7(this,Bh),hE(this,"commandExecutor",new vN(this.hot)),hE(this,"itemsFactory",null),hE(this,"menu",null)}static get PLUGIN_KEY(){return Wh}static get PLUGIN_PRIORITY(){return N7}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[zg,Yg,$e,xh,Ah,$e,Ug,Dh,$e,Gg,Wg,$e,Hh,$e,ti]}isEnabled(){return!!this.hot.getSettings()[Wh]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[Wh];typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.menu=new ku(this.hot,{className:"htContextMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>rm(Bh,this,k7).call(this)),this.menu.addLocalHook("afterOpen",()=>rm(Bh,this,L7).call(this)),this.menu.addLocalHook("afterClose",()=>rm(Bh,this,$7).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=>rm(Bh,this,D7).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=Fg(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:IN})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(IN)}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;ke(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 CN(this.hot,im.DEFAULT_ITEMS);const e=this.hot.getSettings()[Wh],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),D(r,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function D7(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(),Se(o,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(n||r)&&!i(o)&&!(Se(o,"current")&&Se(o,"wtBorder"))))return;const s=Fg(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+s.top,left:t.clientX+s.left})}function k7(){this.hot.runHooks("beforeContextMenuShow",this)}function L7(){this.hot.runHooks("afterContextMenuShow",this)}function $7(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}im.SEPARATOR={name:$e};const PN=/^(\r\n|\n\r|\r|\n)/,F7=/^[^\t\r\n]+/,ON=/^\t/;function V7(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(ON))t=t.replace(ON,""),n+=1,e[r][n]="";else if(t.match(PN))t=t.replace(PN,""),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(F7);o=s?s[0]:"",t=t.slice(o.length)}e[r][n]=o}return e}function jh(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(`
|
|
49
|
-
`)>-1?o+=`"${s.replace(/"/g,'""')}"`:o+=s:s==null?o+="":o+=s;e!==n-1&&(o+=`
|
|
50
|
-
`)}return o}function W7(t){return{key:"copy",name(){return this.getTranslatedPhrase(bb)},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 B7(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),n=e?Ye(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Eb,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 j7(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),n=e?Ye(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Rb,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 U7(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),n=e?Ye(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Sb,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 z7(t){return{key:"cut",name(){return this.getTranslatedPhrase(Tb)},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 Y7{constructor(){this.data={}}setData(e,n){this.data[e]=n}getData(e){return this.data[e]||void 0}}class G7{constructor(){this.clipboardData=new Y7}preventDefault(){}composedPath(){return[]}}function q7(t,e){xN(t,e),e.add(t)}function Lu(t,e,n){xN(t,e),e.set(t,n)}function xN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Kn(t,e){return t.get(Fu(t,e))}function $u(t,e,n){return t.set(Fu(t,e),n),n}function Fu(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 Vs=new WeakMap,dE=new WeakMap,Uh=new WeakMap,fE=new WeakMap,gE=new WeakMap,zh=new WeakMap,Yh=new WeakSet;class K7{constructor(e){let{countRows:n,countColumns:r,rowsLimit:i,columnsLimit:o,countColumnHeaders:s}=e;q7(this,Yh),Lu(this,Vs,void 0),Lu(this,dE,void 0),Lu(this,Uh,void 0),Lu(this,fE,void 0),Lu(this,gE,void 0),Lu(this,zh,void 0),$u(dE,this,n),$u(Uh,this,r),$u(fE,this,i),$u(gE,this,o),$u(zh,this,s)}setSelectedRange(e){$u(Vs,this,e)}getCellsRange(){if(Kn(dE,this).call(this)===0||Kn(Uh,this).call(this)===0)return null;const{row:e,col:n}=Kn(Vs,this).getTopStartCorner(),{row:r,col:i}=Kn(Vs,this).getBottomEndCorner(),o=Fu(Yh,this,X7).call(this,e,r),s=Fu(Yh,this,mE).call(this,n,i);return{isRangeTrimmed:r!==o||i!==s,startRow:e,startCol:n,endRow:o,endCol:s}}getMostBottomColumnHeadersRange(){if(Kn(Uh,this).call(this)===0||Kn(zh,this).call(this)===0)return null;const{col:e}=Kn(Vs,this).getTopStartCorner(),{col:n}=Kn(Vs,this).getBottomEndCorner(),r=Fu(Yh,this,mE).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-1,startCol:e,endRow:-1,endCol:r}}getAllColumnHeadersRange(){if(Kn(Uh,this).call(this)===0||Kn(zh,this).call(this)===0)return null;const{col:e}=Kn(Vs,this).getTopStartCorner(),{col:n}=Kn(Vs,this).getBottomEndCorner(),r=Fu(Yh,this,mE).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-Kn(zh,this).call(this),startCol:e,endRow:-1,endCol:r}}}function mE(t,e){return Math.min(e,Math.max(t+Kn(gE,this).call(this)-1,t))}function X7(t,e){return Math.min(e,Math.max(t+Kn(fE,this).call(this)-1,t))}function AN(t){const e=[],n=[];return D(t,r=>{const i=Math.min(r.startRow,r.endRow),o=Math.max(r.startRow,r.endRow);me(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);me(s,a,l=>{n.indexOf(l)===-1&&n.push(l)})}),{rows:e,columns:n}}var HN={},pE,NN;function Z7(){if(NN)return pE;NN=1;var t=ui(),e=da(),n=ci(),r=n("match");return pE=function(i){var o;return t(i)&&((o=i[r])!==void 0?!!o:e(i)==="RegExp")},pE}var wE,DN;function Q7(){if(DN)return wE;DN=1;var t=sn();return wE=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},wE}var vE,kN;function J7(){if(kN)return vE;kN=1;var t=An(),e=Br(),n=Ec(),r=Q7(),i=RegExp.prototype;return vE=function(o){var s=o.flags;return s===void 0&&!("flags"in i)&&!e(o,"flags")&&n(i,o)?t(r,o):s},vE}var CE,LN;function e5(){if(LN)return CE;LN=1;var t=Jt(),e=kl(),n=Math.floor,r=t("".charAt),i=t("".replace),o=t("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;return CE=function(l,u,c,h,d,f){var m=c+l.length,S=h.length,b=a;return d!==void 0&&(d=e(d),b=s),i(f,b,function(T,v){var O;switch(r(v,0)){case"$":return"$";case"&":return l;case"`":return o(u,0,c);case"'":return o(u,m);case"<":O=d[o(v,1,-1)];break;default:var P=+v;if(P===0)return T;if(P>S){var _=n(P/10);return _===0?T:_<=S?h[_-1]===void 0?r(v,1):h[_-1]+r(v,1):T}O=h[P-1]}return O===void 0?"":O})},CE}var $N;function t5(){if($N)return HN;$N=1;var t=Ct(),e=An(),n=Jt(),r=Sc(),i=on(),o=Jd(),s=Z7(),a=rf(),l=Tc(),u=J7(),c=e5(),h=ci(),d=ys(),f=h("replace"),m=TypeError,S=n("".indexOf),b=n("".replace),T=n("".slice),v=Math.max;return t({target:"String",proto:!0},{replaceAll:function(P,_){var M=r(this),H,X,G,U,ne,ee,he,ie,ae,st,ve=0,Ie="";if(!o(P)){if(H=s(P),H&&(X=a(r(u(P))),!~S(X,"g")))throw new m("`.replaceAll` does not allow non-global regexes");if(G=l(P,f),G)return e(G,P,M,_);if(d&&H)return b(a(M),P,_)}for(U=a(M),ne=a(P),ee=i(_),ee||(_=a(_)),he=ne.length,ie=v(1,he),ae=S(U,ne);ae!==-1;)st=ee?a(_(ne,ae,U)):c(ne,U,ae,[],void 0,_),Ie+=T(U,ve,ae)+st,ve=ae+he,ae=ae+ie>U.length?-1:S(U,ne,ae+ie);return ve<U.length&&(Ie+=T(U,ve)),Ie}}),HN}t5();const FN={" ":" ","&":"&","<":"<",">":">"},n5=new RegExp(Object.keys(FN).map(t=>`(${t})`).join("|"),"gi");function r5(t){return(t&&t.nodeName||"")==="TABLE"}function VN(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 b=0;b<s;b+=1){const T=!f&&n&&b===0;let v="";if(f)v=`<th>${t.getColHeader(b-c)}</th>`;else if(T)v=`<th>${t.getRowHeader(d-h)}</th>`;else{const O=i[d][b],{hidden:P,rowspan:_,colspan:M}=t.getCellMeta(d-h,b-c);if(!P){const H=[];if(_&&H.push(`rowspan="${_}"`),M&&H.push(`colspan="${M}"`),jt(O))v=`<td ${H.join(" ")}></td>`;else{const X=O.toString().replace(/</g,"<").replace(/>/g,">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
|
|
51
|
-
`).replace(/\x20/gi," ").replace(/\t/gi,"	");v=`<td ${H.join(" ")}>${X}</td>`}}}m.push(v)}const S=["<tr>",...m,"</tr>"].join("");f?l.splice(1,0,S):u.splice(-1,0,S)}return a.splice(1,0,l.join(""),u.join("")),a.join("")}function WN(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=jt(l)?"":l.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
|
|
52
|
-
`).replace(/\x20{2,}/gi,c=>`<span style="mso-spacerun: yes">${" ".repeat(c.length-1)} </span>`).replace(/\t/gi,"	");s.push(`<td>${u}</td>`)}n.push("<tr>",...s,"</tr>"),r+1===e&&n.push("</tbody>")}return n.push("</table>"),n.join("")}function i5(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 O=o.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,P=>{const _=P.match(/<td\b[^>]*?>/g)[0],M=/<p.*?>/g,H=P.substring(_.length,P.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(M,`
|
|
53
|
-
`).replace(`
|
|
54
|
-
`,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^ $/mg,"");return`${_}${H}</td>`});i.insertAdjacentHTML("afterbegin",`${O}`),o=i.querySelector("table")}if(!o||!r5(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((O,P)=>O+P.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 O=Array.from(o.tHead.rows).filter(P=>{const _=P.querySelector("td")!==null;return _&&h.push(P),!_});f=O.length,d=f>0,f>1?n.nestedHeaders=Array.from(O).reduce((P,_)=>{const M=Array.from(_.cells).reduce((H,X,G)=>{if(a&&G===0)return H;const{colSpan:U,innerHTML:ne}=X,ee=U>1?{label:ne,colspan:U}:ne;return H.push(ee),H},[]);return P.push(M),P},[]):d&&(n.colHeaders=Array.from(O[0].children).reduce((P,_,M)=>(a&&M===0||P.push(_.innerHTML),P),[]))}h.length&&(n.fixedRowsTop=h.length),c.length&&(n.fixedRowsBottom=c.length);const S=[...h,...Array.from(o.tBodies).reduce((O,P)=>(O.push(...Array.from(P.rows)),O),[]),...c];m=S.length;const b=new Array(m);for(let O=0;O<m;O++)b[O]=new Array(u);const T=[],v=[];for(let O=0;O<m;O++){const P=S[O],_=Array.from(P.cells),M=_.length;for(let H=0;H<M;H++){const X=_[H],{nodeName:G,innerHTML:U,rowSpan:ne,colSpan:ee}=X,he=b[O].findIndex(ie=>ie===void 0);if(G==="TD"){if(ne>1||ee>1){for(let ve=O;ve<O+ne;ve++)if(ve<m)for(let Ie=he;Ie<he+ee;Ie++)b[ve][Ie]=null;const ae=X.getAttribute("style");ae&&ae.includes("mso-ignore:colspan")||T.push({col:he,row:O,rowspan:ne,colspan:ee})}let ie="";s&&/excel/gi.test(s.content)?ie=U.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
|
|
55
|
-
`):ie=U.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
|
|
56
|
-
`),b[O][he]=ie.replace(n5,ae=>FN[ae])}else v.push(U)}}return T.length&&(n.mergeCells=T),v.length&&(n.rowHeaders=v),b.length&&(n.data=b),n}function o5(t,e){BN(t,e),e.add(t)}function Ws(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 Gh(t,e,n){return(e=s5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s5(t){var e=a5(t,"string");return typeof e=="symbol"?e:e+""}function a5(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 hr(t,e){return t.get(dr(t,e))}function Mi(t,e,n){return t.set(dr(t,e),n),n}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")}oe.getSingleton().register("afterCopyLimit"),oe.getSingleton().register("modifyCopyableRange"),oe.getSingleton().register("beforeCut"),oe.getSingleton().register("afterCut"),oe.getSingleton().register("beforePaste"),oe.getSingleton().register("afterPaste"),oe.getSingleton().register("beforeCopy"),oe.getSingleton().register("afterCopy");const yE="copyPaste",l5=80,u5=["fragmentSelection"],jN=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var bE=new WeakMap,SE=new WeakMap,RE=new WeakMap,Vu=new WeakMap,om=new WeakMap,sm=new WeakMap,Wu=new WeakMap,am=new WeakMap,xr=new WeakSet;class c5 extends Qe{constructor(){super(...arguments),o5(this,xr),Gh(this,"columnsLimit",1/0),Gh(this,"rowsLimit",1/0),Gh(this,"pasteMode","overwrite"),Gh(this,"uiContainer",this.hot.rootDocument.body),Ws(this,bE,!1),Ws(this,SE,!1),Ws(this,RE,!1),Ws(this,Vu,"cells-only"),Ws(this,om,!1),Ws(this,sm,!1),Ws(this,Wu,new K7({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),Ws(this,am,!1),Gh(this,"copyableRanges",[])}static get PLUGIN_KEY(){return yE}static get SETTING_KEYS(){return[yE,...u5]}static get PLUGIN_PRIORITY(){return l5}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[yE]}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"),Mi(bE,this,this.getSetting("copyColumnHeaders")),Mi(SE,this,this.getSetting("copyColumnGroupHeaders")),Mi(RE,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=(n=this.getSetting("uiContainer"))!==null&&n!==void 0?n:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",i=>dr(xr,this,f5).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 dr(xr,r,g5).call(r,...o)}),this.addHook("afterSelectionEnd",()=>dr(xr,this,m5).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)}),Vf()&&(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 dr(xr,r,p5).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 dr(xr,r,w5).call(r,...o)}),this.addHook("afterSelection",()=>dr(xr,this,v5).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";Mi(Vu,this,e),Mi(om,this,!0),dr(xr,this,UN).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(){Mi(sm,this,!0),dr(xr,this,UN).call(this,"cut")}getRangedCopyableData(e){return jh(this.getRangedData(e))}getRangedData(e){const n=[],{rows:r,columns:i}=AN(e);return D(r,o=>{const s=[];D(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 G7;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}hr(Wu,this).setSelectedRange(e);const n=new Map([["headers",null],["cells",null]]);hr(Vu,this)==="column-headers-only"?n.set("headers",hr(Wu,this).getMostBottomColumnHeadersRange()):(hr(Vu,this)==="with-column-headers"?n.set("headers",hr(Wu,this).getMostBottomColumnHeadersRange()):hr(Vu,this)==="with-column-group-headers"&&n.set("headers",hr(Wu,this).getAllColumnHeadersRange()),n.set("cells",hr(Wu,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:S}=this.hot.getCellMeta(c,a);if(c=S+1,m===!0)continue;d=S,h=a;const b=[],T=o.length%r;for(;b.length<i||h<=u;){const{skipColumnOnPaste:v,visualCol:O}=this.hot.getCellMeta(s,h);if(h=O+1,v===!0)continue;f=O;const P=b.length%i;b.push(e[T][P])}o.push(b)}return Mi(am,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()&&!hr(om,this)||this.isEditorOpened()||Vo(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!xf(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),Mi(om,this,!1);const o=this.getRangedData(this.copyableRanges),s=dr(xr,this,h5).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",o,this.copyableRanges,s)){const l=jh(o);if(e&&e.clipboardData){const u=WN(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",l),e.clipboardData.setData("text/html",[jN,u].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",l);this.hot.runHooks("afterCopy",o,this.copyableRanges,s)}Mi(Vu,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()&&!hr(sm,this)||this.isEditorOpened()||Vo(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!xf(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),Mi(sm,this,!1);const o=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",o,this.copyableRanges)){const a=jh(o);if(e&&e.clipboardData){const l=WN(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",a),e.clipboardData.setData("text/html",[jN,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()||Vo(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!xf(n,this.hot.rootElement)))return;e.preventDefault();let o;if(e&&typeof e.clipboardData<"u"){const c=Ty(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});c&&/(<table)|(<TABLE)/g.test(c)?o=i5(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=V7(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 UN(t){if(Vf()){const e=this.hot.getSelectedRangeLast();if(e){const{row:n,col:r}=e.highlight,i=this.hot.getCell(n,r,!0);i&&oY(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function h5(t){const{rows:e}=AN(t);let n=0;for(let r=0;r<e.length&&!(e[r]>=0);r++)n+=1;return{columnHeadersCount:n}}function d5(){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&&xx(r)}}}function zN(){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")&&Ax(r)}}}function f5(t){t.items.push({name:"---------"},W7(this)),hr(bE,this)&&t.items.push(U7(this)),hr(SE,this)&&t.items.push(j7(this)),hr(RE,this)&&t.items.push(B7(this)),t.items.push(z7(this))}function g5(t,e,n,r,i){hr(am,this)&&(i.value=!0),Mi(am,this,!1)}function m5(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function p5(){dr(xr,this,zN).call(this)}function w5(){dr(xr,this,d5).call(this)}function v5(){dr(xr,this,zN).call(this)}function YN(t,e){return`border_row${t}col${e}`}function qh(){return{width:1,color:"#000"}}function Jo(){return{hide:!0}}function C5(){return{width:1,color:"#000",cornerVisible:!1}}function EE(t){if(fe(t.start)||fe(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(fe(t.end)||fe(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 Kh(t){return fe(t.start)&&(t.left=t.start),fe(t.end)&&(t.right=t.end),t}function TE(t,e){return{id:YN(t,e),border:C5(),row:t,col:e,top:Jo(),bottom:Jo(),start:Jo(),end:Jo()}}function y5(t,e){return ln(e,"border")&&e.border&&(t.border=e.border),ln(e,"top")&&fe(e.top)&&(e.top?(De(e.top)||(e.top=qh()),t.top=e.top):(e.top=Jo(),t.top=e.top)),ln(e,"bottom")&&fe(e.bottom)&&(e.bottom?(De(e.bottom)||(e.bottom=qh()),t.bottom=e.bottom):(e.bottom=Jo(),t.bottom=e.bottom)),ln(e,"start")&&fe(e.start)&&(e.start?(De(e.start)||(e.start=qh()),t.start=e.start):(e.start=Jo(),t.start=e.start)),ln(e,"end")&&fe(e.end)&&(e.end?(De(e.end)||(e.end=qh()),t.end=e.end):(e.end=Jo(),t.end=e.end)),t}function es(t,e){let n=!1;return D(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(!ln(s[e],"hide")||s[e].hide===!1)return n=!0,!1}else return n=!0,!1})}),n}function lm(t){return`<span class="selected">✓</span>${t}`}function b5(t){return t.some(e=>fe(e.left)||fe(e.right))}function S5(t){return t.some(e=>fe(e.start)||fe(e.end))}const R5=new Map([["left","start"],["right","end"]]);function E5(t){var e;return(e=R5.get(t))!==null&&e!==void 0?e:t}function T5(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(zb);return es(this,"bottom")&&(e=lm(e)),e},callback(e,n){const r=es(this,"bottom");t.prepareBorder(n,"bottom",r)}}}function _5(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let n=this.getTranslatedPhrase(Yb);return es(this,e)&&(n=lm(n)),n},callback(n,r){const i=es(this,e);t.prepareBorder(r,e,i)}}}function M5(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(Gb)},callback(e,n){t.prepareBorder(n,"noBorders")},disabled(){return!es(this)}}}function I5(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let n=this.getTranslatedPhrase(Ub);return es(this,e)&&(n=lm(n)),n},callback(n,r){const i=es(this,e);t.prepareBorder(r,e,i)}}}function P5(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(jb);return es(this,"top")&&(e=lm(e)),e},callback(e,n){const r=es(this,"top");t.prepareBorder(n,"top",r)}}}function O5(t,e,n){return(e=x5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function x5(t){var e=A5(t,"string");return typeof e=="symbol"?e:e+""}function A5(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 ts extends qH{constructor(e,n){super(e,null),O5(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 _E(t){let{activeHeaderClassName:e,...n}=t;return new ts({className:e,...n,selectionType:KH})}function H5(t){let{areaCornerVisible:e,...n}=t;return new ts({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...n,selectionType:vR})}function N5(t){let{...e}=t;return new ts({className:"highlight",...e,selectionType:vR})}function D5(t){let{columnClassName:e,...n}=t;return new ts({className:e,...n,selectionType:t6})}function k5(t){let{cellCornerVisible:e,...n}=t;return new ts({className:"current",headerAttributes:[Iy()],border:{width:2,color:"#4b89ff",cornerVisible:e},...n,selectionType:fh})}function L5(t){let{border:e,visualCellRange:n,...r}=t;return new ts({...e,...r,selectionType:n6},n)}function $5(t){let{...e}=t;return new ts({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:JX})}function GN(t){let{headerClassName:e,...n}=t;return new ts({className:e,...n,selectionType:wR})}function F5(t){let{rowClassName:e,...n}=t;return new ts({className:e,...n,selectionType:e6})}function V5(t,e){W5(t,e),e.add(t)}function W5(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(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 ns(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 uo=new WeakSet;class U5{constructor(e){V5(this,uo),fr(this,"options",void 0),fr(this,"layerLevel",0),fr(this,"focus",void 0),fr(this,"fill",void 0),fr(this,"layeredAreas",new Map),fr(this,"areas",new Map),fr(this,"rowHeaders",new Map),fr(this,"columnHeaders",new Map),fr(this,"activeRowHeaders",new Map),fr(this,"activeColumnHeaders",new Map),fr(this,"activeCornerHeaders",new Map),fr(this,"rowHighlights",new Map),fr(this,"columnHighlights",new Map),fr(this,"customSelections",[]),this.options=e,this.focus=k5(e),this.fill=$5(e)}isEnabledFor(e,n){let r=e;e===fh&&(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 ns(uo,this,rs).call(this,this.layeredAreas,H5)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return ns(uo,this,rs).call(this,this.areas,N5)}getAreas(){return[...this.areas.values()]}createRowHeader(){return ns(uo,this,rs).call(this,this.rowHeaders,GN)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return ns(uo,this,rs).call(this,this.columnHeaders,GN)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return ns(uo,this,rs).call(this,this.activeRowHeaders,_E)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return ns(uo,this,rs).call(this,this.activeColumnHeaders,_E)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return ns(uo,this,rs).call(this,this.activeCornerHeaders,_E)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return ns(uo,this,rs).call(this,this.rowHighlights,F5)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return ns(uo,this,rs).call(this,this.columnHighlights,D5)}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(),D(this.areas.values(),e=>{e.clear()}),D(this.layeredAreas.values(),e=>{e.clear()}),D(this.rowHeaders.values(),e=>{e.clear()}),D(this.columnHeaders.values(),e=>{e.clear()}),D(this.activeRowHeaders.values(),e=>{e.clear()}),D(this.activeColumnHeaders.values(),e=>{e.clear()}),D(this.activeCornerHeaders.values(),e=>{e.clear()}),D(this.rowHighlights.values(),e=>{e.clear()}),D(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 rs(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 qN(t,e,n){return(e=z5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function z5(t){var e=Y5(t,"string");return typeof e=="symbol"?e:e+""}function Y5(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 G5{constructor(e){qN(this,"ranges",[]),qN(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 q5(t,e){KN(t,e),e.add(t)}function ME(t,e,n){KN(t,e),e.set(t,n)}function KN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xe(t,e){return t.get(dn(t,e))}function um(t,e,n){return t.set(dn(t,e),n),n}function dn(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 cm=new WeakMap,bt=new WeakMap,Ii=new WeakMap,pn=new WeakSet;class IE{constructor(e,n){q5(this,pn),ME(this,cm,void 0),ME(this,bt,void 0),ME(this,Ii,{x:0,y:0}),um(cm,this,e),um(bt,this,n)}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=Xe(bt,this).createCellCoords(e,n);let o=Xe(cm,this).current().highlight;const s=Xe(bt,this).visualToRenderableCoords(o);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),s.row!==null&&s.col!==null){const{width:u,height:c}=dn(pn,this,ZN).call(this),{row:h,col:d}=dn(pn,this,QN).call(this,o),f=Xe(bt,this).fixedRowsBottom(),m=Xe(bt,this).minSpareRows(),S=Xe(bt,this).minSpareCols(),b=Xe(bt,this).autoWrapRow(),T=Xe(bt,this).autoWrapCol(),v=Xe(bt,this).createCellCoords(h+i.row,d+i.col);if(v.row>=c){const _=Rr(r&&m>0&&f===0),M=v.col+1,H=Xe(bt,this).createCellCoords(v.row-c,M>=u?M-u:M);this.runLocalHooks("beforeColumnWrap",_,dn(pn,this,Bu).call(this,H),M>=u),_.value?this.runLocalHooks("insertRowRequire",Xe(bt,this).countRenderableRows()):T&&v.assign(H)}else if(v.row<0){const _=Rr(T),M=v.col-1,H=Xe(bt,this).createCellCoords(c+v.row,M<0?u+M:M);this.runLocalHooks("beforeColumnWrap",_,dn(pn,this,Bu).call(this,H),M<0),T&&v.assign(H)}if(v.col>=u){const _=Rr(r&&S>0),M=v.row+1,H=Xe(bt,this).createCellCoords(M>=c?M-c:M,v.col-u);this.runLocalHooks("beforeRowWrap",_,dn(pn,this,Bu).call(this,H),M>=c),_.value?this.runLocalHooks("insertColRequire",Xe(bt,this).countRenderableColumns()):b&&v.assign(H)}else if(v.col<0){const _=Rr(b),M=v.row-1,H=Xe(bt,this).createCellCoords(M<0?c+M:M,u+v.col);this.runLocalHooks("beforeRowWrap",_,dn(pn,this,Bu).call(this,H),M<0),b&&v.assign(H)}const{rowDir:O,colDir:P}=dn(pn,this,XN).call(this,v);a=O,l=P,o=dn(pn,this,Bu).call(this,v)}return this.runLocalHooks("afterTransformStart",o,a,l),o}transformEnd(e,n){const r=Xe(bt,this).createCellCoords(e,n),i=Xe(cm,this).current(),o=Xe(bt,this).visualToRenderableCoords(i.highlight),s=dn(pn,this,PE).call(this,i.to.row,i.from.row),a=dn(pn,this,OE).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}=dn(pn,this,QN).call(this,i.highlight),f=Xe(bt,this).createCellCoords(s+r.row,a+r.col),m=i.getTopStartCorner(),S=i.getTopEndCorner(),b=i.getBottomEndCorner();if(r.col<0&&a>=d&&f.col<d){const P=f.col-d;f.col=dn(pn,this,OE).call(this,m.col,S.col)+P}else if(r.col>0&&a<=d&&f.col>d){const P=dn(pn,this,OE).call(this,S.col,m.col),_=Math.max(f.col-P,1);f.col=P+_}if(r.row<0&&s>=h&&f.row<h){const P=f.row-h;f.row=dn(pn,this,PE).call(this,m.row,b.row)+P}else if(r.row>0&&s<=h&&f.row>h){const P=dn(pn,this,PE).call(this,b.row,m.row),_=Math.max(f.row-P,1);f.row=P+_}const{rowDir:T,colDir:v}=dn(pn,this,XN).call(this,f);u=T,c=v;const O=dn(pn,this,Bu).call(this,f);r.row===0&&r.col!==0?l.col=O.col:r.row!==0&&r.col===0?l.row=O.row:(l.row=O.row,l.col=O.col)}return this.runLocalHooks("afterTransformEnd",l,u,c),l}setOffsetSize(e){let{x:n,y:r}=e;um(Ii,this,{x:n,y:r})}resetOffsetSize(){um(Ii,this,{x:0,y:0})}}function XN(t){const{width:e,height:n}=dn(pn,this,ZN).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 ZN(){return{width:Xe(Ii,this).x+Xe(bt,this).countRenderableColumns(),height:Xe(Ii,this).y+Xe(bt,this).countRenderableRows()}}function PE(t,e){const n=Xe(bt,this).findFirstNonHiddenRenderableRow(t,e);return n===null?null:Xe(Ii,this).y+n}function OE(t,e){const n=Xe(bt,this).findFirstNonHiddenRenderableColumn(t,e);return n===null?null:Xe(Ii,this).x+n}function QN(t){const{row:e,col:n}=Xe(bt,this).visualToRenderableCoords(t);if(e===null||n===null)throw new Error("Renderable coords are not visible.");return Xe(bt,this).createCellCoords(Xe(Ii,this).y+e,Xe(Ii,this).x+n)}function Bu(t){const e=t.clone();return e.col=t.col-Xe(Ii,this).x,e.row=t.row-Xe(Ii,this).y,Xe(bt,this).renderableToVisualCoords(e)}ft(IE,On);function ju(t,e,n){K5(t,e),e.set(t,n)}function K5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function il(t,e,n){return(e=X5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function X5(t){var e=Z5(t,"string");return typeof e=="symbol"?e:e+""}function Z5(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 Mt(t,e){return t.get(JN(t,e))}function co(t,e,n){return t.set(JN(t,e),n),n}function JN(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ln=new WeakMap,ol=new WeakMap,hm=new WeakMap,Xh=new WeakMap,dm=new WeakMap,Zh=new WeakMap;class eD{constructor(e,n){var r=this;il(this,"settings",void 0),il(this,"tableProps",void 0),il(this,"inProgress",!1),il(this,"selectedRange",new G5((i,o,s)=>this.tableProps.createCellRange(i,o,s))),il(this,"highlight",void 0),ju(this,Ln,void 0),ju(this,ol,void 0),il(this,"selectedByRowHeader",new Set),il(this,"selectedByColumnHeader",new Set),ju(this,hm,!1),ju(this,Xh,!1),ju(this,dm,"unknown"),ju(this,Zh,-1),this.settings=e,this.tableProps=n,this.highlight=new U5({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[Iy()],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)}),co(Ln,this,new IE(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})),co(ol,this,new IE(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})),Mt(Ln,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)}),Mt(Ln,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)}),Mt(Ln,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)}),Mt(Ln,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)}),Mt(Ln,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)}),Mt(Ln,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)}),Mt(Ln,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)}),Mt(Ln,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)}),Mt(ol,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)}),Mt(ol,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){co(dm,this,e)}markEndSource(){co(dm,this,"unknown")}getSelectionSource(){return Mt(dm,this)}setExpectedLayers(e){co(Zh,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,co(Zh,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();co(hm,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=Mt(Zh,this)===-1||this.selectedRange.size()===Mt(Zh,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&&(D(this.highlight.getAreas(),m=>{m.clear()}),D(this.highlight.getLayeredAreas(),m=>{m.clear()}),D(this.highlight.getRowHeaders(),m=>{m.clear()}),D(this.highlight.getColumnHeaders(),m=>{m.clear()}),D(this.highlight.getActiveRowHeaders(),m=>{m.clear()}),D(this.highlight.getActiveColumnHeaders(),m=>{m.clear()}),D(this.highlight.getActiveCornerHeaders(),m=>{m.clear()}),D(this.highlight.getRowHighlights(),m=>{m.clear()}),D(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(vR,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(wR,e.highlight)){if(!e.isSingleHeader()){const b=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),T=this.tableProps.createCellCoords(e.to.row,-1),v=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),O=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(a.add(b).commit(),l.add(v).commit(),d.add(b).commit(),f.add(v).commit()):(a.add(b).add(T).commit(),l.add(v).add(O).commit(),d.add(b).add(T).commit(),f.add(v).add(O).commit())}const m=!Mt(Xh,this)&&this.isEntireRowSelected()&&(i>0&&i===e.getWidth()||i===0&&this.isSelectedByRowHeader()),S=!Mt(Xh,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(),S&&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&&S&&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(fh,n.highlight)&&r.add(n.highlight).commit().syncWith(n),this.inProgress||(co(hm,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?Mt(Ln,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):Mt(Ln,this).resetOffsetSize(),this.setRangeStart(Mt(Ln,this).transformStart(e,n,r))}transformEnd(e,n){this.settings.navigableHeaders?Mt(Ln,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):Mt(Ln,this).resetOffsetSize(),this.setRangeEnd(Mt(Ln,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()?Mt(ol,this).setOffsetSize({x:o<0?Math.abs(o):-s,y:i<0?Math.abs(i):-a}):Mt(ol,this).setOffsetSize({x:o<0?0:-s,y:i<0?0:-a});const l=Mt(ol,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(Ye(i.row+h,c,a-1),i.col),f=this.tableProps.createCellCoords(Ye(o.row+n,c,a-1),o.col);this.markSource("shift"),s.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(Ye(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,Ye(i.col+h,c,a-1)),f=this.tableProps.createCellCoords(o.row,Ye(o.col+n,c,a-1));this.markSource("shift"),s.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(s.row,Ye(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=Rr(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&Mt(hm,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;co(Xh,this,f),d&&Number.isInteger(d?.row)&&Number.isInteger(d?.col)&&(h=this.tableProps.createCellCoords(Ye(d.row,u,o-1),Ye(d.col,c,s-1)));const m=this.tableProps.createCellCoords(u,c),S=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(S),this.finish(),co(Xh,this,!1)}selectCells(e){var n=this;const r=Hu(e);if(r===jg)return!1;if(r===Bg)throw new Error(it`Unsupported format of the selection ranges was passed. To select cells pass\x20
|
|
57
|
-
the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
|
|
58
|
-
columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const i=Nh(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),D(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=Ye(r.row,u,s-1),m=Ye(r.col,Math.min(i,o),Math.max(i,o))):(f=Ye(r,u,s-1),m=i);const S=this.tableProps.createCellCoords(f,m),b=l===0?0:Ye(S.row,u,-1),T=s-1,v=this.tableProps.createCellCoords(b,i),O=this.tableProps.createCellCoords(T,o);this.runLocalHooks("beforeSelectColumns",v,O,S),v.row=b,O.row=T,this.setRangeStartOnly(v,void 0,S),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(O),this.runLocalHooks("afterSelectColumns",v,O,S),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=Ye(r.row,Math.min(e,n),Math.max(e,n)),d=Ye(r.col,a,o-1)):(h=e,d=Ye(r,a,o-1));const f=this.tableProps.createCellCoords(h,d),m=s===0?0:Ye(f.col,a,-1),S=o-1,b=this.tableProps.createCellCoords(e,m),T=this.tableProps.createCellCoords(n,S);this.runLocalHooks("beforeSelectRows",b,T,f),b.col=m,T.col=S,this.setRangeStartOnly(b,void 0,f),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(T),this.runLocalHooks("afterSelectRows",b,T,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:Ye(s.row,-1/0,e-1),col:Ye(s.col,-1/0,n-1)}),i.assign({row:Ye(i.row,-1/0,e-1),col:Ye(i.col,-1/0,n-1)}),o.assign({row:Ye(o.row,0,e-1),col:Ye(o.col,0,n-1)}),this.selectedRange.ranges.push(r),this.highlight.isEnabledFor(fh,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(fh,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)}}ft(eD,On);function tD(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 Q5(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 J5=new Map([["mousedown",tD],["mouseover",Q5],["touchstart",tD]]);function nD(t,e){let{coords:n,selection:r,controller:i,cellCoordsFactory:o}=e;J5.get(t.type)({coords:n,selection:r,controller:i,cellCoordsFactory:o,isShiftKey:t.shiftKey,isLeftClick:Hy(t)||t.type==="touchstart",isRightClick:Oa(t)})}function eZ(t,e){tZ(t,e),e.add(t)}function tZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nZ(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)}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")}const fm="customBorders",oZ=90;var xE=new WeakSet;class sZ extends Qe{constructor(){super(...arguments),eZ(this,xE),nZ(this,"savedBorders",[])}static get PLUGIN_KEY(){return fm}static get PLUGIN_PRIORITY(){return oZ}isEnabled(){return!!this.hot.getSettings()[fm]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>rD(xE,this,aZ).call(this,e)),this.addHook("init",()=>rD(xE,this,lZ).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=EE(n));const o=Hu(e),s=Nh(o,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});D(e,a=>{s(a).forAll((l,u)=>{D(r,c=>{this.prepareBorderFromCustomAdded(l,u,i,E5(c))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const n=Hu(e),r=Nh(n,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return D(e,o=>{r(o).forAll((s,a)=>{D(this.savedBorders,l=>{l.row===s&&l.col===a&&i.push(Kh(l))})})}),i}clearBorders(e){e?this.setBorders(e):(D(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=TE(e,n);r&&(a=y5(a,r),D(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",Kh(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);me(e.from.row,r,o=>{me(e.from.col,i,s=>{const a=TE(o,s);let l=0;o===e.from.row&&ln(n,"top")&&(l+=1,a.top=n.top),o===e.to.row&&ln(n,"bottom")&&(l+=1,a.bottom=n.bottom),s===e.from.col&&ln(n,"start")&&(l+=1,a.start=n.start),s===e.to.col&&ln(n,"end")&&(l+=1,a.end=n.end),l>0&&(this.hot.setCellMeta(o,s,"borders",Kh(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,n){const r=YN(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=TE(e,n):o=EE(o),i?(o[r]=Jo(),this.countHide(o)===4?this.removeAllBorders(e,n):(this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",Kh(o)))):(o[r]=qh(),this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",Kh(o)))}prepareBorder(e,n,r){D(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":me(o.col,s.col,a=>{me(o.row,s.row,l=>{this.removeAllBorders(l,a)})});break;case"top":me(o.col,s.col,a=>{this.setBorder(o.row,a,n,r)});break;case"bottom":me(o.col,s.col,a=>{this.setBorder(s.row,a,n,r)});break;case"start":me(o.row,s.row,a=>{this.setBorder(a,o.col,n,r)});break;case"end":me(o.row,s.row,a=>{this.setBorder(a,s.col,n,r)});break}})}createCustomBorders(e){D(e,n=>{const r=EE(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 ir([n,r,i,o],(a,l)=>{let u=a;return l&&l.hide&&(u+=1),u},0)}clearBordersFromSelectionSettings(e){const n=ze(this.hot.selection.highlight.customSelections,r=>r.settings.id).indexOf(e);n>-1&&this.hot.selection.highlight.customSelections[n].clear()}clearNullCellRange(){D(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(){D(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const n=ze(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):D(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 D(this.hot.selection.highlight.customSelections,o=>{if(e.id===o.settings.id){const s=this.hot.view._wt.selectionManager.getBorderInstances(o);return D(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):D(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);D(a,l=>{l.changeBorderStyle(r,e)})}return o=!0,!1}}),o}changeBorderSettings(){const e=this.hot.getSettings()[fm];if(Array.isArray(e)){const n=jn(e);this.checkSettingsCohesion(n),n.length||(this.savedBorders=n),this.createCustomBorders(n)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const n=b5(e),r=S5(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 aZ(t){this.hot.getSettings()[fm]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(Bb)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[P5(this),I5(this),T5(this),_5(this),M5(this)]}})}function lZ(){this.changeBorderSettings()}function uZ(t,e){cZ(t,e),e.add(t)}function cZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function AE(t,e,n){return(e=hZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hZ(t){var e=dZ(t,"string");return typeof e=="symbol"?e:e+""}function dZ(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 iD(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 oD="dragToScroll",fZ=100;var HE=new WeakSet;class gZ extends Qe{constructor(){super(...arguments),uZ(this,HE),AE(this,"boundaries",null),AE(this,"callback",null),AE(this,"listening",!1)}static get PLUGIN_KEY(){return oD}static get PLUGIN_PRIORITY(){return fZ}isEnabled(){return!!this.hot.getSettings()[oD]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>iD(HE,this,sD).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>iD(HE,this,sD).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=Jl(n)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function sD(t){if(Oa(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 mZ(t,e){aD(t,e),e.add(t)}function pZ(t,e,n){aD(t,e),e.set(t,n)}function aD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function NE(t,e,n){return(e=wZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wZ(t){var e=vZ(t,"string");return typeof e=="symbol"?e:e+""}function vZ(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 CZ(t,e){return t.get(ni(t,e))}function lD(t,e,n){return t.set(ni(t,e),n),n}function ni(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")}oe.getSingleton().register("afterDropdownMenuDefaultOptions"),oe.getSingleton().register("beforeDropdownMenuShow"),oe.getSingleton().register("afterDropdownMenuShow"),oe.getSingleton().register("afterDropdownMenuHide"),oe.getSingleton().register("afterDropdownMenuExecute");const gm="dropdownMenu",yZ=230,Qh="changeType",DE=gm;var mm=new WeakMap,Pi=new WeakSet;class pm extends Qe{static get PLUGIN_KEY(){return gm}static get PLUGIN_PRIORITY(){return yZ}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[xh,Ah,$e,Dh,$e,Vg,$e,Hh,$e,ti]}constructor(e){super(e),mZ(this,Pi),NE(this,"commandExecutor",new vN(this.hot)),NE(this,"itemsFactory",null),NE(this,"menu",null),pZ(this,mm,!1),this.hot.addHook("afterGetColHeader",(n,r)=>ni(Pi,this,SZ).call(this,n,r))}isEnabled(){return this.hot.getSettings()[gm]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new CN(this.hot,pm.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 ni(Pi,e,IZ).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 ni(Pi,e,MZ).call(e,...o)});const n=this.hot.getSettings()[gm],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 ku(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",()=>ni(Pi,this,RZ).call(this)),this.menu.addLocalHook("afterOpen",()=>ni(Pi,this,EZ).call(this)),this.menu.addLocalHook("afterSubmenuOpen",o=>ni(Pi,this,TZ).call(this,o)),this.menu.addLocalHook("afterClose",()=>ni(Pi,this,_Z).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)}),D(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=Fg(this.menu.container,this.hot.rootDocument),s=this.hot.getCell(-1,i.col,!0).querySelector(`.${Qh}`),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:DE},{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:DE}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(DE)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>ni(Pi,this,bZ).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(),ke(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 uD(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function bZ(t){if(Se(t.target,Qh)){const e=Fg(this.menu.container,this.hot.rootDocument),n=t.target.getBoundingClientRect();t.stopPropagation(),lD(mm,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 SZ(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(`.${Qh}`);if(this.enabled&&o)return;if(!this.enabled){o&&o.parentNode.removeChild(o);return}const s=this.hot.rootDocument.createElement("button");s.className=Qh,s.type="button",s.tabIndex=-1,this.hot.getSettings().ariaTags&&(Re(s,[Ea(),Gc(" ")]),Re(e,[fx("menu")])),s.onclick=function(){return!1},e.firstChild.insertBefore(s,e.firstChild.firstChild)}function RZ(){this.hot.runHooks("beforeDropdownMenuShow",this)}function EZ(){this.hot.runHooks("afterDropdownMenuShow",this),ni(Pi,this,uD).call(this,this.menu)}function TZ(t){ni(Pi,this,uD).call(this,t)}function _Z(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function MZ(t){return CZ(mm,this)?null:t}function IZ(t){Se(t.target,Qh)&&lD(mm,this,!0)}pm.SEPARATOR={name:$e};function cD(t,e,n){return(e=PZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function PZ(t){var e=OZ(t,"string");return typeof e=="symbol"?e:e+""}function OZ(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 xZ{constructor(e){cD(this,"hot",void 0),cD(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 me(e,r,a=>{const l=[];!o.exportHiddenRows&&this._isHiddenRow(a)||(me(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();me(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();me(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 hD(t,e,n){return(e=AZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function AZ(t){var e=HZ(t,"string");return typeof e=="symbol"?e:e+""}function HZ(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 kE{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){hD(this,"dataProvider",void 0),hD(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(n),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let n=qi(this.constructor.DEFAULT_OPTIONS);const r=new Date;return n=an(qi(kE.DEFAULT_OPTIONS),n),n=an(n,e),n.filename=ux(n.filename,{YYYY:r.getFullYear(),MM:`${r.getMonth()+1}`.padStart(2,"0"),DD:`${r.getDate()}`.padStart(2,"0")}),n}}function NZ(t,e){DZ(t,e),e.add(t)}function DZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dD(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 fD="\r",kZ='"',LZ=`
|
|
59
|
-
`,$Z="=",FZ="+",VZ="-",WZ="@",BZ=" ";var LE=new WeakSet;class jZ extends kE{constructor(){super(...arguments),NZ(this,LE)}static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
|
|
60
|
-
`,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=ze(r,l=>this._escapeCell(l,{force:!0,sanitizeValue:e.sanitizeValues})),s&&(a+=e.columnDelimiter),a+=r.join(e.columnDelimiter),a+=e.rowDelimiter),D(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=dD(LE,this,zZ).call(this,i,r):typeof r=="function"?i=r(i):r&&(i=dD(LE,this,UZ).call(this,i)),(n||i.indexOf(fD)>=0||i.indexOf(kZ)>=0||i.indexOf(LZ)>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(new RegExp('"',"g"),'""'),i=`"${i}"`)),i}}function UZ(t){return t.startsWith($Z)||t.startsWith(FZ)||t.startsWith(VZ)||t.startsWith(WZ)||t.startsWith(BZ)||t.startsWith(fD)?`'${t}`:t}function zZ(t,e){return e.test(t)?`'${t}`:t}const $E={csv:jZ};function YZ(t,e,n){return typeof $E[t]=="function"?new $E[t](e,n):null}const GZ="exportFile",qZ=240;class KZ extends Qe{static get PLUGIN_KEY(){return GZ}static get PLUGIN_PRIORITY(){return qZ}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(!$E[e])throw new Error(`Export format type "${e}" is not supported.`);return YZ(e,new xZ(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 Uu(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=ZZ(t,"string");return typeof e=="symbol"?e:e+""}function ZZ(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 Jh{constructor(e,n){let{id:r,stateless:i=!0}=n;Uu(this,"hot",void 0),Uu(this,"id",void 0),Uu(this,"elements",[]),Uu(this,"hidden",!1),Uu(this,"stateId",""),Uu(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 Cg)}getElements(){return this.elements}reset(){D(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(),D(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}ft(Jh,On);const ed={};function Bs(t,e){if(!ed[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:n,descriptor:r}=ed[t];let i=e;return r.inputValuesDecorator&&(i=r.inputValuesDecorator(i)),function(o){return n.apply(o.meta.instance,[].concat([o],[i]))}}function sl(t){if(!ed[t])throw Error(`Filter condition "${t}" does not exist.`);return ed[t].descriptor}function nn(t,e,n){n.key=t,ed[t]={condition:e,descriptor:n}}const Rn="none";function QZ(){return!0}nn(Rn,QZ,{name:Qf,inputsCount:0,showOperators:!1});const td="empty";function JZ(t){return jt(t.value)}nn(td,JZ,{name:eS,inputsCount:0,showOperators:!0});const wm="not_empty";function eQ(t,e){return!Bs(td,e)(t)}nn(wm,eQ,{name:tS,inputsCount:0,showOperators:!0});const nd="eq";function tQ(t,e){let[n]=e;return xt(t.value).toLocaleLowerCase(t.meta.locale)===xt(n)}nn(nd,tQ,{name:nS,inputsCount:1,showOperators:!0});const vm="neq";function nQ(t,e){return!Bs(nd,e)(t)}nn(vm,nQ,{name:rS,inputsCount:1,showOperators:!0});const gD="gt";function rQ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>r}nn(gD,rQ,{name:lS,inputsCount:1,showOperators:!0});const mD="gte";function iQ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>=r}nn(mD,iQ,{name:uS,inputsCount:1,showOperators:!0});const pD="lt";function oQ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<r}nn(pD,oQ,{name:cS,inputsCount:1,showOperators:!0});const wD="lte";function sQ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<=r}nn(wD,sQ,{name:hS,inputsCount:1,showOperators:!0});const FE="date_after";function aQ(t,e){let[n]=e;const r=Q(t.value,t.meta.dateFormat),i=Q(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)>=0}nn(FE,aQ,{name:gS,inputsCount:1,showOperators:!0});const VE="date_before";function lQ(t,e){let[n]=e;const r=Q(t.value,t.meta.dateFormat),i=Q(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)<=0}nn(VE,lQ,{name:mS,inputsCount:1,showOperators:!0});const Cm="between";function uQ(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=Bs(VE,[o]),a=Bs(FE,[i]);return s(t)&&a(t)}return t.value>=i&&t.value<=o}nn(Cm,uQ,{name:dS,inputsCount:2,showOperators:!0});const vD="not_between";function cQ(t,e){return!Bs(Cm,e)(t)}nn(vD,cQ,{name:fS,inputsCount:2,showOperators:!0});const CD="begins_with";function hQ(t,e){let[n]=e;return xt(t.value).toLocaleLowerCase(t.meta.locale).startsWith(xt(n))}nn(CD,hQ,{name:iS,inputsCount:1,showOperators:!0});const yD="ends_with";function dQ(t,e){let[n]=e;return xt(t.value).toLocaleLowerCase(t.meta.locale).endsWith(xt(n))}nn(yD,dQ,{name:oS,inputsCount:1,showOperators:!0});const WE="contains";function fQ(t,e){let[n]=e;return xt(t.value).toLocaleLowerCase(t.meta.locale).indexOf(xt(n))>=0}nn(WE,fQ,{name:sS,inputsCount:1,showOperators:!0});const bD="not_contains";function gQ(t,e){return!Bs(WE,e)(t)}nn(bD,gQ,{name:aS,inputsCount:1,showOperators:!0});const SD="date_tomorrow";function mQ(t){const e=Q(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(Q().subtract(-1,"days").startOf("day"),"d"):!1}nn(SD,mQ,{name:wS,inputsCount:0});const RD="date_today";function pQ(t){const e=Q(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(Q().startOf("day"),"d"):!1}nn(RD,pQ,{name:pS,inputsCount:0});const ED="date_yesterday";function wQ(t){const e=Q(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(Q().subtract(1,"days").startOf("day"),"d"):!1}nn(ED,wQ,{name:vS,inputsCount:0}),pY();function vQ(t,e){let n=t;return n===""&&(n=`(${e})`),n}function rd(t){const e=new Set(t);return function(n){return e.has(n)}}function BE(t){return t??""}function jE(t){return Array.from(new Set(t)).map(e=>BE(e)).sort((e,n)=>typeof e=="number"&&typeof n=="number"?e-n:e===n?0:e>n?1:-1)}function TD(t,e,n,r){const i=[],o=t===e;let s;return o||(s=rd(e)),t.forEach(a=>{let l=!1;(o||s(a))&&(l=!0);const u={checked:l,value:a,visualValue:vQ(a,n)};r&&r(u),i.push(u)}),i}const al="by_value";function CQ(t,e){let[n]=e;return n(t.value)}nn(al,CQ,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[rd(e)]},showOperators:!1});const id={};function yQ(t){if(!id[t])throw Error(`Operation with id "${t}" does not exist.`);const e=id[t].func;return function(n,r){return e(n,r)}}function bQ(t){return id[t].name}function UE(t,e,n){id[t]={name:e,func:n}}const js="conjunction",SQ=bS;function RQ(t,e){return t.every(n=>n.func(e))}UE(js,SQ,RQ);const ym="disjunction",EQ=Jf;function TQ(t,e){return t.some(n=>n.func(e))}UE(ym,EQ,TQ);const zE="disjunctionWithExtraCondition",_Q=Jf;function MQ(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)}UE(zE,_Q,MQ);const IQ="numeric",_D="text",PQ="date",MD={[IQ]:[Rn,$e,td,wm,$e,nd,vm,$e,gD,mD,pD,wD,Cm,vD],[_D]:[Rn,$e,td,wm,$e,nd,vm,$e,CD,yD,$e,WE,bD],[PQ]:[Rn,$e,td,wm,$e,nd,vm,$e,VE,FE,Cm,$e,SD,RD,ED]};function OQ(t){const e=[];let n=t;return MD[n]||(n=_D),D(MD[n],r=>{let i;r===$e?i={name:$e}:i=qi(sl(r)),e.push(i)}),e}function od(t,e,n){return(e=xQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xQ(t){var e=AQ(t,"string");return typeof e=="symbol"?e:e+""}function AQ(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 YE="built",GE="building",ID=["click","input","keydown","keypress","keyup","focus","blur","change"];let Oi=class RF{static get DEFAULTS(){return qi({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,n){od(this,"hot",void 0),od(this,"eventManager",new vi(this)),od(this,"options",void 0),od(this,"_element",void 0),od(this,"buildState",void 0),this.hot=e,this.options=an(RF.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===GE?this._element:this.buildState===YE?(this.update(),this._element):(this.buildState=GE,this.build(),this.buildState=YE,this._element)}isBuilt(){return this.buildState===YE}translateIfPossible(e){return typeof e=="string"&&e.startsWith(Yn)?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=GE),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&&Z(this._element,this.options.className),this.options.children.length)D(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),ke(this.options,(r,i)=>{n[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(n[i]=this.translateIfPossible(r))}),this._element.appendChild(n),D(ID,r=>e(n,r))}else D(ID,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}};ft(Oi,On);function HQ(t,e){PD(t,e),e.add(t)}function NQ(t,e,n){PD(t,e),e.set(t,n)}function PD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bm(t,e){return t.get(qE(t,e))}function DQ(t,e,n){return t.set(qE(t,e),n),n}function qE(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 zu=new WeakMap,OD=new WeakSet;class Us extends Oi{static get DEFAULTS(){return qi({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,n){super(e,an(Us.DEFAULTS,n)),HQ(this,OD),NQ(this,zu,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>qE(OD,this,kQ).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");DQ(zu,this,this._element.firstChild),Z(this._element,"htUIInput"),Z(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(bm(zu,this).type=this.options.type,bm(zu,this).placeholder=this.translateIfPossible(this.options.placeholder),bm(zu,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&bm(zu,this).focus()}}function kQ(t){this.options.value=t.target.value}function LQ(t,e){xD(t,e),e.add(t)}function sd(t,e,n){xD(t,e),e.set(t,n)}function xD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yu(t,e,n){return t.set(ad(t,e),n),n}function Lt(t,e){return t.get(ad(t,e))}function ad(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 wn=new WeakMap,Sm=new WeakMap,Rm=new WeakMap,KE=new WeakMap,Em=new WeakMap,Tm=new WeakSet;class ld extends Oi{static get DEFAULTS(){return qi({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,n){super(e,an(ld.DEFAULTS,n)),LQ(this,Tm),sd(this,wn,null),sd(this,Sm,[]),sd(this,Rm,void 0),sd(this,KE,void 0),sd(this,Em,void 0),this.registerHooks()}getMenu(){return Lt(wn,this)}registerHooks(){this.addLocalHook("click",()=>ad(Tm,this,VQ).call(this))}setItems(e){Yu(Sm,this,this.translateNames(e)),Lt(wn,this)&&Lt(wn,this).setMenuItems(Lt(Sm,this))}translateNames(e){return D(e,n=>{n.name=this.translateIfPossible(n.name)}),e}build(){super.build(),Yu(wn,this,new ku(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),Lt(wn,this).setMenuItems(Lt(Sm,this));const e=new Oi(this.hot,{className:"htUISelectCaption"}),n=new Oi(this.hot,{className:"htUISelectDropdown"});Yu(Rm,this,e),Yu(KE,this,e.element),Yu(Em,this,n),this.hot.getSettings().ariaTags&&(Re(n.element,[Ea()]),Re(this._element,[dx()])),D([e,n],r=>this._element.appendChild(r.element)),Lt(wn,this).addLocalHook("select",r=>ad(Tm,this,$Q).call(this,r)),Lt(wn,this).addLocalHook("afterClose",()=>ad(Tm,this,FQ).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=Lt(wn,this).hot.getTranslatedPhrase(Qf),Lt(KE,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();Lt(wn,this)&&(Lt(wn,this).open(),Lt(wn,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),Lt(wn,this).getNavigator().toFirstItem(),Lt(wn,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:n=>{this.closeOptions(),this.runLocalHooks("tabKeydown",n)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){Lt(wn,this)&&Lt(wn,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){Lt(wn,this)&&(Lt(wn,this).destroy(),Yu(wn,this,null)),Lt(Rm,this)&&Lt(Rm,this).destroy(),Lt(Em,this)&&Lt(Em,this).destroy(),super.destroy()}}function $Q(t){t.name!==$e&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function FQ(){this.runLocalHooks("afterClose")}function VQ(){this.openOptions()}function WQ(t,e){BQ(t,e),e.add(t)}function BQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function AD(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 HD(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 XE=new WeakSet;class ZE extends Jh{constructor(e,n){super(e,{id:n.id,stateless:!1}),WQ(this,XE),AD(this,"name",""),AD(this,"addSeparator",!1),this.name=n.name,this.addSeparator=n.addSeparator,this.elements.push(new ld(this.hot,{menuContainer:n.menuContainer})),this.elements.push(new Us(this.hot,{placeholder:MS})),this.elements.push(new Us(this.hot,{placeholder:IS})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>HD(XE,this,zQ).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),D(this.getInputElements(),e=>{e.addLocalHook("keydown",n=>HD(XE,this,YQ).call(this,n))})}setState(e){if(this.reset(),!e)return;const n=qi(e.command);n.name.startsWith(Ht)&&(n.name=this.hot.getTranslatedPhrase(n.name)),this.getSelectElement().setValue(n),D(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()||sl(Rn),n=[];return D(this.getInputElements(),(r,i)=>{e.inputsCount>i&&n.push(r.getValue())}),{command:e,args:n}}updateState(e,n){const r=sl(e?e.name:Rn);this.state.setValueAtIndex(n,{command:r,args:e?e.args:[]}),e||D(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof ld)[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 Us)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{Z(n.parentNode,"htFiltersMenuCondition"),this.addSeparator&&Z(n.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return Z(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||D(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let n=[sl(Rn)];if(e!==null){const{visualIndex:r}=e;n=OQ(this.hot.getDataType(0,r,this.hot.countRows(),r))}D(this.getInputElements(),r=>r.hide()),this.getSelectElement().setItems(n),super.reset(),this.getSelectElement().setValue(n[0])}}function zQ(t){D(this.getInputElements(),(e,n)=>{e[t.inputsCount>n?"show":"hide"](),n===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function YQ(t){Zc(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),wi(t))}function ND(t,e,n){GQ(t,e),e.set(t,n)}function GQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ud(t,e){return t.get(kD(t,e))}function DD(t,e,n){return t.set(kD(t,e),n),n}function kD(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 Gu=new WeakMap,QE=new WeakMap;class _m extends Oi{static get DEFAULTS(){return qi({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,n){super(e,an(_m.DEFAULTS,n)),ND(this,Gu,void 0),ND(this,QE,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),DD(QE,this,e),DD(Gu,this,this._element.firstChild),ud(Gu,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(ud(QE,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?ud(Gu,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(ud(Gu,this).checked=e)}focus(){this.isBuilt()&&ud(Gu,this).focus()}}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")}const LD=0;var $D=new WeakSet;class eJ extends Jh{constructor(e,n){super(e,{id:n.id,stateless:!1}),qQ(this,$D),XQ(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)=>(Z(n.parentNode,"htFiltersMenuOperators"),D(this.elements,r=>n.appendChild(r.element)),n)}}buildOperatorsElement(){const e=[js,ym];D(e,n=>{const r=new _m(this.hot,{name:"operator",label:{htmlFor:n,textContent:bQ(n)},value:n,checked:n===e[LD],id:n});r.addLocalHook("change",i=>JQ($D,this,tJ).call(this,i)),this.elements.push(r)})}setChecked(e){if(this.elements.length<e)throw Error(it`Radio button with index ${e} doesn't exist.`);D(this.elements,(n,r)=>{n.setChecked(r===e)})}getActiveOperationId(){const e=this.elements.find(n=>n instanceof _m&&n.isChecked());return e?e.getValue():js}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&D(this.elements,n=>{n.setChecked(n.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:js,n=arguments.length>1?arguments[1]:void 0,r=e;r===zE&&(r=ym),this.state.setValueAtIndex(n,r)}reset(){this.setChecked(LD)}}function tJ(t){this.setState(t.target.value)}const FD="ABCDEFGHIJKLMNOPQRSTUVWXYZ".length;function nJ(t){let e=t+1,n="",r;for(;e>0;)r=(e-1)%FD,n=String.fromCharCode(65+r)+n,e=parseInt((e-r)/FD,10);return n}function VD(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 WD(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&De(t[0])&&(e=wy(t[0]))),e}function rJ(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function iJ(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function oJ(t,e,n){sJ(t,e),e.set(t,n)}function sJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function JE(t,e){return t.get(BD(t,e))}function aJ(t,e,n){return t.set(BD(t,e),n),n}function BD(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;class hd extends Oi{static get DEFAULTS(){return qi({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,n){super(e,an(hd.DEFAULTS,n)),oJ(this,cd,void 0)}build(){super.build(),aJ(cd,this,this._element.firstChild)}update(){this.isBuilt()&&(JE(cd,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&JE(cd,this).focus()}activate(){JE(cd,this).click()}}function lJ(t,e){jD(t,e),e.add(t)}function qu(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 xe(t,e){return t.get(Ku(t,e))}function xi(t,e,n){return t.set(Ku(t,e),n),n}function Ku(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 UD="multipleSelect.itemBox";var Ai=new WeakMap,Yt=new WeakMap,e0=new WeakMap,is=new WeakMap,zs=new WeakMap,Ys=new WeakMap,dd=new WeakSet;class fd extends Oi{static get DEFAULTS(){return qi({className:"htUIMultipleSelect",value:[]})}constructor(e,n){super(e,an(fd.DEFAULTS,n)),lJ(this,dd),qu(this,Ai,[]),qu(this,Yt,void 0),qu(this,e0,void 0),qu(this,is,void 0),qu(this,zs,void 0),qu(this,Ys,void 0),xi(is,this,new Us(this.hot,{placeholder:_S,className:"htUIMultipleSelectSearch"})),xi(zs,this,new hd(this.hot,{textContent:SS,className:"htUISelectAll"})),xi(Ys,this,new hd(this.hot,{textContent:RS,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return xe(Yt,this)}registerHooks(){xe(is,this).addLocalHook("keydown",e=>Ku(dd,this,cJ).call(this,e)),xe(is,this).addLocalHook("input",e=>Ku(dd,this,uJ).call(this,e)),xe(zs,this).addLocalHook("click",e=>Ku(dd,this,hJ).call(this,e)),xe(Ys,this).addLocalHook("click",e=>Ku(dd,this,dJ).call(this,e))}setItems(e){var n;xi(Ai,this,e),(n=xe(Yt,this))===null||n===void 0||n.loadData(xe(Ai,this))}setLocale(e){xi(e0,this,e)}getLocale(){return xe(e0,this)}getItems(){return[...xe(Ai,this)]}getValue(){return gJ(xe(Ai,this))}getSearchInputElement(){return xe(is,this)}getSelectAllElement(){return xe(zs,this)}getClearAllElement(){return xe(Ys,this)}isSelectedAllValues(){return xe(Ai,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,n=e.createElement("div"),r=new Oi(this.hot,{className:"htUISelectionControls",children:[xe(zs,this),xe(Ys,this)]});this._element.appendChild(xe(is,this).element),this._element.appendChild(r.element),this._element.appendChild(n);const i=o=>{var s;if(!this._element)return;(s=xe(Yt,this))===null||s===void 0||s.destroy(),Z(o,"htUIMultipleSelectHot"),xi(Yt,this,new this.hot.constructor(o,{data:xe(Ai,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:()=>{xe(Yt,this).listen()},modifyColWidth:u=>{const c=xe(Yt,this).container.scrollWidth-bn(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"})),xe(Yt,this).init(),this.hot.addHook("afterSetTheme",(u,c)=>{c||xe(Yt,this).useTheme(u)});const l=xe(Yt,this).getShortcutManager().getContext("grid");l.removeShortcutsByKeys(["Tab"]),l.removeShortcutsByKeys(["Shift","Tab"]),l.addShortcut({keys:[["Escape"]],callback:u=>{this.runLocalHooks("keydown",u,this)},group:UD}),l.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:u=>{xe(Yt,this).deselectCell(),this.runLocalHooks("keydown",u,this),this.runLocalHooks("listTabKeydown",u,this)},group:UD})};i(n),this.hot._registerTimeout(()=>i(n),100)}focus(){this.isBuilt()&&xe(Yt,this).listen()}reset(){xe(is,this).reset(),xe(zs,this).reset(),xe(Ys,this).reset()}update(){this.isBuilt()&&(xe(Yt,this).loadData(fJ(xe(Ai,this),this.options.value)),super.update())}destroy(){var e;(e=xe(Yt,this))===null||e===void 0||e.destroy(),xe(is,this).destroy(),xe(Ys,this).destroy(),xe(zs,this).destroy(),xi(is,this,null),xi(Ys,this,null),xi(zs,this,null),xi(Yt,this,null),xi(Ai,this,null),super.destroy()}}function uJ(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let n;e===""?n=[...xe(Ai,this)]:n=xe(Ai,this).filter(r=>`${r.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),xe(Yt,this).loadData(n)}function cJ(t){this.runLocalHooks("keydown",t,this),tA(Zc,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),wi(t),xe(Yt,this).listen(),xe(Yt,this).selectCell(0,0))}function hJ(t){const e=[];t.preventDefault(),xe(Yt,this).getSourceData().forEach((n,r)=>{n.checked=!0,e.push(VD(n,r)[0])}),xe(Yt,this).setSourceDataAtCell(e)}function dJ(t){const e=[];t.preventDefault(),xe(Yt,this).getSourceData().forEach((n,r)=>{n.checked=!1,e.push(VD(n,r)[0])}),xe(Yt,this).setSourceDataAtCell(e)}function fJ(t,e){const n=rd(e);return t.map(r=>(r.checked=n(r.value),r))}function gJ(t){const e=[];return t.forEach(n=>{n.checked&&e.push(n.value)}),e}function mJ(t,e){pJ(t,e),e.add(t)}function pJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wJ(t,e,n){return(e=vJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vJ(t){var e=CJ(t,"string");return typeof e=="symbol"?e:e+""}function CJ(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 Mm(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 gd=new WeakSet;class yJ extends Jh{constructor(e,n){super(e,{id:n.id,stateless:!1}),mJ(this,gd),wJ(this,"name",""),this.name=n.name,this.elements.push(new fd(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>Mm(gd,this,bJ).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,n)=>Mm(gd,this,SJ).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===al){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?Rn:al},args:[e.getValue()],itemsSnapshot:n}}updateState(e){const n=(r,i,o,s,a)=>{const[l]=ba(i,h=>h.name===al),u={},c=this.hot.getTranslatedPhrase(eg);if(l){const h=s(r,a),d=ze(h,v=>v.value),f=new Map(h.map(v=>[v.value,this.hot.getCellMeta(v.meta.visualRow,v.meta.visualCol)])),m=jE(d);o&&(l.args[0]=o);const S=[],b=TD(m,l.args[0],c,v=>{v.checked&&S.push(v.value),Mm(gd,this,zD).call(this,v,f)}),T=e.editedConditionStack.column;u.locale=this.hot.getCellMeta(0,T).locale,u.args=[S],u.command=sl(al),u.itemsSnapshot=b}else u.args=[],u.command=sl(Rn);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 fd)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{Z(n.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return Z(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||D(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getTranslatedPhrase(eg),n=this._getColumnVisibleValues(),r=n.map(l=>l.value),i=new Map(n.map(l=>[l.value,l.meta])),o=jE(r),s=TD(o,o,e,l=>{Mm(gd,this,zD).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?[]:ze(this.hot.getDataAtCol(e.visualIndex),(n,r)=>({value:BE(n),meta:this.hot.getCellMeta(r,e.visualIndex)}))}}function bJ(t){Zc(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),wi(t))}function zD(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function SJ(t,e){return e.type==="numeric"?QA(t,e):t}var YD;function RJ(t,e){EJ(t,e),e.add(t)}function EJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function TJ(t,e,n){return(e=_J(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _J(t){var e=MJ(t,"string");return typeof e=="symbol"?e:e+""}function MJ(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 IJ(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 GD=new WeakSet;class md extends Jh{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,n){super(e,{id:n.id,stateless:!0}),RJ(this,GD),TJ(this,"name",""),this.name=n.name,this.elements.push(new Us(this.hot,{type:"button",value:ES,className:"htUIButton htUIButtonOK",identifier:md.BUTTON_OK})),this.elements.push(new Us(this.hot,{type:"button",value:TS,className:"htUIButton htUIButtonCancel",identifier:md.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){D(this.elements,e=>{e.addLocalHook("click",(n,r)=>IJ(GD,this,PJ).call(this,n,r))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(Z(n.parentNode,"htFiltersMenuActionBar"),D(this.elements,r=>n.appendChild(r.element)),n)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}YD=md;function PJ(t,e){e.options.identifier===YD.BUTTON_OK?this.accept():this.cancel()}function t0(t,e,n){return(e=OJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OJ(t){var e=xJ(t,"string");return typeof e=="symbol"?e:e+""}function xJ(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 qD="ConditionCollection.filteringStates";class n0{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;t0(this,"hot",void 0),t0(this,"isMapRegistrable",void 0),t0(this,"filteringStates",new Cg),this.hot=e,this.isMapRegistrable=n,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(qD,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]:js;return e.length?yQ(r)(e,n):!0}addCondition(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:js,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(it`The column of index ${e} has been already applied with a \`${l}\`\x20
|
|
61
|
-
filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
|
|
62
|
-
Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
|
|
63
|
-
use it consequently for a particular column).`)}else if(At(id[r]))throw new Error(it`Unexpected operation named \`${r}\`. Possible ones are\x20
|
|
64
|
-
\`disjunction\` and \`conjunction\`.`);const u=this.getConditions(e);u.length===0?this.filteringStates.setValueAtIndex(e,{operation:r,conditions:[{name:a,args:s,func:Bs(a,s)}]},i):u.push({name:a,args:s,func:Bs(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(qD),this.filteringStates=null,this.clearLocalHooks()}}ft(n0,On);function KD(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=HJ(t,"string");return typeof e=="symbol"?e:e+""}function HJ(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]:()=>[];KD(this,"conditionCollection",void 0),KD(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=n}filter(){let e=[];return D(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 D(n,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&r.push(i)}),r}_getIntersectData(e,n){const r=[];return D(n,i=>{const o=i.meta.visualRow;e[o]!==void 0&&(r[o]=e[o])}),r}}function NJ(t,e){DJ(t,e),e.add(t)}function DJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ll(t,e,n){return(e=kJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kJ(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 r0(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 Im=new WeakSet;class ZD{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];NJ(this,Im),ll(this,"hot",void 0),ll(this,"conditionCollection",void 0),ll(this,"columnDataFactory",void 0),ll(this,"changes",[]),ll(this,"grouping",!1),ll(this,"latestEditedColumnPosition",-1),ll(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=n,this.columnDataFactory=r,this.conditionCollection.addLocalHook("beforeRemove",i=>r0(Im,this,$J).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>r0(Im,this,FJ).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>r0(Im,this,VJ).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,D(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=OG(function(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const f=new n0(r.hot,!1),m=[].concat(c,d);f.importAllConditions(m);const S=r.columnDataFactory(h);let b;f.isEmpty()?b=S:b=new XD(f,v=>r.columnDataFactory(v)).filter(),b=ze(b,v=>v.meta.visualRow);const T=rd(b);return f.destroy(),ba(S,v=>T(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(),ke(this,(e,n)=>{this[n]=null})}}function $J(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function FJ(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function VJ(){D(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}ft(ZD,On);function WJ(t){return bN({initialPage:0,size:()=>t.length,onItemSelect:(n,r)=>{const i=t[n];if(i instanceof fd)return r;if(i.element&&!nu(i.element))return!1;i.focus()}})}const pd="filters";function BJ(t,e){let n=-1,r;const i=WJ(e),o=h=>()=>{r.isOpened()&&r.getKeyboardShortcutsCtrl().listen(pd),i.setCurrentPage(e.indexOf(h))};e.forEach(h=>{h instanceof Oi&&(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(pd),callback:()=>{h.isSubMenu()&&h.close(),d.listen(pd)}}]),!h.isSubMenu()&&d.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:m=>{const S=r.getNavigator();S.getCurrentPage()>-1&&(n=S.getCurrentPage()),S.clear(),m.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{r.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:m=>{const S=e[i.getCurrentPage()];S instanceof ld&&(S.openOptions(),m.preventDefault()),S instanceof hd&&(S.activate(),m.preventDefault()),S instanceof Oi||m.preventDefault()}}],pd)}function a(){r.focus(),r.getKeyboardShortcutsCtrl().listen(pd)}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 jJ(t,e){QD(t,e),e.add(t)}function i0(t,e,n){QD(t,e),e.set(t,n)}function QD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wd(t,e,n){return(e=UJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function UJ(t){var e=zJ(t,"string");return typeof e=="symbol"?e:e+""}function zJ(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 Pm(t,e,n){return t.set(gr(t,e),n),n}function ri(t,e){return t.get(gr(t,e))}function gr(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 o0="filters",YJ=250,JD=o0;var os=new WeakMap,s0=new WeakMap,ul=new WeakMap,Ar=new WeakSet;class GJ extends Qe{static get PLUGIN_KEY(){return o0}static get PLUGIN_PRIORITY(){return YJ}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var n;super(e),n=this,jJ(this,Ar),wd(this,"dropdownMenuPlugin",null),wd(this,"conditionCollection",null),wd(this,"conditionUpdateObserver",null),wd(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),wd(this,"filtersRowsMap",null),i0(this,os,void 0),i0(this,s0,new WeakSet),i0(this,ul,[]),this.hot.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return gr(Ar,n,eee).call(n,...i)})}isEnabled(){return!!this.hot.getSettings()[o0]}enablePlugin(){var e=this;if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new Ch),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",()=>gr(Ar,this,ek).call(this,"accept")),a.addLocalHook("cancel",()=>gr(Ar,this,ek).call(this,"cancel")),a.addLocalHook("change",l=>gr(Ar,this,JJ).call(this,a,l)),a),o=()=>`${this.hot.getTranslatedPhrase(CS)}:`,s=()=>`${this.hot.getTranslatedPhrase(yS)}:`;if(!this.components.get("filter_by_condition")){const a=new ZE(this.hot,{id:"filter_by_condition",name:o,addSeparator:!1,menuContainer:r});a.addLocalHook("afterClose",()=>gr(Ar,this,tk).call(this)),this.components.set("filter_by_condition",i(a))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new eJ(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const a=new ZE(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:r});a.addLocalHook("afterClose",()=>gr(Ar,this,tk).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 yJ(this.hot,{id:"filter_by_value",name:s}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",i(new md(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new n0(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new ZD(this.hot,this.conditionCollection,a=>this.getDataMapAtColumn(a)),this.conditionUpdateObserver.addLocalHook("update",a=>gr(Ar,this,tee).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 gr(Ar,e,QJ).call(e,...l)}),this.addHook("beforeDropdownMenuShow",()=>gr(Ar,this,ZJ).call(this)),this.addHook("afterDropdownMenuShow",()=>gr(Ar,this,KJ).call(this)),this.addHook("afterDropdownMenuHide",()=>gr(Ar,this,XJ).call(this)),this.addHook("afterChange",a=>gr(Ar,this,qJ).call(this,a)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!ri(os,this)&&this.dropdownMenuPlugin.enabled){const a=[{focus:()=>{const u=ri(os,this).getMenu(),c=u.getNavigator(),h=ri(os,this).getLastMenuPage();u.focus(),h>0?c.setCurrentPage(h):c.toFirstItem()}},...Array.from(this.components).map(u=>{let[,c]=u;return c.getElements()}).flat()];Pm(os,this,BJ(this.dropdownMenuPlugin.menu,a));const l=u=>{ri(os,this).listen(),u.preventDefault(),Zc(u.keyCode,"TAB")&&(u.shiftKey?ri(os,this).toPreviousItem():ri(os,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:JD})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(JD)}addCondition(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:js;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,ri(ul,this));if(s!==!1&&r){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),i=ze(n.filter(),u=>u.meta.visualRow);const l=rd(i);me(this.hot.countSourceRows()-1,u=>{l(u)||a.push(u)}),D(a,u=>{this.filtersRowsMap.setValueAtIndex(u,!0)})},!0),!e&&!i.length&&this.hot.deselectCell(),Pm(ul,this,this.exportConditions())}else s!==!1&&!r?(Pm(ul,this,this.exportConditions()),this.filtersRowsMap.clear()):this.importConditions(ri(ul,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 D(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),S=(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:BE(S)})}),r}updateValueComponentCondition(e){const n=this.hot.getDataAtCol(e),r=jE(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===ym&&n.command.key!==Rn&&r.command.key!==Rn&&i.command.key!==Rn?o=zE:i.command.key!==Rn&&(n.command.key===Rn||r.command.key===Rn)&&(o=js),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 D(i,s=>{D(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 qJ(t){t&&D(t,e=>{const[,n]=e,r=this.hot.propToCol(n);this.conditionCollection.hasConditions(r)&&this.updateValueComponentCondition(r)})}function KJ(){const t=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),t.updateMenuDimensions()}function XJ(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function ZJ(){const t=this.dropdownMenuPlugin.menu;ri(s0,this).has(t)||ri(os,this).setMenu(t),ri(s0,this).add(t)}function QJ(t){t.items.push({name:$e}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function ek(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!==Rn&&(this.conditionCollection.addCondition(i,o,l,u),s.command.key!==Rn&&this.conditionCollection.addCondition(i,s,l,u)),a.command.key!==Rn&&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 JJ(t,e){const n=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),t.constructor===ZE&&!e.inputsCount&&this.setListeningDropdownMenu(),n.updateMenuDimensions()}function tk(){this.setListeningDropdownMenu()}function eee(t,e,n){const r=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(r)&&n===this.hot.view.getColumnHeadersCount()-1?Z(e,"htFiltersActive"):ye(e,"htFiltersActive")}function tee(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)&&Pm(ul,this,ri(ul,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===al),s=n.filter(a=>a.name!==al);if(o.length>=2||s.length>=3)rt(it`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
|
|
65
|
-
The overall amount of conditions exceed the capability of the dropdown menu.\x20
|
|
66
|
-
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 nk="internal-use-in-handsontable",a0={licenseKey:nk,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 rk(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[$n])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function ik(t){return Object.keys(t).reduce((e,n)=>(n!=="hyperformula"&&(e[n]=t[n]),e),{})}function nee(t){var e;const n=t[$n],r=ik(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=rk(t);return{...a0,...r,...i}}function ree(t){var e;const n=t[$n],r=ik(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=rk(t);return{...r,...i}}function iee(t,e){return Object.keys(e).some(n=>e[n]!==void 0&&e[n]!==t[n])}function Om(){const t="engine_relationship",e=Ci($n);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function l0(){const t="shared_engine_usage",e=Ci($n);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function oee(t){const e=t.getSettings(),n=e[$n],r=n?.engine;if(n===!0||At(r))return null;if(typeof r.hyperformula=="function"||typeof r=="function"){var i;return see((i=r.hyperformula)!==null&&i!==void 0?i:r,e,t)}else if(typeof r=="object"&&At(r.hyperformula)){const o=Om(),s=l0().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:nk}),(r.getConfig().leapYear1900!==a0.leapYear1900||my(r.getConfig().nullDate,a0.nullDate)===!1)&&rt(it`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
|
|
67
|
-
settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),r}return null}function see(t,e,n){const r=e[$n],i=nee(e),o=Om(),s=l0();aee(t,r.functions),lee(t,r.language);const a=t.buildEmpty(i);return o.set(a,[n]),s.set(a,[n.guid]),uee(a,r.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function ok(t){var e;const n=Om(),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 sk(t,e){if(t){const n=Om(),r=n.get(t),i=l0(),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 aee(t,e){e&&e.forEach(n=>{const{name:r,plugin:i,translations:o}=n;try{t.registerFunction(r,i,o)}catch(s){rt(s.message)}})}function lee(t,e){if(e){const{langCode:n}=e;try{t.registerLanguage(n,e)}catch(r){rt(r.message)}}}function uee(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){rt(a.message)}}),t.resumeEvaluation())}function cee(t,e){return(At(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const ak="DD/MM/YYYY";function hee(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function dee(t){return hee(t)?t.substr(1):t}function fee(t){return typeof t=="string"&&t.startsWith("=")}function u0(t,e){return typeof t=="string"&&e==="date"}function lk(t,e){return Q(t,e,!0).isValid()}function uk(t,e){return Q(t,e,!0).format(ak)}function gee(t,e){return Q(t,ak,!0).format(e)}function ck(t,e){const r=new Date(Date.UTC(0,0,t+-1));return Q(r).format(e)}function mee(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 pee(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 wee(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 c0(t,e,n){const r=pee(t,mee(t,e,n));return wee(r)}function cl(t,e,n){vee(t,e),e.set(t,n)}function vee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function It(t,e){return t.get(hk(t,e))}function Gs(t,e,n){return t.set(hk(t,e),n),n}function hk(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 vd=new WeakMap,qs=new WeakMap,Hr=new WeakMap,xm=new WeakMap,h0=new WeakMap,d0=new WeakMap,Am=new WeakMap;class dk{constructor(e,n,r){cl(this,vd,void 0),cl(this,qs,void 0),cl(this,Hr,void 0),cl(this,xm,[]),cl(this,h0,[]),cl(this,d0,void 0),cl(this,Am,[]),Gs(vd,this,e),Gs(qs,this,n),Gs(Hr,this,r)}setRemovedHfIndexes(e){return Gs(Am,this,e.map(n=>{const r=It(qs,this).getVisualFromPhysicalIndex(n);return this.getHfIndexFromVisualIndex(r)})),It(Am,this)}getRemovedHfIndexes(){return It(Am,this)}getHfIndexFromVisualIndex(e){const n=It(qs,this).getIndexesSequence(),r=It(qs,this).getNotTrimmedIndexes();return n.indexOf(r[e],e)}syncMoves(e){const r=`move${mi(It(vd,this))}s`;It(Hr,this).getEngine().batch(()=>{e.forEach(i=>{const o=i.from!==i.to,s=i.from+1!==i.to;o&&s&&It(Hr,this).getEngine()[r](It(Hr,this).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,n,r){r!==!1&&(Gs(h0,this,e.map(i=>this.getHfIndexFromVisualIndex(i))),Gs(d0,this,this.getHfIndexFromVisualIndex(n)))}calculateAndSyncMoves(e,n){if(It(Hr,this).isPerformingUndoRedo()||e===!1||n===!1)return;const r=c0(It(h0,this),It(d0,this),It(qs,this).getNumberOfIndexes());It(Hr,this).getSheetId()===null?It(Hr,this).getPostponeAction(()=>this.syncMoves(r)):this.syncMoves(r)}getIndexesChangeSyncMethod(){const e=`set${mi(It(vd,this))}Order`;return n=>{if(It(Hr,this).isPerformingUndoRedo())return;const r=It(qs,this).getIndexesSequence();if(n==="update"&&r.length>0){const i=It(xm,this).map(l=>r.indexOf(l)),o=It(Hr,this).getEngine().getSheetDimensions(It(Hr,this).getSheetId());let s;It(vd,this)==="row"?s=o.height:s=o.width;const a=i.length;for(let l=a;l<s;l+=1)i.push(l);It(Hr,this).getEngine()[e](It(Hr,this).getSheetId(),i)}Gs(xm,this,r)}}init(){Gs(xm,this,It(qs,this).getIndexesSequence())}}function hl(t,e,n){Cee(t,e),e.set(t,n)}function Cee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ss(t,e){return t.get(fk(t,e))}function dl(t,e,n){return t.set(fk(t,e),n),n}function fk(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 Hm=new WeakMap,Nm=new WeakMap,f0=new WeakMap,g0=new WeakMap,m0=new WeakMap,p0=new WeakMap,w0=new WeakMap;class yee{constructor(e,n,r){hl(this,Hm,void 0),hl(this,Nm,void 0),hl(this,f0,void 0),hl(this,g0,!1),hl(this,m0,!1),hl(this,p0,null),hl(this,w0,null),dl(Hm,this,new dk("row",e,this)),dl(Nm,this,new dk("column",n,this)),dl(f0,this,r)}getForAxis(e){return e==="row"?ss(Hm,this):ss(Nm,this)}setPerformUndo(e){dl(g0,this,e)}setPerformRedo(e){dl(m0,this,e)}isPerformingUndoRedo(){return ss(g0,this)||ss(m0,this)}getSheetId(){return ss(w0,this)}getEngine(){return ss(p0,this)}getPostponeAction(){return ss(f0,this)}setupSyncEndpoint(e,n){dl(p0,this,e),dl(w0,this,n),ss(Hm,this).init(),ss(Nm,this).init()}}function bee(t,e){gk(t,e),e.add(t)}function fl(t,e,n){return(e=See(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function See(t){var e=Ree(t,"string");return typeof e=="symbol"?e:e+""}function Ree(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 v0(t,e,n){gk(t,e),e.set(t,n)}function gk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ks(t,e,n){return t.set(Ze(t,e),n),n}function gl(t,e){return t.get(Ze(t,e))}function Ze(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 $n="formulas",Eee=["maxRows","maxColumns","language"],Tee=260;oe.getSingleton().register("afterNamedExpressionAdded"),oe.getSingleton().register("afterNamedExpressionRemoved"),oe.getSingleton().register("afterSheetAdded"),oe.getSingleton().register("afterSheetRemoved"),oe.getSingleton().register("afterSheetRenamed"),oe.getSingleton().register("afterFormulasValuesUpdate");const Xu=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var as=new WeakMap,Dm=new WeakMap,Cd=new WeakMap,Je=new WeakSet;class _ee extends Qe{constructor(){var e;super(...arguments),e=this,bee(this,Je),v0(this,as,!1),v0(this,Dm,!1),v0(this,Cd,[["valuesUpdated",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ze(Je,e,Bee).call(e,...r)}],["namedExpressionAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ze(Je,e,jee).call(e,...r)}],["namedExpressionRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ze(Je,e,Uee).call(e,...r)}],["sheetAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ze(Je,e,zee).call(e,...r)}],["sheetRenamed",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ze(Je,e,Yee).call(e,...r)}],["sheetRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ze(Je,e,Gee).call(e,...r)}]]),fl(this,"staticRegister",Ci("formulas")),fl(this,"engine",null),fl(this,"sheetId",null),fl(this,"sheetName",null),fl(this,"indexSyncer",null),fl(this,"rowAxisSyncer",null),fl(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return $n}static get PLUGIN_PRIORITY(){return Tee}static get SETTING_KEYS(){return[$n,...Eee]}isEnabled(){return!!this.hot.getSettings()[$n]}enablePlugin(){var e,n=this;if(!this.enabled){if(this.engine=(e=oee(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){rt("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&&Ze(Je,this,yd).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 Ze(Je,n,mk).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 Ze(Je,n,pk).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 Ze(Je,n,mk).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 Ze(Je,n,pk).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 Ze(Je,n,Oee).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 Ze(Je,n,xee).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 Ze(Je,n,Mee).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 Ze(Je,n,Aee).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 Ze(Je,n,wk).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 Ze(Je,n,wk).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 Ze(Je,n,Hee).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 Ze(Je,n,Nee).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 Ze(Je,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 Ze(Je,n,$ee).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 Ze(Je,n,Dee).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 Ze(Je,n,kee).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 Ze(Je,n,Fee).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 Ze(Je,n,Vee).call(n,...i)}),this.indexSyncer=new yee(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 Ze(Je,n,Pee).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 Ze(Je,n,Wee).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 Ze(Je,n,Iee).call(n,...i)}),gl(Cd,this).forEach(r=>{let[i,o]=r;return this.engine.on(i,o)}),super.enablePlugin()}}disablePlugin(){gl(Cd,this).forEach(e=>{let[n,r]=e;return this.engine.off(n,r)}),sk(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const n=ree(this.hot.getSettings());iee(this.engine.getConfig(),n)&&this.engine.updateConfig(n);const r=this.hot.getSettings()[$n];if(fe(r)&&fe(r.sheetName)&&r.sheetName!==this.sheetName&&this.switchSheet(r.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[$n].sheetName;if(i&&this.engine.doesSheetExist(i))this.switchSheet(this.sheetName);else{const o=this.addSheet(i??void 0,this.hot.getSourceDataArray());Ze(Je,this,yd).call(this,o)}}super.updatePlugin(e)}destroy(){gl(Cd,this).forEach(e=>{var n;let[r,i]=e;return(n=this.engine)===null||n===void 0?void 0:n.off(r,i)}),Ks(Cd,this,null),sk(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,n){if(fe(n)&&!rJ(n))return rt("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return rt("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 rt(r.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){Zy(`The sheet named \`${e}\` does not exist, switch aborted.`);return}Ze(Je,this,yd).call(this,e);const n=this.engine.getSheetSerialized(this.sheetId);n.length>0&&this.hot.loadData(n,`${mi($n)}.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))}),ok(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 fe(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(fe(l)===!1||fe(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=ok(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)){rt(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const o=this.hot.getCellMeta(e,n);return u0(r,o.type)&&(lk(r,o.dateFormat)?r=uk(r,o.dateFormat):fee(r)===!1&&(r=`'${r}`)),this.engine.setCellContents(i,r)}}function yd(t){this.sheetName=t,this.sheetId=this.engine.getSheetId(this.sheetName)}function Mee(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"&&zn(s)&&(s=ck(s,o.dateFormat)),typeof s=="object"&&s!==null?s.value:s}return t}function Iee(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:S}=h.start,{row:b,col:T}=h.end,v=b-m+1,O=T-S+1;for(let P=0;P<f.length;P+=1)for(let _=0;_<f[P].length;_+=1){const M=f[P][_],H=m+P%v,X=S+_%O,G=this.hot.getCellMeta(H,X);u0(M,G.type)&&(M.startsWith("'")?f[P][_]=M.slice(1):this.isFormulaCellType(H,X,this.sheetId)===!1&&(f[P][_]=gee(M,G.dateFormat)))}return f}function mk(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(mi($n))||Ks(Dm,this,At(this.hot.getSettings().data))}function Pee(){if(gl(Dm,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;u0(i,s.type)&&(lk(i,a)?t[r][o]=uk(i,a):i.startsWith("=")||(t[r][o]=`'${i}`))})}),Ks(as,this,!0);const e=this.engine.setSheetContent(this.sheetId,t);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(e),Ks(as,this,!1)}function pk(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(n.includes(mi($n)))return;const r=cee(this.engine,this.hot.getSettings()[$n].sheetName);if(Ze(Je,this,yd).call(this,r),n!=="updateSettings")if(gl(Dm,this))this.switchSheet(this.sheetName);else{const i=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,i)){Ks(as,this,!0);const o=this.engine.setSheetContent(this.sheetId,i);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(o),Ks(as,this,!1)}}}function Oee(t,e,n,r){if(r!=="get"||gl(as,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=dee(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"&&zn(a)&&(a=ck(a,l.dateFormat)),n.value=typeof a=="object"&&a!==null?a.value:a}function xee(t,e,n,r){if(r!=="get"||gl(as,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 wk(t,e){if(Xu(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 Aee(t,e){if(Xu(e))return;const n=[],r=[];t.forEach(i=>{let[o,s,,a]=i;const l=this.hot.propToCol(s);if(!zn(l))return;const u={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(u)){rt(`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 Hee(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 Nee(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 Dee(t,e,n){return this.rowAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveRows(this.sheetId,[o,1]))===!1?!1:void 0}function kee(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(Xu(n))return;const r=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function $ee(t,e,n){if(Xu(n))return;const r=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function Fee(t,e,n,r){if(Xu(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 Vee(t,e,n,r){if(Xu(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 Wee(t,e,n){var r;Ks(as,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());Ks(as,this,!1),i.forEach((o,s)=>{o.forEach((a,l)=>{this.engine.setCellContents({col:l,row:n+s,sheet:this.sheetId},[[a]])})})}function Bee(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function jee(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function Uee(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function zee(t){this.hot.runHooks("afterSheetAdded",t)}function Yee(t,e){Ze(Je,this,yd).call(this,e),this.hot.runHooks("afterSheetRenamed",t,e)}function Gee(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function qee(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(Xb,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 Kee(t){const e=[];return{key:"hidden_columns_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(Zb,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=ze(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 D(c,h=>{e.push(this.toVisualColumn(h))}),e.length===0}}}function Xee(t,e){vk(t,e),e.add(t)}function Zee(t,e,n){vk(t,e),e.set(t,n)}function vk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ml(t,e){return t.get(Xs(t,e))}function Ck(t,e,n){return t.set(Xs(t,e),n),n}function Xs(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")}oe.getSingleton().register("beforeHideColumns"),oe.getSingleton().register("afterHideColumns"),oe.getSingleton().register("beforeUnhideColumns"),oe.getSingleton().register("afterUnhideColumns");const yk="hiddenColumns",Qee=310;var ho=new WeakMap,pl=new WeakSet;class Jee extends Qe{constructor(){super(...arguments),Xee(this,pl),Zee(this,ho,null)}static get PLUGIN_KEY(){return yk}static get PLUGIN_PRIORITY(){return Qee}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[yk]}enablePlugin(){var e=this;this.enabled||(Ck(ho,this,new vg),ml(ho,this).addLocalHook("init",()=>Xs(pl,this,ote).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,ml(ho,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Xs(pl,e,ite).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>Xs(pl,this,tte).call(this,n,r,i)),this.addHook("modifyColWidth",(n,r)=>Xs(pl,this,ete).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 Xs(pl,e,rte).call(e,...r)}),this.addHook("modifyCopyableRange",n=>Xs(pl,this,nte).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=ml(ho,this).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalColumn(u));D(l,u=>{o[u]=!1}),i=ir(o,(u,c,h)=>(c&&u.push(this.hot.toVisualColumn(h)),u),[])}this.hot.runHooks("beforeUnhideColumns",n,i,r&&s)!==!1&&(r&&s&&ml(ho,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(()=>{D(e,s=>{ml(ho,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 ze(ml(ho,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return ml(ho,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(){D(this.hot.getCellsMeta(),e=>{e.skipColumnOnPaste=!1})}destroy(){Ck(ho,this,null),super.destroy()}}function ete(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 tte(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 nte(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 D(t,r=>{let i=!0,o=0;me(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 rte(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"),Z(e,n)}function ite(t){t.items.push({name:$e},qee(this),Kee(this))}function ote(){const t=this.getSetting("columns");Array.isArray(t)&&this.hideColumns(t)}function ste(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(Qb,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 ate(t){const e=[];return{key:"hidden_rows_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(Jb,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=ze(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 D(c,h=>{e.push(this.toVisualRow(h))}),e.length===0}}}function lte(t,e){bk(t,e),e.add(t)}function ute(t,e,n){bk(t,e),e.set(t,n)}function bk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wl(t,e){return t.get(Zs(t,e))}function Sk(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")}oe.getSingleton().register("beforeHideRows"),oe.getSingleton().register("afterHideRows"),oe.getSingleton().register("beforeUnhideRows"),oe.getSingleton().register("afterUnhideRows");const Rk="hiddenRows",cte=320;var fo=new WeakMap,vl=new WeakSet;class hte extends Qe{constructor(){super(...arguments),lte(this,vl),ute(this,fo,null)}static get PLUGIN_KEY(){return Rk}static get PLUGIN_PRIORITY(){return cte}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[Rk]}enablePlugin(){var e=this;this.enabled||(Sk(fo,this,new vg),wl(fo,this).addLocalHook("init",()=>Zs(vl,this,wte).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,wl(fo,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(vl,e,pte).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>Zs(vl,this,fte).call(this,n,r,i)),this.addHook("modifyRowHeight",(n,r)=>Zs(vl,this,dte).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(vl,e,mte).call(e,...r)}),this.addHook("modifyCopyableRange",n=>Zs(vl,this,gte).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=wl(fo,this).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalRow(u));D(l,u=>{o[u]=!1}),i=ir(o,(u,c,h)=>(c&&u.push(this.hot.toVisualRow(h)),u),[])}this.hot.runHooks("beforeUnhideRows",n,i,r&&s)!==!1&&(r&&s&&wl(fo,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(()=>{D(e,s=>{wl(fo,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 ze(wl(fo,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return wl(fo,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(){D(this.hot.getCellsMeta(),e=>{e.skipRowOnPaste=!1})}destroy(){Sk(fo,this,null),super.destroy()}}function dte(t,e){return this.isHidden(e)?0:t}function fte(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 gte(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 D(t,r=>{let i=!0,o=0;me(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 mte(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"),Z(e,n)}function pte(t){t.items.push({name:$e},ste(this),ate(this))}function wte(){const t=this.getSetting("rows");Array.isArray(t)&&this.hideRows(t)}function vte(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(_b)},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 Cte(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(Mb)},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 yte(t,e){Ek(t,e),e.add(t)}function bte(t,e,n){Ek(t,e),e.set(t,n)}function Ek(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function C0(t,e){return t.get(km(t,e))}function y0(t,e,n){return t.set(km(t,e),n),n}function km(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")}oe.getSingleton().register("beforeColumnFreeze"),oe.getSingleton().register("afterColumnFreeze"),oe.getSingleton().register("beforeColumnUnfreeze"),oe.getSingleton().register("afterColumnUnfreeze");const Tk="manualColumnFreeze",Ste=110;var Cl=new WeakMap,b0=new WeakSet;class Rte extends Qe{constructor(){super(...arguments),yte(this,b0),bte(this,Cl,!1)}static get PLUGIN_KEY(){return Tk}static get PLUGIN_PRIORITY(){return Ste}isEnabled(){return!!this.hot.getSettings()[Tk]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>km(b0,this,Ete).call(this,e)),this.addHook("beforeColumnMove",(e,n)=>km(b0,this,Tte).call(this,e,n)),super.enablePlugin())}disablePlugin(){y0(Cl,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;C0(Cl,this)||y0(Cl,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;C0(Cl,this)||y0(Cl,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 Ete(t){t.items.push({name:"---------"},vte(this),Cte(this))}function Tte(t,e){if(C0(Cl,this)){const n=this.hot.getSettings().fixedColumnsStart;if(e<n||t.some(r=>r<n))return!1}}function Lm(t,e,n){return(e=_te(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _te(t){var e=Mte(t,"string");return typeof e=="symbol"?e:e+""}function Mte(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 S0=0,_k=1,Mk=2,Zu="px";let Ik=class{constructor(e){Lm(this,"hot",void 0),Lm(this,"_element",null),Lm(this,"state",S0),Lm(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=Mk}build(){this.state===S0&&(this._element=this.hot.rootDocument.createElement("div"),this.state=_k)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=S0}isAppended(){return this.state===Mk}isBuilt(){return this.state>=_k}setPosition(e,n){zn(e)&&(this._element.style.top=e+Zu),zn(n)&&(this._element.style[this.inlineProperty]=n+Zu)}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){zn(e)&&(this._element.style.width=e+Zu),zn(n)&&(this._element.style.height=n+Zu)}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){zn(e)&&(this._element.style.marginTop=e+Zu),zn(n)&&(this._element.style[`margin${mi(this.inlineProperty)}`]=n+Zu)}getOffset(){const e=this._element.style,n=`margin${mi(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[n]?parseInt(e[n],10):0}}};const Ite="ht__manualColumnMove--backlight";let Pte=class extends Ik{build(){super.build(),Z(this._element,Ite)}};const Ote="ht__manualColumnMove--guideline";let xte=class extends Ik{build(){super.build(),Z(this._element,Ote)}};function Ate(t,e){Pk(t,e),e.add(t)}function Hi(t,e,n){Pk(t,e),e.set(t,n)}function Pk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mr(t,e,n){return t.set(Qs(t,e),n),n}function ge(t,e){return t.get(Qs(t,e))}function Qs(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}oe.getSingleton().register("beforeColumnMove"),oe.getSingleton().register("afterColumnMove");const R0="manualColumnMove",Hte=120,Ok="ht__manualColumnMove",$m="show-ui",E0="on-moving--columns",T0="after-selection--columns";var Xn=new WeakMap,Js=new WeakMap,ls=new WeakMap,Fm=new WeakMap,ea=new WeakMap,Zn=new WeakMap,Vm=new WeakMap,ii=new WeakMap,Qu=new WeakMap,Wm=new WeakMap,bd=new WeakMap,yl=new WeakSet;class Nte extends Qe{constructor(){super(...arguments),Ate(this,yl),Hi(this,Xn,new Pte(this.hot)),Hi(this,Js,new xte(this.hot)),Hi(this,ls,[]),Hi(this,Fm,0),Hi(this,ea,!1),Hi(this,Zn,{}),Hi(this,Vm,void 0),Hi(this,ii,void 0),Hi(this,Qu,void 0),Hi(this,Wm,void 0),Hi(this,bd,void 0)}static get PLUGIN_KEY(){return R0}static get PLUGIN_PRIORITY(){return Hte}isEnabled(){return!!this.hot.getSettings()[R0]}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 Qs(yl,e,Dte).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 Qs(yl,e,Lte).call(e,...r)}),this.addHook("afterScrollVertically",()=>Qs(yl,this,Fte).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 Qs(yl,e,Vte).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),Z(this.hot.rootElement,Ok),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){ye(this.hot.rootElement,Ok),this.unregisterEvents(),ge(Xn,this).destroy(),ge(Js,this).destroy(),super.disablePlugin()}moveColumn(e,n){return this.moveColumns([e],n)}moveColumns(e,n){const r=ge(Vm,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeColumnMove",e,n,r,i);if(mr(Vm,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 mr(Vm,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=ir(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()[R0];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 me(e,n,i=>{r.push(i)}),r}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(ge(ii,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,ge(ii,this)-1);const s=n.hider.offsetWidth,a=n.TBODY.offsetLeft,l=ge(Xn,this).getOffset().start,u=ge(Xn,this).getSize().width;let c=0,h=0;if(this.hot.isRtl()){const m=this.hot.rootWindow,S=tn(this.hot.rootElement),b=m.innerWidth-ge(Qu,this)-S;h=m.innerWidth-ge(Zn,this).eventPageX-b-(r.scrollX===void 0?i:0)}else h=ge(Zn,this).eventPageX-(ge(Qu,this)-(r.scrollX===void 0?i:0));if(ge(Wm,this)&&(c=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(ge(ii,this))&&(o+=i),o+=c,ge(ii,this)<0)ge(bd,this)>0?ge(Zn,this).col=0:ge(Zn,this).col=e>0?e-1:e;else if(ge(Zn,this).TD.offsetWidth/2+o<=h){const m=ge(ii,this)>=ge(Fm,this)?ge(Fm,this)-1:ge(ii,this);ge(Zn,this).col=m+1,o+=ge(Zn,this).TD.offsetWidth}else ge(Zn,this).col=ge(ii,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&&ge(ii,this)<ge(bd,this)&&(f-=ge(Qu,this)<=r.scrollX?ge(Qu,this):0),ge(Xn,this).setPosition(null,d),ge(Js,this).setPosition(null,f)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>Qs(yl,this,kte).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Qs(yl,this,$te).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){ge(Xn,this).build(),ge(Js,this).build()}destroy(){ge(Xn,this).destroy(),ge(Js,this).destroy(),super.destroy()}}function Dte(t,e,n,r){const i=this.hot.view._wt.wtTable,o=this.hot.selection.isSelectedByColumnHeader(),s=this.hot.getSelectedRangeLast(),a=Se(t.target,"sortAction");if(!s||!o||ge(ea,this)||t.button!==0||a){mr(ea,this,!1),ge(ls,this).length=0,ye(this.hot.rootElement,[E0,$m]);return}const l=ge(Js,this).isBuilt()&&!ge(Js,this).isAppended(),u=ge(Xn,this).isBuilt()&&!ge(Xn,this).isAppended();l&&u&&(ge(Js,this).appendTo(i.hider),ge(Xn,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,mr(ea,this,!0);const m=n.firstChild?cY(t,n.firstChild).x:t.offsetX;ge(Zn,this).eventPageX=t.pageX,mr(ii,this,e.col),ge(Zn,this).TD=n,ge(Zn,this).col=e.col,mr(ls,this,this.prepareColumnsToMoving(d,f)),mr(Wm,this,!!this.hot.getSettings().rowHeaders),mr(Fm,this,this.hot.countCols()),mr(bd,this,this.hot.getSettings().fixedColumnsStart),mr(Qu,this,Nn(this.hot.rootElement).left);const S=ge(Wm,this)?-1:0,b=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,T=e.col<ge(bd,this),v=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),O=Math.abs(m-(this.hot.isRtl()?n.offsetWidth:0)),P=this.getColumnsWidth(d,e.col-1)+O,_=this.getColumnsWidth(S,d-1)+(T?v:0)+P;ge(Xn,this).setPosition(b,_),ge(Xn,this).setSize(this.getColumnsWidth(d,f),i.hider.offsetHeight-b),ge(Xn,this).setOffset(null,-P),Z(this.hot.rootElement,E0)}else ye(this.hot.rootElement,T0),mr(ea,this,!1),ge(ls,this).length=0}function kte(t){ge(ea,this)&&(ge(Zn,this).eventPageX=t.pageX,this.refreshPositions())}function Lte(t,e,n,r){!this.hot.getSelectedRangeLast()||!ge(ea,this)||(ge(ls,this).indexOf(e.col)>-1?ye(this.hot.rootElement,$m):Z(this.hot.rootElement,$m),r.row=!0,r.column=!0,r.cell=!0,mr(ii,this,e.col),ge(Zn,this).TD=n)}function $te(){const t=ge(Zn,this).col,e=ge(ls,this).length;if(mr(ii,this,void 0),mr(ea,this,!1),ye(this.hot.rootElement,[E0,$m,T0]),this.hot.selection.isSelectedByColumnHeader()&&Z(this.hot.rootElement,T0),e<1||t===void 0)return;const n=ge(ls,this)[0],r=this.hot.toPhysicalColumn(n),i=this.dragColumns(ge(ls,this),t);if(ge(ls,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 Fte(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,n=t.holder.scrollTop,r=e+n;ge(Xn,this).setPosition(r),ge(Xn,this).setSize(null,t.hider.offsetHeight-r)}function Vte(){this.moveBySettingsOrLoad()}function Wte(t,e){xk(t,e),e.add(t)}function Fn(t,e,n){xk(t,e),e.set(t,n)}function xk(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(Ni(t,e),n),n}function le(t,e){return t.get(Ni(t,e))}function Ni(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 Bm="manualColumnResize",Bte=130,Ak="manualColumnWidths";var us=new WeakMap,jm=new WeakMap,Nr=new WeakMap,Um=new WeakMap,go=new WeakMap,jte=new WeakMap,Ju=new WeakMap,zm=new WeakMap,pr=new WeakMap,cs=new WeakMap,bl=new WeakMap,Ym=new WeakMap,Sd=new WeakMap,Rd=new WeakMap,Dr=new WeakMap,Ed=new WeakMap,mo=new WeakSet;class Ute extends Qe{static get PLUGIN_KEY(){return Bm}static get PLUGIN_PRIORITY(){return Bte}constructor(e){super(e),Wte(this,mo),Fn(this,us,null),Fn(this,jm,null),Fn(this,Nr,[]),Fn(this,Um,null),Fn(this,go,null),Fn(this,jte,null),Fn(this,Ju,null),Fn(this,zm,null),Fn(this,pr,this.hot.rootDocument.createElement("DIV")),Fn(this,cs,this.hot.rootDocument.createElement("DIV")),Fn(this,bl,null),Fn(this,Ym,!1),Fn(this,Sd,0),Fn(this,Rd,null),Fn(this,Dr,void 0),Fn(this,Ed,void 0),Z(le(pr,this),"manualColumnResizer"),Z(le(cs,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Bm]}enablePlugin(){var e=this;this.enabled||(Gt(Dr,this,new Hs),le(Dr,this).addLocalHook("init",()=>Ni(mo,this,zte).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,le(Dr,this)),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ni(mo,e,Zte).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 Ni(mo,e,Qte).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 Ni(mo,e,Jte).call(e,...r)}),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Gt(Ed,this,le(Dr,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",Ak,le(Dr,this).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",Ak,e),e.value}setManualSize(e,n){const r=Math.max(n,20),i=this.hot.toPhysicalColumn(e);return le(Dr,this).setValueAtIndex(i,r),r}clearManualSize(e){const n=this.hot.toPhysicalColumn(e);le(Dr,this).setValueAtIndex(n,null)}setupHandlePosition(e){if(!e.parentNode)return;Gt(us,this,e);const{_wt:n}=this.hot.view,r=n.wtTable.getCoords(le(us,this)),i=r.col;if(i<0)return;const o=cn(le(us,this)),s=le(us,this).getBoundingClientRect(),a=i<n.getSetting("fixedColumnsStart");let l;a&&(l=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(le(us,this),r.row,r.col)),l||(l=n.wtOverlays.topOverlay.getRelativeCellPosition(le(us,this),r.row,r.col)),Gt(jm,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),Gt(Nr,this,[]);const u=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&u){const c=this.hot.getSelectedRange();D(c,h=>{const d=h.getTopStartCorner().col,f=h.getBottomEndCorner().col;me(d,f,m=>{le(Nr,this).includes(m)||le(Nr,this).push(m)})})}le(Nr,this).includes(le(jm,this))||Gt(Nr,this,[le(jm,this)]),Gt(zm,this,l.start-6),Gt(Ju,this,parseInt(s.width,10)),le(pr,this).style.top=`${l.top}px`,le(pr,this).style[this.inlineDir]=`${le(zm,this)+le(Ju,this)}px`,le(pr,this).style.height=`${o}px`,this.hot.rootElement.appendChild(le(pr,this))}refreshHandlePosition(){le(pr,this).style[this.inlineDir]=`${le(zm,this)+le(Um,this)}px`}setupGuidePosition(){const e=parseInt(cn(le(pr,this)),10),n=parseInt(le(pr,this).style.top,10)+e,r=this.hot.view.getTableHeight();Z(le(pr,this),"active"),Z(le(cs,this),"active"),le(cs,this).style.top=`${n}px`,this.refreshGuidePosition(),le(cs,this).style.height=`${r-e}px`,this.hot.rootElement.appendChild(le(cs,this))}refreshGuidePosition(){le(cs,this).style[this.inlineDir]=le(pr,this).style[this.inlineDir]}hideHandleAndGuide(){ye(le(pr,this),"active"),ye(le(cs,this),"active")}checkIfColumnHeader(e){const n=Ta(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",le(go,this),r,!0);o!==void 0&&Gt(go,this,o),this.setManualSize(r,le(go,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",le(go,this),r,!0),i&&e()};le(Sd,this)>=2&&(le(Nr,this).length>1?(D(le(Nr,this),i=>{n(i)}),e()):D(le(Nr,this),i=>{n(i,!0)})),Gt(Sd,this,0),Gt(Rd,this,null)}bindEvents(){const{rootWindow:e,rootElement:n}=this.hot;this.eventManager.addEventListener(n,"mouseover",r=>Ni(mo,this,Yte).call(this,r)),this.eventManager.addEventListener(n,"mousedown",r=>Ni(mo,this,Gte).call(this,r)),this.eventManager.addEventListener(e,"mousemove",r=>Ni(mo,this,qte).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>Ni(mo,this,Kte).call(this)),this.eventManager.addEventListener(le(pr,this),"contextmenu",()=>Ni(mo,this,Xte).call(this))}destroy(){super.destroy()}}function zte(){const t=this.hot.getSettings()[Bm],e=this.loadManualColumnWidths();typeof e<"u"?this.hot.batchExecution(()=>{e.forEach((n,r)=>{le(Dr,this).setValueAtIndex(r,n)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((n,r)=>{le(Dr,this).setValueAtIndex(r,n)})},!0),Gt(Ed,this,t)):t===!0&&Array.isArray(le(Ed,this))&&this.hot.batchExecution(()=>{le(Ed,this).forEach((n,r)=>{le(Dr,this).setValueAtIndex(r,n)})},!0)}function Yte(t){if(!Ox(t.target)&&le(Ym,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")&&(le(bl,this)||this.setupHandlePosition(e))}}function Gte(t){t.target.parentNode===this.hot.rootElement&&Se(t.target,"manualColumnResizer")&&(this.setupHandlePosition(le(us,this)),this.setupGuidePosition(),Gt(bl,this,!0),le(Rd,this)===null&&(Gt(Rd,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(le(Rd,this))),Gt(Sd,this,le(Sd,this)+1),this.startX=t.pageX,Gt(go,this,le(Ju,this)))}function qte(t){if(le(bl,this)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();Gt(Um,this,le(Ju,this)+e),D(le(Nr,this),n=>{Gt(go,this,this.setManualSize(n,le(Um,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function Kte(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(n,r)=>{this.hot.runHooks("beforeColumnResize",le(go,this),n,!1),r&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",le(go,this),n,!1)};le(bl,this)&&(this.hideHandleAndGuide(),Gt(bl,this,!1),le(go,this)!==le(Ju,this)&&(le(Nr,this).length>1?(D(le(Nr,this),r=>{e(r)}),t()):D(le(Nr,this),r=>{e(r,!0)})),this.setupHandlePosition(le(us,this)))}function Xte(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(le(pr,this)),this.hot.rootElement.removeChild(le(cs,this)),Gt(bl,this,!1),Gt(Ym,this,!0),this.hot._registerImmediate(()=>{Gt(Ym,this,!1)})}function Zte(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalColumn(e),i=le(Dr,this).getValueAtIndex(r);this.hot.getSettings()[Bm]&&i&&(n=i)}return n}function Qte(t,e){const n=le(Dr,this).getValueAtIndex(this.hot.toPhysicalColumn(e));return typeof n=="number"?n:t}function Jte(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function _0(t,e,n){return(e=ene(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ene(t){var e=tne(t,"string");return typeof e=="symbol"?e:e+""}function tne(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 M0=0,Hk=1,Nk=2,ec="px";let Dk=class{constructor(e){_0(this,"hot",void 0),_0(this,"_element",null),_0(this,"state",M0),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=Nk}build(){this.state===M0&&(this._element=this.hot.rootDocument.createElement("div"),this.state=Hk)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=M0}isAppended(){return this.state===Nk}isBuilt(){return this.state>=Hk}setPosition(e,n){e!==void 0&&(this._element.style.top=e+ec),n!==void 0&&(this._element.style.left=n+ec)}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+ec),n&&(this._element.style.height=n+ec)}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+ec),n&&(this._element.style.marginLeft=n+ec)}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 nne="ht__manualRowMove--backlight";class rne extends Dk{build(){super.build(),Z(this._element,nne)}}const ine="ht__manualRowMove--guideline";class one extends Dk{build(){super.build(),Z(this._element,ine)}}function sne(t,e){kk(t,e),e.add(t)}function tc(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 Sl(t,e,n){return t.set(ta(t,e),n),n}function Me(t,e){return t.get(ta(t,e))}function ta(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")}oe.getSingleton().register("beforeRowMove"),oe.getSingleton().register("afterRowMove");const I0="manualRowMove",ane=140,Lk="ht__manualRowMove",Gm="show-ui",P0="on-moving--rows",O0="after-selection--rows";var Qn=new WeakMap,na=new WeakMap,hs=new WeakMap,ra=new WeakMap,wr=new WeakMap,qm=new WeakMap,Rl=new WeakSet;class lne extends Qe{constructor(){super(...arguments),sne(this,Rl),tc(this,Qn,new rne(this.hot)),tc(this,na,new one(this.hot)),tc(this,hs,[]),tc(this,ra,void 0),tc(this,wr,{}),tc(this,qm,void 0)}static get PLUGIN_KEY(){return I0}static get PLUGIN_PRIORITY(){return ane}isEnabled(){return!!this.hot.getSettings()[I0]}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 ta(Rl,e,une).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 ta(Rl,e,hne).call(e,...r)}),this.addHook("afterScrollHorizontally",()=>ta(Rl,this,fne).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 ta(Rl,e,gne).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),Z(this.hot.rootElement,Lk),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){ye(this.hot.rootElement,Lk),this.unregisterEvents(),Me(Qn,this).destroy(),Me(na,this).destroy(),super.disablePlugin()}moveRow(e,n){return this.moveRows([e],n)}moveRows(e,n){const r=Me(qm,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeRowMove",e,n,r,i);if(Sl(qm,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 Sl(qm,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=ir(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()[I0];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 me(o,s,a=>{n.push(a)}),n}refreshPositions(){const e=Me(wr,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=Me(wr,this).TD,a=this.hot.rootElement,l=Nn(a),u=qc(a),c=o.holder.scrollTop,h=this.hot.rootWindow!==u?u.scrollTop:0,d=l.top-h,f=Me(wr,this).eventPageY-d+c,m=o.hider.offsetHeight,S=o.TBODY.offsetTop,b=Me(Qn,this).getOffset().top,T=Me(Qn,this).getSize().height,v=s.offsetHeight/2,O=s.offsetHeight;let P=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const _=f>=P+v;this.isFixedRowTop(e.row)&&(P+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?Me(wr,this).row=n>0?n-1:n:_?(Me(wr,this).row=e.row+1,P+=e.row===0?O-1:O):Me(wr,this).row=e.row;let M=f,H=P;f+T+b>=m?M=m-T-b:f+b<S&&(M=S+Math.abs(b)),P>=m-1&&(H=m-1),Me(Qn,this).setPosition(M),Me(na,this).setPosition(H)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>ta(Rl,this,cne).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>ta(Rl,this,dne).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Me(Qn,this).build(),Me(na,this).build()}destroy(){Me(Qn,this).destroy(),Me(na,this).destroy(),super.destroy()}}function une(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||Me(ra,this)||t.button!==0){Sl(ra,this,!1),Me(hs,this).length=0,ye(this.hot.rootElement,[P0,Gm]);return}const l=Me(na,this).isBuilt()&&!Me(na,this).isAppended(),u=Me(Qn,this).isBuilt()&&!Me(Qn,this).isAppended();l&&u&&(Me(na,this).appendTo(i.hider),Me(Qn,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,Sl(ra,this,!0),Me(wr,this).eventPageY=t.pageY,Me(wr,this).coords=e,Me(wr,this).TD=n,Sl(hs,this,this.prepareRowsToMoving());const m=i.holder.scrollLeft+o.getRowHeaderWidth(),S=this.getRowsHeight(d,e.row-1)+(t.clientY-n.getBoundingClientRect().top);Me(Qn,this).setPosition(null,m),Me(Qn,this).setSize(i.hider.offsetWidth-m,this.getRowsHeight(d,f)),Me(Qn,this).setOffset(-S,null),Z(this.hot.rootElement,P0),this.refreshPositions()}else ye(this.hot.rootElement,O0),Sl(ra,this,!1),Me(hs,this).length=0}function cne(t){Me(ra,this)&&(Me(wr,this).eventPageY=t.pageY,this.refreshPositions())}function hne(t,e,n,r){!this.hot.getSelectedRangeLast()||!Me(ra,this)||(Me(hs,this).indexOf(e.row)>-1?ye(this.hot.rootElement,Gm):Z(this.hot.rootElement,Gm),r.row=!0,r.column=!0,r.cell=!0,Me(wr,this).coords=e,Me(wr,this).TD=n)}function dne(){const t=Me(wr,this).row,e=Me(hs,this).length;if(Sl(ra,this,!1),ye(this.hot.rootElement,[P0,Gm,O0]),this.hot.selection.isSelectedByRowHeader()&&Z(this.hot.rootElement,O0),e<1||t===void 0)return;const n=Me(hs,this)[0],r=this.hot.toPhysicalRow(n),i=this.dragRows(Me(hs,this),t);if(Me(hs,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 fne(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),n=t.holder.scrollLeft,r=e+n;Me(Qn,this).setPosition(null,r),Me(Qn,this).setSize(t.hider.offsetWidth-r)}function gne(){this.moveBySettingsOrLoad()}function mne(t,e){$k(t,e),e.add(t)}function Vn(t,e,n){$k(t,e),e.set(t,n)}function $k(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(ds(t,e),n),n}function se(t,e){return t.get(ds(t,e))}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 Km="manualRowResize",pne=30,Fk="manualRowHeights";var po=new WeakMap,Xm=new WeakMap,kr=new WeakMap,Td=new WeakMap,ia=new WeakMap,x0=new WeakMap,nc=new WeakMap,Zm=new WeakMap,Jn=new WeakMap,wo=new WeakMap,El=new WeakMap,Qm=new WeakMap,_d=new WeakMap,Md=new WeakMap,Di=new WeakMap,Id=new WeakMap,oa=new WeakSet;class wne extends Qe{static get PLUGIN_KEY(){return Km}static get PLUGIN_PRIORITY(){return pne}constructor(e){super(e),mne(this,oa),Vn(this,po,null),Vn(this,Xm,null),Vn(this,kr,[]),Vn(this,Td,null),Vn(this,ia,null),Vn(this,x0,null),Vn(this,nc,null),Vn(this,Zm,null),Vn(this,Jn,this.hot.rootDocument.createElement("DIV")),Vn(this,wo,this.hot.rootDocument.createElement("DIV")),Vn(this,El,!1),Vn(this,Qm,!1),Vn(this,_d,0),Vn(this,Md,null),Vn(this,Di,void 0),Vn(this,Id,void 0),Z(se(Jn,this),"manualRowResizer"),Z(se(wo,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Km]}enablePlugin(){this.enabled||($t(Di,this,new Hs),se(Di,this).addLocalHook("init",()=>ds(oa,this,Ene).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,se(Di,this)),this.addHook("modifyRowHeight",(e,n)=>ds(oa,this,Rne).call(this,e,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){$t(Id,this,se(Di,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",Fk,se(Di,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",Fk,e),e.value}setManualSize(e,n){const r=this.hot.toPhysicalRow(e),i=Math.max(n,this.hot.view.getDefaultRowHeight());return se(Di,this).setValueAtIndex(r,i),i}getLastDesiredRowHeight(){return se(Td,this)}setupHandlePosition(e){$t(po,this,e);const{view:n}=this.hot,{_wt:r}=n,i=r.wtTable.getCoords(se(po,this)),o=i.row;if(o<0)return;const s=tn(se(po,this)),a=se(po,this).getBoundingClientRect(),l=o<r.getSetting("fixedRowsTop"),u=o>=n.countNotHiddenRowIndexes(0,1)-r.getSetting("fixedRowsBottom");let c;l?c=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(se(po,this),i.row,i.col):u&&(c=r.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(se(po,this),i.row,i.col)),c||(c=r.wtOverlays.inlineStartOverlay.getRelativeCellPosition(se(po,this),i.row,i.col)),$t(Xm,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(o)),$t(kr,this,[]);const h=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&h){const d=this.hot.getSelectedRange();D(d,f=>{const m=f.getTopStartCorner().row,S=f.getBottomStartCorner().row;me(m,S,b=>{se(kr,this).includes(b)||se(kr,this).push(b)})})}se(kr,this).includes(se(Xm,this))||$t(kr,this,[se(Xm,this)]),$t(Zm,this,c.top-6),$t(nc,this,parseInt(a.height,10)),se(Jn,this).style.top=`${se(Zm,this)+se(nc,this)}px`,se(Jn,this).style[this.inlineDir]=`${c.start}px`,se(Jn,this).style.width=`${s}px`,this.hot.rootElement.appendChild(se(Jn,this))}refreshHandlePosition(){se(Jn,this).style.top=`${se(Zm,this)+se(Td,this)}px`}setupGuidePosition(){const e=parseInt(tn(se(Jn,this)),10),n=parseInt(se(Jn,this).style[this.inlineDir],10)+e,r=this.hot.view.getTableWidth();Z(se(Jn,this),"active"),Z(se(wo,this),"active"),se(wo,this).style.top=se(Jn,this).style.top,se(wo,this).style[this.inlineDir]=`${n}px`,se(wo,this).style.width=`${r-e}px`,this.hot.rootElement.appendChild(se(wo,this))}refreshGuidePosition(){se(wo,this).style.top=se(Jn,this).style.top}hideHandleAndGuide(){ye(se(Jn,this),"active"),ye(se(wo,this),"active")}checkIfRowHeader(e){const n=Ta(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&&se(ia,this)<n?n:se(ia,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(ia,this,o),this.setManualSize(r,se(ia,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!0),i&&e()};se(_d,this)>=2&&(se(kr,this).length>1?(D(se(kr,this),i=>{n(i)}),e()):D(se(kr,this),i=>{n(i,!0)})),$t(_d,this,0),$t(Md,this,null)}bindEvents(){const{rootElement:e,rootWindow:n}=this.hot;this.eventManager.addEventListener(e,"mouseover",r=>ds(oa,this,vne).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>ds(oa,this,Cne).call(this,r)),this.eventManager.addEventListener(n,"mousemove",r=>ds(oa,this,yne).call(this,r)),this.eventManager.addEventListener(n,"mouseup",()=>ds(oa,this,bne).call(this)),this.eventManager.addEventListener(se(Jn,this),"contextmenu",()=>ds(oa,this,Sne).call(this))}destroy(){super.destroy()}}function vne(t){if(!Ox(t.target)&&se(Qm,this)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(se(El,this)||this.setupHandlePosition(e))}}function Cne(t){Se(t.target,"manualRowResizer")&&(this.setupHandlePosition(se(po,this)),this.setupGuidePosition(),$t(El,this,!0),se(Md,this)===null&&($t(Md,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(se(Md,this))),$t(_d,this,se(_d,this)+1),$t(x0,this,t.pageY),$t(ia,this,se(nc,this)))}function yne(t){se(El,this)&&($t(Td,this,se(nc,this)+(t.pageY-se(x0,this))),D(se(kr,this),e=>{$t(ia,this,this.setManualSize(e,se(Td,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function bne(){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)};se(El,this)&&(this.hideHandleAndGuide(),$t(El,this,!1),se(ia,this)!==se(nc,this)&&(se(kr,this).length>1?(D(se(kr,this),r=>{e(r)}),t()):D(se(kr,this),r=>{e(r,!0)})),this.setupHandlePosition(se(po,this)))}function Sne(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(se(Jn,this)),this.hot.rootElement.removeChild(se(wo,this)),$t(El,this,!1),$t(Qm,this,!0),this.hot._registerImmediate(()=>{$t(Qm,this,!1)})}function Rne(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalRow(e),i=se(Di,this).getValueAtIndex(r);this.hot.getSettings()[Km]&&i&&(n=i)}return n}function Ene(){const t=this.hot.getSettings()[Km],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e<"u"?e.forEach((n,r)=>{se(Di,this).setValueAtIndex(r,n)}):Array.isArray(t)?(t.forEach((n,r)=>{se(Di,this).setValueAtIndex(r,n)}),$t(Id,this,t)):t===!0&&Array.isArray(se(Id,this))&&se(Id,this).forEach((n,r)=>{se(Di,this).setValueAtIndex(r,n)})},!0)}var Vk={},Wk;function Tne(){if(Wk)return Vk;Wk=1;var t=Kf();return t("flatMap"),Vk}Tne();var Bk={},jk={},A0,Uk;function _ne(){if(Uk)return A0;Uk=1;var t=An(),e=sn(),n=Bi(),r=fC();return A0=function(i,o){(!o||typeof i!="string")&&e(i);var s=r(i);return n(e(s!==void 0?t(s,i):i))},A0}var zk;function Mne(){if(zk)return jk;zk=1;var t=Ct(),e=An(),n=nr(),r=sn(),i=Bi(),o=_ne(),s=sC(),a=Fl(),l=ys(),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})}}),jk}var Yk;function Ine(){return Yk||(Yk=1,Mne()),Bk}Ine();function Pne(t,e,n){One(t,e),e.set(t,n)}function One(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tl(t,e,n){return(e=xne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xne(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 Gk(t,e){return t.get(qk(t,e))}function Jm(t,e,n){return t.set(qk(t,e),n),n}function qk(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 _l=new WeakMap;class vo{constructor(e,n,r,i,o,s){Tl(this,"row",void 0),Tl(this,"col",void 0),Tl(this,"rowspan",void 0),Tl(this,"colspan",void 0),Tl(this,"removed",!1),Tl(this,"cellCoordsFactory",void 0),Tl(this,"cellRangeFactory",void 0),Pne(this,_l,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 it`The merged cell declared with {row: ${n}, col: ${r},\x20
|
|
68
|
-
rowspan: ${i}, colspan: ${o}} contains negative values, which is\x20
|
|
69
|
-
not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){let{row:n,col:r}=e;return it`The merged cell declared at [${n}, ${r}] is positioned\x20
|
|
70
|
-
(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 it`The merged cell declared at [${n}, ${r}] has both "rowspan"\x20
|
|
71
|
-
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 it`The merged cell declared at [${n}, ${r}] has "rowspan"\x20
|
|
72
|
-
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),Jm(_l,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,Jm(_l,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 Jm(_l,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 Gk(_l,this)||Jm(_l,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),Gk(_l,this)}}function Hne(t,e){Nne(t,e),e.add(t)}function Nne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ep(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=kne(t,"string");return typeof e=="symbol"?e:e+""}function kne(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 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 sa=new WeakSet;class tp{constructor(e){Hne(this,sa),ep(this,"plugin",void 0),ep(this,"mergedCells",[]),ep(this,"mergedCellsMatrix",new Map),ep(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:n,col:r}=e;return it`The merged cell declared at [${n}, ${r}], overlaps\x20
|
|
73
|
-
with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
|
|
74
|
-
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)){rt(tp.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 vo(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),Ml(sa,this,Kk).call(this,a),a):(u&&rt(tp.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),Ml(sa,this,Lne).call(this,r),r):!1}clear(){D(this.mergedCells,e=>{let{row:n,col:r,rowspan:i,colspan:o}=e;me(n,n+i,s=>{me(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=Ye(u,i,i+s-1),d=Ye(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=Ml(sa,this,np).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=Ml(sa,this,np).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=Ml(sa,this,np).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=Ml(sa,this,np).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=>{Ml(sa,this,Kk).call(this,s)})}}function np(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 Kk(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 H0(t,e,n){return(e=$ne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $ne(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 Vne{constructor(e){H0(this,"plugin",void 0),H0(this,"mergedCellsCollection",void 0),H0(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,S=this.getFarthestCollection(e,n,r,i);if(S){if(r==="down"){const b=S.row+S.rowspan-a-m;o[2]+b>=this.plugin.hot.countRows()?o[2]-=m:o[2]+=m?b:0}else if(r==="right"){const b=S.col+S.colspan-l-m;o[3]+b>=this.plugin.hot.countCols()?o[3]-=m:o[3]+=m?b:0}else if(r==="up"){const b=u-m-S.row+1;o[0]+b<0?o[0]+=m:o[0]-=m?b:0}else if(r==="left"){const b=c-m-S.col+1;o[1]+b<0?o[1]+=m:o[1]-=m?b:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:r,foundMergedCells:i,fillSize:s,dragArea:o,cycleLength:d}),o}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),an(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,S=d-m;let b=null,T=null,v=null;switch(r){case"up":b="includesVertically",v=c-S+1;break;case"left":b="includesHorizontally",v=c-S+1;break;case"down":b="includesVertically",v=h+S-1;break;case"right":b="includesHorizontally",v=h+S-1;break}return D(i,O=>{O[b](v)&&O.isFarther(T,r)&&(T=O)}),T}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 D(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:S}=m;return S===h.getWidth()}):!f.every(m=>{let{rowspan:S}=m;return S===h.getHeight()})}}function N0(t,e,n){return(e=Wne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wne(t){var e=Bne(t,"string");return typeof e=="symbol"?e:e+""}function Bne(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 jne{constructor(e){N0(this,"plugin",void 0),N0(this,"hot",void 0),N0(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 Une(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(Ib)},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?vo.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 Pd(t,e,n){return(e=zne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zne(t){var e=Yne(t,"string");return typeof e=="symbol"?e:e+""}function Yne(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){Pd(this,"data",void 0),Pd(this,"next",null),Pd(this,"prev",null),this.data=e}}class rp{constructor(){Pd(this,"first",null),Pd(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 Gne(t,e){Zk(t,e),e.add(t)}function Il(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 ot(t,e){return t.get(ip(t,e))}function Lr(t,e,n){return t.set(ip(t,e),n),n}function ip(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 Co=new WeakMap,yo=new WeakMap,bo=new WeakMap,So=new WeakMap,D0=new WeakMap,op=new WeakMap,sp=new WeakMap,k0=new WeakSet;class qne{constructor(e){let{mergedCellsGetter:n,rowIndexMapper:r,columnIndexMapper:i}=e;Gne(this,k0),Il(this,Co,new rp),Il(this,yo,new rp),Il(this,bo,null),Il(this,So,null),Il(this,D0,null),Il(this,op,null),Il(this,sp,null),Lr(D0,this,n),Lr(op,this,r),Lr(sp,this,i)}getCurrentVerticalNode(){return ot(So,this).data}getFirstVerticalNode(){return ot(yo,this).first.data}getNextVerticalNode(){return ot(So,this).next.data}getPrevVerticalNode(){return ot(So,this).prev.data}getCurrentHorizontalNode(){return ot(bo,this).data}getFirstHorizontalNode(){return ot(Co,this).first.data}getNextHorizontalNode(){return ot(bo,this).next.data}getPrevHorizontalNode(){return ot(bo,this).prev.data}setPrevNodeAsActive(){Lr(So,this,ot(So,this).prev),Lr(bo,this,ot(bo,this).prev)}setNextNodeAsActive(){Lr(So,this,ot(So,this).next),Lr(bo,this,ot(bo,this).next)}buildFocusOrder(e){const n=e.getTopStartCorner(),r=e.getBottomEndCorner(),i=new WeakSet;Lr(Co,this,new rp);for(let s=n.row;s<=r.row;s++)if(!ot(op,this).isHidden(s))for(let a=n.col;a<=r.col;a++){if(ot(sp,this).isHidden(a))continue;const l=ip(k0,this,Qk).call(this,e,ot(Co,this),i,s,a);l&&Lr(bo,this,l)}ot(Co,this).first&&(ot(Co,this).first.prev=ot(Co,this).last,ot(Co,this).last.next=ot(Co,this).first);const o=new WeakSet;Lr(yo,this,new rp);for(let s=n.col;s<=r.col;s++)if(!ot(sp,this).isHidden(s))for(let a=n.row;a<=r.row;a++){if(ot(op,this).isHidden(a))continue;const l=ip(k0,this,Qk).call(this,e,ot(yo,this),o,a,s);l&&Lr(So,this,l)}ot(yo,this).first&&(ot(yo,this).first.prev=ot(yo,this).last,ot(yo,this).last.next=ot(yo,this).first)}setActiveNode(e,n){return ot(Co,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return Lr(bo,this,r),!1}),ot(yo,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return Lr(So,this,r),!1}),this}}function Qk(t,e,n,r,i){const o=t.getTopStartCorner(),s=t.getBottomEndCorner(),a=t.highlight.clone().normalize(),l=ot(D0,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 Jk(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 Kne(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(!De(c)){a.removeAttribute("rowspan"),a.removeAttribute("colspan"),Vf()&&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,[S,b]=t.translateMergedCellToRenderable(h,m,d,f),T=t.getSetting("virtualized");if(Vf()&&d===0&&!e.getSettings().rowHeaders){const U=Jk(e,h,m);i.set(l,U/m)}const v=n.getRenderableFromVisualIndex(l),O=r.getRenderableFromVisualIndex(u),P=S-v+1,_=b-O+1;let M=n.getNearestNotHiddenIndex(h,1),H=r.getNearestNotHiddenIndex(d,1);if(T){const U=e.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(U)||(M=Math.max(M,e.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(U)||(H=Math.max(H,e.getFirstRenderedVisibleColumn()))}const X=Math.min(m,P),G=Math.min(f,_);M===l&&H===u?(a.setAttribute("rowspan",X),a.setAttribute("colspan",G)):(a.removeAttribute("rowspan"),a.removeAttribute("colspan"),a.style.display="none")}return{before:o,after:s}}function Xne(t,e){eL(t,e),e.add(t)}function ap(t,e,n){eL(t,e),e.set(t,n)}function eL(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=Zne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zne(t){var e=Qne(t,"string");return typeof e=="symbol"?e:e+""}function Qne(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 Od(t,e,n){return t.set(ut(t,e),n),n}function yt(t,e){return t.get(ut(t,e))}function ut(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")}oe.getSingleton().register("beforeMergeCells"),oe.getSingleton().register("afterMergeCells"),oe.getSingleton().register("beforeUnmergeCells"),oe.getSingleton().register("afterUnmergeCells");const $0="mergeCells",Jne=150,tL=$0;var oi=new WeakMap,si=new WeakMap,Ro=new WeakMap,nL=new WeakMap,mt=new WeakSet;class ere extends Qe{constructor(){super(...arguments),Xne(this,mt),L0(this,"mergedCellsCollection",null),L0(this,"autofillCalculations",null),L0(this,"selectionCalculations",null),ap(this,oi,null),ap(this,si,{row:0,col:0}),ap(this,Ro,new qne({mergedCellsGetter:(e,n)=>this.mergedCellsCollection.get(e,n),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),ap(this,nL,Kne(this))}static get PLUGIN_KEY(){return $0}static get PLUGIN_PRIORITY(){return Jne}static get DEFAULT_SETTINGS(){return{[dH]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[$0]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new tp(this),this.autofillCalculations=new Vne(this),this.selectionCalculations=new jne(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ut(mt,e,tre).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 ut(mt,e,rre).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 ut(mt,e,ire).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 ut(mt,e,ore).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 ut(mt,e,sre).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 ut(mt,e,iL).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 ut(mt,e,iL).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 ut(mt,e,lre).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 ut(mt,e,ure).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 ut(mt,e,cre).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 ut(mt,e,rL).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 ut(mt,e,rL).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 ut(mt,e,nre).call(e,...r)}),this.addHook("afterRenderer",function(){return yt(nL,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 ut(mt,e,are).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 ut(mt,e,hre).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 ut(mt,e,dre).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 ut(mt,e,fre).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 ut(mt,e,gre).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 ut(mt,e,mre).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 ut(mt,e,pre).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 ut(mt,e,wre).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 ut(mt,e,vre).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 ut(mt,e,Cre).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 ut(mt,e,yre).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 ut(mt,e,bre).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 ut(mt,e,Sre).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 ut(mt,e,Rre).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 ut(mt,e,Ere).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(!Nx())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=Nf(s,"backgroundColor").replace(")",", 0.99)"),e.push(s))})}),this.hot._registerTimeout(()=>{e.forEach(r=>{var i;r.style.background=(i=Nf(r,"backgroundColor"))===null||i===void 0?void 0:i.replace(", 0.99)",")")})},1)}validateSetting(e){return e?vo.containsNegativeValues(e)?(rt(vo.NEGATIVE_VALUES_WARNING(e)),!1):vo.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(rt(vo.IS_OUT_OF_BOUNDS_WARNING(e)),!1):vo.isSingleCell(e)?(rt(vo.IS_SINGLE_CELL(e)),!1):vo.containsZeroSpan(e)?(rt(vo.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),me(0,s.rowspan-1,c=>{me(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),D(r,i=>{this.mergedCellsCollection.remove(i.row,i.col),me(0,i.rowspan-1,o=>{me(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:tL})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(tL)}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(De(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(De(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(De(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(De(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 tre(){this.generateFromSettings(),this.hot.render()}function nre(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 rre(t){yt(si,this).row=t.row,yt(si,this).col=t.col}function ire(t){const e=this.hot.getSelectedRangeLast(),{highlight:n}=e,{columnIndexMapper:r,rowIndexMapper:i}=this.hot;yt(oi,this)&&(i.getRenderableFromVisualIndex(yt(oi,this).row)!==null&&(n.row=yt(oi,this).row),r.getRenderableFromVisualIndex(yt(oi,this).col)!==null&&(n.col=yt(oi,this).col),Od(oi,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 ore(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 sre(){const t=this.hot.getSelectedRangeLast(),{highlight:e}=t;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){Od(oi,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);Od(oi,this,e.clone()),n&&e.assign(n)}function rL(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(),S=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleColumn();return[Ye(m,u,h),Ye(S,c,d),Ye(this.hot.getLastRenderedVisibleRow(),u,h),Ye(this.hot.getLastRenderedVisibleColumn(),c,d)]}return[u,c,h,d]}function are(t){t.items.push({name:"---------"},Une(this))}function iL(){Od(oi,this,null)}function lre(){if(yt(oi,this).isCell())return;const t=this.hot.getSelectedRangeLast(),e=t.getVerticalDirection(),n=t.getHorizontalDirection(),r=yt(oi,this).clone().normalize();yt(Ro,this).setActiveNode(r.row,r.col),yt(si,this).row>0||yt(si,this).col>0?yt(Ro,this).setPrevNodeAsActive():(n==="E-W"&&yt(si,this).col<0||e==="S-N"&&yt(si,this).row<0)&&yt(Ro,this).setNextNodeAsActive()}function ure(t,e){const n=this.hot.getSelectedRangeLast(),{columnIndexMapper:r,rowIndexMapper:i}=this.hot;let o=null,s=null;if(yt(si,this).col<0){const{rowEnd:a,colEnd:l}=yt(Ro,this).getPrevHorizontalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(yt(si,this).col>0){const{rowStart:a,colStart:l}=yt(Ro,this).getNextHorizontalNode();s=r.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}else if(yt(si,this).row<0){const{rowEnd:a,colEnd:l}=yt(Ro,this).getPrevVerticalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(yt(si,this).row>0){const{rowStart:a,colStart:l}=yt(Ro,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()}yt(Ro,this).setActiveNode(t,e),Od(si,this,{row:0,col:0})}function cre(){this.hot.getSelectedRangeLast().isHeader()||yt(Ro,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function hre(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 dre(t){if(this.getSetting("virtualized"))return;const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function fre(t){if(this.getSetting("virtualized"))return;const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function gre(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 mre(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function pre(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function wre(t,e,n){n!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function vre(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function Cre(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function yre(t,e){if(e&&e==="area"){const n=this.hot.getSelectedRangeLast(),r=this.mergedCellsCollection.getWithinRange(n);D(r,i=>{n.getBottomEndCorner().row===i.getLastRow()&&n.getBottomEndCorner().col===i.getLastColumn()&&(t[2]=i.row,t[3]=i.col)})}}function bre(t,e,n,r){if(n)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,n,r)}function Sre(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function Rre(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 Ere(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,Jk(this.hot,e,m))}),t}function Tre(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:q1(u.type))(l,u,d)(c,h);if(m===so){const S=a+1;if(typeof e[S]<"u")return s(S)}return m})(0)}}const oL="sort";function _re(t,e,n){const r=[];return n===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&r.push(`${oL}-${t.getIndexOfColumnInSortQueue(e)+1}`),r}function Mre(t){const e=t.className.split(" "),n=new RegExp(`^${oL}-[0-9]{1,2}$`);return e.filter(r=>n.test(r))}function Ire(t,e,n){return(e=Pre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pre(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 lp="multiColumnSorting",xre=170,sL=lp;G1(lp,Tre);class Are extends oN{constructor(){super(...arguments),Ire(this,"pluginKey",lp)}static get PLUGIN_KEY(){return lp}static get PLUGIN_PRIORITY(){return xre}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,Ag)),!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:Is,position:"before",group:sL})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(sL)}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),ye(e,Mre(e)),this.enabled!==!1&&Z(e,_re(...r))}onAfterOnCellMouseDown(e,n){zR(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,Ag))):this.sort(this.getColumnNextConfig(n.col)))}}function aL(t,e,n){return(e=Hre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hre(t){var e=Nre(t,"string");return typeof e=="symbol"?e:e+""}function Nre(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 Dre="multipleSelectionHandles",kre=160;class Lre extends Qe{constructor(){super(...arguments),aL(this,"dragged",[]),aL(this,"lastSetCell",null)}static get PLUGIN_KEY(){return Dre}static get PLUGIN_PRIORITY(){return kre}isEnabled(){return Wo()}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(Se(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(Se(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(Se(i.target,"topSelectionHandle-HitArea"))return r.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(Se(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 F0(){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 lL(){return{label:"",isPlaceholder:!0}}function $re(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const n=[];if(e===0)return n;D(t,i=>{const o=[];let s=0;n.push(o),D(i,a=>{const l=F0();if(De(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(lL());return!u})});const r=Math.max(...ze(n,i=>i.length));return D(n,i=>{if(i.length<r){const o=ze(new Array(r-i.length),()=>F0());i.splice(i.length,0,...o)}}),n}function V0(t,e,n){Fre(t,e),e.set(t,n)}function Fre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ki(t,e){return t.get(uL(t,e))}function xd(t,e,n){return t.set(uL(t,e),n),n}function uL(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 cL=["label","collapsible"];var fs=new WeakMap,Pl=new WeakMap,W0=new WeakMap;class Vre{constructor(){V0(this,fs,[]),V0(this,Pl,0),V0(this,W0,1/0)}setColumnsLimit(e){xd(W0,this,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];xd(fs,this,$re(e,ki(W0,this))),xd(Pl,this,ki(fs,this).length)}getData(){return ki(fs,this)}mergeWith(e){D(e,n=>{let{row:r,col:i,...o}=n;const s=this.getHeaderSettings(r,i);s!==null&&an(s,o,cL)})}map(e){D(ki(fs,this),n=>{D(n,r=>{const i=e({...r});De(i)&&an(r,i,cL)})})}getHeaderSettings(e,n){var r;if(e>=ki(Pl,this)||e<0)return null;const i=ki(fs,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>=ki(Pl,this)||e<0)return i;const o=ki(fs,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 ki(Pl,this)}getColumnsCount(){return ki(Pl,this)>0?ki(fs,this)[0].length:0}clear(){xd(fs,this,[]),xd(Pl,this,0)}}function B0(t,e,n){return(e=Wre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wre(t){var e=Bre(t,"string");return typeof e=="symbol"?e:e+""}function Bre(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 hL="DF-pre-order";function dL(t,e){let n=t.call(e,this);for(let r=0;r<this.childs.length;r++){if(n===!1)return!1;n=dL.call(this.childs[r],t,e)}return n}const jre="DF-post-order";function fL(t,e){for(let n=0;n<this.childs.length;n++)if(fL.call(this.childs[n],t,e)===!1)return!1;return t.call(e,this)}const gL="BF";function Ure(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 zre=gL,mL=new Map([[hL,dL],[jre,fL],[gL,Ure]]);class up{constructor(e){B0(this,"data",{}),B0(this,"parent",null),B0(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 up({...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]:zre;if(!mL.has(n))throw new Error(`Traversal strategy "${n}" does not exist`);mL.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 j0(t,e,n){Yre(t,e),e.set(t,n)}function Yre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function er(t,e){return t.get(pL(t,e))}function Gre(t,e,n){return t.set(pL(t,e),n),n}function pL(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 rc=new WeakMap,Ol=new WeakMap,ic=new WeakMap;class qre{constructor(e){j0(this,rc,new Map),j0(this,Ol,new Map),j0(this,ic,null),Gre(ic,this,e)}getRoots(){return Array.from(er(rc,this).values())}getRootByColumn(e){let n;return er(Ol,this).has(e)&&(n=er(rc,this).get(er(Ol,this).get(e))),n}getNode(e,n){const r=this.getRootByColumn(n);if(!r)return;const i=n-er(Ol,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;er(Ol,this).clear(),D(er(rc,this),n=>{let[,{data:{colspan:r}}]=n;for(let i=e;i<e+r;i++)er(Ol,this).set(i,e);e+=r})}buildTree(){this.clear();const e=er(ic,this).getColumnsCount();let n=0;for(;n<e;){const r=er(ic,this).getHeaderSettings(0,n),i=new up;er(rc,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=er(ic,this).getHeadersSettings(r,n,i);r+=1,D(o,s=>{const a={...s,headerLevel:r-1,columnIndex:n};let l;r===1?(e.data=a,l=e):(l=new up(a),e.addChild(l)),r<er(ic,this).getLayersCount()&&this.buildLeaves(l,n,r,s.origColspan),n+=s.origColspan})}clear(){er(rc,this).clear(),er(Ol,this).clear()}}function wL(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 cp(t,e){let{childs:n}=t;if(n.length!==0)return n[0].data[e]}function hp(t){return cp(t,"origColspan")===t.data.origColspan}function U0(t){const{data:e,childs:n}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(hp(t))return U0(n[0]);e.isCollapsed=!1;const i=n.slice(1),o=new Set;let s=0;if(i.length>0)D(i,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;s+=l.colspan,wL(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):hp(a)&&(l.isCollapsed=cp(a,"isCollapsed"))}),{rollbackModification:()=>z0(t),affectedColumns:Array.from(o),colspanCompensation:s}}function z0(t){var e;const{data:n,childs:r}=t;if(n.isCollapsed||n.isHidden||n.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(hp(t))return z0(r[0]);n.isCollapsed=!0;const o=r.slice(1),s=new Set;if(o.length>0)D(o,l=>{wL(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=cp(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):hp(l)&&(u.isCollapsed=cp(l,"isCollapsed"))}),{rollbackModification:()=>U0(t),affectedColumns:Array.from(s),colspanCompensation:a}}function Kre(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(it`The passed node is not the last node on the tree. Only for\x20
|
|
75
|
-
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 Xre(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(it`The passed node is not the last node on the tree. Only for\x20
|
|
76
|
-
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 vL=new Map([["collapse",z0],["expand",U0],["hide-column",Kre],["show-column",Xre]]);function Zre(t,e,n){if(!vL.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return vL.get(t)(e,n)}function dp(t){const e=[];return D(t,n=>{n.walkDown(r=>{const i=r.data,{origColspan:o,columnIndex:s,headerLevel:a,crossHiddenColumns:l}=i,u=Jre(e,a);let c=!1;for(let h=s;h<s+o;h++)if(l.includes(h)||c)u.push(lL());else{const f=Qre(i);f.isRoot=!0,u.push(f),c=!0}})}),e}function Qre(t){const{crossHiddenColumns:e,...n}=F0(t);return n}function Jre(t,e){let n;return Array.isArray(t[e])?n=t[e]:(n=[],t[e]=n),n}function Y0(t,e,n){eie(t,e),e.set(t,n)}function eie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ad(t,e,n){return t.set(CL(t,e),n),n}function Ft(t,e){return t.get(CL(t,e))}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 Eo=new WeakMap,vr=new WeakMap,xl=new WeakMap;class tie{constructor(){Y0(this,Eo,new Vre),Y0(this,vr,new qre(Ft(Eo,this))),Y0(this,xl,[[]])}setState(e){Ft(Eo,this).setData(e);let n=!1;try{Ft(vr,this).buildTree()}catch{Ft(vr,this).clear(),Ft(Eo,this).clear(),n=!0}return Ad(xl,this,dp(Ft(vr,this).getRoots())),n}setColumnsLimit(e){Ft(Eo,this).setColumnsLimit(e)}mergeStateWith(e){const n=ze(e,r=>{let{row:i,...o}=r;return{row:i<0?this.rowCoordsToLevel(i):i,...o}});Ft(Eo,this).mergeWith(n),Ft(vr,this).buildTree(),Ad(xl,this,dp(Ft(vr,this).getRoots()))}mapState(e){Ft(Eo,this).map(e),Ft(vr,this).buildTree(),Ad(xl,this,dp(Ft(vr,this).getRoots()))}mapNodes(e){return ir(Ft(vr,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(vr,this).getNode(n,r);let o;return i&&(o=Zre(e,i,r),Ad(xl,this,dp(Ft(vr,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(xl,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(vr,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(vr,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)},hL)}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(Eo,this).getLayersCount()}getColumnsCount(){return Ft(Eo,this).getColumnsCount()}clear(){Ad(xl,this,[]),Ft(Eo,this).clear(),Ft(vr,this).clear()}}function Hd(t,e,n){return(e=nie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nie(t){var e=rie(t,"string");return typeof e=="symbol"?e:e+""}function rie(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 iie{constructor(e,n){Hd(this,"hot",void 0),Hd(this,"nestedHeaderSettingsGetter",void 0),Hd(this,"layersCount",0),Hd(this,"container",void 0),Hd(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>'),tu(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 oie(t,e){bL(t,e),e.add(t)}function yL(t,e,n){return(e=sie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sie(t){var e=aie(t,"string");return typeof e=="symbol"?e:e+""}function aie(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 Nd(t,e,n){bL(t,e),e.set(t,n)}function bL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gs(t,e,n){return t.set(Vt(t,e),n),n}function Be(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 SL="nestedHeaders",lie=280;var ct=new WeakMap,aa=new WeakMap,Dd=new WeakMap,fp=new WeakMap,gp=new WeakMap,qt=new WeakSet;class uie extends Qe{constructor(){super(...arguments),oie(this,qt),Nd(this,ct,new tie),Nd(this,aa,null),Nd(this,Dd,null),Nd(this,fp,!1),Nd(this,gp,null),yL(this,"ghostTable",new iie(this.hot,(e,n)=>this.getHeaderSettings(e,n))),yL(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return SL}static get PLUGIN_PRIORITY(){return lie}isEnabled(){return!!this.hot.getSettings()[SL]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();(!Array.isArray(n)||!Array.isArray(n[0]))&&rt(it`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
|
|
77
|
-
passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>Vt(qt,this,Tie).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,_ie).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,fie).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,gie).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,mie).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,pie).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,wie).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,vie).call(e,...i)}),this.addHook("afterSelection",()=>Vt(qt,this,mp).call(this)),this.addHook("afterSelectionFocusSet",()=>Vt(qt,this,mp).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,cie).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",r=>Vt(qt,this,yie).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,Sie).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,Rie).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,hie).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,die).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,Cie).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,bie).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,Eie).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>Vt(qt,this,mp).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>Vt(qt,this,mp).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();Be(ct,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=Be(ct,this).setState(e)),this.detectedOverlappedHeaders&&rt(it`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
|
|
78
|
-
is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((n,r)=>{const i=n===!0?"hide-column":"show-column";Be(ct,this).triggerColumnModification(i,r)}),!Be(aa,this)&&this.enabled&&gs(aa,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";Be(ct,this).triggerColumnModification(a,o)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),Be(ct,this).clear(),Be(aa,this).unsubscribe(),gs(aa,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return Be(ct,this)}getLayersCount(){return Be(ct,this).getLayersCount()}getHeaderSettings(e,n){return Be(ct,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"),ye(a.childNodes[c],"hiddenHeader"),l&&l.childNodes[c]&&(l.childNodes[c].removeAttribute("colspan"),ye(l.childNodes[c],"hiddenHeader")),o&&u&&u.childNodes[c]&&(u.childNodes[c].removeAttribute("colspan"),ye(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"),ye(o,"hiddenHeader"),ye(o,"hiddenHeaderText");const{colspan:c,isHidden:h,isPlaceholder:d,headerClassNames:f}=(s=Be(ct,this).getHeaderSettings(e,u))!==null&&s!==void 0?s:{};if(d||h)Z(o,"hiddenHeader");else if(c>1){var m,S,b;const{wtOverlays:T}=l._wt,v=(m=T.topInlineStartCornerOverlay)===null||m===void 0?void 0:m.clone.wtTable.THEAD.contains(o),O=(S=T.inlineStartOverlay)===null||S===void 0?void 0:S.clone.wtTable.THEAD.contains(o);!((b=T.topOverlay)===null||b===void 0)&&b.clone.wtTable.THEAD.contains(o)&&u<r&&Z(o,"hiddenHeaderText");const _=v||O?Math.min(c,r-i):c;_>1&&o.setAttribute("colspan",_)}if(this.hot.view.appendColHeader(u,o,function(){return n.getColumnHeaderValue(...arguments)},e),!d&&!h){const T=o.querySelector("div.relative");T&&f&&f.length>0&&(ye(T,this.hot.getColumnMeta(u).headerClassName),Z(T,f))}}}getColumnHeaderValue(e,n){var r;const{isHidden:i,isPlaceholder:o}=(r=Be(ct,this).getHeaderSettings(n,e))!==null&&r!==void 0?r:{};return o||i?"":this.hot.getColHeader(e,n)}destroy(){gs(ct,this,null),Be(aa,this)!==null&&(Be(aa,this).unsubscribe(),gs(aa,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return Be(ct,this).getHeaderTreeNodeData(e.row,e.col)}}function mp(){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=Be(ct,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 cie(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=Be(gp,this))===null||n===void 0?void 0:n.row,l=s?t:i.col,u=a<0&&l>=0;if(gs(gp,this,null),!u)return t;const c=this.hot.getFirstFullyVisibleColumn(),h=this.hot.getLastFullyVisibleColumn(),d=h-c+1,f=Be(ct,this).findLeftMostColumnIndex(a,l),m=Be(ct,this).findRightMostColumnIndex(a,l),S=m-f+1;if(f<c&&m>h)return f;if(s){let b=null;return f>=c&&m>h?S>d?(e.value="start",b=f):(e.value="end",b=m):f<c&&m<=h&&(S>d?(e.value="end",b=m):(e.value="start",b=f)),b}return f<=c?f:m}function hie(t,e,n){const r=Be(ct,this).getHeaderTreeNodeData(e,t);if(!r)return t;const{columnCursor:i,selectionType:o,selectionWidth:s}=n,{isRoot:a,colspan:l}=Be(ct,this).getHeaderSettings(e,t);if(o===wR){if(!a)return r.columnIndex}else if(o===KH&&(l>s-i||!a))return null;return t}function die(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,S=d-a;if(S===0)continue;((i=Be(ct,this).getHeaderTreeNodeData(f,d))===null||i===void 0?void 0:i.isRoot)===!1&&(t[m][S]="")}}}function fie(t,e,n,r){this._getHeaderTreeNodeDataByCoords(e)&&(r.column=!0)}function gie(t,e){const n=this._getHeaderTreeNodeDataByCoords(e);if(!n)return;gs(Dd,this,e.clone()),gs(fp,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):(Hy(t)||Oa(t)&&l||uY(t))&&o.push(s,s+a-1,e.row),r.selectColumns(...o)}function mie(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=Ye(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 pie(){gs(fp,this,!1)}function wie(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!Be(fp,this)||!t)return;const e=this.hot.getSelectedRangeLast(),n=e.getTopStartCorner().col,r=e.getBottomEndCorner().col,{columnIndex:i,origColspan:o}=Be(ct,this).getHeaderTreeNodeData(Be(Dd,this).row,Be(Dd,this).col);if(e.setHighlight(Be(Dd,this)),o>e.getWidth()||i<n||i+o-1>r){const s=Be(ct,this).findTopMostEntireHeaderLevel(Ye(n,i,i+o-1),Ye(r,i,i+o-1));e.highlight.row=s,e.highlight.col=e.from.col}}function vie(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=Be(ct,this).findLeftMostColumnIndex(n.row,n.col),o=Be(ct,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 Cie(t,e,n){const r=t.row,i=this._getHeaderTreeNodeDataByCoords({row:r,col:t.col}),o=this._getHeaderTreeNodeDataByCoords({row:r,col:e.col});gs(gp,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 yie(t){if(Be(ct,this).getLayersCount()>0){t.length=0;for(let e=0;e<Be(ct,this).getLayersCount();e++)t.push(this.headerRendererFactory(e))}}function bie(t){const e=Be(ct,this).getLayersCount();let n=t.startColumn,r=!!e;for(let i=0;i<e;i++){const o=Be(ct,this).findLeftMostColumnIndex(i,t.startColumn),s=this.hot.columnIndexMapper.getRenderableFromVisualIndex(o);if(o>=0&&(r=!1),zn(s)&&s<t.startColumn){n=s;break}}t.startColumn=r?Be(ct,this).getHeaderTreeNodeData(0,n).columnIndex:n}function Sie(t,e){const n=this.ghostTable.getWidth(e);return t>n?t:n}function Rie(t,e,n){var r;const{label:i}=(r=Be(ct,this).getHeaderTreeNodeData(n,e))!==null&&r!==void 0?r:{label:""};return i}function Eie(t,e){if(t<0)return this.hot.getCell(t,Be(ct,this).findLeftMostColumnIndex(t,e),!0)}function Tie(){this.updatePlugin()}function _ie(t,e){e||this.updatePlugin()}function kd(t,e,n){return(e=Mie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mie(t){var e=Iie(t,"string");return typeof e=="symbol"?e:e+""}function Iie(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 Pie{constructor(e,n){kd(this,"hot",void 0),kd(this,"data",null),kd(this,"plugin",void 0),kd(this,"parentReference",new WeakMap),kd(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},me(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)&&D(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&&D(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 ke(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:(D(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)?(me(e[0],e[2],d=>{const f=this.translateTrimmedRow(d);i.push(this.getDataObject(f))}),me(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=[];D(r,o=>{i.push(this.getDataObject(o))}),D(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 RL(t,e,n){return(e=Oie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oie(t){var e=xie(t,"string");return typeof e=="symbol"?e:e+""}function xie(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{constructor(e,n){RL(this,"hot",void 0),RL(this,"plugin",void 0),this.hot=n,this.plugin=e}}class To extends G0{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(D(l,c=>{c&&s.removeChild(c)}),Z(n,To.CSS_CLASSES.indicatorContainer),i){const{rootDocument:c}=this.hot,h=a.cloneNode(!0);s.innerHTML="",me(0,i-1,()=>{const d=c.createElement("SPAN");Z(d,To.CSS_CLASSES.emptyIndicator),s.appendChild(d)}),s.appendChild(h)}if(this.dataManager.hasChildren(o)){const c=this.hot.rootDocument.createElement("DIV");u&&Re(c,[Ea()]),Z(n,To.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(r)?(Z(c,`${To.CSS_CLASSES.button} ${To.CSS_CLASSES.expandButton}`),u&&Re(n,[Yr(!1)])):(Z(c,`${To.CSS_CLASSES.button} ${To.CSS_CLASSES.collapseButton}`),u&&Re(n,[Yr(!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 Aie extends G0{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),D(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)=>{me(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)&&D(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=[];D(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 D(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);D(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 D(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);D(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)&&D(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=[];D(e,o=>{i.push(...this.expandChildren(o,!1,!1))}),r&&this.untrimRows(i),n&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),n=[];D(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.collapseMultipleChildren(n),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),n=[];D(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.expandMultipleChildren(n),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{D(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{D(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)&&D(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);Se(e.target,To.CSS_CLASSES.button)&&(this.areChildrenCollapsed(r)?this.expandChildren(r):this.collapseChildren(r),wi(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}function Hie(t,e,n){Nie(t,e),e.set(t,n)}function Nie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Die(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)}function $ie(t,e){return t.get(Fie(t,e))}function Fie(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 EL=new WeakMap;class Vie extends G0{constructor(){super(...arguments),Die(this,"dataManager",this.plugin.dataManager),Hie(this,EL,{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(qb)},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 me(0,e.items.length-1,r=>{if(r===0)return D(n,(i,o)=>{e.items.splice(r+o,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return me(0,e.items.length-1,n=>{const r=$ie(EL,this)[e.items[n].key];r!=null&&(e.items[n].callback=r)}),e}}function pp(t,e,n){return(e=Wie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wie(t){var e=Bie(t,"string");return typeof e=="symbol"?e:e+""}function Bie(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 jie{constructor(e){pp(this,"plugin",void 0),pp(this,"hot",void 0),pp(this,"dataManager",void 0),pp(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 S=this.dataManager.translateTrimmedRow(m);return l=this.shouldAllowMoving(S,a),S}),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)&&(rt(it`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
|
|
79
|
-
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 Uie(t,e){_L(t,e),e.add(t)}function TL(t,e,n){_L(t,e),e.set(t,n)}function _L(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function q0(t,e,n){return(e=zie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zie(t){var e=Yie(t,"string");return typeof e=="symbol"?e:e+""}function Yie(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 wp(t,e){return t.get(vn(t,e))}function vp(t,e,n){return t.set(vn(t,e),n),n}function vn(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 Cp="nestedRows",Gie=300,ML=Cp,qie="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var yp=new WeakMap,oc=new WeakMap,En=new WeakSet;class Kie extends Qe{constructor(){super(...arguments),Uie(this,En),q0(this,"dataManager",null),q0(this,"headersUI",null),q0(this,"collapsedRowsMap",null),TL(this,yp,!1),TL(this,oc,!1)}static get PLUGIN_KEY(){return Cp}static get PLUGIN_PRIORITY(){return Gie}isEnabled(){return!!this.hot.getSettings()[Cp]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new Ch),this.dataManager=new Pie(this,this.hot),this.collapsingUI=new Aie(this,this.hot),this.headersUI=new To(this,this.hot),this.contextMenuUI=new Vie(this,this.hot),this.rowMoveController=new jie(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return vn(En,e,uoe).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 vn(En,e,coe).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 vn(En,e,Qie).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 vn(En,e,Jie).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 vn(En,e,eoe).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 vn(En,e,Zie).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 vn(En,e,roe).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 vn(En,e,noe).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 vn(En,e,ioe).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 vn(En,e,ooe).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 vn(En,e,soe).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 vn(En,e,aoe).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 vn(En,e,toe).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 vn(En,e,loe).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 vn(En,e,Xie).call(e,...r)}),this.addHook("beforeLoadData",n=>vn(En,this,IL).call(this,n)),this.addHook("beforeUpdateData",n=>vn(En,this,IL).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:ML,relativeToGroup:Is,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(ML)}disableCoreAPIModifiers(){vp(oc,this,!0)}enableCoreAPIModifiers(){vp(oc,this,!1)}onModifyRowData(e){if(!wp(oc,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!wp(oc,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,n,r){return wp(oc,this)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,n,r),!1)}destroy(){super.destroy()}}function Xie(t,e,n,r){return this.rowMoveController.onBeforeRowMove(t,e,n,r)}function Zie(t,e,n){this.collapsingUI.toggleState(t,e,n)}function Qie(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),vp(yp,this,!0),this.dataManager.getData().slice()}function Jie(t){return this.contextMenuUI.appendOptions(t)}function eoe(t,e){this.headersUI.appendLevelIndicators(t,e)}function toe(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function noe(t,e,n,r){r!==this.pluginName&&this.hot._registerTimeout(()=>{vp(yp,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function roe(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 ioe(){this.collapsingUI.collapsedRowsStash.stash()}function ooe(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function soe(){this.collapsingUI.collapsedRowsStash.stash()}function aoe(t,e,n){this.collapsingUI.collapsedRowsStash.shiftStash(n,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function loe(){this.dataManager.rewriteCache()}function uoe(){this.headersUI.updateRowHeaderWidth()}function coe(t,e){wp(yp,this)&&(e.skipRender=!0)}function IL(t){if(!iJ(t)){Zy(qie),this.hot.getSettings()[Cp]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function K0(t,e,n){return(e=hoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hoe(t){var e=doe(t,"string");return typeof e=="symbol"?e:e+""}function doe(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 foe{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(){D(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 goe(t,e,n){return(e=moe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function moe(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)}oe.getSingleton().register("persistentStateSave"),oe.getSingleton().register("persistentStateLoad"),oe.getSingleton().register("persistentStateReset");const PL="persistentState",woe=0;class voe extends Qe{constructor(){super(...arguments),goe(this,"storage",void 0)}static get PLUGIN_KEY(){return PL}static get PLUGIN_PRIORITY(){return woe}isEnabled(){return!!this.hot.getSettings()[PL]}enablePlugin(){this.enabled||(this.storage||(this.storage=new foe(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 Coe(t,e){yoe(t,e),e.add(t)}function yoe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function X0(t,e,n){return(e=boe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function boe(t){var e=Soe(t,"string");return typeof e=="symbol"?e:e+""}function Soe(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 OL(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 Z0="search",Roe=190,Eoe="htSearchResult",Toe=function(t,e,n,r,i){t.getCellMeta(e,n).isSearchResult=i},_oe=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 Q0=new WeakSet;class Moe extends Qe{constructor(){super(...arguments),Coe(this,Q0),X0(this,"callback",Toe),X0(this,"queryMethod",_oe),X0(this,"searchResultClass",Eoe)}static get PLUGIN_KEY(){return Z0}static get PLUGIN_PRIORITY(){return Roe}isEnabled(){return this.hot.getSettings()[Z0]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[Z0];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 OL(Q0,e,xL).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 OL(Q0,e,xL).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 me(0,i-1,l=>{me(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 S={row:l,col:u,data:c};s.push(S)}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){De(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function xL(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 bp(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)}class AL{constructor(e){bp(this,"viewportWidth",void 0),bp(this,"overwriteColumnWidthFn",void 0),bp(this,"baseWidths",new Map),bp(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 Ooe extends AL{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>=fu?(i.push([d,m]),a+=m):f!==m&&(i.push([d,m]),o.push(d),s-=m)}),s<=fu){this.stretchedWidths.clear();return}const l=s/a;let u=-1,c=0;i.forEach((h,d)=>{let[f,m]=h,S=m;o.includes(f)||(S=Math.round(m*l)),this.stretchedWidths.set(f,S),u=f,d<i.length-1&&(c+=S)}),this.stretchedWidths.size>1&&this.stretchedWidths.set(u,Math.round(this.viewportWidth-c))}}function HL(t,e,n){xoe(t,e),e.set(t,n)}function xoe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function J0(t,e){return t.get(NL(t,e))}function Sp(t,e,n){return t.set(NL(t,e),n),n}function NL(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 Rp=new WeakMap,Ld=new WeakMap;class Aoe extends AL{constructor(){super(...arguments),HL(this,Rp,0),HL(this,Ld,-1)}prepare(e){super.prepare(e),Sp(Rp,this,0),Sp(Ld,this,-1)}setColumnBaseWidth(e,n){super.setColumnBaseWidth(e,n),Sp(Ld,this,e),Sp(Rp,this,n)}calculate(){if(J0(Ld,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+J0(Rp,this),0);this.stretchedWidths.set(J0(Ld,this),n)}}function Hoe(t,e){DL(t,e),e.add(t)}function Ep(t,e,n){DL(t,e),e.set(t,n)}function DL(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(sc(t,e))}function eT(t,e,n){return t.set(sc(t,e),n),n}function sc(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 Noe="stretchColumns";var Wn=new WeakMap,ac=new WeakMap,tT=new WeakMap,Tp=new WeakMap,$d=new WeakSet;class Doe{constructor(e){Hoe(this,$d),Ep(this,Wn,void 0),Ep(this,ac,void 0),Ep(this,tT,new Map([["all",new Ooe(sc($d,this,kL).bind(this))],["last",new Aoe(sc($d,this,kL).bind(this))]])),Ep(this,Tp,"none"),eT(Wn,this,e),eT(ac,this,Kt(Wn,this).columnIndexMapper.createAndRegisterIndexMap(Noe,"physicalIndexToValue"))}useStrategy(e){eT(Tp,this,Kt(tT,this).has(e)?e:"none")}refreshStretching(){if(Kt(Tp,this)==="none"){Kt(ac,this).clear();return}Kt(Wn,this).batchExecution(()=>{Kt(ac,this).clear();const e=Kt(tT,this).get(Kt(Tp,this));let r=Kt(Wn,this).view.getViewportWidth();sc($d,this,koe).call(this)&&(r-=bn(Kt(Wn,this).rootDocument)),e.prepare({viewportWidth:r});for(let i=0;i<Kt(Wn,this).countCols();i++)Kt(Wn,this).columnIndexMapper.isHidden(Kt(Wn,this).toPhysicalColumn(i))||e.setColumnBaseWidth(i,sc($d,this,Loe).call(this,i));e.calculate(),e.getWidths().forEach(i=>{let[o,s]=i;Kt(ac,this).setValueAtIndex(Kt(Wn,this).toPhysicalColumn(o),s)})},!0)}getStretchedWidth(e){return Kt(ac,this).getValueAtIndex(Kt(Wn,this).toPhysicalColumn(e))}}function koe(){const{view:t}=Kt(Wn,this);if(t.isVerticallyScrollableByWindow())return!1;const e=t.getViewportHeight(),n=Kt(Wn,this).countRows(),r=t.getStylesHandler().getDefaultRowHeight();let i=0,o=!1;for(let a=0;a<n;a++){var s;if(i+=((s=Kt(Wn,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(Wn,this).getColWidth(t,"StretchColumns"))!==null&&e!==void 0?e:fu}function kL(t,e){return Kt(Wn,this).runHooks("beforeStretchingColumnWidth",t,e)}function $oe(t,e){LL(t,e),e.add(t)}function nT(t,e,n){LL(t,e),e.set(t,n)}function LL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rT(t,e,n){return t.set(_p(t,e),n),n}function ms(t,e){return t.get(_p(t,e))}function _p(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 Foe="stretchColumns",Voe=155;var lc=new WeakMap,Mp=new WeakMap,Fd=new WeakMap,iT=new WeakSet;class Woe extends Qe{constructor(){super(...arguments),$oe(this,iT),nT(this,lc,new Doe(this.hot)),nT(this,Mp,null),nT(this,Fd,new ResizeObserver(e=>{requestAnimationFrame(()=>{var n;(n=this.hot)!==null&&n!==void 0&&n.view.isHorizontallyScrollableByWindow()&&e.forEach(r=>{let{contentRect:i}=r;ms(Mp,this)!==null&&ms(Mp,this)!==i.width&&(this.hot.refreshDimensions(),this.hot.view.adjustElementsSize()),rT(Mp,this,i.width)})})}))}static get PLUGIN_KEY(){return Foe}static get PLUGIN_PRIORITY(){return Voe}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(ms(lc,this).useStrategy(this.hot.getSettings().stretchH),ms(Fd,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 _p(iT,e,joe).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 _p(iT,e,Boe).call(e,...r)},10),super.enablePlugin())}updatePlugin(){ms(lc,this).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),ms(Fd,this).unobserve(this.hot.rootElement)}getColumnWidth(e){return ms(lc,this).getStretchedWidth(e)}destroy(){ms(Fd,this).disconnect(),rT(Fd,this,null),rT(lc,this,null),super.destroy()}}function Boe(t,e,n){if(n===this.pluginName)return;const r=this.getColumnWidth(e);return typeof r=="number"?r:t}function joe(t){t&&ms(lc,this).refreshStretching()}function Uoe(t,e){zoe(t,e),e.add(t)}function zoe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ip(t,e,n){return(e=Yoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yoe(t){var e=Goe(t,"string");return typeof e=="symbol"?e:e+""}function Goe(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 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")}const qoe="touchScroll",Koe=200;var Pp=new WeakSet;class Xoe extends Qe{constructor(){super(...arguments),Uoe(this,Pp),Ip(this,"scrollbars",[]),Ip(this,"clones",[]),Ip(this,"lockedCollection",!1),Ip(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return qoe}static get PLUGIN_PRIORITY(){return Koe}static get SETTING_KEYS(){return!0}isEnabled(){return Hx()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>oT(Pp,this,Zoe).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>oT(Pp,this,Qoe).call(this)),this.addHook("afterMomentumScroll",()=>oT(Pp,this,Joe).call(this))}}function Zoe(){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 Qoe(){this.freezeOverlays=!0,D(this.clones,t=>{Z(t,"hide-tween")})}function Joe(){this.freezeOverlays=!1,D(this.clones,t=>{ye(t,"hide-tween"),Z(t,"show-tween")}),this.hot._registerTimeout(()=>{D(this.clones,t=>{ye(t,"show-tween")})},400),D(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function ese(t,e){tse(t,e),e.add(t)}function tse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nse(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)}function ose(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 Op="trimRows",sse=330;var $L=new WeakSet;class ase extends Qe{constructor(){super(...arguments),ese(this,$L),nse(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return Op}static get PLUGIN_PRIORITY(){return sse}isEnabled(){return!!this.hot.getSettings()[Op]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new Ch),this.trimmedRowsMap.addLocalHook("init",()=>ose($L,this,lse).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[Op];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),D(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(()=>{D(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&&(D(e,l=>{o[l]=!1}),i=ir(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 lse(){const t=this.hot.getSettings()[Op];Array.isArray(t)&&this.hot.batchExecution(()=>{D(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}function use(t,e,n){return(e=cse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cse(t){var e=hse(t,"string");return typeof e=="symbol"?e:e+""}function hse(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 ai{constructor(e){use(this,"actionType",""),this.actionType=e}undo(){throw new Error("Not implemented")}redo(){throw new Error("Not implemented")}}function xp(t,e,n){return(e=dse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dse(t){var e=fse(t,"string");return typeof e=="symbol"?e:e+""}function fse(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 sT extends ai{constructor(e){let{stateBefore:n,range:r,type:i,alignment:o}=e;super("cell_alignment"),xp(this,"stateBefore",void 0),xp(this,"range",void 0),xp(this,"type",void 0),xp(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 sT({stateBefore:r,range:i,type:o,alignment:s}))})}undo(e,n){D(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){Ls(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 FL(t,e,n){return(e=gse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gse(t){var e=mse(t,"string");return typeof e=="symbol"?e:e+""}function mse(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 aT extends ai{constructor(e){let{columns:n,finalIndex:r}=e;super("col_move"),FL(this,"columns",void 0),FL(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 aT({columns:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),c0(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 VL(t,e,n){return(e=pse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pse(t){var e=wse(t,"string");return typeof e=="symbol"?e:e+""}function wse(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 lT extends ai{constructor(e){let{currentSortState:n,newSortState:r}=e;super("col_sort"),VL(this,"previousSortState",void 0),VL(this,"nextSortState",void 0),this.previousSortState=n,this.nextSortState=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnSort",(r,i,o)=>{o&&n.done(()=>new lT({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 WL(t,e,n){return(e=vse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vse(t){var e=Cse(t,"string");return typeof e=="symbol"?e:e+""}function Cse(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 uT extends ai{constructor(e){let{index:n,amount:r}=e;super("insert_col"),WL(this,"index",void 0),WL(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateCol",(r,i,o)=>{n.done(()=>new uT({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 BL(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=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)}class cT extends ai{constructor(e){let{index:n,amount:r}=e;super("insert_row"),BL(this,"index",void 0),BL(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateRow",(r,i,o)=>{n.done(()=>new cT({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 Ap(t,e,n){return(e=Sse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sse(t){var e=Rse(t,"string");return typeof e=="symbol"?e:e+""}function Rse(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 hT extends ai{constructor(e){let{changes:n,selected:r,countCols:i,countRows:o}=e;super("change"),Ap(this,"changes",void 0),Ap(this,"selected",void 0),Ap(this,"countCols",void 0),Ap(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 hT({changes:l,selected:u,countCols:e.countCols(),countRows:e.countRows()})};n.done(a,i)})}undo(e,n){const r=jn(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=jn(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 jL(t,e,n){return(e=Ese(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ese(t){var e=Tse(t,"string");return typeof e=="symbol"?e:e+""}function Tse(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 dT extends ai{constructor(e){let{conditionsStack:n,previousConditionsStack:r}=e;super("filter"),jL(this,"conditionsStack",void 0),jL(this,"previousConditionsStack",void 0),this.conditionsStack=n,this.previousConditionsStack=r}static startRegisteringEvents(e,n){e.addHook("beforeFilter",(r,i)=>{n.done(()=>new dT({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 _se(t,e,n){return(e=Mse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mse(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 fT extends ai{constructor(e){let{data:n,cellRange:r}=e;super("merge_cells"),_se(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 fT({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 UL={},zL;function Pse(){if(zL)return UL;zL=1;var t=Ct(),e=Vl(),n=wI();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}}),UL}Pse();function YL(t,e,n,r,i){const o=["visualRow","visualCol","row","col","prop"],s=o.length,a=[];return me(r,i,l=>{me(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 ps(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=xse(t,"string");return typeof e=="symbol"?e:e+""}function xse(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 gT extends ai{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"),ps(this,"index",void 0),ps(this,"indexes",void 0),ps(this,"data",void 0),ps(this,"amount",void 0),ps(this,"headers",void 0),ps(this,"columnPositions",void 0),ps(this,"rowPositions",void 0),ps(this,"fixedColumnsStart",void 0),ps(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 me(l.length-1,m=>{const S=[],b=l[m];me(u,c,T=>{S.push(b[e.toPhysicalColumn(T)])}),h.push(S)}),me(i-1,m=>{f.push(e.toPhysicalColumn(u+m))}),Array.isArray(e.getSettings().colHeaders)&&me(i-1,m=>{d.push(e.getSettings().colHeaders[e.toPhysicalColumn(u+m)]||null)}),new gT({index:u,indexes:f,data:h,amount:i,headers:d,columnPositions:e.columnIndexMapper.getIndexesSequence(),rowPositions:e.rowIndexMapper.getIndexesSequence(),fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:YL(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(ze(this.data[c],o));const l=ze(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),D(e.getSourceDataArray(),(c,h)=>{D(i,(d,f)=>{c[d]=a[h][f],u.push([h,d,c[d]])})}),typeof this.headers<"u"&&D(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 uc(t,e,n){return(e=Ase(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ase(t){var e=Hse(t,"string");return typeof e=="symbol"?e:e+""}function Hse(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 mT extends ai{constructor(e){let{index:n,data:r,fixedRowsBottom:i,fixedRowsTop:o,rowIndexesSequence:s,removedCellMetas:a}=e;super("remove_row"),uc(this,"index",void 0),uc(this,"data",void 0),uc(this,"fixedRowsBottom",void 0),uc(this,"fixedRowsTop",void 0),uc(this,"rowIndexesSequence",void 0),uc(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=jn(e.getSourceData(l,0,l+i-1,e.countSourceCols()-1));return new mT({index:l,data:c,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:YL(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 GL(t,e,n){return(e=Nse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nse(t){var e=Dse(t,"string");return typeof e=="symbol"?e:e+""}function Dse(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 pT extends ai{constructor(e){let{rows:n,finalIndex:r}=e;super("row_move"),GL(this,"rows",void 0),GL(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 pT({rows:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),c0(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 kse(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=$se(t,"string");return typeof e=="symbol"?e:e+""}function $se(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 wT extends ai{constructor(e){let{cellRange:n}=e;super("unmerge_cells"),kse(this,"cellRange",void 0),this.cellRange=n}static startRegisteringEvents(e,n){e.addHook("afterUnmergeCells",(r,i)=>{i||n.done(()=>new wT({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 Fse(t,e){[sT,aT,lT,uT,cT,hT,dT,fT,gT,mT,pT,wT].forEach(n=>n.startRegisteringEvents(t,e))}function Vse(t,e){Wse(t,e),e.add(t)}function Wse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vT(t,e,n){return(e=Bse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bse(t){var e=jse(t,"string");return typeof e=="symbol"?e:e+""}function jse(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 CT(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 qL="undoRedo",Use="undoRedo",zse=1e3;oe.getSingleton().register("beforeUndo"),oe.getSingleton().register("afterUndo"),oe.getSingleton().register("beforeRedo"),oe.getSingleton().register("afterRedo");const KL=new Set;var Hp=new WeakSet;class Yse extends Qe{static get PLUGIN_KEY(){return Use}static get PLUGIN_PRIORITY(){return zse}static get SETTING_KEYS(){return!0}constructor(e){super(e),Vse(this,Hp),vT(this,"doneActions",[]),vT(this,"undoneActions",[]),vT(this,"ignoreNewActions",!1),Fse(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 CT(Hp,e,Gse).call(e,...r)}),this.registerShortcuts(),CT(Hp,this,qse).call(this),super.enablePlugin())}disablePlugin(){super.disablePlugin(),this.clear(),this.unregisterShortcuts(),CT(Hp,this,Kse).call(this)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("grid"),i={runOnlyIf:o=>!o.altKey,group:qL};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(qL)}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=jn(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=jn(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 Gse(t,e){e==="loadData"&&this.clear()}function qse(){const t=e=>{KL.has(e)||(rt(it`The "${e}" method is deprecated and it will be removed\x20
|
|
80
|
-
from the Core API in the future. Please use the method from the UndoRedo plugin\x20
|
|
81
|
-
(e.g. \`hotInstance.getPlugin("undoRedo").${e}()\`).`),KL.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 Kse(){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 Xse(){Ke(Rh),Ke(R4),Ke(_h),Ke(e9),Ke(l9),Ke(oN),Ke(r8),Ke(z8),Ke(im),Ke(c5),Ke(sZ),Ke(gZ),Ke(pm),Ke(KZ),Ke(GJ),Ke(_ee),Ke(Jee),Ke(hte),Ke(Rte),Ke(Nte),Ke(Ute),Ke(lne),Ke(wne),Ke(ere),Ke(Are),Ke(Lre),Ke(uie),Ke(Kie),Ke(voe),Ke(Moe),Ke(Woe),Ke(Xoe),Ke(ase),Ke(Yse)}function Zse(){C2(),qq(),sK(),yK(),Xse()}var XL={},ZL={},yT,QL;function JL(){if(QL)return yT;QL=1;var t=TypeError;return yT=function(e,n){if(e<n)throw new t("Not enough arguments");return e},yT}var bT,e$;function Qse(){if(e$)return bT;e$=1;var t=ef();return bT=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),bT}var ST,t$;function n$(){if(t$)return ST;t$=1;var t=gn(),e=ef(),n=da(),r=function(i){return e.slice(0,i.length)===i};return ST=(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"})(),ST}var RT,r$;function Jse(){if(r$)return RT;r$=1;var t=n$();return RT=t==="NODE",RT}var ET,i$;function o$(){if(i$)return ET;i$=1;var t=gn(),e=nf(),n=BI(),r=on(),i=Br(),o=Tn(),s=bI(),a=fy(),l=Gw(),u=JL(),c=Qse(),h=Jse(),d=t.setImmediate,f=t.clearImmediate,m=t.process,S=t.Dispatch,b=t.Function,T=t.MessageChannel,v=t.String,O=0,P={},_="onreadystatechange",M,H,X,G;o(function(){M=t.location});var U=function(ie){if(i(P,ie)){var ae=P[ie];delete P[ie],ae()}},ne=function(ie){return function(){U(ie)}},ee=function(ie){U(ie.data)},he=function(ie){t.postMessage(v(ie),M.protocol+"//"+M.host)};return(!d||!f)&&(d=function(ae){u(arguments.length,1);var st=r(ae)?ae:b(ae),ve=a(arguments,1);return P[++O]=function(){e(st,void 0,ve)},H(O),O},f=function(ae){delete P[ae]},h?H=function(ie){m.nextTick(ne(ie))}:S&&S.now?H=function(ie){S.now(ne(ie))}:T&&!c?(X=new T,G=X.port2,X.port1.onmessage=ee,H=n(G.postMessage,G)):t.addEventListener&&r(t.postMessage)&&!t.importScripts&&M&&M.protocol!=="file:"&&!o(he)?(H=he,t.addEventListener("message",ee,!1)):_ in l("script")?H=function(ie){s.appendChild(l("script"))[_]=function(){s.removeChild(this),U(ie)}}:H=function(ie){setTimeout(ne(ie),0)}),ET={set:d,clear:f},ET}var s$;function eae(){if(s$)return ZL;s$=1;var t=Ct(),e=gn(),n=o$().clear;return t({global:!0,bind:!0,enumerable:!0,forced:e.clearImmediate!==n},{clearImmediate:n}),ZL}var a$={},TT,l$;function tae(){if(l$)return TT;l$=1;var t=gn(),e=nf(),n=on(),r=n$(),i=ef(),o=fy(),s=JL(),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 TT=function(u,c){var h=c?2:1;return l?function(d,f){var m=s(arguments.length,1)>h,S=n(d)?d:a(d),b=m?o(arguments,h):[],T=m?function(){e(S,this,b)}:S;return c?u(T,f):u(T)}:u},TT}var u$;function nae(){if(u$)return a$;u$=1;var t=Ct(),e=gn(),n=o$().set,r=tae(),i=e.setImmediate?r(n,!1):n;return t({global:!0,bind:!0,enumerable:!0,forced:e.setImmediate!==i},{setImmediate:i}),a$}var c$;function rae(){return c$||(c$=1,eae(),nae()),XL}rae();function iae(t,e){oae(t,e),e.add(t)}function oae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Al(t,e,n){return(e=sae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sae(t){var e=aae(t,"string");return typeof e=="symbol"?e:e+""}function aae(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,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 Np=new WeakSet;class MT{constructor(e,n,r){iae(this,Np),Al(this,"hot",void 0),Al(this,"tableMeta",void 0),Al(this,"selection",void 0),Al(this,"eventManager",void 0),Al(this,"destroyed",!1),Al(this,"activeEditor",void 0),Al(this,"cellProperties",void 0),this.hot=e,this.tableMeta=n,this.selection=r,this.eventManager=new vi(e),this.hot.addHook("afterDocumentKeyDown",i=>_T(Np,this,h$).call(this,i)),this.hot.addHook("beforeCompositionStart",i=>_T(Np,this,h$).call(this,i)),this.hot.view._wt.update("onCellDblClick",(i,o,s)=>_T(Np,this,lae).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=AA(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 h$(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||Pa(t))return;const{keyCode:n}=t,r=(t.ctrlKey||t.metaKey)&&!t.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!eA(n)&&!MG(n)&&!r&&!this.isEditorOpened()&&this.openEditor("",t)}function lae(t,e){e.isCell()&&this.openEditor(null,t,!0)}const d$=new WeakMap;MT.getInstance=function(t,e,n){let r=d$.get(t);return r||(r=new MT(t,e,n),d$.set(t,r)),r};function uae(t,e){f$(t,e),e.add(t)}function Vd(t,e,n){f$(t,e),e.set(t,n)}function f$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function St(t,e){return t.get(ws(t,e))}function Wd(t,e,n){return t.set(ws(t,e),n),n}function ws(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 cc=Object.freeze({CELL:"cell",MIXED:"mixed"});var fn=new WeakMap,Dp=new WeakMap,kp=new WeakMap,Lp=new WeakMap,$p=new WeakMap,la=new WeakSet;class cae{constructor(e){var n=this;uae(this,la),Vd(this,fn,void 0),Vd(this,Dp,void 0),Vd(this,kp,1),Vd(this,Lp,null),Vd(this,$p,new Map);const r=e.getSettings();Wd(fn,this,e),Wd(Dp,this,r.imeFastEdit?cc.MIXED:cc.CELL),St(fn,this).addHook("afterUpdateSettings",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ws(la,n,dae).call(n,...o)}),St(fn,this).addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ws(la,n,g$).call(n,...o)}),St(fn,this).addHook("afterSelectionFocusSet",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ws(la,n,g$).call(n,...o)}),St(fn,this).addHook("afterSelectionEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ws(la,n,hae).call(n,...o)})}getFocusMode(){return St(Dp,this)}setFocusMode(e){Object.values(cc).includes(e)?Wd(Dp,this,e):rt(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return St(kp,this)}setRefocusDelay(e){Wd(kp,this,e)}setRefocusElementGetter(e){Wd(Lp,this,e)}getRefocusElement(){var e;return typeof St(Lp,this)=="function"?St(Lp,this).call(this):(e=St(fn,this).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const n=r=>{var i,o;const s=(i=St(fn,this).getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;if(!s)return;let a=St(fn,this).runHooks("modifyFocusedElement",s.row,s.col,r);Vo(a)||(a=r),a&&!((o=St(fn,this).getActiveEditor())!==null&&o!==void 0&&o.isOpened())&&a.focus({preventScroll:!0})};e?n(e):ws(la,this,IT).call(this,r=>n(r))}refocusToEditorTextarea(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:St(kp,this);if(St(fn,this).getSettings().imeFastEdit&&!((e=St(fn,this).getActiveEditor())!==null&&e!==void 0&&e.isOpened())){var r,i;(r=St(fn,this).getActiveEditor())===null||r===void 0||(i=r.refreshValue)===null||i===void 0||i.call(r),St($p,this).has(n)||St($p,this).set(n,jf(()=>{if(!St(fn,this).isDestroyed){var o;(o=this.getRefocusElement())===null||o===void 0||o.select()}},n)),St($p,this).get(n)()}}}function IT(t){var e;const n=(e=St(fn,this).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||!St(fn,this).selection.isCellVisible(n)){t(null);return}const r=St(fn,this).getCell(n.row,n.col,!0);r===null?St(fn,this).addHookOnce("afterScroll",()=>{t(St(fn,this).getCell(n.row,n.col,!0))}):t(r)}function g$(){ws(la,this,IT).call(this,t=>{const{activeElement:e}=St(fn,this).rootDocument;e&&Px(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function hae(){ws(la,this,IT).call(this,t=>{this.getFocusMode()===cc.MIXED&&t?.nodeName==="TD"&&this.refocusToEditorTextarea()})}function dae(t){typeof t.imeFastEdit=="boolean"&&this.setFocusMode(t.imeFastEdit?cc.MIXED:cc.CELL)}const m$=new WeakMap,PT=Symbol("rootInstance");function fae(t){m$.set(t,!0)}function gae(t){return t===PT}function Fp(t){return m$.has(t)}function mae(t,e){p$(t,e),e.add(t)}function ua(t,e,n){p$(t,e),e.set(t,n)}function p$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ca(t,e,n){return(e=pae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pae(t){var e=wae(t,"string");return typeof e=="symbol"?e:e+""}function wae(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 rn(t,e){return t.get(hc(t,e))}function Cr(t,e,n){return t.set(hc(t,e),n),n}function hc(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 OT=new WeakMap,Vp=new WeakMap,Wp=new WeakMap,vs=new WeakMap,Li=new WeakMap,xT=new WeakMap,AT=new WeakMap,dc=new WeakMap,Bd=new WeakSet;class vae{constructor(e){mae(this,Bd),ca(this,"hot",void 0),ca(this,"eventManager",void 0),ca(this,"settings",void 0),ca(this,"THEAD",void 0),ca(this,"TBODY",void 0),ca(this,"_wt",void 0),ca(this,"activeWt",void 0),ua(this,OT,0),ua(this,Vp,0),ca(this,"postponedAdjustElementsSize",!1),ua(this,Wp,!1),ua(this,vs,void 0),ua(this,Li,void 0),ua(this,xT,0),ua(this,AT,0),ua(this,dc,null),this.hot=e,this.eventManager=new vi(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),hc(Bd,this,yae).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),Z(e,"handsontable"),Cr(Li,this,n.createElement("TABLE")),Z(rn(Li,this),"htCore"),this.hot.getSettings().tableClassName&&Z(rn(Li,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(Re(rn(Li,this),[$o()]),Re(e,[Tz(),gx(-1),Of(this.hot.countCols()),Fz()])),this.THEAD=n.createElement("THEAD"),rn(Li,this).appendChild(this.THEAD),this.TBODY=n.createElement("TBODY"),rn(Li,this).appendChild(this.TBODY),this.hot.table=rn(Li,this),this.hot.container.insertBefore(rn(Li,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=>{Cr(Wp,this,!0),this.isTextSelectionAllowed(a.target)||(_x(i),a.preventDefault(),i.focus())}),this.eventManager.addEventListener(e,"mouseup",()=>{Cr(Wp,this,!1)}),this.eventManager.addEventListener(e,"mousemove",a=>{rn(Wp,this)&&!this.isTextSelectionAllowed(a.target)&&(this.settings.fragmentSelection&&_x(i),a.preventDefault())}),this.eventManager.addEventListener(o,"keyup",a=>{r.isInProgress()&&!a.shiftKey&&r.finish()}),this.eventManager.addEventListener(o,"mouseup",a=>{r.isInProgress()&&Hy(a)&&r.finish(),Cr(vs,this,!1);const l=Px(n.activeElement);Lf(n.activeElement)&&!l||(l||!r.isSelected()&&!r.isSelectedByAnyHeader()&&!e.contains(a.target)&&!Oa(a))&&this.hot.unlisten()}),this.eventManager.addEventListener(o,"contextmenu",a=>{r.isInProgress()&&Oa(a)&&(r.finish(),Cr(vs,this,!1))}),this.eventManager.addEventListener(o,"touchend",()=>{r.isInProgress()&&r.finish(),Cr(vs,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(rn(vs,this)||!e||!this.hot.view)return;const{holder:d}=this._wt.wtTable;if(h===d){const m=bn(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=Jl(i);for(;s!==null;)this.eventManager.addEventListener(s.document.documentElement,"click",()=>{this.hot.unlisten()}),s=Jl(s);this.eventManager.addEventListener(rn(Li,this),"selectstart",a=>{this.settings.fragmentSelection||Lf(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&&Z(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&&ye(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:rn(Li,this),isDataViewInstance:()=>Fp(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),Cr(Vp,this,o.length),this.hot.getSettings().ariaTags&&hc(Bd,this,w$).call(this)===this.hot.countCols()&&hc(Bd,this,Cae).call(this,rn(Vp,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),Cr(OT,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 S=this.hot.getDataAtRowProp(h,m);this.hot.hasHook("beforeValueRender")&&(S=this.hot.runHooks("beforeValueRender",S,f)),this.hot.runHooks("beforeRenderer",a,l,u,m,S,f),this.hot.getCellRenderer(f)(this.hot,a,l,u,m,S,f),this.hot.runHooks("afterRenderer",a,l,u,m,S,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&&nu(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,Cr(vs,this,!0),Cr(dc,this,{x:o.clientX,y:o.clientY}),this.hot.runHooks("beforeOnCellMouseDown",o,u,a,c),!Pa(o)&&(nD(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,Cr(vs,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",o,u,a),!Pa(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),!Pa(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),!Pa(o)&&(rn(vs,this)&&(!rn(dc,this)||rn(dc,this).x!==o.clientX||rn(dc,this).y!==o.clientY)&&nD(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,Cr(dc,this,null))},onCellMouseUp:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",o,u,a),!(Pa(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,S,b,T]=f;return[m>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(m,1)):m,S>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(S,1)):S,b>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(b,-1)):b,T>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(T,-1)):T]}},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(Lf(e))return!0;const n=_a(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 rn(vs,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(!Se(r,"relative")){Fo(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;Se(s,"relative")?(this.updateCellHeader(s.querySelector(".colHeader"),e,r,i),s.className="",Z(s,["relative",...o()])):(Fo(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&&(Re(a,...$o()),Re(l,...$o())),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&&(Se(e,"colHeader")?o=s.wtTable.columnFilter.sourceToRendered(n):Se(e,"rowHeader")&&(o=s.wtTable.rowFilter.sourceToRendered(n))),o>-1?tu(e,r(n,i)):(Ia(e," "),Z(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){Cr(xT,this,e),Cr(AT,this,n)}getLastSize(){return{width:rn(xT,this),height:rn(AT,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 rn(OT,this)}getRowHeadersCount(){return rn(Vp,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 w$(){return parseInt(this.hot.rootElement.getAttribute(Of()[0]),10)}function Cae(t){const e=hc(Bd,this,w$).call(this)+t;Re(this.hot.rootElement,...Of(e))}function yae(){const t=this.hot.rootElement;this.hasVerticalScroll()?Z(t,"htHasScrollY"):ye(t,"htHasScrollY"),this.hasHorizontalScroll()?Z(t,"htHasScrollX"):ye(t,"htHasScrollX")}function jd(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 Rae{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];jd(this,"hot",void 0),jd(this,"data",void 0),jd(this,"dataType","array"),jd(this,"colToProp",()=>{}),jd(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 D(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)}):me(n,r,u=>{l[u-n]=this.getAtPhysicalCell(e,u,a)});else if(De(a)||at(a))if(i?l=[]:l={},!o||i){const c=this.countFirstRowKeys()-1;me(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?py(l,d,f):l[d]=f}})}else ke(a,(u,c)=>{const h=this.getAtPhysicalCell(e,c,a);s?py(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=Rr(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:py(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?UU(r,n):r[n]}else typeof n=="function"?i=n(r):i=r[n];if(this.hot.hasHook("modifySourceData")){const o=Rr(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 me(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 WD(this.data)}destroy(){this.data=null,this.hot=null}}function Eae(t,e){return ke(e,(n,r)=>{At(t[r])&&(t[r]=n)}),t}function v$(t){const n=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return n?`${n[1].toLowerCase()}-${n[2].toUpperCase()}`:t}function C$(t){fe(t)&&Zy(it`Language with code "${t}" was not found. You should register particular language\x20
|
|
82
|
-
before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function Tae(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:_ae,getValues:Mae}=Ci("phraseFormatters");function Iae(t,e){_ae(t,e)}function Pae(){return Mae()}Iae("pluralize",Tae);const y$={languageCode:"en-US",[hb]:"No available options",[db]:"Insert row above",[fb]:"Insert row below",[gb]:"Insert column left",[mb]:"Insert column right",[pb]:["Remove row","Remove rows"],[wb]:["Remove column","Remove columns"],[vb]:"Undo",[Cb]:"Redo",[Zf]:"Read only",[yb]:"Clear column",[Nb]:"Alignment",[Db]:"Left",[kb]:"Center",[Lb]:"Right",[$b]:"Justify",[Fb]:"Top",[Vb]:"Middle",[Wb]:"Bottom",[_b]:"Freeze column",[Mb]:"Unfreeze column",[Bb]:"Borders",[jb]:"Top",[Ub]:"Right",[zb]:"Bottom",[Yb]:"Left",[Gb]:"Remove border(s)",[Ob]:"Add comment",[xb]:"Edit comment",[Ab]:"Delete comment",[Hb]:"Read-only comment",[Ib]:"Merge cells",[Pb]:"Unmerge cells",[bb]:"Copy",[Sb]:["Copy with header","Copy with headers"],[Rb]:["Copy with group header","Copy with group headers"],[Eb]:["Copy header only","Copy headers only"],[Tb]:"Cut",[qb]:"Insert child row",[Kb]:"Detach from parent",[Xb]:["Hide column","Hide columns"],[Zb]:["Show column","Show columns"],[Qb]:["Hide row","Hide rows"],[Jb]:["Show row","Show rows"],[Qf]:"None",[eS]:"Is empty",[tS]:"Is not empty",[nS]:"Is equal to",[rS]:"Is not equal to",[iS]:"Begins with",[oS]:"Ends with",[sS]:"Contains",[aS]:"Does not contain",[lS]:"Greater than",[uS]:"Greater than or equal to",[cS]:"Less than",[hS]:"Less than or equal to",[dS]:"Is between",[fS]:"Is not between",[gS]:"After",[mS]:"Before",[pS]:"Today",[wS]:"Tomorrow",[vS]:"Yesterday",[eg]:"Blank cells",[CS]:"Filter by condition",[yS]:"Filter by value",[bS]:"And",[Jf]:"Or",[SS]:"Select all",[RS]:"Clear",[ES]:"OK",[TS]:"Cancel",[_S]:"Search",[MS]:"Value",[IS]:"Second value",[OS]:"Checked",[xS]:"Unchecked"},Oae=_2,HT=y$.languageCode,{register:xae,getItem:b$,hasItem:Aae,getValues:Hae}=Ci("languagesDictionaries");S$(y$);function S$(t,e){let n=t,r=e;return De(t)&&(r=t,n=r.languageCode),Nae(n,r),xae(n,jn(r)),jn(r)}function Nae(t,e){t!==HT&&Eae(e,b$(HT))}function R$(t){return NT(t)?jn(b$(t)):null}function NT(t){return Aae(t)}function Dae(){return Hae()}function E$(t,e,n){const r=R$(t);if(r===null)return null;const i=r[e];if(At(i))return null;const o=kae(i,n);return Array.isArray(o)?o[0]:o}function kae(t,e){let n=t;return D(Pae(),r=>{n=r(t,e)}),n}function Lae(t){let e=v$(t);return NT(e)||(e=HT,C$(t)),e}function Hl(t,e,n){return(e=$ae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $ae(t){var e=Fae(t,"string");return typeof e=="symbol"?e:e+""}function Fae(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 fc{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,n,r){Hl(this,"hot",void 0),Hl(this,"metaManager",void 0),Hl(this,"tableMeta",void 0),Hl(this,"dataSource",void 0),Hl(this,"duckSchema",void 0),Hl(this,"colToPropCache",void 0),Hl(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=wy(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(De(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 WD(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)&&ke(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&&fe(this.colToPropCache[n])?this.colToPropCache[n]:n}propToCol(e){const n=this.propToColCache.get(e);if(fe(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]?jc(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=jn(this.getSchema()):(m=[],me(h-1,()=>m.push(null))):this.hot.dataType==="function"?m=this.tableMeta.dataSchema(l+a):(m={},If(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 S=m;for(;f<n&&d<s;){if(typeof l!="number"||l>=d)if(h>0)for(let T=0;T<h;T+=1)typeof o[T]>"u"&&(o[T]=[]),o[T].push(null);else o.push([null]);else for(let T=0;T<h;T++)o[T].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(S,n));const b=this.hot.toVisualColumn(S);return this.hot.runHooks("afterCreateCol",b,f,r),this.refreshDuckSchema(),{delta:f,startPhysicalIndex:S}}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=fe(this.tableMeta.columns)||fe(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];MO(l,s);let c=0;for(;c<r;)l.push(null),c+=1;return AU(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];MO(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&&ln(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=Rr(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=Rr(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&&ln(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,fc.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===fc.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 jh(this.getRange(e,n,fc.DESTINATION_RENDERER))}getCopyableText(e,n){return jh(this.getRange(e,n,fc.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 Vae(t,e){var n;return t==="CELL_TYPE"?!1:((n=e._automaticallyAssignedMetaProps)===null||n===void 0?void 0:n.has(t))||!ln(e,t)}function Bp(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const r=typeof e.type=="string"?CK(e.type):e.type;if(t._automaticallyAssignedMetaProps&&ke(e,(o,s)=>{t._automaticallyAssignedMetaProps.delete(s)}),!De(r))return;n===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const i={};ke(r,(o,s)=>{if(Vae(s,n)){var a;i[s]=o,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(s)}}),an(t,i)}function Wae(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function n(){}jU(n,t);for(let r=0;r<e.length;r++)n.prototype[e[r]]=void 0;return n}function jp(t){return Number.isInteger(t)&&t>=0}function Up(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function zp(t){return t==null}const T$=()=>({_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),jt(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),jt(r)===!1)return typeof r=="object"?(i=this.getCellMeta(t,e),my(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 _$(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=jae(t,"string");return typeof e=="symbol"?e:e+""}function jae(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 Uae(){return class{}}class zae{constructor(e){_$(this,"metaCtor",Uae()),_$(this,"meta",void 0),this.meta=this.metaCtor.prototype,an(this.meta,T$()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var n;an(this.meta,e),Bp(this.meta,{...e,type:(n=e.type)!==null&&n!==void 0?n:this.meta.type},e)}}function Yae(t,e,n){return(e=Gae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gae(t){var e=qae(t,"string");return typeof e=="symbol"?e:e+""}function qae(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 Kae{constructor(e){Yae(this,"meta",void 0);const n=e.getMetaConstructor();this.meta=new n}getMeta(){return this.meta}updateMeta(e){an(this.meta,e),Bp(this.meta,e,e)}}function Yp(t,e,n){return(e=Xae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xae(t){var e=Zae(t,"string");return typeof e=="symbol"?e:e+""}function Zae(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 Gp{constructor(e){Yp(this,"valueFactory",void 0),Yp(this,"data",[]),Yp(this,"index",[]),Yp(this,"holes",new Set),this.valueFactory=e}obtain(e){Up(()=>jp(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;Up(()=>jp(e)||zp(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=zp(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;Up(()=>jp(e)||zp(e),"Expecting an unsigned number or null/undefined argument.");const r=this.index.splice(zp(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 M$(t,e,n){return(e=Qae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qae(t){var e=Jae(t,"string");return typeof e=="symbol"?e:e+""}function Jae(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 ele=["data","width"];class tle{constructor(e){M$(this,"globalMeta",void 0),M$(this,"metas",new Gp(()=>this._createMeta())),this.globalMeta=e,this.metas=new Gp(()=>this._createMeta())}updateMeta(e,n){const r=this.getMeta(e);an(r,n),Bp(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 Wae(this.globalMeta.getMetaConstructor(),ele).prototype}}function I$(t,e,n){return(e=nle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nle(t){var e=rle(t,"string");return typeof e=="symbol"?e:e+""}function rle(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 ile{constructor(e){I$(this,"columnMeta",void 0),I$(this,"metas",new Gp(()=>this._createRow())),this.columnMeta=e}updateMeta(e,n,r){const i=this.getMeta(e,n);an(i,r),Bp(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++)fe(n[r])&&e.push(...n[r].values());return e}getMetasAtRow(e){Up(()=>jp(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 Gp(e=>this._createMeta(e))}_createMeta(e){const n=this.columnMeta.getMetaConstructor(e);return new n}}class P${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 zae(e),this.tableMeta=new Kae(this.globalMeta),this.columnMeta=new tle(this.globalMeta),this.cellMeta=new ile(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()}}ft(P$,On);function O$(t,e,n,r){const{hotInstance:i,dataMap:o,dataSource:s,internalSource:a,source:l,metaManager:u,firstRun:c}=r,h=mi(a),d=i.getSettings();Array.isArray(d.dataSchema)?i.dataType="array":at(d.dataSchema)?i.dataType="function":i.dataType="object",o&&o.destroy(),t=i.runHooks(`before${h}`,t,c,l);const f=new fc(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 S,b=0,T=0;for(b=0,T=d.startRows;b<T;b++)if((i.dataType==="object"||i.dataType==="function")&&d.dataSchema)S=jn(m),t.push(S);else if(i.dataType==="array")S=jn(m[0]),t.push(S);else{S=[];for(let v=0,O=d.startCols;v<O;v++)S.push(null);t.push(S)}}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&&Re(i.rootElement,[gx(-1),Of(i.countCols()+(i.view?i.countRowHeaders():0))])}function x$(t,e,n){return(e=ole(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ole(t){var e=sle(t,"string");return typeof e=="symbol"?e:e+""}function sle(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 ale{constructor(e){var n=this;x$(this,"metaManager",void 0),x$(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",function(){return n.extendCellMeta(...arguments)}),oe.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=ln(e,"type")?e.type:null;let c=at(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 lle(t,e,n){ule(t,e),e.set(t,n)}function ule(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function DT(t,e,n){return(e=cle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cle(t){var e=hle(t,"string");return typeof e=="symbol"?e:e+""}function hle(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 dle(t,e){return t.get(fle(t,e))}function fle(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 A$=new WeakMap;class gle{constructor(e){DT(this,"metaManager",void 0),DT(this,"usageTracker",new Set),DT(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}]])),lle(this,A$,(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,dle(A$,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 mle(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.rootElement,r=H$(t),i=H$(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 H$(t){const n=t.rootDocument.createElement("input");return n.type="text",n.name="__htFocusCatcher",n.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&Re(n,[Gc("Focus catcher")]),n}function ple(t){const e=wle(t);let n;const{activate:r,deactivate:i}=mle(t,{onFocusFromTop(){var h;const d=(h=e(n))!==null&&h!==void 0?h:kT(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:LT(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,S)=>{if(a&&(o.wrapped&&o.flipped||l)&&(l=!1,S.value=!0),s){var b;n=(b=t.getSelectedRangeLast())===null||b===void 0?void 0:b.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:Zx,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?kT(t):LT(t)),u(),!1;h.preventDefault()},position:"after"}])}function kT(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 LT(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 wle(t){return e=>{if(!e)return null;const n=kT(t),r=LT(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 gc(t){Vo(t)&&t.scrollIntoView({block:"nearest",inline:"nearest"})}function qp(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,S=f<=h,b=m>=d;return{getComputedColumnTarget(T){return i==="mouse"||i==="keyboard"?T.col:u&&c?r.highlight.col:u?a:c?l:T.col},getComputedRowTarget(T){return i==="mouse"||i==="keyboard"?T.row:S&&b?r.highlight.row:S?f:b?m:T.row}}}function vle(t){return e=>{const n=qp(t).getComputedColumnTarget(e);t.scrollViewportTo({col:n},()=>{const r=!!t.getSettings().colHeaders;gc(t.getCell(r?-1:0,n,!0))})}}function Cle(){return()=>{}}function yle(t){return e=>{t.scrollViewportTo(e.toObject(),()=>{const{row:n,col:r}=t.getSelectedRangeLast().highlight;gc(t.getCell(n,r,!0))})}}function ble(t){return e=>{const n=qp(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:o}=r;gc(t.getCell(i,o,!0))})}}function Sle(t){return e=>{const n=qp(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:o}=r;gc(t.getCell(i,o,!0))})}}function Rle(t){return e=>{const n=qp(t).getComputedRowTarget(e);t.scrollViewportTo({row:n},()=>{const r=!!t.getSettings().rowHeaders;gc(t.getCell(n,r?-1:0,!0))})}}function Ele(t){return e=>{const n=t.selection.getSelectionSource(),{row:r,col:i}=e,o=()=>{gc(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 Tle(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=yle(t):e.isSelectedByCorner()?s=Cle():e.isSelectedByRowHeader()?s=Rle(t):e.isSelectedByColumnHeader()?s=vle(t):e.getSelectedRange().size()===1&&e.isMultiple()?s=ble(t):e.getSelectedRange().size()===1&&!e.isMultiple()?s=Ele(t):e.getSelectedRange().size()>1&&(s=Sle(t)),(o=s)===null||o===void 0||o(i)}}}const N$=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"]]),Kp=t=>t.map(e=>{const n=e.toLowerCase();return N$.has(n)?N$.get(n):n}).sort().join("+"),_le=t=>t.split("+"),D$=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"]]),$T=t=>{let{which:e,key:n}=t;if(D$.has(e))return D$.get(e);const r=String.fromCharCode(e).toLowerCase();return/^[a-z0-9]$/.test(r)?r:n.toLowerCase()},k$=Symbol("shortcut-context");function L$(t){return De(t)&&t.__kindOf===k$}const Mle=t=>{const e=og({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:S,position:b,forwardToContext:T}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(At(c))throw new Error("You need to define the shortcut's group.");if(at(u)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(it`Pass the shortcut\'s keys as an array of arrays,\x20
|
|
83
|
-
using the KeyboardEvent.key properties:\x20
|
|
84
|
-
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};fe(S)&&(v.relativeToGroup=S,v.position=b),L$(T)&&(v.forwardToContext=T),l.forEach(O=>{const P=Kp(O);if(e.hasItem(P)){const M=e.getItem(P);let H=M.findIndex(X=>X.group===S);H!==-1?b==="before"?H-=1:H+=1:H=M.length,M.splice(H,0,v)}else e.addItem(P,[v])})},r=function(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l.forEach(c=>{ke(u,(h,d)=>{Object.prototype.hasOwnProperty.call(c,d)===!1&&(c[d]=u[d])}),n(c)})},i=l=>{const u=Kp(l);e.removeItem(u)};return{__kindOf:k$,addShortcut:n,addShortcuts:r,getShortcuts:l=>{const u=Kp(l),c=e.getItem(u);return fe(c)?c.slice():[]},hasShortcut:l=>{const u=Kp(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(_le(h)):(d.length=0,d.push(...f))})}}};function Ile(){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 Ple=["meta","alt","shift","control"],Ud=Ile(),zd=[];let Xp=0;function Ole(t,e,n,r,i){const o=f=>Ple.includes(f),s=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const S=[];return f.altKey&&S.push("alt"),m&&(f.ctrlKey||f.metaKey)?S.push("control/meta"):(f.ctrlKey&&S.push("control"),f.metaKey&&S.push("meta")),f.shiftKey&&S.push("shift"),S},a=f=>{if(e(f)===!1||n(f)===!1||f.keyCode===229||typeof f.key!="string"||Pa(f))return;const S=$T(f);let b=[];o(S)||(b=s(f));const T=[S].concat(b);!i(f,T)&&($x()&&b.includes("meta")||!$x()&&b.includes("control"))&&i(f,[S].concat(s(f,!0))),r(f)},l=f=>{if(typeof f.key=="string"){const m=$T(f);o(m)&&Ud.press(m)}},u=f=>{if(typeof f.key=="string"){const m=$T(f);o(m)&&Ud.release(m)}},c=()=>{Ud.releaseAll()};return{mount:()=>{let f=t;for(Xp+=1;f;)Xp===1&&(f.document.documentElement.addEventListener("keydown",l),zd.push({event:"keydown",listener:l}),f.document.documentElement.addEventListener("keyup",u),zd.push({event:"keyup",listener:u})),f.document.documentElement.addEventListener("keydown",a),f.document.documentElement.addEventListener("blur",c),f=Jl(f)},unmount:()=>{let f=t;for(Xp-=1;f;){if(Xp===0){for(let m=0;m<zd.length;m++){const{event:S,listener:b}=zd[m];f.document.documentElement.removeEventListener(S,b)}zd.length=0}f.document.documentElement.removeEventListener("keydown",a),f.document.documentElement.removeEventListener("blur",c),f=Jl(f)}},isPressed:f=>Ud.isPressed(f),releasePressedKeys:()=>Ud.releaseAll()}}const xle=t=>{let{ownerWindow:e,handleEvent:n,beforeKeyDown:r,afterKeyDown:i}=t;const o=og({errorIdExists:m=>`The "${m}" context name is already registered.`});let s="grid";const a=m=>{const S=Mle(m);return o.addItem(m,S),S},l=()=>s,u=m=>o.getItem(m),c=m=>{if(!o.hasItem(m))throw new Error(it`You've tried to activate the "${m}" shortcut context\x20
|
|
85
|
-
that does not exist. Before activation, register the context using the "addContext" method.`);s=m};let h=!1;const d=function(m,S){let b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const T=L$(b)?b:u(b);let v=!1;if(!T.hasShortcut(S))return v;const O=T.getShortcuts(S);for(let P=0;P<O.length;P++){const{callback:_,runOnlyIf:M,preventDefault:H,stopPropagation:X,captureCtrl:G,forwardToContext:U}=O[P];if(M(m)===!0){if(h=G,v=_(m,S)===!1,h=!1,H&&m.preventDefault(),X&&(wi(m),m.stopPropagation()),v)break;U&&d(m,S,U)}}return v},f=Ole(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 $$(t){const{classNames:e}=Xz(t,/ht-theme-[a-zA-Z0-9_-]+/);return e.pop()}let FT=null;const VT=new Map;function F$(t,e){var n,r=this;let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this;const s=new vi(o);let a,l,u,c,h,d,f=!0;gae(i)&&fae(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",S=["rtl","ltr"].includes(m)?m:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",S),this.isRtl=function(){return S==="rtl"},this.isLtr=function(){return!o.isRtl()},this.getDirectionFactor=function(){return o.isLtr()?1:-1},e.language=Lae(e.language);const b=Object.fromEntries(Object.entries(e).filter(g=>{let[w]=g;return!(oe.getSingleton().isRegistered(w)||oe.getSingleton().isDeprecated(w))})),T=new P$(o,b,[ale,gle]),v=T.getTableMeta(),O=T.getGlobalMeta(),P=og();this.container=this.rootDocument.createElement("div"),t.insertBefore(this.container,t.firstChild),Fp(this)&&(LU(e.licenseKey,t),Z(t,"ht-wrapper")),this.guid=`ht_${ax()}`,VT.set(this.guid,this),this.columnIndexMapper=new $R,this.rowIndexMapper=new $R,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 Rae(o),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const _=g=>{const{row:w,col:p}=g;return o._createCellCoords(w>=0?o.rowIndexMapper.getRenderableFromVisualIndex(w):w,p>=0?o.columnIndexMapper.getRenderableFromVisualIndex(p):p)},M=g=>{const{row:w,col:p}=g;return o._createCellCoords(w>=0?o.rowIndexMapper.getVisualFromRenderableIndex(w):w,p>=0?o.columnIndexMapper.getVisualFromRenderableIndex(p):p)},H=(g,w)=>{const p=w>g?1:-1,I=Math.min(g,w),k=Math.max(g,w),F=o.rowIndexMapper.getNearestNotHiddenIndex(g,p);return F===null||p===1&&F>k||p===-1&&F<I?null:F>=0?o.rowIndexMapper.getRenderableFromVisualIndex(F):F},X=(g,w)=>{const p=w>g?1:-1,I=Math.min(g,w),k=Math.max(g,w),F=o.columnIndexMapper.getNearestNotHiddenIndex(g,p);return F===null||p===1&&F>k||p===-1&&F<I?null:F>=0?o.columnIndexMapper.getRenderableFromVisualIndex(F):F};let G=new eD(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:_,renderableToVisualCoords:M,findFirstNonHiddenRenderableRow:H,findFirstNonHiddenRenderableColumn:X,isDisabledCellSelection:(g,w)=>g<0||w<0?o.getSettings().disableVisualSelection:o.getCellMeta(g,w).disableVisualSelection});this.selection=G;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=Rr(!1),I=this.selection.getSelectedRange(),{from:k,to:F}=I.current(),j=I.size()-1;this.runHooks("afterSelection",k.row,k.col,F.row,F.col,p,j),this.runHooks("afterSelectionByProp",k.row,o.colToProp(k.col),F.row,o.colToProp(F.col),p,j),w&&(!p.isTouched()||p.isTouched()&&!p.value)&&d.scrollTo(g);const Y=G.isSelectedByRowHeader(),y=G.isSelectedByColumnHeader();Y&&y?Z(this.rootElement,["ht__selection--rows","ht__selection--columns"]):Y?(ye(this.rootElement,"ht__selection--columns"),Z(this.rootElement,"ht__selection--rows")):y?(ye(this.rootElement,"ht__selection--rows"),Z(this.rootElement,"ht__selection--columns")):ye(this.rootElement,["ht__selection--rows","ht__selection--columns"]),G.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=Rr(!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:I}=g[w];this.runHooks("afterSelectionEnd",p.row,p.col,I.row,I.col,w),this.runHooks("afterSelectionEndByProp",p.row,o.colToProp(p.col),I.row,o.colToProp(I.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(),ye(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,I=arguments.length>3?arguments[3]:void 0,k=arguments.length>4?arguments[4]:void 0;const F=j=>{if(j.length===0)return[];const Y=[...j];return Y.sort((R,C)=>{let[x]=R,[A]=C;return x===A?0:x>A?1:-1}),ir(Y,(R,C)=>{let[x,A]=C;const N=R[R.length-1],[W,L]=N,$=W+L;if(x<=$){const B=Math.max(A-($-x),0);N[1]+=B}else R.push([x,A]);return R},[Y[0]])};switch(g){case"insert_row_below":case"insert_row_above":const j=o.countSourceRows();if(v.maxRows===j)return;const Y=g==="insert_row_below"?"below":"above";w=w??(Y==="below"?j:0);const{delta:y,startPhysicalIndex:R}=a.createRow(w,p,{source:I,mode:Y});G.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:x,startPhysicalIndex:A}=a.createCol(w,p,{source:I,mode:C});if(x){if(Array.isArray(v.colHeaders)){const L=[o.toVisualColumn(A),0];L.length+=x,Array.prototype.splice.apply(v.colHeaders,L)}G.shiftColumns(o.toVisualColumn(A),x)}break;case"remove_row":const N=L=>{let $=0;D(L,B=>{let[V,q]=B;const ue=jt(V)?o.countRows()-1:Math.max(V-$,0);if(Number.isInteger(V)&&(V=Math.max(V-$,0)),!a.removeRow(V,q,I))return;if(G.isSelected()){const{row:_e}=o.getSelectedRangeLast().highlight;_e>=V&&_e<=V+q-1&&c.closeEditor(!0)}const Te=o.countRows(),Fe=v.fixedRowsTop;Fe>=ue+1&&(v.fixedRowsTop-=Math.min(q,Fe-ue));const et=v.fixedRowsBottom;et&&ue>=Te-et&&(v.fixedRowsBottom-=Math.min(q,et)),Te===0?G.deselect():I==="ContextMenu.removeRow"?G.refresh():G.shiftRows(V,-q),$+=q})};Array.isArray(w)?N(F(w)):N([[w,p]]);break;case"remove_col":const W=L=>{let $=0;D(L,B=>{let[V,q]=B;const ue=jt(V)?o.countCols()-1:Math.max(V-$,0);let ce=o.toPhysicalColumn(ue);if(Number.isInteger(V)&&(V=Math.max(V-$,0)),!a.removeCol(V,q,I))return;if(G.isSelected()){const{col:_e}=o.getSelectedRangeLast().highlight;_e>=V&&_e<=V+q-1&&c.closeEditor(!0)}o.countCols()===0?G.deselect():I==="ContextMenu.removeColumn"?G.refresh():G.shiftColumns(V,-q);const et=v.fixedColumnsStart;et>=ue+1&&(v.fixedColumnsStart-=Math.min(q,et-ue)),Array.isArray(v.colHeaders)&&(typeof ce>"u"&&(ce=-1),v.colHeaders.splice(ce,q)),$+=q})};Array.isArray(w)?W(F(w)):W([[w,p]]);break;default:throw new Error(`There is no such action "${g}"`)}k||u.adjustRowsAndCols(),o.view.render(),o.view.adjustElementsSize()},adjustRowsAndCols(){const g=v.minRows,w=v.minSpareRows,p=v.minCols,I=v.minSpareCols;if(g){const k=o.countRows();k<g&&a.createRow(k,g-k,{source:"auto"})}if(w){const k=o.countEmptyRows(!0);if(k<w){const F=w-k,j=Math.min(F,v.maxRows-o.countSourceRows());a.createRow(o.countRows(),j,{source:"auto"})}}{let k;(p||I)&&(k=o.countEmptyCols(!0));let F=o.countCols();if(p&&!v.columns&&F<p){const j=p-F;k+=j,a.createCol(F,j,{source:"auto"})}if(I&&!v.columns&&o.dataType==="array"&&k<I){F=o.countCols();const j=I-k,Y=Math.min(j,v.maxCols-F);a.createCol(F,Y,{source:"auto"})}}},populateFromArray(g,w,p,I,k){let F,j,Y,y;const R=[],C={},x=[],A=g.row,N=g.col;if(j=w.length,j===0)return!1;let W=0,L=0;switch(De(p)&&(W=p.col-N+1,L=p.row-A+1),k){case"shift_down":const $=_f(w),B=$.length,V=Math.max(B,W),q=o.getData().slice(A),ue=_f(q).slice(N,N+V);for(Y=0;Y<V;Y+=1)if(Y<B){for(F=0,j=$[Y].length;F<L-j;F+=1)$[Y].push($[Y][F%j]);Y<ue.length?x.push($[Y].concat(ue[Y])):x.push($[Y].concat(new Array(q.length).fill(null)))}else x.push($[Y%B].concat(ue[Y]));o.populateFromArray(A,N,_f(x));break;case"shift_right":const ce=w.length,Te=Math.max(ce,L),Fe=o.getData().slice(A).map(Wt=>Wt.slice(N));for(F=0;F<Te;F+=1)if(F<ce){for(Y=0,y=w[F].length;Y<W-y;Y+=1)w[F].push(w[F][Y%y]);if(F<Fe.length)for(let Wt=0;Wt<Fe[F].length;Wt+=1)w[F].push(Fe[F][Wt]);else w[F].push(...new Array(Fe[0].length).fill(null))}else w.push(w[F%j].slice(0,Te).concat(Fe[F]));o.populateFromArray(A,N,w);break;default:C.row=g.row,C.col=g.col;let et=0,_e=0,We=!0,Rt;const yr=function(Fr){let Zt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const Pt=w[Fr%w.length];return Zt!==null?Pt[Zt%Pt.length]:Pt},$i=w.length,li=p?p.row-g.row+1:0;for(p?j=li:j=Math.max($i,li),F=0;F<j&&!(p&&C.row>p.row&&li>$i||!v.allowInsertRow&&C.row>o.countRows()-1||C.row>=v.maxRows);F++){const Wt=F-et,Fr=yr(Wt).length,Zt=p?p.col-g.col+1:0;if(p?y=Zt:y=Math.max(Fr,Zt),C.col=g.col,Rt=o.getCellMeta(C.row,C.col),(I==="CopyPaste.paste"||I==="Autofill.fill")&&Rt.skipRowOnPaste){et+=1,C.row+=1,j+=1;continue}for(_e=0,Y=0;Y<y&&!(p&&C.col>p.col&&Zt>Fr||!v.allowInsertColumn&&C.col>o.countCols()-1||C.col>=v.maxCols);Y++){if(Rt=o.getCellMeta(C.row,C.col),(I==="CopyPaste.paste"||I==="Autofill.fill")&&Rt.skipColumnOnPaste){_e+=1,C.col+=1,y+=1;continue}if(Rt.readOnly&&I!=="UndoRedo.undo"){C.col+=1;continue}const Pt=Y-_e;let je=yr(Wt,Pt),xn=o.getDataAtCell(C.row,C.col);if(je!==null&&typeof je=="object")if(Array.isArray(je)&&xn===null&&(xn=[]),xn===null||typeof xn!="object")We=!1;else{const Vr=jc(Array.isArray(xn)?xn:xn[0]||xn),wc=jc(Array.isArray(je)?je:je[0]||je);my(Vr,wc)||Array.isArray(Vr)&&Array.isArray(wc)?je=jn(je):We=!1}else xn!==null&&typeof xn=="object"&&(We=!1);We&&R.push([C.row,C.col,je]),We=!0,C.col+=1}C.row+=1}o.setDataAtCell(R,null,null,I||"populateFromArray");break}}};function ne(g){const w=v$(g);NT(w)?(o.runHooks("beforeLanguageChange",w),O.language=w,o.runHooks("afterLanguageChange",w)):C$(g)}function ee(g,w){const p=g==="className"?o.rootElement:o.table;if(f)Z(p,w);else{let I=[],k=[];O[g]&&(I=Array.isArray(O[g])?O[g]:PO(O[g])),w&&(k=Array.isArray(w)?w:PO(w));const F=IO(I,k),j=IO(k,I);F.length&&ye(p,F),j.length&&Z(p,j)}O[g]=w}this.init=function(){l.setData(v.data),o.runHooks("beforeInit"),(Wo()||kx())&&Z(o.rootElement,"mobile"),this.updateSettings(e,!0),this.view=new vae(this);const g=v.themeName||$$(o.rootElement);o.useTheme(g),o.view.addClassNameToLicenseElement(o.getCurrentThemeName()),c=MT.getInstance(o,v,G),d=Tle(o),h=new cae(o),Fp(this)&&ple(o),o.runHooks("init"),this.render(),f&&o.rootElement.offsetParent===null&&iY(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 he(){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 ie(g){const w=g.replace(",",".");return isNaN(parseFloat(w))===!1?parseFloat(w):g}function ae(g,w,p){if(!g.length){p();return}const I=o.getActiveEditor(),k=new he;let F=!0;k.onQueueEmpty=()=>{I&&F&&I.cancelChanges(),p()};for(let j=g.length-1;j>=0;j--){const[Y,y]=g[j],R=a.propToCol(y);let C;Number.isInteger(R)?C=o.getCellMeta(Y,R):C={...Object.getPrototypeOf(v),...v},o.getCellValidator(C)&&(k.addValidatorToQueue(),o.validateCell(g[j][3],C,(function(x,A){return function(N){if(typeof N!="boolean")throw new Error("Validation error: result is not boolean");N===!1&&A.allowInvalid===!1&&(F=!1,g.splice(x,1),A.valid=!0),k.removeValidatorFormQueue()}})(j,C),w))}k.checkIfQueueIsEmpty()}function st(g,w){for(let I=g.length-1;I>=0;I--){let k=!1;if(g[I]===null){g.splice(I,1);continue}if(!((g[I][2]===null||g[I][2]===void 0)&&(g[I][3]===null||g[I][3]===void 0))){if(v.allowInsertRow)for(;g[I][0]>o.countRows()-1;){const{delta:F}=a.createRow(void 0,void 0,{source:"auto"});if(F===0){k=!0;break}}if(o.dataType==="array"&&(!v.columns||v.columns.length===0)&&v.allowInsertColumn)for(;a.propToCol(g[I][1])>o.countCols()-1;){const{delta:F}=a.createCol(void 0,void 0,{source:"auto"});if(F===0){k=!0;break}}k||a.set(g[I][0],g[I][1],g[I][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 I=o.getActiveEditor();I&&fe(I.refreshValue)&&I.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,I){let k=o.getCellValidator(w);function F(j){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||w.hidden===!0){p(j);return}const y=w.visualCol,R=w.visualRow,C=o.getCell(R,y,!0);if(C&&C.nodeName!=="TH"){const x=o.rowIndexMapper.getRenderableFromVisualIndex(R),A=o.columnIndexMapper.getRenderableFromVisualIndex(y);o.view._wt.getSetting("cellRenderer",x,A,C)}p(j)}NU(k)&&(k=(function(j){return function(Y,y){y(j.test(Y))}})(k)),at(k)?(g=o.runHooks("beforeValidate",g,w.visualRow,w.prop,I),o._registerImmediate(()=>{k.call(w,g,j=>{o&&(j=o.runHooks("afterValidate",j,g,w.visualRow,w.prop,I),w.valid=j,F(j),o.runHooks("postAfterValidate",j,g,w.visualRow,w.prop,I))})})):o._registerImmediate(()=>{w.valid=!0,F(w.valid,!1)})};function ve(g,w,p){return Array.isArray(g)?g:[[g,w,p]]}function Ie(g,w){const p=o.runHooks("beforeChange",g,w||"edit"),I=g.filter(F=>F!==null);if(p===!1||I.length===0){var k;return(k=o.getActiveEditor())===null||k===void 0||k.cancelChanges(),[]}for(let F=I.length-1;F>=0;F--){const[j,Y,,y]=I[F],R=a.propToCol(Y);let C;Number.isInteger(R)?C=o.getCellMeta(j,R):C={...Object.getPrototypeOf(v),...v};const{type:x,checkedTemplate:A,uncheckedTemplate:N}=C;if(x==="numeric"&&typeof y=="string"&&TY(y)&&(I[F][3]=ie(y)),x==="checkbox"){const W=xt(y),L=W===xt(A),$=W===xt(N);(L||$)&&(I[F][3]=L?A:N)}}return I}this.setDataAtCell=function(g,w,p,I){const k=ve(g,w,p),F=[];let j=I,Y,y,R;for(Y=0,y=k.length;Y<y;Y++){if(typeof k[Y]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof k[Y][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`");k[Y][1]>=this.countCols()?R=k[Y][1]:R=a.colToProp(k[Y][1]),F.push([k[Y][0],R,l.getAtCell(this.toPhysicalRow(k[Y][0]),k[Y][1]),k[Y][2]])}!j&&typeof g=="object"&&(j=w);const C=Ie(F,j);o.runHooks("afterSetDataAtCell",C,j),ae(C,j,()=>{st(C,j)})},this.setDataAtRowProp=function(g,w,p,I){const k=ve(g,w,p),F=[];let j=I,Y,y;for(Y=0,y=k.length;Y<y;Y++)F.push([k[Y][0],k[Y][1],l.getAtCell(this.toPhysicalRow(k[Y][0]),k[Y][1]),k[Y][2]]);!j&&typeof g=="object"&&(j=w);const R=Ie(F,I);o.runHooks("afterSetDataAtRowProp",R,j),ae(R,j,()=>{st(R,j)})},this.listen=function(){o&&!o.isListening()&&(VT.forEach(g=>{o!==g&&g.unlisten()}),FT=o.guid,o.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(FT=null,o.runHooks("afterUnlisten"))},this.isListening=function(){return FT===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&&G.isSelected()&&c.prepareEditor()},this.populateFromArray=function(g,w,p,I,k,F,j){if(!(typeof p=="object"&&typeof p[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const Y=typeof I=="number"?o._createCellCoords(I,k):null;return u.populateFromArray(o._createCellCoords(g,w),p,Y,F,j)},this.spliceCol=function(g,w,p){for(var I=arguments.length,k=new Array(I>3?I-3:0),F=3;F<I;F++)k[F-3]=arguments[F];return a.spliceCol(g,w,p,...k)},this.spliceRow=function(g,w,p){for(var I=arguments.length,k=new Array(I>3?I-3:0),F=3;F<I;F++)k[F-3]=arguments[F];return a.spliceRow(g,w,p,...k)},this.getSelected=function(){if(G.isSelected())return ze(G.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(G.isSelected())return Array.from(G.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(!G.isSelected()||this.countRows()===0||this.countCols()===0)return;const w=[];D(G.getSelectedRange(),p=>{if(p.isSingleHeader())return;const I=p.getTopStartCorner(),k=p.getBottomEndCorner();me(I.row,k.row,F=>{me(I.col,k.col,j=>{this.getCellMeta(F,j).readOnly||w.push([F,j,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:I,height:k}=o.rootElement.getBoundingClientRect(),F=I!==w||k!==p;o.runHooks("beforeRefreshDimensions",{width:w,height:p},{width:I,height:k},F)!==!1&&((F||g._wt.wtOverlays.scrollableElement===o.rootWindow)&&(g.setLastSize(I,k),o.render(),g.adjustElementsSize()),o.runHooks("afterRefreshDimensions",{width:w,height:p},{width:I,height:k},F))},this.updateData=function(g,w){O$(g,p=>{a=p},p=>{a=p,o.columnIndexMapper.fitToLength(this.getInitialColumnCount()),o.rowIndexMapper.fitToLength(this.countSourceRows()),u.adjustRowsAndCols(),G.refresh()},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"updateData",source:w,metaManager:T,firstRun:f})},this.loadData=function(g,w){O$(g,p=>{a=p},()=>{T.clearCellsCache(),o.initIndexMappers(),u.adjustRowsAndCols(),G.refresh(),f&&(f=[null,"loadData"])},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"loadData",source:w,metaManager:T,firstRun:f})},this.getInitialColumnCount=function(){const g=v.columns;let w=0;if(Array.isArray(g))w=g.length;else if(at(g))if(o.dataType==="array"){const p=this.countSourceCols();for(let I=0;I<p;I+=1)g(I)&&(w+=1)}else(o.dataType==="object"||o.dataType==="function")&&(w=a.colToPropCache.length);else if(fe(v.dataSchema)){const p=a.getSchema();w=Array.isArray(p)?p.length:wy(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,I){return At(g)?a.getAll():a.getRange(o._createCellCoords(g,w),o._createCellCoords(p,I),a.DESTINATION_RENDERER)},this.getCopyableText=function(g,w,p,I){return a.getCopyableText(o._createCellCoords(g,w),o._createCellCoords(p,I))},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 I=!1,k,F;if(fe(g.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(fe(g.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(fe(g.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');g.language&&ne(g.language);for(k in g)if(!(k==="data"||k==="language"))if(k==="className")ee("className",g.className);else if(k==="tableClassName"&&o.table)ee("tableClassName",g.tableClassName),o.view._wt.wtOverlays.syncOverlayTableClassNames();else if(oe.getSingleton().isRegistered(k)||oe.getSingleton().isDeprecated(k)){const C=g[k];at(C)?(oe.getSingleton().addAsFixed(k,C,o),v[k]=C):Array.isArray(C)&&(oe.getSingleton().add(k,C,o),v[k]=C)}else!w&&ln(g,k)&&(O[k]=g[k]);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 j=o.countCols(),Y=v.columns;if(Y&&at(Y)&&(I=!0),(g.cell!==void 0||g.cells!==void 0||g.columns!==void 0)&&T.clearCache(),j>0)for(k=0,F=0;k<j;k++){if(Y){const C=I?Y(k):Y[F];C&&T.updateColumnMeta(F,C)}F+=1}fe(g.cell)&&ke(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(at(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;at(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(),x=ln(g,"themeName");C&&x&&C!==g.themeName&&(o.view.getStylesHandler().removeClassNames(),o.view.removeClassNameFromLicenseElement(C));const A=x&&g.themeName||$$(o.rootElement);o.useTheme(A),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(at(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,I,k){u.alter(g,w,p,I,k)},this.getCell=function(g,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,I=w,k=g;if(w>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(w)))return null;I=this.columnIndexMapper.getRenderableFromVisualIndex(w)}if(g>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(g)))return null;k=this.rowIndexMapper.getRenderableFromVisualIndex(g)}return k===null||I===null||k===void 0||I===void 0?null:o.view.getCellAtCoords(o._createCellCoords(k,I),p)},this.getCoords=function(g){const w=this.view._wt.wtTable.getCoords(g);if(w===null)return null;const{row:p,col:I}=w;let k=p,F=I;return p>=0&&(k=this.rowIndexMapper.getVisualFromRenderableIndex(p)),I>=0&&(F=this.columnIndexMapper.getVisualFromRenderableIndex(I)),o._createCellCoords(k,F)},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 I=0;I<p.length;I+=1)for(let k=0;k<p[I].length;k+=1)w.push(p[I][k]);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 I=0;I<p.length;I+=1)for(let k=0;k<p[I].length;k+=1)w.push(p[I][k]);return w},this.getSourceData=function(g,w,p,I){let k;return g===void 0?k=l.getData():k=l.getByRange(o._createCellCoords(g,w),o._createCellCoords(p,I)),k},this.getSourceDataArray=function(g,w,p,I){let k;return g===void 0?k=l.getData(!0):k=l.getByRange(o._createCellCoords(g,w),o._createCellCoords(p,I),!0),k},this.getSourceDataAtCol=function(g){return l.getAtColumn(g)},this.setSourceDataAtCell=function(g,w,p,I){const k=ve(g,w,p),F=this.hasHook("afterSetSourceDataAtCell"),j=[];F&&D(k,y=>{let[R,C,x]=y;j.push([R,C,l.getAtCell(R,C),x])}),D(k,y=>{let[R,C,x]=y;l.setAtCell(R,C,x)}),F&&this.runHooks("afterSetSourceDataAtCell",j,I),this.render();const Y=o.getActiveEditor();Y&&fe(Y.refreshValue)&&Y.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,I){const k=g===void 0?[0,0,this.countRows(),this.countCols()]:[g,w,p,I],[F,j]=k;let[,,Y,y]=k,R=null,C=null;Y===void 0&&(Y=F),y===void 0&&(y=j);let x="mixed";return me(Math.max(Math.min(F,Y),0),Math.max(F,Y),A=>{let N=!0;return me(Math.max(Math.min(j,y),0),Math.max(j,y),W=>(C=this.getCellMeta(A,W).type,R?N=R===C:R=C,N)),x=N?C:"mixed",N}),x},this.removeCellMeta=function(g,w,p){const[I,k]=[this.toPhysicalRow(g),this.toPhysicalColumn(w)];let F=T.getCellMetaKeyValue(I,k,p);o.runHooks("beforeRemoveCellMeta",g,w,p,F)!==!1&&(T.removeCellMeta(I,k,p),o.runHooks("afterRemoveCellMeta",g,w,p,F)),F=null},this.spliceCellsMeta=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var p=arguments.length,I=new Array(p>2?p-2:0),k=2;k<p;k++)I[k-2]=arguments[k];if(I.length>0&&!Array.isArray(I[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");w>0&&T.removeRow(this.toPhysicalRow(g),w),I.length>0&&D(I.reverse(),F=>{T.createRow(this.toPhysicalRow(g)),D(F,(j,Y)=>this.setCellMetaObject(g,Y,j))}),o.render()},this.setCellMetaObject=function(g,w,p){typeof p=="object"&&ke(p,(I,k)=>{this.setCellMeta(g,w,k,I)})},this.setCellMeta=function(g,w,p,I){if(o.runHooks("beforeSetCellMeta",g,w,p,I)===!1)return;let F=g,j=w;g<this.countRows()&&(F=this.toPhysicalRow(g)),w<this.countCols()&&(j=this.toPhysicalColumn(w)),T.setCellMeta(F,j,p,I),o.runHooks("afterSetCellMeta",g,w,p,I)},this.getCellsMeta=function(){return T.getCellsMeta()},this.getCellMeta=function(g,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipMetaExtension:!1},I=this.toPhysicalRow(g),k=this.toPhysicalColumn(w);return I===null&&(I=g),k===null&&(k=w),T.getCellMeta(I,k,{visualRow:g,visualColumn:w,...p})},this.getColumnMeta=function(g){return T.getColumnMeta(this.toPhysicalColumn(g))},this.getCellMetaAtRow=function(g){return T.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"?GS(p):At(p)?GS("text"):p},this.getCellEditor=function(g,w){const p=typeof g=="number"?o.getCellMeta(g,w).editor:g.editor;return typeof p=="string"?lb(p):At(p)?lb("text"):p},this.getCellValidator=function(g,w){const p=typeof g=="number"?o.getCellMeta(g,w).validator:g.validator;return typeof p=="string"?oK(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 I=new he;g&&(I.onQueueEmpty=g);let k=o.countRows()-1;for(;k>=0;){if(w!==void 0&&w.indexOf(k)===-1){k-=1;continue}let F=o.countCols()-1;for(;F>=0;){if(p!==void 0&&p.indexOf(F)===-1){F-=1;continue}I.addValidatorToQueue(),o.validateCell(o.getDataAtCell(k,F),o.getCellMeta(k,F),j=>{if(typeof j!="boolean")throw new Error("Validation error: result is not boolean");j===!1&&(I.valid=!1),I.removeValidatorFormQueue()},"validateCells"),F-=1}k-=1}I.checkIfQueueIsEmpty()},this.getRowHeader=function(g){let w=v.rowHeaders,p=g;return p!==void 0&&(p=o.runHooks("modifyRowHeader",p)),p===void 0?(w=[],me(o.countRows()-1,I=>{w.push(o.getRowHeader(I))})):Array.isArray(w)&&w[p]!==void 0?w=w[p]:at(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 Y=[],y=o.countCols();for(let R=0;R<y;R++)Y.push(o.getColHeader(R));return Y}let I=v.colHeaders;const k=function(Y){const y=[],R=o.countCols();let C=0;for(;C<R;C++)at(v.columns)&&v.columns(C)&&y.push(C);return y[Y]},F=o.toPhysicalColumn(p),j=k(F);return v.colHeaders===!1?I=null:v.columns&&at(v.columns)&&v.columns(j)&&v.columns(j).title?I=v.columns(j).title:v.columns&&v.columns[F]&&v.columns[F].title?I=v.columns[F].title:Array.isArray(v.colHeaders)&&v.colHeaders[F]!==void 0?I=v.colHeaders[F]:at(v.colHeaders)?I=v.colHeaders(F):v.colHeaders&&typeof v.colHeaders!="string"&&typeof v.colHeaders!="number"&&(I=nJ(p)),I=o.runHooks("modifyColumnHeaderValue",I,g,w),I},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=fu),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 Ux(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 Ux(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,I){let k=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,F=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return At(g)||At(w)?!1:this.selectCells([[g,w,p,I]],k,F)},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 I=G.selectCells(g);return I&&p&&o.listen(),d.resume(),I},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 G.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 G.selectRows(g,w,p)},this.deselectCell=function(){G.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(),G.selectAll(g,w,p)};const pt=(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:I,col:k,considerHiddenIndexes:F}=g??{};let j=I,Y=k;if(at(w)&&this.addHookOnce("afterScroll",w),F===void 0||F){const x=Number.isInteger(I)&&I>=0,A=Number.isInteger(k)&&k>=0,N=x?pt(this.rowIndexMapper,I):void 0,W=A?pt(this.columnIndexMapper,k):void 0;if(N===null||W===null)return!1;j=x?o.rowIndexMapper.getRenderableFromVisualIndex(N):I,Y=A?o.columnIndexMapper.getRenderableFromVisualIndex(W):k}const y=Number.isInteger(j),R=Number.isInteger(Y);let C=!1;return y&&j>=0&&R&&Y>=0?C=o.view.scrollViewport(o._createCellCoords(j,Y),g.horizontalSnap,g.verticalSnap):y&&j>=0&&(R&&Y<0||!R)?C=o.view.scrollViewportVertically(j,g.verticalSnap):R&&Y>=0&&(y&&j<0||!y)&&(C=o.view.scrollViewportHorizontally(Y,g.horizontalSnap)),at(w)&&(C?this.view.render():(this.removeHook("afterScroll",w),this._registerMicrotask(()=>w()))),C},this.scrollToFocusedCell=function(g){if(!this.selection.isSelected())return!1;at(g)&&this.addHookOnce("afterScroll",g);const{highlight:w}=this.getSelectedRangeLast(),p=this.scrollViewportTo(w.toObject());return p?this.view.render():at(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(),T.clearCache(),VT.delete(this.guid),Fp(o)){const g=this.rootDocument.querySelector(".hot-display-license-info");g&&g.parentNode.removeChild(g)}Fo(o.rootElement),s.destroy(),c&&c.destroy(),o.batchExecution(()=>{o.rowIndexMapper.unregisterAll(),o.columnIndexMapper.unregisterAll(),P.getItems().forEach(g=>{let[,w]=g;w.destroy()}),P.clear(),o.runHooks("afterDestroy")},!0),oe.getSingleton().destroy(o),ke(o,(g,w,p)=>{at(g)?p[w]=Xt(w):w!=="guid"&&(p[w]=null)}),o.isDestroyed=!0,a&&a.destroy(),a=null,u=null,G=null,c=null,o=null};function Xt(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 P.getItem(mi(g))},this.getPluginName=function(g){return g===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:P.getId(g)},this.getInstance=function(){return o},this.addHook=function(g,w,p){oe.getSingleton().add(g,w,o,p)},this.hasHook=function(g){return oe.getSingleton().has(g,o)||oe.getSingleton().has(g)},this.addHookOnce=function(g,w,p){oe.getSingleton().once(g,w,o,p)},this.removeHook=function(g,w){oe.getSingleton().remove(g,w,o)},this.runHooks=function(g,w,p,I,k,F,j){return oe.getSingleton().run(o,g,w,p,I,k,F,j)},this.getTranslatedPhrase=function(g,w){return E$(v.language,g,w)},this.toHTML=()=>VN(this),this.toTableElement=()=>{const g=this.rootDocument.createElement("div");return g.insertAdjacentHTML("afterbegin",VN(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(){D(this.timeouts,g=>{clearTimeout(g)})},this.immediates=[],this._registerImmediate=function(g){this.immediates.push(setImmediate(g))},this._clearImmediates=function(){D(this.immediates,g=>{clearImmediate(g)})},this._registerMicrotask=function(g){this.rootWindow.queueMicrotask(()=>{this.isDestroyed||g()})},this._getEditorManager=function(){return c};const K=xle({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&&K.releasePressedKeys()}),this.getShortcutManager=function(){return K},this.getFocusManager=function(){return h},lH().forEach(g=>{const w=tR(g);P.addItem(g,new w(this))}),RG(o),K.setActiveContextName("grid"),oe.getSingleton().run(o,"construct")}bi(rH),Ve.editors={BaseEditor:ru};function Ve(t,e){const n=new F$(t,e||{},PT);return n.init(),n}Ve.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new F$(t,e,PT)},Ve.DefaultSettings=T$(),Ve.hooks=oe.getSingleton(),Ve.CellCoords=Va,Ve.CellRange=ah,Ve.packageName="handsontable",Ve.buildDate="24/04/2025 10:59:00",Ve.version="15.3.0",Ve.languages={dictionaryKeys:Oae,getLanguageDictionary:R$,getLanguagesDictionaries:Dae,registerLanguageDictionary:S$,getTranslatedPhrase:E$};function WT(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 Ale(t){if(Array.isArray(t))return WT(t)}function Hle(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Yd(t,e,n){return e=Zp(e),Vle(t,W$()?Reflect.construct(e,n||[],Zp(t).constructor):e.apply(t,n))}function mc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function V$(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,j$(r.key),r)}}function pc(t,e,n){return e&&V$(t.prototype,e),n&&V$(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Nle(t,e,n){return(e=j$(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zp(t){return Zp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zp(t)}function Gd(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&&BT(t,e)}function W$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(W$=function(){return!!t})()}function Dle(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function kle(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
86
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B$(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?B$(Object(n),!0).forEach(function(r){Nle(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):B$(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function $le(t,e){if(t==null)return{};var n,r,i=Fle(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 Fle(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 Vle(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 Hle(t)}function BT(t,e){return BT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},BT(t,e)}function Wle(t){return Ale(t)||Dle(t)||jle(t)||kle()}function Ble(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 j$(t){var e=Ble(t,"string");return typeof e=="symbol"?e:e+""}function $r(t){"@babel/helpers - typeof";return $r=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},$r(t)}function jle(t,e){if(t){if(typeof t=="string")return WT(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)?WT(t,e):void 0}}var jT=null,Ule="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.",zle="The Handsontable instance bound to this component was destroyed and cannot be used properly.",Qp="global",Yle="hot-wrapper-editor-container";function Gle(){if(typeof console<"u"){var t;(t=console).warn.apply(t,arguments)}}function UT(t,e){var n=wt.Children.toArray(t),r=wt.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 U$(t){return t?t.type.WrappedComponent?t.type.WrappedComponent:t.type:null}function z$(t,e){if(typeof t>"u"||e===null)return null;var n=G$(e.props,!1);return n.className="".concat(Yle," ").concat(n.className),Xd.createPortal(wt.createElement("div",Object.assign({},n),e),t.body)}function Y$(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qp,r=UT(t,"hot-editor"),i=U$(r);return r?wt.cloneElement(r,{emitEditorInstance:function(s,a){e.get(i)||e.set(i,new Map);var l=e.get(i);l.set(a??Qp,s)},editorColumnScope:n,isEditor:!0}):null}function qle(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),jT||(jT=n.createDocumentFragment());var o=i??n.createElement("DIV");jT.appendChild(o);var s=wt.cloneElement(t,Lle({key:"".concat(e.row,"-").concat(e.col)},e));return{portal:Xd.createPortal(s,o,r),portalContainer:o}}function G$(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 Kle(){return typeof window<"u"}var q$=(function(){function t(){mc(this,t)}return pc(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(b){return!a&&u.includes(b)?o[b]===n[b]:!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}}])})(),Xle=(function(t){function e(){return mc(this,e),Yd(this,e,arguments)}return Gd(e,t),pc(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 Y$(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=q$.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=z$(r,this.getLocalEditorElement());return wt.createElement(wt.Fragment,null,i)}}])})(wt.Component),Zle=(function(t){function e(){var n;return mc(this,e),n=Yd(this,e,arguments),n.state={portals:[]},n}return Gd(e,t),pc(e,[{key:"render",value:function(){return wt.createElement(wt.Fragment,null,this.state.portals)}}])})(wt.Component),Qle="15.3.0";function Jle(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var zT={exports:{}},Jp={exports:{}},ht={},K$;function eue(){if(K$)return ht;K$=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,S=t?Symbol.for("react.block"):60121,b=t?Symbol.for("react.fundamental"):60117,T=t?Symbol.for("react.responder"):60118,v=t?Symbol.for("react.scope"):60119;function O(_){if($r(_)==="object"&&_!==null){var M=_.$$typeof;switch(M){case e:switch(_=_.type,_){case l:case u:case r:case o:case i:case h:return _;default:switch(_=_&&_.$$typeof,_){case a:case c:case m:case f:case s:return _;default:return M}}case n:return M}}}function P(_){return O(_)===u}return ht.AsyncMode=l,ht.ConcurrentMode=u,ht.ContextConsumer=a,ht.ContextProvider=s,ht.Element=e,ht.ForwardRef=c,ht.Fragment=r,ht.Lazy=m,ht.Memo=f,ht.Portal=n,ht.Profiler=o,ht.StrictMode=i,ht.Suspense=h,ht.isAsyncMode=function(_){return P(_)||O(_)===l},ht.isConcurrentMode=P,ht.isContextConsumer=function(_){return O(_)===a},ht.isContextProvider=function(_){return O(_)===s},ht.isElement=function(_){return $r(_)==="object"&&_!==null&&_.$$typeof===e},ht.isForwardRef=function(_){return O(_)===c},ht.isFragment=function(_){return O(_)===r},ht.isLazy=function(_){return O(_)===m},ht.isMemo=function(_){return O(_)===f},ht.isPortal=function(_){return O(_)===n},ht.isProfiler=function(_){return O(_)===o},ht.isStrictMode=function(_){return O(_)===i},ht.isSuspense=function(_){return O(_)===h},ht.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===r||_===u||_===o||_===i||_===h||_===d||$r(_)==="object"&&_!==null&&(_.$$typeof===m||_.$$typeof===f||_.$$typeof===s||_.$$typeof===a||_.$$typeof===c||_.$$typeof===b||_.$$typeof===T||_.$$typeof===v||_.$$typeof===S)},ht.typeOf=O,ht}var dt={},X$;function tue(){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,S=t?Symbol.for("react.block"):60121,b=t?Symbol.for("react.fundamental"):60117,T=t?Symbol.for("react.responder"):60118,v=t?Symbol.for("react.scope"):60119;function O(C){return typeof C=="string"||typeof C=="function"||C===r||C===u||C===o||C===i||C===h||C===d||$r(C)==="object"&&C!==null&&(C.$$typeof===m||C.$$typeof===f||C.$$typeof===s||C.$$typeof===a||C.$$typeof===c||C.$$typeof===b||C.$$typeof===T||C.$$typeof===v||C.$$typeof===S)}function P(C){if($r(C)==="object"&&C!==null){var x=C.$$typeof;switch(x){case e:var A=C.type;switch(A){case l:case u:case r:case o:case i:case h:return A;default:var N=A&&A.$$typeof;switch(N){case a:case c:case m:case f:case s:return N;default:return x}}case n:return x}}}var _=l,M=u,H=a,X=s,G=e,U=c,ne=r,ee=m,he=f,ie=n,ae=o,st=i,ve=h,Ie=!1;function pt(C){return Ie||(Ie=!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.")),Xt(C)||P(C)===l}function Xt(C){return P(C)===u}function K(C){return P(C)===a}function g(C){return P(C)===s}function w(C){return $r(C)==="object"&&C!==null&&C.$$typeof===e}function p(C){return P(C)===c}function I(C){return P(C)===r}function k(C){return P(C)===m}function F(C){return P(C)===f}function j(C){return P(C)===n}function Y(C){return P(C)===o}function y(C){return P(C)===i}function R(C){return P(C)===h}dt.AsyncMode=_,dt.ConcurrentMode=M,dt.ContextConsumer=H,dt.ContextProvider=X,dt.Element=G,dt.ForwardRef=U,dt.Fragment=ne,dt.Lazy=ee,dt.Memo=he,dt.Portal=ie,dt.Profiler=ae,dt.StrictMode=st,dt.Suspense=ve,dt.isAsyncMode=pt,dt.isConcurrentMode=Xt,dt.isContextConsumer=K,dt.isContextProvider=g,dt.isElement=w,dt.isForwardRef=p,dt.isFragment=I,dt.isLazy=k,dt.isMemo=F,dt.isPortal=j,dt.isProfiler=Y,dt.isStrictMode=y,dt.isSuspense=R,dt.isValidElementType=O,dt.typeOf=P})()),dt}var Z$;function Q$(){return Z$||(Z$=1,process.env.NODE_ENV==="production"?Jp.exports=eue():Jp.exports=tue()),Jp.exports}var YT,J$;function nue(){if(J$)return YT;J$=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 YT=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},YT}var GT,eF;function qT(){if(eF)return GT;eF=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return GT=t,GT}var KT,tF;function nF(){return tF||(tF=1,KT=Function.call.bind(Object.prototype.hasOwnProperty)),KT}var XT,rF;function rue(){if(rF)return XT;rF=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=qT(),n={},r=nF();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 `"+$r(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 "+$r(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={})},XT=i,XT}var ZT,iF;function iue(){if(iF)return ZT;iF=1;var t=Q$(),e=nue(),n=qT(),r=nF(),i=rue(),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 ZT=function(l,u){var c=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function d(K){var g=K&&(c&&K[c]||K[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:O(),arrayOf:P,element:_(),elementType:M(),instanceOf:H,node:ne(),objectOf:G,oneOf:X,oneOfType:U,shape:he,exact:ie};function S(K,g){return K===g?K!==0||1/K===1/g:K!==K&&g!==g}function b(K,g){this.message=K,this.data=g&&$r(g)==="object"?g:{},this.stack=""}b.prototype=Error.prototype;function T(K){if(process.env.NODE_ENV!=="production")var g={},w=0;function p(k,F,j,Y,y,R,C){if(Y=Y||f,R=R||j,C!==n){if(u){var x=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 x.name="Invariant Violation",x}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var A=Y+":"+j;!g[A]&&w<3&&(o("You are manually calling a React.PropTypes validation function for the `"+R+"` prop on `"+Y+"`. 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[A]=!0,w++)}}return F[j]==null?k?F[j]===null?new b("The "+y+" `"+R+"` is marked as required "+("in `"+Y+"`, but its value is `null`.")):new b("The "+y+" `"+R+"` is marked as required in "+("`"+Y+"`, but its value is `undefined`.")):null:K(F,j,Y,y,R)}var I=p.bind(null,!1);return I.isRequired=p.bind(null,!0),I}function v(K){function g(w,p,I,k,F,j){var Y=w[p],y=ve(Y);if(y!==K){var R=Ie(Y);return new b("Invalid "+k+" `"+F+"` of type "+("`"+R+"` supplied to `"+I+"`, expected ")+("`"+K+"`."),{expectedType:K})}return null}return T(g)}function O(){return T(s)}function P(K){function g(w,p,I,k,F){if(typeof K!="function")return new b("Property `"+F+"` of component `"+I+"` has invalid PropType notation inside arrayOf.");var j=w[p];if(!Array.isArray(j)){var Y=ve(j);return new b("Invalid "+k+" `"+F+"` of type "+("`"+Y+"` supplied to `"+I+"`, expected an array."))}for(var y=0;y<j.length;y++){var R=K(j,y,I,k,F+"["+y+"]",n);if(R instanceof Error)return R}return null}return T(g)}function _(){function K(g,w,p,I,k){var F=g[w];if(!l(F)){var j=ve(F);return new b("Invalid "+I+" `"+k+"` of type "+("`"+j+"` supplied to `"+p+"`, expected a single ReactElement."))}return null}return T(K)}function M(){function K(g,w,p,I,k){var F=g[w];if(!t.isValidElementType(F)){var j=ve(F);return new b("Invalid "+I+" `"+k+"` of type "+("`"+j+"` supplied to `"+p+"`, expected a single ReactElement type."))}return null}return T(K)}function H(K){function g(w,p,I,k,F){if(!(w[p]instanceof K)){var j=K.name||f,Y=Xt(w[p]);return new b("Invalid "+k+" `"+F+"` of type "+("`"+Y+"` supplied to `"+I+"`, expected ")+("instance of `"+j+"`."))}return null}return T(g)}function X(K){if(!Array.isArray(K))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,I,k,F){for(var j=w[p],Y=0;Y<K.length;Y++)if(S(j,K[Y]))return null;var y=JSON.stringify(K,function(C,x){var A=Ie(x);return A==="symbol"?String(x):x});return new b("Invalid "+k+" `"+F+"` of value `"+String(j)+"` "+("supplied to `"+I+"`, expected one of "+y+"."))}return T(g)}function G(K){function g(w,p,I,k,F){if(typeof K!="function")return new b("Property `"+F+"` of component `"+I+"` has invalid PropType notation inside objectOf.");var j=w[p],Y=ve(j);if(Y!=="object")return new b("Invalid "+k+" `"+F+"` of type "+("`"+Y+"` supplied to `"+I+"`, expected an object."));for(var y in j)if(r(j,y)){var R=K(j,y,I,k,F+"."+y,n);if(R instanceof Error)return R}return null}return T(g)}function U(K){if(!Array.isArray(K))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var g=0;g<K.length;g++){var w=K[g];if(typeof w!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+pt(w)+" at index "+g+"."),s}function p(I,k,F,j,Y){for(var y=[],R=0;R<K.length;R++){var C=K[R],x=C(I,k,F,j,Y,n);if(x==null)return null;x.data&&r(x.data,"expectedType")&&y.push(x.data.expectedType)}var A=y.length>0?", expected one of type ["+y.join(", ")+"]":"";return new b("Invalid "+j+" `"+Y+"` supplied to "+("`"+F+"`"+A+"."))}return T(p)}function ne(){function K(g,w,p,I,k){return ae(g[w])?null:new b("Invalid "+I+" `"+k+"` supplied to "+("`"+p+"`, expected a ReactNode."))}return T(K)}function ee(K,g,w,p,I){return new b((K||"React class")+": "+g+" type `"+w+"."+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+I+"`.")}function he(K){function g(w,p,I,k,F){var j=w[p],Y=ve(j);if(Y!=="object")return new b("Invalid "+k+" `"+F+"` of type `"+Y+"` "+("supplied to `"+I+"`, expected `object`."));for(var y in K){var R=K[y];if(typeof R!="function")return ee(I,k,F,y,Ie(R));var C=R(j,y,I,k,F+"."+y,n);if(C)return C}return null}return T(g)}function ie(K){function g(w,p,I,k,F){var j=w[p],Y=ve(j);if(Y!=="object")return new b("Invalid "+k+" `"+F+"` of type `"+Y+"` "+("supplied to `"+I+"`, expected `object`."));var y=e({},w[p],K);for(var R in y){var C=K[R];if(r(K,R)&&typeof C!="function")return ee(I,k,F,R,Ie(C));if(!C)return new b("Invalid "+k+" `"+F+"` key `"+R+"` supplied to `"+I+"`.\nBad object: "+JSON.stringify(w[p],null," ")+`
|
|
87
|
-
Valid keys: `+JSON.stringify(Object.keys(K),null," "));var x=C(j,R,I,k,F+"."+R,n);if(x)return x}return null}return T(g)}function ae(K){switch($r(K)){case"number":case"string":case"undefined":return!0;case"boolean":return!K;case"object":if(Array.isArray(K))return K.every(ae);if(K===null||l(K))return!0;var g=d(K);if(g){var w=g.call(K),p;if(g!==K.entries){for(;!(p=w.next()).done;)if(!ae(p.value))return!1}else for(;!(p=w.next()).done;){var I=p.value;if(I&&!ae(I[1]))return!1}}else return!1;return!0;default:return!1}}function st(K,g){return K==="symbol"?!0:g?g["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&g instanceof Symbol:!1}function ve(K){var g=$r(K);return Array.isArray(K)?"array":K instanceof RegExp?"object":st(g,K)?"symbol":g}function Ie(K){if(typeof K>"u"||K===null)return""+K;var g=ve(K);if(g==="object"){if(K instanceof Date)return"date";if(K instanceof RegExp)return"regexp"}return g}function pt(K){var g=Ie(K);switch(g){case"array":case"object":return"an "+g;case"boolean":case"date":case"regexp":return"a "+g;default:return g}}function Xt(K){return!K.constructor||!K.constructor.name?f:K.constructor.name}return m.checkPropTypes=i,m.resetWarningCache=i.resetWarningCache,m.PropTypes=m,m},ZT}var QT,oF;function oue(){if(oF)return QT;oF=1;var t=qT();function e(){}function n(){}return n.resetWarningCache=e,QT=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},QT}if(process.env.NODE_ENV!=="production"){var sue=Q$(),aue=!0;zT.exports=iue()(sue.isElement,aue)}else zT.exports=oue()();var lue=zT.exports,JT=Jle(lue),e_=(function(t){function e(){var n;return mc(this,e),n=Yd(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 Gd(e,t),pc(e,[{key:"hotInstance",get:function(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn(zle),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 Kle()?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(),S="".concat(l,"-").concat(u),b=s.guid,T="".concat(b,"-").concat(S),v="".concat(S,"-").concat(b);if(f.has(S)&&(a.innerHTML=f.get(S).innerHTML),a&&!a.getAttribute("ghost-table")){for(var O=i.portalCache.get(v),P=m.get(T);a.firstChild;)a.removeChild(a.firstChild);if(O&&P)a.appendChild(P);else{var _=qle(r,{TD:a,row:l,col:u,prop:c,value:h,cellProperties:d,isRenderer:!0},a.ownerDocument,v,P),M=_.portal,H=_.portalContainer;m.set(T,H),a.appendChild(H),i.portalCache.set(v,M)}}return f.set(S,a),a}}},{key:"getEditorClass",value:function(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qp,s=U$(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 mc(this,s),l=Yd(this,s,[a]),r.hotCustomEditorInstance=l,l.editorComponent=r,l}return Gd(s,o),pc(s,[{key:"focus",value:function(){}},{key:"getValue",value:function(){}},{key:"setValue",value:function(){}},{key:"open",value:function(){}},{key:"close",value:function(){}}])})(Ve.editors.BaseEditor);return Object.getOwnPropertyNames(Ve.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 UT(this.props.children,"hot-renderer")}},{key:"getGlobalEditorElement",value:function(){return Y$(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=q$.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,Qp);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=lb("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=GS("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&&Gle(Ule)}},{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:Wle(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 Ve.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===Xle},o=wt.Children.toArray(this.props.children),s=o.filter(function(u){return i(u)}).map(function(u,c){return wt.cloneElement(u,{_componentRendererColumns:r.componentRendererColumns,_emitColumnSettings:r.setHotColumnSettings.bind(r),_columnIndex:c,_getChildElementByType:UT.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=G$(this.props),l=z$(this.getOwnerDocument(),this.getGlobalEditorElement());return wt.createElement(wt.Fragment,null,wt.createElement("div",Object.assign({ref:this.setHotElementRef.bind(this)},a),s),wt.createElement(Zle,{ref:this.setRenderersPortalManagerRef.bind(this)}),l)}}],[{key:"version",get:function(){return Qle}}])})(wt.Component);e_.propTypes={style:JT.object,id:JT.string,className:JT.string};var uue=["children"],sF=wt.forwardRef(function(t,e){var n,r=t.children,i=$le(t,uue),o=typeof wt.useId=="function"?wt.useId():void 0,s=(n=i.id)!==null&&n!==void 0?n:o;return wt.createElement(e_,Object.assign({id:s},i,{ref:e}),r)});sF.version=e_.version,wt.Component,Zse();const aF="wds-editable-table__required-indicator",lF=Cs.forwardRef(({autoWrapCol:t=!0,autoWrapRow:e=!0,afterRender:n,beforeContextMenuShow:r,requiredColumns:i=[],...o},s)=>{const a=Cs.useRef(null),l=s??a;return Cs.createElement("div",{onKeyDown:u=>{if(u.key==="Escape"){const c=l.current?.hotInstance?.getActiveEditor();c&&c.isOpened()&&(u.stopPropagation(),c.close(),c.finishEditing(!0))}}},Cs.createElement(sF,{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&&Xd.render(Cs.createElement(c_.Icon,{icon:"chevron-down",size:"xs",color:"grey-medium"}),h)}),n&&n(u)},afterGetColHeader:(u,c)=>{if(i.includes(u)&&!c.querySelector(`.${aF}`)){const h=document.createElement("span");c.insertBefore(h,c.firstChild),Xd.render(Cs.createElement(c_.Icon,{icon:"asterisk",size:"xs",color:"red-medium","aria-label":"Required",className:aF}),h)}},licenseKey:"c0365-d23e1-f7d91-a482d-2be12",...o}))}),cue={"Editable Tables":{components:[lF],description:()=>Cs.createElement(Cs.Fragment,null),examples:{}}};Wi.EditableTable=lF,Wi.MANIFEST=cue,Object.defineProperty(Wi,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"})}));
|