adminizer 4.0.0-commit.f9bffe6 → 4.1.0-build.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +36 -0
- package/assets/VanillaJSONEditor-EdDEEERs.js +3833 -0
- package/assets/add-CXBzlfCv.js +1 -0
- package/assets/add-form-C1pPO9IW.js +1 -0
- package/assets/add-group-BIVpnHvQ.js +1 -0
- package/assets/add-group-form-BWu1FoyP.js +1 -0
- package/assets/add-user-BXbPJ4kC.js +1 -0
- package/assets/add-user-form-Dm9-szTc.js +1 -0
- package/assets/{app-DiNg6K-6.css → app-DMmad2-f.css} +6 -6
- package/assets/{app-layout-CLIcmUo6.js → app-layout-HvBcNP7X.js} +1 -1
- package/assets/app-shell-CeSqdfTT.js +1 -0
- package/assets/app-sidebar-BtgeHCOh.js +1 -0
- package/assets/{app-sidebar-header-C5wVa7ER.js → app-sidebar-header-pNKH1knV.js} +2 -2
- package/assets/app.js +33 -33
- package/assets/{breadcrumbs-DlS-hpHL.js → breadcrumbs-CQNon4Vl.js} +1 -1
- package/assets/{button-CcO4Q6h6.js → button-CQ9t1kLz.js} +1 -1
- package/assets/checkbox-W0nGAXIj.js +1 -0
- package/assets/dashboard-DOZBrGfi.js +1 -0
- package/assets/{date-picker-DMW7NWSI.js → date-picker-B__dVVqj.js} +2 -2
- package/assets/dropdown-menu-SEBnEIiL.js +1 -0
- package/assets/{field-renderer-CvC9UdC0.js → field-renderer-hXvJ0krZ.js} +139 -139
- package/assets/form-BMkoRYG6.js +1 -0
- package/assets/form-yYsjEajF.js +1 -0
- package/assets/{geo-json-BVpmaj6P.js → geo-json-paEzaL-W.js} +1 -1
- package/assets/handsontable-Wf0rBy4A.js +347 -0
- package/assets/home-BGYylio4.js +2 -0
- package/assets/{icon-CgDnRol2.js → icon-Bz9BMaD0.js} +1 -1
- package/assets/index-BC0yfOHo.js +1 -0
- package/assets/index-BbXEMx9n.js +1 -0
- package/assets/index-BcE9FUM6.js +1 -0
- package/assets/index-C0SL3SHw.js +41 -0
- package/assets/index-Cdb9ACvz.js +1 -0
- package/assets/index-D5ir9iUV.js +1 -0
- package/assets/index-DEk3sC8d.js +1 -0
- package/assets/index-DTRTjOmh.js +10 -0
- package/assets/index-DrWfGwtf.js +1 -0
- package/assets/index-K81GbF6O.js +1 -0
- package/assets/init-user-D9K13Tol.js +1 -0
- package/assets/{input-coEb8Hta.js → input-DF7Ue23C.js} +1 -1
- package/assets/{input-error-Dt30bqav.js → input-error-BBygona6.js} +1 -1
- package/assets/{label-BH_NLtVH.js → label-Z506NKsW.js} +1 -1
- package/assets/{list-table-CJgy5FsP.js → list-table-CE3swbOx.js} +3 -3
- package/assets/list-vQjhDdnO.js +1 -0
- package/assets/login-BKGj0WOS.js +6 -0
- package/assets/manifest.json +552 -601
- package/assets/{material-icon-DpKyAc3Z.js → material-icon-CItZiB53.js} +1 -1
- package/assets/module-BtDdcMyj.js +1 -0
- package/assets/multi-select-DOrUHH4A.js +11 -0
- package/assets/nav-footer-BoqrRyzw.js +1 -0
- package/assets/nav-main-BL-Hmm6O.js +1 -0
- package/assets/nav-user-KahV1IDw.js +1 -0
- package/assets/{pagination-render-S4EXTE9a.js → pagination-render-B57pOpFy.js} +1 -1
- package/assets/popover-I249Gg2O.js +1 -0
- package/assets/register-r-RETuTI.js +1 -0
- package/assets/select-D1N8zRPY.js +6 -0
- package/assets/{sidebar-C9-ESAx1.js → sidebar-VU5deMRj.js} +1 -1
- package/assets/{toast-editor-X2U_pFls.js → toast-editor-BQpTg1Td.js} +43 -43
- package/assets/tooltip-D2ehgLlB.js +1 -0
- package/assets/user-info-DBYoAJYJ.js +9 -0
- package/assets/{user-menu-content-D25M1xxo.js → user-menu-content-qkvdkUVd.js} +2 -2
- package/assets/utils-DjqsqOe8.js +1 -0
- package/assets/welcome-Z0ubrSPJ.js +1 -0
- package/controllers/add.js +1 -1
- package/controllers/addGroup.js +1 -1
- package/controllers/addUser.js +1 -1
- package/controllers/catalog/Catalog.js +1 -1
- package/controllers/ckeditorUpload.js +1 -1
- package/controllers/dashboard.js +1 -1
- package/controllers/edit.js +1 -1
- package/controllers/editGroup.js +1 -1
- package/controllers/editUser.js +1 -1
- package/controllers/form.js +1 -1
- package/controllers/getAllWidgets.js +1 -1
- package/controllers/initUser.js +1 -1
- package/controllers/list.js +1 -1
- package/controllers/login.js +3 -1
- package/controllers/media-manager/mediaManagerApi.js +1 -1
- package/controllers/navigation/edit.js +1 -1
- package/controllers/processInstallFinalize.js +1 -1
- package/controllers/processInstallStep.js +1 -1
- package/controllers/register.js +1 -1
- package/controllers/remove.js +1 -1
- package/controllers/timezones.js +1 -1
- package/controllers/view.js +1 -1
- package/controllers/welcome.js +1 -1
- package/controllers/widgets/Action.js +1 -1
- package/controllers/widgets/Custom.js +1 -1
- package/controllers/widgets/Info.js +1 -1
- package/controllers/widgets/switch.js +1 -1
- package/controllers/widgetsDB.js +1 -1
- package/helpers/accessRightsHelper.js +1 -1
- package/helpers/inertiaAddHelper.d.ts +1 -0
- package/interfaces/adminpanelConfig.d.ts +5 -1
- package/lib/datatable/NodeTable.js +2 -0
- package/lib/v4/POWCaptcha.js +1 -1
- package/lib/v4/model/AbstractModel.js +2 -0
- package/lib/v4/model/adapter/sequelize.d.ts +26 -0
- package/lib/v4/model/adapter/sequelize.js +280 -0
- package/lib/v4/model/adapter/waterline.js +3 -1
- package/package.json +6 -3
- package/policies/checkAuth.js +1 -1
- package/system/bindAuthorization.js +17 -2
- package/system/bindInertia.js +1 -1
- package/system/defaults.js +3 -0
- package/assets/VanillaJSONEditor-OdBvR1ds.js +0 -3807
- package/assets/add-DtkqVKek.js +0 -1
- package/assets/add-form-D7Gz1uwX.js +0 -1
- package/assets/add-group-BIUZK9CR.js +0 -1
- package/assets/add-group-form-CFw1igaY.js +0 -1
- package/assets/add-user-5Ko0sxsj.js +0 -1
- package/assets/add-user-form-fxpU-oac.js +0 -1
- package/assets/app-shell-Dgf4uNFy.js +0 -1
- package/assets/app-sidebar-D5-eQKSx.js +0 -1
- package/assets/checkbox-zNG98WS7.js +0 -1
- package/assets/dashboard-BmEpxYnQ.js +0 -1
- package/assets/dropdown-menu-CKLjASQo.js +0 -1
- package/assets/floating-ui.react-dom-DEWQUtJU.js +0 -1
- package/assets/form-BZkPiK2Z.js +0 -1
- package/assets/form-XjYeizmY.js +0 -1
- package/assets/handsontable-D_wNwOhu.js +0 -347
- package/assets/home-CmIZ3AL2.js +0 -2
- package/assets/index-B6nPyxx_.js +0 -1
- package/assets/index-B7QLmddv.js +0 -1
- package/assets/index-BNKtUMNI.js +0 -1
- package/assets/index-C4BeqGbx.js +0 -41
- package/assets/index-CJTkueDA.js +0 -1
- package/assets/index-CNFwBlc7.js +0 -1
- package/assets/index-D8YaJIVm.js +0 -1
- package/assets/index-DZ2G3GiC.js +0 -10
- package/assets/index-DlfDI23T.js +0 -1
- package/assets/index-Dv6YbCDH.js +0 -1
- package/assets/index-S2Olh4hE.js +0 -1
- package/assets/init-user-DXTgLYcI.js +0 -1
- package/assets/list-BBJBZzsm.js +0 -1
- package/assets/login-B7INjWDi.js +0 -6
- package/assets/module-D8kHGWhF.js +0 -1
- package/assets/multi-select-CgIsryRX.js +0 -11
- package/assets/nav-footer-BioIOL2n.js +0 -1
- package/assets/nav-main-CcQo_Ho4.js +0 -1
- package/assets/nav-user-p58e1wG0.js +0 -1
- package/assets/popover-DXKNm8mO.js +0 -1
- package/assets/register-B-p6hoZb.js +0 -1
- package/assets/select-B1LhFAX0.js +0 -6
- package/assets/tooltip-DXyAGFz-.js +0 -1
- package/assets/user-info-D89n2REb.js +0 -1
- package/assets/utils-jAU0Cazi.js +0 -1
- package/assets/welcome-D1l61QW1.js +0 -1
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
import{c as HT,W as At,R as kH,r as bh,j as NT}from"./app.js";import{u as b$}from"./use-appearance-CL_TqHcP.js";import"./compiler-runtime-tM4jBQ-T.js";var DT={},Sh,kT;function dn(){if(kT)return Sh;kT=1;var t=function(e){return e&&e.Math===Math&&e};return Sh=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof HT=="object"&&HT)||t(typeof Sh=="object"&&Sh)||function(){return this}()||Function("return this")(),Sh}var Xw={},Zw,LT;function Sn(){return LT||(LT=1,Zw=function(t){try{return!!t()}catch{return!0}}),Zw}var Jw,$T;function lo(){if($T)return Jw;$T=1;var t=Sn();return Jw=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Jw}var Qw,FT;function Xp(){if(FT)return Qw;FT=1;var t=Sn();return Qw=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Qw}var ev,VT;function Nn(){if(VT)return ev;VT=1;var t=Xp(),e=Function.prototype.call;return ev=t?e.bind(e):function(){return e.apply(e,arguments)},ev}var tv={},WT;function S$(){if(WT)return tv;WT=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);return tv.f=n?function(i){var o=e(this,i);return!!o&&o.enumerable}:t,tv}var nv,BT;function Zp(){return BT||(BT=1,nv=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),nv}var rv,jT;function qt(){if(jT)return rv;jT=1;var t=Xp(),e=Function.prototype,n=e.call,r=t&&e.bind.bind(n,n);return rv=t?r:function(i){return function(){return n.apply(i,arguments)}},rv}var iv,UT;function Iu(){if(UT)return iv;UT=1;var t=qt(),e=t({}.toString),n=t("".slice);return iv=function(r){return n(e(r),8,-1)},iv}var ov,zT;function R$(){if(zT)return ov;zT=1;var t=qt(),e=Sn(),n=Iu(),r=Object,i=t("".split);return ov=e(function(){return!r("z").propertyIsEnumerable(0)})?function(o){return n(o)==="String"?i(o,""):r(o)}:r,ov}var sv,YT;function Jp(){return YT||(YT=1,sv=function(t){return t==null}),sv}var av,GT;function Sf(){if(GT)return av;GT=1;var t=Jp(),e=TypeError;return av=function(n){if(t(n))throw new e("Can't call method on "+n);return n},av}var lv,KT;function Rf(){if(KT)return lv;KT=1;var t=R$(),e=Sf();return lv=function(n){return t(e(n))},lv}var uv,qT;function on(){if(qT)return uv;qT=1;var t=typeof document=="object"&&document.all;return uv=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},uv}var cv,XT;function Vo(){if(XT)return cv;XT=1;var t=on();return cv=function(e){return typeof e=="object"?e!==null:t(e)},cv}var hv,ZT;function rh(){if(ZT)return hv;ZT=1;var t=dn(),e=on(),n=function(r){return e(r)?r:void 0};return hv=function(r,i){return arguments.length<2?n(t[r]):t[r]&&t[r][i]},hv}var dv,JT;function Ef(){if(JT)return dv;JT=1;var t=qt();return dv=t({}.isPrototypeOf),dv}var fv,QT;function Qp(){if(QT)return fv;QT=1;var t=dn(),e=t.navigator,n=e&&e.userAgent;return fv=n?String(n):"",fv}var gv,e_;function E$(){if(e_)return gv;e_=1;var t=dn(),e=Qp(),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]))),gv=a,gv}var mv,t_;function ZR(){if(t_)return mv;t_=1;var t=E$(),e=Sn(),n=dn(),r=n.String;return mv=!!Object.getOwnPropertySymbols&&!e(function(){var i=Symbol("symbol detection");return!r(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&t&&t<41}),mv}var pv,n_;function LH(){if(n_)return pv;n_=1;var t=ZR();return pv=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",pv}var wv,r_;function JR(){if(r_)return wv;r_=1;var t=rh(),e=on(),n=Ef(),r=LH(),i=Object;return wv=r?function(o){return typeof o=="symbol"}:function(o){var s=t("Symbol");return e(s)&&n(s.prototype,i(o))},wv}var vv,i_;function ew(){if(i_)return vv;i_=1;var t=String;return vv=function(e){try{return t(e)}catch{return"Object"}},vv}var Cv,o_;function gr(){if(o_)return Cv;o_=1;var t=on(),e=ew(),n=TypeError;return Cv=function(r){if(t(r))return r;throw new n(e(r)+" is not a function")},Cv}var yv,s_;function Tf(){if(s_)return yv;s_=1;var t=gr(),e=Jp();return yv=function(n,r){var i=n[r];return e(i)?void 0:t(i)},yv}var bv,a_;function T$(){if(a_)return bv;a_=1;var t=Nn(),e=on(),n=Vo(),r=TypeError;return bv=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")},bv}var Sv={exports:{}},Rv,l_;function hl(){return l_||(l_=1,Rv=!1),Rv}var Ev,u_;function QR(){if(u_)return Ev;u_=1;var t=dn(),e=Object.defineProperty;return Ev=function(n,r){try{e(t,n,{value:r,configurable:!0,writable:!0})}catch{t[n]=r}return r},Ev}var c_;function eE(){if(c_)return Sv.exports;c_=1;var t=hl(),e=dn(),n=QR(),r="__core-js_shared__",i=Sv.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"}),Sv.exports}var Tv,h_;function $H(){if(h_)return Tv;h_=1;var t=eE();return Tv=function(e,n){return t[e]||(t[e]=n||{})},Tv}var _v,d_;function ih(){if(d_)return _v;d_=1;var t=Sf(),e=Object;return _v=function(n){return e(t(n))},_v}var Mv,f_;function uo(){if(f_)return Mv;f_=1;var t=qt(),e=ih(),n=t({}.hasOwnProperty);return Mv=Object.hasOwn||function(i,o){return n(e(i),o)},Mv}var Iv,g_;function FH(){if(g_)return Iv;g_=1;var t=qt(),e=0,n=Math.random(),r=t(1 .toString);return Iv=function(i){return"Symbol("+(i===void 0?"":i)+")_"+r(++e+n,36)},Iv}var Pv,m_;function Wo(){if(m_)return Pv;m_=1;var t=dn(),e=$H(),n=uo(),r=FH(),i=ZR(),o=LH(),s=t.Symbol,a=e("wks"),l=o?s.for||s:s&&s.withoutSetter||r;return Pv=function(u){return n(a,u)||(a[u]=i&&n(s,u)?s[u]:l("Symbol."+u)),a[u]},Pv}var Ov,p_;function _$(){if(p_)return Ov;p_=1;var t=Nn(),e=Vo(),n=JR(),r=Tf(),i=T$(),o=Wo(),s=TypeError,a=o("toPrimitive");return Ov=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)},Ov}var xv,w_;function VH(){if(w_)return xv;w_=1;var t=_$(),e=JR();return xv=function(n){var r=t(n,"string");return e(r)?r:r+""},xv}var Av,v_;function tE(){if(v_)return Av;v_=1;var t=dn(),e=Vo(),n=t.document,r=e(n)&&e(n.createElement);return Av=function(i){return r?n.createElement(i):{}},Av}var Hv,C_;function WH(){if(C_)return Hv;C_=1;var t=lo(),e=Sn(),n=tE();return Hv=!t&&!e(function(){return Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a!==7}),Hv}var y_;function BH(){if(y_)return Xw;y_=1;var t=lo(),e=Nn(),n=S$(),r=Zp(),i=Rf(),o=VH(),s=uo(),a=WH(),l=Object.getOwnPropertyDescriptor;return Xw.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])},Xw}var Nv={},Dv,b_;function jH(){if(b_)return Dv;b_=1;var t=lo(),e=Sn();return Dv=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Dv}var kv,S_;function sn(){if(S_)return kv;S_=1;var t=Vo(),e=String,n=TypeError;return kv=function(r){if(t(r))return r;throw new n(e(r)+" is not an object")},kv}var R_;function dl(){if(R_)return Nv;R_=1;var t=lo(),e=WH(),n=jH(),r=sn(),i=VH(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l="enumerable",u="configurable",c="writable";return Nv.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 C=a(d,f);C&&C[c]&&(d[f]=m.value,m={configurable:u in m?m[u]:C[u],enumerable:l in m?m[l]:C[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},Nv}var Lv,E_;function oh(){if(E_)return Lv;E_=1;var t=lo(),e=dl(),n=Zp();return Lv=t?function(r,i,o){return e.f(r,i,n(1,o))}:function(r,i,o){return r[i]=o,r},Lv}var $v={exports:{}},Fv,T_;function M$(){if(T_)return Fv;T_=1;var t=lo(),e=uo(),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 Fv={EXISTS:i,PROPER:o,CONFIGURABLE:s},Fv}var Vv,__;function I$(){if(__)return Vv;__=1;var t=qt(),e=on(),n=eE(),r=t(Function.toString);return e(n.inspectSource)||(n.inspectSource=function(i){return r(i)}),Vv=n.inspectSource,Vv}var Wv,M_;function P$(){if(M_)return Wv;M_=1;var t=dn(),e=on(),n=t.WeakMap;return Wv=e(n)&&/native code/.test(String(n)),Wv}var Bv,I_;function nE(){if(I_)return Bv;I_=1;var t=$H(),e=FH(),n=t("keys");return Bv=function(r){return n[r]||(n[r]=e(r))},Bv}var jv,P_;function rE(){return P_||(P_=1,jv={}),jv}var Uv,O_;function UH(){if(O_)return Uv;O_=1;var t=P$(),e=dn(),n=Vo(),r=oh(),i=uo(),o=eE(),s=nE(),a=rE(),l="Object already initialized",u=e.TypeError,c=e.WeakMap,h,d,f,m=function(R){return f(R)?d(R):h(R,{})},C=function(R){return function(I){var O;if(!n(I)||(O=d(I)).type!==R)throw new u("Incompatible receiver, "+R+" required");return O}};if(t||o.state){var w=o.state||(o.state=new c);w.get=w.get,w.has=w.has,w.set=w.set,h=function(R,I){if(w.has(R))throw new u(l);return I.facade=R,w.set(R,I),I},d=function(R){return w.get(R)||{}},f=function(R){return w.has(R)}}else{var S=s("state");a[S]=!0,h=function(R,I){if(i(R,S))throw new u(l);return I.facade=R,r(R,S,I),I},d=function(R){return i(R,S)?R[S]:{}},f=function(R){return i(R,S)}}return Uv={set:h,get:d,has:f,enforce:m,getterFor:C},Uv}var x_;function zH(){if(x_)return $v.exports;x_=1;var t=qt(),e=Sn(),n=on(),r=uo(),i=lo(),o=M$().CONFIGURABLE,s=I$(),a=UH(),l=a.enforce,u=a.get,c=String,h=Object.defineProperty,d=t("".slice),f=t("".replace),m=t([].join),C=i&&!e(function(){return h(function(){},"length",{value:8}).length!==8}),w=String(String).split("String"),S=$v.exports=function(R,I,O){d(c(I),0,7)==="Symbol("&&(I="["+f(c(I),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),O&&O.getter&&(I="get "+I),O&&O.setter&&(I="set "+I),(!r(R,"name")||o&&R.name!==I)&&(i?h(R,"name",{value:I,configurable:!0}):R.name=I),C&&O&&r(O,"arity")&&R.length!==O.arity&&h(R,"length",{value:O.arity});try{O&&r(O,"constructor")&&O.constructor?i&&h(R,"prototype",{writable:!1}):R.prototype&&(R.prototype=void 0)}catch{}var D=l(R);return r(D,"source")||(D.source=m(w,typeof I=="string"?I:"")),R};return Function.prototype.toString=S(function(){return n(this)&&u(this).source||s(this)},"toString"),$v.exports}var zv,A_;function iE(){if(A_)return zv;A_=1;var t=on(),e=dl(),n=zH(),r=QR();return zv=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},zv}var Yv={},Gv,H_;function O$(){if(H_)return Gv;H_=1;var t=Math.ceil,e=Math.floor;return Gv=Math.trunc||function(r){var i=+r;return(i>0?e:t)(i)},Gv}var Kv,N_;function _f(){if(N_)return Kv;N_=1;var t=O$();return Kv=function(e){var n=+e;return n!==n||n===0?0:t(n)},Kv}var qv,D_;function x$(){if(D_)return qv;D_=1;var t=_f(),e=Math.max,n=Math.min;return qv=function(r,i){var o=t(r);return o<0?e(o+i,0):n(o,i)},qv}var Xv,k_;function A$(){if(k_)return Xv;k_=1;var t=_f(),e=Math.min;return Xv=function(n){var r=t(n);return r>0?e(r,9007199254740991):0},Xv}var Zv,L_;function sh(){if(L_)return Zv;L_=1;var t=A$();return Zv=function(e){return t(e.length)},Zv}var Jv,$_;function H$(){if($_)return Jv;$_=1;var t=Rf(),e=x$(),n=sh(),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 Jv={includes:r(!0),indexOf:r(!1)},Jv}var Qv,F_;function YH(){if(F_)return Qv;F_=1;var t=qt(),e=uo(),n=Rf(),r=H$().indexOf,i=rE(),o=t([].push);return Qv=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},Qv}var eC,V_;function oE(){return V_||(V_=1,eC=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),eC}var W_;function N$(){if(W_)return Yv;W_=1;var t=YH(),e=oE(),n=e.concat("length","prototype");return Yv.f=Object.getOwnPropertyNames||function(i){return t(i,n)},Yv}var tC={},B_;function D$(){return B_||(B_=1,tC.f=Object.getOwnPropertySymbols),tC}var nC,j_;function k$(){if(j_)return nC;j_=1;var t=rh(),e=qt(),n=N$(),r=D$(),i=sn(),o=e([].concat);return nC=t("Reflect","ownKeys")||function(a){var l=n.f(i(a)),u=r.f;return u?o(l,u(a)):l},nC}var rC,U_;function GH(){if(U_)return rC;U_=1;var t=uo(),e=k$(),n=BH(),r=dl();return rC=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))}},rC}var iC,z_;function L$(){if(z_)return iC;z_=1;var t=Sn(),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 iC=r,iC}var oC,Y_;function dt(){if(Y_)return oC;Y_=1;var t=dn(),e=BH().f,n=oh(),r=iE(),i=QR(),o=GH(),s=L$();return oC=function(a,l){var u=a.target,c=a.global,h=a.stat,d,f,m,C,w,S;if(c?f=t:h?f=t[u]||i(u,{}):f=t[u]&&t[u].prototype,f)for(m in l){if(w=l[m],a.dontCallGetSet?(S=e(f,m),C=S&&S.value):C=f[m],d=s(c?m:u+(h?".":"#")+m,a.forced),!d&&C!==void 0){if(typeof w==typeof C)continue;o(w,C)}(a.sham||C&&C.sham)&&n(w,"sham",!0),r(f,m,w,a)}},oC}var sC,G_;function tw(){if(G_)return sC;G_=1;var t=Xp(),e=Function.prototype,n=e.apply,r=e.call;return sC=typeof Reflect=="object"&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),sC}var aC,K_;function KH(){if(K_)return aC;K_=1;var t=qt(),e=gr();return aC=function(n,r,i){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[i]))}catch{}},aC}var lC,q_;function $$(){if(q_)return lC;q_=1;var t=Vo();return lC=function(e){return t(e)||e===null},lC}var uC,X_;function F$(){if(X_)return uC;X_=1;var t=$$(),e=String,n=TypeError;return uC=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")},uC}var cC,Z_;function qH(){if(Z_)return cC;Z_=1;var t=KH(),e=Vo(),n=Sf(),r=F$();return cC=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),cC}var hC,J_;function V$(){if(J_)return hC;J_=1;var t=dl().f;return hC=function(e,n,r){r in e||t(e,r,{configurable:!0,get:function(){return n[r]},set:function(i){n[r]=i}})},hC}var dC,Q_;function W$(){if(Q_)return dC;Q_=1;var t=on(),e=Vo(),n=qH();return dC=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},dC}var fC,eM;function B$(){if(eM)return fC;eM=1;var t=Wo(),e=t("toStringTag"),n={};return n[e]="z",fC=String(n)==="[object z]",fC}var gC,tM;function XH(){if(tM)return gC;tM=1;var t=B$(),e=on(),n=Iu(),r=Wo(),i=r("toStringTag"),o=Object,s=n(function(){return arguments}())==="Arguments",a=function(l,u){try{return l[u]}catch{}};return gC=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},gC}var mC,nM;function nw(){if(nM)return mC;nM=1;var t=XH(),e=String;return mC=function(n){if(t(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(n)},mC}var pC,rM;function j$(){if(rM)return pC;rM=1;var t=nw();return pC=function(e,n){return e===void 0?arguments.length<2?"":n:t(e)},pC}var wC,iM;function U$(){if(iM)return wC;iM=1;var t=Vo(),e=oh();return wC=function(n,r){t(r)&&"cause"in r&&e(n,"cause",r.cause)},wC}var vC,oM;function z$(){if(oM)return vC;oM=1;var t=qt(),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 vC=function(s,a){if(o&&typeof s=="string"&&!e.prepareStackTrace)for(;a--;)s=n(s,i,"");return s},vC}var CC,sM;function Y$(){if(sM)return CC;sM=1;var t=Sn(),e=Zp();return CC=!t(function(){var n=new Error("a");return"stack"in n?(Object.defineProperty(n,"stack",e(1,7)),n.stack!==7):!0}),CC}var yC,aM;function G$(){if(aM)return yC;aM=1;var t=oh(),e=z$(),n=Y$(),r=Error.captureStackTrace;return yC=function(i,o,s,a){n&&(r?r(i,o):t(i,"stack",e(s,a)))},yC}var bC,lM;function K$(){if(lM)return bC;lM=1;var t=rh(),e=uo(),n=oh(),r=Ef(),i=qH(),o=GH(),s=V$(),a=W$(),l=j$(),u=U$(),c=G$(),h=lo(),d=hl();return bC=function(f,m,C,w){var S="stackTraceLimit",R=w?2:1,I=f.split("."),O=I[I.length-1],D=t.apply(null,I);if(D){var _=D.prototype;if(!d&&e(_,"cause")&&delete _.cause,!C)return D;var x=t("Error"),j=m(function(X,U){var Z=l(w?U:X,void 0),Q=w?new D(X):new D;return Z!==void 0&&n(Q,"message",Z),c(Q,j,Q.stack,2),this&&r(_,this)&&a(Q,this,j),arguments.length>R&&u(Q,arguments[R]),Q});if(j.prototype=_,O!=="Error"?i?i(j,x):o(j,x,{name:!0}):h&&S in D&&(s(j,D,S),s(j,D,"prepareStackTrace")),o(j,D),!d)try{_.name!==O&&n(_,"name",O),_.constructor=j}catch{}return j}},bC}var uM;function q$(){if(uM)return DT;uM=1;var t=dt(),e=dn(),n=tw(),r=K$(),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)}}),DT}q$();var cM={},SC,hM;function ZH(){if(hM)return SC;hM=1;var t=Iu();return SC=Array.isArray||function(n){return t(n)==="Array"},SC}var RC,dM;function JH(){if(dM)return RC;dM=1;var t=lo(),e=ZH(),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 RC=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},RC}var EC,fM;function QH(){if(fM)return EC;fM=1;var t=TypeError,e=9007199254740991;return EC=function(n){if(n>e)throw t("Maximum allowed index exceeded");return n},EC}var gM;function X$(){if(gM)return cM;gM=1;var t=dt(),e=ih(),n=sh(),r=JH(),i=QH(),o=Sn(),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}}),cM}X$();var mM={},TC,pM;function Is(){if(pM)return TC;pM=1;var t=qt(),e=Set.prototype;return TC={Set,add:t(e.add),has:t(e.has),remove:t(e.delete),proto:e},TC}var _C,wM;function Pu(){if(wM)return _C;wM=1;var t=Is().has;return _C=function(e){return t(e),e},_C}var MC,vM;function Ou(){if(vM)return MC;vM=1;var t=Nn();return MC=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},MC}var IC,CM;function Mf(){if(CM)return IC;CM=1;var t=qt(),e=Ou(),n=Is(),r=n.Set,i=n.proto,o=t(i.forEach),s=t(i.keys),a=s(new r).next;return IC=function(l,u,c){return c?e({iterator:s(l),next:a},u):o(l,u)},IC}var PC,yM;function sE(){if(yM)return PC;yM=1;var t=Is(),e=Mf(),n=t.Set,r=t.add;return PC=function(i){var o=new n;return e(i,function(s){r(o,s)}),o},PC}var OC,bM;function If(){if(bM)return OC;bM=1;var t=KH(),e=Is();return OC=t(e.proto,"size","get")||function(n){return n.size},OC}var xC,SM;function Ps(){return SM||(SM=1,xC=function(t){return{iterator:t,next:t.next,done:!1}}),xC}var AC,RM;function xu(){if(RM)return AC;RM=1;var t=gr(),e=sn(),n=Nn(),r=_f(),i=Ps(),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)}},AC=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)},AC}var HC,EM;function Z$(){if(EM)return HC;EM=1;var t=Pu(),e=Is(),n=sE(),r=If(),i=xu(),o=Mf(),s=Ou(),a=e.has,l=e.remove;return HC=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},HC}var NC,TM;function Au(){if(TM)return NC;TM=1;var t=rh(),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 NC=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}},NC}var _M;function J$(){if(_M)return mM;_M=1;var t=dt(),e=Z$(),n=Au(),r=!n("difference",function(i){return i.size===0});return t({target:"Set",proto:!0,real:!0,forced:r},{difference:e}),mM}J$();var MM={},DC,IM;function Q$(){if(IM)return DC;IM=1;var t=Pu(),e=Is(),n=If(),r=xu(),i=Mf(),o=Ou(),s=e.Set,a=e.add,l=e.has;return DC=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},DC}var PM;function eF(){if(PM)return MM;PM=1;var t=dt(),e=Sn(),n=Q$(),r=Au(),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}),MM}eF();var OM={},kC,xM;function ah(){if(xM)return kC;xM=1;var t=Nn(),e=sn(),n=Tf();return kC=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},kC}var LC,AM;function tF(){if(AM)return LC;AM=1;var t=Pu(),e=Is().has,n=If(),r=xu(),i=Mf(),o=Ou(),s=ah();return LC=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},LC}var HM;function nF(){if(HM)return OM;HM=1;var t=dt(),e=tF(),n=Au(),r=!n("isDisjointFrom",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isDisjointFrom:e}),OM}nF();var NM={},$C,DM;function rF(){if(DM)return $C;DM=1;var t=Pu(),e=If(),n=Mf(),r=xu();return $C=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},$C}var kM;function iF(){if(kM)return NM;kM=1;var t=dt(),e=rF(),n=Au(),r=!n("isSubsetOf",function(i){return i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSubsetOf:e}),NM}iF();var LM={},FC,$M;function oF(){if($M)return FC;$M=1;var t=Pu(),e=Is().has,n=If(),r=xu(),i=Ou(),o=ah();return FC=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},FC}var FM;function sF(){if(FM)return LM;FM=1;var t=dt(),e=oF(),n=Au(),r=!n("isSupersetOf",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSupersetOf:e}),LM}sF();var VM={},VC,WM;function aF(){if(WM)return VC;WM=1;var t=Pu(),e=Is(),n=sE(),r=xu(),i=Ou(),o=e.add,s=e.has,a=e.remove;return VC=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},VC}var BM;function lF(){if(BM)return VM;BM=1;var t=dt(),e=aF(),n=Au();return t({target:"Set",proto:!0,real:!0,forced:!n("symmetricDifference")},{symmetricDifference:e}),VM}lF();var jM={},WC,UM;function uF(){if(UM)return WC;UM=1;var t=Pu(),e=Is().add,n=sE(),r=xu(),i=Ou();return WC=function(s){var a=t(this),l=r(s).getIterator(),u=n(a);return i(l,function(c){e(u,c)}),u},WC}var zM;function cF(){if(zM)return jM;zM=1;var t=dt(),e=uF(),n=Au();return t({target:"Set",proto:!0,real:!0,forced:!n("union")},{union:e}),jM}cF();var YM={},GM={},BC,KM;function hF(){if(KM)return BC;KM=1;var t=Ef(),e=TypeError;return BC=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")},BC}var jC,qM;function dF(){if(qM)return jC;qM=1;var t=Sn();return jC=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),jC}var UC,XM;function e1(){if(XM)return UC;XM=1;var t=uo(),e=on(),n=ih(),r=nE(),i=dF(),o=r("IE_PROTO"),s=Object,a=s.prototype;return UC=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},UC}var zC,ZM;function fF(){if(ZM)return zC;ZM=1;var t=zH(),e=dl();return zC=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)},zC}var YC,JM;function t1(){if(JM)return YC;JM=1;var t=lo(),e=dl(),n=Zp();return YC=function(r,i,o){t?e.f(r,i,n(0,o)):r[i]=o},YC}var GC={},KC,QM;function gF(){if(QM)return KC;QM=1;var t=YH(),e=oE();return KC=Object.keys||function(r){return t(r,e)},KC}var eI;function mF(){if(eI)return GC;eI=1;var t=lo(),e=jH(),n=dl(),r=sn(),i=Rf(),o=gF();return GC.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},GC}var qC,tI;function n1(){if(tI)return qC;tI=1;var t=rh();return qC=t("document","documentElement"),qC}var XC,nI;function aE(){if(nI)return XC;nI=1;var t=sn(),e=mF(),n=oE(),r=rE(),i=n1(),o=tE(),s=nE(),a=">",l="<",u="prototype",c="script",h=s("IE_PROTO"),d=function(){},f=function(R){return l+c+a+R+l+"/"+c+a},m=function(R){R.write(f("")),R.close();var I=R.parentWindow.Object;return R=null,I},C=function(){var R=o("iframe"),I="java"+c+":",O;return R.style.display="none",i.appendChild(R),R.src=String(I),O=R.contentWindow.document,O.open(),O.write(f("document.F=Object")),O.close(),O.F},w,S=function(){try{w=new ActiveXObject("htmlfile")}catch{}S=typeof document<"u"?document.domain&&w?m(w):C():m(w);for(var R=n.length;R--;)delete S[u][n[R]];return S()};return r[h]=!0,XC=Object.create||function(I,O){var D;return I!==null?(d[u]=t(I),D=new d,d[u]=null,D[h]=I):D=S(),O===void 0?D:e.f(D,O)},XC}var ZC,rI;function r1(){if(rI)return ZC;rI=1;var t=Sn(),e=on(),n=Vo(),r=aE(),i=e1(),o=iE(),s=Wo(),a=hl(),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}),ZC={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:u},ZC}var iI;function pF(){if(iI)return GM;iI=1;var t=dt(),e=dn(),n=hF(),r=sn(),i=on(),o=e1(),s=fF(),a=t1(),l=Sn(),u=uo(),c=Wo(),h=r1().IteratorPrototype,d=lo(),f=hl(),m="constructor",C="Iterator",w=c("toStringTag"),S=TypeError,R=e[C],I=f||!i(R)||R.prototype!==h||!l(function(){R({})}),O=function(){if(n(this,h),o(this)===h)throw new S("Abstract class Iterator not directly constructable")},D=function(_,x){d?s(h,_,{configurable:!0,get:function(){return x},set:function(j){if(r(this),this===h)throw new S("You can't redefine this property");u(this,_)?this[_]=j:a(this,_,j)}}):h[_]=x};return u(h,w)||D(w,C),(I||!u(h,m)||h[m]===Object)&&D(m,O),O.prototype=h,t({global:!0,constructor:!0,forced:I},{Iterator:O}),GM}var oI;function wF(){return oI||(oI=1,pF()),YM}wF();var sI={},aI={},JC,lI;function vF(){if(lI)return JC;lI=1;var t=iE();return JC=function(e,n,r){for(var i in n)t(e,i,n[i],r);return e},JC}var QC,uI;function CF(){return uI||(uI=1,QC=function(t,e){return{value:t,done:e}}),QC}var ey,cI;function lE(){if(cI)return ey;cI=1;var t=Nn(),e=aE(),n=oh(),r=vF(),i=Wo(),o=UH(),s=Tf(),a=r1().IteratorPrototype,l=CF(),u=ah(),c=i("toStringTag"),h="IteratorHelper",d="WrapForValidIterator",f=o.set,m=function(S){var R=o.getterFor(S?d:h);return r(e(a),{next:function(){var O=R(this);if(S)return O.nextHandler();if(O.done)return l(void 0,!0);try{var D=O.nextHandler();return O.returnHandlerResult?D:l(D,O.done)}catch(_){throw O.done=!0,_}},return:function(){var I=R(this),O=I.iterator;if(I.done=!0,S){var D=s(O,"return");return D?t(D,O):l(void 0,!0)}if(I.inner)try{u(I.inner.iterator,"normal")}catch(_){return u(O,"throw",_)}return O&&u(O,"normal"),l(void 0,!0)}})},C=m(!0),w=m(!1);return n(w,c,"Iterator Helper"),ey=function(S,R,I){var O=function(_,x){x?(x.iterator=_.iterator,x.next=_.next):x=_,x.type=R?d:h,x.returnHandlerResult=!!I,x.nextHandler=S,x.counter=0,x.done=!1,f(this,x)};return O.prototype=R?C:w,O},ey}var ty,hI;function i1(){if(hI)return ty;hI=1;var t=sn(),e=ah();return ty=function(n,r,i,o){try{return o?r(t(i)[0],i[1]):r(i)}catch(s){e(n,"throw",s)}},ty}var dI;function yF(){if(dI)return aI;dI=1;var t=dt(),e=Nn(),n=gr(),r=sn(),i=Ps(),o=lE(),s=i1(),a=hl(),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})}}),aI}var fI;function bF(){return fI||(fI=1,yF()),sI}bF();var gI={},mI={},ny,pI;function SF(){if(pI)return ny;pI=1;var t=Iu(),e=qt();return ny=function(n){if(t(n)==="Function")return e(n)},ny}var ry,wI;function o1(){if(wI)return ry;wI=1;var t=SF(),e=gr(),n=Xp(),r=t(t.bind);return ry=function(i,o){return e(i),o===void 0?i:n?r(i,o):function(){return i.apply(o,arguments)}},ry}var iy,vI;function s1(){return vI||(vI=1,iy={}),iy}var oy,CI;function RF(){if(CI)return oy;CI=1;var t=Wo(),e=s1(),n=t("iterator"),r=Array.prototype;return oy=function(i){return i!==void 0&&(e.Array===i||r[n]===i)},oy}var sy,yI;function uE(){if(yI)return sy;yI=1;var t=XH(),e=Tf(),n=Jp(),r=s1(),i=Wo(),o=i("iterator");return sy=function(s){if(!n(s))return e(s,o)||e(s,"@@iterator")||r[t(s)]},sy}var ay,bI;function EF(){if(bI)return ay;bI=1;var t=Nn(),e=gr(),n=sn(),r=ew(),i=uE(),o=TypeError;return ay=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")},ay}var ly,SI;function lh(){if(SI)return ly;SI=1;var t=o1(),e=Nn(),n=sn(),r=ew(),i=RF(),o=sh(),s=Ef(),a=EF(),l=uE(),u=ah(),c=TypeError,h=function(f,m){this.stopped=f,this.result=m},d=h.prototype;return ly=function(f,m,C){var w=C&&C.that,S=!!(C&&C.AS_ENTRIES),R=!!(C&&C.IS_RECORD),I=!!(C&&C.IS_ITERATOR),O=!!(C&&C.INTERRUPTED),D=t(m,w),_,x,j,X,U,Z,Q,le=function(ue){return _&&u(_,"normal",ue),new h(!0,ue)},te=function(ue){return S?(n(ue),O?D(ue[0],ue[1],le):D(ue[0],ue[1])):O?D(ue,le):D(ue)};if(R)_=f.iterator;else if(I)_=f;else{if(x=l(f),!x)throw new c(r(f)+" is not iterable");if(i(x)){for(j=0,X=o(f);X>j;j++)if(U=te(f[j]),U&&s(d,U))return U;return new h(!1)}_=a(f,x)}for(Z=R?f.next:_.next;!(Q=e(Z,_)).done;){try{U=te(Q.value)}catch(ue){u(_,"throw",ue)}if(typeof U=="object"&&U&&s(d,U))return U}return new h(!1)},ly}var RI;function TF(){if(RI)return mI;RI=1;var t=dt(),e=lh(),n=gr(),r=sn(),i=Ps();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})}}),mI}var EI;function _F(){return EI||(EI=1,TF()),gI}_F();var TI={},_I={},uy,MI;function MF(){if(MI)return uy;MI=1;var t=Nn(),e=gr(),n=sn(),r=Ps(),i=lE(),o=i1(),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 uy=function(l){return n(this),e(l),new s(r(this),{mapper:l})},uy}var II;function IF(){if(II)return _I;II=1;var t=dt(),e=MF(),n=hl();return t({target:"Iterator",proto:!0,real:!0,forced:n},{map:e}),_I}var PI;function PF(){return PI||(PI=1,IF()),TI}PF();var OI={},xI={},cy,AI;function cE(){if(AI)return cy;AI=1;var t=qt();return cy=t([].slice),cy}var hy,HI;function a1(){if(HI)return hy;HI=1;var t=TypeError;return hy=function(e,n){if(e<n)throw new t("Not enough arguments");return e},hy}var dy,NI;function OF(){if(NI)return dy;NI=1;var t=Qp();return dy=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),dy}var fy,DI;function l1(){if(DI)return fy;DI=1;var t=dn(),e=Qp(),n=Iu(),r=function(i){return e.slice(0,i.length)===i};return fy=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"}(),fy}var gy,kI;function xF(){if(kI)return gy;kI=1;var t=l1();return gy=t==="NODE",gy}var my,LI;function u1(){if(LI)return my;LI=1;var t=dn(),e=tw(),n=o1(),r=on(),i=uo(),o=Sn(),s=n1(),a=cE(),l=tE(),u=a1(),c=OF(),h=xF(),d=t.setImmediate,f=t.clearImmediate,m=t.process,C=t.Dispatch,w=t.Function,S=t.MessageChannel,R=t.String,I=0,O={},D="onreadystatechange",_,x,j,X;o(function(){_=t.location});var U=function(te){if(i(O,te)){var ue=O[te];delete O[te],ue()}},Z=function(te){return function(){U(te)}},Q=function(te){U(te.data)},le=function(te){t.postMessage(R(te),_.protocol+"//"+_.host)};return(!d||!f)&&(d=function(ue){u(arguments.length,1);var ft=r(ue)?ue:w(ue),Re=a(arguments,1);return O[++I]=function(){e(ft,void 0,Re)},x(I),I},f=function(ue){delete O[ue]},h?x=function(te){m.nextTick(Z(te))}:C&&C.now?x=function(te){C.now(Z(te))}:S&&!c?(j=new S,X=j.port2,j.port1.onmessage=Q,x=n(X.postMessage,X)):t.addEventListener&&r(t.postMessage)&&!t.importScripts&&_&&_.protocol!=="file:"&&!o(le)?(x=le,t.addEventListener("message",Q,!1)):D in l("script")?x=function(te){s.appendChild(l("script"))[D]=function(){s.removeChild(this),U(te)}}:x=function(te){setTimeout(Z(te),0)}),my={set:d,clear:f},my}var $I;function AF(){if($I)return xI;$I=1;var t=dt(),e=dn(),n=u1().clear;return t({global:!0,bind:!0,enumerable:!0,forced:e.clearImmediate!==n},{clearImmediate:n}),xI}var FI={},py,VI;function HF(){if(VI)return py;VI=1;var t=dn(),e=tw(),n=on(),r=l1(),i=Qp(),o=cE(),s=a1(),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 py=function(u,c){var h=c?2:1;return l?function(d,f){var m=s(arguments.length,1)>h,C=n(d)?d:a(d),w=m?o(arguments,h):[],S=m?function(){e(C,this,w)}:C;return c?u(S,f):u(S)}:u},py}var WI;function NF(){if(WI)return FI;WI=1;var t=dt(),e=dn(),n=u1().set,r=HF(),i=e.setImmediate?r(n,!1):n;return t({global:!0,bind:!0,enumerable:!0,forced:e.setImmediate!==i},{setImmediate:i}),FI}var BI;function DF(){return BI||(BI=1,AF(),NF()),OI}DF();/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:c1,setPrototypeOf:jI,isFrozen:kF,getPrototypeOf:LF,getOwnPropertyDescriptor:$F}=Object;let{freeze:Yn,seal:ao,create:h1}=Object,{apply:KS,construct:qS}=typeof Reflect<"u"&&Reflect;Yn||(Yn=function(e){return e});ao||(ao=function(e){return e});KS||(KS=function(e,n,r){return e.apply(n,r)});qS||(qS=function(e,n){return new e(...n)});const Jf=Gn(Array.prototype.forEach),FF=Gn(Array.prototype.lastIndexOf),UI=Gn(Array.prototype.pop),Rh=Gn(Array.prototype.push),VF=Gn(Array.prototype.splice),Nm=Gn(String.prototype.toLowerCase),wy=Gn(String.prototype.toString),zI=Gn(String.prototype.match),Eh=Gn(String.prototype.replace),WF=Gn(String.prototype.indexOf),BF=Gn(String.prototype.trim),To=Gn(Object.prototype.hasOwnProperty),kn=Gn(RegExp.prototype.test),Th=jF(TypeError);function Gn(t){return 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 KS(t,e,r)}}function jF(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return qS(t,n)}}function Ve(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nm;jI&&jI(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=n(i);o!==i&&(kF(e)||(e[r]=o),i=o)}t[i]=!0}return t}function UF(t){for(let e=0;e<t.length;e++)To(t,e)||(t[e]=null);return t}function ru(t){const e=h1(null);for(const[n,r]of c1(t))To(t,n)&&(Array.isArray(r)?e[n]=UF(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=ru(r):e[n]=r);return e}function _h(t,e){for(;t!==null;){const r=$F(t,e);if(r){if(r.get)return Gn(r.get);if(typeof r.value=="function")return Gn(r.value)}t=LF(t)}function n(){return null}return n}const YI=Yn(["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","section","select","shadow","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"]),vy=Yn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Cy=Yn(["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"]),zF=Yn(["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"]),yy=Yn(["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"]),YF=Yn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),GI=Yn(["#text"]),KI=Yn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),by=Yn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),qI=Yn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),Qf=Yn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),GF=ao(/\{\{[\w\W]*|[\w\W]*\}\}/gm),KF=ao(/<%[\w\W]*|[\w\W]*%>/gm),qF=ao(/\$\{[\w\W]*/gm),XF=ao(/^data-[\-\w.\u00B7-\uFFFF]+$/),ZF=ao(/^aria-[\-\w]+$/),d1=ao(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),JF=ao(/^(?:\w+script|data):/i),QF=ao(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),f1=ao(/^html$/i),eV=ao(/^[a-z][.\w]*(-[.\w]+)+$/i);var XI=Object.freeze({__proto__:null,ARIA_ATTR:ZF,ATTR_WHITESPACE:QF,CUSTOM_ELEMENT:eV,DATA_ATTR:XF,DOCTYPE_NAME:f1,ERB_EXPR:KF,IS_ALLOWED_URI:d1,IS_SCRIPT_OR_DATA:JF,MUSTACHE_EXPR:GF,TMPLIT_EXPR:qF});const Mh={element:1,text:3,progressingInstruction:7,comment:8,document:9},tV=function(){return typeof window>"u"?null:window},nV=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}},ZI=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function g1(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tV();const e=ve=>g1(ve);if(e.version="3.2.4",e.removed=[],!t||!t.document||t.document.nodeType!==Mh.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:f}=t,m=l.prototype,C=_h(m,"cloneNode"),w=_h(m,"remove"),S=_h(m,"nextSibling"),R=_h(m,"childNodes"),I=_h(m,"parentNode");if(typeof s=="function"){const ve=n.createElement("template");ve.content&&ve.content.ownerDocument&&(n=ve.content.ownerDocument)}let O,D="";const{implementation:_,createNodeIterator:x,createDocumentFragment:j,getElementsByTagName:X}=n,{importNode:U}=r;let Z=ZI();e.isSupported=typeof c1=="function"&&typeof I=="function"&&_&&_.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Q,ERB_EXPR:le,TMPLIT_EXPR:te,DATA_ATTR:ue,ARIA_ATTR:ft,IS_SCRIPT_OR_DATA:Re,ATTR_WHITESPACE:Le,CUSTOM_ELEMENT:Rt}=XI;let{IS_ALLOWED_URI:Zt}=XI,g=null;const p=Ve({},[...YI,...vy,...Cy,...yy,...GI]);let v=null;const E=Ve({},[...KI,...by,...qI,...Qf]);let H=Object.seal(h1(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,G=null,K=!0,oe=!0,y=!1,b=!0,T=!1,k=!0,A=!1,$=!1,B=!1,P=!1,L=!1,F=!1,V=!0,z=!1;const ce="user-content-";let de=!0,Se=!1,Ne={},Be=null;const Me=Ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $e=null;const kt=Ve({},["audio","video","img","source","image","track"]);let go=null;const zo=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fn="http://www.w3.org/1998/Math/MathML",Jt="http://www.w3.org/2000/svg",Lt="http://www.w3.org/1999/xhtml";let pt=Lt,nt=!1,Fe=null;const qf=Ve({},[fn,Jt,Lt],wy);let wl=Ve({},["mi","mo","mn","ms","mtext"]),Xf=Ve({},["annotation-xml"]);const m$=Ve({},["title","style","font","a","script"]);let Ch=null;const p$=["application/xhtml+xml","text/html"],w$="text/html";let gn=null,Lu=null;const v$=n.createElement("form"),bT=function(N){return N instanceof RegExp||N instanceof Function},Kw=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Lu&&Lu===N)){if((!N||typeof N!="object")&&(N={}),N=ru(N),Ch=p$.indexOf(N.PARSER_MEDIA_TYPE)===-1?w$:N.PARSER_MEDIA_TYPE,gn=Ch==="application/xhtml+xml"?wy:Nm,g=To(N,"ALLOWED_TAGS")?Ve({},N.ALLOWED_TAGS,gn):p,v=To(N,"ALLOWED_ATTR")?Ve({},N.ALLOWED_ATTR,gn):E,Fe=To(N,"ALLOWED_NAMESPACES")?Ve({},N.ALLOWED_NAMESPACES,wy):qf,go=To(N,"ADD_URI_SAFE_ATTR")?Ve(ru(zo),N.ADD_URI_SAFE_ATTR,gn):zo,$e=To(N,"ADD_DATA_URI_TAGS")?Ve(ru(kt),N.ADD_DATA_URI_TAGS,gn):kt,Be=To(N,"FORBID_CONTENTS")?Ve({},N.FORBID_CONTENTS,gn):Me,W=To(N,"FORBID_TAGS")?Ve({},N.FORBID_TAGS,gn):{},G=To(N,"FORBID_ATTR")?Ve({},N.FORBID_ATTR,gn):{},Ne=To(N,"USE_PROFILES")?N.USE_PROFILES:!1,K=N.ALLOW_ARIA_ATTR!==!1,oe=N.ALLOW_DATA_ATTR!==!1,y=N.ALLOW_UNKNOWN_PROTOCOLS||!1,b=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,T=N.SAFE_FOR_TEMPLATES||!1,k=N.SAFE_FOR_XML!==!1,A=N.WHOLE_DOCUMENT||!1,P=N.RETURN_DOM||!1,L=N.RETURN_DOM_FRAGMENT||!1,F=N.RETURN_TRUSTED_TYPE||!1,B=N.FORCE_BODY||!1,V=N.SANITIZE_DOM!==!1,z=N.SANITIZE_NAMED_PROPS||!1,de=N.KEEP_CONTENT!==!1,Se=N.IN_PLACE||!1,Zt=N.ALLOWED_URI_REGEXP||d1,pt=N.NAMESPACE||Lt,wl=N.MATHML_TEXT_INTEGRATION_POINTS||wl,Xf=N.HTML_INTEGRATION_POINTS||Xf,H=N.CUSTOM_ELEMENT_HANDLING||{},N.CUSTOM_ELEMENT_HANDLING&&bT(N.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=N.CUSTOM_ELEMENT_HANDLING.tagNameCheck),N.CUSTOM_ELEMENT_HANDLING&&bT(N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=N.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(H.allowCustomizedBuiltInElements=N.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),T&&(oe=!1),L&&(P=!0),Ne&&(g=Ve({},GI),v=[],Ne.html===!0&&(Ve(g,YI),Ve(v,KI)),Ne.svg===!0&&(Ve(g,vy),Ve(v,by),Ve(v,Qf)),Ne.svgFilters===!0&&(Ve(g,Cy),Ve(v,by),Ve(v,Qf)),Ne.mathMl===!0&&(Ve(g,yy),Ve(v,qI),Ve(v,Qf))),N.ADD_TAGS&&(g===p&&(g=ru(g)),Ve(g,N.ADD_TAGS,gn)),N.ADD_ATTR&&(v===E&&(v=ru(v)),Ve(v,N.ADD_ATTR,gn)),N.ADD_URI_SAFE_ATTR&&Ve(go,N.ADD_URI_SAFE_ATTR,gn),N.FORBID_CONTENTS&&(Be===Me&&(Be=ru(Be)),Ve(Be,N.FORBID_CONTENTS,gn)),de&&(g["#text"]=!0),A&&Ve(g,["html","head","body"]),g.table&&(Ve(g,["tbody"]),delete W.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw Th('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Th('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');O=N.TRUSTED_TYPES_POLICY,D=O.createHTML("")}else O===void 0&&(O=nV(f,i)),O!==null&&typeof D=="string"&&(D=O.createHTML(""));Yn&&Yn(N),Lu=N}},ST=Ve({},[...vy,...Cy,...zF]),RT=Ve({},[...yy,...YF]),C$=function(N){let ee=I(N);(!ee||!ee.tagName)&&(ee={namespaceURI:pt,tagName:"template"});const me=Nm(N.tagName),Et=Nm(ee.tagName);return Fe[N.namespaceURI]?N.namespaceURI===Jt?ee.namespaceURI===Lt?me==="svg":ee.namespaceURI===fn?me==="svg"&&(Et==="annotation-xml"||wl[Et]):!!ST[me]:N.namespaceURI===fn?ee.namespaceURI===Lt?me==="math":ee.namespaceURI===Jt?me==="math"&&Xf[Et]:!!RT[me]:N.namespaceURI===Lt?ee.namespaceURI===Jt&&!Xf[Et]||ee.namespaceURI===fn&&!wl[Et]?!1:!RT[me]&&(m$[me]||!ST[me]):!!(Ch==="application/xhtml+xml"&&Fe[N.namespaceURI]):!1},Yo=function(N){Rh(e.removed,{element:N});try{I(N).removeChild(N)}catch{w(N)}},Zf=function(N,ee){try{Rh(e.removed,{attribute:ee.getAttributeNode(N),from:ee})}catch{Rh(e.removed,{attribute:null,from:ee})}if(ee.removeAttribute(N),N==="is")if(P||L)try{Yo(ee)}catch{}else try{ee.setAttribute(N,"")}catch{}},ET=function(N){let ee=null,me=null;if(B)N="<remove></remove>"+N;else{const Cn=zI(N,/^[\r\n\t ]+/);me=Cn&&Cn[0]}Ch==="application/xhtml+xml"&&pt===Lt&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const Et=O?O.createHTML(N):N;if(pt===Lt)try{ee=new d().parseFromString(Et,Ch)}catch{}if(!ee||!ee.documentElement){ee=_.createDocument(pt,"template",null);try{ee.documentElement.innerHTML=nt?D:Et}catch{}}const En=ee.body||ee.documentElement;return N&&me&&En.insertBefore(n.createTextNode(me),En.childNodes[0]||null),pt===Lt?X.call(ee,A?"html":"body")[0]:A?ee.documentElement:En},TT=function(N){return x.call(N.ownerDocument||N,N,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},qw=function(N){return N instanceof h&&(typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||!(N.attributes instanceof c)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function")},_T=function(N){return typeof a=="function"&&N instanceof a};function Hs(ve,N,ee){Jf(ve,me=>{me.call(e,N,ee,Lu)})}const MT=function(N){let ee=null;if(Hs(Z.beforeSanitizeElements,N,null),qw(N))return Yo(N),!0;const me=gn(N.nodeName);if(Hs(Z.uponSanitizeElement,N,{tagName:me,allowedTags:g}),N.hasChildNodes()&&!_T(N.firstElementChild)&&kn(/<[/\w]/g,N.innerHTML)&&kn(/<[/\w]/g,N.textContent)||N.nodeType===Mh.progressingInstruction||k&&N.nodeType===Mh.comment&&kn(/<[/\w]/g,N.data))return Yo(N),!0;if(!g[me]||W[me]){if(!W[me]&&PT(me)&&(H.tagNameCheck instanceof RegExp&&kn(H.tagNameCheck,me)||H.tagNameCheck instanceof Function&&H.tagNameCheck(me)))return!1;if(de&&!Be[me]){const Et=I(N)||N.parentNode,En=R(N)||N.childNodes;if(En&&Et){const Cn=En.length;for(let er=Cn-1;er>=0;--er){const Go=C(En[er],!0);Go.__removalCount=(N.__removalCount||0)+1,Et.insertBefore(Go,S(N))}}}return Yo(N),!0}return N instanceof l&&!C$(N)||(me==="noscript"||me==="noembed"||me==="noframes")&&kn(/<\/no(script|embed|frames)/i,N.innerHTML)?(Yo(N),!0):(T&&N.nodeType===Mh.text&&(ee=N.textContent,Jf([Q,le,te],Et=>{ee=Eh(ee,Et," ")}),N.textContent!==ee&&(Rh(e.removed,{element:N.cloneNode()}),N.textContent=ee)),Hs(Z.afterSanitizeElements,N,null),!1)},IT=function(N,ee,me){if(V&&(ee==="id"||ee==="name")&&(me in n||me in v$))return!1;if(!(oe&&!G[ee]&&kn(ue,ee))){if(!(K&&kn(ft,ee))){if(!v[ee]||G[ee]){if(!(PT(N)&&(H.tagNameCheck instanceof RegExp&&kn(H.tagNameCheck,N)||H.tagNameCheck instanceof Function&&H.tagNameCheck(N))&&(H.attributeNameCheck instanceof RegExp&&kn(H.attributeNameCheck,ee)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(ee))||ee==="is"&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&kn(H.tagNameCheck,me)||H.tagNameCheck instanceof Function&&H.tagNameCheck(me))))return!1}else if(!go[ee]){if(!kn(Zt,Eh(me,Le,""))){if(!((ee==="src"||ee==="xlink:href"||ee==="href")&&N!=="script"&&WF(me,"data:")===0&&$e[N])){if(!(y&&!kn(Re,Eh(me,Le,"")))){if(me)return!1}}}}}}return!0},PT=function(N){return N!=="annotation-xml"&&zI(N,Rt)},OT=function(N){Hs(Z.beforeSanitizeAttributes,N,null);const{attributes:ee}=N;if(!ee||qw(N))return;const me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:v,forceKeepAttr:void 0};let Et=ee.length;for(;Et--;){const En=ee[Et],{name:Cn,namespaceURI:er,value:Go}=En,yh=gn(Cn);let Dn=Cn==="value"?Go:BF(Go);if(me.attrName=yh,me.attrValue=Dn,me.keepAttr=!0,me.forceKeepAttr=void 0,Hs(Z.uponSanitizeAttribute,N,me),Dn=me.attrValue,z&&(yh==="id"||yh==="name")&&(Zf(Cn,N),Dn=ce+Dn),k&&kn(/((--!?|])>)|<\/(style|title)/i,Dn)){Zf(Cn,N);continue}if(me.forceKeepAttr||(Zf(Cn,N),!me.keepAttr))continue;if(!b&&kn(/\/>/i,Dn)){Zf(Cn,N);continue}T&&Jf([Q,le,te],AT=>{Dn=Eh(Dn,AT," ")});const xT=gn(N.nodeName);if(IT(xT,yh,Dn)){if(O&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!er)switch(f.getAttributeType(xT,yh)){case"TrustedHTML":{Dn=O.createHTML(Dn);break}case"TrustedScriptURL":{Dn=O.createScriptURL(Dn);break}}try{er?N.setAttributeNS(er,Cn,Dn):N.setAttribute(Cn,Dn),qw(N)?Yo(N):UI(e.removed)}catch{}}}Hs(Z.afterSanitizeAttributes,N,null)},y$=function ve(N){let ee=null;const me=TT(N);for(Hs(Z.beforeSanitizeShadowDOM,N,null);ee=me.nextNode();)Hs(Z.uponSanitizeShadowNode,ee,null),MT(ee),OT(ee),ee.content instanceof o&&ve(ee.content);Hs(Z.afterSanitizeShadowDOM,N,null)};return e.sanitize=function(ve){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=null,me=null,Et=null,En=null;if(nt=!ve,nt&&(ve="<!-->"),typeof ve!="string"&&!_T(ve))if(typeof ve.toString=="function"){if(ve=ve.toString(),typeof ve!="string")throw Th("dirty is not a string, aborting")}else throw Th("toString is not a function");if(!e.isSupported)return ve;if($||Kw(N),e.removed=[],typeof ve=="string"&&(Se=!1),Se){if(ve.nodeName){const Go=gn(ve.nodeName);if(!g[Go]||W[Go])throw Th("root node is forbidden and cannot be sanitized in-place")}}else if(ve instanceof a)ee=ET("<!---->"),me=ee.ownerDocument.importNode(ve,!0),me.nodeType===Mh.element&&me.nodeName==="BODY"||me.nodeName==="HTML"?ee=me:ee.appendChild(me);else{if(!P&&!T&&!A&&ve.indexOf("<")===-1)return O&&F?O.createHTML(ve):ve;if(ee=ET(ve),!ee)return P?null:F?D:""}ee&&B&&Yo(ee.firstChild);const Cn=TT(Se?ve:ee);for(;Et=Cn.nextNode();)MT(Et),OT(Et),Et.content instanceof o&&y$(Et.content);if(Se)return ve;if(P){if(L)for(En=j.call(ee.ownerDocument);ee.firstChild;)En.appendChild(ee.firstChild);else En=ee;return(v.shadowroot||v.shadowrootmode)&&(En=U.call(r,En,!0)),En}let er=A?ee.outerHTML:ee.innerHTML;return A&&g["!doctype"]&&ee.ownerDocument&&ee.ownerDocument.doctype&&ee.ownerDocument.doctype.name&&kn(f1,ee.ownerDocument.doctype.name)&&(er="<!DOCTYPE "+ee.ownerDocument.doctype.name+`>
|
|
2
|
-
`+er),T&&Jf([Q,le,te],Go=>{er=Eh(er,Go," ")}),O&&F?O.createHTML(er):er},e.setConfig=function(){let ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Kw(ve),$=!0},e.clearConfig=function(){Lu=null,$=!1},e.isValidAttribute=function(ve,N,ee){Lu||Kw({});const me=gn(ve),Et=gn(N);return IT(me,Et,ee)},e.addHook=function(ve,N){typeof N=="function"&&Rh(Z[ve],N)},e.removeHook=function(ve,N){if(N!==void 0){const ee=FF(Z[ve],N);return ee===-1?void 0:VF(Z[ve],ee,1)[0]}return UI(Z[ve])},e.removeHooks=function(ve){Z[ve]=[]},e.removeAllHooks=function(){Z=ZI()},e}var rV=g1();//! moment.js
|
|
3
|
-
//! version : 2.30.1
|
|
4
|
-
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
5
|
-
//! license : MIT
|
|
6
|
-
//! momentjs.com
|
|
7
|
-
var m1;function q(){return m1.apply(null,arguments)}function iV(t){m1=t}function ko(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function pu(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function Ze(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function hE(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(Ze(t,e))return!1;return!0}function lr(t){return t===void 0}function ga(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function Pf(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function p1(t,e){var n=[],r,i=t.length;for(r=0;r<i;++r)n.push(e(t[r],r));return n}function Ja(t,e){for(var n in e)Ze(e,n)&&(t[n]=e[n]);return Ze(e,"toString")&&(t.toString=e.toString),Ze(e,"valueOf")&&(t.valueOf=e.valueOf),t}function Os(t,e,n,r){return F1(t,e,n,r,!0).utc()}function oV(){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 Pe(t){return t._pf==null&&(t._pf=oV()),t._pf}var XS;Array.prototype.some?XS=Array.prototype.some:XS=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 dE(t){var e=null,n=!1,r=t._d&&!isNaN(t._d.getTime());if(r&&(e=Pe(t),n=XS.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 rw(t){var e=Os(NaN);return t!=null?Ja(Pe(e),t):Pe(e).userInvalidated=!0,e}var JI=q.momentProperties=[],Sy=!1;function fE(t,e){var n,r,i,o=JI.length;if(lr(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),lr(e._i)||(t._i=e._i),lr(e._f)||(t._f=e._f),lr(e._l)||(t._l=e._l),lr(e._strict)||(t._strict=e._strict),lr(e._tzm)||(t._tzm=e._tzm),lr(e._isUTC)||(t._isUTC=e._isUTC),lr(e._offset)||(t._offset=e._offset),lr(e._pf)||(t._pf=Pe(e)),lr(e._locale)||(t._locale=e._locale),o>0)for(n=0;n<o;n++)r=JI[n],i=e[r],lr(i)||(t[r]=i);return t}function Of(t){fE(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Sy===!1&&(Sy=!0,q.updateOffset(this),Sy=!1)}function Lo(t){return t instanceof Of||t!=null&&t._isAMomentObject!=null}function w1(t){q.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function co(t,e){var n=!0;return Ja(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+=`
|
|
8
|
-
[`+o+"] ";for(s in arguments[0])Ze(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[o];r.push(i)}w1(t+`
|
|
9
|
-
Arguments: `+Array.prototype.slice.call(r).join("")+`
|
|
10
|
-
`+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var QI={};function v1(t,e){q.deprecationHandler!=null&&q.deprecationHandler(t,e),QI[t]||(w1(e),QI[t]=!0)}q.suppressDeprecationWarnings=!1;q.deprecationHandler=null;function xs(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function sV(t){var e,n;for(n in t)Ze(t,n)&&(e=t[n],xs(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 ZS(t,e){var n=Ja({},t),r;for(r in e)Ze(e,r)&&(pu(t[r])&&pu(e[r])?(n[r]={},Ja(n[r],t[r]),Ja(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)Ze(t,r)&&!Ze(e,r)&&pu(t[r])&&(n[r]=Ja({},n[r]));return n}function gE(t){t!=null&&this.set(t)}var JS;Object.keys?JS=Object.keys:JS=function(t){var e,n=[];for(e in t)Ze(t,e)&&n.push(e);return n};var aV={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function lV(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return xs(r)?r.call(e,n):r}function _s(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 mE=/(\[[^\[]*\])|(\\)?([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,eg=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ry={},Fc={};function ye(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(Fc[t]=i),e&&(Fc[e[0]]=function(){return _s(i.apply(this,arguments),e[1],e[2])}),n&&(Fc[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function uV(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function cV(t){var e=t.match(mE),n,r;for(n=0,r=e.length;n<r;n++)Fc[e[n]]?e[n]=Fc[e[n]]:e[n]=uV(e[n]);return function(i){var o="",s;for(s=0;s<r;s++)o+=xs(e[s])?e[s].call(i,t):e[s];return o}}function Dm(t,e){return t.isValid()?(e=C1(e,t.localeData()),Ry[e]=Ry[e]||cV(e),Ry[e](t)):t.localeData().invalidDate()}function C1(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(eg.lastIndex=0;n>=0&&eg.test(t);)t=t.replace(eg,r),eg.lastIndex=0,n-=1;return t}var hV={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 dV(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(mE).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var fV="Invalid date";function gV(){return this._invalidDate}var mV="%d",pV=/\d{1,2}/;function wV(t){return this._ordinal.replace("%d",t)}var vV={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 CV(t,e,n,r){var i=this._relativeTime[n];return xs(i)?i(t,e,n,r):i.replace(/%d/i,t)}function yV(t,e){var n=this._relativeTime[t>0?"future":"past"];return xs(n)?n(e):n.replace(/%s/i,e)}var eP={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 ho(t){return typeof t=="string"?eP[t]||eP[t.toLowerCase()]:void 0}function pE(t){var e={},n,r;for(r in t)Ze(t,r)&&(n=ho(r),n&&(e[n]=t[r]));return e}var bV={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 SV(t){var e=[],n;for(n in t)Ze(t,n)&&e.push({unit:n,priority:bV[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var y1=/\d/,ji=/\d\d/,b1=/\d{3}/,wE=/\d{4}/,iw=/[+-]?\d{6}/,St=/\d\d?/,S1=/\d\d\d\d?/,R1=/\d\d\d\d\d\d?/,ow=/\d{1,3}/,vE=/\d{1,4}/,sw=/[+-]?\d{1,6}/,uh=/\d+/,aw=/[+-]?\d+/,RV=/Z|[+-]\d\d:?\d\d/gi,lw=/Z|[+-]\d\d(?::?\d\d)?/gi,EV=/[+-]?\d+(\.\d{1,3})?/,xf=/[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,ch=/^[1-9]\d?/,CE=/^([1-9]\d|\d)/,np;np={};function ae(t,e,n){np[t]=xs(e)?e:function(r,i){return r&&n?n:e}}function TV(t,e){return Ze(np,t)?np[t](e._strict,e._locale):new RegExp(_V(t))}function _V(t){return da(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,o){return n||r||i||o}))}function da(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ro(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=ro(e)),n}var QS={};function ct(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),ga(e)&&(r=function(o,s){s[e]=Ue(o)}),i=t.length,n=0;n<i;n++)QS[t[n]]=r}function Af(t,e){ct(t,function(n,r,i,o){i._w=i._w||{},e(n,i._w,i,o)})}function MV(t,e,n){e!=null&&Ze(QS,t)&&QS[t](e,n._a,n,t)}function uw(t){return t%4===0&&t%100!==0||t%400===0}var Hn=0,oa=1,ys=2,hn=3,Ho=4,sa=5,uu=6,IV=7,PV=8;ye("Y",0,0,function(){var t=this.year();return t<=9999?_s(t,4):"+"+t});ye(0,["YY",2],0,function(){return this.year()%100});ye(0,["YYYY",4],0,"year");ye(0,["YYYYY",5],0,"year");ye(0,["YYYYYY",6,!0],0,"year");ae("Y",aw);ae("YY",St,ji);ae("YYYY",vE,wE);ae("YYYYY",sw,iw);ae("YYYYYY",sw,iw);ct(["YYYYY","YYYYYY"],Hn);ct("YYYY",function(t,e){e[Hn]=t.length===2?q.parseTwoDigitYear(t):Ue(t)});ct("YY",function(t,e){e[Hn]=q.parseTwoDigitYear(t)});ct("Y",function(t,e){e[Hn]=parseInt(t,10)});function Hd(t){return uw(t)?366:365}q.parseTwoDigitYear=function(t){return Ue(t)+(Ue(t)>68?1900:2e3)};var E1=hh("FullYear",!0);function OV(){return uw(this.year())}function hh(t,e){return function(n){return n!=null?(T1(this,t,n),q.updateOffset(this,e),this):ef(this,t)}}function ef(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 T1(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&&!uw(o)?28:a,i?r.setUTCFullYear(o,s,a):r.setFullYear(o,s,a)}}function xV(t){return t=ho(t),xs(this[t])?this[t]():this}function AV(t,e){if(typeof t=="object"){t=pE(t);var n=SV(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=ho(t),xs(this[t]))return this[t](e);return this}function HV(t,e){return(t%e+e)%e}var Yt;Array.prototype.indexOf?Yt=Array.prototype.indexOf:Yt=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function yE(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=HV(e,12);return t+=(e-n)/12,n===1?uw(t)?29:28:31-n%7%2}ye("M",["MM",2],"Mo",function(){return this.month()+1});ye("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)});ye("MMMM",0,0,function(t){return this.localeData().months(this,t)});ae("M",St,ch);ae("MM",St,ji);ae("MMM",function(t,e){return e.monthsShortRegex(t)});ae("MMMM",function(t,e){return e.monthsRegex(t)});ct(["M","MM"],function(t,e){e[oa]=Ue(t)-1});ct(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[oa]=i:Pe(n).invalidMonth=t});var NV="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),_1="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),M1=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,DV=xf,kV=xf;function LV(t,e){return t?ko(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||M1).test(e)?"format":"standalone"][t.month()]:ko(this._months)?this._months:this._months.standalone}function $V(t,e){return t?ko(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[M1.test(e)?"format":"standalone"][t.month()]:ko(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function FV(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=Os([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?e==="MMM"?(i=Yt.call(this._shortMonthsParse,s),i!==-1?i:null):(i=Yt.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=Yt.call(this._shortMonthsParse,s),i!==-1?i:(i=Yt.call(this._longMonthsParse,s),i!==-1?i:null)):(i=Yt.call(this._longMonthsParse,s),i!==-1?i:(i=Yt.call(this._shortMonthsParse,s),i!==-1?i:null))}function VV(t,e,n){var r,i,o;if(this._monthsParseExact)return FV.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=Os([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 I1(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),!ga(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,yE(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function P1(t){return t!=null?(I1(this,t),q.updateOffset(this,!0),this):ef(this,"Month")}function WV(){return yE(this.year(),this.month())}function BV(t){return this._monthsParseExact?(Ze(this,"_monthsRegex")||O1.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(Ze(this,"_monthsShortRegex")||(this._monthsShortRegex=DV),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function jV(t){return this._monthsParseExact?(Ze(this,"_monthsRegex")||O1.call(this),t?this._monthsStrictRegex:this._monthsRegex):(Ze(this,"_monthsRegex")||(this._monthsRegex=kV),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function O1(){function t(l,u){return u.length-l.length}var e=[],n=[],r=[],i,o,s,a;for(i=0;i<12;i++)o=Os([2e3,i]),s=da(this.monthsShort(o,"")),a=da(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 UV(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 tf(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 rp(t,e,n){var r=7+e-n,i=(7+tf(t,0,r).getUTCDay()-e)%7;return-i+r-1}function x1(t,e,n,r,i){var o=(7+n-r)%7,s=rp(t,r,i),a=1+7*(e-1)+o+s,l,u;return a<=0?(l=t-1,u=Hd(l)+a):a>Hd(t)?(l=t+1,u=a-Hd(t)):(l=t,u=a),{year:l,dayOfYear:u}}function nf(t,e,n){var r=rp(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,o,s;return i<1?(s=t.year()-1,o=i+fa(s,e,n)):i>fa(t.year(),e,n)?(o=i-fa(t.year(),e,n),s=t.year()+1):(s=t.year(),o=i),{week:o,year:s}}function fa(t,e,n){var r=rp(t,e,n),i=rp(t+1,e,n);return(Hd(t)-r+i)/7}ye("w",["ww",2],"wo","week");ye("W",["WW",2],"Wo","isoWeek");ae("w",St,ch);ae("ww",St,ji);ae("W",St,ch);ae("WW",St,ji);Af(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=Ue(t)});function zV(t){return nf(t,this._week.dow,this._week.doy).week}var YV={dow:0,doy:6};function GV(){return this._week.dow}function KV(){return this._week.doy}function qV(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function XV(t){var e=nf(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}ye("d",0,"do","day");ye("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});ye("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});ye("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});ye("e",0,0,"weekday");ye("E",0,0,"isoWeekday");ae("d",St);ae("e",St);ae("E",St);ae("dd",function(t,e){return e.weekdaysMinRegex(t)});ae("ddd",function(t,e){return e.weekdaysShortRegex(t)});ae("dddd",function(t,e){return e.weekdaysRegex(t)});Af(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:Pe(n).invalidWeekday=t});Af(["d","e","E"],function(t,e,n,r){e[r]=Ue(t)});function ZV(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function JV(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function bE(t,e){return t.slice(e,7).concat(t.slice(0,e))}var QV="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),A1="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),eW="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),tW=xf,nW=xf,rW=xf;function iW(t,e){var n=ko(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?bE(n,this._week.dow):t?n[t.day()]:n}function oW(t){return t===!0?bE(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function sW(t){return t===!0?bE(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function aW(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=Os([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=Yt.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=Yt.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Yt.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=Yt.call(this._weekdaysParse,s),i!==-1||(i=Yt.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Yt.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=Yt.call(this._shortWeekdaysParse,s),i!==-1||(i=Yt.call(this._weekdaysParse,s),i!==-1)?i:(i=Yt.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Yt.call(this._minWeekdaysParse,s),i!==-1||(i=Yt.call(this._weekdaysParse,s),i!==-1)?i:(i=Yt.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function lW(t,e,n){var r,i,o;if(this._weekdaysParseExact)return aW.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=Os([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 uW(t){if(!this.isValid())return t!=null?this:NaN;var e=ef(this,"Day");return t!=null?(t=ZV(t,this.localeData()),this.add(t-e,"d")):e}function cW(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 hW(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=JV(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function dW(t){return this._weekdaysParseExact?(Ze(this,"_weekdaysRegex")||SE.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Ze(this,"_weekdaysRegex")||(this._weekdaysRegex=tW),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function fW(t){return this._weekdaysParseExact?(Ze(this,"_weekdaysRegex")||SE.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Ze(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=nW),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function gW(t){return this._weekdaysParseExact?(Ze(this,"_weekdaysRegex")||SE.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Ze(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=rW),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function SE(){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=Os([2e3,1]).day(o),a=da(this.weekdaysMin(s,"")),l=da(this.weekdaysShort(s,"")),u=da(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 RE(){return this.hours()%12||12}function mW(){return this.hours()||24}ye("H",["HH",2],0,"hour");ye("h",["hh",2],0,RE);ye("k",["kk",2],0,mW);ye("hmm",0,0,function(){return""+RE.apply(this)+_s(this.minutes(),2)});ye("hmmss",0,0,function(){return""+RE.apply(this)+_s(this.minutes(),2)+_s(this.seconds(),2)});ye("Hmm",0,0,function(){return""+this.hours()+_s(this.minutes(),2)});ye("Hmmss",0,0,function(){return""+this.hours()+_s(this.minutes(),2)+_s(this.seconds(),2)});function H1(t,e){ye(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}H1("a",!0);H1("A",!1);function N1(t,e){return e._meridiemParse}ae("a",N1);ae("A",N1);ae("H",St,CE);ae("h",St,ch);ae("k",St,ch);ae("HH",St,ji);ae("hh",St,ji);ae("kk",St,ji);ae("hmm",S1);ae("hmmss",R1);ae("Hmm",S1);ae("Hmmss",R1);ct(["H","HH"],hn);ct(["k","kk"],function(t,e,n){var r=Ue(t);e[hn]=r===24?0:r});ct(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t});ct(["h","hh"],function(t,e,n){e[hn]=Ue(t),Pe(n).bigHour=!0});ct("hmm",function(t,e,n){var r=t.length-2;e[hn]=Ue(t.substr(0,r)),e[Ho]=Ue(t.substr(r)),Pe(n).bigHour=!0});ct("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[hn]=Ue(t.substr(0,r)),e[Ho]=Ue(t.substr(r,2)),e[sa]=Ue(t.substr(i)),Pe(n).bigHour=!0});ct("Hmm",function(t,e,n){var r=t.length-2;e[hn]=Ue(t.substr(0,r)),e[Ho]=Ue(t.substr(r))});ct("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[hn]=Ue(t.substr(0,r)),e[Ho]=Ue(t.substr(r,2)),e[sa]=Ue(t.substr(i))});function pW(t){return(t+"").toLowerCase().charAt(0)==="p"}var wW=/[ap]\.?m?\.?/i,vW=hh("Hours",!0);function CW(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var D1={calendar:aV,longDateFormat:hV,invalidDate:fV,ordinal:mV,dayOfMonthOrdinalParse:pV,relativeTime:vV,months:NV,monthsShort:_1,week:YV,weekdays:QV,weekdaysMin:eW,weekdaysShort:A1,meridiemParse:wW},Tt={},Ih={},rf;function yW(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 bW(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=cw(o.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&yW(o,r)>=n-1)break;n--}e++}return rf}function SW(t){return!!(t&&t.match("^[^/\\\\]*$"))}function cw(t){var e=null,n;if(Tt[t]===void 0&&typeof module<"u"&&module&&module.exports&&SW(t))try{e=rf._abbr,n=require,n("./locale/"+t),il(e)}catch{Tt[t]=null}return Tt[t]}function il(t,e){var n;return t&&(lr(e)?n=Ca(t):n=EE(t,e),n?rf=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),rf._abbr}function EE(t,e){if(e!==null){var n,r=D1;if(e.abbr=t,Tt[t]!=null)v1("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=Tt[t]._config;else if(e.parentLocale!=null)if(Tt[e.parentLocale]!=null)r=Tt[e.parentLocale]._config;else if(n=cw(e.parentLocale),n!=null)r=n._config;else return Ih[e.parentLocale]||(Ih[e.parentLocale]=[]),Ih[e.parentLocale].push({name:t,config:e}),null;return Tt[t]=new gE(ZS(r,e)),Ih[t]&&Ih[t].forEach(function(i){EE(i.name,i.config)}),il(t),Tt[t]}else return delete Tt[t],null}function RW(t,e){if(e!=null){var n,r,i=D1;Tt[t]!=null&&Tt[t].parentLocale!=null?Tt[t].set(ZS(Tt[t]._config,e)):(r=cw(t),r!=null&&(i=r._config),e=ZS(i,e),r==null&&(e.abbr=t),n=new gE(e),n.parentLocale=Tt[t],Tt[t]=n),il(t)}else Tt[t]!=null&&(Tt[t].parentLocale!=null?(Tt[t]=Tt[t].parentLocale,t===il()&&il(t)):Tt[t]!=null&&delete Tt[t]);return Tt[t]}function Ca(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return rf;if(!ko(t)){if(e=cw(t),e)return e;t=[t]}return bW(t)}function EW(){return JS(Tt)}function TE(t){var e,n=t._a;return n&&Pe(t).overflow===-2&&(e=n[oa]<0||n[oa]>11?oa:n[ys]<1||n[ys]>yE(n[Hn],n[oa])?ys:n[hn]<0||n[hn]>24||n[hn]===24&&(n[Ho]!==0||n[sa]!==0||n[uu]!==0)?hn:n[Ho]<0||n[Ho]>59?Ho:n[sa]<0||n[sa]>59?sa:n[uu]<0||n[uu]>999?uu:-1,Pe(t)._overflowDayOfYear&&(e<Hn||e>ys)&&(e=ys),Pe(t)._overflowWeeks&&e===-1&&(e=IV),Pe(t)._overflowWeekday&&e===-1&&(e=PV),Pe(t).overflow=e),t}var TW=/^\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)?)?$/,_W=/^\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)?)?$/,MW=/Z|[+-]\d\d(?::?\d\d)?/,tg=[["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]],Ey=[["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/]],IW=/^\/?Date\((-?\d+)/i,PW=/^(?:(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}))$/,OW={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function k1(t){var e,n,r=t._i,i=TW.exec(r)||_W.exec(r),o,s,a,l,u=tg.length,c=Ey.length;if(i){for(Pe(t).iso=!0,e=0,n=u;e<n;e++)if(tg[e][1].exec(i[1])){s=tg[e][0],o=tg[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(i[3]){for(e=0,n=c;e<n;e++)if(Ey[e][1].exec(i[3])){a=(i[2]||" ")+Ey[e][0];break}if(a==null){t._isValid=!1;return}}if(!o&&a!=null){t._isValid=!1;return}if(i[4])if(MW.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=s+(a||"")+(l||""),ME(t)}else t._isValid=!1}function xW(t,e,n,r,i,o){var s=[AW(t),_1.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return o&&s.push(parseInt(o,10)),s}function AW(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function HW(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function NW(t,e,n){if(t){var r=A1.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return Pe(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function DW(t,e,n){if(t)return OW[t];if(e)return 0;var r=parseInt(n,10),i=r%100,o=(r-i)/100;return o*60+i}function L1(t){var e=PW.exec(HW(t._i)),n;if(e){if(n=xW(e[4],e[3],e[2],e[5],e[6],e[7]),!NW(e[1],n,t))return;t._a=n,t._tzm=DW(e[8],e[9],e[10]),t._d=tf.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),Pe(t).rfc2822=!0}else t._isValid=!1}function kW(t){var e=IW.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(k1(t),t._isValid===!1)delete t._isValid;else return;if(L1(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:q.createFromInputFallback(t)}q.createFromInputFallback=co("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 Rc(t,e,n){return t??e??n}function LW(t){var e=new Date(q.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function _E(t){var e,n,r=[],i,o,s;if(!t._d){for(i=LW(t),t._w&&t._a[ys]==null&&t._a[oa]==null&&$W(t),t._dayOfYear!=null&&(s=Rc(t._a[Hn],i[Hn]),(t._dayOfYear>Hd(s)||t._dayOfYear===0)&&(Pe(t)._overflowDayOfYear=!0),n=tf(s,0,t._dayOfYear),t._a[oa]=n.getUTCMonth(),t._a[ys]=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[hn]===24&&t._a[Ho]===0&&t._a[sa]===0&&t._a[uu]===0&&(t._nextDay=!0,t._a[hn]=0),t._d=(t._useUTC?tf:UV).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[hn]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==o&&(Pe(t).weekdayMismatch=!0)}}function $W(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=Rc(e.GG,t._a[Hn],nf(bt(),1,4).year),r=Rc(e.W,1),i=Rc(e.E,1),(i<1||i>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,u=nf(bt(),o,s),n=Rc(e.gg,t._a[Hn],u.year),r=Rc(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>fa(n,o,s)?Pe(t)._overflowWeeks=!0:l!=null?Pe(t)._overflowWeekday=!0:(a=x1(n,r,i,o,s),t._a[Hn]=a.year,t._dayOfYear=a.dayOfYear)}q.ISO_8601=function(){};q.RFC_2822=function(){};function ME(t){if(t._f===q.ISO_8601){k1(t);return}if(t._f===q.RFC_2822){L1(t);return}t._a=[],Pe(t).empty=!0;var e=""+t._i,n,r,i,o,s,a=e.length,l=0,u,c;for(i=C1(t._f,t._locale).match(mE)||[],c=i.length,n=0;n<c;n++)o=i[n],r=(e.match(TV(o,t))||[])[0],r&&(s=e.substr(0,e.indexOf(r)),s.length>0&&Pe(t).unusedInput.push(s),e=e.slice(e.indexOf(r)+r.length),l+=r.length),Fc[o]?(r?Pe(t).empty=!1:Pe(t).unusedTokens.push(o),MV(o,r,t)):t._strict&&!r&&Pe(t).unusedTokens.push(o);Pe(t).charsLeftOver=a-l,e.length>0&&Pe(t).unusedInput.push(e),t._a[hn]<=12&&Pe(t).bigHour===!0&&t._a[hn]>0&&(Pe(t).bigHour=void 0),Pe(t).parsedDateParts=t._a.slice(0),Pe(t).meridiem=t._meridiem,t._a[hn]=FW(t._locale,t._a[hn],t._meridiem),u=Pe(t).era,u!==null&&(t._a[Hn]=t._locale.erasConvertYear(u,t._a[Hn])),_E(t),TE(t)}function FW(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 VW(t){var e,n,r,i,o,s,a=!1,l=t._f.length;if(l===0){Pe(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)o=0,s=!1,e=fE({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],ME(e),dE(e)&&(s=!0),o+=Pe(e).charsLeftOver,o+=Pe(e).unusedTokens.length*10,Pe(e).score=o,a?o<r&&(r=o,n=e):(r==null||o<r||s)&&(r=o,n=e,s&&(a=!0));Ja(t,n||e)}function WW(t){if(!t._d){var e=pE(t._i),n=e.day===void 0?e.date:e.day;t._a=p1([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),_E(t)}}function BW(t){var e=new Of(TE($1(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function $1(t){var e=t._i,n=t._f;return t._locale=t._locale||Ca(t._l),e===null||n===void 0&&e===""?rw({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),Lo(e)?new Of(TE(e)):(Pf(e)?t._d=e:ko(n)?VW(t):n?ME(t):jW(t),dE(t)||(t._d=null),t))}function jW(t){var e=t._i;lr(e)?t._d=new Date(q.now()):Pf(e)?t._d=new Date(e.valueOf()):typeof e=="string"?kW(t):ko(e)?(t._a=p1(e.slice(0),function(n){return parseInt(n,10)}),_E(t)):pu(e)?WW(t):ga(e)?t._d=new Date(e):q.createFromInputFallback(t)}function F1(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),(pu(t)&&hE(t)||ko(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,BW(o)}function bt(t,e,n,r){return F1(t,e,n,r,!1)}var UW=co("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=bt.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:rw()}),zW=co("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=bt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:rw()});function V1(t,e){var n,r;if(e.length===1&&ko(e[0])&&(e=e[0]),!e.length)return bt();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function YW(){var t=[].slice.call(arguments,0);return V1("isBefore",t)}function GW(){var t=[].slice.call(arguments,0);return V1("isAfter",t)}var KW=function(){return Date.now?Date.now():+new Date},Ph=["year","quarter","month","week","day","hour","minute","second","millisecond"];function qW(t){var e,n=!1,r,i=Ph.length;for(e in t)if(Ze(t,e)&&!(Yt.call(Ph,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[Ph[r]]){if(n)return!1;parseFloat(t[Ph[r]])!==Ue(t[Ph[r]])&&(n=!0)}return!0}function XW(){return this._isValid}function ZW(){return Bo(NaN)}function hw(t){var e=pE(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=qW(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=Ca(),this._bubble()}function km(t){return t instanceof hw}function eR(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function JW(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 W1(t,e){ye(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+_s(~~(n/60),2)+e+_s(~~n%60,2)})}W1("Z",":");W1("ZZ","");ae("Z",lw);ae("ZZ",lw);ct(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=IE(lw,t)});var QW=/([\+\-]|\d\d)/gi;function IE(t,e){var n=(e||"").match(t),r,i,o;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(QW)||["-",0,0],o=+(i[1]*60)+Ue(i[2]),o===0?0:i[0]==="+"?o:-o)}function PE(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(Lo(t)||Pf(t)?t.valueOf():bt(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),q.updateOffset(n,!1),n):bt(t).local()}function tR(t){return-Math.round(t._d.getTimezoneOffset())}q.updateOffset=function(){};function eB(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=IE(lw,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=tR(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?U1(this,Bo(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,q.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:tR(this)}function tB(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function nB(t){return this.utcOffset(0,t)}function rB(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(tR(this),"m")),this}function iB(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=IE(RV,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function oB(t){return this.isValid()?(t=t?bt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function sB(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function aB(){if(!lr(this._isDSTShifted))return this._isDSTShifted;var t={},e;return fE(t,this),t=$1(t),t._a?(e=t._isUTC?Os(t._a):bt(t._a),this._isDSTShifted=this.isValid()&&JW(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function lB(){return this.isValid()?!this._isUTC:!1}function uB(){return this.isValid()?this._isUTC:!1}function B1(){return this.isValid()?this._isUTC&&this._offset===0:!1}var cB=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,hB=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Bo(t,e){var n=t,r=null,i,o,s;return km(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:ga(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=cB.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:Ue(r[ys])*i,h:Ue(r[hn])*i,m:Ue(r[Ho])*i,s:Ue(r[sa])*i,ms:Ue(eR(r[uu]*1e3))*i}):(r=hB.exec(t))?(i=r[1]==="-"?-1:1,n={y:vl(r[2],i),M:vl(r[3],i),w:vl(r[4],i),d:vl(r[5],i),h:vl(r[6],i),m:vl(r[7],i),s:vl(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(s=dB(bt(n.from),bt(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),o=new hw(n),km(t)&&Ze(t,"_locale")&&(o._locale=t._locale),km(t)&&Ze(t,"_isValid")&&(o._isValid=t._isValid),o}Bo.fn=hw.prototype;Bo.invalid=ZW;function vl(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function nP(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 dB(t,e){var n;return t.isValid()&&e.isValid()?(e=PE(e,t),t.isBefore(e)?n=nP(t,e):(n=nP(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function j1(t,e){return function(n,r){var i,o;return r!==null&&!isNaN(+r)&&(v1(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=Bo(n,r),U1(this,i,t),this}}function U1(t,e,n,r){var i=e._milliseconds,o=eR(e._days),s=eR(e._months);t.isValid()&&(r=r??!0,s&&I1(t,ef(t,"Month")+s*n),o&&T1(t,"Date",ef(t,"Date")+o*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&q.updateOffset(t,o||s))}var fB=j1(1,"add"),gB=j1(-1,"subtract");function z1(t){return typeof t=="string"||t instanceof String}function mB(t){return Lo(t)||Pf(t)||z1(t)||ga(t)||wB(t)||pB(t)||t===null||t===void 0}function pB(t){var e=pu(t)&&!hE(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||Ze(t,o);return e&&n}function wB(t){var e=ko(t),n=!1;return e&&(n=t.filter(function(r){return!ga(r)&&z1(t)}).length===0),e&&n}function vB(t){var e=pu(t)&&!hE(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||Ze(t,o);return e&&n}function CB(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 yB(t,e){arguments.length===1&&(arguments[0]?mB(arguments[0])?(t=arguments[0],e=void 0):vB(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||bt(),r=PE(n,this).startOf("day"),i=q.calendarFormat(this,r)||"sameElse",o=e&&(xs(e[i])?e[i].call(this,n):e[i]);return this.format(o||this.localeData().calendar(i,this,bt(n)))}function bB(){return new Of(this)}function SB(t,e){var n=Lo(t)?t:bt(t);return this.isValid()&&n.isValid()?(e=ho(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function RB(t,e){var n=Lo(t)?t:bt(t);return this.isValid()&&n.isValid()?(e=ho(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function EB(t,e,n,r){var i=Lo(t)?t:bt(t),o=Lo(e)?e:bt(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 TB(t,e){var n=Lo(t)?t:bt(t),r;return this.isValid()&&n.isValid()?(e=ho(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 _B(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function MB(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function IB(t,e,n){var r,i,o;if(!this.isValid())return NaN;if(r=PE(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=ho(e),e){case"year":o=Lm(this,r)/12;break;case"month":o=Lm(this,r);break;case"quarter":o=Lm(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:ro(o)}function Lm(t,e){if(t.date()<e.date())return-Lm(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 PB(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function OB(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?Dm(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):xs(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Dm(n,"Z")):Dm(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function xB(){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 AB(t){t||(t=this.isUtc()?q.defaultFormatUtc:q.defaultFormat);var e=Dm(this,t);return this.localeData().postformat(e)}function HB(t,e){return this.isValid()&&(Lo(t)&&t.isValid()||bt(t).isValid())?Bo({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function NB(t){return this.from(bt(),t)}function DB(t,e){return this.isValid()&&(Lo(t)&&t.isValid()||bt(t).isValid())?Bo({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function kB(t){return this.to(bt(),t)}function Y1(t){var e;return t===void 0?this._locale._abbr:(e=Ca(t),e!=null&&(this._locale=e),this)}var G1=co("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 K1(){return this._locale}var ip=1e3,Vc=60*ip,op=60*Vc,q1=(365*400+97)*24*op;function Wc(t,e){return(t%e+e)%e}function X1(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-q1:new Date(t,e,n).valueOf()}function Z1(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-q1:Date.UTC(t,e,n)}function LB(t){var e,n;if(t=ho(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Z1:X1,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-=Wc(e+(this._isUTC?0:this.utcOffset()*Vc),op);break;case"minute":e=this._d.valueOf(),e-=Wc(e,Vc);break;case"second":e=this._d.valueOf(),e-=Wc(e,ip);break}return this._d.setTime(e),q.updateOffset(this,!0),this}function $B(t){var e,n;if(t=ho(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Z1:X1,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+=op-Wc(e+(this._isUTC?0:this.utcOffset()*Vc),op)-1;break;case"minute":e=this._d.valueOf(),e+=Vc-Wc(e,Vc)-1;break;case"second":e=this._d.valueOf(),e+=ip-Wc(e,ip)-1;break}return this._d.setTime(e),q.updateOffset(this,!0),this}function FB(){return this._d.valueOf()-(this._offset||0)*6e4}function VB(){return Math.floor(this.valueOf()/1e3)}function WB(){return new Date(this.valueOf())}function BB(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function jB(){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 UB(){return this.isValid()?this.toISOString():null}function zB(){return dE(this)}function YB(){return Ja({},Pe(this))}function GB(){return Pe(this).overflow}function KB(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ye("N",0,0,"eraAbbr");ye("NN",0,0,"eraAbbr");ye("NNN",0,0,"eraAbbr");ye("NNNN",0,0,"eraName");ye("NNNNN",0,0,"eraNarrow");ye("y",["y",1],"yo","eraYear");ye("y",["yy",2],0,"eraYear");ye("y",["yyy",3],0,"eraYear");ye("y",["yyyy",4],0,"eraYear");ae("N",OE);ae("NN",OE);ae("NNN",OE);ae("NNNN",oj);ae("NNNNN",sj);ct(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?Pe(n).era=i:Pe(n).invalidEra=t});ae("y",uh);ae("yy",uh);ae("yyy",uh);ae("yyyy",uh);ae("yo",aj);ct(["y","yy","yyy","yyyy"],Hn);ct(["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 qB(t,e){var n,r,i,o=this._eras||Ca("en")._eras;for(n=0,r=o.length;n<r;++n){switch(typeof o[n].since){case"string":i=q(o[n].since).startOf("day"),o[n].since=i.valueOf();break}switch(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 XB(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 ZB(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 JB(){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 QB(){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 ej(){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 tj(){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 nj(t){return Ze(this,"_erasNameRegex")||xE.call(this),t?this._erasNameRegex:this._erasRegex}function rj(t){return Ze(this,"_erasAbbrRegex")||xE.call(this),t?this._erasAbbrRegex:this._erasRegex}function ij(t){return Ze(this,"_erasNarrowRegex")||xE.call(this),t?this._erasNarrowRegex:this._erasRegex}function OE(t,e){return e.erasAbbrRegex(t)}function oj(t,e){return e.erasNameRegex(t)}function sj(t,e){return e.erasNarrowRegex(t)}function aj(t,e){return e._eraYearOrdinalRegex||uh}function xE(){var t=[],e=[],n=[],r=[],i,o,s,a,l,u=this.eras();for(i=0,o=u.length;i<o;++i)s=da(u[i].name),a=da(u[i].abbr),l=da(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")}ye(0,["gg",2],0,function(){return this.weekYear()%100});ye(0,["GG",2],0,function(){return this.isoWeekYear()%100});function dw(t,e){ye(0,[t,t.length],0,e)}dw("gggg","weekYear");dw("ggggg","weekYear");dw("GGGG","isoWeekYear");dw("GGGGG","isoWeekYear");ae("G",aw);ae("g",aw);ae("GG",St,ji);ae("gg",St,ji);ae("GGGG",vE,wE);ae("gggg",vE,wE);ae("GGGGG",sw,iw);ae("ggggg",sw,iw);Af(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=Ue(t)});Af(["gg","GG"],function(t,e,n,r){e[r]=q.parseTwoDigitYear(t)});function lj(t){return J1.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function uj(t){return J1.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function cj(){return fa(this.year(),1,4)}function hj(){return fa(this.isoWeekYear(),1,4)}function dj(){var t=this.localeData()._week;return fa(this.year(),t.dow,t.doy)}function fj(){var t=this.localeData()._week;return fa(this.weekYear(),t.dow,t.doy)}function J1(t,e,n,r,i){var o;return t==null?nf(this,r,i).year:(o=fa(t,r,i),e>o&&(e=o),gj.call(this,t,e,n,r,i))}function gj(t,e,n,r,i){var o=x1(t,e,n,r,i),s=tf(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}ye("Q",0,"Qo","quarter");ae("Q",y1);ct("Q",function(t,e){e[oa]=(Ue(t)-1)*3});function mj(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}ye("D",["DD",2],"Do","date");ae("D",St,ch);ae("DD",St,ji);ae("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});ct(["D","DD"],ys);ct("Do",function(t,e){e[ys]=Ue(t.match(St)[0])});var Q1=hh("Date",!0);ye("DDD",["DDDD",3],"DDDo","dayOfYear");ae("DDD",ow);ae("DDDD",b1);ct(["DDD","DDDD"],function(t,e,n){n._dayOfYear=Ue(t)});function pj(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}ye("m",["mm",2],0,"minute");ae("m",St,CE);ae("mm",St,ji);ct(["m","mm"],Ho);var wj=hh("Minutes",!1);ye("s",["ss",2],0,"second");ae("s",St,CE);ae("ss",St,ji);ct(["s","ss"],sa);var vj=hh("Seconds",!1);ye("S",0,0,function(){return~~(this.millisecond()/100)});ye(0,["SS",2],0,function(){return~~(this.millisecond()/10)});ye(0,["SSS",3],0,"millisecond");ye(0,["SSSS",4],0,function(){return this.millisecond()*10});ye(0,["SSSSS",5],0,function(){return this.millisecond()*100});ye(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});ye(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});ye(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});ye(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});ae("S",ow,y1);ae("SS",ow,ji);ae("SSS",ow,b1);var Qa,eN;for(Qa="SSSS";Qa.length<=9;Qa+="S")ae(Qa,uh);function Cj(t,e){e[uu]=Ue(("0."+t)*1e3)}for(Qa="S";Qa.length<=9;Qa+="S")ct(Qa,Cj);eN=hh("Milliseconds",!1);ye("z",0,0,"zoneAbbr");ye("zz",0,0,"zoneName");function yj(){return this._isUTC?"UTC":""}function bj(){return this._isUTC?"Coordinated Universal Time":""}var J=Of.prototype;J.add=fB;J.calendar=yB;J.clone=bB;J.diff=IB;J.endOf=$B;J.format=AB;J.from=HB;J.fromNow=NB;J.to=DB;J.toNow=kB;J.get=xV;J.invalidAt=GB;J.isAfter=SB;J.isBefore=RB;J.isBetween=EB;J.isSame=TB;J.isSameOrAfter=_B;J.isSameOrBefore=MB;J.isValid=zB;J.lang=G1;J.locale=Y1;J.localeData=K1;J.max=zW;J.min=UW;J.parsingFlags=YB;J.set=AV;J.startOf=LB;J.subtract=gB;J.toArray=BB;J.toObject=jB;J.toDate=WB;J.toISOString=OB;J.inspect=xB;typeof Symbol<"u"&&Symbol.for!=null&&(J[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});J.toJSON=UB;J.toString=PB;J.unix=VB;J.valueOf=FB;J.creationData=KB;J.eraName=JB;J.eraNarrow=QB;J.eraAbbr=ej;J.eraYear=tj;J.year=E1;J.isLeapYear=OV;J.weekYear=lj;J.isoWeekYear=uj;J.quarter=J.quarters=mj;J.month=P1;J.daysInMonth=WV;J.week=J.weeks=qV;J.isoWeek=J.isoWeeks=XV;J.weeksInYear=dj;J.weeksInWeekYear=fj;J.isoWeeksInYear=cj;J.isoWeeksInISOWeekYear=hj;J.date=Q1;J.day=J.days=uW;J.weekday=cW;J.isoWeekday=hW;J.dayOfYear=pj;J.hour=J.hours=vW;J.minute=J.minutes=wj;J.second=J.seconds=vj;J.millisecond=J.milliseconds=eN;J.utcOffset=eB;J.utc=nB;J.local=rB;J.parseZone=iB;J.hasAlignedHourOffset=oB;J.isDST=sB;J.isLocal=lB;J.isUtcOffset=uB;J.isUtc=B1;J.isUTC=B1;J.zoneAbbr=yj;J.zoneName=bj;J.dates=co("dates accessor is deprecated. Use date instead.",Q1);J.months=co("months accessor is deprecated. Use month instead",P1);J.years=co("years accessor is deprecated. Use year instead",E1);J.zone=co("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",tB);J.isDSTShifted=co("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",aB);function Sj(t){return bt(t*1e3)}function Rj(){return bt.apply(null,arguments).parseZone()}function tN(t){return t}var Je=gE.prototype;Je.calendar=lV;Je.longDateFormat=dV;Je.invalidDate=gV;Je.ordinal=wV;Je.preparse=tN;Je.postformat=tN;Je.relativeTime=CV;Je.pastFuture=yV;Je.set=sV;Je.eras=qB;Je.erasParse=XB;Je.erasConvertYear=ZB;Je.erasAbbrRegex=rj;Je.erasNameRegex=nj;Je.erasNarrowRegex=ij;Je.months=LV;Je.monthsShort=$V;Je.monthsParse=VV;Je.monthsRegex=jV;Je.monthsShortRegex=BV;Je.week=zV;Je.firstDayOfYear=KV;Je.firstDayOfWeek=GV;Je.weekdays=iW;Je.weekdaysMin=sW;Je.weekdaysShort=oW;Je.weekdaysParse=lW;Je.weekdaysRegex=dW;Je.weekdaysShortRegex=fW;Je.weekdaysMinRegex=gW;Je.isPM=pW;Je.meridiem=CW;function sp(t,e,n,r){var i=Ca(),o=Os().set(r,e);return i[n](o,t)}function nN(t,e,n){if(ga(t)&&(e=t,t=void 0),t=t||"",e!=null)return sp(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=sp(t,r,n,"month");return i}function AE(t,e,n,r){typeof t=="boolean"?(ga(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,ga(e)&&(n=e,e=void 0),e=e||"");var i=Ca(),o=t?i._week.dow:0,s,a=[];if(n!=null)return sp(e,(n+o)%7,r,"day");for(s=0;s<7;s++)a[s]=sp(e,(s+o)%7,r,"day");return a}function Ej(t,e){return nN(t,e,"months")}function Tj(t,e){return nN(t,e,"monthsShort")}function _j(t,e,n){return AE(t,e,n,"weekdays")}function Mj(t,e,n){return AE(t,e,n,"weekdaysShort")}function Ij(t,e,n){return AE(t,e,n,"weekdaysMin")}il("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=co("moment.lang is deprecated. Use moment.locale instead.",il);q.langData=co("moment.langData is deprecated. Use moment.localeData instead.",Ca);var Ns=Math.abs;function Pj(){var t=this._data;return this._milliseconds=Ns(this._milliseconds),this._days=Ns(this._days),this._months=Ns(this._months),t.milliseconds=Ns(t.milliseconds),t.seconds=Ns(t.seconds),t.minutes=Ns(t.minutes),t.hours=Ns(t.hours),t.months=Ns(t.months),t.years=Ns(t.years),this}function rN(t,e,n,r){var i=Bo(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function Oj(t,e){return rN(this,t,e,1)}function xj(t,e){return rN(this,t,e,-1)}function rP(t){return t<0?Math.floor(t):Math.ceil(t)}function Aj(){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+=rP(nR(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=ro(t/1e3),r.seconds=i%60,o=ro(i/60),r.minutes=o%60,s=ro(o/60),r.hours=s%24,e+=ro(s/24),l=ro(iN(e)),n+=l,e-=rP(nR(l)),a=ro(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function iN(t){return t*4800/146097}function nR(t){return t*146097/4800}function Hj(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=ho(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+iN(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(nR(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 ya(t){return function(){return this.as(t)}}var oN=ya("ms"),Nj=ya("s"),Dj=ya("m"),kj=ya("h"),Lj=ya("d"),$j=ya("w"),Fj=ya("M"),Vj=ya("Q"),Wj=ya("y"),Bj=oN;function jj(){return Bo(this)}function Uj(t){return t=ho(t),this.isValid()?this[t+"s"]():NaN}function Hu(t){return function(){return this.isValid()?this._data[t]:NaN}}var zj=Hu("milliseconds"),Yj=Hu("seconds"),Gj=Hu("minutes"),Kj=Hu("hours"),qj=Hu("days"),Xj=Hu("months"),Zj=Hu("years");function Jj(){return ro(this.days()/7)}var Qs=Math.round,Ac={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Qj(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function eU(t,e,n,r){var i=Bo(t).abs(),o=Qs(i.as("s")),s=Qs(i.as("m")),a=Qs(i.as("h")),l=Qs(i.as("d")),u=Qs(i.as("M")),c=Qs(i.as("w")),h=Qs(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,Qj.apply(null,d)}function tU(t){return t===void 0?Qs:typeof t=="function"?(Qs=t,!0):!1}function nU(t,e){return Ac[t]===void 0?!1:e===void 0?Ac[t]:(Ac[t]=e,t==="s"&&(Ac.ss=e-1),!0)}function rU(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Ac,i,o;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},Ac,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),o=eU(this,!n,r,i),n&&(o=i.pastFuture(+this,o)),i.postformat(o)}var Ty=Math.abs;function $u(t){return(t>0)-(t<0)||+t}function fw(){if(!this.isValid())return this.localeData().invalidDate();var t=Ty(this._milliseconds)/1e3,e=Ty(this._days),n=Ty(this._months),r,i,o,s,a=this.asSeconds(),l,u,c,h;return a?(r=ro(t/60),i=ro(r/60),t%=60,r%=60,o=ro(n/12),n%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=$u(this._months)!==$u(a)?"-":"",c=$u(this._days)!==$u(a)?"-":"",h=$u(this._milliseconds)!==$u(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 Ke=hw.prototype;Ke.isValid=XW;Ke.abs=Pj;Ke.add=Oj;Ke.subtract=xj;Ke.as=Hj;Ke.asMilliseconds=oN;Ke.asSeconds=Nj;Ke.asMinutes=Dj;Ke.asHours=kj;Ke.asDays=Lj;Ke.asWeeks=$j;Ke.asMonths=Fj;Ke.asQuarters=Vj;Ke.asYears=Wj;Ke.valueOf=Bj;Ke._bubble=Aj;Ke.clone=jj;Ke.get=Uj;Ke.milliseconds=zj;Ke.seconds=Yj;Ke.minutes=Gj;Ke.hours=Kj;Ke.days=qj;Ke.weeks=Jj;Ke.months=Xj;Ke.years=Zj;Ke.humanize=rU;Ke.toISOString=fw;Ke.toString=fw;Ke.toJSON=fw;Ke.locale=Y1;Ke.localeData=K1;Ke.toIsoString=co("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",fw);Ke.lang=G1;ye("X",0,0,"unix");ye("x",0,0,"valueOf");ae("x",aw);ae("X",EV);ct("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)});ct("x",function(t,e,n){n._d=new Date(Ue(t))});//! moment.js
|
|
11
|
-
q.version="2.30.1";iV(bt);q.fn=J;q.min=YW;q.max=GW;q.now=KW;q.utc=Os;q.unix=Sj;q.months=Ej;q.isDate=Pf;q.locale=il;q.invalid=rw;q.duration=Bo;q.isMoment=Lo;q.weekdays=_j;q.parseZone=Rj;q.localeData=Ca;q.isDuration=km;q.monthsShort=Tj;q.weekdaysMin=Ij;q.defineLocale=EE;q.updateLocale=RW;q.locales=EW;q.weekdaysShort=Mj;q.normalizeUnits=ho;q.relativeTimeRounding=tU;q.relativeTimeThreshold=nU;q.calendarFormat=CB;q.prototype=J;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"};function iU(t){const e=t.length;let n=0;for(;n<e;)t[n]=[t[n]],n+=1}function iP(t,e){const n=e.length;let r=0;for(;r<n;)t.push(e[r]),r+=1}function $m(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 mr(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 vu(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length,o=[];let s=-1;for(;n<i;){const a=r[n];e(a,n,r)&&(s+=1,o[s]=a),n+=1}return o}function je(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length,o=[];let s=-1;for(;n<i;){const a=r[n];s+=1,o[s]=e(a,n,r),n+=1}return o}function M(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 oU(t){const e=[];return M(t,n=>{e.indexOf(n)===-1&&e.push(n)}),e}function oP(){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 M(i,s=>{o=o.filter(a=>!s.includes(a))}),o}function sP(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function tt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return mr(t,(o,s,a)=>{const l=s.replace(/\r?\n\s*/g,""),u=n[a]?n[a]:"";return o+l+u},"").trim()}function Kt(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 se(t){return typeof t<"u"}function _t(t){return typeof t>"u"}function jt(t){return t===null||t===""||_t(t)}function sU(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const _d="length",Nd=t=>parseInt(t,16),aP=t=>parseInt(t,10),ap=(t,e,n)=>t.substr(e,n),Dd=t=>t.codePointAt(0)-65,rR=t=>`${t}`.replace(/\-/g,""),aU=t=>Nd(ap(rR(t),Nd("12"),Dd("F")))/(Nd(ap(rR(t),Dd("B"),~~![][_d]))||9),lU=()=>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 lP=!1;const uP={invalid:()=>tt`
|
|
12
|
-
The license key for Handsontable is invalid.\x20
|
|
13
|
-
If you need any help, contact us at support@handsontable.com.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return tt`
|
|
14
|
-
The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
|
|
15
|
-
version ${n}. Renew your license key at handsontable.com or downgrade to a version released prior\x20
|
|
16
|
-
to ${e}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>tt`
|
|
17
|
-
The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
|
|
18
|
-
Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
|
|
19
|
-
passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20
|
|
20
|
-
us at support@handsontable.com.`,non_commercial:()=>""},cP={invalid:()=>tt`
|
|
21
|
-
The license key for Handsontable is invalid.\x20
|
|
22
|
-
<a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
|
|
23
|
-
install it properly or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return tt`
|
|
24
|
-
The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
|
|
25
|
-
version ${n}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
|
|
26
|
-
license key or downgrade to a version released prior to ${e}. If you need any\x20
|
|
27
|
-
help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`},missing:()=>tt`
|
|
28
|
-
The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
|
|
29
|
-
Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
|
|
30
|
-
passing the key: 'non-commercial-and-evaluation'.\x20
|
|
31
|
-
<a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
|
|
32
|
-
the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function uU(t,e){const n=!jt(t),r=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",i="15.2.0";let o,s="invalid",a="invalid";t=rR(t||"");const l=cU(t);if(n||r||l)if(l){const u=q("19/03/2025","DD/MM/YYYY"),c=Math.floor(u.toDate().getTime()/864e5),h=aU(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(lU()&&(s="valid",a="valid"),!lP&&s!=="valid"&&(uP[s]({keyValidityDate:o,hotVersion:i})&&console[s==="non_commercial"?"info":"warn"](uP[s]({keyValidityDate:o,hotVersion:i})),lP=!0),a!=="valid"&&e.parentNode&&cP[a]({keyValidityDate:o,hotVersion:i})){const c=document.createElement("div");c.className="handsontable hot-display-license-info",c.innerHTML=cP[a]({keyValidityDate:o,hotVersion:i}),e.parentNode.insertBefore(c,e.nextSibling)}}function cU(t){let e=[][_d],n=e;if(t[_d]!==Dd("Z"))return!1;for(let r="",i="B<H4P+".split(""),o=Dd(i.shift());o;o=Dd(i.shift()||"A"))--o<""[_d]?n=n|(aP(`${aP(Nd(r)+(Nd(ap(t,Math.abs(o),2))+[]).padStart(2,"0"))}`)%97||2)>>1:r=ap(t,o,o?i[_d]===1?9:8:6);return n===e}function $o(t){return t[0].toUpperCase()+t.substr(1)}function sN(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function aN(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function lN(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 hP(t){return HE(`${t}`,{ALLOWED_TAGS:[]})}function HE(t,e){return rV.sanitize(t,e)}const Nu=t=>["tabindex",t],hU=()=>["role","treegrid"],Es=()=>["role","presentation"],dU=()=>["role","gridcell"],fU=()=>["role","rowheader"],uN=()=>["role","rowgroup"],gU=()=>["role","columnheader"],iR=()=>["role","row"],mU=()=>["role","menu"],pU=()=>["role","menuitem"],wU=()=>["role","menuitemcheckbox"],vU=()=>["role","combobox"],cN=()=>["role","listbox"],CU=()=>["role","option"],yU=()=>["role","checkbox"],bU=()=>["scope","col"],SU=()=>["scope","row"],RU=()=>["type","text"],lp=t=>["aria-label",t],fl=()=>["aria-hidden","true"],EU=()=>["aria-disabled","true"],TU=()=>["aria-multiselectable","true"],hN=t=>["aria-haspopup",t],dN=t=>["aria-rowcount",t],gw=t=>["aria-colcount",t],fN=t=>["aria-rowindex",t],NE=t=>["aria-colindex",t],so=t=>["aria-expanded",t],_U=t=>["aria-sort",t],dP=()=>["aria-readonly","true"],fP=()=>["aria-invalid","true"],gN=t=>["aria-checked",t],DE=()=>["aria-selected","true"],MU=()=>["aria-autocomplete","list"],IU=t=>["aria-controls",t],PU=t=>["aria-activedescendant",t],OU=t=>["aria-live",t],xU=t=>["aria-relevant",t],AU=t=>["aria-setsize",t],HU=t=>["aria-posinset",t];function NU(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 Fm(t,e){const n=t.closest(".handsontable");return!!n&&(n.parentNode===e||n===e)}function DU(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function Kc(t){return DU(t)&&t.parent}function Cu(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 ng(t,e,n){const r=[];let i=t;for(;i&&(i=Cu(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 kU(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 wu(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 LU(t){let e=0,n=t;if(n.previousSibling)for(;n=n.previousSibling;)e+=1;return e}function Cl(t,e,n){const r=n.parentElement.querySelector(`.ht_clone_${t}`);return r?r.contains(e):null}function mN(t){return!t||!t.length?[]:t.filter(e=>!!e)}function pN(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 Ce(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function Y(t,e){typeof e=="string"&&(e=e.split(" ")),e=mN(e),e.length>0&&t.classList.add(...e)}function we(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:n,regexes:r}=pN(e,!0);n=mN(n),n.length>0&&t.classList.remove(...n),r.forEach(i=>{t.classList.forEach(o=>{i.test(o)&&t.classList.remove(o)})})}function be(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 dh(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}=pN(e,!0);n.forEach(i=>{i!==""&&t.removeAttribute(i)}),r.forEach(i=>{t.getAttributeNames().forEach(o=>{i.test(o)&&t.removeAttribute(o)})})}function wN(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--)wN(e[n])}}function ma(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const $U=/(<(.*)>|&(.*);)/;function fh(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;$U.test(e)?t.innerHTML=n?HE(e):e:yu(t,e)}function yu(t,e){const n=t.firstChild;n&&n.nodeType===3&&n.nextSibling===null?n.textContent=e:(ma(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function qc(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 qc(r.host.impl);if(r.host)return qc(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 An(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 vN(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function kE(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function LE(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?vN(e):t.scrollTop}function CN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?kE(e):t.scrollLeft}function up(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 FU(t){return t.scrollHeight-t.clientHeight}function VU(t){return t.scrollWidth-t.clientWidth}function of(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 cp(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 Gt(t){return t.offsetWidth}function nn(t){return t.offsetHeight}function kd(t){return t.clientHeight||t.innerHeight}function yN(t){return t.clientWidth||t.innerWidth}function bN(t){return t.selectionStart?t.selectionStart:0}function WU(t){return t.selectionEnd?t.selectionEnd:0}function gP(){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 mw(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 _y;function BU(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;const e=t.createElement("div");e.style.height="200px",e.style.width="100%";const n=t.createElement("div");n.style.boxSizing="content-box",n.style.height="150px",n.style.left="0px",n.style.overflow="hidden",n.style.position="absolute",n.style.top="0px",n.style.width="200px",n.style.visibility="hidden",n.appendChild(e),(t.body||t.documentElement).appendChild(n);const r=e.offsetWidth;n.style.overflow="scroll";let i=e.offsetWidth;return r===i&&(i=n.clientWidth),(t.body||t.documentElement).removeChild(n),r-i}function vn(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return _y===void 0&&(_y=BU(t)),_y}function SN(t){return t instanceof Window?t.document.body.scrollHeight>t.innerHeight:t.offsetWidth!==t.clientWidth}function RN(t){return t instanceof Window?t.document.body.scrollWidth>t.innerWidth:t.offsetHeight!==t.clientHeight}function $E(t,e,n){t.style.transform=`translate3d(${e},${n},0)`}function pw(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function Vm(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function EN(t){return Vm(t)&&t.hasAttribute("data-hot-input")===!1}function TN(t){return!t.parentNode}function jU(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 _N(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();be(t,"contenteditable",!0),n&&be(t,...fl()),e&&Y(t,"invisibleSelection"),i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i)}function MN(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&&we(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function UU(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;_N(t,n),e(),MN(t,n)}function ol(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 mt(t){return typeof t=="function"}function FE(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 IN(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 zU(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 oR(t,e,n,r,i,o,s,a){return se(a)?t.call(e,n,r,i,o,s,a):se(s)?t.call(e,n,r,i,o,s):se(o)?t.call(e,n,r,i,o):se(i)?t.call(e,n,r,i):se(r)?t.call(e,n,r):se(n)?t.call(e,n):t.call(e)}var mP={},My,pP;function YU(){if(pP)return My;pP=1;var t=qt(),e=ZH(),n=on(),r=Iu(),i=nw(),o=t([].push);return My=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 C=0;C<h;C++)if(l[C]===f)return m}}},My}var wP;function GU(){if(wP)return mP;wP=1;var t=dt(),e=rh(),n=tw(),r=Nn(),i=qt(),o=Sn(),s=on(),a=JR(),l=cE(),u=YU(),c=ZR(),h=String,d=e("JSON","stringify"),f=i(/./.exec),m=i("".charAt),C=i("".charCodeAt),w=i("".replace),S=i(1 .toString),R=/[\uD800-\uDFFF]/g,I=/^[\uD800-\uDBFF]$/,O=/^[\uDC00-\uDFFF]$/,D=!c||o(function(){var X=e("Symbol")("stringify detection");return d([X])!=="[null]"||d({a:X})!=="{}"||d(Object(X))!=="{}"}),_=o(function(){return d("\uDF06\uD834")!=='"\\udf06\\ud834"'||d("\uDEAD")!=='"\\udead"'}),x=function(X,U){var Z=l(arguments),Q=u(U);if(!(!s(Q)&&(X===void 0||a(X))))return Z[1]=function(le,te){if(s(Q)&&(te=r(Q,this,h(le),te)),!a(te))return te},n(d,null,Z)},j=function(X,U,Z){var Q=m(Z,U-1),le=m(Z,U+1);return f(I,X)&&!f(O,le)||f(O,X)&&!f(I,Q)?"\\u"+S(C(X,0),16):X};return d&&t({target:"JSON",stat:!0,arity:3,forced:D||_},{stringify:function(U,Z,Q){var le=l(arguments),te=n(D?x:d,null,le);return _&&typeof te=="string"?w(te,R,j):te}}),mP}GU();function sf(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},He(t,(n,r)=>{r!=="__children"&&(n&&typeof n=="object"&&!Array.isArray(n)?e[r]=sf(n):Array.isArray(n)?n.length&&typeof n[0]=="object"&&!Array.isArray(n[0])?e[r]=[sf(n[0])]:e[r]=[]:e[r]=null)})),e}function KU(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function rn(t,e,n){const r=Array.isArray(n);return He(e,(i,o)=>{(r===!1||n.includes(o))&&(t[o]=i)}),t}function ww(t,e){He(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]={}),ww(t[r],e[r])):t[r]=e[r]})}function Kn(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function Ms(t){const e={};return He(t,(n,r)=>{e[r]=n}),e}function lt(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 M(n,i=>{t.MIXINS.push(i.MIXIN_NAME),He(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 C=m;return(Array.isArray(C)||Ae(C))&&(C=Kn(C)),C};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 VE(t,e){return JSON.stringify(t)===JSON.stringify(e)}function Ae(t){return Object.prototype.toString.call(t)==="[object Object]"}function ba(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 He(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 qU(t,e){const n=e.split(".");let r=t;return He(n,i=>{if(r=r[i],r===void 0)return r=void 0,!1}),r}function Iy(t,e,n){const r=e.split(".");let i=t;r.forEach((o,s)=>{o==="__proto__"||o==="constructor"||o==="prototype"||(s!==r.length-1?(tn(i,o)||(i[o]={}),i=i[o]):i[o]=n)})}function WE(t){if(!Ae(t))return 0;const e=function(n){let r=0;return Ae(n)?He(n,(i,o)=>{o!=="__children"&&(r+=e(i))}):r+=1,r};return e(t)}function Bi(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 tn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function hp(t){return window.requestAnimationFrame(t)}function dp(t){window.cancelAnimationFrame(t)}function PN(){return"ontouchstart"in window}function XU(){return typeof window<"u"}let Fu;function ZU(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Fu||(typeof Intl=="object"?Fu=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?Fu=(n,r)=>`${n}`.localeCompare(r):Fu=(n,r)=>n===r?0:n>r?-1:1,Fu)}const Ji=t=>{const e={value:!1};return e.test=(n,r)=>{e.value=t(n,r)},e},gl={chrome:Ji((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:Ji(t=>/CriOS/.test(t)),edge:Ji(t=>/Edge/.test(t)),edgeWebKit:Ji(t=>/EdgiOS/.test(t)),firefox:Ji(t=>/Firefox/.test(t)),firefoxWebKit:Ji(t=>/FxiOS/.test(t)),mobile:Ji(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:Ji((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},Hf={mac:Ji(t=>/^Mac/.test(t)),win:Ji(t=>/^Win/.test(t)),linux:Ji(t=>/^Linux/.test(t)),ios:Ji(t=>/iPhone|iPad|iPod/i.test(t))};function JU(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};He(gl,n=>{let{test:r}=n;return void r(t,e)})}function QU(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};He(Hf,e=>{let{test:n}=e;return void n(t)})}XU()&&(JU(),QU());function ON(){return gl.chrome.value}function ez(){return gl.chromeWebKit.value}function Py(){return gl.firefox.value}function tz(){return gl.firefoxWebKit.value}function xN(){return gl.safari.value}function nz(){return gl.edge.value}function aa(){return gl.mobile.value}function AN(){return Hf.ios.value}function HN(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&Hf.mac.value}function vP(){return Hf.win.value}function CP(){return Hf.mac.value}const pe={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:Py()?182:174,AUDIO_MUTE:Py()?181:173,AUDIO_UP:Py()?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},rz=[pe.ALT,pe.ARROW_DOWN,pe.ARROW_LEFT,pe.ARROW_RIGHT,pe.ARROW_UP,pe.AUDIO_DOWN,pe.AUDIO_MUTE,pe.AUDIO_UP,pe.BACKSPACE,pe.CAPS_LOCK,pe.DELETE,pe.END,pe.ENTER,pe.ESCAPE,pe.F1,pe.F2,pe.F3,pe.F4,pe.F5,pe.F6,pe.F7,pe.F8,pe.F9,pe.F10,pe.F11,pe.F12,pe.F13,pe.F14,pe.F15,pe.F16,pe.F17,pe.F18,pe.F19,pe.HOME,pe.INSERT,pe.MEDIA_NEXT,pe.MEDIA_PLAY_PAUSE,pe.MEDIA_PREV,pe.MEDIA_STOP,pe.NULL,pe.NUM_LOCK,pe.PAGE_DOWN,pe.PAGE_UP,pe.PAUSE,pe.SCROLL_LOCK,pe.SHIFT,pe.TAB];function iz(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 NN(t){return rz.includes(t)}function oz(t){return[pe.CONTROL,pe.COMMAND_LEFT,pe.COMMAND_RIGHT,pe.COMMAND_FIREFOX].includes(t)}function Nf(t,e){const n=e.split("|");let r=!1;return M(n,i=>{if(t===pe[i])return r=!0,!1}),r}function jo(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function au(t){return t.isImmediatePropagationEnabled===!1}function bu(t){return t.button===2}function BE(t){return t.button===0}function sz(t){return t instanceof TouchEvent}function az(t,e){const n={x:t.offsetX,y:t.offsetY};let r=t.target;if(!ol(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 Xe(){se(console)&&console.warn(...arguments)}function jE(){se(console)&&console.error(...arguments)}const lu=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","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"],Oy=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"]]),xy=new Map([[]]);var yP={},Ay,bP;function lz(){if(bP)return Ay;bP=1;var t=sh();return Ay=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},Ay}var Hy,SP;function uz(){if(SP)return Hy;SP=1;var t=dn();return Hy=function(e,n){var r=t[e],i=r&&r.prototype;return i&&i[n]},Hy}var Ny,RP;function vw(){if(RP)return Ny;RP=1;var t=Wo(),e=aE(),n=dl().f,r=t("unscopables"),i=Array.prototype;return i[r]===void 0&&n(i,r,{configurable:!0,value:e(null)}),Ny=function(o){i[r][o]=!0},Ny}var EP;function cz(){if(EP)return yP;EP=1;var t=dt(),e=qt(),n=gr(),r=Rf(),i=lz(),o=uz(),s=vw(),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"),yP}cz();var TP={},_P={},MP;function hz(){if(MP)return _P;MP=1;var t=dt(),e=lh(),n=gr(),r=sn(),i=Ps();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}}),_P}var IP;function dz(){return IP||(IP=1,hz()),TP}dz();function fz(t,e){DN(t,e),e.add(t)}function Dy(t,e,n){DN(t,e),e.set(t,n)}function DN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function PP(t,e,n){return t.set(fp(t,e),n),n}function bn(t,e){return t.get(fp(t,e))}function fp(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 gz=100;var Hi=new WeakMap,Ec=new WeakMap,ky=new WeakMap,Ly=new WeakSet;class OP{constructor(){fz(this,Ly),Dy(this,Hi,new Map),Dy(this,Ec,new Map),Dy(this,ky,new Set),lu.forEach(e=>fp(Ly,this,xP).call(this,e))}getHooks(e){var n;return(n=bn(Hi,this).get(e))!==null&&n!==void 0?n:[]}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};bn(Hi,this).has(e)||(fp(Ly,this,xP).call(this,e),lu.push(e));const i=bn(Hi,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=bn(ky,this).has(e);!u&&o!==0&&(u=!0,bn(ky,this).add(e)),u&&i.length>1&&bn(Hi,this).set(e,i.toSorted((c,h)=>c.orderIndex-h.orderIndex))}}has(e){return bn(Hi,this).has(e)&&bn(Hi,this).get(e).length>0}remove(e,n){if(!bn(Hi,this).has(e))return!1;const r=bn(Hi,this).get(e),i=r.find(o=>o.callback===n);if(i){let o=bn(Ec,this).get(e);return i.skip=!0,o+=1,o>gz&&(bn(Hi,this).set(e,r.filter(s=>!s.skip)),o=0),bn(Ec,this).set(e,o),!0}return!1}destroy(){bn(Hi,this).clear(),bn(Ec,this).clear(),PP(Hi,this,null),PP(Ec,this,null)}}function xP(t){bn(Hi,this).set(t,[]),bn(Ec,this).set(t,0)}function mz(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=wz(t,"string");return typeof e=="symbol"?e:e+""}function wz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 vz=tt`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
|
|
33
|
-
Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
|
|
34
|
-
learn about the migration path.`;class ie{constructor(){mz(this,"globalBucket",new OP)}static getSingleton(){return yz()}getBucket(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=new OP),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)?M(n,o=>this.add(e,o,r)):(Oy.has(e)&&Xe(lN(vz,{hookName:e,removedInVersion:Oy.get(e)})),xy.has(e)&&Xe(xy.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)?M(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)?M(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=oR(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=oR(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)||lu.push(e)}deregister(e){this.isRegistered(e)&&lu.splice(lu.indexOf(e),1)}isDeprecated(e){return xy.has(e)||Oy.has(e)}isRegistered(e){return lu.indexOf(e)>=0}getRegistered(){return lu}}const Cz=new ie;function yz(){return Cz}const $y=new Map;function Uo(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";$y.has(t)||$y.set(t,new Map);const e=$y.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 sR=new WeakMap,{register:bz,getItem:kN,hasItem:LN,getNames:gle,getValues:mle}=Uo("editors");function Sz(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]},ie.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function $N(t,e){let n;if(typeof t=="function")sR.get(t)||Di(null,t),n=sR.get(t);else if(typeof t=="string")n=kN(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 aR(t){if(typeof t=="function")return t;if(!LN(t))throw Error(`No registered editor found under "${t}" name`);return kN(t).getConstructor()}function Di(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const n=new Sz(e);typeof t=="string"&&bz(t,n),sR.set(e,n)}function Rz(t,e,n){return(e=Ez(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ez(t){var e=Tz(t,"string");return typeof e=="symbol"?e:e+""}function Tz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Fo{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;Rz(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,_z(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 _z(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),jo(this)},t}function Mz(t,e){Iz(t,e),e.add(t)}function Iz(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yl(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)}function AP(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 Fy=new WeakSet;class lR{constructor(e,n,r){Mz(this,Fy),yl(this,"hot",void 0),yl(this,"tableMeta",void 0),yl(this,"selection",void 0),yl(this,"eventManager",void 0),yl(this,"destroyed",!1),yl(this,"activeEditor",void 0),yl(this,"cellProperties",void 0),this.hot=e,this.tableMeta=n,this.selection=r,this.eventManager=new Fo(e),this.hot.addHook("afterDocumentKeyDown",i=>AP(Fy,this,xz).call(this,i)),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"compositionstart",i=>{!this.destroyed&&this.hot.isListening()&&this.openEditor("",i)}),this.hot.view._wt.update("onCellDblClick",(i,o,s)=>AP(Fy,this,Az).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=$N(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 xz(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||au(t))return;const{keyCode:n}=t,r=(t.ctrlKey||t.metaKey)&&!t.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!NN(n)&&!oz(n)&&!r&&!this.isEditorOpened()&&this.openEditor("",t)}function Az(t,e){e.isCell()&&this.openEditor(null,t,!0)}const HP=new WeakMap;lR.getInstance=function(t,e,n){let r=HP.get(t);return r||(r=new lR(t,e,n),HP.set(t,r)),r};function Hz(t,e){FN(t,e),e.add(t)}function Oh(t,e,n){FN(t,e),e.set(t,n)}function FN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ct(t,e){return t.get(ra(t,e))}function xh(t,e,n){return t.set(ra(t,e),n),n}function ra(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 Bc=Object.freeze({CELL:"cell",MIXED:"mixed"});var cn=new WeakMap,rg=new WeakMap,ig=new WeakMap,og=new WeakMap,sg=new WeakMap,Ua=new WeakSet;class Nz{constructor(e){var n=this;Hz(this,Ua),Oh(this,cn,void 0),Oh(this,rg,void 0),Oh(this,ig,1),Oh(this,og,null),Oh(this,sg,new Map);const r=e.getSettings();xh(cn,this,e),xh(rg,this,r.imeFastEdit?Bc.MIXED:Bc.CELL),Ct(cn,this).addHook("afterUpdateSettings",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ra(Ua,n,kz).call(n,...o)}),Ct(cn,this).addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ra(Ua,n,NP).call(n,...o)}),Ct(cn,this).addHook("afterSelectionFocusSet",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ra(Ua,n,NP).call(n,...o)}),Ct(cn,this).addHook("afterSelectionEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ra(Ua,n,Dz).call(n,...o)})}getFocusMode(){return Ct(rg,this)}setFocusMode(e){Object.values(Bc).includes(e)?xh(rg,this,e):Xe(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return Ct(ig,this)}setRefocusDelay(e){xh(ig,this,e)}setRefocusElementGetter(e){xh(og,this,e)}getRefocusElement(){var e;return typeof Ct(og,this)=="function"?Ct(og,this).call(this):(e=Ct(cn,this).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const n=r=>{var i,o;const s=(i=Ct(cn,this).getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;if(!s)return;let a=Ct(cn,this).runHooks("modifyFocusedElement",s.row,s.col,r);ol(a)||(a=r),a&&!((o=Ct(cn,this).getActiveEditor())!==null&&o!==void 0&&o.isOpened())&&a.focus({preventScroll:!0})};e?n(e):ra(Ua,this,UE).call(this,r=>n(r))}refocusToEditorTextarea(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ct(ig,this);if(Ct(cn,this).getSettings().imeFastEdit&&!((e=Ct(cn,this).getActiveEditor())!==null&&e!==void 0&&e.isOpened())){var r,i;(r=Ct(cn,this).getActiveEditor())===null||r===void 0||(i=r.refreshValue)===null||i===void 0||i.call(r),Ct(sg,this).has(n)||Ct(sg,this).set(n,FE(()=>{var o;(o=this.getRefocusElement())===null||o===void 0||o.select()},n)),Ct(sg,this).get(n)()}}}function UE(t){var e;const n=(e=Ct(cn,this).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||!Ct(cn,this).selection.isCellVisible(n)){t(null);return}const r=Ct(cn,this).getCell(n.row,n.col,!0);r===null?Ct(cn,this).addHookOnce("afterScroll",()=>{t(Ct(cn,this).getCell(n.row,n.col,!0))}):t(r)}function NP(){ra(Ua,this,UE).call(this,t=>{const{activeElement:e}=Ct(cn,this).rootDocument;e&&EN(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function Dz(){ra(Ua,this,UE).call(this,t=>{this.getFocusMode()===Bc.MIXED&&(t==null?void 0:t.nodeName)==="TD"&&this.refocusToEditorTextarea()})}function kz(t){typeof t.imeFastEdit=="boolean"&&this.setFocusMode(t.imeFastEdit?Bc.MIXED:Bc.CELL)}var DP={},Vy,kP;function Lz(){if(kP)return Vy;kP=1;var t=Vo(),e=Iu(),n=Wo(),r=n("match");return Vy=function(i){var o;return t(i)&&((o=i[r])!==void 0?!!o:e(i)==="RegExp")},Vy}var Wy,LP;function $z(){if(LP)return Wy;LP=1;var t=sn();return Wy=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},Wy}var By,$P;function Fz(){if($P)return By;$P=1;var t=Nn(),e=uo(),n=Ef(),r=$z(),i=RegExp.prototype;return By=function(o){var s=o.flags;return s===void 0&&!("flags"in i)&&!e(o,"flags")&&n(i,o)?t(r,o):s},By}var jy,FP;function Vz(){if(FP)return jy;FP=1;var t=qt(),e=ih(),n=Math.floor,r=t("".charAt),i=t("".replace),o=t("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;return jy=function(l,u,c,h,d,f){var m=c+l.length,C=h.length,w=a;return d!==void 0&&(d=e(d),w=s),i(f,w,function(S,R){var I;switch(r(R,0)){case"$":return"$";case"&":return l;case"`":return o(u,0,c);case"'":return o(u,m);case"<":I=d[o(R,1,-1)];break;default:var O=+R;if(O===0)return S;if(O>C){var D=n(O/10);return D===0?S:D<=C?h[D-1]===void 0?r(R,1):h[D-1]+r(R,1):S}I=h[O-1]}return I===void 0?"":I})},jy}var VP;function Wz(){if(VP)return DP;VP=1;var t=dt(),e=Nn(),n=qt(),r=Sf(),i=on(),o=Jp(),s=Lz(),a=nw(),l=Tf(),u=Fz(),c=Vz(),h=Wo(),d=hl(),f=h("replace"),m=TypeError,C=n("".indexOf),w=n("".replace),S=n("".slice),R=Math.max;return t({target:"String",proto:!0},{replaceAll:function(O,D){var _=r(this),x,j,X,U,Z,Q,le,te,ue,ft,Re=0,Le="";if(!o(O)){if(x=s(O),x&&(j=a(r(u(O))),!~C(j,"g")))throw new m("`.replaceAll` does not allow non-global regexes");if(X=l(O,f),X)return e(X,O,_,D);if(d&&x)return w(a(_),O,D)}for(U=a(_),Z=a(O),Q=i(D),Q||(D=a(D)),le=Z.length,te=R(1,le),ue=C(U,Z);ue!==-1;)ft=Q?a(D(Z,ue,U)):c(Z,U,ue,[],void 0,D),Le+=S(U,Re,ue)+ft,Re=ue+le,ue=ue+te>U.length?-1:C(U,Z,ue+te);return Re<U.length&&(Le+=S(U,Re)),Le}}),DP}Wz();var WP={},BP={},jP;function Bz(){if(jP)return BP;jP=1;var t=dt(),e=lh(),n=gr(),r=sn(),i=Ps(),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}}),BP}var UP;function jz(){return UP||(UP=1,Bz()),WP}jz();const VN={" ":" ","&":"&","<":"<",">":">"},Uz=new RegExp(Object.keys(VN).map(t=>`(${t})`).join("|"),"gi");function zz(t){return(t&&t.nodeName||"")==="TABLE"}function zP(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 w=0;w<s;w+=1){const S=!f&&n&&w===0;let R="";if(f)R=`<th>${t.getColHeader(w-c)}</th>`;else if(S)R=`<th>${t.getRowHeader(d-h)}</th>`;else{const I=i[d][w],{hidden:O,rowspan:D,colspan:_}=t.getCellMeta(d-h,w-c);if(!O){const x=[];if(D&&x.push(`rowspan="${D}"`),_&&x.push(`colspan="${_}"`),jt(I))R=`<td ${x.join(" ")}></td>`;else{const j=I.toString().replace(/</g,"<").replace(/>/g,">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
|
|
35
|
-
`).replace(/\x20/gi," ").replace(/\t/gi,"	");R=`<td ${x.join(" ")}>${j}</td>`}}}m.push(R)}const C=["<tr>",...m,"</tr>"].join("");f?l.splice(1,0,C):u.splice(-1,0,C)}return a.splice(1,0,l.join(""),u.join("")),a.join("")}function YP(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
|
|
36
|
-
`).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 Yz(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;const n={},r=e.createDocumentFragment(),i=e.createElement("div");r.appendChild(i);let o=t;if(typeof o=="string"){const I=o.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,O=>{const D=O.match(/<td\b[^>]*?>/g)[0],_=/<p.*?>/g,x=O.substring(D.length,O.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(_,`
|
|
37
|
-
`).replace(`
|
|
38
|
-
`,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^ $/mg,"");return`${D}${x}</td>`});i.insertAdjacentHTML("afterbegin",`${I}`),o=i.querySelector("table")}if(!o||!zz(o))return;const s=i.querySelector('meta[name$="enerator"]'),a=o.querySelector("tbody th")!==null,l=o.querySelector("tr"),u=l?Array.from(l.cells).reduce((I,O)=>I+O.colSpan,0)-(a?1:0):0,c=o.tFoot&&Array.from(o.tFoot.rows)||[],h=[];let d=!1,f=0,m=0;if(o.tHead){const I=Array.from(o.tHead.rows).filter(O=>{const D=O.querySelector("td")!==null;return D&&h.push(O),!D});f=I.length,d=f>0,f>1?n.nestedHeaders=Array.from(I).reduce((O,D)=>{const _=Array.from(D.cells).reduce((x,j,X)=>{if(a&&X===0)return x;const{colSpan:U,innerHTML:Z}=j,Q=U>1?{label:Z,colspan:U}:Z;return x.push(Q),x},[]);return O.push(_),O},[]):d&&(n.colHeaders=Array.from(I[0].children).reduce((O,D,_)=>(a&&_===0||O.push(D.innerHTML),O),[]))}h.length&&(n.fixedRowsTop=h.length),c.length&&(n.fixedRowsBottom=c.length);const C=[...h,...Array.from(o.tBodies).reduce((I,O)=>(I.push(...Array.from(O.rows)),I),[]),...c];m=C.length;const w=new Array(m);for(let I=0;I<m;I++)w[I]=new Array(u);const S=[],R=[];for(let I=0;I<m;I++){const O=C[I],D=Array.from(O.cells),_=D.length;for(let x=0;x<_;x++){const j=D[x],{nodeName:X,innerHTML:U,rowSpan:Z,colSpan:Q}=j,le=w[I].findIndex(te=>te===void 0);if(X==="TD"){if(Z>1||Q>1){for(let Re=I;Re<I+Z;Re++)if(Re<m)for(let Le=le;Le<le+Q;Le++)w[Re][Le]=null;const ue=j.getAttribute("style");ue&&ue.includes("mso-ignore:colspan")||S.push({col:le,row:I,rowspan:Z,colspan:Q})}let te="";s&&/excel/gi.test(s.content)?te=U.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
|
|
39
|
-
`):te=U.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
|
|
40
|
-
`),w[I][le]=te.replace(Uz,ue=>VN[ue])}else R.push(U)}}return S.length&&(n.mergeCells=S),R.length&&(n.rowHeaders=R),w.length&&(n.data=w),n}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 Gz(t){return zn(t,[","])}function fe(t,e,n){let r=-1;for(typeof e=="function"?(n=e,e=t):r=t-1;++r<=e&&n(r)!==!1;);}function GP(t,e,n){let r=t+1;for(typeof e=="function"&&(n=e,e=0);--r>=e&&n(r)!==!1;);}function WN(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function ze(t,e,n){return Math.min(t,e)===t?e:Math.max(t,n)===t?n:t}const uR="asc",Kz="desc",KP=new Map([[uR,[-1,1]],[Kz,[1,-1]]]),qz=t=>`The priority '${t}' is already declared in a map.`,Xz=t=>`The priority '${t}' is not a number.`;function Zz(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=new Map;t=mt(t)?t:qz,e=mt(e)?e:Xz;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]:uR;const[s,a]=KP.get(o)||KP.get(uR);return[...n].sort((l,u)=>l[0]<u[0]?s:a).map(l=>l[1])}return{addItem:r,getItems:i}}const Jz=t=>`The id '${t}' is already declared in a map.`;function Cw(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=mt(t)?t:Jz;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 Qz=t=>`'${t}' value is already declared in a unique set.`;function eY(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=mt(t)?t:Qz;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 zE=t=>`There is already registered "${t}" plugin.`,tY=t=>`There is already registered plugin on priority "${t}".`,nY=t=>`The priority "${t}" is not a number.`,BN=Zz({errorPriorityExists:tY,errorPriorityNaN:nY}),jN=eY({errorItemExists:zE}),cR=Cw({errorIdExists:zE});function UN(){return[...BN.getItems(),...jN.getItems()]}function YE(t){const e=$o(t);return cR.getItem(e)}function rY(t){return!!YE(t)}function Ye(t,e,n){[t,e,n]=oY(t,e,n),YE(t)===void 0&&iY(t,e,n)}function iY(t,e,n){const r=$o(t);if(cR.hasItem(r))throw new Error(zE(r));n===void 0?jN.addItem(r):BN.addItem(n,r),cR.addItem(r,e)}function oY(t,e,n){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,n=e.PLUGIN_PRIORITY),[t,e,n]}const{register:sY,getItem:aY,hasItem:zN,getNames:ple,getValues:wle}=Uo("renderers");function hR(t){if(typeof t=="function")return t;if(!zN(t))throw Error(`No registered renderer found under "${t}" name`);return aY(t)}function Xi(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),sY(t,e)}const{register:lY,getItem:uY,hasItem:YN,getNames:vle,getValues:Cle}=Uo("validators");function cY(t){if(typeof t=="function")return t;if(!YN(t))throw Error(`No registered validator found under "${t}" name`);return uY(t)}function Tc(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),lY(t,e)}var qP={},XP;function hY(){if(XP)return qP;XP=1;var t=dt(),e=ih(),n=sh(),r=_f(),i=vw();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"),qP}hY();var ZP={},JP;function dY(){if(JP)return ZP;JP=1;var t=dt(),e=qt(),n=Sf(),r=_f(),i=nw(),o=Sn(),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)}}),ZP}dY();function Ah(t,e,n){return(e=fY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fY(t){var e=gY(t,"string");return typeof e=="symbol"?e:e+""}function gY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 mY{constructor(){Ah(this,"count",0),Ah(this,"startColumn",null),Ah(this,"endColumn",null),Ah(this,"startPosition",null),Ah(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 Hh(t,e,n){return(e=pY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pY(t){var e=wY(t,"string");return typeof e=="symbol"?e:e+""}function wY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 vY{constructor(){Hh(this,"count",0),Hh(this,"startRow",null),Hh(this,"endRow",null),Hh(this,"startPosition",null),Hh(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 Nh(t,e,n){return(e=CY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function CY(t){var e=yY(t,"string");return typeof e=="symbol"?e:e+""}function yY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 GN{constructor(){Nh(this,"count",0),Nh(this,"startColumn",null),Nh(this,"endColumn",null),Nh(this,"startPosition",null),Nh(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 Dh(t,e,n){return(e=bY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bY(t){var e=SY(t,"string");return typeof e=="symbol"?e:e+""}function SY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 KN{constructor(){Dh(this,"count",0),Dh(this,"startRow",null),Dh(this,"endRow",null),Dh(this,"startPosition",null),Dh(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 kh(t,e,n){return(e=RY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function RY(t){var e=EY(t,"string");return typeof e=="symbol"?e:e+""}function EY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 TY{constructor(){kh(this,"count",0),kh(this,"startColumn",0),kh(this,"endColumn",0),kh(this,"startPosition",0),kh(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalColumns:n}=e;this.count=n,this.endColumn=this.count-1}process(){}finalize(){}}function Lh(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)}class IY{constructor(){Lh(this,"count",0),Lh(this,"startRow",0),Lh(this,"endRow",0),Lh(this,"startPosition",0),Lh(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalRows:n}=e;this.count=n,this.endRow=this.count-1}process(){}finalize(){}}function QP(t,e,n){return(e=PY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function PY(t){var e=OY(t,"string");return typeof e=="symbol"?e:e+""}function OY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 xY extends GN{constructor(){super(...arguments),QP(this,"columnStartOffset",0),QP(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 eO(t,e,n){return(e=AY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function AY(t){var e=HY(t,"string");return typeof e=="symbol"?e:e+""}function HY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 NY extends KN{constructor(){super(...arguments),eO(this,"rowStartOffset",0),eO(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 tO(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=kY(t,"string");return typeof e=="symbol"?e:e+""}function kY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 qN{constructor(e){tO(this,"calculationTypes",[]),tO(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 mo(t,e,n){return(e=LY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LY(t){var e=$Y(t,"string");return typeof e=="symbol"?e:e+""}function $Y(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Xc=50;class FY extends qN{constructor(e){let{calculationTypes:n,viewportWidth:r,scrollOffset:i,totalColumns:o,columnWidthFn:s,overrideFn:a,inlineStartOffset:l}=e;super(n),mo(this,"viewportWidth",0),mo(this,"scrollOffset",0),mo(this,"zeroBasedScrollOffset",0),mo(this,"totalColumns",0),mo(this,"columnWidthFn",null),mo(this,"columnWidth",0),mo(this,"overrideFn",null),mo(this,"inlineStartOffset",0),mo(this,"totalCalculatedWidth",0),mo(this,"startPositions",[]),mo(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)?Xc:n}}function Ui(t,e,n){return(e=VY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VY(t){var e=WY(t,"string");return typeof e=="symbol"?e:e+""}function WY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 BY extends qN{constructor(e){let{calculationTypes:n,viewportHeight:r,scrollOffset:i,totalRows:o,defaultRowHeight:s,rowHeightFn:a,overrideFn:l,horizontalScrollbarHeight:u}=e;super(n),Ui(this,"viewportHeight",0),Ui(this,"scrollOffset",0),Ui(this,"zeroBasedScrollOffset",0),Ui(this,"totalRows",0),Ui(this,"rowHeightFn",null),Ui(this,"rowHeight",0),Ui(this,"overrideFn",null),Ui(this,"horizontalScrollbarHeight",0),Ui(this,"innerViewportHeight",0),Ui(this,"totalCalculatedHeight",0),Ui(this,"startPositions",[]),Ui(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 jY(t,e,n){UY(t,e),e.set(t,n)}function UY(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nO(t,e,n){return(e=zY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zY(t){var e=YY(t,"string");return typeof e=="symbol"?e:e+""}function YY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Vu(t,e){return t.get(XN(t,e))}function rO(t,e,n){return t.set(XN(t,e),n),n}function XN(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 Ds=new WeakMap;class Su{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;nO(this,"row",null),nO(this,"col",null),jY(this,Ds,!1),rO(Ds,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 Vu(Ds,this)}isSouthEastOf(e){return this.row>=e.row&&(Vu(Ds,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(Vu(Ds,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(Vu(Ds,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(Vu(Ds,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==null?void 0:e.row)&&(this.row=e.row),Number.isInteger(e==null?void 0:e.col)&&(this.col=e.col),e instanceof Su&&rO(Ds,this,e.isRtl()),this}clone(){return new Su(this.row,this.col,Vu(Ds,this))}toObject(){return{row:this.row,col:this.col}}}function GY(t,e,n){KY(t,e),e.set(t,n)}function KY(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Uy(t,e,n){return(e=qY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qY(t){var e=XY(t,"string");return typeof e=="symbol"?e:e+""}function XY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 zi(t,e){return t.get(ZN(t,e))}function ZY(t,e,n){return t.set(ZN(t,e),n),n}function ZN(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 tr=new WeakMap;class Df{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;Uy(this,"highlight",null),Uy(this,"from",null),Uy(this,"to",null),GY(this,tr,!1),this.highlight=e.clone(),this.from=n.clone(),this.to=r.clone(),ZY(tr,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}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 zi(tr,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 zi(tr,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 zi(tr,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 zi(tr,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 zi(tr,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 zi(tr,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 zi(tr,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 zi(tr,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 Su))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(zi(tr,this)?"left":"right"),n.bottom===r.bottom&&i.push("bottom"),n.left===r.left&&i.push(zi(tr,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 Df(this.highlight,this.from,this.to,zi(tr,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,n){return new Su(e,n,zi(tr,this))}}function Ko(t,e,n){JY(t,e),e.set(t,n)}function JY(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ge(t,e){return t.get(JN(t,e))}function Ma(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 Yi=new WeakMap,zy=new WeakMap,mn=new WeakMap,Wu=new WeakMap,ag=new WeakMap,po=new WeakMap,Yy=new WeakMap,$h=new WeakMap,bl=new WeakMap,qo=new WeakMap;let QN=class{constructor(e,n,r,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;Ko(this,Yi,void 0),Ko(this,zy,void 0),Ko(this,mn,void 0),Ko(this,Wu,void 0),Ko(this,ag,void 0),Ko(this,po,void 0),Ko(this,Yy,void 0),Ko(this,$h,void 0),Ko(this,bl,[null,null]),Ko(this,qo,[null,null]),Ma(Yi,this,r),Ma(zy,this,n),Ma(mn,this,o),Ma(Wu,this,s),Ma(ag,this,a),Ma(po,this,i),Ma(Yy,this,e),this.registerEvents()}registerEvents(){ge(po,this).addEventListener(ge(mn,this).holder,"contextmenu",r=>this.onContextMenu(r)),ge(po,this).addEventListener(ge(mn,this).TABLE,"mouseover",r=>this.onMouseOver(r)),ge(po,this).addEventListener(ge(mn,this).TABLE,"mouseout",r=>this.onMouseOut(r));const e=()=>{ge(po,this).addEventListener(ge(mn,this).holder,"touchstart",r=>this.onTouchStart(r)),ge(po,this).addEventListener(ge(mn,this).holder,"touchend",r=>this.onTouchEnd(r)),this.momentumScrolling||(this.momentumScrolling={}),ge(po,this).addEventListener(ge(mn,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||ge(Yi,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,ge(Yi,this).getSetting("onAfterMomentumScroll"))},200)})},n=()=>{ge(po,this).addEventListener(ge(mn,this).holder,"mouseup",r=>this.onMouseUp(r)),ge(po,this).addEventListener(ge(mn,this).holder,"mousedown",r=>this.onMouseDown(r))};aa()?e():(PN()&&e(),n())}selectedCellWasTouched(e){const r=this.parentCell(e).coords;if(ge($h,this)&&r){const[i,o]=[r.row,ge($h,this).from.row],[s,a]=[r.col,ge($h,this).from.col];return i===o&&s===a}return!1}parentCell(e){const n={},r=ge(mn,this).TABLE,i=ng(e,["TD","TH"],r);return i?(n.coords=ge(mn,this).getCoords(i),n.TD=i):Ce(e,"wtBorder")&&Ce(e,"current")?(n.coords=ge(Wu,this).getFocusSelection().cellRange.highlight,n.TD=ge(mn,this).getCell(n.coords)):Ce(e,"wtBorder")&&Ce(e,"area")&&ge(Wu,this).getAreaSelection().cellRange&&(n.coords=ge(Wu,this).getAreaSelection().cellRange.to,n.TD=ge(mn,this).getCell(n.coords)),n}onMouseDown(e){const n=ge(zy,this).rootDocument.activeElement,r=IN(NU,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);Ce(i,"corner")?ge(Yi,this).getSetting("onCellCornerMouseDown",e,i):o.TD&&ge(Yi,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,o.coords,o.TD),(e.button===0||this.touchApplied)&&o.TD&&(ge(qo,this)[0]=o.TD,clearTimeout(ge(bl,this)[0]),ge(bl,this)[0]=setTimeout(()=>{ge(qo,this)[0]=null},1e3))}onContextMenu(e){if(ge(Yi,this).has("onCellContextMenu")){const n=this.parentCell(e.target);n.TD&&this.callListener("onCellContextMenu",e,n.coords,n.TD)}}onMouseOver(e){if(!ge(Yi,this).has("onCellMouseOver"))return;const n=ge(mn,this).TABLE,r=ng(e.target,["TD","TH"],n),i=ge(ag,this)||this;r&&r!==i.lastMouseOver&&wu(r,n)&&(i.lastMouseOver=r,this.callListener("onCellMouseOver",e,ge(mn,this).getCoords(r),r))}onMouseOut(e){if(!ge(Yi,this).has("onCellMouseOut"))return;const n=ge(mn,this).TABLE,r=ng(e.target,["TD","TH"],n),i=ng(e.relatedTarget,["TD","TH"],n),o=ge(ag,this)||this;r&&r!==i&&wu(r,n)&&(this.callListener("onCellMouseOut",e,ge(mn,this).getCoords(r),r),i===null&&(o.lastMouseOver=null))}onMouseUp(e){const n=this.parentCell(e.target);n.TD&&ge(Yi,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,n.coords,n.TD),!(e.button!==0&&!this.touchApplied)&&(n.TD===ge(qo,this)[0]&&n.TD===ge(qo,this)[1]?(Ce(e.target,"corner")?this.callListener("onCellCornerDblClick",e,n.coords,n.TD):this.callListener("onCellDblClick",e,n.coords,n.TD),ge(qo,this)[0]=null,ge(qo,this)[1]=null):n.TD===ge(qo,this)[0]&&(ge(qo,this)[1]=n.TD,clearTimeout(ge(bl,this)[1]),ge(bl,this)[1]=setTimeout(()=>{ge(qo,this)[1]=null},500)))}onTouchStart(e){Ma($h,this,ge(Wu,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=se(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&o&&ge(Yi,this).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];AN()&&(ez()||tz())&&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=ge(Yi,this).getSettingPure(e);o&&o(n,r,i,ge(Yy,this).call(this))}destroy(){clearTimeout(ge(bl,this)[0]),clearTimeout(ge(bl,this)[1]),ge(po,this).destroy()}};function Gy(t,e,n){return(e=QY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function QY(t){var e=eG(t,"string");return typeof e=="symbol"?e:e+""}function eG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 tG{constructor(e,n,r){Gy(this,"offset",void 0),Gy(this,"total",void 0),Gy(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 Ky(t,e,n){return(e=nG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nG(t){var e=rG(t,"string");return typeof e=="symbol"?e:e+""}function rG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 iG{constructor(e,n,r){Ky(this,"offset",void 0),Ky(this,"total",void 0),Ky(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 lg(t,e,n){return(e=oG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oG(t){var e=sG(t,"string");return typeof e=="symbol"?e:e+""}function sG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 aG{constructor(){lg(this,"currentSize",0),lg(this,"nextSize",0),lg(this,"currentOffset",0),lg(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}const lG=0,iO=1,dR=2;function qy(t,e,n){return(e=uG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uG(t){var e=cG(t,"string");return typeof e=="symbol"?e:e+""}function cG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class hG{constructor(){qy(this,"size",new aG),qy(this,"workingSpace",lG),qy(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=iO,e.workingSpace=dR,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=dR,e.workingSpace=iO,this.sharedSize=e.getViewSize()}}var oO={},Xy,sO;function dG(){if(sO)return Xy;sO=1;var t=ew(),e=TypeError;return Xy=function(n,r){if(!delete n[r])throw new e("Cannot delete property "+t(r)+" of "+t(n))},Xy}var aO;function fG(){if(aO)return oO;aO=1;var t=dt(),e=ih(),n=sh(),r=JH(),i=dG(),o=QH(),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 C=m+f;m in h?h[C]=h[m]:i(h,C)}for(var w=0;w<f;w++)h[w]=arguments[w]}return r(h,d+f)}}),oO}fG();function gG(t,e,n){return(e=mG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mG(t){var e=pG(t,"string");return typeof e=="symbol"?e:e+""}function pG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 lO{constructor(e,n){gG(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 wG(t,e,n){return(e=vG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vG(t){var e=CG(t,"string");return typeof e=="symbol"?e:e+""}function CG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 yG{constructor(e){wG(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 lO(o,n),l=new lO(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(dR)?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 Bu(t,e,n){return(e=bG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bG(t){var e=SG(t,"string");return typeof e=="symbol"?e:e+""}function SG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 eD{constructor(e,n){Bu(this,"rootNode",void 0),Bu(this,"nodesPool",void 0),Bu(this,"sizeSet",new hG),Bu(this,"collectedNodes",[]),Bu(this,"viewDiffer",new yG(this.sizeSet)),Bu(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 tD extends eD{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 uO(t,e,n){return(e=RG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function RG(t){var e=EG(t,"string");return typeof e=="symbol"?e:e+""}function EG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 TG{constructor(e){uO(this,"nodeType",void 0),uO(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 Fh(t,e,n){return(e=_G(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _G(t){var e=MG(t,"string");return typeof e=="symbol"?e:e+""}function MG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class kf{constructor(e,n){Fh(this,"nodesPool",null),Fh(this,"nodeType",void 0),Fh(this,"rootNode",void 0),Fh(this,"table",null),Fh(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new TG(e):null,this.nodeType=e,this.rootNode=n}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function cO(t,e,n){return(e=IG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function IG(t){var e=PG(t,"string");return typeof e=="symbol"?e:e+""}function PG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 OG extends kf{constructor(){super("TH"),cO(this,"orderViews",new WeakMap),cO(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new tD(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=0;h<r;h++){u.render();const d=u.getCurrentNode();d.className="",d.removeAttribute("style"),dh(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&be(d,[fU(),SU(),NE(h+1),Nu(-1)]),n[h](a,d,h)}u.end()}}}class xG extends kf{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&&ma(r)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&be(this.rootNode,[uN()]);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()&&be(s,[iR(),fN(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"),dh(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&be(u,[NE(a+1+this.table.rowHeadersCount),Nu(-1),gU(),...a>=0?[bU()]:[iR()]]),r[n](l,u,n)}}}}let hO=!1;class AG extends kf{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;!hO&&e>1e3&&(hO=!0,Xe(tt`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
|
|
41
|
-
Consider limiting the number of rendered columns by specifying the table width and/or\x20
|
|
42
|
-
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&&Y(r,"rowHeader")}}function HG(t,e,n){return(e=NG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function NG(t){var e=DG(t,"string");return typeof e=="symbol"?e:e+""}function DG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 ju={rowEven:"ht__row_even",rowOdd:"ht__row_odd"};let dO=!1;class kG extends kf{constructor(e){super("TR",e),HG(this,"orderView",void 0),this.orderView=new eD(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;!dO&&e>1e3&&(dO=!0,Xe(tt`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
|
|
43
|
-
Consider limiting the number of rendered rows by specifying the table height and/or\x20
|
|
44
|
-
turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&be(this.rootNode,[uN()]),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;be(o,[iR(),fN(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?Ce(o,ju.rowEven)||(we(o,ju.rowOdd),Y(o,ju.rowEven)):Ce(o,ju.rowOdd)||(we(o,ju.rowEven),Y(o,ju.rowOdd))}this.orderView.end()}}function fO(t,e,n){return(e=LG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LG(t){var e=$G(t,"string");return typeof e=="symbol"?e:e+""}function $G(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class FG extends kf{constructor(){super("TD"),fO(this,"orderViews",new WeakMap),fO(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new tD(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(Ce(m,"hide")||(m.className=""),m.removeAttribute("style"),m.removeAttribute("dir"),dh(m,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,f,m),this.table.isAriaEnabled()){var o,s;be(m,[...m.hasAttribute("role")?[]:[dU()],Nu(-1),NE(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 Qt(t,e,n){return(e=VG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VG(t){var e=WG(t,"string");return typeof e=="symbol"?e:e+""}function WG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 BG{constructor(e){let{cellRenderer:n,stylesHandler:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Qt(this,"rootNode",void 0),Qt(this,"rootDocument",void 0),Qt(this,"rowHeaders",null),Qt(this,"columnHeaders",null),Qt(this,"colGroup",null),Qt(this,"rows",null),Qt(this,"cells",null),Qt(this,"rowFilter",null),Qt(this,"columnFilter",null),Qt(this,"rowUtils",null),Qt(this,"columnUtils",null),Qt(this,"rowsToRender",0),Qt(this,"columnsToRender",0),Qt(this,"rowHeaderFunctions",[]),Qt(this,"rowHeadersCount",0),Qt(this,"columnHeaderFunctions",[]),Qt(this,"columnHeadersCount",0),Qt(this,"cellRenderer",void 0),Qt(this,"activeOverlayName",void 0),Qt(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 jG{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 BG(e,{cellRenderer:a,stylesHandler:l}),this.renderer.setRenderers({rowHeaders:new OG,columnHeaders:new xG(n),colGroup:new AG(r),rows:new kG(i),cells:new FG}),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 Zy(t,e,n){return(e=UG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function UG(t){var e=zG(t,"string");return typeof e=="symbol"?e:e+""}function zG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 YG{constructor(e,n){Zy(this,"dataAccessObject",void 0),Zy(this,"wtSettings",void 0),Zy(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 gO(t,e,n){return(e=GG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GG(t){var e=KG(t,"string");return typeof e=="symbol"?e:e+""}function KG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 qG{constructor(e,n){gO(this,"dataAccessObject",void 0),gO(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 Xo(t,e,n){return(e=XG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function XG(t){var e=ZG(t,"string");return typeof e=="symbol"?e:e+""}function ZG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 gh{constructor(e,n,r,i,o){Xo(this,"wtSettings",null),Xo(this,"domBindings",void 0),Xo(this,"TBODY",null),Xo(this,"THEAD",null),Xo(this,"COLGROUP",null),Xo(this,"hasTableHeight",!0),Xo(this,"hasTableWidth",!0),Xo(this,"isTableVisible",!1),Xo(this,"tableOffset",0),Xo(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,wN(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 qG(this.dataAccessObject,this.wtSettings),this.columnUtils=new YG(this.dataAccessObject,this.wtSettings),this.tableRenderer=new jG({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||!Ce(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")&&be(r,[Es()]),r}createHider(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!Ce(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtHider",n&&n.insertBefore(r,e),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&be(r,[Es()]),r}createHolder(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!Ce(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.style.position="relative",r.className="wtHolder",be(r,[Nu(-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")&&be(r.parentNode,[Es()])),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&be(r,[Es()]),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=An(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=An(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const f=o>0?this.getFirstRenderedRow():0,m=s>0?this.getFirstRenderedColumn():0;this.rowFilter=new iG(f,o,c),this.columnFilter=new tG(m,s,l);let C=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const w={};this.wtSettings.getSetting("beforeDraw",!0,w),C=w.skipRender!==!0}C&&(this.tableRenderer.setHeaderContentRenderers(a,u),(this.is(bs)||this.is(sl))&&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(bs))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||i.createVisibleCalculators(),r.refresh(!1),r.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(bs)&&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=kd(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(bs))&&!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==null?void 0: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==null?void 0: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==null?void 0:o.childNodes[i];s&&n.push(s)}return n}getCoords(e){let n=e;if(n.nodeName!=="TD"&&n.nodeName!=="TH"&&(n=Cu(n,["TD","TH"])),n===null)return null;const r=n.parentNode,i=r.parentNode;let o=LU(r),s=n.cellIndex;Cl(Tu,n,this.wtRootElement)||Cl(Ru,n,this.wtRootElement)?i.nodeName==="THEAD"&&(o-=i.childNodes.length):Cl(sl,n,this.wtRootElement)||Cl(bs,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)),Cl(Tu,n,this.wtRootElement)||Cl(Eu,n,this.wtRootElement)||Cl(sl,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=kd(this.TBODY)-1,i=this.wot.stylesHandler.areCellsBorderBox(),o=i?nn:kd,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 Gt(this.TABLE)}getHeight(){return nn(this.TABLE)}getTotalWidth(){const e=Gt(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=nn(this.hider);return e!==0?e:this.getHeight()}isVisible(){return qc(this.TABLE)}_modifyRowHeaderWidth(e){let n=mt(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 JG="stickyRowsBottom",GE={getFirstRenderedRow(){const t=this.wtSettings.getSetting("totalRows"),e=this.wtSettings.getSetting("fixedRowsBottom"),n=t-e;return t===0||e===0?-1:n<0?0:n},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){const t=this.wtSettings.getSetting("totalRows");return Math.min(this.wtSettings.getSetting("fixedRowsBottom"),t)},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return 0}};ba(GE,"MIXIN_NAME",JG,{writable:!1,enumerable:!1});const QG="stickyColumnsStart",yw={getFirstRenderedColumn(){return this.wtSettings.getSetting("totalColumns")===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(){const t=this.wtSettings.getSetting("totalColumns");return Math.min(this.wtSettings.getSetting("fixedColumnsStart"),t)},getVisibleColumnsCount(){return this.getRenderedColumnsCount()},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};ba(yw,"MIXIN_NAME",QG,{writable:!1,enumerable:!1});class KE extends gh{constructor(e,n,r,i){super(e,n,r,i,sl)}}lt(KE,GE);lt(KE,yw);const Ru="top",bs="bottom",Eu="inline_start",Tu="top_inline_start_corner",sl="bottom_inline_start_corner",nD=[Ru,bs,Eu,Tu,sl],e2=new Map([[Ru,`ht_clone_${Ru}`],[bs,`ht_clone_${bs}`],[Eu,`ht_clone_${Eu} ht_clone_left`],[Tu,`ht_clone_${Tu} ht_clone_top_left_corner`],[sl,`ht_clone_${sl} ht_clone_bottom_left_corner`]]);function t2(t,e){n2(t,e),e.add(t)}function n2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function r2(t,e,n){return(e=i2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i2(t){var e=o2(t,"string");return typeof e=="symbol"?e:e+""}function o2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 ug(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 Vh=new WeakSet;class s2{constructor(e){t2(this,Vh),r2(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=Bi(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=Bi(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 ug(Vh,this,pO).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return ug(Vh,this,pO).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return ug(Vh,this,mO).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return ug(Vh,this,mO).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function mO(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=An(r.wtRootElement).left;const u=Math.abs(CN(s,s));if(l>u){const c=yN(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 pO(t){const{topOverlay:e,wtTable:n,wtViewport:r,totalRows:i,rootWindow:o}=this.dataAccessObject;if(e.mainTableScrollableElement===o){const s=An(n.wtRootElement),a=LE(o,o);if(s.top>a){const l=kd(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 Gi(t,e,n){return(e=a2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a2(t){var e=l2(t,"string");return typeof e=="symbol"?e:e+""}function l2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 qE{get eventManager(){return new Fo(this)}constructor(e,n){Gi(this,"wtTable",void 0),Gi(this,"wtScroll",void 0),Gi(this,"wtViewport",void 0),Gi(this,"wtOverlays",void 0),Gi(this,"selectionManager",void 0),Gi(this,"wtEvent",void 0),Gi(this,"guid",`wt_${sN()}`),Gi(this,"drawInterrupted",!1),Gi(this,"drawn",!1),Gi(this,"activeOverlayName","master"),Gi(this,"domBindings",void 0),Gi(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=n,this.wtScroll=new s2(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){yu(r,e[n])}])}}createCellCoords(e,n){return new Su(e,n,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,n,r){return new Df(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()?this.wtTable.draw(e):this.drawInterrupted=!0,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 wO(t,e,n){return(e=u2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u2(t){var e=c2(t,"string");return typeof e=="symbol"?e:e+""}function c2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 h2 extends qE{constructor(e,n,r){super(e,n),wO(this,"cloneSource",void 0),wO(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 QN(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,r.event),this.findOriginalHeaders()}}function d2(t,e,n){return(e=f2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f2(t){var e=g2(t,"string");return typeof e=="symbol"?e:e+""}function g2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Lf{constructor(e,n,r,i,o){d2(this,"wtSettings",null),ba(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=of(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=of(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=up(e.TABLE)}getRelativeCellPosition(e,n,r){if(this.clone.wtTable.holder.contains(e)===!1){Xe(`The provided element is not a child of the ${this.type} overlay`);return}const i=this.mainTableScrollableElement===this.domBindings.rootWindow,o=r<this.wtSettings.getSetting("fixedColumnsStart"),s=n<this.wtSettings.getSetting("fixedRowsTop"),a=n>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),l=this.clone.wtTable.spreader,u={start:this.getRelativeStartPosition(l),top:l.offsetTop},c={start:this.getRelativeStartPosition(e),top:e.offsetTop};let h=null;return i?h=this.getRelativeCellPositionWithinWindow(s,o,c,u):h=this.getRelativeCellPositionWithinHolder(s,a,o,c,u),h}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,n,r,i){const o=this.wot.wtTable.wtRootElement.getBoundingClientRect();let s=0,a=0;if(!n)s=i.start;else{let l=o.left;this.isRtl()&&(l=this.domBindings.rootWindow.innerWidth-(o.left+o.width+vn())),s=l<=0?-1*l:0}return e?a=this.clone.wtTable.TABLE.getBoundingClientRect().top-o.top:a=i.top,{start:r.start+s,top:r.top+a}}getRelativeCellPositionWithinHolder(e,n,r,i,o){const s={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let a=0,l=0;if(r||(a=s.horizontal-o.start),n){const u=this.wot.wtTable.wtRootElement.getBoundingClientRect();l=this.clone.wtTable.TABLE.getBoundingClientRect().top*-1+u.top}else e||(l=s.vertical-o.top);return{start:i.start-a,top:i.top-l}}makeClone(){if(nD.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=`${e2.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")&&be(o,[Es()]),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===Ru||u==="vertical"&&this.type===Eu?this.mainTableScrollableElement=i:i.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=up(e.TABLE),new h2(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 m2 extends Lf{constructor(e,n,r,i,o,s){super(e,n,sl,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 KE(...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 pw(n),this.repositionOverlay();let r=nn(this.clone.wtTable.TABLE);const i=Gt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(r=0),n.style.height=`${r}px`,n.style.width=`${i}px`,!1}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;n.hasVerticalScroll()||(o+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(o+=vn(r)),i.style.bottom=`${o}px`}}const p2="calculatedColumns",bw={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}};ba(bw,"MIXIN_NAME",p2,{writable:!1,enumerable:!1});class XE extends gh{constructor(e,n,r,i){super(e,n,r,i,bs)}}lt(XE,GE);lt(XE,bw);function w2(t,e,n){return(e=v2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v2(t){var e=C2(t,"string");return typeof e=="symbol"?e:e+""}function C2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 y2 extends Lf{constructor(e,n,r,i){super(e,n,bs,r,i),w2(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 XE(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,n=this.clone.wtTable.holder.parentNode;n.style.top="";let r=0;const i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!i||i!=="vertical")?(r=this.getOverlayOffset(),n.style.bottom=`${r}px`):(r=this.getScrollPosition(),this.repositionOverlay());const o=this.adjustHeaderBordersPosition(r);return this.adjustElementsSize(),o}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;n.hasVerticalScroll()||(o+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(o+=vn(r)),i.style.bottom=`${o}px`}setScrollPosition(e){const{rootWindow:n}=this.domBindings;let r=!1;return this.mainTableScrollableElement===n?(n.scrollTo(kE(n),e),r=!0):this.mainTableScrollableElement.scrollTop!==e&&(this.mainTableScrollableElement.scrollTop=e,r=!0),r}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const{wtTable:r,stylesHandler:i}=this.wot,o=i.getDefaultRowHeight();let s=e,a=0;for(;s<n;){const l=r.getRowHeight(s);a+=l===void 0?o:l,s+=1}return a}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=n.getWorkspaceWidth();n.hasVerticalScroll()&&(u-=vn(r)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=nn(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=e.parentNode.style.height}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:n}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?n.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:n.style[e]=""}scrollTo(e,n){let r=this.getTableParentOffset();const o=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let s=0;n&&o.offsetHeight!==o.clientHeight&&(s=vn(this.domBindings.rootDocument)),n?(r+=this.sumCellSizes(0,e+1),r-=this.wot.wtViewport.getViewportHeight(),r+=1):r+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),r+=s,this.setScrollPosition(r)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return LE(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=Ce(s,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(Y(s,"innerBorderBottom"),o=!a):(we(s,"innerBorderBottom"),o=a)}return o}}const b2="calculatedRows",ZE={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}};ba(ZE,"MIXIN_NAME",b2,{writable:!1,enumerable:!1});class JE extends gh{constructor(e,n,r,i){super(e,n,r,i,Eu)}}lt(JE,ZE);lt(JE,yw);const S2="localHooks",Rn={_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++)oR(this._localHooks[t][l],this,e,n,r,i,o,s)}},clearLocalHooks(){return this._localHooks={},this}};ba(Rn,"MIXIN_NAME",S2,{writable:!1,enumerable:!1});let rD=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")}};lt(rD,Rn);const iD="active-header",QE="header",e0="area",gp="focus",R2="fill",E2="row",T2="column",_2="custom-selection",t0=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 vO={},CO;function M2(){if(CO)return vO;CO=1;var t=vw();return t("flat"),vO}M2();function I2(t,e){oD(t,e),e.add(t)}function yO(t,e,n){oD(t,e),e.set(t,n)}function oD(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(Ld(t,e))}function bO(t,e,n){return t.set(Ld(t,e),n),n}function Ld(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 So=new WeakMap,In=new WeakMap,cg=new WeakSet;class P2{constructor(){I2(this,cg),yO(this,So,void 0),yO(this,In,void 0)}setActiveOverlay(e){return bO(In,this,e),this}setActiveSelection(e){return bO(So,this,e),this}scan(){const e=Ot(So,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]=Ot(So,this).getCorners(),{wtTable:s}=Ot(In,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 C=Ot(In,this).getSetting("onBeforeHighlightingColumnHeader",h,f,{selectionType:Ot(So,this).settings.selectionType,columnCursor:u,selectionWidth:o-r+1});C!==null&&(C!==h&&(m=s.getColumnHeader(C,f)),e(m))}u+=1}}}scanRowsInHeadersRange(e){const[n,r,i,o]=Ot(So,this).getCorners(),{wtTable:s}=Ot(In,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 C=Ot(In,this).getSetting("onBeforeHighlightingRowHeader",h,f,{selectionType:Ot(So,this).settings.selectionType,rowCursor:u,selectionHeight:i-n+1});C!==null&&(C!==h&&(m=s.getRowHeader(C,f)),e(m))}u+=1}}}scanCellsRange(e){const{wtTable:n}=Ot(In,this);Ld(cg,this,O2).call(this,(r,i)=>{const o=n.getCell(Ot(In,this).createCellCoords(r,i)),s=Ot(In,this).getSetting("onAfterDrawSelection",r,i,Ot(So,this).settings.layerLevel);typeof s=="string"&&Y(o,s),e(o)})}scanRowsInCellsRange(e){const[n,,r]=Ot(So,this).getCorners(),{wtTable:i}=Ot(In,this);Ld(cg,this,SO).call(this,(o,s)=>{if(o>=n&&o<=r){const a=i.getCell(Ot(In,this).createCellCoords(o,s));e(a)}})}scanColumnsInCellsRange(e){const[,n,,r]=Ot(So,this).getCorners(),{wtTable:i}=Ot(In,this);Ld(cg,this,SO).call(this,(o,s)=>{if(s>=n&&s<=r){const a=i.getCell(Ot(In,this).createCellCoords(o,s));e(a)}})}}function O2(t){let[e,n,r,i]=Ot(So,this).getCorners();if(e<0&&r<0||n<0&&i<0)return;const{wtTable:o}=Ot(In,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(Ot(In,this).createCellCoords(e,n));if(!ol(a))return}for(let a=e;a<=r;a+=1)for(let l=n;l<=i;l+=1)t(a,l)}function SO(t){const{wtTable:e}=Ot(In,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 RO{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=t0(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(),jo(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(" "),aa()&&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`};He(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}`};He(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),C=parseInt(c.width,10),w=this.wot.wtTable.getWidth(),S=this.wot.wtTable.getHeight();u.top=`${parseInt(r-m-1,10)}px`,u[l]=`${parseInt(i-m-1,10)}px`,c.top=`${parseInt(r-C/4*3,10)}px`,c[l]=`${parseInt(i-C/4*3,10)}px`;const R=Math.min(parseInt(i+o,10),w-m-f*2),I=Math.min(parseInt(i+o-C/4,10),w-C-f*2);h[l]=`${R}px`,d[l]=`${I}px`;const O=Math.min(parseInt(r+s,10),S-m-f*2),D=Math.min(parseInt(r+s-C/4,10),S-C-f*2);h.top=`${O}px`,d.top=`${D}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();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)),!ol(m)){this.disappear();return}const C=u?s.getCell(this.wot.createCellCoords(i,o)):m,w=An(m),S=u?An(C):w,R=An(s.TABLE),I=w.top,O=w.left,D=this.wot.wtSettings.getSetting("rtlMode");let _=0,x=0;if(D){const Re=Gt(s.TABLE),Le=Gt(m),Rt=l.innerWidth-R.left-Re;x=O+Le-S.left,_=l.innerWidth-O-Le-Rt-1}else x=S.left+Gt(C)-O,_=O-R.left-1;if(this.isEntireColumnSelected(n,i)){const Re=n,Le=this.getDimensionsFromHeader("columns",r,o,Re,R);let Rt=null;Le&&([Rt,_,x]=Le),Rt&&(m=Rt)}let j=I-R.top-1,X=S.top+nn(C)-I;if(this.isEntireRowSelected(r,o)){const Re=r,Le=this.getDimensionsFromHeader("rows",n,i,Re,R);let Rt=null;Le&&([Rt,j,X]=Le),Rt&&(m=Rt)}const U=l.getComputedStyle(m);parseInt(U.borderTopWidth,10)>0&&(j+=1,X=X>0?X-1:0),parseInt(U[D?"borderRightWidth":"borderLeftWidth"],10)>0&&(_+=1,x=x>0?x-1:0);const Z=D?"right":"left";this.topStyle.top=`${j}px`,this.topStyle[Z]=`${_}px`,this.topStyle.width=`${x}px`,this.topStyle.display="block",this.startStyle.top=`${j}px`,this.startStyle[Z]=`${_}px`,this.startStyle.height=`${X}px`,this.startStyle.display="block";const Q=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${j+X-Q}px`,this.bottomStyle[Z]=`${_}px`,this.bottomStyle.width=`${x}px`,this.bottomStyle.display="block",this.endStyle.top=`${j}px`,this.endStyle[Z]=`${_+x-Q}px`,this.endStyle.height=`${X+1}px`,this.endStyle.display="block";let le=this.settings.border.cornerVisible;le=typeof le=="function"?le(this.settings.layerLevel):le;const te=this.wot.getSetting("onModifyGetCellCoords",i,o,!1,"render");let[ue,ft]=[i,o];if(te&&Array.isArray(te)&&([,,ue,ft]=te),aa()||!le||this.isPartRange(ue,ft))this.cornerStyle.display="none";else{this.cornerStyle.top=`${j+X+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle[Z]=`${_+x+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 Re=of(s.TABLE);const Le=Re===l;Le&&(Re=a.documentElement);const Rt=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,Zt=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),g=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(o===this.wot.getSetting("totalColumns")-1){const p=Le?C.getBoundingClientRect().left:C.offsetLeft;let v=!1,E=0;D?(E=p-parseInt(this.cornerDefaultStyle.width,10)/2,v=E<0):(E=p+Gt(C)+parseInt(this.cornerDefaultStyle.width,10)/2,v=E>=yN(Re)),v&&(this.cornerStyle[Z]=`${Math.floor(_+x+this.cornerCenterPointOffset-Zt-Rt)}px`,this.cornerStyle[D?"borderLeftWidth":"borderRightWidth"]=0)}if(i===this.wot.getSetting("totalRows")-1){const E=(Le?C.getBoundingClientRect().top:C.offsetTop)+nn(C)+parseInt(this.cornerDefaultStyle.height,10)/2>=kd(Re),H=this.wot.stylesHandler.isClassicTheme();if(E){const W=Math.floor(j+X+this.cornerCenterPointOffset-g-Rt);H?(this.cornerStyle.top=`${W}px`,this.cornerStyle.borderBottomWidth=0):this.cornerStyle.top=`${W-1}px`}}this.cornerStyle.display="block"}aa()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(i,o,j,_,x,X)}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,C=null;switch(e){case"rows":l=function(){return s.getRowHeader(...arguments)},u=function(){return nn(...arguments)},c="ht__selection--rows",f="top";break;case"columns":l=function(){return s.getColumnHeader(...arguments)},u=function(){return Gt(...arguments)},c="ht__selection--columns",f="left";break}if(a.classList.contains(c)){const w=this.wot.getSetting("columnHeaders").length;if(m=l(n,w-i),C=l(r,w-i),!m||!C)return!1;const S=An(m),R=An(C);return m&&C&&(h=S[f]-o[f]-1,d=R[f]+u(C)-S[f]),[m,h,d]}return!1}changeBorderStyle(e,n){const r=this[e].style,i=n[e];!i||i.hide?Y(this[e],"hidden"):(Ce(this[e],"hidden")&&we(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?Y(this[e],"hidden"):we(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",aa()&&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 x2(t,e){sD(t,e),e.add(t)}function Uu(t,e,n){sD(t,e),e.set(t,n)}function sD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oe(t,e){return t.get(n0(t,e))}function EO(t,e,n){return t.set(n0(t,e),n),n}function n0(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 Pn=new WeakMap,ur=new WeakMap,Jy=new WeakMap,Md=new WeakMap,Qy=new WeakMap,Sl=new WeakMap,TO=new WeakSet;class A2{constructor(e){x2(this,TO),Uu(this,Pn,void 0),Uu(this,ur,void 0),Uu(this,Jy,new P2),Uu(this,Md,new WeakMap),Uu(this,Qy,new WeakSet),Uu(this,Sl,new Map),EO(ur,this,e)}setActiveOverlay(e){return EO(Pn,this,e),Oe(Jy,this).setActiveOverlay(Oe(Pn,this)),Oe(Md,this).has(Oe(Pn,this))||Oe(Md,this).set(Oe(Pn,this),new Set),this}getFocusSelection(){return Oe(ur,this)!==null?Oe(ur,this).getFocus():null}getAreaSelection(){return Oe(ur,this)!==null?Oe(ur,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(Oe(Sl,this).has(e)){const r=Oe(Sl,this).get(e);if(r.has(Oe(Pn,this)))return r.get(Oe(Pn,this));const i=new RO(Oe(Pn,this),e.settings);return r.set(Oe(Pn,this),i),i}const n=new RO(Oe(Pn,this),e.settings);return Oe(Sl,this).set(e,new Map([[Oe(Pn,this),n]])),n}getBorderInstances(e){var n,r;return Array.from((n=(r=Oe(Sl,this).get(e))===null||r===void 0?void 0:r.values())!==null&&n!==void 0?n:[])}destroyBorders(e){Oe(Sl,this).get(e).forEach(n=>n.destroy()),Oe(Sl,this).delete(e)}render(e){if(Oe(ur,this)===null)return;e&&n0(TO,this,H2).call(this);const n=Array.from(Oe(ur,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;Oe(Qy,this).has(s)||(Oe(Qy,this).add(s),s.addLocalHook("destroy",()=>this.destroyBorders(s)));const h=this.getBorderInstance(s);if(s.isEmpty()){h==null||h.disappear();continue}a&&Oe(Jy,this).setActiveSelection(s).scan().forEach(m=>{if(r.has(m)){const C=r.get(m);C.has(a)&&u===!0?C.set(a,C.get(a)+1):C.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();Oe(Pn,this).getSetting("onBeforeDrawBorders",d,c),h==null||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=>Oe(Md,this).get(Oe(Pn,this)).add(u)),Y(s,l),s.nodeName==="TD"&&Array.isArray((a=Oe(ur,this).options)===null||a===void 0?void 0:a.cellAttributes)&&be(s,Oe(ur,this).options.cellAttributes)}),Array.from(i.keys()).forEach(o=>{be(o,[...i.get(o)])})}}function H2(){const t=Oe(Md,this).get(Oe(Pn,this)),e=Oe(Pn,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=Oe(Pn,this).wtTable.TABLE.querySelectorAll(`.${n}`);let s=[];Array.isArray((r=Oe(ur,this).options)===null||r===void 0?void 0:r.cellAttributes)&&(s=Oe(ur,this).options.cellAttributes.map(a=>a[0])),Array.isArray((i=Oe(ur,this).options)===null||i===void 0?void 0:i.headerAttributes)&&(s=[...s,...Oe(ur,this).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=o.length;a<l;a++)we(o[a],n),dh(o[a],s)}),t.clear()}class N2 extends Lf{constructor(e,n,r,i){super(e,n,Eu,r,i)}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new JE(...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),$E(r,`${o}px`,"0px")):(o=this.getScrollPosition(),pw(r));const s=this.adjustHeaderBordersPosition(o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:n}=this.domBindings;let r=!1;return this.isRtl()&&(e=-e),this.mainTableScrollableElement===n&&n.scrollX!==e?(n.scrollTo(e,vN(n)),r=!0):this.mainTableScrollableElement.scrollLeft!==e&&(this.mainTableScrollableElement.scrollLeft=e,r=!0),r}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,n){const r=this.wtSettings.getSetting("defaultColumnWidth");let i=e,o=0;for(;i<n;)o+=this.wot.wtTable.getColumnWidth(i)||r,i+=1;return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="vertical"){let u=n.getWorkspaceHeight();n.hasHorizontalScroll()&&(u-=vn(r)),u=Math.min(u,e.wtRootElement.scrollHeight),s.height=`${u}px`}else s.height="";this.clone.wtTable.holder.style.height=s.height;const l=Gt(this.clone.wtTable.TABLE);s.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=t0(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&&!Ce(a.parentNode,"innerBorderInlineStart")?1:0;let u=this.getTableParentOffset(),c=0;if(n){const h=this.wot.wtTable.getColumnWidth(e),d=this.wot.wtViewport.getViewportWidth();h>d&&(n=!1)}return n&&a.offsetWidth!==a.clientWidth&&(c=vn(this.domBindings.rootDocument)),n?(u+=this.sumCellSizes(0,e+1),u-=this.wot.wtViewport.getViewportWidth(),u+=l):u+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),u+=c,VU(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(CN(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?we(r,"emptyRows"):Y(r,"emptyRows");let l=!1;if(!a){if(o&&!i.length)Y(r,"innerBorderLeft innerBorderInlineStart");else if(!o&&i.length){const u=Ce(r,"innerBorderInlineStart");e?(Y(r,"innerBorderLeft innerBorderInlineStart"),l=!u):(we(r,"innerBorderLeft innerBorderInlineStart"),l=u)}}return l}}const D2="stickyRowsTop",r0={getFirstRenderedRow(){return this.wtSettings.getSetting("totalRows")===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(){const t=this.wtSettings.getSetting("totalRows");return Math.min(this.wtSettings.getSetting("fixedRowsTop"),t)},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};ba(r0,"MIXIN_NAME",D2,{writable:!1,enumerable:!1});class i0 extends gh{constructor(e,n,r,i){super(e,n,r,i,Tu)}}lt(i0,r0);lt(i0,yw);function _O(t,e,n){return(e=k2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k2(t){var e=L2(t,"string");return typeof e=="symbol"?e:e+""}function L2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 $2 extends Lf{constructor(e,n,r,i,o,s){super(e,n,Tu,r,i),_O(this,"topOverlay",void 0),_O(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 i0(...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();$E(e,`${i}px`,`${o}px`)}else pw(e);let n=nn(this.clone.wtTable.TABLE);const r=Gt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),e.style.height=`${n}px`,e.style.width=`${r}px`,!1}}class o0 extends gh{constructor(e,n,r,i){super(e,n,r,i,Ru)}}lt(o0,r0);lt(o0,bw);function F2(t,e,n){return(e=V2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V2(t){var e=W2(t,"string");return typeof e=="symbol"?e:e+""}function W2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 B2 extends Lf{constructor(e,n,r,i){super(e,n,Ru,r,i),F2(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 o0(...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(),$E(e,"0px",`${i}px`)}else i=this.getScrollPosition(),pw(e);const s=this.adjustHeaderBordersPosition(i,o);return this.adjustElementsSize(),s}setScrollPosition(e){const n=this.domBindings.rootWindow;let r=!1;return this.mainTableScrollableElement===n&&n.scrollY!==e?(n.scrollTo(kE(n),e),r=!0):this.mainTableScrollableElement.scrollTop!==e&&(this.mainTableScrollableElement.scrollTop=e,r=!0),r}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const r=this.wot.stylesHandler.getDefaultRowHeight();let i=e,o=0;for(;i<n;){const s=this.wot.wtTable.getRowHeight(i);o+=s===void 0?r:s,i+=1}return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=n.getWorkspaceWidth();n.hasVerticalScroll()&&(u-=vn(r)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=nn(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=t0(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&&!Ce(s.parentNode,"innerBorderTop")?1:0;let c=this.getTableParentOffset(),h=0;if(n){const d=this.wot.wtTable.getRowHeight(e),f=this.wot.wtViewport.getViewportHeight();d>f&&(n=!1)}if(n&&s.offsetHeight!==s.clientHeight&&(h=vn(this.domBindings.rootDocument)),n){const d=i.getSetting("fixedRowsBottom"),f=i.getSetting("totalRows");c+=this.sumCellSizes(0,e+1),c-=r.wtViewport.getViewportHeight()-this.sumCellSizes(f-d,f),c+=1,c+=u}else c+=this.sumCellSizes(i.getSetting("fixedRowsTop"),e);return c+=h,FU(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 LE(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?we(i,"emptyColumns"):Y(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=Ce(i,"innerBorderTop");this.cachedFixedRowsTop=r.getSetting("fixedRowsTop"),e||r.getSetting("totalRows")===0?(Y(i,"innerBorderTop"),a=!h):(we(i,"innerBorderTop"),a=h)}}return a}}function hg(t,e,n){j2(t,e),e.set(t,n)}function j2(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(e=U2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function U2(t){var e=z2(t,"string");return typeof e=="symbol"?e:e+""}function z2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Rl(t,e,n){return t.set(aD(t,e),n),n}function Ls(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 zu=new WeakMap,dg=new WeakMap,Yu=new WeakMap,fg=new WeakMap;class Y2{constructor(e,n,r,i,o,s){ks(this,"wot",null),hg(this,zu,[]),ks(this,"topOverlay",null),ks(this,"bottomOverlay",null),ks(this,"inlineStartOverlay",null),ks(this,"topInlineStartCornerOverlay",null),ks(this,"bottomInlineStartCornerOverlay",null),ks(this,"browserLineHeight",void 0),ks(this,"wtSettings",null),hg(this,dg,!1),hg(this,Yu,0),hg(this,fg,null),ks(this,"resizeObserver",new ResizeObserver(c=>{hp(()=>{!Array.isArray(c)||!c.length||(Rl(Yu,this,Ls(Yu,this)+1),Ls(Yu,this)===100&&(Xe("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()),Ls(fg,this)!==null&&clearTimeout(Ls(fg,this)),Rl(fg,this,setTimeout(()=>{Rl(Yu,this,0)},100)),this.wtSettings.getSetting("onContainerElementResize"))})})),this.wot=e,this.wtSettings=i,this.domBindings=r,this.facadeGetter=n,this.wtTable=s;const{rootDocument:a,rootWindow:l}=this.domBindings;this.instance=this.wot,this.eventManager=o,this.scrollbarSize=vn(a);const u=l.getComputedStyle(s.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden";this.scrollableElement=u?s.holder:up(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=[...Ls(zu,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 B2(...e),this.bottomOverlay=new y2(...e),this.inlineStartOverlay=new N2(...e),this.topInlineStartCornerOverlay=new $2(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new m2(...e,this.bottomOverlay,this.inlineStartOverlay),Rl(zu,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){Rl(dg,this,Ls(zu,this).reduce((e,n)=>n.hasRenderingStateChanged()||e,!1)),Ls(zu,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),Ls(zu,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||!ON())&&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",()=>{hp(()=>{clearTimeout(c),this.wtSettings.getSetting("onWindowResize"),c=setTimeout(()=>{Rl(Yu,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=Nf(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{rootWindow:e}=this.domBindings,n=this.topOverlay.clone.wtTable.holder,r=this.inlineStartOverlay.clone.wtTable.holder,[i,o]=[this.scrollableElement.scrollLeft,this.scrollableElement.scrollTop];if(this.horizontalScrolling=n.scrollLeft!==i||this.lastScrollX!==e.scrollX,this.verticalScrolling=r.scrollTop!==o||this.lastScrollY!==e.scrollY,this.lastScrollX=e.scrollX,this.lastScrollY=e.scrollY,this.horizontalScrolling){n.scrollLeft=i;const s=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;s&&(s.scrollLeft=i)}this.verticalScrolling&&(r.scrollTop=o),this.refreshAll()}syncScrollWithMaster(){if(!Ls(dg,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),Rl(dg,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=up(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),C=f()?1:0,w=m()?1:0;d.width=`${c+w}px`,d.height=`${u+C}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 M(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];M(n,r=>{r&&(r.clone.wtTable.TABLE.className=e.className)})}}function MO(t,e,n){return(e=G2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function G2(t){var e=K2(t,"string");return typeof e=="symbol"?e:e+""}function K2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 q2{constructor(e){MO(this,"settings",{}),MO(this,"defaults",Object.freeze(this.getDefaults())),He(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);yu(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?He(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 s0 extends gh{constructor(e,n,r,i){super(e,n,r,i,"master")}alignOverlaysWithTrimmingContainer(){const e=of(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=cp(e,"height",n),o=cp(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=qc(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}}}lt(s0,ZE);lt(s0,bw);class X2{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 IY:new NY],["fullyVisible",()=>new vY],["partiallyVisible",()=>new KN]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new TY:new xY],["fullyVisible",()=>new mY],["partiallyVisible",()=>new GN]]),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=nn(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 An(this.wtTable.holder)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=nn(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+=Gt(r),r=r.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}createRowsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:n,wtTable:r}=this;let i=this.getViewportHeight(),o,s;this.rowHeaderWidth=NaN;let a=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const l=n.getSetting("fixedRowsTop"),u=n.getSetting("fixedRowsBottom"),c=n.getSetting("totalRows");return l&&a>=0&&(s=this.dataAccessObject.topOverlay.sumCellSizes(0,l),a+=s,i-=s),u&&this.dataAccessObject.bottomOverlay.clone&&(s=this.dataAccessObject.bottomOverlay.sumCellSizes(c-u,c),i-=s),r.holder.clientHeight===r.holder.offsetHeight?o=0:o=vn(this.domBindings.rootDocument),new BY({calculationTypes:e.map(h=>[h,this.rowsCalculatorTypes.get(h)()]),viewportHeight:i,scrollOffset:a,totalRows:n.getSetting("totalRows"),defaultRowHeight:this.instance.stylesHandler.getDefaultRowHeight(),rowHeightFn:h=>r.getRowHeight(h),overrideFn:n.getSettingPure("viewportRowCalculatorOverride"),horizontalScrollbarHeight:o})}createColumnsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:n,wtTable:r}=this;let i=this.getViewportWidth(),o=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const s=n.getSetting("fixedColumnsStart");if(s&&o>=0){const a=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,s);o+=a,i-=a}return r.holder.clientWidth!==r.holder.offsetWidth&&(i-=vn(this.domBindings.rootDocument)),new FY({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(){He(this.hasOversizedColumnHeadersMarked,(e,n,r)=>{r[n]=void 0})}}function Z2(t,e){lD(t,e),e.add(t)}function El(t,e,n){lD(t,e),e.set(t,n)}function lD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yt(t,e){return t.get(xo(t,e))}function Oo(t,e,n){return t.set(xo(t,e),n),n}function xo(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 IO=23;var cs=new WeakMap,ia=new WeakMap,a0=new WeakMap,fR=new WeakMap,Ba=new WeakMap,Id=new WeakMap,af=new WeakMap,fs=new WeakSet;class J2{constructor(e){Z2(this,fs),El(this,cs,void 0),El(this,ia,void 0),El(this,a0,void 0),El(this,fR,void 0),El(this,Ba,!0),El(this,Id,{}),El(this,af,{}),Oo(ia,this,e.rootTable.parentElement.parentElement),Oo(fR,this,e.rootDocument)}isClassicTheme(){return yt(Ba,this)}getCSSVariableValue(e){var n;if(yt(Ba,this))return null;if(yt(Id,this)[`--ht-${e}`])return yt(Id,this)[`--ht-${e}`];const r=(n=xo(fs,this,nK).call(this,`--ht-${e}`))!==null&&n!==void 0?n:xo(fs,this,uD).call(this,`--ht-${e}`);if(r!==null)return yt(Id,this)[`--ht-${e}`]=r,r}getStyleForTD(e){var n;return(n=yt(af,this))===null||n===void 0?void 0:n.td[e]}getDefaultRowHeight(){if(yt(Ba,this))return IO;const e=xo(fs,this,Q2).call(this);return!e&&Ce(yt(ia,this),"ht-wrapper")?(Xe(`The "${yt(cs,this)}" theme is enabled, but its stylesheets are missing or not imported correctly. Import the correct CSS files in order to use that theme.`),Oo(Ba,this,!0),this.useTheme(),IO):e}areCellsBorderBox(){return this.getStyleForTD("box-sizing")==="border-box"}useTheme(e){if(!e){xo(fs,this,PO).call(this),Oo(Ba,this,!0),Oo(cs,this,e||void 0);return}e&&e!==yt(cs,this)&&(yt(cs,this)&&xo(fs,this,rK).call(this),Oo(cs,this,e),Oo(Ba,this,!1),xo(fs,this,eK).call(this),xo(fs,this,PO).call(this))}getThemeName(){return yt(cs,this)}removeClassNames(){Ce(yt(ia,this),yt(cs,this))&&we(yt(ia,this),yt(cs,this))}}function Q2(){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 eK(){we(yt(ia,this),/ht-theme-.*/g),Y(yt(ia,this),yt(cs,this))}function PO(){this.isClassicTheme()||Oo(a0,this,getComputedStyle(yt(ia,this)));const t=xo(fs,this,tK).call(this,["box-sizing","border-bottom-width"]);yt(af,this).td={...yt(af,this).td,"box-sizing":t["box-sizing"],"border-bottom-width":t["border-bottom-width"]}}function tK(t){const e=yt(fR,this),n=yt(ia,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 nK(t){const e=Math.ceil(parseFloat(xo(fs,this,uD).call(this,t)));return Number.isNaN(e)?null:e}function uD(t){const e=yt(a0,this).getPropertyValue(t);return e===""?null:e}function rK(){Oo(af,this,{}),Oo(Id,this,{}),Oo(Ba,this,!0)}class iK extends qE{constructor(e,n){super(e,new q2(n)),this.stylesHandler=new J2(this.domBindings);const r=this.wtSettings.getSetting("facade",this);this.wtTable=new s0(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=new X2(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new A2(this.wtSettings.getSetting("selections")),this.wtEvent=new QN(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new Y2(this,r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},n=[],r=[];He(e,(i,o)=>{this.wtSettings.getSetting(o).length&&r.push(i),n.push(i)}),we(this.wtTable.wtRootElement.parentNode,n),Y(this.wtTable.wtRootElement.parentNode,r)}getOverlayByName(e){var n;if(!nD.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 l0{constructor(e){e instanceof qE?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=n=>{const r=new l0(n);return()=>r},this._wot=new iK(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()}}function OO(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 oK(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 sK=new Map([["mousedown",OO],["mouseover",oK],["touchstart",OO]]);function xO(t,e){let{coords:n,selection:r,controller:i,cellCoordsFactory:o}=e;sK.get(t.type)({coords:n,selection:r,controller:i,cellCoordsFactory:o,isShiftKey:t.shiftKey,isLeftClick:BE(t)||t.type==="touchstart",isRightClick:bu(t)})}const cD=new WeakMap,u0=Symbol("rootInstance");function aK(t){cD.set(t,!0)}function lK(t){return t===u0}function Wm(t){return cD.has(t)}function uK(t,e){hD(t,e),e.add(t)}function Ia(t,e,n){hD(t,e),e.set(t,n)}function hD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pa(t,e,n){return(e=cK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cK(t){var e=hK(t,"string");return typeof e=="symbol"?e:e+""}function hK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zt(t,e){return t.get(jc(t,e))}function nr(t,e,n){return t.set(jc(t,e),n),n}function jc(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 eb=new WeakMap,gg=new WeakMap,mg=new WeakMap,$s=new WeakMap,wo=new WeakMap,tb=new WeakMap,nb=new WeakMap,Gu=new WeakMap,Pd=new WeakSet;class dK{constructor(e){uK(this,Pd),Pa(this,"hot",void 0),Pa(this,"eventManager",void 0),Pa(this,"settings",void 0),Pa(this,"THEAD",void 0),Pa(this,"TBODY",void 0),Pa(this,"_wt",void 0),Pa(this,"activeWt",void 0),Ia(this,eb,0),Ia(this,gg,0),Pa(this,"postponedAdjustElementsSize",!1),Ia(this,mg,!1),Ia(this,$s,void 0),Ia(this,wo,void 0),Ia(this,tb,0),Ia(this,nb,0),Ia(this,Gu,null),this.hot=e,this.eventManager=new Fo(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){this.hot.isRenderSuspended()||(this.hot.runHooks("beforeRender",this.hot.forceFullRender),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize()),this._wt.draw(!this.hot.forceFullRender),jc(Pd,this,gK).call(this),this.hot.runHooks("afterRender",this.hot.forceFullRender),this.hot.forceFullRender=!1,this.hot.renderCall=!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),Y(e,"handsontable"),nr(wo,this,n.createElement("TABLE")),Y(zt(wo,this),"htCore"),this.hot.getSettings().tableClassName&&Y(zt(wo,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(be(zt(wo,this),[Es()]),be(e,[hU(),dN(-1),gw(this.hot.countCols()),TU()])),this.THEAD=n.createElement("THEAD"),zt(wo,this).appendChild(this.THEAD),this.TBODY=n.createElement("TBODY"),zt(wo,this).appendChild(this.TBODY),this.hot.table=zt(wo,this),this.hot.container.insertBefore(zt(wo,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=>{nr(mg,this,!0),this.isTextSelectionAllowed(a.target)||(gP(i),a.preventDefault(),i.focus())}),this.eventManager.addEventListener(e,"mouseup",()=>{nr(mg,this,!1)}),this.eventManager.addEventListener(e,"mousemove",a=>{zt(mg,this)&&!this.isTextSelectionAllowed(a.target)&&(this.settings.fragmentSelection&&gP(i),a.preventDefault())}),this.eventManager.addEventListener(o,"keyup",a=>{r.isInProgress()&&!a.shiftKey&&r.finish()}),this.eventManager.addEventListener(o,"mouseup",a=>{r.isInProgress()&&BE(a)&&r.finish(),nr($s,this,!1);const l=EN(n.activeElement);Vm(n.activeElement)&&!l||(l||!r.isSelected()&&!r.isSelectedByAnyHeader()&&!e.contains(a.target)&&!bu(a))&&this.hot.unlisten()}),this.eventManager.addEventListener(o,"contextmenu",a=>{r.isInProgress()&&bu(a)&&(r.finish(),nr($s,this,!1))}),this.eventManager.addEventListener(o,"touchend",()=>{r.isInProgress()&&r.finish(),nr($s,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(zt($s,this)||!e||!this.hot.view)return;const{holder:d}=this._wt.wtTable;if(h===d){const m=vn(n);if(n.elementFromPoint(u+m,c)!==d||n.elementFromPoint(u,c+m)!==d)return}else for(;h!==o;){if(h===null){if(a.isTargetWebComponent)break;return}if(h===e)return;h=h.parentNode}(typeof this.settings.outsideClickDeselects=="function"?this.settings.outsideClickDeselects(l):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)});let s=Kc(i);for(;s!==null;)this.eventManager.addEventListener(s.document.documentElement,"click",()=>{this.hot.unlisten()}),s=Kc(s);this.eventManager.addEventListener(zt(wo,this),"selectstart",a=>{this.settings.fragmentSelection||Vm(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&&Y(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&&we(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:zt(wo,this),isDataViewInstance:()=>Wm(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),nr(gg,this,o.length),this.hot.getSettings().ariaTags&&jc(Pd,this,dD).call(this)===this.hot.countCols()&&jc(Pd,this,fK).call(this,zt(gg,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),nr(eb,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 C=this.hot.getDataAtRowProp(h,m);this.hot.hasHook("beforeValueRender")&&(C=this.hot.runHooks("beforeValueRender",C,f)),this.hot.runHooks("beforeRenderer",a,l,u,m,C,f),this.hot.getCellRenderer(f)(this.hot,a,l,u,m,C,f),this.hot.runHooks("afterRenderer",a,l,u,m,C,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&&qc(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,nr($s,this,!0),nr(Gu,this,{x:o.clientX,y:o.clientY}),this.hot.runHooks("beforeOnCellMouseDown",o,u,a,c),!au(o)&&(xO(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,nr($s,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",o,u,a),!au(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),!au(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),!au(o)&&(zt($s,this)&&(!zt(Gu,this)||zt(Gu,this).x!==o.clientX||zt(Gu,this).y!==o.clientY)&&xO(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,nr(Gu,this,null))},onCellMouseUp:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",o,u,a),!(au(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,C,w,S]=f;return[m>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(m,1)):m,C>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(C,1)):C,w>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(w,-1)):w,S>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(S,-1)):S]}},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 l0(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.forceFullRender=!0,this.render())})}isTextSelectionAllowed(e){if(Vm(e))return!0;const n=wu(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 zt($s,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(!Ce(r,"relative")){ma(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;Ce(s,"relative")?(this.updateCellHeader(s.querySelector(".colHeader"),e,r,i),s.className="",Y(s,["relative",...o()])):(ma(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&&(be(a,...Es()),be(l,...Es())),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&&(Ce(e,"colHeader")?o=s.wtTable.columnFilter.sourceToRendered(n):Ce(e,"rowHeader")&&(o=s.wtTable.rowFilter.sourceToRendered(n))),o>-1?fh(e,r(n,i)):(yu(e," "),Y(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){nr(tb,this,e),nr(nb,this,n)}getLastSize(){return{width:zt(tb,this),height:zt(nb,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 zt(eb,this)}getRowHeadersCount(){return zt(gg,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 dD(){return parseInt(this.hot.rootElement.getAttribute(gw()[0]),10)}function fK(t){const e=jc(Pd,this,dD).call(this)+t;be(this.hot.rootElement,...gw(e))}function gK(){const t=this.hot.rootElement;this.hasVerticalScroll()?Y(t,"htHasScrollY"):we(t,"htHasScrollY"),this.hasHorizontalScroll()?Y(t,"htHasScrollX"):we(t,"htHasScrollX")}var AO={},HO={},NO;function mK(){if(NO)return HO;NO=1;var t=dt(),e=lh(),n=gr(),r=sn(),i=Ps();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}}),HO}var DO;function pK(){return DO||(DO=1,mK()),AO}pK();const wK="ABCDEFGHIJKLMNOPQRSTUVWXYZ",kO=wK.length;function vK(t){let e=t+1,n="",r;for(;e>0;)r=(e-1)%kO,n=String.fromCharCode(65+r)+n,e=parseInt((e-r)/kO,10);return n}function fD(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 gD(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&Ae(t[0])&&(e=WE(t[0]))),e}function CK(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function yK(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function Wh(t,e,n){return(e=bK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bK(t){var e=SK(t,"string");return typeof e=="symbol"?e:e+""}function SK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 RK{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];Wh(this,"hot",void 0),Wh(this,"data",void 0),Wh(this,"dataType","array"),Wh(this,"colToProp",()=>{}),Wh(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 M(this.data,(r,i)=>{const o=this.getAtCell(i,e);n.push(o)}),n}getAtRow(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const o=n===void 0&&r===void 0,{dataDotNotation:s}=this.hot.getSettings();let a=null,l=null;if(a=this.modifyRowData(e),Array.isArray(a))l=[],o?a.forEach((u,c)=>{l[c]=this.getAtPhysicalCell(e,c,a)}):fe(n,r,u=>{l[u-n]=this.getAtPhysicalCell(e,u,a)});else if(Ae(a)||mt(a))if(i?l=[]:l={},!o||i){const c=this.countFirstRowKeys()-1;fe(0,c,h=>{const d=this.colToProp(h);if(h>=(n||0)&&h<=(r||c)&&!Number.isInteger(d)){const f=this.getAtPhysicalCell(e,d,a);i?l.push(f):s?Iy(l,d,f):l[d]=f}})}else He(a,(u,c)=>{const h=this.getAtPhysicalCell(e,c,a);s?Iy(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=Bi(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:Iy(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?qU(r,n):r[n]}else typeof n=="function"?i=n(r):i=r[n];if(this.hot.hasHook("modifySourceData")){const o=Bi(i);this.hot.runHooks("modifySourceData",e,n,o,"get"),o.isTouched()&&(i=o.value)}return i}getAtCell(e,n){const r=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(n),r)}getByRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=!1,o=null,s=null,a=null,l=null;e===null||n===null?(i=!0,o=0,a=this.countRows()-1):(o=Math.min(e.row,n.row),s=Math.min(e.col,n.col),a=Math.max(e.row,n.row),l=Math.max(e.col,n.col));const u=[];return fe(o,a,c=>{u.push(i?this.getAtRow(c,void 0,void 0,r):this.getAtRow(c,s,l,r))}),u}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return gD(this.data)}destroy(){this.data=null,this.hot=null}}var LO={},$O={},FO;function EK(){if(FO)return $O;FO=1;var t=dt(),e=lh(),n=gr(),r=sn(),i=Ps();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}}),$O}var VO;function TK(){return VO||(VO=1,EK()),LO}TK();function WO(t,e,n){return(e=_K(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _K(t){var e=MK(t,"string");return typeof e=="symbol"?e:e+""}function MK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Du{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;WO(this,"indexedValues",[]),WO(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,mt(this.initValueOrFn)?fe(e-1,n=>this.indexedValues.push(this.initValueOrFn(n))):fe(e-1,()=>this.indexedValues.push(this.initValueOrFn)),this.runLocalHooks("change")}init(e){return this.setDefaultValues(e),this.runLocalHooks("init"),this}insert(){this.runLocalHooks("change")}remove(){this.runLocalHooks("change")}destroy(){this.clearLocalHooks(),this.indexedValues=null,this.initValueOrFn=null}}lt(Du,Rn);function c0(t,e,n,r){const i=n.length?n[0]:void 0;return[...t.slice(0,i),...n.map((o,s)=>mt(r)?r(o,s):r),...i===void 0?[]:t.slice(i)]}function h0(t,e){return vu(t,(n,r)=>e.includes(r)===!1)}class ml extends Du{insert(e,n){this.indexedValues=c0(this.indexedValues,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){this.indexedValues=h0(this.indexedValues,e),super.remove(e)}}class Sw extends ml{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return mr(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}function d0(t,e,n){return[...t.slice(0,e),...n,...t.slice(e)]}function lf(t,e){return vu(t,n=>e.includes(n)===!1)}function f0(t,e){return je(t,n=>n-e.filter(r=>r<n).length)}function g0(t,e){const n=e[0],r=e.length;return je(t,i=>i>=n?i+r:i)}function IK(t,e,n){return(e=PK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function PK(t){var e=OK(t,"string");return typeof e=="symbol"?e:e+""}function OK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Rw extends Du{constructor(){super(...arguments),IK(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=lf(this.orderOfIndexes,[e]),mt(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=c0(this.indexedValues,e,n,this.initValueOrFn),this.orderOfIndexes=g0(this.orderOfIndexes,n),super.insert(e,n)}remove(e){this.indexedValues=h0(this.indexedValues,e),this.orderOfIndexes=lf(this.orderOfIndexes,e),this.orderOfIndexes=f0(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class $f extends ml{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return mr(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}const BO=new Map([["indexesSequence",{getListWithInsertedItems:d0,getListWithRemovedItems:lf}],["physicallyIndexed",{getListWithInsertedItems:c0,getListWithRemovedItems:h0}]]),mD=t=>{if(BO.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return BO.get(t)};class pD extends Du{constructor(){super(e=>e)}insert(e,n){const r=g0(this.indexedValues,n);this.indexedValues=d0(r,e,n),super.insert(e,n)}remove(e){const n=lf(this.indexedValues,e);this.indexedValues=f0(n,e),super.remove(e)}}const jO=new Map([["hiding",Sw],["index",Du],["linkedPhysicalIndexToValue",Rw],["physicalIndexToValue",ml],["trimming",$f]]);function xK(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!jO.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(jO.get(t))(e)}function AK(t,e,n){return(e=HK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function HK(t){var e=NK(t,"string");return typeof e=="symbol"?e:e+""}function NK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class m0{constructor(){AK(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);se(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 _t(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)})}}lt(m0,Rn);function rb(t,e,n){return(e=DK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function DK(t){var e=kK(t,"string");return typeof e=="symbol"?e:e+""}function kK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 UO extends m0{constructor(e,n){super(),rb(this,"mergedValuesCache",[]),rb(this,"aggregationFunction",void 0),rb(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=n}getMergedValues(){if((arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0)return this.mergedValuesCache;if(this.getLength()===0)return[];const n=je(this.get(),o=>o.getValues()),r=[],i=se(n[0])&&n[0].length||0;for(let o=0;o<i;o+=1){const s=[];for(let a=0;a<this.getLength();a+=1)s.push(n[a][o]);r.push(s)}return je(r,this.aggregationFunction)}getMergedValueAtIndex(e,n){const r=this.getMergedValues(n)[e];return se(r)?r:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function LK(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 FK(t,e,n){return t.set(wD(t,e),n),n}function VK(t,e){return t.get(wD(t,e))}function wD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ib=new WeakMap;class vD{constructor(){LK(this,ib,[])}subscribe(e){return this.addLocalHook("change",e),this._write(VK(ib,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){FK(ib,this,e)}}lt(vD,Rn);function zO(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 Bh(t,e,n){WK(t,e),e.set(t,n)}function WK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ki(t,e){return t.get(CD(t,e))}function pg(t,e,n){return t.set(CD(t,e),n),n}function CD(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 wg=new WeakMap,jh=new WeakMap,vg=new WeakMap,Cg=new WeakMap,yg=new WeakMap;class BK{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Bh(this,wg,new Set),Bh(this,jh,[]),Bh(this,vg,[]),Bh(this,Cg,!1),Bh(this,yg,!1),pg(yg,this,e??!1)}createObserver(){const e=new vD;return Ki(wg,this).add(e),e.addLocalHook("unsubscribe",()=>{Ki(wg,this).delete(e)}),e._writeInitialChanges(zO(Ki(jh,this),Ki(vg,this))),e}emit(e){let n=Ki(vg,this);(!Ki(Cg,this)||Ki(jh,this).length!==e.length)&&(e.length===0?e=new Array(n.length).fill(Ki(yg,this)):pg(jh,this,new Array(e.length).fill(Ki(yg,this))),Ki(Cg,this)||(pg(Cg,this,!0),n=Ki(jh,this)));const r=zO(n,e);Ki(wg,this).forEach(i=>i._write(r)),pg(vg,this,e)}}function Ln(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 gR{constructor(){Ln(this,"indexesSequence",new pD),Ln(this,"trimmingMapsCollection",new UO(e=>e.some(n=>n===!0),!1)),Ln(this,"hidingMapsCollection",new UO(e=>e.some(n=>n===!0),!1)),Ln(this,"variousMapsCollection",new m0),Ln(this,"hidingChangesObservable",new BK({initialIndexValue:!1})),Ln(this,"notTrimmedIndexesCache",[]),Ln(this,"notHiddenIndexesCache",[]),Ln(this,"isBatched",!1),Ln(this,"indexesSequenceChanged",!1),Ln(this,"indexesChangeSource",void 0),Ln(this,"trimmedIndexesChanged",!1),Ln(this,"hiddenIndexesChanged",!1),Ln(this,"renderablePhysicalIndexesCache",[]),Ln(this,"fromPhysicalToVisualIndexesCache",new Map),Ln(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,xK(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 $f?this.trimmingMapsCollection.register(e,n):n instanceof Sw?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 se(n)?n:null}getPhysicalFromRenderableIndex(e){const n=this.renderablePhysicalIndexesCache[e];return se(n)?n:null}getVisualFromPhysicalIndex(e){const n=this.fromPhysicalToVisualIndexesCache.get(e);return se(n)?n:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const n=this.fromVisualToRenderableIndexesCache.get(e);return se(n)?n:null}getNearestNotHiddenIndex(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.getPhysicalFromVisualIndex(e)===null)return null;if(this.fromVisualToRenderableIndexesCache.has(e))return e;const o=Array.from(this.fromVisualToRenderableIndexesCache.keys());let s=-1;return n>0?s=o.findIndex(a=>a>e):s=o.reverse().findIndex(a=>a<e),s===-1?r?this.getNearestNotHiddenIndex(e,-n,!1):null:o[s]}initToLength(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getNumberOfIndexes();this.notTrimmedIndexesCache=[...new Array(e).keys()],this.notHiddenIndexesCache=[...new Array(e).keys()],this.suspendOperations(),this.indexesChangeSource="init",this.indexesSequence.init(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.initEvery(e),this.resumeOperations(),this.suspendOperations(),this.hidingMapsCollection.initEvery(e),this.variousMapsCollection.initEvery(e),this.resumeOperations(),this.runLocalHooks("init")}fitToLength(e){const n=this.getNumberOfIndexes();if(e<n){const r=[...Array(this.getNumberOfIndexes()-e).keys()].map(i=>i+e);this.removeIndexes(r)}else this.insertIndexes(n,e-n)}getIndexesSequence(){return this.indexesSequence.getValues()}setIndexesSequence(e){this.indexesChangeSource===void 0&&(this.indexesChangeSource="update"),this.indexesSequence.setValues(e),this.indexesChangeSource==="update"&&(this.indexesChangeSource=void 0)}getNotTrimmedIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notTrimmedIndexesCache:this.getIndexesSequence().filter(r=>this.isTrimmed(r)===!1)}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notHiddenIndexesCache:this.getIndexesSequence().filter(r=>this.isHidden(r)===!1)}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(r=>this.isHidden(r)===!1)}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,n){typeof e=="number"&&(e=[e]);const r=je(e,u=>this.getPhysicalFromVisualIndex(u)),i=this.getNotTrimmedIndexesLength(),o=e.length,s=lf(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(d0(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=se(r)?r:this.getNumberOfIndexes(),o=this.getIndexesSequence().includes(r)?this.getIndexesSequence().indexOf(r):this.getNumberOfIndexes(),s=je(new Array(n).fill(i),(a,l)=>a+l);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(o,s),this.indexesChangeSource=void 0,this.trimmingMapsCollection.insertToEvery(o,s),this.hidingMapsCollection.insertToEvery(o,s),this.variousMapsCollection.insertToEvery(o,s),this.resumeOperations()}removeIndexes(e){this.suspendOperations(),this.indexesChangeSource="remove",this.indexesSequence.remove(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.removeFromEvery(e),this.hidingMapsCollection.removeFromEvery(e),this.variousMapsCollection.removeFromEvery(e),this.resumeOperations()}updateCache(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(e===!0||this.isBatched===!1&&n===!0)&&(this.trimmingMapsCollection.updateCache(),this.hidingMapsCollection.updateCache(),this.notTrimmedIndexesCache=this.getNotTrimmedIndexes(!1),this.notHiddenIndexesCache=this.getNotHiddenIndexes(!1),this.renderablePhysicalIndexesCache=this.getRenderableIndexes(!1),this.cacheFromPhysicalToVisualIndexes(),this.cacheFromVisualToRenderableIndexes(),this.hiddenIndexesChanged&&this.hidingChangesObservable.emit(this.hidingMapsCollection.getMergedValues()),this.runLocalHooks("cacheUpdated",{indexesSequenceChanged:this.indexesSequenceChanged,trimmedIndexesChanged:this.trimmedIndexesChanged,hiddenIndexesChanged:this.hiddenIndexesChanged}),this.indexesSequenceChanged=!1,this.trimmedIndexesChanged=!1,this.hiddenIndexesChanged=!1)}cacheFromPhysicalToVisualIndexes(){const e=this.getNotTrimmedIndexesLength();this.fromPhysicalToVisualIndexesCache.clear();for(let n=0;n<e;n+=1){const r=this.getPhysicalFromVisualIndex(n);this.fromPhysicalToVisualIndexesCache.set(r,n)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let n=0;n<e;n+=1){const r=this.getPhysicalFromRenderableIndex(n),i=this.getVisualFromPhysicalIndex(r);this.fromVisualToRenderableIndexesCache.set(i,n)}}}lt(gR,Rn);function zK(t,e){return He(e,(n,r)=>{_t(t[r])&&(t[r]=n)}),t}function yD(t){const n=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return n?`${n[1].toLowerCase()}-${n[2].toUpperCase()}`:t}function bD(t){se(t)&&jE(tt`Language with code "${t}" was not found. You should register particular language\x20
|
|
45
|
-
before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function YK(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:GK,getValues:KK}=Uo("phraseFormatters");function qK(t,e){GK(t,e)}function XK(){return KK()}qK("pluralize",YK);const SD="ContextMenu:items",_e=SD,Ew=`${_e}.noItems`,pr=`${_e}.insertRowAbove`,wr=`${_e}.insertRowBelow`,vr=`${_e}.insertColumnOnTheLeft`,Cr=`${_e}.insertColumnOnTheRight`,yr=`${_e}.removeRow`,br=`${_e}.removeColumn`,Sr=`${_e}.undo`,Rr=`${_e}.redo`,qn=`${_e}.readOnly`,Er=`${_e}.clearColumn`,Tr=`${_e}.copy`,Sa=`${_e}.copyWithHeaders`,Ra=`${_e}.copyWithGroupHeaders`,Ea=`${_e}.copyHeadersOnly`,_r=`${_e}.cut`,Mr=`${_e}.freezeColumn`,Ir=`${_e}.unfreezeColumn`,Pr=`${_e}.mergeCells`,Or=`${_e}.unmergeCells`,xr=`${_e}.addComment`,Ar=`${_e}.editComment`,Hr=`${_e}.removeComment`,Nr=`${_e}.readOnlyComment`,Dr=`${_e}.align`,kr=`${_e}.align.left`,Lr=`${_e}.align.center`,$r=`${_e}.align.right`,Fr=`${_e}.align.justify`,Vr=`${_e}.align.top`,Wr=`${_e}.align.middle`,Br=`${_e}.align.bottom`,jr=`${_e}.borders`,Ur=`${_e}.borders.top`,zr=`${_e}.borders.right`,Yr=`${_e}.borders.bottom`,Gr=`${_e}.borders.left`,Kr=`${_e}.borders.remove`,qr=`${_e}.nestedHeaders.insertChildRow`,Xr=`${_e}.nestedHeaders.detachFromParent`,Zr=`${_e}.hideColumn`,Jr=`${_e}.showColumn`,Qr=`${_e}.hideRow`,ei=`${_e}.showRow`,Zn="Filters:",Dt=`${Zn}conditions`,Jn=`${Dt}.none`,ti=`${Dt}.isEmpty`,ni=`${Dt}.isNotEmpty`,ri=`${Dt}.isEqualTo`,ii=`${Dt}.isNotEqualTo`,oi=`${Dt}.beginsWith`,si=`${Dt}.endsWith`,ai=`${Dt}.contains`,li=`${Dt}.doesNotContain`,ZK=`${Dt}.byValue`,ui=`${Dt}.greaterThan`,ci=`${Dt}.greaterThanOrEqualTo`,hi=`${Dt}.lessThan`,di=`${Dt}.lessThanOrEqualTo`,fi=`${Dt}.isBetween`,gi=`${Dt}.isNotBetween`,mi=`${Dt}.after`,pi=`${Dt}.before`,wi=`${Dt}.today`,vi=`${Dt}.tomorrow`,Ci=`${Dt}.yesterday`,yi=`${Zn}labels.filterByCondition`,bi=`${Zn}labels.filterByValue`,Si=`${Zn}labels.conjunction`,Qn=`${Zn}labels.disjunction`,Xn=`${Zn}values.blankCells`,Ri=`${Zn}buttons.selectAll`,Ei=`${Zn}buttons.clear`,Ti=`${Zn}buttons.ok`,_i=`${Zn}buttons.cancel`,Mi=`${Zn}buttons.placeholder.search`,Ii=`${Zn}buttons.placeholder.value`,Pi=`${Zn}buttons.placeholder.secondValue`,p0="CheckboxRenderer:",Tw=`${p0}checked`,_w=`${p0}unchecked`,JK=Object.freeze(Object.defineProperty({__proto__:null,CHECKBOX_CHECKED:Tw,CHECKBOX_RENDERER_NAMESPACE:p0,CHECKBOX_UNCHECKED:_w,CONTEXTMENU_ITEMS_ADD_COMMENT:xr,CONTEXTMENU_ITEMS_ALIGNMENT:Dr,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:Br,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:Lr,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:Fr,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:kr,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:Wr,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:$r,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:Vr,CONTEXTMENU_ITEMS_BORDERS:jr,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:Yr,CONTEXTMENU_ITEMS_BORDERS_LEFT:Gr,CONTEXTMENU_ITEMS_BORDERS_RIGHT:zr,CONTEXTMENU_ITEMS_BORDERS_TOP:Ur,CONTEXTMENU_ITEMS_CLEAR_COLUMN:Er,CONTEXTMENU_ITEMS_COPY:Tr,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:Ea,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:Ra,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:Sa,CONTEXTMENU_ITEMS_CUT:_r,CONTEXTMENU_ITEMS_EDIT_COMMENT:Ar,CONTEXTMENU_ITEMS_FREEZE_COLUMN:Mr,CONTEXTMENU_ITEMS_HIDE_COLUMN:Zr,CONTEXTMENU_ITEMS_HIDE_ROW:Qr,CONTEXTMENU_ITEMS_INSERT_LEFT:vr,CONTEXTMENU_ITEMS_INSERT_RIGHT:Cr,CONTEXTMENU_ITEMS_MERGE_CELLS:Pr,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:Xr,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:qr,CONTEXTMENU_ITEMS_NO_ITEMS:Ew,CONTEXTMENU_ITEMS_READ_ONLY:qn,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:Nr,CONTEXTMENU_ITEMS_REDO:Rr,CONTEXTMENU_ITEMS_REMOVE_BORDERS:Kr,CONTEXTMENU_ITEMS_REMOVE_COLUMN:br,CONTEXTMENU_ITEMS_REMOVE_COMMENT:Hr,CONTEXTMENU_ITEMS_REMOVE_ROW:yr,CONTEXTMENU_ITEMS_ROW_ABOVE:pr,CONTEXTMENU_ITEMS_ROW_BELOW:wr,CONTEXTMENU_ITEMS_SHOW_COLUMN:Jr,CONTEXTMENU_ITEMS_SHOW_ROW:ei,CONTEXTMENU_ITEMS_UNDO:Sr,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:Ir,CONTEXTMENU_ITEMS_UNMERGE_CELLS:Or,CONTEXT_MENU_ITEMS_NAMESPACE:SD,FILTERS_BUTTONS_CANCEL:_i,FILTERS_BUTTONS_CLEAR:Ei,FILTERS_BUTTONS_OK:Ti,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:Mi,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:Pi,FILTERS_BUTTONS_PLACEHOLDER_VALUE:Ii,FILTERS_BUTTONS_SELECT_ALL:Ri,FILTERS_CONDITIONS_AFTER:mi,FILTERS_CONDITIONS_BEFORE:pi,FILTERS_CONDITIONS_BEGINS_WITH:oi,FILTERS_CONDITIONS_BETWEEN:fi,FILTERS_CONDITIONS_BY_VALUE:ZK,FILTERS_CONDITIONS_CONTAINS:ai,FILTERS_CONDITIONS_EMPTY:ti,FILTERS_CONDITIONS_ENDS_WITH:si,FILTERS_CONDITIONS_EQUAL:ri,FILTERS_CONDITIONS_GREATER_THAN:ui,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:ci,FILTERS_CONDITIONS_LESS_THAN:hi,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:di,FILTERS_CONDITIONS_NAMESPACE:Dt,FILTERS_CONDITIONS_NONE:Jn,FILTERS_CONDITIONS_NOT_BETWEEN:gi,FILTERS_CONDITIONS_NOT_CONTAIN:li,FILTERS_CONDITIONS_NOT_EMPTY:ni,FILTERS_CONDITIONS_NOT_EQUAL:ii,FILTERS_CONDITIONS_TODAY:wi,FILTERS_CONDITIONS_TOMORROW:vi,FILTERS_CONDITIONS_YESTERDAY:Ci,FILTERS_DIVS_FILTER_BY_CONDITION:yi,FILTERS_DIVS_FILTER_BY_VALUE:bi,FILTERS_LABELS_CONJUNCTION:Si,FILTERS_LABELS_DISJUNCTION:Qn,FILTERS_NAMESPACE:Zn,FILTERS_VALUES_BLANK_CELLS:Xn},Symbol.toStringTag,{value:"Module"}));/**
|
|
46
|
-
* @preserve
|
|
47
|
-
* Authors: Handsoncode
|
|
48
|
-
* Last updated: Nov 15, 2017
|
|
49
|
-
*
|
|
50
|
-
* Description: Definition file for English - United States language-country.
|
|
51
|
-
*/const w0={languageCode:"en-US",[Ew]:"No available options",[pr]:"Insert row above",[wr]:"Insert row below",[vr]:"Insert column left",[Cr]:"Insert column right",[yr]:["Remove row","Remove rows"],[br]:["Remove column","Remove columns"],[Sr]:"Undo",[Rr]:"Redo",[qn]:"Read only",[Er]:"Clear column",[Dr]:"Alignment",[kr]:"Left",[Lr]:"Center",[$r]:"Right",[Fr]:"Justify",[Vr]:"Top",[Wr]:"Middle",[Br]:"Bottom",[Mr]:"Freeze column",[Ir]:"Unfreeze column",[jr]:"Borders",[Ur]:"Top",[zr]:"Right",[Yr]:"Bottom",[Gr]:"Left",[Kr]:"Remove border(s)",[xr]:"Add comment",[Ar]:"Edit comment",[Hr]:"Delete comment",[Nr]:"Read-only comment",[Pr]:"Merge cells",[Or]:"Unmerge cells",[Tr]:"Copy",[Sa]:["Copy with header","Copy with headers"],[Ra]:["Copy with group header","Copy with group headers"],[Ea]:["Copy header only","Copy headers only"],[_r]:"Cut",[qr]:"Insert child row",[Xr]:"Detach from parent",[Zr]:["Hide column","Hide columns"],[Jr]:["Show column","Show columns"],[Qr]:["Hide row","Hide rows"],[ei]:["Show row","Show rows"],[Jn]:"None",[ti]:"Is empty",[ni]:"Is not empty",[ri]:"Is equal to",[ii]:"Is not equal to",[oi]:"Begins with",[si]:"Ends with",[ai]:"Contains",[li]:"Does not contain",[ui]:"Greater than",[ci]:"Greater than or equal to",[hi]:"Less than",[di]:"Less than or equal to",[fi]:"Is between",[gi]:"Is not between",[mi]:"After",[pi]:"Before",[wi]:"Today",[vi]:"Tomorrow",[Ci]:"Yesterday",[Xn]:"Blank cells",[yi]:"Filter by condition",[bi]:"Filter by value",[Si]:"And",[Qn]:"Or",[Ri]:"Select all",[Ei]:"Clear",[Ti]:"OK",[_i]:"Cancel",[Mi]:"Search",[Ii]:"Value",[Pi]:"Second value",[Tw]:"Checked",[_w]:"Unchecked"},QK=JK,mR=w0.languageCode,{register:eq,getItem:RD,hasItem:tq,getValues:nq}=Uo("languagesDictionaries");v0(w0);function v0(t,e){let n=t,r=e;return Ae(t)&&(r=t,n=r.languageCode),rq(n,r),eq(n,Kn(r)),Kn(r)}function rq(t,e){t!==mR&&zK(e,RD(mR))}function ED(t){return C0(t)?Kn(RD(t)):null}function C0(t){return tq(t)}function iq(){return nq()}function TD(t,e,n){const r=ED(t);if(r===null)return null;const i=r[e];if(_t(i))return null;const o=oq(i,n);return Array.isArray(o)?o[0]:o}function oq(t,e){let n=t;return M(XK(),r=>{n=r(t,e)}),n}function sq(t){let e=yD(t);return C0(e)||(e=mR,bD(t)),e}function aq(t,e,n){return(e=lq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lq(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)}class Ta extends rD{constructor(e,n){super(e,null),aq(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 ob(t){let{activeHeaderClassName:e,...n}=t;return new Ta({className:e,...n,selectionType:iD})}function cq(t){let{areaCornerVisible:e,...n}=t;return new Ta({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...n,selectionType:e0})}function hq(t){let{...e}=t;return new Ta({className:"highlight",...e,selectionType:e0})}function dq(t){let{columnClassName:e,...n}=t;return new Ta({className:e,...n,selectionType:T2})}function fq(t){let{cellCornerVisible:e,...n}=t;return new Ta({className:"current",headerAttributes:[DE()],border:{width:2,color:"#4b89ff",cornerVisible:e},...n,selectionType:gp})}function gq(t){let{border:e,visualCellRange:n,...r}=t;return new Ta({...e,...r,selectionType:_2},n)}function mq(t){let{...e}=t;return new Ta({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:R2})}function YO(t){let{headerClassName:e,...n}=t;return new Ta({className:e,...n,selectionType:QE})}function pq(t){let{rowClassName:e,...n}=t;return new Ta({className:e,...n,selectionType:E2})}function wq(t,e){vq(t,e),e.add(t)}function vq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rr(t,e,n){return(e=Cq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cq(t){var e=yq(t,"string");return typeof e=="symbol"?e:e+""}function yq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Fs(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 WeakSet;class bq{constructor(e){wq(this,Zo),rr(this,"options",void 0),rr(this,"layerLevel",0),rr(this,"focus",void 0),rr(this,"fill",void 0),rr(this,"layeredAreas",new Map),rr(this,"areas",new Map),rr(this,"rowHeaders",new Map),rr(this,"columnHeaders",new Map),rr(this,"activeRowHeaders",new Map),rr(this,"activeColumnHeaders",new Map),rr(this,"activeCornerHeaders",new Map),rr(this,"rowHighlights",new Map),rr(this,"columnHighlights",new Map),rr(this,"customSelections",[]),this.options=e,this.focus=fq(e),this.fill=mq(e)}isEnabledFor(e,n){let r=e;e===gp&&(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 Fs(Zo,this,Vs).call(this,this.layeredAreas,cq)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return Fs(Zo,this,Vs).call(this,this.areas,hq)}getAreas(){return[...this.areas.values()]}createRowHeader(){return Fs(Zo,this,Vs).call(this,this.rowHeaders,YO)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return Fs(Zo,this,Vs).call(this,this.columnHeaders,YO)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return Fs(Zo,this,Vs).call(this,this.activeRowHeaders,ob)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return Fs(Zo,this,Vs).call(this,this.activeColumnHeaders,ob)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return Fs(Zo,this,Vs).call(this,this.activeCornerHeaders,ob)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return Fs(Zo,this,Vs).call(this,this.rowHighlights,pq)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return Fs(Zo,this,Vs).call(this,this.columnHighlights,dq)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(gq({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),M(this.areas.values(),e=>void e.clear()),M(this.layeredAreas.values(),e=>void e.clear()),M(this.rowHeaders.values(),e=>void e.clear()),M(this.columnHeaders.values(),e=>void e.clear()),M(this.activeRowHeaders.values(),e=>void e.clear()),M(this.activeColumnHeaders.values(),e=>void e.clear()),M(this.activeCornerHeaders.values(),e=>void e.clear()),M(this.rowHighlights.values(),e=>void e.clear()),M(this.columnHighlights.values(),e=>void e.clear())}[Symbol.iterator](){return[this.focus,this.fill,...this.areas.values(),...this.layeredAreas.values(),...this.rowHeaders.values(),...this.columnHeaders.values(),...this.activeRowHeaders.values(),...this.activeColumnHeaders.values(),...this.activeCornerHeaders.values(),...this.rowHighlights.values(),...this.columnHighlights.values(),...this.customSelections][Symbol.iterator]()}}function Vs(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 GO(t,e,n){return(e=Sq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sq(t){var e=Rq(t,"string");return typeof e=="symbol"?e:e+""}function Rq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Eq{constructor(e){GO(this,"ranges",[]),GO(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 Tq(t,e){_D(t,e),e.add(t)}function sb(t,e,n){_D(t,e),e.set(t,n)}function _D(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ge(t,e){return t.get(en(t,e))}function bg(t,e,n){return t.set(en(t,e),n),n}function en(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 Sg=new WeakMap,gt=new WeakMap,No=new WeakMap,ln=new WeakSet;class pR{constructor(e,n){Tq(this,ln),sb(this,Sg,void 0),sb(this,gt,void 0),sb(this,No,{x:0,y:0}),bg(Sg,this,e),bg(gt,this,n)}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=Ge(gt,this).createCellCoords(e,n);let o=Ge(Sg,this).current().highlight;const s=Ge(gt,this).visualToRenderableCoords(o);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),s.row!==null&&s.col!==null){const{width:u,height:c}=en(ln,this,MD).call(this),{row:h,col:d}=en(ln,this,qO).call(this,o),f=Ge(gt,this).fixedRowsBottom(),m=Ge(gt,this).minSpareRows(),C=Ge(gt,this).minSpareCols(),w=Ge(gt,this).autoWrapRow(),S=Ge(gt,this).autoWrapCol(),R=Ge(gt,this).createCellCoords(h+i.row,d+i.col);if(R.row>=c){const D=Bi(r&&m>0&&f===0),_=R.col+1,x=Ge(gt,this).createCellCoords(R.row-c,_>=u?_-u:_);this.runLocalHooks("beforeColumnWrap",D,en(ln,this,Ku).call(this,x),_>=u),D.value?this.runLocalHooks("insertRowRequire",Ge(gt,this).countRenderableRows()):S&&R.assign(x)}else if(R.row<0){const D=Bi(S),_=R.col-1,x=Ge(gt,this).createCellCoords(c+R.row,_<0?u+_:_);this.runLocalHooks("beforeColumnWrap",D,en(ln,this,Ku).call(this,x),_<0),S&&R.assign(x)}if(R.col>=u){const D=Bi(r&&C>0),_=R.row+1,x=Ge(gt,this).createCellCoords(_>=c?_-c:_,R.col-u);this.runLocalHooks("beforeRowWrap",D,en(ln,this,Ku).call(this,x),_>=c),D.value?this.runLocalHooks("insertColRequire",Ge(gt,this).countRenderableColumns()):w&&R.assign(x)}else if(R.col<0){const D=Bi(w),_=R.row-1,x=Ge(gt,this).createCellCoords(_<0?c+_:_,u+R.col);this.runLocalHooks("beforeRowWrap",D,en(ln,this,Ku).call(this,x),_<0),w&&R.assign(x)}const{rowDir:I,colDir:O}=en(ln,this,KO).call(this,R);a=I,l=O,o=en(ln,this,Ku).call(this,R)}return this.runLocalHooks("afterTransformStart",o,a,l),o}transformEnd(e,n){const r=Ge(gt,this).createCellCoords(e,n),i=Ge(Sg,this).current(),o=Ge(gt,this).visualToRenderableCoords(i.highlight),s=en(ln,this,ab).call(this,i.to.row,i.from.row),a=en(ln,this,lb).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}=en(ln,this,qO).call(this,i.highlight),f=Ge(gt,this).createCellCoords(s+r.row,a+r.col),m=i.getTopStartCorner(),C=i.getTopEndCorner(),w=i.getBottomEndCorner();if(r.col<0&&a>=d&&f.col<d){const O=f.col-d;f.col=en(ln,this,lb).call(this,m.col,C.col)+O}else if(r.col>0&&a<=d&&f.col>d){const O=en(ln,this,lb).call(this,C.col,m.col),D=Math.max(f.col-O,1);f.col=O+D}if(r.row<0&&s>=h&&f.row<h){const O=f.row-h;f.row=en(ln,this,ab).call(this,m.row,w.row)+O}else if(r.row>0&&s<=h&&f.row>h){const O=en(ln,this,ab).call(this,w.row,m.row),D=Math.max(f.row-O,1);f.row=O+D}const{rowDir:S,colDir:R}=en(ln,this,KO).call(this,f);u=S,c=R;const I=en(ln,this,Ku).call(this,f);r.row===0&&r.col!==0?l.col=I.col:r.row!==0&&r.col===0?l.row=I.row:(l.row=I.row,l.col=I.col)}return this.runLocalHooks("afterTransformEnd",l,u,c),l}setOffsetSize(e){let{x:n,y:r}=e;bg(No,this,{x:n,y:r})}resetOffsetSize(){bg(No,this,{x:0,y:0})}}function KO(t){const{width:e,height:n}=en(ln,this,MD).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 MD(){return{width:Ge(No,this).x+Ge(gt,this).countRenderableColumns(),height:Ge(No,this).y+Ge(gt,this).countRenderableRows()}}function ab(t,e){const n=Ge(gt,this).findFirstNonHiddenRenderableRow(t,e);return n===null?null:Ge(No,this).y+n}function lb(t,e){const n=Ge(gt,this).findFirstNonHiddenRenderableColumn(t,e);return n===null?null:Ge(No,this).x+n}function qO(t){const{row:e,col:n}=Ge(gt,this).visualToRenderableCoords(t);if(e===null||n===null)throw new Error("Renderable coords are not visible.");return Ge(gt,this).createCellCoords(Ge(No,this).y+e,Ge(No,this).x+n)}function Ku(t){const e=t.clone();return e.col=t.col-Ge(No,this).x,e.row=t.row-Ge(No,this).y,Ge(gt,this).renderableToVisualCoords(e)}lt(pR,Rn);const Mw=0,Iw=1,ID=2,y0=3,_q=[y0,ID],Mq=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],ub=Symbol("root"),XO=Symbol("child");function Zc(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ub;if(e!==ub&&e!==XO)throw new Error("The second argument is used internally only and cannot be overwritten.");const n=Array.isArray(t),r=e===ub;let i=Mw;if(n){const o=t[0];t.length===0?i=Iw:r&&o instanceof Df?i=y0:r&&Array.isArray(o)?i=Zc(o,XO):t.length>=2&&t.length<=4&&!t.some((a,l)=>!Mq[l].includes(typeof a))&&(i=ID)}return i}function uf(t){let{createCellCoords:e,createCellRange:n,keepDirection:r=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!_q.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(o){const s=t===y0;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))),_t(u)&&(u=a),_t(c)&&(c=l),!r){const f=a,m=l,C=u,w=c;a=Math.min(f,C),l=Math.min(m,w),u=Math.max(f,C),c=Math.max(m,w)}const h=e(a,l),d=e(u,c);return n(h,h,d)}}function Iq(t){const e=Zc(t.getSelected());if(e===Mw||e===Iw)return[];const n=uf(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;M(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.col,0),c=l.col-u+1;M(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 mr(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function Pq(t){const e=Zc(t.getSelected());if(e===Mw||e===Iw)return[];const n=uf(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;M(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.row,0),c=l.row-u+1;M(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 mr(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function qu(t,e,n){Oq(t,e),e.set(t,n)}function Oq(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=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)}function wt(t,e){return t.get(PD(t,e))}function Jo(t,e,n){return t.set(PD(t,e),n),n}function PD(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 Tn=new WeakMap,_l=new WeakMap,Rg=new WeakMap,Uh=new WeakMap,Eg=new WeakMap,zh=new WeakMap;class OD{constructor(e,n){var r=this;Tl(this,"settings",void 0),Tl(this,"tableProps",void 0),Tl(this,"inProgress",!1),Tl(this,"selectedRange",new Eq((i,o,s)=>this.tableProps.createCellRange(i,o,s))),Tl(this,"highlight",void 0),qu(this,Tn,void 0),qu(this,_l,void 0),Tl(this,"selectedByRowHeader",new Set),Tl(this,"selectedByColumnHeader",new Set),qu(this,Rg,!1),qu(this,Uh,!1),qu(this,Eg,"unknown"),qu(this,zh,-1),this.settings=e,this.tableProps=n,this.highlight=new bq({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[DE()],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)}),Jo(Tn,this,new pR(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})),Jo(_l,this,new pR(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})),wt(Tn,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)}),wt(Tn,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)}),wt(Tn,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)}),wt(Tn,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)}),wt(Tn,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)}),wt(Tn,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)}),wt(Tn,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)}),wt(Tn,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)}),wt(_l,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)}),wt(_l,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){Jo(Eg,this,e)}markEndSource(){Jo(Eg,this,"unknown")}getSelectionSource(){return wt(Eg,this)}setExpectedLayers(e){Jo(zh,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,Jo(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=_t(n)?this.tableProps.getShortcutManager().isCtrlPressed():n,a=e.clone();Jo(Rg,this,!1),this.runLocalHooks(`beforeSetRangeStart${r?"Only":""}`,a),(!o||o&&!s&&_t(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=wt(zh,this)===-1||this.selectedRange.size()===wt(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&&(M(this.highlight.getAreas(),m=>void m.clear()),M(this.highlight.getLayeredAreas(),m=>void m.clear()),M(this.highlight.getRowHeaders(),m=>void m.clear()),M(this.highlight.getColumnHeaders(),m=>void m.clear()),M(this.highlight.getActiveRowHeaders(),m=>void m.clear()),M(this.highlight.getActiveColumnHeaders(),m=>void m.clear()),M(this.highlight.getActiveCornerHeaders(),m=>void m.clear()),M(this.highlight.getRowHighlights(),m=>void m.clear()),M(this.highlight.getColumnHighlights(),m=>void 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(e0,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(QE,e.highlight)){if(!e.isSingleHeader()){const w=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),S=this.tableProps.createCellCoords(e.to.row,-1),R=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),I=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(a.add(w).commit(),l.add(R).commit(),d.add(w).commit(),f.add(R).commit()):(a.add(w).add(S).commit(),l.add(R).add(I).commit(),d.add(w).add(S).commit(),f.add(R).add(I).commit())}const m=!wt(Uh,this)&&this.isEntireRowSelected()&&(i>0&&i===e.getWidth()||i===0&&this.isSelectedByRowHeader()),C=!wt(Uh,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(),C&&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&&C&&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(gp,n.highlight)&&r.add(n.highlight).commit().syncWith(n),this.inProgress||(Jo(Rg,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?wt(Tn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):wt(Tn,this).resetOffsetSize(),this.setRangeStart(wt(Tn,this).transformStart(e,n,r))}transformEnd(e,n){this.settings.navigableHeaders?wt(Tn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):wt(Tn,this).resetOffsetSize(),this.setRangeEnd(wt(Tn,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()?wt(_l,this).setOffsetSize({x:o<0?Math.abs(o):-s,y:i<0?Math.abs(i):-a}):wt(_l,this).setOffsetSize({x:o<0?0:-s,y:i<0?0:-a});const l=wt(_l,this).transformStart(e,n);this.setRangeFocus(l.normalize())}shiftRows(e,n){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||r.getOuterTopStartCorner().row>=e){const{from:i,to:o,highlight:s}=r,a=this.tableProps.countRows(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=u?-1:0,h=u?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(ze(i.row+h,c,a-1),i.col),f=this.tableProps.createCellCoords(ze(o.row+n,c,a-1),o.col);this.markSource("shift"),s.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(ze(s.row+n,0,a-1),s.col)):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}shiftColumns(e,n){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||r.getOuterTopStartCorner().col>=e){const{from:i,to:o,highlight:s}=r,a=this.tableProps.countCols(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=l?-1:0,h=l?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(i.row,ze(i.col+h,c,a-1)),f=this.tableProps.createCellCoords(o.row,ze(o.col+n,c,a-1));this.markSource("shift"),s.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(s.row,ze(s.col+n,0,a-1))):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){if(!this.isSelected())return!1;const e=Bi(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&wt(Rg,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;Jo(Uh,this,f),d&&Number.isInteger(d==null?void 0:d.row)&&Number.isInteger(d==null?void 0:d.col)&&(h=this.tableProps.createCellCoords(ze(d.row,u,o-1),ze(d.col,c,s-1)));const m=this.tableProps.createCellCoords(u,c),C=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(C),this.finish(),Jo(Uh,this,!1)}selectCells(e){var n=this;const r=Zc(e);if(r===Iw)return!1;if(r===Mw)throw new Error(tt`Unsupported format of the selection ranges was passed. To select cells pass\x20
|
|
52
|
-
the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
|
|
53
|
-
columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const i=uf(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),M(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==null?void 0:r.row)&&Number.isInteger(r==null?void 0:r.col)?(f=ze(r.row,u,s-1),m=ze(r.col,Math.min(i,o),Math.max(i,o))):(f=ze(r,u,s-1),m=i);const C=this.tableProps.createCellCoords(f,m),w=l===0?0:ze(C.row,u,-1),S=s-1,R=this.tableProps.createCellCoords(w,i),I=this.tableProps.createCellCoords(S,o);this.runLocalHooks("beforeSelectColumns",R,I,C),R.row=w,I.row=S,this.setRangeStartOnly(R,void 0,C),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(I),this.runLocalHooks("afterSelectColumns",R,I,C),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==null?void 0:r.row)&&Number.isInteger(r==null?void 0:r.col)?(h=ze(r.row,Math.min(e,n),Math.max(e,n)),d=ze(r.col,a,o-1)):(h=e,d=ze(r,a,o-1));const f=this.tableProps.createCellCoords(h,d),m=s===0?0:ze(f.col,a,-1),C=o-1,w=this.tableProps.createCellCoords(e,m),S=this.tableProps.createCellCoords(n,C);this.runLocalHooks("beforeSelectRows",w,S,f),w.col=m,S.col=C,this.setRangeStartOnly(w,void 0,f),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(S),this.runLocalHooks("afterSelectRows",w,S,f),this.finish()}return c}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),n=this.tableProps.countCols();if(e===0||n===0){this.deselect();return}const r=this.selectedRange.peekByIndex(this.selectedRange.size()-1),{from:i,to:o,highlight:s}=r;this.clear(),s.assign({row:ze(s.row,-1/0,e-1),col:ze(s.col,-1/0,n-1)}),i.assign({row:ze(i.row,-1/0,e-1),col:ze(i.col,-1/0,n-1)}),o.assign({row:ze(o.row,0,e-1),col:ze(o.col,0,n-1)}),this.selectedRange.ranges.push(r),this.highlight.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(gp,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)}}lt(OD,Rn);const ZO=/^(\r\n|\n\r|\r|\n)/,Hq=/^[^\t\r\n]+/,JO=/^\t/;function Nq(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(JO))t=t.replace(JO,""),n+=1,e[r][n]="";else if(t.match(ZO))t=t.replace(ZO,""),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(Hq);o=s?s[0]:"",t=t.slice(o.length)}e[r][n]=o}return e}function $d(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(`
|
|
54
|
-
`)>-1?o+=`"${s.replace(/"/g,'""')}"`:o+=s:s==null?o+="":o+=s;e!==n-1&&(o+=`
|
|
55
|
-
`)}return o}function Ml(t,e,n){return(e=Dq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dq(t){var e=kq(t,"string");return typeof e=="symbol"?e:e+""}function kq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Hc{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,n,r){Ml(this,"hot",void 0),Ml(this,"metaManager",void 0),Ml(this,"tableMeta",void 0),Ml(this,"dataSource",void 0),Ml(this,"duckSchema",void 0),Ml(this,"colToPropCache",void 0),Ml(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=WE(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(Ae(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 gD(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)&&He(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&&se(this.colToPropCache[n])?this.colToPropCache[n]:n}propToCol(e){const n=this.propToColCache.get(e);if(se(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]?sf(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=Kn(this.getSchema()):(m=[],fe(h-1,()=>m.push(null))):this.hot.dataType==="function"?m=this.tableMeta.dataSchema(l+a):(m={},ww(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),this.hot.forceFullRender=!0,{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 C=m;for(;f<n&&d<s;){if(typeof l!="number"||l>=d)if(h>0)for(let S=0;S<h;S+=1)typeof o[S]>"u"&&(o[S]=[]),o[S].push(null);else o.push([null]);else for(let S=0;S<h;S++)o[S].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(C,n));const w=this.hot.toVisualColumn(C);return this.hot.runHooks("afterCreateCol",w,f,r),this.hot.forceFullRender=!0,this.refreshDuckSchema(),{delta:f,startPhysicalIndex:C}}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=se(this.tableMeta.columns)||se(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),this.hot.forceFullRender=!0,!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.hot.forceFullRender=!0,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];iP(l,s);let c=0;for(;c<r;)l.push(null),c+=1;return iU(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];iP(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&&tn(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=Bi(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=Bi(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&&tn(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,Hc.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===Hc.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 $d(this.getRange(e,n,Hc.DESTINATION_RENDERER))}getCopyableText(e,n){return $d(this.getRange(e,n,Hc.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}}const{register:Lq,getItem:$q,hasItem:xD,getNames:Sle,getValues:Rle}=Uo("cellTypes");function Fq(t){if(!xD(t))throw Error(`You declared cell type "${t}" as a string that is not mapped to a known object.
|
|
56
|
-
Cell type must be an object or a string mapped to an object registered by
|
|
57
|
-
"Handsontable.cellTypes.registerCellType" method`);return $q(t)}function Ro(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:n,renderer:r,validator:i}=e;n&&Di(t,n),r&&Xi(t,r),i&&Tc(t,i),Lq(t,e)}function Vq(t,e){var n;return t==="CELL_TYPE"?!1:((n=e._automaticallyAssignedMetaProps)===null||n===void 0?void 0:n.has(t))||!tn(e,t)}function Pw(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const r=typeof e.type=="string"?Fq(e.type):e.type;if(t._automaticallyAssignedMetaProps&&He(e,(o,s)=>void t._automaticallyAssignedMetaProps.delete(s)),!Ae(r))return;n===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const i={};He(r,(o,s)=>{if(Vq(s,n)){var a;i[s]=o,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(s)}}),rn(t,i)}function Wq(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function n(){}KU(n,t);for(let r=0;r<e.length;r++)n.prototype[e[r]]=void 0;return n}function Bm(t){return Number.isInteger(t)&&t>=0}function jm(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function Tg(t){return t==null}const AD=()=>({_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),VE(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 QO(t,e,n){return(e=Bq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bq(t){var e=jq(t,"string");return typeof e=="symbol"?e:e+""}function jq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Uq(){return class{}}class zq{constructor(e){QO(this,"metaCtor",Uq()),QO(this,"meta",void 0),this.meta=this.metaCtor.prototype,rn(this.meta,AD()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var n;rn(this.meta,e),Pw(this.meta,{...e,type:(n=e.type)!==null&&n!==void 0?n:this.meta.type},e)}}function Yq(t,e,n){return(e=Gq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gq(t){var e=Kq(t,"string");return typeof e=="symbol"?e:e+""}function Kq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 qq{constructor(e){Yq(this,"meta",void 0);const n=e.getMetaConstructor();this.meta=new n}getMeta(){return this.meta}updateMeta(e){rn(this.meta,e),Pw(this.meta,e,e)}}function _g(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=Zq(t,"string");return typeof e=="symbol"?e:e+""}function Zq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 mp{constructor(e){_g(this,"valueFactory",void 0),_g(this,"data",[]),_g(this,"index",[]),_g(this,"holes",new Set),this.valueFactory=e}obtain(e){jm(()=>Bm(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;jm(()=>Bm(e)||Tg(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=Tg(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;jm(()=>Bm(e)||Tg(e),"Expecting an unsigned number or null/undefined argument.");const r=this.index.splice(Tg(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 ex(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=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)}const e3=["data","width"];class t3{constructor(e){ex(this,"globalMeta",void 0),ex(this,"metas",new mp(()=>this._createMeta())),this.globalMeta=e,this.metas=new mp(()=>this._createMeta())}updateMeta(e,n){const r=this.getMeta(e);rn(r,n),Pw(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 Wq(this.globalMeta.getMetaConstructor(),e3).prototype}}function tx(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(e){tx(this,"columnMeta",void 0),tx(this,"metas",new mp(()=>this._createRow())),this.columnMeta=e}updateMeta(e,n,r){const i=this.getMeta(e,n);rn(i,r),Pw(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++)se(n[r])&&e.push(...n[r].values());return e}getMetasAtRow(e){jm(()=>Bm(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 mp(e=>this._createMeta(e))}_createMeta(e){const n=this.columnMeta.getMetaConstructor(e);return new n}}class HD{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 zq(e),this.tableMeta=new qq(this.globalMeta),this.columnMeta=new t3(this.globalMeta),this.cellMeta=new i3(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){let{visualRow:i,visualColumn:o}=r;const s=this.cellMeta.getMeta(e,n);return s.visualRow=i,s.visualCol=o,s.row=e,s.col=n,this.runLocalHooks("afterGetCellMeta",s),s}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()}}lt(HD,Rn);function nx(t,e,n,r){const{hotInstance:i,dataMap:o,dataSource:s,internalSource:a,source:l,metaManager:u,firstRun:c}=r,h=$o(a),d=i.getSettings();Array.isArray(d.dataSchema)?i.dataType="array":mt(d.dataSchema)?i.dataType="function":i.dataType="object",o&&o.destroy(),t=i.runHooks(`before${h}`,t,c,l);const f=new Hc(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 C,w=0,S=0;for(w=0,S=d.startRows;w<S;w++)if((i.dataType==="object"||i.dataType==="function")&&d.dataSchema)C=Kn(m),t.push(C);else if(i.dataType==="array")C=Kn(m[0]),t.push(C);else{C=[];for(let R=0,I=d.startCols;R<I;R++)C.push(null);t.push(C)}}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&&be(i.rootElement,[dN(-1),gw(i.countCols()+(i.view?i.countRowHeaders():0))])}function rx(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{constructor(e){rx(this,"metaManager",void 0),rx(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",n=>this.extendCellMeta(n)),ie.getSingleton().add("beforeRender",n=>{n&&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=tn(e,"type")?e.type:null;let c=mt(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 l3(t,e,n){u3(t,e),e.set(t,n)}function u3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cb(t,e,n){return(e=c3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c3(t){var e=h3(t,"string");return typeof e=="symbol"?e:e+""}function h3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function d3(t,e){return t.get(f3(t,e))}function f3(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 ix=new WeakMap;class g3{constructor(e){cb(this,"metaManager",void 0),cb(this,"usageTracker",new Set),cb(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}]])),l3(this,ix,(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,d3(ix,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})}}const ND="gridDefault",pl="editorManager.handlingEditor",m3={name:"editorCloseAndSave",callback(t){t._getEditorManager().closeEditorAndSaveChanges()}},p3="hooksRefRegisterer",DD={_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){M(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){He(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};ba(DD,"MIXIN_NAME",p3,{writable:!1,enumerable:!1});function vo(t,e,n){return(e=w3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w3(t){var e=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)}const C3="base",Wt=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class mh{static get EDITOR_TYPE(){return C3}constructor(e){vo(this,"hot",void 0),vo(this,"state",Wt.VIRGIN),vo(this,"_opened",!1),vo(this,"_fullEditMode",!1),vo(this,"_closeCallback",null),vo(this,"TD",null),vo(this,"row",null),vo(this,"col",null),vo(this,"prop",null),vo(this,"originalValue",null),vo(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:Wt.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!==Wt.VIRGIN)return;const r=this.hot,i=r.rowIndexMapper.getRenderableFromVisualIndex(this.row),o=r.columnIndexMapper.getRenderableFromVisualIndex(this.col),s=()=>{if(this.state=Wt.EDITING,this.isInFullEditMode()){const l=typeof e=="string"?e:Kt(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===Wt.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===Wt.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=Wt.WAITING,this.saveValue(i,n),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",s=>{this.state=Wt.FINISHED,this.discardEditor(s)}):(this.state=Wt.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=Wt.FINISHED,this.discardEditor()}discardEditor(e){this.state===Wt.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=Wt.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Wt.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===Wt.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=An(n),a=Gt(n),l=An(this.hot.rootElement),u=Gt(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:C}=(e=r.getParentOverlay(n))!==null&&e!==void 0?e:this.hot.view._wt,w=C.name,S=["master","inline_start"].includes(w)?d:0,R=["master","top","bottom"].includes(w)?f:0,I=s.top===l.top?0:1;let O=s.top-l.top-I-S,D=0;this.hot.isRtl()?D=o.innerWidth-s.left-a-m-1+R:D=s.left-l.left-1-R,["top","top_inline_start_corner"].includes(w)&&(O+=r.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(w)&&(D+=Math.abs(r.inlineStartOverlay.getOverlayOffset()));const _=this.hot.hasColHeaders(),x=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),j=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),U=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(_&&x<=0||x===U)&&(O+=1),j<=0&&(D+=1);const Z=i.rowsRenderCalculator.startPosition,Q=i.columnsRenderCalculator.startPosition,le=Math.abs(r.inlineStartOverlay.getScrollPosition()),te=r.topOverlay.getScrollPosition(),ue=vn(this.hot.rootDocument);let ft=n.offsetTop;if(["inline_start","master"].includes(w)&&(ft+=Z-te),["bottom","bottom_inline_start_corner"].includes(w)){const{wtViewport:K,wtTable:oe}=r.bottomOverlay.clone;ft+=K.getWorkspaceHeight()-oe.getHeight()-ue}let Re=n.offsetLeft;this.hot.isRtl()?(Re>=0?Re=C.getWidth()-n.offsetLeft:Re=Math.abs(Re),Re+=Q-le-a):["top","master","bottom"].includes(w)&&(Re+=Q-le);const Le=o.getComputedStyle(this.TD),Rt=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",Zt=parseInt(Le[Rt],10)>0?0:1,g=parseInt(Le.borderTopWidth,10)>0?0:1,p=Gt(n)+Zt,v=nn(n)+g,E=SN(c)?ue:0,H=RN(h)?ue:0,W=this.hot.view.maximumVisibleElementWidth(Re)-E+Zt,G=Math.max(this.hot.view.maximumVisibleElementHeight(ft)-H+g,this.hot.view.getDefaultRowHeight());return{top:O,start:D,height:v,maxHeight:G,width:p,maxWidth:W}}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}}lt(mh,DD);const y3={name:"editorCloseAndSaveByArrowKeys",callback(t,e,n){const r=t._getEditorManager(),i=r.getActiveEditor();i.isInFullEditMode()&&i.state===Wt.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())}},b3={name:"editorCloseAndSaveByEnter",callback(t,e){const n=t._getEditorManager();n.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),n.moveSelectionAfterEnter(e)}},S3={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},R3={name:"editorFastOpen",callback(t,e){const{highlight:n}=t.getSelectedRangeLast();n.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},E3={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),jo(e))}};function T3(){return[m3,y3,b3,S3,R3,E3]}const _3={name:"extendCellsSelectionDown",callback(t){const{highlight:e}=t.getSelectedRangeLast();!t.selection.isSelectedByColumnHeader()&&!t.selection.isSelectedByCorner()&&(e.isCell()||e.isHeader()&&t.selection.isSelectedByRowHeader())&&t.selection.transformEnd(1,0)}},M3={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{to:e}=t.getSelectedRangeLast(),n=Math.min(e.row+t.countVisibleRows(),t.countRows()-1),r=t.rowIndexMapper.getNearestNotHiddenIndex(n,-1);if(r!==null){const i=t._createCellCoords(r,e.col),o=e.row-t.getFirstFullyVisibleRow(),s=Math.min(i.row-o,t.countRows()-1);t.selection.setRangeEnd(i),t.scrollViewportTo({row:s,verticalSnap:"top",horizontalSnap:"start"})}}},I3={name:"extendCellsSelectionLeft",callback(t){const{highlight:e}=t.getSelectedRangeLast();!t.selection.isSelectedByRowHeader()&&!t.selection.isSelectedByCorner()&&(e.isCell()||e.isHeader()&&t.selection.isSelectedByColumnHeader())&&t.selection.transformEnd(0,-1*t.getDirectionFactor())}},P3={name:"extendCellsSelectionRight",callback(t){const{highlight:e}=t.getSelectedRangeLast();!t.selection.isSelectedByRowHeader()&&!t.selection.isSelectedByCorner()&&(e.isCell()||e.isHeader()&&t.selection.isSelectedByColumnHeader())&&t.selection.transformEnd(0,t.getDirectionFactor())}},O3={name:"extendCellsSelectionToColumns",callback(t){const{highlight:e,from:n,to:r}=t.getSelectedRangeLast();t.selection.isSelectedByRowHeader()?t.selection.selectAll(!0,!0):t.selectColumns(n.col,r.col,e)}},x3={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&t.selection.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(t.countRows()-1,-1),l=i.clone();l.row=r.row,e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col))}}},A3={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast();if(!t.selection.isSelectedByRowHeader()&&!t.selection.isSelectedByCorner()&&r.isCell()){const s=n.getNearestNotHiddenIndex(t.countCols()-1,-1),a=i.clone();a.col=r.col,e.setRangeStart(a,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(o.row,s))}}},H3={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast();if(!t.selection.isSelectedByRowHeader()&&!t.selection.isSelectedByCorner()&&r.isCell()){const s=parseInt(t.getSettings().fixedColumnsStart,10),a=n.getNearestNotHiddenIndex(s,1),l=i.clone();l.col=r.col,e.setRangeStart(l,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(o.row,a))}}},N3={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&t.selection.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.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a))}}},D3={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&t.selection.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.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a))}}},k3={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&t.selection.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(0,1),l=i.clone();l.row=r.row,e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col))}}},L3={name:"extendCellsSelectionToRows",callback(t){const{highlight:e,from:n,to:r}=t.getSelectedRangeLast();t.selection.isSelectedByColumnHeader()?t.selection.selectAll(!0,!0):t.selectRows(n.row,r.row,e)}},$3={name:"extendCellsSelectionUp",callback(t){const{highlight:e}=t.getSelectedRangeLast();!t.selection.isSelectedByColumnHeader()&&!t.selection.isSelectedByCorner()&&(e.isCell()||e.isHeader()&&t.selection.isSelectedByRowHeader())&&t.selection.transformEnd(-1,0)}},F3={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{to:e}=t.getSelectedRangeLast(),n=Math.max(e.row-t.countVisibleRows(),0),r=t.rowIndexMapper.getNearestNotHiddenIndex(n,1);if(r!==null){const i=t._createCellCoords(r,e.col),o=e.row-t.getFirstFullyVisibleRow(),s=Math.max(i.row-o,0);t.selection.setRangeEnd(i),t.scrollViewportTo({row:s,verticalSnap:"top",horizontalSnap:"start"})}}};function V3(){return[_3,M3,I3,P3,O3,x3,A3,H3,N3,D3,k3,L3,$3,F3]}const W3={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.transformStart(1,0)}},B3={name:"moveCellSelectionDownByViewportHeight",callback(t){const{navigableHeaders:e}=t.getSettings(),n=e?t.countColHeaders():0,{row:r}=t.getSelectedRangeLast().highlight;let i=t.countVisibleRows()+n;i=i===0?1:i,r===t.countRows()-1?i=1:r+i>t.countRows()&&(i=t.countRows()-r-1),t.selection.transformStart(i,0),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}},j3={name:"moveCellSelectionInlineEnd",callback(t,e){const n=t.getSettings(),r=t.getSelectedRangeLast(),i=typeof n.tabMoves=="function"?n.tabMoves(e):n.tabMoves;t.selection.isMultiple()&&!r.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?t.selection.transformFocus(-i.row,-i.col):t.selection.transformStart(-i.row,-i.col)}},U3={name:"moveCellSelectionInlineStart",callback(t,e){const n=t.getSettings(),r=t.getSelectedRangeLast(),i=typeof n.tabMoves=="function"?n.tabMoves(e):n.tabMoves;t.selection.isMultiple()&&!r.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?t.selection.transformFocus(i.row,i.col):t.selection.transformStart(i.row,i.col)}},z3={name:"moveCellSelectionLeft",callback(t){t.selection.transformStart(0,-1*t.getDirectionFactor())}},Y3={name:"moveCellSelectionRight",callback(t){t.selection.transformStart(0,t.getDirectionFactor())}},G3={name:"moveCellSelectionToMostBottom",callback(t){const{col:e}=t.getSelectedRangeLast().highlight;let n=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);n===null&&(n=-1),t.selection.setRangeStart(t._createCellCoords(n,e))}},K3={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.setRangeStart(t._createCellCoords(o,s))}},q3={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t;e.setRangeStart(t._createCellCoords(t.getSelectedRangeLast().highlight.row,n.getNearestNotHiddenIndex(t.countCols()-1,-1)))}},X3={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.setRangeStart(t._createCellCoords(i,o))}},Z3={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.setRangeStart(t._createCellCoords(r,i))}},J3={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.setRangeStart(t._createCellCoords(r,i))}},Q3={name:"moveCellSelectionToMostTop",callback(t){const{col:e}=t.getSelectedRangeLast().highlight;let n=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);n===null&&(n=-t.countColHeaders()),t.selection.setRangeStart(t._createCellCoords(n,e))}},eX={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.setRangeStart(t._createCellCoords(s,a))}},tX={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.transformStart(-1,0)}},nX={name:"moveCellSelectionUpByViewportHight",callback(t){const{navigableHeaders:e}=t.getSettings(),n=e?t.countColHeaders():0,{row:r}=t.getSelectedRangeLast().highlight;let i=t.countVisibleRows()+n;i=i===0?-1:-i,r===-n?i=-1:r+i<n&&(i=-(r+n)),t.selection.transformStart(i,0),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}};function rX(){return[W3,B3,j3,U3,z3,Y3,G3,K3,q3,X3,Z3,J3,Q3,eX,tX,nX]}const iX={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},oX={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"})}}},sX={name:"selectAllCells",callback(t){t.selection.selectAll(!0,!0,{disableHeadersHighlight:!0})}},aX={name:"selectAllCellsAndHeaders",callback(t){t.selection.selectAll(!0,!0,{disableHeadersHighlight:!1})}},lX={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()))}},uX=[...T3(),...V3(),...rX(),iX,oX,sX,aX,lX];function kD(t){const e={};return uX.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 cX(t){const e=t.getShortcutManager().addContext("editor"),n=kD(t),r={group:pl};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 hX(t){const e=t.getShortcutManager().addContext("grid"),n=kD(t),r={runOnlyIf:()=>{const{navigableHeaders:i}=t.getSettings();return se(t.getSelected())&&(i||!i&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:ND};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:pl,runOnlyIf:()=>se(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 dX(t){[hX,cX].forEach(e=>e(t))}function fX(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.rootElement,r=ox(t),i=ox(t);return r.addEventListener("focus",()=>e==null?void 0:e.onFocusFromTop()),i.addEventListener("focus",()=>e==null?void 0: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 ox(t){const n=t.rootDocument.createElement("input");return n.type="text",n.name="__htFocusCatcher",n.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&be(n,[Es(),fl()]),n}function gX(t){const e=mX(t);let n;const{activate:r,deactivate:i}=fX(t,{onFocusFromTop(){var h;const d=(h=e(n))!==null&&h!==void 0?h:wR(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:vR(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,C)=>{if(a&&(o.wrapped&&o.flipped||l)&&(l=!1,C.value=!0),s){var w;n=(w=t.getSelectedRangeLast())===null||w===void 0?void 0:w.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:ND,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?wR(t):vR(t)),u(),!1;h.preventDefault()},position:"after"}])}function wR(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 vR(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 mX(t){return e=>{if(!e)return null;const n=wR(t),r=vR(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 pX(t){return e=>{let{col:n}=e;t.scrollViewportTo({col:n})}}function wX(){return()=>{}}function vX(t){return e=>{t.scrollViewportTo(e.toObject())}}function CX(t){return e=>{t.scrollViewportTo(e.toObject())}}function yX(t){return e=>{t.scrollViewportTo(e.toObject())}}function bX(t){return e=>{let{row:n}=e;t.scrollViewportTo({row:n})}}function SX(t){return e=>{const n=t.selection.getSelectionSource(),{row:r,col:i}=e;if(r<0&&i>=0)t.scrollViewportTo({col:i});else if(i<0&&r>=0)t.scrollViewportTo({row:r});else{if(n==="mouse"&&(i===t.view.getLastPartiallyVisibleColumn()||r===t.view.getLastPartiallyVisibleRow()))return;t.scrollViewportTo({row:r,col:i})}}}function RX(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=vX(t):e.isSelectedByCorner()?s=wX():e.isSelectedByRowHeader()?s=bX(t):e.isSelectedByColumnHeader()?s=pX(t):e.getSelectedRange().size()===1&&e.isMultiple()?s=CX(t):e.getSelectedRange().size()===1&&!e.isMultiple()?s=SX(t):e.getSelectedRange().size()>1&&(s=yX(t)),(o=s)===null||o===void 0||o(i)}}}const sx=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"]]),Mg=t=>t.map(e=>{const n=e.toLowerCase();return sx.has(n)?sx.get(n):n}).sort().join("+"),EX=t=>t.split("+"),ax=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"]]),hb=t=>{let{which:e,key:n}=t;if(ax.has(e))return ax.get(e);const r=String.fromCharCode(e).toLowerCase();return/^[a-z0-9]$/.test(r)?r:n.toLowerCase()},LD=Symbol("shortcut-context");function $D(t){return Ae(t)&&t.__kindOf===LD}const TX=t=>{const e=Cw({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:C,position:w,forwardToContext:S}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(_t(c))throw new Error("You need to define the shortcut's group.");if(mt(u)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(tt`Pass the shortcut\'s keys as an array of arrays,\x20
|
|
58
|
-
using the KeyboardEvent.key properties:\x20
|
|
59
|
-
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const R={callback:u,group:c,runOnlyIf:h,captureCtrl:d,preventDefault:f,stopPropagation:m};se(C)&&(R.relativeToGroup=C,R.position=w),$D(S)&&(R.forwardToContext=S),l.forEach(I=>{const O=Mg(I);if(e.hasItem(O)){const _=e.getItem(O);let x=_.findIndex(j=>j.group===C);x!==-1?w==="before"?x-=1:x+=1:x=_.length,_.splice(x,0,R)}else e.addItem(O,[R])})},r=function(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l.forEach(c=>{He(u,(h,d)=>{Object.prototype.hasOwnProperty.call(c,d)===!1&&(c[d]=u[d])}),n(c)})},i=l=>{const u=Mg(l);e.removeItem(u)};return{__kindOf:LD,addShortcut:n,addShortcuts:r,getShortcuts:l=>{const u=Mg(l),c=e.getItem(u);return se(c)?c.slice():[]},hasShortcut:l=>{const u=Mg(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(EX(h)):(d.length=0,d.push(...f))})}}};function _X(){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 MX=["meta","alt","shift","control"],Yh=_X(),Gh=[];let Ig=0;function IX(t,e,n,r,i){const o=f=>MX.includes(f),s=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const C=[];return f.altKey&&C.push("alt"),m&&(f.ctrlKey||f.metaKey)?C.push("control/meta"):(f.ctrlKey&&C.push("control"),f.metaKey&&C.push("meta")),f.shiftKey&&C.push("shift"),C},a=f=>{if(e(f)===!1||n(f)===!1||f.keyCode===229||typeof f.key!="string"||au(f))return;const C=hb(f);let w=[];o(C)||(w=s(f));const S=[C].concat(w);!i(f,S)&&(CP()&&w.includes("meta")||!CP()&&w.includes("control"))&&i(f,[C].concat(s(f,!0))),r(f)},l=f=>{if(typeof f.key=="string"){const m=hb(f);o(m)&&Yh.press(m)}},u=f=>{if(typeof f.key=="string"){const m=hb(f);o(m)&&Yh.release(m)}},c=()=>{Yh.releaseAll()};return{mount:()=>{let f=t;for(Ig+=1;f;)Ig===1&&(f.document.documentElement.addEventListener("keydown",l),Gh.push({event:"keydown",listener:l}),f.document.documentElement.addEventListener("keyup",u),Gh.push({event:"keyup",listener:u})),f.document.documentElement.addEventListener("keydown",a),f.document.documentElement.addEventListener("blur",c),f=Kc(f)},unmount:()=>{let f=t;for(Ig-=1;f;){if(Ig===0){for(let m=0;m<Gh.length;m++){const{event:C,listener:w}=Gh[m];f.document.documentElement.removeEventListener(C,w)}Gh.length=0}f.document.documentElement.removeEventListener("keydown",a),f.document.documentElement.removeEventListener("blur",c),f=Kc(f)}},isPressed:f=>Yh.isPressed(f),releasePressedKeys:()=>Yh.releaseAll()}}const PX=t=>{let{ownerWindow:e,handleEvent:n,beforeKeyDown:r,afterKeyDown:i}=t;const o=Cw({errorIdExists:m=>`The "${m}" context name is already registered.`});let s="grid";const a=m=>{const C=TX(m);return o.addItem(m,C),C},l=()=>s,u=m=>o.getItem(m),c=m=>{if(!o.hasItem(m))throw new Error(tt`You've tried to activate the "${m}" shortcut context\x20
|
|
60
|
-
that does not exist. Before activation, register the context using the "addContext" method.`);s=m};let h=!1;const d=function(m,C){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const S=$D(w)?w:u(w);let R=!1;if(!S.hasShortcut(C))return R;const I=S.getShortcuts(C);for(let O=0;O<I.length;O++){const{callback:D,runOnlyIf:_,preventDefault:x,stopPropagation:j,captureCtrl:X,forwardToContext:U}=I[O];if(_(m)===!0){if(h=X,R=D(m,C)===!1,h=!1,x&&m.preventDefault(),j&&(jo(m),m.stopPropagation()),R)break;U&&d(m,C,U)}}return R},f=IX(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 lx(t){const{classNames:e}=kU(t,/ht-theme-[a-zA-Z0-9_-]+/);return e.pop()}let db=null;const fb=new Map;function FD(t,e){var n,r=this;let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this;const s=new Fo(o);let a,l,u,c,h,d,f=!0;lK(i)&&aK(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==null?void 0:e.layoutDirection)!==null&&n!==void 0?n:"inherit",C=["rtl","ltr"].includes(m)?m:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",C),this.isRtl=function(){return C==="rtl"},this.isLtr=function(){return!o.isRtl()},this.getDirectionFactor=function(){return o.isLtr()?1:-1},e.language=sq(e.language);const w=new HD(o,e,[a3,g3]),S=w.getTableMeta(),R=w.getGlobalMeta(),I=Cw();this.container=this.rootDocument.createElement("div"),this.renderCall=!1,t.insertBefore(this.container,t.firstChild),Wm(this)&&(uU(e.licenseKey,t),Y(t,"ht-wrapper")),this.guid=`ht_${sN()}`,fb.set(this.guid,this),this.columnIndexMapper=new gR,this.rowIndexMapper=new gR,this.columnIndexMapper.addLocalHook("indexesSequenceChange",g=>{o.runHooks("afterColumnSequenceChange",g)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",g=>{o.runHooks("afterRowSequenceChange",g)}),l=new RK(o),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const O=g=>{const{row:p,col:v}=g;return o._createCellCoords(p>=0?o.rowIndexMapper.getRenderableFromVisualIndex(p):p,v>=0?o.columnIndexMapper.getRenderableFromVisualIndex(v):v)},D=g=>{const{row:p,col:v}=g;return o._createCellCoords(p>=0?o.rowIndexMapper.getVisualFromRenderableIndex(p):p,v>=0?o.columnIndexMapper.getVisualFromRenderableIndex(v):v)},_=(g,p)=>{const v=p>g?1:-1,E=Math.min(g,p),H=Math.max(g,p),W=o.rowIndexMapper.getNearestNotHiddenIndex(g,v);return W===null||v===1&&W>H||v===-1&&W<E?null:W>=0?o.rowIndexMapper.getRenderableFromVisualIndex(W):W},x=(g,p)=>{const v=p>g?1:-1,E=Math.min(g,p),H=Math.max(g,p),W=o.columnIndexMapper.getNearestNotHiddenIndex(g,v);return W===null||v===1&&W>H||v===-1&&W<E?null:W>=0?o.columnIndexMapper.getRenderableFromVisualIndex(W):W};let j=new OD(S,{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,p)=>o._createCellCoords(g,p),createCellRange:(g,p,v)=>o._createCellRange(g,p,v),visualToRenderableCoords:O,renderableToVisualCoords:D,findFirstNonHiddenRenderableRow:_,findFirstNonHiddenRenderableColumn:x,isDisabledCellSelection:(g,p)=>g<0||p<0?o.getSettings().disableVisualSelection:o.getCellMeta(g,p).disableVisualSelection});this.selection=j;const X=g=>{let{hiddenIndexesChanged:p}=g;p&&this.selection.commit()};this.columnIndexMapper.addLocalHook("cacheUpdated",X),this.rowIndexMapper.addLocalHook("cacheUpdated",X),this.selection.addLocalHook("afterSetRangeEnd",(g,p)=>{const v=Bi(!1),E=this.selection.getSelectedRange(),{from:H,to:W}=E.current(),G=E.size()-1;this.runHooks("afterSelection",H.row,H.col,W.row,W.col,v,G),this.runHooks("afterSelectionByProp",H.row,o.colToProp(H.col),W.row,o.colToProp(W.col),v,G),p&&(!v.isTouched()||v.isTouched()&&!v.value)&&d.scrollTo(g);const K=j.isSelectedByRowHeader(),oe=j.isSelectedByColumnHeader();K&&oe?Y(this.rootElement,["ht__selection--rows","ht__selection--columns"]):K?(we(this.rootElement,"ht__selection--columns"),Y(this.rootElement,"ht__selection--rows")):oe?(we(this.rootElement,"ht__selection--rows"),Y(this.rootElement,"ht__selection--columns")):we(this.rootElement,["ht__selection--rows","ht__selection--columns"]),j.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 p=Bi(!1);this.runHooks("afterSelectionFocusSet",g.row,g.col,p),(!p.isTouched()||p.isTouched()&&!p.value)&&d.scrollTo(g),c.closeEditor(),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("afterSelectionFinished",g=>{const p=g.length-1,{from:v,to:E}=g[p];this.runHooks("afterSelectionEnd",v.row,v.col,E.row,E.col,p),this.runHooks("afterSelectionEndByProp",v.row,o.colToProp(v.col),E.row,o.colToProp(E.col),p)}),this.selection.addLocalHook("afterIsMultipleSelection",g=>{const p=this.runHooks("afterIsMultipleSelection",g.value);g.value&&(g.value=p)}),this.selection.addLocalHook("afterDeselect",()=>{c.closeEditor(),o.view.render(),we(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,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("beforeSetRangeStart",...p)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("beforeSetRangeStartOnly",...p)}).addLocalHook("beforeSetRangeEnd",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("beforeSetRangeEnd",...p)}).addLocalHook("beforeSelectColumns",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("beforeSelectColumns",...p)}).addLocalHook("afterSelectColumns",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("afterSelectColumns",...p)}).addLocalHook("beforeSelectRows",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("beforeSelectRows",...p)}).addLocalHook("afterSelectRows",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("afterSelectRows",...p)}).addLocalHook("beforeModifyTransformStart",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("modifyTransformStart",...p)}).addLocalHook("afterModifyTransformStart",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("afterModifyTransformStart",...p)}).addLocalHook("beforeModifyTransformFocus",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("modifyTransformFocus",...p)}).addLocalHook("afterModifyTransformFocus",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("afterModifyTransformFocus",...p)}).addLocalHook("beforeModifyTransformEnd",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("modifyTransformEnd",...p)}).addLocalHook("afterModifyTransformEnd",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("afterModifyTransformEnd",...p)}).addLocalHook("beforeRowWrap",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("beforeRowWrap",...p)}).addLocalHook("beforeColumnWrap",function(){for(var g=arguments.length,p=new Array(g),v=0;v<g;v++)p[v]=arguments[v];return r.runHooks("beforeColumnWrap",...p)}).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,p){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,E=arguments.length>3?arguments[3]:void 0,H=arguments.length>4?arguments[4]:void 0;const W=G=>{if(G.length===0)return[];const K=[...G];return K.sort((y,b)=>{let[T]=y,[k]=b;return T===k?0:T>k?1:-1}),mr(K,(y,b)=>{let[T,k]=b;const A=y[y.length-1],[$,B]=A,P=$+B;if(T<=P){const L=Math.max(k-(P-T),0);A[1]+=L}else y.push([T,k]);return y},[K[0]])};switch(g){case"insert_row_below":case"insert_row_above":const G=o.countSourceRows();if(S.maxRows===G)return;const K=g==="insert_row_below"?"below":"above";p=p??(K==="below"?G:0);const{delta:oe,startPhysicalIndex:y}=a.createRow(p,v,{source:E,mode:K});j.shiftRows(o.toVisualRow(y),oe);break;case"insert_col_start":case"insert_col_end":const b=g==="insert_col_end"?"end":"start";p=p??(b==="end"?o.countSourceCols():0);const{delta:T,startPhysicalIndex:k}=a.createCol(p,v,{source:E,mode:b});if(T){if(Array.isArray(S.colHeaders)){const B=[o.toVisualColumn(k),0];B.length+=T,Array.prototype.splice.apply(S.colHeaders,B)}j.shiftColumns(o.toVisualColumn(k),T)}break;case"remove_row":const A=B=>{let P=0;M(B,L=>{let[F,V]=L;const z=jt(F)?o.countRows()-1:Math.max(F-P,0);if(Number.isInteger(F)&&(F=Math.max(F-P,0)),!a.removeRow(F,V,E))return;if(j.isSelected()){const{row:Be}=o.getSelectedRangeLast().highlight;Be>=F&&Be<=F+V-1&&c.closeEditor(!0)}const de=o.countRows();de===0?j.deselect():E==="ContextMenu.removeRow"?j.refresh():j.shiftRows(F,-V);const Se=S.fixedRowsTop;Se>=z+1&&(S.fixedRowsTop-=Math.min(V,Se-z));const Ne=S.fixedRowsBottom;Ne&&z>=de-Ne&&(S.fixedRowsBottom-=Math.min(V,Ne)),P+=V})};Array.isArray(p)?A(W(p)):A([[p,v]]);break;case"remove_col":const $=B=>{let P=0;M(B,L=>{let[F,V]=L;const z=jt(F)?o.countCols()-1:Math.max(F-P,0);let ce=o.toPhysicalColumn(z);if(Number.isInteger(F)&&(F=Math.max(F-P,0)),!a.removeCol(F,V,E))return;if(j.isSelected()){const{col:Be}=o.getSelectedRangeLast().highlight;Be>=F&&Be<=F+V-1&&c.closeEditor(!0)}o.countCols()===0?j.deselect():E==="ContextMenu.removeColumn"?j.refresh():j.shiftColumns(F,-V);const Ne=S.fixedColumnsStart;Ne>=z+1&&(S.fixedColumnsStart-=Math.min(V,Ne-z)),Array.isArray(S.colHeaders)&&(typeof ce>"u"&&(ce=-1),S.colHeaders.splice(ce,V)),P+=V})};Array.isArray(p)?$(W(p)):$([[p,v]]);break;default:throw new Error(`There is no such action "${g}"`)}H||u.adjustRowsAndCols(),o.view.render(),o.view.adjustElementsSize()},adjustRowsAndCols(){const g=S.minRows,p=S.minSpareRows,v=S.minCols,E=S.minSpareCols;if(g){const H=o.countRows();H<g&&a.createRow(H,g-H,{source:"auto"})}if(p){const H=o.countEmptyRows(!0);if(H<p){const W=p-H,G=Math.min(W,S.maxRows-o.countSourceRows());a.createRow(o.countRows(),G,{source:"auto"})}}{let H;(v||E)&&(H=o.countEmptyCols(!0));let W=o.countCols();if(v&&!S.columns&&W<v){const G=v-W;H+=G,a.createCol(W,G,{source:"auto"})}if(E&&!S.columns&&o.dataType==="array"&&H<E){W=o.countCols();const G=E-H,K=Math.min(G,S.maxCols-W);a.createCol(W,K,{source:"auto"})}}},populateFromArray(g,p,v,E,H){let W,G,K,oe;const y=[],b={},T=[],k=g.row,A=g.col;if(G=p.length,G===0)return!1;let $=0,B=0;switch(Ae(v)&&($=v.col-A+1,B=v.row-k+1),H){case"shift_down":const P=$m(p),L=P.length,F=Math.max(L,$),V=o.getData().slice(k),z=$m(V).slice(A,A+F);for(K=0;K<F;K+=1)if(K<L){for(W=0,G=P[K].length;W<B-G;W+=1)P[K].push(P[K][W%G]);K<z.length?T.push(P[K].concat(z[K])):T.push(P[K].concat(new Array(V.length).fill(null)))}else T.push(P[K%L].concat(z[K]));o.populateFromArray(k,A,$m(T));break;case"shift_right":const ce=p.length,de=Math.max(ce,B),Se=o.getData().slice(k).map(fn=>fn.slice(A));for(W=0;W<de;W+=1)if(W<ce){for(K=0,oe=p[W].length;K<$-oe;K+=1)p[W].push(p[W][K%oe]);if(W<Se.length)for(let fn=0;fn<Se[W].length;fn+=1)p[W].push(Se[W][fn]);else p[W].push(...new Array(Se[0].length).fill(null))}else p.push(p[W%G].slice(0,de).concat(Se[W]));o.populateFromArray(k,A,p);break;case"overwrite":default:b.row=g.row,b.col=g.col;let Ne=0,Be=0,Me=!0,$e;const kt=function(Jt){let Lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const pt=p[Jt%p.length];return Lt!==null?pt[Lt%pt.length]:pt},go=p.length,zo=v?v.row-g.row+1:0;for(v?G=zo:G=Math.max(go,zo),W=0;W<G&&!(v&&b.row>v.row&&zo>go||!S.allowInsertRow&&b.row>o.countRows()-1||b.row>=S.maxRows);W++){const fn=W-Ne,Jt=kt(fn).length,Lt=v?v.col-g.col+1:0;if(v?oe=Lt:oe=Math.max(Jt,Lt),b.col=g.col,$e=o.getCellMeta(b.row,b.col),(E==="CopyPaste.paste"||E==="Autofill.fill")&&$e.skipRowOnPaste){Ne+=1,b.row+=1,G+=1;continue}for(Be=0,K=0;K<oe&&!(v&&b.col>v.col&&Lt>Jt||!S.allowInsertColumn&&b.col>o.countCols()-1||b.col>=S.maxCols);K++){if($e=o.getCellMeta(b.row,b.col),(E==="CopyPaste.paste"||E==="Autofill.fill")&&$e.skipColumnOnPaste){Be+=1,b.col+=1,oe+=1;continue}if($e.readOnly&&E!=="UndoRedo.undo"){b.col+=1;continue}const pt=K-Be;let nt=kt(fn,pt),Fe=o.getDataAtCell(b.row,b.col);if(nt!==null&&typeof nt=="object")if(Array.isArray(nt)&&Fe===null&&(Fe=[]),Fe===null||typeof Fe!="object")Me=!1;else{const qf=sf(Array.isArray(Fe)?Fe:Fe[0]||Fe),wl=sf(Array.isArray(nt)?nt:nt[0]||nt);VE(qf,wl)||Array.isArray(qf)&&Array.isArray(wl)?nt=Kn(nt):Me=!1}else Fe!==null&&typeof Fe=="object"&&(Me=!1);Me&&y.push([b.row,b.col,nt]),Me=!0,b.col+=1}b.row+=1}o.setDataAtCell(y,null,null,E||"populateFromArray");break}}};function U(g){const p=yD(g);C0(p)?(o.runHooks("beforeLanguageChange",p),R.language=p,o.runHooks("afterLanguageChange",p)):bD(g)}function Z(g,p){const v=g==="className"?o.rootElement:o.table;if(f)Y(v,p);else{let E=[],H=[];R[g]&&(E=Array.isArray(R[g])?R[g]:sP(R[g])),p&&(H=Array.isArray(p)?p:sP(p));const W=oP(E,H),G=oP(H,E);W.length&&we(v,W),G.length&&Y(v,G)}R[g]=p}this.init=function(){l.setData(S.data),o.runHooks("beforeInit"),(aa()||HN())&&Y(o.rootElement,"mobile"),this.updateSettings(S,!0),this.view=new dK(this);const g=S.themeName||lx(o.rootElement);o.useTheme(g),o.view.addClassNameToLicenseElement(o.getCurrentThemeName()),c=lR.getInstance(o,S,j),d=RX(o),h=new Nz(o),Wm(this)&&gX(o),o.runHooks("init"),this.forceFullRender=!0,this.view.render(),f&&o.rootElement.offsetParent===null&&jU(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 Q(){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 le(g){const p=g.replace(",",".");return isNaN(parseFloat(p))===!1?parseFloat(p):g}function te(g,p,v){if(!g.length){v();return}const E=o.getActiveEditor(),H=new Q;let W=!0;H.onQueueEmpty=()=>{E&&W&&E.cancelChanges(),v()};for(let G=g.length-1;G>=0;G--){const[K,oe]=g[G],y=a.propToCol(oe);let b;Number.isInteger(y)?b=o.getCellMeta(K,y):b={...Object.getPrototypeOf(S),...S},o.getCellValidator(b)&&(H.addValidatorToQueue(),o.validateCell(g[G][3],b,function(T,k){return function(A){if(typeof A!="boolean")throw new Error("Validation error: result is not boolean");A===!1&&k.allowInvalid===!1&&(W=!1,g.splice(T,1),k.valid=!0),H.removeValidatorFormQueue()}}(G,b),p))}H.checkIfQueueIsEmpty()}function ue(g,p){for(let E=g.length-1;E>=0;E--){let H=!1;if(g[E]===null){g.splice(E,1);continue}if(!((g[E][2]===null||g[E][2]===void 0)&&(g[E][3]===null||g[E][3]===void 0))){if(S.allowInsertRow)for(;g[E][0]>o.countRows()-1;){const{delta:W}=a.createRow(void 0,void 0,{source:"auto"});if(W===0){H=!0;break}}if(o.dataType==="array"&&(!S.columns||S.columns.length===0)&&S.allowInsertColumn)for(;a.propToCol(g[E][1])>o.countCols()-1;){const{delta:W}=a.createCol(void 0,void 0,{source:"auto"});if(W===0){H=!0;break}}H||a.set(g[E][0],g[E][1],g[E][3])}}const v=g.length>0;if(o.forceFullRender=!0,v){u.adjustRowsAndCols(),o.runHooks("beforeChangeRender",g,p),c.closeEditor(),o.view.render(),c.prepareEditor(),o.view.adjustElementsSize(),o.runHooks("afterChange",g,p||"edit");const E=o.getActiveEditor();E&&se(E.refreshValue)&&E.refreshValue()}else o.view.render()}this._createCellCoords=function(g,p){return o.view._wt.createCellCoords(g,p)},this._createCellRange=function(g,p,v){return o.view._wt.createCellRange(g,p,v)},this.validateCell=function(g,p,v,E){let H=o.getCellValidator(p);function W(G){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||p.hidden===!0){v(G);return}const oe=p.visualCol,y=p.visualRow,b=o.getCell(y,oe,!0);if(b&&b.nodeName!=="TH"){const T=o.rowIndexMapper.getRenderableFromVisualIndex(y),k=o.columnIndexMapper.getRenderableFromVisualIndex(oe);o.view._wt.getSetting("cellRenderer",T,k,b)}v(G)}sU(H)&&(H=function(G){return function(K,oe){oe(G.test(K))}}(H)),mt(H)?(g=o.runHooks("beforeValidate",g,p.visualRow,p.prop,E),o._registerImmediate(()=>{H.call(p,g,G=>{o&&(G=o.runHooks("afterValidate",G,g,p.visualRow,p.prop,E),p.valid=G,W(G),o.runHooks("postAfterValidate",G,g,p.visualRow,p.prop,E))})})):o._registerImmediate(()=>{p.valid=!0,W(p.valid,!1)})};function ft(g,p,v){return Array.isArray(g)?g:[[g,p,v]]}function Re(g,p){const v=o.runHooks("beforeChange",g,p||"edit"),E=g.filter(W=>W!==null);if(v===!1||E.length===0){var H;return(H=o.getActiveEditor())===null||H===void 0||H.cancelChanges(),[]}for(let W=E.length-1;W>=0;W--){const[G,K,,oe]=E[W],y=a.propToCol(K);let b;Number.isInteger(y)?b=o.getCellMeta(G,y):b={...Object.getPrototypeOf(S),...S},b.type==="numeric"&&typeof oe=="string"&&Gz(oe)&&(E[W][3]=le(oe))}return E}this.setDataAtCell=function(g,p,v,E){const H=ft(g,p,v),W=[];let G=E,K,oe,y;for(K=0,oe=H.length;K<oe;K++){if(typeof H[K]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof H[K][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`");H[K][1]>=this.countCols()?y=H[K][1]:y=a.colToProp(H[K][1]),W.push([H[K][0],y,l.getAtCell(this.toPhysicalRow(H[K][0]),H[K][1]),H[K][2]])}!G&&typeof g=="object"&&(G=p);const b=Re(W,G);o.runHooks("afterSetDataAtCell",b,G),te(b,G,()=>{ue(b,G)})},this.setDataAtRowProp=function(g,p,v,E){const H=ft(g,p,v),W=[];let G=E,K,oe;for(K=0,oe=H.length;K<oe;K++)W.push([H[K][0],H[K][1],l.getAtCell(this.toPhysicalRow(H[K][0]),H[K][1]),H[K][2]]);!G&&typeof g=="object"&&(G=p);const y=Re(W,E);o.runHooks("afterSetDataAtRowProp",y,G),te(y,G,()=>{ue(y,G)})},this.listen=function(){o&&!o.isListening()&&(fb.forEach(g=>{o!==g&&g.unlisten()}),db=o.guid,o.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(db=null,o.runHooks("afterUnlisten"))},this.isListening=function(){return db===o.guid},this.destroyEditor=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;c.closeEditor(g),o.view.render(),p&&j.isSelected()&&c.prepareEditor()},this.populateFromArray=function(g,p,v,E,H,W,G){if(!(typeof v=="object"&&typeof v[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const K=typeof E=="number"?o._createCellCoords(E,H):null;return u.populateFromArray(o._createCellCoords(g,p),v,K,W,G)},this.spliceCol=function(g,p,v){for(var E=arguments.length,H=new Array(E>3?E-3:0),W=3;W<E;W++)H[W-3]=arguments[W];return a.spliceCol(g,p,v,...H)},this.spliceRow=function(g,p,v){for(var E=arguments.length,H=new Array(E>3?E-3:0),W=3;W<E;W++)H[W-3]=arguments[W];return a.spliceRow(g,p,v,...H)},this.getSelected=function(){if(j.isSelected())return je(j.getSelectedRange(),g=>{let{from:p,to:v}=g;return[p.row,p.col,v.row,v.col]})},this.getSelectedLast=function(){const g=this.getSelected();let p;return g&&g.length>0&&(p=g[g.length-1]),p},this.getSelectedRange=function(){if(j.isSelected())return Array.from(j.getSelectedRange())},this.getSelectedRangeLast=function(){const g=this.getSelectedRange();let p;return g&&g.length>0&&(p=g[g.length-1]),p},this.emptySelectedCells=function(g){if(!j.isSelected()||this.countRows()===0||this.countCols()===0)return;const p=[];M(j.getSelectedRange(),v=>{if(v.isSingleHeader())return;const E=v.getTopStartCorner(),H=v.getBottomEndCorner();fe(E.row,H.row,W=>{fe(E.col,H.col,G=>{this.getCellMeta(W,G).readOnly||p.push([W,G,null])})})}),p.length>0&&this.setDataAtCell(p,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&&(this.renderCall?this.render():o.view.render())},this.render=function(){this.view&&(this.renderCall=!0,this.forceFullRender=!0,this.isRenderSuspended()||o.view.render())},this.batchRender=function(g){this.suspendRender();const p=g();return this.resumeRender(),p},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 p=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(p,0),(!this.isExecutionSuspended()&&p===this.executionSuspendedCounter||g)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(g){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const v=g();return this.resumeExecution(p),v},this.batch=function(g){this.suspendRender(),this.suspendExecution();const p=g();return this.resumeExecution(),this.resumeRender(),p},this.refreshDimensions=function(){if(!o.view)return;const g=o.view,{width:p,height:v}=g.getLastSize(),{width:E,height:H}=o.rootElement.getBoundingClientRect(),W=E!==p||H!==v;o.runHooks("beforeRefreshDimensions",{width:p,height:v},{width:E,height:H},W)!==!1&&((W||g._wt.wtOverlays.scrollableElement===o.rootWindow)&&(g.setLastSize(E,H),o.render(),g.adjustElementsSize()),o.runHooks("afterRefreshDimensions",{width:p,height:v},{width:E,height:H},W))},this.updateData=function(g,p){nx(g,v=>{a=v},v=>{a=v,o.columnIndexMapper.fitToLength(this.getInitialColumnCount()),o.rowIndexMapper.fitToLength(this.countSourceRows()),u.adjustRowsAndCols(),j.refresh()},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"updateData",source:p,metaManager:w,firstRun:f})},this.loadData=function(g,p){nx(g,v=>{a=v},()=>{w.clearCellsCache(),o.initIndexMappers(),u.adjustRowsAndCols(),j.refresh(),f&&(f=[null,"loadData"])},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"loadData",source:p,metaManager:w,firstRun:f})},this.getInitialColumnCount=function(){const g=S.columns;let p=0;if(Array.isArray(g))p=g.length;else if(mt(g))if(o.dataType==="array"){const v=this.countSourceCols();for(let E=0;E<v;E+=1)g(E)&&(p+=1)}else(o.dataType==="object"||o.dataType==="function")&&(p=a.colToPropCache.length);else if(se(S.dataSchema)){const v=a.getSchema();p=Array.isArray(v)?v.length:WE(v)}else p=this.countSourceCols();return p},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(g,p,v,E){return _t(g)?a.getAll():a.getRange(o._createCellCoords(g,p),o._createCellCoords(v,E),a.DESTINATION_RENDERER)},this.getCopyableText=function(g,p,v,E){return a.getCopyableText(o._createCellCoords(g,p),o._createCellCoords(v,E))},this.getCopyableData=function(g,p){return a.getCopyable(g,a.colToProp(p))},this.getSchema=function(){return a.getSchema()},this.updateSettings=function(g){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const v=(f?o.loadData:o.updateData).bind(this);let E=!1,H,W;if(se(g.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(se(g.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(se(g.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');for(H in g)H==="data"||(H==="language"?U(g.language):H==="className"?Z("className",g.className):H==="tableClassName"&&o.table?(Z("tableClassName",g.tableClassName),o.view._wt.wtOverlays.syncOverlayTableClassNames()):ie.getSingleton().isRegistered(H)||ie.getSingleton().isDeprecated(H)?mt(g[H])?ie.getSingleton().addAsFixed(H,g[H],o):Array.isArray(g[H])&&ie.getSingleton().add(H,g[H],o):!p&&tn(g,H)&&(R[H]=g[H]));g.data===void 0&&S.data===void 0?v(null,"updateSettings"):g.data!==void 0?v(g.data,"updateSettings"):g.columns!==void 0&&(a.createMap(),o.initIndexMappers());const G=o.countCols(),K=S.columns;if(K&&mt(K)&&(E=!0),(g.cell!==void 0||g.cells!==void 0||g.columns!==void 0)&&w.clearCache(),G>0)for(H=0,W=0;H<G;H++){if(K){const b=E?K(H):K[W];b&&w.updateColumnMeta(W,b)}W+=1}se(g.cell)&&He(g.cell,b=>{o.setCellMetaObject(b.row,b.col,b)}),o.runHooks("afterCellMetaReset");let oe=o.rootElement.style.height;oe!==""&&(oe=parseInt(o.rootElement.style.height,10));let y=g.height;if(mt(y)&&(y=y()),p&&o.rootElement.getAttribute("style")&&o.rootElement.setAttribute("data-initialstyle",o.rootElement.getAttribute("style")),y===null){const b=o.rootElement.getAttribute("data-initialstyle");b&&(b.indexOf("height")>-1||b.indexOf("overflow")>-1)?o.rootElement.setAttribute("style",b):(o.rootElement.style.height="",o.rootElement.style.overflow="")}else y!==void 0&&(o.rootElement.style.height=isNaN(y)?`${y}`:`${y}px`,o.rootElement.style.overflow="hidden");if(typeof g.width<"u"){let b=g.width;mt(b)&&(b=b()),o.rootElement.style.width=isNaN(b)?`${b}`:`${b}px`}if(!p){if(o.view){o.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),o.view._wt.exportSettingsAsClassNames();const b=o.getCurrentThemeName(),T=tn(g,"themeName");b&&T&&b!==g.themeName&&(o.view.getStylesHandler().removeClassNames(),o.view.removeClassNameFromLicenseElement(b));const k=T&&g.themeName||lx(o.rootElement);o.useTheme(k),o.view.addClassNameToLicenseElement(o.getCurrentThemeName())}o.runHooks("afterUpdateSettings",g)}u.adjustRowsAndCols(),o.view&&!f&&(o.forceFullRender=!0,o.view.render(),o.view._wt.wtOverlays.adjustElementsSize()),!p&&o.view&&(oe===""||y===""||y===void 0)&&oe!==y&&o.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const g=o.getSelectedLast();if(S.getValue){if(mt(S.getValue))return S.getValue.call(o);if(g)return o.getData()[g[0][0]][S.getValue]}else if(g)return o.getDataAtCell(g[0],g[1])},this.getSettings=function(){return S},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(g,p,v,E,H){u.alter(g,p,v,E,H)},this.getCell=function(g,p){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,E=p,H=g;if(p>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(p)))return null;E=this.columnIndexMapper.getRenderableFromVisualIndex(p)}if(g>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(g)))return null;H=this.rowIndexMapper.getRenderableFromVisualIndex(g)}return H===null||E===null||H===void 0||E===void 0?null:o.view.getCellAtCoords(o._createCellCoords(H,E),v)},this.getCoords=function(g){const p=this.view._wt.wtTable.getCoords(g);if(p===null)return null;const{row:v,col:E}=p;let H=v,W=E;return v>=0&&(H=this.rowIndexMapper.getVisualFromRenderableIndex(v)),E>=0&&(W=this.columnIndexMapper.getVisualFromRenderableIndex(E)),o._createCellCoords(H,W)},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,p){return a.get(g,a.colToProp(p))},this.getDataAtRowProp=function(g,p){return a.get(g,p)},this.getDataAtCol=function(g){const p=[],v=a.getRange(o._createCellCoords(0,g),o._createCellCoords(S.data.length-1,g),a.DESTINATION_RENDERER);for(let E=0;E<v.length;E+=1)for(let H=0;H<v[E].length;H+=1)p.push(v[E][H]);return p},this.getDataAtProp=function(g){const p=[],v=a.getRange(o._createCellCoords(0,a.propToCol(g)),o._createCellCoords(S.data.length-1,a.propToCol(g)),a.DESTINATION_RENDERER);for(let E=0;E<v.length;E+=1)for(let H=0;H<v[E].length;H+=1)p.push(v[E][H]);return p},this.getSourceData=function(g,p,v,E){let H;return g===void 0?H=l.getData():H=l.getByRange(o._createCellCoords(g,p),o._createCellCoords(v,E)),H},this.getSourceDataArray=function(g,p,v,E){let H;return g===void 0?H=l.getData(!0):H=l.getByRange(o._createCellCoords(g,p),o._createCellCoords(v,E),!0),H},this.getSourceDataAtCol=function(g){return l.getAtColumn(g)},this.setSourceDataAtCell=function(g,p,v,E){const H=ft(g,p,v),W=this.hasHook("afterSetSourceDataAtCell"),G=[];W&&M(H,oe=>{let[y,b,T]=oe;G.push([y,b,l.getAtCell(y,b),T])}),M(H,oe=>{let[y,b,T]=oe;l.setAtCell(y,b,T)}),W&&this.runHooks("afterSetSourceDataAtCell",G,E),this.render();const K=o.getActiveEditor();K&&se(K.refreshValue)&&K.refreshValue()},this.getSourceDataAtRow=function(g){return l.getAtRow(g)},this.getSourceDataAtCell=function(g,p){return l.getAtCell(g,p)},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,p,v,E){const H=g===void 0?[0,0,this.countRows(),this.countCols()]:[g,p,v,E],[W,G]=H;let[,,K,oe]=H,y=null,b=null;K===void 0&&(K=W),oe===void 0&&(oe=G);let T="mixed";return fe(Math.max(Math.min(W,K),0),Math.max(W,K),k=>{let A=!0;return fe(Math.max(Math.min(G,oe),0),Math.max(G,oe),$=>(b=this.getCellMeta(k,$).type,y?A=y===b:y=b,A)),T=A?b:"mixed",A}),T},this.removeCellMeta=function(g,p,v){const[E,H]=[this.toPhysicalRow(g),this.toPhysicalColumn(p)];let W=w.getCellMetaKeyValue(E,H,v);o.runHooks("beforeRemoveCellMeta",g,p,v,W)!==!1&&(w.removeCellMeta(E,H,v),o.runHooks("afterRemoveCellMeta",g,p,v,W)),W=null},this.spliceCellsMeta=function(g){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var v=arguments.length,E=new Array(v>2?v-2:0),H=2;H<v;H++)E[H-2]=arguments[H];if(E.length>0&&!Array.isArray(E[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");p>0&&w.removeRow(this.toPhysicalRow(g),p),E.length>0&&M(E.reverse(),W=>{w.createRow(this.toPhysicalRow(g)),M(W,(G,K)=>this.setCellMetaObject(g,K,G))}),o.render()},this.setCellMetaObject=function(g,p,v){typeof v=="object"&&He(v,(E,H)=>{this.setCellMeta(g,p,H,E)})},this.setCellMeta=function(g,p,v,E){if(o.runHooks("beforeSetCellMeta",g,p,v,E)===!1)return;let W=g,G=p;g<this.countRows()&&(W=this.toPhysicalRow(g)),p<this.countCols()&&(G=this.toPhysicalColumn(p)),w.setCellMeta(W,G,v,E),o.runHooks("afterSetCellMeta",g,p,v,E)},this.getCellsMeta=function(){return w.getCellsMeta()},this.getCellMeta=function(g,p){let v=this.toPhysicalRow(g),E=this.toPhysicalColumn(p);return v===null&&(v=g),E===null&&(E=p),w.getCellMeta(v,E,{visualRow:g,visualColumn:p})},this.getColumnMeta=function(g){return w.getColumnMeta(this.toPhysicalColumn(g))},this.getCellMetaAtRow=function(g){return w.getCellsMetaAtRow(g)},this.isColumnModificationAllowed=function(){return!(o.dataType==="object"||S.columns)},this.getCellRenderer=function(g,p){const v=typeof g=="number"?o.getCellMeta(g,p).renderer:g.renderer;return typeof v=="string"?hR(v):_t(v)?hR("text"):v},this.getCellEditor=function(g,p){const v=typeof g=="number"?o.getCellMeta(g,p).editor:g.editor;return typeof v=="string"?aR(v):_t(v)?aR("text"):v},this.getCellValidator=function(g,p){const v=typeof g=="number"?o.getCellMeta(g,p).validator:g.validator;return typeof v=="string"?cY(v):v},this.validateCells=function(g){this._validateCells(g)},this.validateRows=function(g,p){if(!Array.isArray(g))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(p,g)},this.validateColumns=function(g,p){if(!Array.isArray(g))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(p,void 0,g)},this._validateCells=function(g,p,v){const E=new Q;g&&(E.onQueueEmpty=g);let H=o.countRows()-1;for(;H>=0;){if(p!==void 0&&p.indexOf(H)===-1){H-=1;continue}let W=o.countCols()-1;for(;W>=0;){if(v!==void 0&&v.indexOf(W)===-1){W-=1;continue}E.addValidatorToQueue(),o.validateCell(o.getDataAtCell(H,W),o.getCellMeta(H,W),G=>{if(typeof G!="boolean")throw new Error("Validation error: result is not boolean");G===!1&&(E.valid=!1),E.removeValidatorFormQueue()},"validateCells"),W-=1}H-=1}E.checkIfQueueIsEmpty()},this.getRowHeader=function(g){let p=S.rowHeaders,v=g;return v!==void 0&&(v=o.runHooks("modifyRowHeader",v)),v===void 0?(p=[],fe(o.countRows()-1,E=>{p.push(o.getRowHeader(E))})):Array.isArray(p)&&p[v]!==void 0?p=p[v]:mt(p)?p=p(v):p&&typeof p!="string"&&typeof p!="number"&&(p=v+1),p},this.hasRowHeaders=function(){return!!S.rowHeaders},this.hasColHeaders=function(){if(S.colHeaders!==void 0&&S.colHeaders!==null)return!!S.colHeaders;for(let g=0,p=o.countCols();g<p;g++)if(o.getColHeader(g))return!0;return!1},this.getColHeader=function(g){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const v=o.runHooks("modifyColHeader",g);if(v===void 0){const K=[],oe=o.countCols();for(let y=0;y<oe;y++)K.push(o.getColHeader(y));return K}let E=S.colHeaders;const H=function(K){const oe=[],y=o.countCols();let b=0;for(;b<y;b++)mt(S.columns)&&S.columns(b)&&oe.push(b);return oe[K]},W=o.toPhysicalColumn(v),G=H(W);return S.colHeaders===!1?E=null:S.columns&&mt(S.columns)&&S.columns(G)&&S.columns(G).title?E=S.columns(G).title:S.columns&&S.columns[W]&&S.columns[W].title?E=S.columns[W].title:Array.isArray(S.colHeaders)&&S.colHeaders[W]!==void 0?E=S.colHeaders[W]:mt(S.colHeaders)?E=S.colHeaders(W):S.colHeaders&&typeof S.colHeaders!="string"&&typeof S.colHeaders!="number"&&(E=vK(v)),E=o.runHooks("modifyColumnHeaderValue",E,g,p),E},this._getColWidthFromSettings=function(g){let p;if(g>=0&&(p=o.getCellMeta(0,g).width),(p===void 0||p===S.width)&&(p=S.colWidths),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},this.getColWidth=function(g,p){let v=o._getColWidthFromSettings(g);return v=o.runHooks("modifyColWidth",v,g,p),v===void 0&&(v=Xc),v},this._getRowHeightFromSettings=function(g){const p=this.view.getDefaultRowHeight();let v=S.rowHeights;if(v!=null){switch(typeof v){case"object":v=v[g];break;case"function":v=v(g);break}typeof v=="string"&&(v=parseInt(v,10))}return v!=null&&v<p?p:v},this.getRowHeight=function(g,p){let v=o._getRowHeightFromSettings(g);return v=o.runHooks("modifyRowHeight",v,g,p),v},this.countSourceRows=function(){return l.countRows()},this.countSourceCols=function(){return l.countFirstRowKeys()},this.countRows=function(){return a.getLength()},this.countCols=function(){const g=S.maxCols,p=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(g,p)},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,p=0;return GP(o.countRows()-1,v=>{if(o.isEmptyRow(v))p+=1;else if(g===!0)return!1}),p},this.countEmptyCols=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,p=0;return GP(o.countCols()-1,v=>{if(o.isEmptyCol(v))p+=1;else if(g===!0)return!1}),p},this.isEmptyRow=function(g){return S.isEmptyRow.call(o,g)},this.isEmptyCol=function(g){return S.isEmptyCol.call(o,g)},this.selectCell=function(g,p,v,E){let H=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,W=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return _t(g)||_t(p)?!1:this.selectCells([[g,p,v,E]],H,W)},this.selectCells=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;p===!1&&d.suspend();const E=j.selectCells(g);return E&&v&&o.listen(),d.resume(),E},this.selectColumns=function(g){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,v=arguments.length>2?arguments[2]:void 0;return j.selectColumns(g,p,v)},this.selectRows=function(g){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,v=arguments.length>2?arguments[2]:void 0;return j.selectRows(g,p,v)},this.deselectCell=function(){j.deselect()},this.selectAll=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,v=arguments.length>2?arguments[2]:void 0;d.skipNextScrollCycle(),j.selectAll(g,p,v)};const Le=(g,p)=>g.getNearestNotHiddenIndex(p,1,!0);this.scrollViewportTo=function(g){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:v,col:E,considerHiddenIndexes:H}=g??{};let W=v,G=E;if(H===void 0||H){const y=Number.isInteger(v)&&v>=0,b=Number.isInteger(E)&&E>=0,T=y?Le(this.rowIndexMapper,v):void 0,k=b?Le(this.columnIndexMapper,E):void 0;if(T===null||k===null)return!1;W=y?o.rowIndexMapper.getRenderableFromVisualIndex(T):v,G=b?o.columnIndexMapper.getRenderableFromVisualIndex(k):E}const K=Number.isInteger(W),oe=Number.isInteger(G);return K&&W>=0&&oe&&G>=0?o.view.scrollViewport(o._createCellCoords(W,G),g.horizontalSnap,g.verticalSnap):K&&W>=0&&(oe&&G<0||!oe)?o.view.scrollViewportVertically(W,g.verticalSnap):oe&&G>=0&&(K&&W<0||!K)?o.view.scrollViewportHorizontally(G,g.horizontalSnap):!1},this.scrollToFocusedCell=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};if(!this.selection.isSelected())return;this.addHookOnce("afterScroll",g);const{highlight:p}=this.getSelectedRangeLast();this.scrollViewportTo(p.toObject())?this.view.render():(this.removeHook("afterScroll",g),this._registerImmediate(()=>g()))},this.destroy=function(){if(o._clearTimeouts(),o._clearImmediates(),o.view&&o.view.destroy(),l&&l.destroy(),l=null,this.getShortcutManager().destroy(),w.clearCache(),fb.delete(this.guid),Wm(o)){const g=this.rootDocument.querySelector(".hot-display-license-info");g&&g.parentNode.removeChild(g)}ma(o.rootElement),s.destroy(),c&&c.destroy(),o.batchExecution(()=>{o.rowIndexMapper.unregisterAll(),o.columnIndexMapper.unregisterAll(),I.getItems().forEach(g=>{let[,p]=g;p.destroy()}),I.clear(),o.runHooks("afterDestroy")},!0),ie.getSingleton().destroy(o),He(o,(g,p,v)=>{mt(g)?v[p]=Rt(p):p!=="guid"&&(v[p]=null)}),o.isDestroyed=!0,a&&a.destroy(),a=null,u=null,j=null,c=null,o=null};function Rt(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 I.getItem($o(g))},this.getPluginName=function(g){return g===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:I.getId(g)},this.getInstance=function(){return o},this.addHook=function(g,p,v){ie.getSingleton().add(g,p,o,v)},this.hasHook=function(g){return ie.getSingleton().has(g,o)||ie.getSingleton().has(g)},this.addHookOnce=function(g,p,v){ie.getSingleton().once(g,p,o,v)},this.removeHook=function(g,p){ie.getSingleton().remove(g,p,o)},this.runHooks=function(g,p,v,E,H,W,G){return ie.getSingleton().run(o,g,p,v,E,H,W,G)},this.getTranslatedPhrase=function(g,p){return TD(S.language,g,p)},this.toHTML=()=>zP(this),this.toTableElement=()=>{const g=this.rootDocument.createElement("div");return g.insertAdjacentHTML("afterbegin",zP(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 p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,v=g;typeof v=="function"&&(v=setTimeout(v,p)),this.timeouts.push(v)},this._clearTimeouts=function(){M(this.timeouts,g=>{clearTimeout(g)})},this.immediates=[],this._registerImmediate=function(g){this.immediates.push(setImmediate(g))},this._clearImmediates=function(){M(this.immediates,g=>{clearImmediate(g)})},this._getEditorManager=function(){return c};const Zt=PX({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&&Zt.releasePressedKeys()}),this.getShortcutManager=function(){return Zt},this.getFocusManager=function(){return h},UN().forEach(g=>{const p=YE(g);I.addItem(g,new p(this))}),dX(o),Zt.setActiveContextName("grid"),ie.getSingleton().run(o,"construct")}function ux(t,e,n){t.addEventListener(e,n,!1)}function cx(t,e,n){t.removeEventListener(e,n,!1)}function Pg(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function VD(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=Pg(s).fontSize,o.style.fontFamily=Pg(s).fontFamily,o.style.whiteSpace="pre",r.appendChild(o);const f=parseInt(((h=Pg(s))===null||h===void 0?void 0:h.paddingInlineStart)||0,10),m=parseInt(((d=Pg(s))===null||d===void 0?void 0:d.paddingInlineEnd)||0,10),C=o.clientWidth+f+m+1;r.removeChild(o);const w=s.style;w.height=`${n.minHeight}px`,n.minWidth>C?w.width=`${n.minWidth}px`:C>n.maxWidth?w.width=`${n.maxWidth}px`:w.width=`${C}px`;const S=s.scrollHeight?s.scrollHeight-1:0;n.minHeight>S?w.height=`${n.minHeight}px`:n.maxHeight<S?(w.height=`${n.maxHeight}px`,w.overflowY="visible"):w.height=`${S}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&&(ux(s,"input",a),ux(s,"keydown",l)),a()}return{init:c,resize:a,unObserve(){cx(s,"input",a),cx(s,"keydown",l)}}}function hx(t,e){const n=bN(e),r=e.value.split(`
|
|
61
|
-
`);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}mw(e,i)}function Il(t,e,n){return(e=OX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OX(t){var e=xX(t,"string");return typeof e=="symbol"?e:e+""}function xX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 AX="ht_editor_visible",Og="ht_editor_hidden",dx="textEditor",HX="text";class ku extends mh{static get EDITOR_TYPE(){return HX}constructor(e){super(e),Il(this,"eventManager",new Fo(this)),Il(this,"autoResize",VD(this.hot.rootDocument)),Il(this,"TEXTAREA",void 0),Il(this,"textareaStyle",void 0),Il(this,"TEXTAREA_PARENT",void 0),Il(this,"textareaParentStyle",void 0),Il(this,"layerClass",void 0),this.eventManager=new Fo(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(),Fm(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!==Wt.FINISHED&&!this.isOpened()&&this.hideEditableElement()}}beginEditing(e,n){this.state===Wt.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,n))}focus(){this.TEXTAREA.select(),mw(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),be(this.TEXTAREA,[["data-hot-input",""],Nu(-1)]),Y(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"),Y(this.TEXTAREA_PARENT,"handsontableInputHolder"),Ce(this.TEXTAREA_PARENT,this.layerClass)&&we(this.TEXTAREA_PARENT,this.layerClass),Y(this.TEXTAREA_PARENT,Og),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){nz()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",we(this.TEXTAREA_PARENT,this.layerClass),Y(this.TEXTAREA_PARENT,Og)}showEditableElement(){this.textareaParentStyle.height="",this.textareaParentStyle.overflow="",this.textareaParentStyle.position="",this.textareaParentStyle[this.hot.isRtl()?"left":"right"]="auto",this.textareaParentStyle.opacity="1",this.textareaStyle.textIndent="";const e=this.TEXTAREA_PARENT.childNodes;let n=!1;fe(e.length-1,r=>{const i=e[r];if(Ce(i,"handsontableEditor"))return n=!0,!1}),Ce(this.TEXTAREA_PARENT,Og)&&we(this.TEXTAREA_PARENT,Og),n?(this.layerClass=AX,Y(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),Y(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!==Wt.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(){AN()&&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===Wt.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===Wt.EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={runOnlyIf:()=>se(this.hot.getSelected()),group:dx},i=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
|
|
62
|
-
`)};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;hx(a,this.TEXTAREA)}},{keys:[["End"]],callback:(o,s)=>{let[a]=s;hx(a,this.TEXTAREA)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(dx)}}const NX="base";function Ff(t,e,n,r,i,o,s){const a=s.ariaTags,l=[],u=[],c=[],h=[];s.className&&Y(e,s.className),s.readOnly?(l.push(s.readOnlyCellClassName),a&&h.push(dP())):a&&c.push(dP()[0]),s.valid===!1&&s.invalidCellClassName?(l.push(s.invalidCellClassName),a&&h.push(fP())):(u.push(s.invalidCellClassName),a&&c.push(fP()[0])),s.wordWrap===!1&&s.noWordWrapClassName&&l.push(s.noWordWrapClassName),!o&&s.placeholder&&l.push(s.placeholderCellClassName),we(e,u),Y(e,l),dh(e,c),be(e,h)}Ff.RENDERER_TYPE=NX;const DX="text";function _a(t,e,n,r,i,o,s){Ff.apply(this,[t,e,n,r,i,o,s]);let a=o;!a&&s.placeholder&&(a=s.placeholder),a=Kt(a),s.trimWhitespace&&(a=a.trim()),yu(e,a)}_a.RENDERER_TYPE=DX;const kX="text",WD={CELL_TYPE:kX,editor:ku,renderer:_a};Ro(WD);ke.editors={BaseEditor:mh};function ke(t,e){const n=new FD(t,e||{},u0);return n.init(),n}ke.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new FD(t,e,u0)};ke.DefaultSettings=AD();ke.hooks=ie.getSingleton();ke.CellCoords=Su;ke.CellRange=Df;ke.packageName="handsontable";ke.buildDate="19/03/2025 09:41:52";ke.version="15.2.0";ke.languages={dictionaryKeys:QK,getLanguageDictionary:ED,getLanguagesDictionaries:iq,registerLanguageDictionary:v0,getTranslatedPhrase:TD};function CR(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 LX(t){if(Array.isArray(t))return CR(t)}function $X(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cf(t,e,n){return e=pp(e),zX(t,BD()?Reflect.construct(e,n||[],pp(t).constructor):e.apply(t,n))}function Jc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fx(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,jD(r.key),r)}}function Qc(t,e,n){return e&&fx(t.prototype,e),n&&fx(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function FX(t,e,n){return(e=jD(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pp(t){return pp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pp(t)}function hf(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&&yR(t,e)}function BD(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(BD=function(){return!!t})()}function VX(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function WX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
63
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gx(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 BX(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?gx(Object(n),!0).forEach(function(r){FX(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gx(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function jX(t,e){if(t==null)return{};var n,r,i=UX(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 UX(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 zX(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 $X(t)}function yR(t,e){return yR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},yR(t,e)}function YX(t){return LX(t)||VX(t)||KX(t)||WX()}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 String(t)}function jD(t){var e=GX(t,"string");return typeof e=="symbol"?e:e+""}function KX(t,e){if(t){if(typeof t=="string")return CR(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)?CR(t,e):void 0}}var gb=null,qX="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.",XX="The Handsontable instance bound to this component was destroyed and cannot be used properly.",wp="global",ZX="hot-wrapper-editor-container";function JX(){if(typeof console<"u"){var t;(t=console).warn.apply(t,arguments)}}function bR(t,e){var n=At.Children.toArray(t),r=At.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 UD(t){return t?t.type.WrappedComponent?t.type.WrappedComponent:t.type:null}function zD(t,e){if(typeof t>"u"||e===null)return null;var n=GD(e.props,!1);return n.className="".concat(ZX," ").concat(n.className),kH.createPortal(At.createElement("div",Object.assign({},n),e),t.body)}function YD(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wp,r=bR(t,"hot-editor"),i=UD(r);return r?At.cloneElement(r,{emitEditorInstance:function(s,a){e.get(i)||e.set(i,new Map);var l=e.get(i);l.set(a??wp,s)},editorColumnScope:n,isEditor:!0}):null}function QX(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),gb||(gb=n.createDocumentFragment());var o=i??n.createElement("DIV");gb.appendChild(o);var s=At.cloneElement(t,BX({key:"".concat(e.row,"-").concat(e.col)},e));return{portal:kH.createPortal(s,o,r),portalContainer:o}}function GD(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 e9(){return typeof window<"u"}var KD=function(){function t(){Jc(this,t)}return Qc(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(w){return!a&&u.includes(w)?o[w]===n[w]:!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}}])}(),qD=function(t){function e(){return Jc(this,e),cf(this,e,arguments)}return hf(e,t),Qc(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 YD(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=KD.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=zD(r,this.getLocalEditorElement());return At.createElement(At.Fragment,null,i)}}])}(At.Component),t9=function(t){function e(){var n;return Jc(this,e),n=cf(this,e,arguments),n.state={portals:[]},n}return hf(e,t),Qc(e,[{key:"render",value:function(){return At.createElement(At.Fragment,null,this.state.portals)}}])}(At.Component),n9="15.2.0";function r9(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var XD={exports:{}},mb,mx;function i9(){if(mx)return mb;mx=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return mb=t,mb}var pb,px;function o9(){if(px)return pb;px=1;var t=i9();function e(){}function n(){}return n.resetWarningCache=e,pb=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},pb}XD.exports=o9()();var s9=XD.exports,wb=r9(s9),b0=function(t){function e(){var n;return Jc(this,e),n=cf(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 hf(e,t),Qc(e,[{key:"hotInstance",get:function(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn(XX),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 e9()?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(),C="".concat(l,"-").concat(u),w=s.guid,S="".concat(w,"-").concat(C),R="".concat(C,"-").concat(w);if(f.has(C)&&(a.innerHTML=f.get(C).innerHTML),a&&!a.getAttribute("ghost-table")){for(var I=i.portalCache.get(R),O=m.get(S);a.firstChild;)a.removeChild(a.firstChild);if(I&&O)a.appendChild(O);else{var D=QX(r,{TD:a,row:l,col:u,prop:c,value:h,cellProperties:d,isRenderer:!0},a.ownerDocument,R,O),_=D.portal,x=D.portalContainer;m.set(S,x),a.appendChild(x),i.portalCache.set(R,_)}}return f.set(C,a),a}}},{key:"getEditorClass",value:function(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wp,s=UD(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 Jc(this,s),l=cf(this,s,[a]),r.hotCustomEditorInstance=l,l.editorComponent=r,l}return hf(s,o),Qc(s,[{key:"focus",value:function(){}},{key:"getValue",value:function(){}},{key:"setValue",value:function(){}},{key:"open",value:function(){}},{key:"close",value:function(){}}])}(ke.editors.BaseEditor);return Object.getOwnPropertyNames(ke.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 bR(this.props.children,"hot-renderer")}},{key:"getGlobalEditorElement",value:function(){return YD(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=KD.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,wp);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=aR("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=hR("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&&JX(qX)}},{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:YX(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 ke.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===qD},o=At.Children.toArray(this.props.children),s=o.filter(function(u){return i(u)}).map(function(u,c){return At.cloneElement(u,{_componentRendererColumns:r.componentRendererColumns,_emitColumnSettings:r.setHotColumnSettings.bind(r),_columnIndex:c,_getChildElementByType:bR.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=GD(this.props),l=zD(this.getOwnerDocument(),this.getGlobalEditorElement());return At.createElement(At.Fragment,null,At.createElement("div",Object.assign({ref:this.setHotElementRef.bind(this)},a),s),At.createElement(t9,{ref:this.setRenderersPortalManagerRef.bind(this)}),l)}}],[{key:"version",get:function(){return n9}}])}(At.Component);b0.propTypes={style:wb.object,id:wb.string,className:wb.string};var a9=["children"],ZD=At.forwardRef(function(t,e){var n,r=t.children,i=jX(t,a9),o=typeof At.useId=="function"?At.useId():void 0,s=(n=i.id)!==null&&n!==void 0?n:o;return At.createElement(b0,Object.assign({id:s},i,{ref:e}),r)});ZD.version=b0.version;At.Component;const wx="handsontableEditor",l9="handsontable";class S0 extends ku{static get EDITOR_TYPE(){return l9}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(),mw(this.TEXTAREA,0,this.TEXTAREA.value.length),this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),this.refreshDimensions()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s);const a=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,autoWrapCol:!1,autoWrapRow:!1,ariaTags:!1,themeName:this.hot.getCurrentThemeName(),afterOnCellMouseDown(u,c){const h=this.getSourceData(c.row,c.col);h!==void 0&&a.setValue(h),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&rn(l,s.handsontable),this.htOptions=l}beginEditing(e,n){const r=this.hot.getSettings().onBeginEditing;r&&r()===!1||super.beginEditing(e,n)}createElements(){super.createElements();const e=this.hot.rootDocument.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()}finishEditing(e,n,r){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedLast()){const i=this.htEditor.getValue();i!==void 0&&this.setValue(i)}super.finishEditing(e,n,r)}getHeight(){return this.htEditor.view.getTableHeight()+1}getWidth(){return this.htEditor.view.getTableWidth()}assignHooks(){this.hot.addHook("afterDestroy",()=>{var e;(e=this.htEditor)===null||e===void 0||e.destroy()}),this.hot.addHook("afterSetTheme",(e,n)=>{if(!n){var r;(r=this.htEditor)===null||r===void 0||r.useTheme(e)}})}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const r={group:wx,relativeToGroup:pl,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(),jo(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(wx)}}function u9(t,e){JD(t,e),e.add(t)}function c9(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 xg(t,e,n){return(e=h9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h9(t){var e=d9(t,"string");return typeof e=="symbol"?e:e+""}function d9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 vx(t,e){return t.get(SR(t,e))}function SR(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const f9="autocomplete";var vb=new WeakMap,Cb=new WeakSet;class R0 extends S0{constructor(){super(...arguments),u9(this,Cb),xg(this,"query",null),xg(this,"strippedChoices",[]),xg(this,"rawChoices",[]),c9(this,vb,this.hot.guid.slice(0,9)),xg(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=hP(Kt(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 f9}getValue(){const e=this.rawChoices.find(n=>this.stripValueIfNeeded(n)===this.TEXTAREA.value);return se(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),Y(this.htContainer,"autocompleteEditor"),Y(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&be(this.TEXTAREA,[RU(),vU(),hN("listbox"),MU()])}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.hot.getSettings().ariaTags&&be(this.TEXTAREA,[so("false"),IU(`${vx(vb,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==null?void 0:r.length,{row:o,col:s}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",a=>this.onBeforeKeyDown(a)),this.htEditor.updateSettings({colWidths:e?[Gt(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,autoRowSize:!0,renderer:(a,l,u,c,h,d,f)=>{_a(a,l,u,c,h,d,f);const{filteringCaseSensitive:m,allowHtml:C,locale:w}=this.cellProperties,S=this.query;let R=Kt(d),I,O;R&&!C&&(I=m===!0?R.indexOf(S):R.toLocaleLowerCase(w).indexOf(S.toLocaleLowerCase(w)),I!==-1&&(O=R.substr(I,S.length),R=R.replace(O,`<strong>${O}</strong>`))),n&&be(l,[CU(),...r?[AU(i)]:[],...r?[HU(r.indexOf(d)+1)]:[],["id",`${this.htEditor.rootElement.id}_${u}-${c}`]]),l.innerHTML=R},afterSelectionEnd:(a,l)=>{if(n){const u=this.htEditor.getCell(a,l,!0);be(u,[DE()]),be(this.TEXTAREA,...PU(u.id))}}}),n&&(be(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...Es()),be(this.htEditor.rootElement,[cN(),OU("polite"),xU("text"),["id",`${vx(vb,this)}-listbox-${o}-${s}`]]),be(this.TEXTAREA,...so("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&be(this.TEXTAREA,[so("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=bN(this.TEXTAREA),r=WU(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)a=u>0?s[0]: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($m([l])),l.length>0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(a)),this.hot.listen(),mw(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()}),SR(Cb,this,Cx).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),SR(Cb,this,Cx).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)=>o+this.htEditor.getRowHeight(s),0)+n+1}getWidth(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),n=parseInt(e.borderInlineStartWidth,10)+parseInt(e.borderInlineEndWidth,10);return this.htEditor.getColWidth(0)+n}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:n}=this.cellProperties,r=je(e,o=>Kt(o));return je(r,o=>n?o:hP(o))}allowKeyEventPropagation(e){const n=this.htEditor.getSelectedRangeLast(),r={row:n?n.from.row:-1};let i=!1;return e===pe.ARROW_DOWN&&r.row>0&&r.row<this.htEditor.countRows()-1&&(i=!0),e===pe.ARROW_UP&&r.row>-1&&(i=!0),i}onBeforeKeyDown(e){if(iz(e.keyCode)||e.keyCode===pe.BACKSPACE||e.keyCode===pe.DELETE||e.keyCode===pe.INSERT){let n=10;if(e.keyCode===pe.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(n+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},n)}}}function Cx(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.htEditor.getSettings().width+vn(this.hot.rootDocument)})}const g9="checkbox";class QD extends mh{static get EDITOR_TYPE(){return g9}beginEditing(e,n){if(n&&n.type==="mouseup"&&n.target.nodeName==="TD"){const r=this.TD.querySelector('input[type="checkbox"]');Ce(r,"htBadValue")||r.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}/*!
|
|
64
|
-
* Pikaday
|
|
65
|
-
*
|
|
66
|
-
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
|
|
67
|
-
*/const el=()=>window,no=()=>window.document,RR=(t,e)=>window.setTimeout(t,e),hs=function(t,e,n,r){t.addEventListener(e,n,!!r)},Ws=function(t,e,n,r){t.removeEventListener(e,n,!!r)},m9=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},Ni=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},yb=function(t,e){Ni(t,e)||(t.className=t.className===""?e:t.className+" "+e)},bb=function(t,e){t.className=m9((" "+t.className+" ").replace(" "+e+" "," "))},E0=function(t){return/Array/.test(Object.prototype.toString.call(t))},$i=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},p9=function(t){let e=t.getDay();return e===0||e===6},w9=function(t){return t%4===0&&t%100!==0||t%400===0},yx=function(t,e){return[31,w9(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},Ag=function(t){$i(t)&&t.setHours(0,0,0,0)},Hg=function(t,e){return t.getTime()===e.getTime()},vp=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?$i(e[r])?n&&(t[r]=new Date(e[r].getTime())):E0(e[r])?n&&(t[r]=e[r].slice(0)):t[r]=vp({},e[r],n):(n||!i)&&(t[r]=e[r]);return t},bx=function(t,e,n){let r=no().createEvent("HTMLEvents");r.initEvent(e,!0,!1),r=vp(r,n),t.dispatchEvent(r)},Sx=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},Qo={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},Rx=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},v9=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>"},C9=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=24*60*60*1e3,c=(t.getTime()-l.getTime())/u;return 1+Math.round((c-o+a(l.getDay()))/s)},y9=function(t,e,n,r,i){let o=new Date(r,n,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(o).isoWeek():C9(o,i))+"</td>"},b9=function(t,e,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},S9=function(t){return"<tbody>"+t.join("")+"</tbody>"},R9=function(t){let e,n=[];for(t.showWeekNumber&&n.push("<th></th>"),e=0;e<7;e++)n.push('<th scope="col"><abbr title="'+Rx(t,e)+'">'+Rx(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?n.reverse():n).join("")+"</tr></thead>"},E9=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,C=!0,w=!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>",E0(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)&&(C=!1),h&&(r===11||u.maxMonth<=r)&&(w=!1),e===0&&(d+='<button class="pika-prev'+(C?"":" is-disabled")+'" type="button">'+u.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(d+='<button class="pika-next'+(w?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),d+="</div>"},T9=function(t,e,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+R9(t)+S9(e)+"</table>"};function ER(t){let e=this,n=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||el().event;let o=i.target||i.srcElement;if(o)if(Ni(o,"is-disabled")||(Ni(o,"pika-button")&&!Ni(o,"is-empty")&&!Ni(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&&RR(function(){e.hide(),n.blurFieldOnSelect&&n.field&&n.field.blur()},100)):Ni(o,"pika-prev")?e.prevMonth():Ni(o,"pika-next")&&e.nextMonth()),Ni(o,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||el().event;let o=i.target||i.srcElement;o&&(Ni(o,"pika-select-month")?e.gotoMonth(o.value):Ni(o,"pika-select-year")&&e.gotoYear(o.value))},e._onKeyChange=function(i){if(i=i||el().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(),$i(o)&&e.setDate(o),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=no().activeElement;do if(Ni(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=RR(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||el().event;let o=i.target||i.srcElement,s=o;if(o){!hasEventListeners&&Ni(o,"pika-select")&&(o.onchange||(o.setAttribute("onchange","return;"),hs(o,"change",e._onChange)));do if(Ni(s,"pika-single")||s===n.trigger)return;while(s=s.parentNode);e._v&&o!==n.trigger&&s!==n.trigger&&e.hide()}},e.el=no().createElement("div"),e.el.className="pika-single"+(n.isRTL?" is-rtl":"")+(n.theme?" "+n.theme:""),hs(e.el,"mousedown",e._onMouseDown,!0),hs(e.el,"touchend",e._onMouseDown,!0),hs(e.el,"change",e._onChange),n.keyboardInput&&hs(no(),"keydown",e._onKeyChange),n.field&&(n.container?n.container.appendChild(e.el):n.bound?no().body.appendChild(e.el):n.field.parentNode.insertBefore(e.el,n.field.nextSibling),hs(n.field,"change",e._onInputChange),n.defaultDate||(n.defaultDate=e._parseFieldValue(),n.setDefaultDate=!0));let r=n.defaultDate;$i(r)?n.setDefaultDate?e.setDate(r,!0):e.gotoDate(r):e.gotoDate(new Date),n.bound?(this.hide(),e.el.className+=" is-bound",hs(n.trigger,"click",e._onInputClick),hs(n.trigger,"focus",e._onInputFocus),hs(n.trigger,"blur",e._onInputBlur)):this.show()}ER.prototype={config:function(t){this._o||(this._o=vp({},Qo,!0));let e=vp(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,$i(e.minDate)||(e.minDate=!1),$i(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),E0(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))||Qo.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,$i(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 $i(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="",bx(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!$i(t))return;let n=this._o.minDate,r=this._o.maxDate;$i(n)&&t<n?t=n:$i(r)&&t>r&&(t=r),this._d=new Date(t.getTime()),Ag(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),bx(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($i(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]=Sx(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=Sx({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?(Ag(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=Qo.minDate,this._o.minYear=Qo.minYear,this._o.minMonth=Qo.minMonth,this._o.startRange=Qo.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(Ag(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=Qo.maxDate,this._o.maxYear=Qo.maxYear,this._o.maxMonth=Qo.maxMonth,this._o.endRange=Qo.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">'+E9(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"&&RR(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=el().innerWidth||no().documentElement.clientWidth,i=el().innerHeight||no().documentElement.clientHeight,o=no().body.scrollTop||no().documentElement.scrollTop,u=!0,c=!0,l=t.getBoundingClientRect(),s=l.left+el().pageXOffset,a=l.bottom+el().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",yb(this.el,u?"left-aligned":"right-aligned"),yb(this.el,c?"bottom-aligned":"top-aligned"),bb(this.el,u?"right-aligned":"left-aligned"),bb(this.el,c?"top-aligned":"bottom-aligned"))},render:function(t,e,n){let r=this._o,i=new Date,o=yx(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];Ag(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=yx(h,u),m=o+s,C=m;for(;C>7;)C-=7;m+=7-C;let w=!1;for(let S=0,R=0;S<m;S++){let I=new Date(t,e,1+(S-s)),O=$i(this._d)?Hg(I,this._d):!1,D=Hg(I,i),_=r.events.indexOf(I.toDateString())!==-1,x=S<s||S>=o+s,j=1+(S-s),X=e,U=t,Z=r.startRange&&Hg(r.startRange,I),Q=r.endRange&&Hg(r.endRange,I),le=r.startRange&&r.endRange&&r.startRange<I&&I<r.endRange,te=r.minDate&&I<r.minDate||r.maxDate&&I>r.maxDate||r.disableWeekends&&p9(I)||r.disableDayFn&&r.disableDayFn(I);x&&(S<s?(j=f+j,X=u,U=h):(j=j-o,X=c,U=d));let ue={day:j,month:X,year:U,hasEvent:_,isSelected:O,isToday:D,isDisabled:te,isEmpty:x,isStartRange:Z,isEndRange:Q,isInRange:le,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&O&&(w=!0),l.push(v9(ue)),++R===7&&(r.showWeekNumber&&l.unshift(y9(this,S-s,e,t,r.firstWeekOfYearMinDays)),a.push(b9(l,r.isRTL,r.pickWholeWeek,w)),l=[],R=0,w=!1)}return T9(r,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),bb(this.el,"is-hidden"),this._o.bound&&(hs(no(),"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&&Ws(no(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),yb(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(),Ws(this.el,"mousedown",this._onMouseDown,!0),Ws(this.el,"touchend",this._onMouseDown,!0),Ws(this.el,"change",this._onChange),t.keyboardInput&&Ws(no(),"keydown",this._onKeyChange),t.field&&(Ws(t.field,"change",this._onInputChange),t.bound&&(Ws(t.trigger,"click",this._onInputClick),Ws(t.trigger,"focus",this._onInputFocus),Ws(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function _9(t,e){M9(t,e),e.add(t)}function M9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ex(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=P9(t,"string");return typeof e=="symbol"?e:e+""}function P9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Sb(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 ek="date",Tx="dateEditor",O9="DD/MM/YYYY";var Ng=new WeakSet;class tk extends ku{constructor(){super(...arguments),_9(this,Ng),Ex(this,"parentDestroyed",!1),Ex(this,"$datePicker",null)}static get EDITOR_TYPE(){return ek}init(){if(typeof q!="function")throw new Error("You need to include moment.js to your project.");if(typeof ER!="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||(we(this.datePicker,/ht-theme-.*/g),Y(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"),Y(this.datePicker,"htDatepickerHolder");const e=this.hot.getCurrentThemeName();we(this.datePicker,/ht-theme-.*/g),Y(this.datePicker,e),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",n=>{Ce(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:Tx})}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(Tx),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=Sb(Ng,this,Rb).call(this),r=this.hot.view.isMouseDown(),i=e?NN(e.keyCode):!1;let o;this.datePicker.style.display="block",this.$datePicker=new ER(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&&ww(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:Sb(Ng,this,Rb).call(this),r.reposition=r.reposition||!1,r.isRTL=!1,r.onSelect=s=>{let a=s;isNaN(a.getTime())||(a=q(a).format(Sb(Ng,this,Rb).call(this))),this.setValue(a),i&&i(),aa()&&this.hideDatepicker()},r.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),o&&o()},r}refreshDimensions(e){var n;if(super.refreshDimensions(e),this.state!==Wt.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+nn(this.TD)}px`;let d=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?d+=h.right-Gt(this.datePicker):d+=h.left,this.datePickerStyle.left=`${d}px`}else this.hideDatepicker()}}function Rb(){var t;return(t=this.cellProperties.dateFormat)!==null&&t!==void 0?t:O9}const x9="dropdown";class nk extends R0{static get EDITOR_TYPE(){return x9}prepare(e,n,r,i,o,s){s.filter=!1,s.strict=!0,super.prepare(e,n,r,i,o,s)}}const A9="numeric";class rk extends ku{static get EDITOR_TYPE(){return A9}}function H9(t,e,n){return(e=N9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function N9(t){var e=D9(t,"string");return typeof e=="symbol"?e:e+""}function D9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 k9="password";class ik extends ku{constructor(){super(...arguments),H9(this,"autoResize",VD(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}))}static get EDITOR_TYPE(){return k9}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,ma(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const Eb="ht_editor_visible",_x="selectEditor",L9="select";class ok extends mh{static get EDITOR_TYPE(){return L9}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(...fl()),e.appendChild(this.hot.rootDocument.createTextNode("▼")),Y(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",Ce(this.selectWrapper,Eb)&&we(this.selectWrapper,Eb),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),ma(this.select),He(l,(u,c)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=c,fh(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!==Wt.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",Y(this.selectWrapper,Eb)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={group:_x};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(_x)}}const $9="time";class sk extends ku{static get EDITOR_TYPE(){return $9}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.TEXTAREA.dir="ltr"}}function F9(){Di(mh),Di(R0),Di(QD),Di(tk),Di(nk),Di(S0),Di(rk),Di(ik),Di(ok),Di(ku),Di(sk)}const V9="html";function T0(t,e,n,r,i,o,s){Ff.apply(this,[t,e,n,r,i,o,s]),fh(e,o??"",!1)}T0.RENDERER_TYPE=V9;const W9="autocomplete";function ph(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=s.allowHtml?T0:_a,u=a.createElement("DIV"),c=t.getSettings().ariaTags;if(u.className="htAutocompleteArrow",c&&u.setAttribute(...fl()),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),Y(e,"htAutocomplete"),!t.acArrowListener){const h=new Fo(t);t.acArrowListener=function(d){Ce(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()})}}ph.RENDERER_TYPE=W9;const B9="dropdown";function _0(t,e,n,r,i,o,s){ph.apply(this,[t,e,n,r,i,o,s])}_0.RENDERER_TYPE=B9;const Mx=new WeakMap,Ix=new WeakMap,j9="htBadValue",eh="data-row",th="data-col",U9="checkboxRenderer",ak="checkbox";ie.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,n){const{label:r,type:i,row:o,column:s,prop:a}=e;if(i===ak){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 M0(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=t.getSettings().ariaTags;Ff.apply(this,[t,e,n,r,i,o,s]),z9(t);let u=Y9(a);const c=s.label;let h=!1;if(typeof s.checkedTemplate>"u"&&(s.checkedTemplate=!0),typeof s.uncheckedTemplate>"u"&&(s.uncheckedTemplate=!1),ma(e),o===s.checkedTemplate||Kt(o).toLocaleLowerCase(s.locale)===Kt(s.checkedTemplate).toLocaleLowerCase(s.locale)?u.checked=!0:o===s.uncheckedTemplate||Kt(o).toLocaleLowerCase(s.locale)===Kt(s.uncheckedTemplate).toLocaleLowerCase(s.locale)?u.checked=!1:jt(o)?Y(u,"noValue"):(u.style.display="none",Y(u,j9),h=!0),be(u,[[eh,n],[th,r]]),l&&be(u,[lp(u.checked?t.getTranslatedPhrase(Tw):t.getTranslatedPhrase(_w)),gN(u.checked),yU()]),!h&&c){let C="";if(c.value)C=typeof c.value=="function"?c.value.call(this,n,r,i,o):c.value;else if(c.property){const S=t.getDataAtRowProp(n,c.property);C=S!==null?S:""}const w=G9(a,C,c.separated!==!0);c.position==="before"?c.separated?(e.appendChild(w),e.appendChild(u)):(w.appendChild(u),u=w):(!c.position||c.position==="after")&&(c.separated?(e.appendChild(u),e.appendChild(w)):(w.insertBefore(u,w.firstChild),u=w))}(!c||c&&!c.separated)&&e.appendChild(u),h&&e.appendChild(a.createTextNode("#bad-value#")),Mx.has(t)||(Mx.set(t,!0),d());function d(){const w=t.getShortcutManager().getContext("grid"),S={group:U9,relativeToGroup:pl,position:"before"};w.addShortcuts([{keys:[["space"]],callback:()=>(f(),!m()),runOnlyIf:()=>{var R;return(R=t.getSelectedRangeLast())===null||R===void 0?void 0:R.highlight.isCell()}},{keys:[["enter"]],callback:()=>(f(),!m()),runOnlyIf:()=>{const R=t.getSelectedRangeLast();return t.getSettings().enterBeginsEditing&&(R==null?void 0:R.highlight.isCell())&&!t.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(f(!0),!m()),runOnlyIf:()=>{var R;return(R=t.getSelectedRangeLast())===null||R===void 0?void 0:R.highlight.isCell()}}],S)}function f(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const w=t.getSelectedRange(),S=[],R=new Map;let I=[],O=0;if(w){for(let D=0;D<w.length;D++){const{row:_,col:x}=w[D].getTopStartCorner(),{row:j,col:X}=w[D].getBottomEndCorner();for(let U=_;U<=j;U+=1)for(let Z=x;Z<=X;Z+=1){const Q=t.getCellMeta(U,Z);if(Q.hidden)continue;const le={checkedTemplate:Q.checkedTemplate,uncheckedTemplate:Q.uncheckedTemplate};if(Q.type!=="checkbox"){C===!0&&!Q.readOnly&&(R.has(S.length)?R.set(S.length,[...R.get(S.length),[U,Z,null]]):R.set(S.length,[[U,Z,null]]));continue}if(Q.readOnly===!0)continue;typeof Q.checkedTemplate>"u"&&(Q.checkedTemplate=!0),typeof Q.uncheckedTemplate>"u"&&(Q.uncheckedTemplate=!1);const te=t.getDataAtCell(U,Z);C===!1?[Q.checkedTemplate,Q.checkedTemplate.toString()].includes(te)?I.push([U,Z,Q.uncheckedTemplate,le]):[Q.uncheckedTemplate,Q.uncheckedTemplate.toString(),null,void 0].includes(te)&&I.push([U,Z,Q.checkedTemplate,le]):I.push([U,Z,Q.uncheckedTemplate,le]),O+=1}S.push(O),O=0}I.every(D=>{let[,,_]=D;return _===I[0][2]})?I=I.map(D=>{let[_,x,j]=D;return[_,x,j]}):I=I.map(D=>{let[_,x,,j]=D;return[_,x,j.checkedTemplate]}),I.length>0&&S.forEach((D,_)=>{let x=I.splice(0,D);R.size&&R.has(_)&&(x=[...x,...R.get(_)]),t.setDataAtCell(x)})}}function m(){const C=t.getSelectedRange();if(C){for(let w=0;w<C.length;w++){const S=C[w].getTopStartCorner(),R=C[w].getBottomEndCorner();for(let I=S.row;I<=R.row;I++)for(let O=S.col;O<=R.col;O++){if(t.getCellMeta(I,O).readOnly)continue;const _=t.getCell(I,O);if(ol(_)&&_.querySelectorAll("input[type=checkbox]").length>0)return!0}}return!1}}}M0.RENDERER_TYPE=ak;function z9(t){let e=Ix.get(t);if(!e){const{rootElement:n}=t;e=new Fo(t),e.addEventListener(n,"click",r=>q9(r,t)),e.addEventListener(n,"mouseup",r=>K9(r,t)),e.addEventListener(n,"change",r=>X9(r,t)),Ix.set(t,e)}return e}function Y9(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function G9(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 K9(t,e){const{target:n}=t;I0(n)&&(!n.hasAttribute(eh)||!n.hasAttribute(th)||setTimeout(e.listen,10))}function q9(t,e){const{target:n}=t;if(!I0(n)||!n.hasAttribute(eh)||!n.hasAttribute(th))return;const r=parseInt(n.getAttribute(eh),10),i=parseInt(n.getAttribute(th),10);e.getCellMeta(r,i).readOnly&&t.preventDefault()}function X9(t,e){const{target:n}=t;if(!I0(n)||!n.hasAttribute(eh)||!n.hasAttribute(th))return;const r=parseInt(n.getAttribute(eh),10),i=parseInt(n.getAttribute(th),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 I0(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const Z9="handsontable";function P0(t,e,n,r,i,o,s){ph.apply(this,[t,e,n,r,i,o,s])}P0.RENDERER_TYPE=Z9;var J9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Q9(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}/*!
|
|
68
|
-
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
69
|
-
*
|
|
70
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
71
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
72
|
-
* in the Software without restriction, including without limitation the rights
|
|
73
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
74
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
75
|
-
* furnished to do so, subject to the following conditions:
|
|
76
|
-
*
|
|
77
|
-
* The above copyright notice and this permission notice shall be included in
|
|
78
|
-
* all copies or substantial portions of the Software.
|
|
79
|
-
*
|
|
80
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
81
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
82
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
83
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
84
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
85
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
86
|
-
* SOFTWARE.
|
|
87
|
-
*/var Tb,Px;function e4(){return Px||(Px=1,Tb={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}}}),Tb}/*!
|
|
88
|
-
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
89
|
-
*
|
|
90
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
91
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
92
|
-
* in the Software without restriction, including without limitation the rights
|
|
93
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
94
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
95
|
-
* furnished to do so, subject to the following conditions:
|
|
96
|
-
*
|
|
97
|
-
* The above copyright notice and this permission notice shall be included in
|
|
98
|
-
* all copies or substantial portions of the Software.
|
|
99
|
-
*
|
|
100
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
101
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
102
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
103
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
104
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
105
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
106
|
-
* SOFTWARE.
|
|
107
|
-
*/var _b,Ox;function lk(){if(Ox)return _b;Ox=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 C="",w=l.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(w!==l)return-1*n(w,u,c,h,d,f);for(let _=0;_<t.length;_++){let x=t[_];if(C=l.replace(RegExp(`([0-9 ])(${x.key})$`),"$1"),C!==l)return n(C,u,c,h,d,f)*x.factor}if(C=l.replace("%",""),C!==l)return n(C,u,c,h,d,f)/100;let S=parseFloat(l);if(isNaN(S))return;let R=h(S);if(R&&R!=="."&&(C=l.replace(new RegExp(`${e(R)}$`),""),C!==l))return n(C,u,c,h,d,f);let I={};Object.keys(f).forEach(_=>{I[f[_]]=_});let O=Object.keys(I).sort().reverse(),D=O.length;for(let _=0;_<D;_++){let x=O[_],j=I[x];if(C=l.replace(x,""),C!==l){let X;switch(j){case"thousand":X=Math.pow(10,3);break;case"million":X=Math.pow(10,6);break;case"billion":X=Math.pow(10,9);break;case"trillion":X=Math.pow(10,12);break}return n(C,u,c,h,d,f)*X}}}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 C=r(l,u,c);return n(C,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=A0();let h=c.currentDelimiters(),d=c.currentCurrency().symbol,f=c.currentOrdinal(),m=c.getZeroFormat(),C=c.currentAbbreviations(),w;if(typeof l=="string")o(l,h)?w=s(l):w=i(l,h,d,f,m,C);else if(typeof l=="number")w=l;else return;if(w!==void 0)return w}return _b={unformat:a},_b}/*!
|
|
108
|
-
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
109
|
-
*
|
|
110
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
111
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
112
|
-
* in the Software without restriction, including without limitation the rights
|
|
113
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
114
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
115
|
-
* furnished to do so, subject to the following conditions:
|
|
116
|
-
*
|
|
117
|
-
* The above copyright notice and this permission notice shall be included in
|
|
118
|
-
* all copies or substantial portions of the Software.
|
|
119
|
-
*
|
|
120
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
121
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
122
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
123
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
124
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
125
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
126
|
-
* SOFTWARE.
|
|
127
|
-
*/var Mb,xx;function O0(){if(xx)return Mb;xx=1;let t=lk();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:(w,S)=>S.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:w=>w.output==="byte"},characteristic:{type:"number",restriction:w=>w>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:r},average:"boolean",lowPrecision:{type:"boolean",restriction:(w,S)=>S.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:w=>w>=0,message:"value must be positive"},{restriction:(w,S)=>!S.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:w=>w>=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:(w,S)=>S.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},c={languageTag:{type:"string",mandatory:!0,restriction:w=>w.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(w,S){let R=d(w),I=m(S);return R&&I}function d(w){return t.unformat(w)!==void 0}function f(w,S,R,I=!1){let O=Object.keys(w).map(D=>{if(!S[D])return console.error(`${R} Invalid key: ${D}`),!1;let _=w[D],x=S[D];if(typeof x=="string"&&(x={type:x}),x.type==="format"){if(!f(_,u,`[Validate ${D}]`,!0))return!1}else if(typeof _!==x.type)return console.error(`${R} ${D} type mismatched: "${x.type}" expected, "${typeof _}" provided`),!1;if(x.restrictions&&x.restrictions.length){let j=x.restrictions.length;for(let X=0;X<j;X++){let{restriction:U,message:Z}=x.restrictions[X];if(!U(_,w))return console.error(`${R} ${D} invalid value: ${Z}`),!1}}return x.restriction&&!x.restriction(_,w)?(console.error(`${R} ${D} invalid value: ${x.message}`),!1):x.validValues&&x.validValues.indexOf(_)===-1?(console.error(`${R} ${D} invalid value: must be among ${JSON.stringify(x.validValues)}, "${_}" provided`),!1):!(x.children&&!f(_,x.children,`[Validate ${D}]`))});return I||O.push(...Object.keys(S).map(D=>{let _=S[D];if(typeof _=="string"&&(_={type:_}),_.mandatory){let x=_.mandatory;if(typeof x=="function"&&(x=x(w)),x&&w[D]===void 0)return console.error(`${R} Missing mandatory key "${D}"`),!1}return!0})),O.reduce((D,_)=>D&&_,!0)}function m(w){return f(w,u,"[Validate format]")}function C(w){return f(w,c,"[Validate language]")}return Mb={validate:h,validateFormat:m,validateInput:d,validateLanguage:C},Mb}/*!
|
|
128
|
-
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
129
|
-
*
|
|
130
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
131
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
132
|
-
* in the Software without restriction, including without limitation the rights
|
|
133
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
134
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
135
|
-
* furnished to do so, subject to the following conditions:
|
|
136
|
-
*
|
|
137
|
-
* The above copyright notice and this permission notice shall be included in
|
|
138
|
-
* all copies or substantial portions of the Software.
|
|
139
|
-
*
|
|
140
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
141
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
142
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
143
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
144
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
145
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
146
|
-
* SOFTWARE.
|
|
147
|
-
*/function t4(t,e){let n=t.match(/^{([^}]*)}/);return n?(e.prefix=n[1],t.slice(n[0].length)):t}function n4(t,e){let n=t.match(/{([^}]*)}$/);return n?(e.postfix=n[1],t.slice(0,-n[0].length)):t}function r4(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 i4(t,e){t.indexOf(",")!==-1&&(e.thousandSeparated=!0)}function o4(t,e){t.indexOf(" ")!==-1&&(e.spaceSeparated=!0,e.spaceSeparatedCurrency=!0,(e.average||e.forceAverage)&&(e.spaceSeparatedAbbreviation=!0))}function s4(t,e){let n=t.match(/[1-9]+[0-9]*/);n&&(e.totalLength=+n[0])}function a4(t,e){let r=t.split(".")[0].match(/0+/);r&&(e.characteristic=r[0].length)}function l4(t,e){let n=t.split(".")[1];if(n){let r=n.match(/0+/);r&&(e.mantissa=r[0].length)}}function u4(t,e){const n=t.split(".")[1];n&&(e.trimMantissa=n.indexOf("[")!==-1)}function c4(t,e){t.indexOf("a")!==-1&&(e.average=!0)}function h4(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 d4(t,e){t.match(/\[\.]/)?e.optionalMantissa=!0:t.match(/\./)&&(e.optionalMantissa=!1)}function f4(t,e){if(t.indexOf(".")!==-1){let n=t.split(".")[0];e.optionalCharacteristic=n.indexOf("0")===-1}}function g4(t,e){t.match(/^\+?\([^)]*\)$/)&&(e.negative="parenthesis"),t.match(/^\+?-/)&&(e.negative="sign")}function m4(t,e){t.match(/^\+/)&&(e.forceSign=!0)}function p4(t,e={}){return typeof t!="string"?t:(t=t4(t,e),t=n4(t,e),r4(t,e),s4(t,e),a4(t,e),f4(t,e),c4(t,e),h4(t,e),l4(t,e),d4(t,e),u4(t,e),i4(t,e),o4(t,e),g4(t,e),m4(t,e),e)}var x0={parseFormat:p4};/*!
|
|
148
|
-
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
149
|
-
*
|
|
150
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
151
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
152
|
-
* in the Software without restriction, including without limitation the rights
|
|
153
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
154
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
155
|
-
* furnished to do so, subject to the following conditions:
|
|
156
|
-
*
|
|
157
|
-
* The above copyright notice and this permission notice shall be included in
|
|
158
|
-
* all copies or substantial portions of the Software.
|
|
159
|
-
*
|
|
160
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
161
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
162
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
163
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
164
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
165
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
166
|
-
* SOFTWARE.
|
|
167
|
-
*/var Ib,Ax;function A0(){if(Ax)return Ib;Ax=1;const t=e4(),e=O0(),n=x0;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,Ib=r,Ib}function w4(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.')}/*!
|
|
168
|
-
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
169
|
-
*
|
|
170
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
171
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
172
|
-
* in the Software without restriction, including without limitation the rights
|
|
173
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
174
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
175
|
-
* furnished to do so, subject to the following conditions:
|
|
176
|
-
*
|
|
177
|
-
* The above copyright notice and this permission notice shall be included in
|
|
178
|
-
* all copies or substantial portions of the Software.
|
|
179
|
-
*
|
|
180
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
181
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
182
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
183
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
184
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
185
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
186
|
-
* SOFTWARE.
|
|
187
|
-
*/function v4(t,e){t.forEach(n=>{let r;try{r=w4(`../languages/${n}`)}catch{console.error(`Unable to load "${n}". No matching language file found.`)}r&&e.registerLanguage(r)})}var C4=t=>({loadLanguagesInNode:e=>v4(e,t)}),uk={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(_){var x,j,X,U=E.prototype={constructor:E,toString:null,valueOf:null},Z=new E(1),Q=20,le=4,te=-7,ue=21,ft=-1e7,Re=1e7,Le=!1,Rt=1,Zt=0,g={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},p="0123456789abcdefghijklmnopqrstuvwxyz",v=!0;function E(y,b){var T,k,A,$,B,P,L,F,V=this;if(!(V instanceof E))return new E(y,b);if(b==null){if(y&&y._isBigNumber===!0){V.s=y.s,!y.c||y.e>Re?V.c=V.e=null:y.e<ft?V.c=[V.e=0]:(V.e=y.e,V.c=y.c.slice());return}if((P=typeof y=="number")&&y*0==0){if(V.s=1/y<0?(y=-y,-1):1,y===~~y){for($=0,B=y;B>=10;B/=10,$++);$>Re?V.c=V.e=null:(V.e=$,V.c=[y]);return}F=String(y)}else{if(!r.test(F=String(y)))return X(V,F,P);V.s=F.charCodeAt(0)==45?(F=F.slice(1),-1):1}($=F.indexOf("."))>-1&&(F=F.replace(".","")),(B=F.search(/e/i))>0?($<0&&($=B),$+=+F.slice(B+1),F=F.substring(0,B)):$<0&&($=F.length)}else{if(R(b,2,p.length,"Base"),b==10&&v)return V=new E(y),K(V,Q+V.e+1,le);if(F=String(y),P=typeof y=="number"){if(y*0!=0)return X(V,F,P,b);if(V.s=1/y<0?(F=F.slice(1),-1):1,E.DEBUG&&F.replace(/^0\.0*|\./,"").length>15)throw Error(a+y)}else V.s=F.charCodeAt(0)===45?(F=F.slice(1),-1):1;for(T=p.slice(0,b),$=B=0,L=F.length;B<L;B++)if(T.indexOf(k=F.charAt(B))<0){if(k=="."){if(B>$){$=L;continue}}else if(!A&&(F==F.toUpperCase()&&(F=F.toLowerCase())||F==F.toLowerCase()&&(F=F.toUpperCase()))){A=!0,B=-1,$=0;continue}return X(V,String(y),P,b)}P=!1,F=j(F,b,10,V.s),($=F.indexOf("."))>-1?F=F.replace(".",""):$=F.length}for(B=0;F.charCodeAt(B)===48;B++);for(L=F.length;F.charCodeAt(--L)===48;);if(F=F.slice(B,++L)){if(L-=B,P&&E.DEBUG&&L>15&&(y>c||y!==o(y)))throw Error(a+V.s*y);if(($=$-B-1)>Re)V.c=V.e=null;else if($<ft)V.c=[V.e=0];else{if(V.e=$,V.c=[],B=($+1)%u,$<0&&(B+=u),B<L){for(B&&V.c.push(+F.slice(0,B)),L-=u;B<L;)V.c.push(+F.slice(B,B+=u));B=u-(F=F.slice(B)).length}else B-=L;for(;B--;F+="0");V.c.push(+F)}}else V.c=[V.e=0]}E.clone=m,E.ROUND_UP=0,E.ROUND_DOWN=1,E.ROUND_CEIL=2,E.ROUND_FLOOR=3,E.ROUND_HALF_UP=4,E.ROUND_HALF_DOWN=5,E.ROUND_HALF_EVEN=6,E.ROUND_HALF_CEIL=7,E.ROUND_HALF_FLOOR=8,E.EUCLID=9,E.config=E.set=function(y){var b,T;if(y!=null)if(typeof y=="object"){if(y.hasOwnProperty(b="DECIMAL_PLACES")&&(T=y[b],R(T,0,f,b),Q=T),y.hasOwnProperty(b="ROUNDING_MODE")&&(T=y[b],R(T,0,8,b),le=T),y.hasOwnProperty(b="EXPONENTIAL_AT")&&(T=y[b],T&&T.pop?(R(T[0],-1e9,0,b),R(T[1],0,f,b),te=T[0],ue=T[1]):(R(T,-1e9,f,b),te=-(ue=T<0?-T:T))),y.hasOwnProperty(b="RANGE"))if(T=y[b],T&&T.pop)R(T[0],-1e9,-1,b),R(T[1],1,f,b),ft=T[0],Re=T[1];else if(R(T,-1e9,f,b),T)ft=-(Re=T<0?-T:T);else throw Error(s+b+" cannot be zero: "+T);if(y.hasOwnProperty(b="CRYPTO"))if(T=y[b],T===!!T)if(T)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))Le=T;else throw Le=!T,Error(s+"crypto unavailable");else Le=T;else throw Error(s+b+" not true or false: "+T);if(y.hasOwnProperty(b="MODULO_MODE")&&(T=y[b],R(T,0,9,b),Rt=T),y.hasOwnProperty(b="POW_PRECISION")&&(T=y[b],R(T,0,f,b),Zt=T),y.hasOwnProperty(b="FORMAT"))if(T=y[b],typeof T=="object")g=T;else throw Error(s+b+" not an object: "+T);if(y.hasOwnProperty(b="ALPHABET"))if(T=y[b],typeof T=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(T))v=T.slice(0,10)=="0123456789",p=T;else throw Error(s+b+" invalid: "+T)}else throw Error(s+"Object expected: "+y);return{DECIMAL_PLACES:Q,ROUNDING_MODE:le,EXPONENTIAL_AT:[te,ue],RANGE:[ft,Re],CRYPTO:Le,MODULO_MODE:Rt,POW_PRECISION:Zt,FORMAT:g,ALPHABET:p}},E.isBigNumber=function(y){if(!y||y._isBigNumber!==!0)return!1;if(!E.DEBUG)return!0;var b,T,k=y.c,A=y.e,$=y.s;e:if({}.toString.call(k)=="[object Array]"){if(($===1||$===-1)&&A>=-1e9&&A<=f&&A===o(A)){if(k[0]===0){if(A===0&&k.length===1)return!0;break e}if(b=(A+1)%u,b<1&&(b+=u),String(k[0]).length==b){for(b=0;b<k.length;b++)if(T=k[b],T<0||T>=l||T!==o(T))break e;if(T!==0)return!0}}}else if(k===null&&A===null&&($===null||$===1||$===-1))return!0;throw Error(s+"Invalid BigNumber: "+y)},E.maximum=E.max=function(){return W(arguments,-1)},E.minimum=E.min=function(){return W(arguments,1)},E.random=function(){var y=9007199254740992,b=Math.random()*y&2097151?function(){return o(Math.random()*y)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(T){var k,A,$,B,P,L=0,F=[],V=new E(Z);if(T==null?T=Q:R(T,0,f),B=i(T/u),Le)if(crypto.getRandomValues){for(k=crypto.getRandomValues(new Uint32Array(B*=2));L<B;)P=k[L]*131072+(k[L+1]>>>11),P>=9e15?(A=crypto.getRandomValues(new Uint32Array(2)),k[L]=A[0],k[L+1]=A[1]):(F.push(P%1e14),L+=2);L=B/2}else if(crypto.randomBytes){for(k=crypto.randomBytes(B*=7);L<B;)P=(k[L]&31)*281474976710656+k[L+1]*1099511627776+k[L+2]*4294967296+k[L+3]*16777216+(k[L+4]<<16)+(k[L+5]<<8)+k[L+6],P>=9e15?crypto.randomBytes(7).copy(k,L):(F.push(P%1e14),L+=7);L=B/7}else throw Le=!1,Error(s+"crypto unavailable");if(!Le)for(;L<B;)P=b(),P<9e15&&(F[L++]=P%1e14);for(B=F[--L],T%=u,B&&T&&(P=h[u-T],F[L]=o(B/P)*P);F[L]===0;F.pop(),L--);if(L<0)F=[$=0];else{for($=-1;F[0]===0;F.splice(0,1),$-=u);for(L=1,P=F[0];P>=10;P/=10,L++);L<u&&($-=u-L)}return V.e=$,V.c=F,V}}(),E.sum=function(){for(var y=1,b=arguments,T=new E(b[0]);y<b.length;)T=T.plus(b[y++]);return T},j=function(){var y="0123456789";function b(T,k,A,$){for(var B,P=[0],L,F=0,V=T.length;F<V;){for(L=P.length;L--;P[L]*=k);for(P[0]+=$.indexOf(T.charAt(F++)),B=0;B<P.length;B++)P[B]>A-1&&(P[B+1]==null&&(P[B+1]=0),P[B+1]+=P[B]/A|0,P[B]%=A)}return P.reverse()}return function(T,k,A,$,B){var P,L,F,V,z,ce,de,Se,Ne=T.indexOf("."),Be=Q,Me=le;for(Ne>=0&&(V=Zt,Zt=0,T=T.replace(".",""),Se=new E(k),ce=Se.pow(T.length-Ne),Zt=V,Se.c=b(D(w(ce.c),ce.e,"0"),10,A,y),Se.e=Se.c.length),de=b(T,k,A,B?(P=p,y):(P=y,p)),F=V=de.length;de[--V]==0;de.pop());if(!de[0])return P.charAt(0);if(Ne<0?--F:(ce.c=de,ce.e=F,ce.s=$,ce=x(ce,Se,Be,Me,A),de=ce.c,z=ce.r,F=ce.e),L=F+Be+1,Ne=de[L],V=A/2,z=z||L<0||de[L+1]!=null,z=Me<4?(Ne!=null||z)&&(Me==0||Me==(ce.s<0?3:2)):Ne>V||Ne==V&&(Me==4||z||Me==6&&de[L-1]&1||Me==(ce.s<0?8:7)),L<1||!de[0])T=z?D(P.charAt(1),-Be,P.charAt(0)):P.charAt(0);else{if(de.length=L,z)for(--A;++de[--L]>A;)de[L]=0,L||(++F,de=[1].concat(de));for(V=de.length;!de[--V];);for(Ne=0,T="";Ne<=V;T+=P.charAt(de[Ne++]));T=D(T,F,P.charAt(0))}return T}}(),x=function(){function y(k,A,$){var B,P,L,F,V=0,z=k.length,ce=A%d,de=A/d|0;for(k=k.slice();z--;)L=k[z]%d,F=k[z]/d|0,B=de*L+F*ce,P=ce*L+B%d*d+V,V=(P/$|0)+(B/d|0)+de*F,k[z]=P%$;return V&&(k=[V].concat(k)),k}function b(k,A,$,B){var P,L;if($!=B)L=$>B?1:-1;else for(P=L=0;P<$;P++)if(k[P]!=A[P]){L=k[P]>A[P]?1:-1;break}return L}function T(k,A,$,B){for(var P=0;$--;)k[$]-=P,P=k[$]<A[$]?1:0,k[$]=P*B+k[$]-A[$];for(;!k[0]&&k.length>1;k.splice(0,1));}return function(k,A,$,B,P){var L,F,V,z,ce,de,Se,Ne,Be,Me,$e,kt,go,zo,fn,Jt,Lt,pt=k.s==A.s?1:-1,nt=k.c,Fe=A.c;if(!nt||!nt[0]||!Fe||!Fe[0])return new E(!k.s||!A.s||(nt?Fe&&nt[0]==Fe[0]:!Fe)?NaN:nt&&nt[0]==0||!Fe?pt*0:pt/0);for(Ne=new E(pt),Be=Ne.c=[],F=k.e-A.e,pt=$+F+1,P||(P=l,F=C(k.e/u)-C(A.e/u),pt=pt/u|0),V=0;Fe[V]==(nt[V]||0);V++);if(Fe[V]>(nt[V]||0)&&F--,pt<0)Be.push(1),z=!0;else{for(zo=nt.length,Jt=Fe.length,V=0,pt+=2,ce=o(P/(Fe[0]+1)),ce>1&&(Fe=y(Fe,ce,P),nt=y(nt,ce,P),Jt=Fe.length,zo=nt.length),go=Jt,Me=nt.slice(0,Jt),$e=Me.length;$e<Jt;Me[$e++]=0);Lt=Fe.slice(),Lt=[0].concat(Lt),fn=Fe[0],Fe[1]>=P/2&&fn++;do{if(ce=0,L=b(Fe,Me,Jt,$e),L<0){if(kt=Me[0],Jt!=$e&&(kt=kt*P+(Me[1]||0)),ce=o(kt/fn),ce>1)for(ce>=P&&(ce=P-1),de=y(Fe,ce,P),Se=de.length,$e=Me.length;b(de,Me,Se,$e)==1;)ce--,T(de,Jt<Se?Lt:Fe,Se,P),Se=de.length,L=1;else ce==0&&(L=ce=1),de=Fe.slice(),Se=de.length;if(Se<$e&&(de=[0].concat(de)),T(Me,de,$e,P),$e=Me.length,L==-1)for(;b(Fe,Me,Jt,$e)<1;)ce++,T(Me,Jt<$e?Lt:Fe,$e,P),$e=Me.length}else L===0&&(ce++,Me=[0]);Be[V++]=ce,Me[0]?Me[$e++]=nt[go]||0:(Me=[nt[go]],$e=1)}while((go++<zo||Me[0]!=null)&&pt--);z=Me[0]!=null,Be[0]||Be.splice(0,1)}if(P==l){for(V=1,pt=Be[0];pt>=10;pt/=10,V++);K(Ne,$+(Ne.e=V+F*u-1)+1,B,z)}else Ne.e=F,Ne.r=+z;return Ne}}();function H(y,b,T,k){var A,$,B,P,L;if(T==null?T=le:R(T,0,8),!y.c)return y.toString();if(A=y.c[0],B=y.e,b==null)L=w(y.c),L=k==1||k==2&&(B<=te||B>=ue)?O(L,B):D(L,B,"0");else if(y=K(new E(y),b,T),$=y.e,L=w(y.c),P=L.length,k==1||k==2&&(b<=$||$<=te)){for(;P<b;L+="0",P++);L=O(L,$)}else if(b-=B,L=D(L,$,"0"),$+1>P){if(--b>0)for(L+=".";b--;L+="0");}else if(b+=$-P,b>0)for($+1==P&&(L+=".");b--;L+="0");return y.s<0&&A?"-"+L:L}function W(y,b){for(var T,k,A=1,$=new E(y[0]);A<y.length;A++)k=new E(y[A]),(!k.s||(T=S($,k))===b||T===0&&$.s===b)&&($=k);return $}function G(y,b,T){for(var k=1,A=b.length;!b[--A];b.pop());for(A=b[0];A>=10;A/=10,k++);return(T=k+T*u-1)>Re?y.c=y.e=null:T<ft?y.c=[y.e=0]:(y.e=T,y.c=b),y}X=function(){var y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,T=/^\.([^.]+)$/,k=/^-?(Infinity|NaN)$/,A=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,B,P,L){var F,V=P?B:B.replace(A,"");if(k.test(V))$.s=isNaN(V)?null:V<0?-1:1;else{if(!P&&(V=V.replace(y,function(z,ce,de){return F=(de=de.toLowerCase())=="x"?16:de=="b"?2:8,!L||L==F?ce:z}),L&&(F=L,V=V.replace(b,"$1").replace(T,"0.$1")),B!=V))return new E(V,F);if(E.DEBUG)throw Error(s+"Not a"+(L?" base "+L:"")+" number: "+B);$.s=null}$.c=$.e=null}}();function K(y,b,T,k){var A,$,B,P,L,F,V,z=y.c,ce=h;if(z){e:{for(A=1,P=z[0];P>=10;P/=10,A++);if($=b-A,$<0)$+=u,B=b,L=z[F=0],V=o(L/ce[A-B-1]%10);else if(F=i(($+1)/u),F>=z.length)if(k){for(;z.length<=F;z.push(0));L=V=0,A=1,$%=u,B=$-u+1}else break e;else{for(L=P=z[F],A=1;P>=10;P/=10,A++);$%=u,B=$-u+A,V=B<0?0:o(L/ce[A-B-1]%10)}if(k=k||b<0||z[F+1]!=null||(B<0?L:L%ce[A-B-1]),k=T<4?(V||k)&&(T==0||T==(y.s<0?3:2)):V>5||V==5&&(T==4||k||T==6&&($>0?B>0?L/ce[A-B]:0:z[F-1])%10&1||T==(y.s<0?8:7)),b<1||!z[0])return z.length=0,k?(b-=y.e+1,z[0]=ce[(u-b%u)%u],y.e=-b||0):z[0]=y.e=0,y;if($==0?(z.length=F,P=1,F--):(z.length=F+1,P=ce[u-$],z[F]=B>0?o(L/ce[A-B]%ce[B])*P:0),k)for(;;)if(F==0){for($=1,B=z[0];B>=10;B/=10,$++);for(B=z[0]+=P,P=1;B>=10;B/=10,P++);$!=P&&(y.e++,z[0]==l&&(z[0]=1));break}else{if(z[F]+=P,z[F]!=l)break;z[F--]=0,P=1}for($=z.length;z[--$]===0;z.pop());}y.e>Re?y.c=y.e=null:y.e<ft&&(y.c=[y.e=0])}return y}function oe(y){var b,T=y.e;return T===null?y.toString():(b=w(y.c),b=T<=te||T>=ue?O(b,T):D(b,T,"0"),y.s<0?"-"+b:b)}return U.absoluteValue=U.abs=function(){var y=new E(this);return y.s<0&&(y.s=1),y},U.comparedTo=function(y,b){return S(this,new E(y,b))},U.decimalPlaces=U.dp=function(y,b){var T,k,A,$=this;if(y!=null)return R(y,0,f),b==null?b=le:R(b,0,8),K(new E($),y+$.e+1,b);if(!(T=$.c))return null;if(k=((A=T.length-1)-C(this.e/u))*u,A=T[A])for(;A%10==0;A/=10,k--);return k<0&&(k=0),k},U.dividedBy=U.div=function(y,b){return x(this,new E(y,b),Q,le)},U.dividedToIntegerBy=U.idiv=function(y,b){return x(this,new E(y,b),0,1)},U.exponentiatedBy=U.pow=function(y,b){var T,k,A,$,B,P,L,F,V,z=this;if(y=new E(y),y.c&&!y.isInteger())throw Error(s+"Exponent not an integer: "+oe(y));if(b!=null&&(b=new E(b)),P=y.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!y.c||!y.c[0])return V=new E(Math.pow(+oe(z),P?y.s*(2-I(y)):+oe(y))),b?V.mod(b):V;if(L=y.s<0,b){if(b.c?!b.c[0]:!b.s)return new E(NaN);k=!L&&z.isInteger()&&b.isInteger(),k&&(z=z.mod(b))}else{if(y.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||P&&z.c[1]>=24e7:z.c[0]<8e13||P&&z.c[0]<=9999975e7)))return $=z.s<0&&I(y)?-0:0,z.e>-1&&($=1/$),new E(L?1/$:$);Zt&&($=i(Zt/u+2))}for(P?(T=new E(.5),L&&(y.s=1),F=I(y)):(A=Math.abs(+oe(y)),F=A%2),V=new E(Z);;){if(F){if(V=V.times(z),!V.c)break;$?V.c.length>$&&(V.c.length=$):k&&(V=V.mod(b))}if(A){if(A=o(A/2),A===0)break;F=A%2}else if(y=y.times(T),K(y,y.e+1,1),y.e>14)F=I(y);else{if(A=+oe(y),A===0)break;F=A%2}z=z.times(z),$?z.c&&z.c.length>$&&(z.c.length=$):k&&(z=z.mod(b))}return k?V:(L&&(V=Z.div(V)),b?V.mod(b):$?K(V,Zt,le,B):V)},U.integerValue=function(y){var b=new E(this);return y==null?y=le:R(y,0,8),K(b,b.e+1,y)},U.isEqualTo=U.eq=function(y,b){return S(this,new E(y,b))===0},U.isFinite=function(){return!!this.c},U.isGreaterThan=U.gt=function(y,b){return S(this,new E(y,b))>0},U.isGreaterThanOrEqualTo=U.gte=function(y,b){return(b=S(this,new E(y,b)))===1||b===0},U.isInteger=function(){return!!this.c&&C(this.e/u)>this.c.length-2},U.isLessThan=U.lt=function(y,b){return S(this,new E(y,b))<0},U.isLessThanOrEqualTo=U.lte=function(y,b){return(b=S(this,new E(y,b)))===-1||b===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,b){var T,k,A,$,B=this,P=B.s;if(y=new E(y,b),b=y.s,!P||!b)return new E(NaN);if(P!=b)return y.s=-b,B.plus(y);var L=B.e/u,F=y.e/u,V=B.c,z=y.c;if(!L||!F){if(!V||!z)return V?(y.s=-b,y):new E(z?B:NaN);if(!V[0]||!z[0])return z[0]?(y.s=-b,y):new E(V[0]?B:le==3?-0:0)}if(L=C(L),F=C(F),V=V.slice(),P=L-F){for(($=P<0)?(P=-P,A=V):(F=L,A=z),A.reverse(),b=P;b--;A.push(0));A.reverse()}else for(k=($=(P=V.length)<(b=z.length))?P:b,P=b=0;b<k;b++)if(V[b]!=z[b]){$=V[b]<z[b];break}if($&&(A=V,V=z,z=A,y.s=-y.s),b=(k=z.length)-(T=V.length),b>0)for(;b--;V[T++]=0);for(b=l-1;k>P;){if(V[--k]<z[k]){for(T=k;T&&!V[--T];V[T]=b);--V[T],V[k]+=l}V[k]-=z[k]}for(;V[0]==0;V.splice(0,1),--F);return V[0]?G(y,V,F):(y.s=le==3?-1:1,y.c=[y.e=0],y)},U.modulo=U.mod=function(y,b){var T,k,A=this;return y=new E(y,b),!A.c||!y.s||y.c&&!y.c[0]?new E(NaN):!y.c||A.c&&!A.c[0]?new E(A):(Rt==9?(k=y.s,y.s=1,T=x(A,y,0,3),y.s=k,T.s*=k):T=x(A,y,0,Rt),y=A.minus(T.times(y)),!y.c[0]&&Rt==1&&(y.s=A.s),y)},U.multipliedBy=U.times=function(y,b){var T,k,A,$,B,P,L,F,V,z,ce,de,Se,Ne,Be,Me=this,$e=Me.c,kt=(y=new E(y,b)).c;if(!$e||!kt||!$e[0]||!kt[0])return!Me.s||!y.s||$e&&!$e[0]&&!kt||kt&&!kt[0]&&!$e?y.c=y.e=y.s=null:(y.s*=Me.s,!$e||!kt?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(k=C(Me.e/u)+C(y.e/u),y.s*=Me.s,L=$e.length,z=kt.length,L<z&&(Se=$e,$e=kt,kt=Se,A=L,L=z,z=A),A=L+z,Se=[];A--;Se.push(0));for(Ne=l,Be=d,A=z;--A>=0;){for(T=0,ce=kt[A]%Be,de=kt[A]/Be|0,B=L,$=A+B;$>A;)F=$e[--B]%Be,V=$e[B]/Be|0,P=de*F+V*ce,F=ce*F+P%Be*Be+Se[$]+T,T=(F/Ne|0)+(P/Be|0)+de*V,Se[$--]=F%Ne;Se[$]=T}return T?++k:Se.splice(0,1),G(y,Se,k)},U.negated=function(){var y=new E(this);return y.s=-y.s||null,y},U.plus=function(y,b){var T,k=this,A=k.s;if(y=new E(y,b),b=y.s,!A||!b)return new E(NaN);if(A!=b)return y.s=-b,k.minus(y);var $=k.e/u,B=y.e/u,P=k.c,L=y.c;if(!$||!B){if(!P||!L)return new E(A/0);if(!P[0]||!L[0])return L[0]?y:new E(P[0]?k:A*0)}if($=C($),B=C(B),P=P.slice(),A=$-B){for(A>0?(B=$,T=L):(A=-A,T=P),T.reverse();A--;T.push(0));T.reverse()}for(A=P.length,b=L.length,A-b<0&&(T=L,L=P,P=T,b=A),A=0;b;)A=(P[--b]=P[b]+L[b]+A)/l|0,P[b]=l===P[b]?0:P[b]%l;return A&&(P=[A].concat(P),++B),G(y,P,B)},U.precision=U.sd=function(y,b){var T,k,A,$=this;if(y!=null&&y!==!!y)return R(y,1,f),b==null?b=le:R(b,0,8),K(new E($),y,b);if(!(T=$.c))return null;if(A=T.length-1,k=A*u+1,A=T[A]){for(;A%10==0;A/=10,k--);for(A=T[0];A>=10;A/=10,k++);}return y&&$.e+1>k&&(k=$.e+1),k},U.shiftedBy=function(y){return R(y,-9007199254740991,c),this.times("1e"+y)},U.squareRoot=U.sqrt=function(){var y,b,T,k,A,$=this,B=$.c,P=$.s,L=$.e,F=Q+4,V=new E("0.5");if(P!==1||!B||!B[0])return new E(!P||P<0&&(!B||B[0])?NaN:B?$:1/0);if(P=Math.sqrt(+oe($)),P==0||P==1/0?(b=w(B),(b.length+L)%2==0&&(b+="0"),P=Math.sqrt(+b),L=C((L+1)/2)-(L<0||L%2),P==1/0?b="5e"+L:(b=P.toExponential(),b=b.slice(0,b.indexOf("e")+1)+L),T=new E(b)):T=new E(P+""),T.c[0]){for(L=T.e,P=L+F,P<3&&(P=0);;)if(A=T,T=V.times(A.plus(x($,A,F,1))),w(A.c).slice(0,P)===(b=w(T.c)).slice(0,P))if(T.e<L&&--P,b=b.slice(P-3,P+1),b=="9999"||!k&&b=="4999"){if(!k&&(K(A,A.e+Q+2,0),A.times(A).eq($))){T=A;break}F+=4,P+=4,k=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(K(T,T.e+Q+2,1),y=!T.times(T).eq($));break}}return K(T,T.e+Q+1,le,y)},U.toExponential=function(y,b){return y!=null&&(R(y,0,f),y++),H(this,y,b,1)},U.toFixed=function(y,b){return y!=null&&(R(y,0,f),y=y+this.e+1),H(this,y,b)},U.toFormat=function(y,b,T){var k,A=this;if(T==null)y!=null&&b&&typeof b=="object"?(T=b,b=null):y&&typeof y=="object"?(T=y,y=b=null):T=g;else if(typeof T!="object")throw Error(s+"Argument not an object: "+T);if(k=A.toFixed(y,b),A.c){var $,B=k.split("."),P=+T.groupSize,L=+T.secondaryGroupSize,F=T.groupSeparator||"",V=B[0],z=B[1],ce=A.s<0,de=ce?V.slice(1):V,Se=de.length;if(L&&($=P,P=L,L=$,Se-=$),P>0&&Se>0){for($=Se%P||P,V=de.substr(0,$);$<Se;$+=P)V+=F+de.substr($,P);L>0&&(V+=F+de.slice($)),ce&&(V="-"+V)}k=z?V+(T.decimalSeparator||"")+((L=+T.fractionGroupSize)?z.replace(new RegExp("\\d{"+L+"}\\B","g"),"$&"+(T.fractionGroupSeparator||"")):z):V}return(T.prefix||"")+k+(T.suffix||"")},U.toFraction=function(y){var b,T,k,A,$,B,P,L,F,V,z,ce,de=this,Se=de.c;if(y!=null&&(P=new E(y),!P.isInteger()&&(P.c||P.s!==1)||P.lt(Z)))throw Error(s+"Argument "+(P.isInteger()?"out of range: ":"not an integer: ")+oe(P));if(!Se)return new E(de);for(b=new E(Z),F=T=new E(Z),k=L=new E(Z),ce=w(Se),$=b.e=ce.length-de.e-1,b.c[0]=h[(B=$%u)<0?u+B:B],y=!y||P.comparedTo(b)>0?$>0?b:F:P,B=Re,Re=1/0,P=new E(ce),L.c[0]=0;V=x(P,b,0,1),A=T.plus(V.times(k)),A.comparedTo(y)!=1;)T=k,k=A,F=L.plus(V.times(A=F)),L=A,b=P.minus(V.times(A=b)),P=A;return A=x(y.minus(T),k,0,1),L=L.plus(A.times(F)),T=T.plus(A.times(k)),L.s=F.s=de.s,$=$*2,z=x(F,k,$,le).minus(de).abs().comparedTo(x(L,T,$,le).minus(de).abs())<1?[F,k]:[L,T],Re=B,z},U.toNumber=function(){return+oe(this)},U.toPrecision=function(y,b){return y!=null&&R(y,1,f),H(this,y,b,2)},U.toString=function(y){var b,T=this,k=T.s,A=T.e;return A===null?k?(b="Infinity",k<0&&(b="-"+b)):b="NaN":(y==null?b=A<=te||A>=ue?O(w(T.c),A):D(w(T.c),A,"0"):y===10&&v?(T=K(new E(T),Q+A+1,le),b=D(w(T.c),T.e,"0")):(R(y,2,p.length,"Base"),b=j(D(w(T.c),A,"0"),10,y,k,!0)),k<0&&T.c[0]&&(b="-"+b)),b},U.valueOf=U.toJSON=function(){return oe(this)},U._isBigNumber=!0,_!=null&&E.set(_),E}function C(_){var x=_|0;return _>0||_===x?x:x-1}function w(_){for(var x,j,X=1,U=_.length,Z=_[0]+"";X<U;){for(x=_[X++]+"",j=u-x.length;j--;x="0"+x);Z+=x}for(U=Z.length;Z.charCodeAt(--U)===48;);return Z.slice(0,U+1||1)}function S(_,x){var j,X,U=_.c,Z=x.c,Q=_.s,le=x.s,te=_.e,ue=x.e;if(!Q||!le)return null;if(j=U&&!U[0],X=Z&&!Z[0],j||X)return j?X?0:-le:Q;if(Q!=le)return Q;if(j=Q<0,X=te==ue,!U||!Z)return X?0:!U^j?1:-1;if(!X)return te>ue^j?1:-1;for(le=(te=U.length)<(ue=Z.length)?te:ue,Q=0;Q<le;Q++)if(U[Q]!=Z[Q])return U[Q]>Z[Q]^j?1:-1;return te==ue?0:te>ue^j?1:-1}function R(_,x,j,X){if(_<x||_>j||_!==o(_))throw Error(s+(X||"Argument")+(typeof _=="number"?_<x||_>j?" out of range: ":" not an integer: ":" not a primitive number: ")+String(_))}function I(_){var x=_.c.length-1;return C(_.e/u)==x&&_.c[x]%2!=0}function O(_,x){return(_.length>1?_.charAt(0)+"."+_.slice(1):_)+(x<0?"e":"e+")+x}function D(_,x,j){var X,U;if(x<0){for(U=j+".";++x;U+=j);_=U+_}else if(X=_.length,++x>X){for(U=j,x-=X;--x;U+=j);_+=U}else x<X&&(_=_.slice(0,x)+"."+_.slice(x));return _}n=m(),n.default=n.BigNumber=n,t.exports?t.exports=n:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=n)})(J9)})(uk);var ck=uk.exports;/*!
|
|
188
|
-
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
189
|
-
*
|
|
190
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
191
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
192
|
-
* in the Software without restriction, including without limitation the rights
|
|
193
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
194
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
195
|
-
* furnished to do so, subject to the following conditions:
|
|
196
|
-
*
|
|
197
|
-
* The above copyright notice and this permission notice shall be included in
|
|
198
|
-
* all copies or substantial portions of the Software.
|
|
199
|
-
*
|
|
200
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
201
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
202
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
203
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
204
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
205
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
206
|
-
* SOFTWARE.
|
|
207
|
-
*/const _o=A0(),y4=O0(),b4=x0,S4=ck,yn={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},Vf={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:hk,decimalSuffixes:Cp}=_o.currentBytes(),H0={general:{scale:1024,suffixes:Cp},binary:{scale:1024,suffixes:hk},decimal:{scale:1e3,suffixes:Cp}};function R4(t,e={},n){if(typeof e=="string"&&(e=b4.parseFormat(e)),!y4.validateFormat(e))return"ERROR: invalid format";let i=e.prefix||"",o=e.postfix||"",s=E4(t,e,n);return s=j4(s,i),s=U4(s,o),s}function E4(t,e,n){switch(e.output){case"currency":return e=_c(e,_o.currentCurrencyDefaultFormat()),A4(t,e,_o);case"percent":return e=_c(e,_o.currentPercentageDefaultFormat()),x4(t,e,_o,n);case"byte":return e=_c(e,_o.currentByteDefaultFormat()),I4(t,e,_o,n);case"time":return e=_c(e,_o.currentTimeDefaultFormat()),O4(t);case"ordinal":return e=_c(e,_o.currentOrdinalDefaultFormat()),P4(t,e,_o);case"number":default:return Wf({instance:t,providedFormat:e})}}function T4(t){let e=H0.decimal;return Ow(t._value,e.suffixes,e.scale).suffix}function _4(t){let e=H0.binary;return Ow(t._value,e.suffixes,e.scale).suffix}function M4(t){let e=H0.general;return Ow(t._value,e.suffixes,e.scale).suffix}function Ow(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 I4(t,e,n,r){let i=e.base||"binary",o=Object.assign({},Vf,e);const{binarySuffixes:s,decimalSuffixes:a}=n.currentBytes();let u={general:{scale:1024,suffixes:a||Cp,marker:"bd"},binary:{scale:1024,suffixes:s||hk,marker:"b"},decimal:{scale:1e3,suffixes:a||Cp,marker:"d"}}[i],{value:c,suffix:h}=Ow(t._value,u.suffixes,u.scale);return`${Wf({instance:r(c),providedFormat:e,state:n,defaults:n.currentByteDefaultFormat()})}${o.spaceSeparated?" ":""}${h}`}function P4(t,e,n){let r=n.currentOrdinal(),i=Object.assign({},Vf,e),o=Wf({instance:t,providedFormat:e,state:n}),s=r(t._value);return`${o}${i.spaceSeparated?" ":""}${s}`}function O4(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 x4(t,e,n,r){let i=e.prefixSymbol,o=Wf({instance:r(t._value*100),providedFormat:e,state:n}),s=Object.assign({},Vf,e);return i?`%${s.spaceSeparated?" ":""}${o}`:`${o}${s.spaceSeparated?" ":""}%`}function A4(t,e,n){const r=n.currentCurrency();let i=Object.assign({},e),o=Object.assign({},Vf,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=Wf({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 H4({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]&&yn[e]?(a=r[e],t=t/yn[e]):l>=yn.trillion||n&&s(l/yn.trillion)===1?(a=r.trillion,t=t/yn.trillion):l<yn.trillion&&l>=yn.billion||n&&s(l/yn.billion)===1?(a=r.billion,t=t/yn.billion):l<yn.billion&&l>=yn.million||n&&s(l/yn.million)===1?(a=r.million,t=t/yn.million):(l<yn.million&&l>=yn.thousand||n&&s(l/yn.thousand)===1)&&(a=r.thousand,t=t/yn.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 N4({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 Dg(t){let e="";for(let n=0;n<t;n++)e+="0";return e}function D4(t,e){let n=t.toString(),[r,i]=n.split("e"),[o,s=""]=r.split(".");if(+i>0)n=o+s+Dg(i-s.length);else{let a=".";+o<0?a=`-0${a}`:a=`0${a}`;let l=(Dg(-i-1)+Math.abs(o)+s).substr(0,e);l.length<e&&(l+=Dg(e-l.length)),n=a+l}return+i>0&&e>0&&(n+=`.${Dg(e)}`),n}function k4(t,e,n=Math.round){return t.toString().indexOf("e")!==-1?D4(t,e):new S4(n(+`${t}e+${e}`)/Math.pow(10,e)).toFixed(e)}function L4(t,e,n,r,i,o){if(r===-1)return t;let s=k4(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 $4(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 F4(t,e){let n=[],r=0;for(let i=t;i>0;i--)r===e&&(n.unshift(i),r=0),r++;return n}function V4(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)),F4(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 W4(t,e){return t+e}function B4(t,e,n){return e===0?t:+t==0?t.replace("-",""):e>0?`+${t}`:n==="sign"?t:`(${t.replace("-","")})`}function j4(t,e){return e+t}function U4(t,e){return t+e}function Wf({instance:t,providedFormat:e,state:n=_o,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({},Vf,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,C=s.trimMantissa,w=s.thousandSeparated,S=s.spaceSeparated,R=s.negative,I=s.forceSign,O=s.exponential,D=s.roundingFunction,_="";if(d){let j=H4({value:o,forceAverage:c,lowPrecision:h,abbreviations:n.currentAbbreviations(),spaceSeparated:S,roundingFunction:D,totalLength:a});o=j.value,_+=j.abbreviation,a&&(f=j.mantissaPrecision)}if(O){let j=N4({value:o,characteristicPrecision:l});o=j.value,_=j.abbreviation+_}let x=L4(o.toString(),o,m,f,C,D);return x=$4(x,o,u,l),x=V4(x,o,w,n,r),(d||O)&&(x=W4(x,_)),(I||o<0)&&(x=B4(x,o,R)),x}function _c(t,e){if(!t)return e;let n=Object.keys(t);return n.length===1&&n[0]==="output"?e:t}var z4=t=>({format:(...e)=>R4(...e,t),getByteUnit:(...e)=>M4(...e,t),getBinaryByteUnit:(...e)=>_4(...e,t),getDecimalByteUnit:(...e)=>T4(...e,t),formatOrDefault:_c});/*!
|
|
208
|
-
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
209
|
-
*
|
|
210
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
211
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
212
|
-
* in the Software without restriction, including without limitation the rights
|
|
213
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
214
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
215
|
-
* furnished to do so, subject to the following conditions:
|
|
216
|
-
*
|
|
217
|
-
* The above copyright notice and this permission notice shall be included in
|
|
218
|
-
* all copies or substantial portions of the Software.
|
|
219
|
-
*
|
|
220
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
221
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
222
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
223
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
224
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
225
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
226
|
-
* SOFTWARE.
|
|
227
|
-
*/const pa=ck;function Y4(t,e,n){let r=new pa(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new pa(i),t._value=r.plus(i).toNumber(),t}function dk(t,e,n){let r=new pa(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new pa(i),t._value=r.minus(i).toNumber(),t}function G4(t,e,n){let r=new pa(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new pa(i),t._value=r.times(i).toNumber(),t}function K4(t,e,n){let r=new pa(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new pa(i),t._value=r.dividedBy(i).toNumber(),t}function q4(t,e,n){let r=e;return n.isNumbro(e)&&(r=e._value),t._value=r,t}function X4(t,e,n){let r=n(t._value);return dk(r,e,n),Math.abs(r._value)}var Z4=t=>({add:(e,n)=>Y4(e,n,t),subtract:(e,n)=>dk(e,n,t),multiply:(e,n)=>G4(e,n,t),divide:(e,n)=>K4(e,n,t),set:(e,n)=>q4(e,n,t),difference:(e,n)=>X4(e,n,t),BigNumber:pa});/*!
|
|
228
|
-
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
229
|
-
*
|
|
230
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
231
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
232
|
-
* in the Software without restriction, including without limitation the rights
|
|
233
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
234
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
235
|
-
* furnished to do so, subject to the following conditions:
|
|
236
|
-
*
|
|
237
|
-
* The above copyright notice and this permission notice shall be included in
|
|
238
|
-
* all copies or substantial portions of the Software.
|
|
239
|
-
*
|
|
240
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
241
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
242
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
243
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
244
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
245
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
246
|
-
* SOFTWARE.
|
|
247
|
-
*/const J4="2.5.0",As=A0(),Q4=O0(),e6=C4(Ut),t6=lk();let Pl=z4(Ut),iu=Z4(Ut);const n6=x0;class fk{constructor(e){this._value=e}clone(){return Ut(this._value)}format(e={}){return Pl.format(this,e)}formatCurrency(e){return typeof e=="string"&&(e=n6.parseFormat(e)),e=Pl.formatOrDefault(e,As.currentCurrencyDefaultFormat()),e.output="currency",Pl.format(this,e)}formatTime(e={}){return e.output="time",Pl.format(this,e)}binaryByteUnits(){return Pl.getBinaryByteUnit(this)}decimalByteUnits(){return Pl.getDecimalByteUnit(this)}byteUnits(){return Pl.getByteUnit(this)}difference(e){return iu.difference(this,e)}add(e){return iu.add(this,e)}subtract(e){return iu.subtract(this,e)}multiply(e){return iu.multiply(this,e)}divide(e){return iu.divide(this,e)}set(e){return iu.set(this,gk(e))}value(){return this._value}valueOf(){return this._value}}function gk(t){let e=t;return Ut.isNumbro(t)?e=t._value:typeof t=="string"?e=Ut.unformat(t):isNaN(t)&&(e=NaN),e}function Ut(t){return new fk(gk(t))}Ut.version=J4;Ut.isNumbro=function(t){return t instanceof fk};Ut.language=As.currentLanguage;Ut.registerLanguage=As.registerLanguage;Ut.setLanguage=As.setLanguage;Ut.languages=As.languages;Ut.languageData=As.languageData;Ut.zeroFormat=As.setZeroFormat;Ut.defaultFormat=As.currentDefaults;Ut.setDefaults=As.setDefaults;Ut.defaultCurrencyFormat=As.currentCurrencyDefaultFormat;Ut.validate=Q4.validate;Ut.loadLanguagesInNode=e6.loadLanguagesInNode;Ut.unformat=t6.unformat;Ut.BigNumber=iu.BigNumber;var r6=Ut,Ol=Q9(r6);const i6="numeric";function mk(t,e){if(zn(t)){const n=e.numericFormat,r=n&&n.culture||"-",i=n&&n.pattern;if(typeof r<"u"&&!Ol.languages()[r]){const o=r.replace("-",""),s=Ol.allLanguages?Ol.allLanguages[r]:Ol[o];s&&Ol.registerLanguage(s)}Ol.setLanguage(r),t=Ol(t).format(i||"0")}return t}function N0(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=mk(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"}_a(t,e,n,r,i,a,s)}N0.RENDERER_TYPE=i6;const o6="password";function D0(t,e,n,r,i,o,s){_a.apply(this,[t,e,n,r,i,o,s]);const a=s.hashLength||e.innerHTML.length,l=s.hashSymbol||"*";let u="";fe(a-1,()=>{u+=l}),fh(e,u)}D0.RENDERER_TYPE=o6;const s6="select";function k0(t,e,n,r,i,o,s){_a.apply(this,[t,e,n,r,i,o,s])}k0.RENDERER_TYPE=s6;const a6="time";function L0(t,e,n,r,i,o,s){_a.apply(this,[t,e,n,r,i,o,s]),e.dir="ltr"}L0.RENDERER_TYPE=a6;function l6(){Xi(ph),Xi(Ff),Xi(M0),Xi(_0),Xi(P0),Xi(T0),Xi(N0),Xi(D0),Xi(k0),Xi(_a),Xi(L0)}const u6="autocomplete";function xw(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,Hx(n,e)):Hx(n,e)(this.source):e(!0)}xw.VALIDATOR_TYPE=u6;function Hx(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 c6(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const h6="date";function $0(t,e){const n=$N(ek,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=d6(r,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,a,"dateValidator"),i=!0}else i=!1;e(i)}$0.VALIDATOR_TYPE=h6;function d6(t,e){const n=q(c6(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 f6="dropdown";function F0(t,e){xw.apply(this,[t,e])}F0.VALIDATOR_TYPE=f6;const g6="numeric";function V0(t,e){let n=t;n==null&&(n=""),this.allowEmpty&&n===""?e(!0):e(n===""?!1:zn(t))}V0.VALIDATOR_TYPE=g6;const m6=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],p6="time";function W0(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,m6,!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)}W0.VALIDATOR_TYPE=p6;function w6(){Tc(xw),Tc(F0),Tc($0),Tc(V0),Tc(W0)}const v6="autocomplete",C6={CELL_TYPE:v6,editor:R0,renderer:ph,validator:xw},y6="checkbox",b6={CELL_TYPE:y6,editor:QD,renderer:M0},S6="date";function pk(t,e,n,r,i,o,s){ph.apply(this,[t,e,n,r,i,o,s])}pk.RENDERER_TYPE=S6;const R6="date",E6={CELL_TYPE:R6,editor:tk,renderer:pk,validator:$0},T6="dropdown",_6={CELL_TYPE:T6,editor:nk,renderer:_0,validator:F0,filter:!1,strict:!0},M6="handsontable",I6={CELL_TYPE:M6,editor:S0,renderer:P0},P6="numeric",O6={CELL_TYPE:P6,editor:rk,renderer:N0,validator:V0,dataType:"number"},x6="password",A6={CELL_TYPE:x6,editor:ik,renderer:D0,copyable:!1},H6="select",N6={CELL_TYPE:H6,editor:ok,renderer:k0},D6="time",k6={CELL_TYPE:D6,editor:sk,renderer:L0,validator:W0};function L6(){Ro(C6),Ro(b6),Ro(E6),Ro(_6),Ro(I6),Ro(O6),Ro(A6),Ro(N6),Ro(WD),Ro(k6)}function $6(t,e){wk(t,e),e.add(t)}function F6(t,e,n){wk(t,e),e.set(t,n)}function wk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xu(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)}function Zu(t,e){return t.get(vk(t,e))}function vk(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 Nx=new Map([["plugin",rY],["cell-type",xD],["editor",LN],["renderer",zN],["validator",YN]]),Ck=Symbol("mainSetting"),B6="base",kg=[];let xl=null;var Al=new WeakMap,Dx=new WeakSet;class qe{static get PLUGIN_KEY(){return B6}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}constructor(e){$6(this,Dx),Xu(this,"eventManager",new Fo(this)),Xu(this,"pluginName",null),Xu(this,"pluginsInitializedCallbacks",[]),Xu(this,"isPluginsReady",!1),Xu(this,"enabled",!1),Xu(this,"initialized",!1),F6(this,Al,{}),ba(this,"hot",e,{writable:!1}),xl=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(!Nx.has(s))throw new Error(`Unknown plugin dependency type "${s}" was found.`);Nx.get(s)(a)||i.push(` - ${a} (${s})`)}),i.length>0){const o=[`The ${this.pluginName} plugin requires the following modules:
|
|
248
|
-
`,`${i.join(`
|
|
249
|
-
`)}
|
|
250
|
-
`].join("");kg.push(o)}}if(xl||(xl=UN()),xl.indexOf(this.pluginName)>=0&&xl.splice(xl.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),xl.length===0){if(kg.length>0){const i=[`${kg.join(`
|
|
251
|
-
`)}
|
|
252
|
-
`,"You have to import and register them manually."].join("");throw kg.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)||Ae(n))&&r[Ck]===e){var i;return Array.isArray(n)?n:(i=n[e])!==null&&i!==void 0?i:r[e]}if(Ae(n)){var o;return(o=n[e])!==null&&o!==void 0?o:r[e]}return r[e]}addHook(e,n,r){Zu(Al,this)[e]=Zu(Al,this)[e]||[];const i=Zu(Al,this)[e];this.hot.addHook(e,n,r),i.push(n),Zu(Al,this)[e]=i}removeHooks(e){M(Zu(Al,this)[e]||[],n=>{this.hot.removeHook(e,n)})}clearHooks(){const e=Zu(Al,this);He(e,(n,r)=>this.removeHooks(r)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){M(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const n=vk(Dx,this,j6).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(),He(this,(n,r)=>{r!=="hot"&&(this[r]=null)}),delete this.t,delete this.hot}}function j6(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 Hl(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)}let yk=class{constructor(e){Hl(this,"hot",null),Hl(this,"container",null),Hl(this,"injected",!1),Hl(this,"rows",[]),Hl(this,"columns",[]),Hl(this,"samples",null),Hl(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)),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(),M(this.rows,n=>{const{height:r}=n.table.getBoundingClientRect();e(n.row,Math.ceil(r))})}getWidths(e){this.injected||this.injectTable(),M(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=>{M(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=>{M(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=>{M(i.strings,o=>{const s=o.col,a=e.createElement("th");r.push([s,a]),n.appendChild(a)})}),this.table.tHead.appendChild(n),M(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=>{M(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),Y(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 Y(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 Lg(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 Aw{static get SAMPLE_COUNT(){return 3}constructor(e){Lg(this,"samples",null),Lg(this,"dataFactory",null),Lg(this,"customSampleCount",null),Lg(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:Aw.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,n){return this.generateSamples("row",n,e)}generateColumnSamples(e,n){return this.generateSamples("col",n,e)}generateSamples(e,n,r){const i=new Map,{from:o,to:s}=typeof r=="number"?{from:r,to:r}:r;return fe(o,s,a=>{const l=this.generateSample(e,n,a);i.set(a,l)}),i}generateSample(e,n,r){if(e!=="row"&&e!=="col")throw new Error("Unsupported sample type");const i=new Map,o=e==="row"?"col":"row",s=[];return fe(n.from,n.to,a=>{const l=e==="row"?this.dataFactory(r,a):this.dataFactory(a,r);if(l===!1)return;const{value:u,bundleSeed:c}=l,h=typeof c=="string"&&c.length>0;let d;h?d=c:Ae(u)?d=`${Object.keys(u).length}`:Array.isArray(u)?d=`${u.length}`:d=`${Kt(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}}function K6(t,e){bk(t,e),e.add(t)}function kx(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 Kh(t,e,n){return(e=q6(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function q6(t){var e=X6(t,"string");return typeof e=="symbol"?e:e+""}function X6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 cu(t,e){return t.get(ws(t,e))}function B0(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")}ie.getSingleton().register("modifyAutoColumnSizeSeed");const Pb="autoColumnSize",Z6=10,J6="autoColumnSize";var Mc=new WeakMap,nh=new WeakMap,Ks=new WeakSet;class Fd extends qe{static get PLUGIN_KEY(){return Pb}static get PLUGIN_PRIORITY(){return Z6}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),K6(this,Ks),Kh(this,"ghostTable",new yk(this.hot)),Kh(this,"samplesGenerator",new Aw((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}})),Kh(this,"inProgress",!1),Kh(this,"measuredColumns",0),Kh(this,"columnWidthsMap",new ml),kx(this,Mc,[]),kx(this,nh,[]),this.hot.columnIndexMapper.registerMap(J6,this.columnWidthsMap),this.addHook("beforeColumnResize",(n,r,i)=>ws(Ks,this,Lx).call(this,n,r,i))}isEnabled(){return this.hot.getSettings()[Pb]!==!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 ws(Ks,e,t8).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 ws(Ks,e,n8).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 ws(Ks,e,i8).call(e,...i)}),this.addHook("beforeRender",()=>ws(Ks,this,e8).call(this)),this.addHook("modifyColWidth",(r,i)=>this.getColumnWidth(i,r)),this.addHook("init",()=>ws(Ks,this,r8).call(this)),super.enablePlugin()}updatePlugin(){B0(nh,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,n,r)=>ws(Ks,this,Lx).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.renderCall;this.calculateColumnsWidth({from:e,to:n},void 0,r)}calculateColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countRows()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof n=="number"?{from:n,to:n}:n;fe(i.from,i.to,s=>{let a=this.hot.toPhysicalColumn(s);a===null&&(a=s),(r||this.columnWidthsMap.getValueAtIndex(a)===null&&!this.hot._getColWidthFromSettings(a))&&this.samplesGenerator.generateColumnSamples(s,o).forEach((u,c)=>this.ghostTable.addColumn(c,u))}),this.ghostTable.columns.length&&(this.hot.batchExecution(()=>{this.ghostTable.getWidths((s,a)=>{const l=this.hot.toPhysicalColumn(s);this.columnWidthsMap.setValueAtIndex(l,a)})},!0),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){dp(o),this.inProgress=!1;return}this.calculateColumnsWidth({from:r,to:Math.min(r+Fd.CALCULATION_STEP,i)},e,n),r=r+Fd.CALCULATION_STEP+1,r<i?o=hp(s):(dp(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()[Pb];let n=Fd.SYNC_CALCULATION_LIMIT;const r=this.hot.countCols()-1;return Ae(e)&&(n=e.syncLimit,aN(n)?n=WN(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,Xc))),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=cu(Mc,this).length;return(s-1<o||cu(Mc,this)[o]!==i)&&r.push(this.hot.toVisualColumn(o)),s-1<o?cu(Mc,this).push(i):cu(Mc,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 Q6(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)||this.samplesGenerator.generateColumnSamples(n,e).forEach((o,s)=>this.ghostTable.addColumn(s,o)))}),this.ghostTable.columns.length&&(this.hot.batchExecution(()=>{this.ghostTable.getWidths((n,r)=>{const i=this.hot.toPhysicalColumn(n);this.columnWidthsMap.setValueAtIndex(i,r)})},!0),this.ghostTable.clean())}function e8(){this.calculateVisibleColumnsWidth(),this.inProgress||(ws(Ks,this,Q6).call(this,cu(nh,this)),B0(nh,this,[]))}function t8(t,e){e||this.recalculateAllColumnsWidth()}function n8(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},[]);cu(nh,this).push(...e)}function Lx(t,e,n){let r=t;return n&&(this.calculateColumnsWidth(e,void 0,!0),r=this.getColumnWidth(e,void 0,!1)),r}function r8(){B0(Mc,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth()}function i8(t){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},[]);cu(nh,this).push(...e)}const hu={horizontal:"horizontal",vertical:"vertical"};function o8(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 s8(t){const e={};return t===!0?(e.directions=Object.keys(hu),e.autoInsertRow=!0):Ae(t)?(se(t.autoInsertRow)?t.direction===hu.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,se(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(hu)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function a8(t,e){l8(t,e),e.add(t)}function l8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ju(t,e,n){return(e=u8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u8(t){var e=c8(t,"string");return typeof e=="symbol"?e:e+""}function c8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 qh(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}ie.getSingleton().register("modifyAutofillRange");ie.getSingleton().register("beforeAutofill");ie.getSingleton().register("afterAutofill");const $x="autofill",h8=20,d8=["fillHandle"],f8="insert_row_below",g8=200;var Qu=new WeakSet;class m8 extends qe{constructor(){super(...arguments),a8(this,Qu),Ju(this,"addingStarted",!1),Ju(this,"mouseDownOnCellCorner",!1),Ju(this,"mouseDragOutside",!1),Ju(this,"handleDraggedCells",0),Ju(this,"directions",[]),Ju(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return $x}static get PLUGIN_PRIORITY(){return h8}static get SETTING_KEYS(){return[$x,...d8]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>qh(Qu,this,w8).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>qh(Qu,this,p8).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,n)=>qh(Qu,this,v8).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 M(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)}),M(a,c=>{const h=[];M(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}=o8(l,u,(f,m)=>this.hot._createCellCoords(f,m));if(h&&h.row>-1&&h.col>-1){const f=this.getSelectionData(),m=o.clone(),C=this.hot._createCellRange(h,h,d),w=this.hot.runHooks("beforeAutofill",f,m,C,c);if(w===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let S=w;const R=w;if(["up","left"].indexOf(c)>-1&&!(R.length===1&&R[0].length===0))if(S=[],c==="up"){const I=d.row-h.row+1,O=I%R.length;for(let D=0;D<I;D++)S.push(R[(D+(R.length-O))%R.length])}else{const I=d.col-h.col+1,O=I%R[0].length;for(let D=0;D<R.length;D++){S.push([]);for(let _=0;_<I;_++)S[D].push(R[D][(_+(R[D].length-O))%R[D].length])}}this.hot.populateFromArray(h.row,h.col,S,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(u),this.hot.runHooks("afterAutofill",S,m,C,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(hu.vertical)&&this.directions.includes(hu.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(hu.vertical))i=this.hot._createCellCoords(e.row,r.col);else if(this.directions.includes(hu.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(f8,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},g8)}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(...je(e,n=>Math.max(n,0)),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),n=this.getIndexOfLastAdjacentFilledInRow(e);return n===-1||n===void 0?!1:(this.addSelectionFromStartAreaToSpecificRowIndex(e,n),!0)}resetSelectionOfDraggedArea(){this.handleDraggedCells=0,this.hot.selection.highlight.getFill().clear()}redrawBorders(e){this.hot.selection.highlight.getFill().clear().add(this.hot.getSelectedRangeLast().from).add(this.hot.getSelectedRangeLast().to).add(e).commit(),this.hot.view.render()}getIfMouseWasDraggedOutside(e){const{documentElement:n}=this.hot.rootDocument,r=An(this.hot.table).top-(this.hot.rootWindow.pageYOffset||n.scrollTop)+nn(this.hot.table),i=An(this.hot.table).left-(this.hot.rootWindow.pageXOffset||n.scrollLeft)+Gt(this.hot.table);return e.clientY>r&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>qh(Qu,this,C8).call(this)),this.eventManager.addEventListener(e,"mousemove",n=>qh(Qu,this,y8).call(this,n))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=s8(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function p8(){this.selectAdjacent()&&this.fillIn()}function w8(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function v8(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function C8(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function y8(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 b8(t,e){Sk(t,e),e.add(t)}function S8(t,e,n){Sk(t,e),e.set(t,n)}function Sk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ec(t,e,n){return(e=R8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R8(t){var e=E8(t,"string");return typeof e=="symbol"?e:e+""}function E8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 T8(t,e,n){return t.set(vs(t,e),n),n}function j0(t,e){return t.get(vs(t,e))}function vs(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 Ob="autoRowSize",_8=40,M8="autoRowSize";var df=new WeakMap,qs=new WeakSet;class Vd extends qe{static get PLUGIN_KEY(){return Ob}static get PLUGIN_PRIORITY(){return _8}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),b8(this,qs),ec(this,"headerHeight",null),ec(this,"ghostTable",new yk(this.hot)),ec(this,"samplesGenerator",new Aw((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}})),ec(this,"inProgress",!1),ec(this,"measuredRows",0),ec(this,"rowHeightsMap",new ml),S8(this,df,[]),this.hot.rowIndexMapper.registerMap(M8,this.rowHeightsMap),this.addHook("beforeRowResize",(n,r,i)=>vs(qs,this,Fx).call(this,n,r,i))}isEnabled(){const e=this.hot.getSettings()[Ob];return e===!0||Ae(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 vs(qs,e,O8).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 vs(qs,e,x8).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 vs(qs,e,H8).call(e,...i)}),this.addHook("beforeRender",()=>vs(qs,this,P8).call(this)),this.addHook("modifyRowHeight",(r,i)=>this.getRowHeight(i,r)),this.addHook("init",()=>vs(qs,this,A8).call(this)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin()}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,n,r)=>vs(qs,this,Fx).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.renderCall;this.calculateRowsHeight({from:e,to:n},void 0,r)}calculateRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countCols()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof n=="number"?{from:n,to:n}:n;if(this.hot.getColHeader(0)!==null){const s=this.samplesGenerator.generateRowSamples(-1,o);this.ghostTable.addColumnHeadersRow(s.get(-1))}fe(i.from,i.to,s=>{let a=this.hot.toPhysicalRow(s);a===null&&(a=s),(r||this.rowHeightsMap.getValueAtIndex(a)===null)&&this.samplesGenerator.generateRowSamples(s,o).forEach((u,c)=>this.ghostTable.addRow(c,u))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((s,a)=>{s<0?this.headerHeight=a:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(s),a)})},!0),this.measuredRows=i.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0;const i=this.hot.countRows()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){dp(o),this.inProgress=!1;return}this.calculateRowsHeight({from:r,to:Math.min(r+Vd.CALCULATION_STEP,i)},e,n),r=r+Vd.CALCULATION_STEP+1,r<i?o=hp(s):(dp(o),this.inProgress=!1,this.hot.view.adjustElementsSize(),this.hot.view._wt.wtOverlays.inlineStartOverlay.needFullRender&&this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.draw())},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()[Ob];let n=Vd.SYNC_CALCULATION_LIMIT;const r=this.hot.countRows()-1;return Ae(e)&&(n=e.syncLimit,aN(n)?n=WN(r,n):n>>=0),Math.min(n,r)}getRowHeight(e,n){const r=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let i=n;return r!==null&&r>(n||0)&&(i=r),i}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){var e;return(e=this.hot.getFirstRenderedVisibleRow())!==null&&e!==void 0?e:-1}getLastVisibleRow(){var e;return(e=this.hot.getLastRenderedVisibleRow())!==null&&e!==void 0?e:-1}clearCache(e){this.headerHeight=null,Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(n=>{this.rowHeightsMap.setValueAtIndex(n,null)})},!0):this.rowHeightsMap.clear()}clearCacheByRange(e){const{from:n,to:r}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{fe(Math.min(n,r),Math.max(n,r),i=>{this.rowHeightsMap.setValueAtIndex(i,null)})},!0)}isNeedRecalculate(){return!!this.rowHeightsMap.getValues().slice(0,this.measuredRows).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function I8(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 P8(){this.calculateVisibleRowsHeight(),this.inProgress||(vs(qs,this,I8).call(this,j0(df,this)),T8(df,this,[]))}function Fx(t,e,n){let r=t;return n&&(this.calculateRowsHeight(e,void 0,!0),r=this.getRowHeight(e)),r}function O8(t,e){e||this.recalculateAllRowsHeight()}function x8(t){const e=t.reduce((n,r)=>{let[i]=r;return n.indexOf(i)===-1&&n.push(i),n},[]);j0(df,this).push(...e)}function A8(){this.recalculateAllRowsHeight()}function H8(t){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},[]);j0(df,this).push(...e)}const{getListWithInsertedItems:N8,getListWithRemovedItems:D8}=mD("physicallyIndexed");class k8 extends Du{constructor(){super(e=>e)}insert(e,n){const r=g0(this.indexedValues,n);this.indexedValues=N8(r,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){const n=D8(this.indexedValues,e);this.indexedValues=f0(n,e),super.remove(e)}}const{getListWithInsertedItems:L8,getListWithRemovedItems:$8}=mD("physicallyIndexed");class F8 extends Du{constructor(){super(e=>e)}insert(e,n){this.indexedValues=L8(this.indexedValues,e,n,(r,i)=>this.getNextValue(i)),super.insert(e,n)}remove(e){this.indexedValues=$8(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}function V8(t,e){W8(t,e),e.add(t)}function W8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function B8(t,e,n){return(e=j8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function j8(t){var e=U8(t,"string");return typeof e=="symbol"?e:e+""}function U8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 z8(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 Vx="bindRowsWithHeaders",Y8=210,G8="loose",Wx=new Map([["loose",k8],["strict",F8]]);var Bx=new WeakSet;class K8 extends qe{constructor(){super(...arguments),V8(this,Bx),B8(this,"headerIndexes",null)}static get PLUGIN_KEY(){return Vx}static get PLUGIN_PRIORITY(){return Y8}isEnabled(){return!!this.hot.getSettings()[Vx]}enablePlugin(){var e;if(this.enabled)return;const n=(e=Wx.get(this.getSetting()))!==null&&e!==void 0?e:Wx.get(G8);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new n),this.addHook("modifyRowHeader",r=>z8(Bx,this,q8).call(this,r)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function q8(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function X8(t,e){Rk(t,e),e.add(t)}function Z8(t,e,n){Rk(t,e),e.set(t,n)}function Rk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jx(t,e,n){return(e=J8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function J8(t){var e=Q8(t,"string");return typeof e=="symbol"?e:e+""}function Q8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Ux(t,e){return t.get(Nc(t,e))}function xb(t,e,n){return t.set(Nc(t,e),n),n}function Nc(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 Um="collapsibleColumns",e7=290,t7=["nestedHeaders"],Uc="collapsibleIndicator",zx=Um,Yx=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var tc=new WeakMap,Xh=new WeakSet;class n7 extends qe{constructor(){super(...arguments),X8(this,Xh),jx(this,"nestedHeadersPlugin",null),jx(this,"headerStateManager",null),Z8(this,tc,null)}static get PLUGIN_KEY(){return Um}static get PLUGIN_PRIORITY(){return e7}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[Um,...t7]}isEnabled(){return!!this.hot.getSettings()[Um]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();n||Xe("You need to configure the Nested Headers plugin in order to use collapsible headers."),xb(tc,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>Nc(Xh,this,o7).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 Nc(Xh,e,s7).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 Nc(Xh,e,r7).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(r,i,o)=>Nc(Xh,this,i7).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),xb(tc,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:zx,relativeToGroup:pl,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(zx)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,n=this.hot.view._wt.wtTable.THEAD,r=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,i=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,o=function(s){s&&s.parentNode.removeChild(s)};fe(0,e-1,s=>{const a=n.childNodes[s],l=r.childNodes[s],u=i?i.childNodes[s]:null;fe(0,a.childNodes.length-1,c=>{let h=a.childNodes[c].querySelector(`.${Uc}`);o(h),l&&l.childNodes[c]&&(h=l.childNodes[c].querySelector(`.${Uc}`),o(h)),i&&u&&u.childNodes[c]&&(h=u.childNodes[c].querySelector(`.${Uc}`),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(!Yx.has(n))throw new Error(`Unsupported action is passed (${n}).`);if(!Array.isArray(e))return;const r=vu(e,f=>{let{row:m}=f;return m<0});let i=r.length>0;M(r,f=>{var m;let{row:C,col:w}=f;const{collapsible:S,isCollapsed:R}=(m=this.headerStateManager.getHeaderSettings(C,w))!==null&&m!==void 0?m:{};if(!S||R&&n==="collapse"||!R&&n==="expand")return i=!1,!1});const o=[],s=[];i&&M(r,f=>{let{row:m,col:C}=f;const{colspanCompensation:w,affectedColumns:S,rollbackModification:R}=this.headerStateManager.triggerNodeModification(n,m,C);w>0&&(s.push(...S),o.push(R))});const a=this.getCollapsedColumns();let l=[];n==="collapse"?l=oU([...a,...s]):n==="expand"&&(l=vu(a,f=>!s.includes(f)));const u=Yx.get(n);if(this.hot.runHooks(u.beforeHook,a,l,i)===!1){M(o,f=>{f()});return}this.hot.batchExecution(()=>{M(s,f=>{Ux(tc,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 w=f>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(f,1,!0):f,S=m>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(m,1,!0):m;w!==null&&S!==null&&this.hot.selectCell(w,S)}}this.hot.runHooks(u.afterHook,a,l,i,h),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return Ux(tc,this).getHiddenIndexes()}destroy(){xb(tc,this,null),super.destroy()}}function r7(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(`.${Uc}`);if(dh(e,[so("")[0]]),a)u||(u=this.hot.rootDocument.createElement("div"),Y(u,Uc),e.querySelector("div:first-child").appendChild(u)),we(u,["collapsed","expanded"]),s?(Y(u,"collapsed"),yu(u,"+"),l&&be(e,...so(!1))):(Y(u,"expanded"),yu(u,"-"),l&&be(e,...so(!0))),l&&be(u,...fl());else{var c;(c=u)===null||c===void 0||c.remove()}}function i7(t,e){Ce(t.target,Uc)&&(Ce(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):Ce(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),jo(t))}function o7(){this.updatePlugin()}function s7(t,e){e||this.updatePlugin()}function Nl(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=l7(t,"string");return typeof e=="symbol"?e:e+""}function l7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 u7=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],c7=!1,h7=!0,d7=!0;class f7{constructor(e,n){Nl(this,"hot",void 0),Nl(this,"sortingStates",new Rw),Nl(this,"sortEmptyCells",c7),Nl(this,"indicator",h7),Nl(this,"headerAction",d7),Nl(this,"compareFunctionFactory",void 0),Nl(this,"mapName",void 0),this.hot=e,this.mapName=n,this.hot.columnIndexMapper.registerMap(n,this.sortingStates)}updateAllColumnsProperties(e){Ae(e)&&He(e,(n,r)=>{u7.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 Ae(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(se(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 Ek(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?Ts:jt(i)?jt(o)?Ts:s&&t==="asc"?Ht:Nt:jt(o)?s&&t==="asc"?Nt:Ht:isNaN(i)&&!isNaN(o)?t==="asc"?Nt:Ht:!isNaN(i)&&isNaN(o)||(isNaN(i)||isNaN(o)||(i=parseFloat(i),o=parseFloat(o)),i<o)?t==="asc"?Ht:Nt:i>o?t==="asc"?Nt:Ht:Ts}}const Tk="default";function g7(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 Ts;if(a){if(jt(r))return t==="asc"?Ht:Nt;if(jt(i))return t==="asc"?Nt:Ht}return isNaN(o)?Nt:isNaN(s)?Ht:o<s?t==="asc"?Ht:Nt:o>s?t==="asc"?Nt:Ht:Ts}}const m7="numeric";function p7(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 Nt;if(l===!1&&u)return Ht}return d===!1&&f?t==="asc"?Ht:Nt:d&&f===!1?t==="asc"?Nt:Ht:d===!1&&f===!1?Ek(t,e,n)(s,a):c===i&&h===r?t==="asc"?Ht:Nt:c===r&&h===i?t==="asc"?Nt:Ht:Ts}}const w7="checkbox";function v7(t,e,n){return xk(t,e.dateFormat,n)}const C7="date";function y7(t,e,n){return xk(t,e.timeFormat,n)}const b7="time",{register:Bf,getItem:Gx,hasItem:S7}=Uo("sorting.compareFunctionFactory"),{register:_k,getItem:R7}=Uo("sorting.mainSortComparator");function Mk(t){return S7(t)?Gx(t):Gx(Tk)}Bf(w7,p7);Bf(C7,v7);Bf(Tk,Ek);Bf(m7,g7);Bf(b7,y7);const Ts=0,Ht=-1,Nt=1;function E7(t,e){const n=R7(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 yp="asc",bp="desc",Ik="colHeader";function T7(t){if(Ae(t)===!1)return!1;const{column:e,sortOrder:n}=t;return Number.isInteger(e)&&[yp,bp].includes(n)}function _7(t){if(t.some(n=>T7(n)===!1))return!1;const e=t.map(n=>{let{column:r}=n;return r});return new Set(e).size===e.length}function Kx(t){if(t!==bp)return t===yp?bp:yp}function Pk(t){return t.querySelector(`.${Ik}`)}function Ok(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 U0(t,e,n){return t===-1&&e>=0&&bu(n)===!1}function xk(t,e,n){return function(r,i){const{sortEmptyCells:o}=n;if(r===i)return Ts;if(jt(r))return jt(i)?Ts:o&&t==="asc"?Ht:Nt;if(jt(i))return o&&t==="asc"?Nt:Ht;const s=q(r,e),a=q(i,e);return s.isValid()?a.isValid()?a.isAfter(s)?t==="asc"?Ht:Nt:a.isBefore(s)?t==="asc"?Nt:Ht:Ts:Ht:Nt}}function M7(t,e){Xe(tt`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20
|
|
253
|
-
Only \`${t}\` will work. The \`${e}\` plugin will remain disabled.`)}const I7="ascending",P7="descending",Ak="indicatorDisabled",Hk="columnSorting",Nk="sortAction",Dk=new Map([[yp,I7],[bp,P7]]);function O7(t,e,n,r){const i=[Hk];if(r&&i.push(Nk),n===!1)return i.push(Ak),i;const o=t.getSortOrderOfColumn(e);return se(o)&&i.push(Dk.get(o)),i}function x7(){return Array.from(Dk.values()).concat(Nk,Ak,Hk)}function A7(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:Mk(u.type))(l,u,d)(c,h)}(0)}}function H7(t,e){N7(t,e),e.add(t)}function N7(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $g(t,e,n){return(e=D7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D7(t){var e=k7(t,"string");return typeof e=="symbol"?e:e+""}function k7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Ic(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Sp="columnSorting",L7=50,Rp="append",$7="replace",qx=Sp;_k(Sp,A7);ie.getSingleton().register("beforeColumnSort");ie.getSingleton().register("afterColumnSort");const Zh=new WeakMap;var ou=new WeakSet;class kk extends qe{constructor(){super(...arguments),H7(this,ou),$g(this,"columnStatesManager",null),$g(this,"columnMetaCache",null),$g(this,"pluginKey",Sp),$g(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return Sp}static get PLUGIN_PRIORITY(){return L7}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;if(Zh.has(this.hot)&&Zh.get(this.hot)!==this.pluginKey){this.hot.updateSettings({[this.pluginKey]:!1}),M7(Zh.get(this.hot),this.pluginKey);return}this.enabled||(Zh.set(this.hot,this.pluginKey),this.columnStatesManager=new f7(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new ml(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)=>Ic(ou,this,F7).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 Ic(ou,e,W7).call(e,...r)}),this.addHook("afterOnCellMouseDown",(n,r)=>this.onAfterOnCellMouseDown(n,r)),this.addHook("afterInit",()=>Ic(ou,this,TR).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 Ic(ou,e,V7).call(e,...r)}),this.hot.view&&Ic(ou,this,TR).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(n,r)=>{const i=Pk(r);Ok(n,r)===!1||i===null||this.updateHeaderClasses(i)};Zh.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:pl,position:"before",group:qx})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(qx)}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 pD),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(),this.hot.forceFullRender=!1,this.hot.view.render()))}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return se(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 _7(e)&&e.every(r=>{let{column:i}=r;return i<=n&&i>=0})}saveAllSortSettings(e){const n=this.columnStatesManager.getAllColumnsProperties(),r=i=>{let{column:o,...s}=i;return{column:this.hot.toPhysicalColumn(o),...s}};n.initialConfig=je(e,r),this.hot.runHooks("persistentStateSave","columnSorting",n)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const n=e.value,r=i=>{let{column:o,...s}=i;return{column:this.hot.toVisualColumn(o),...s}};return se(n)&&Array.isArray(n.initialConfig)&&(n.initialConfig=je(n.initialConfig,r)),n}getColumnNextConfig(e){const n=this.columnStatesManager.getSortOrderOfColumn(e);if(se(n)){const i=Kx(n);return se(i)?{column:e,sortOrder:i}:void 0}const r=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<r)return{column:e,sortOrder:Kx()}}getNextSortConfig(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rp;const r=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=r!==-1,o=this.getSortConfig(),s=this.getColumnNextConfig(e);if(i){if(_t(s))return[...o.slice(0,r),...o.slice(r+1)];if(n===Rp)return[...o.slice(0,r),...o.slice(r+1),s];if(n===$7)return[...o.slice(0,r),s,...o.slice(r+1)]}return se(s)?o.concat(s):o}getPluginColumnConfig(e){if(Ae(e)){const n=e[this.pluginKey];if(Ae(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])):mt(o.columns)?Object.assign(r,n,this.getPluginColumnConfig(o.columns(e))):Object.assign(r,n)}getFirstCellSettings(e){const n=this.hot.getCellMeta(0,e),r=Object.create(n);return r[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),r}getNumberOfRowsToSort(e){const n=this.hot.getSettings();return n.maxRows<=e?n.maxRows:e-n.minSpareRows}sortByPresetSortStates(e){if(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),e.length===0)return;const n=[],r=this.hot.countRows(),i=u=>je(e,c=>this.hot.getDataAtCell(u,c.column));for(let u=0;u<this.getNumberOfRowsToSort(r);u+=1)n.push([this.hot.toPhysicalRow(u)].concat(i(u)));const o=je(n,u=>u[0]);E7(n,this.pluginKey,je(e,u=>u.sortOrder),je(e,u=>this.getFirstCellSettings(u.column)));for(let u=n.length;u<r;u+=1)n.push([u].concat(i(u)));const s=je(n,u=>u[0]),a=new Map(je(o,(u,c)=>[u,s[c]])),l=je(this.hot.rowIndexMapper.getIndexesSequence(),u=>a.has(u)?a.get(u):u);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if(Ae(e)){this.columnStatesManager.updateAllColumnsProperties(e);const n=e.initialConfig;(Array.isArray(n)||Ae(n))&&this.sort(n)}else this.hot.render()}updateHeaderClasses(e){if(we(e,x7()),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];Y(e,O7(...r))}}onUpdateSettings(e){super.onUpdateSettings(e),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),se(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,n){return this.getFirstCellSettings(n)[this.pluginKey].headerAction&&Ce(e.target,Ik)}onAfterOnCellMouseDown(e,n){if(U0(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 TR(){const t=this.getAllSavedSortSettings();if(Ae(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function F7(t,e){const n=Pk(e);if(Ok(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);be(e,..._U(s?`${s}ending`:"none"))}}function V7(t){t===!0&&this.hot.view&&Ic(ou,this,TR).call(this)}function W7(t,e,n,r){U0(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(r.column=!0)}function Dl(t,e,n){return(e=B7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function B7(t){var e=j7(t,"string");return typeof e=="symbol"?e:e+""}function j7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 U7{constructor(e,n){Dl(this,"plugin",void 0),Dl(this,"hot",void 0),Dl(this,"endpoints",[]),Dl(this,"settings",void 0),Dl(this,"settingsType","array"),Dl(this,"currentEndpoint",null),Dl(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),M(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(`
|
|
254
|
-
You must provide a destination row for the Column Summary plugin in order to work properly!
|
|
255
|
-
`)),this.assignSetting(i,o,"destinationColumn",new Error(`
|
|
256
|
-
You must provide a destination column for the Column Summary plugin in order to work properly!
|
|
257
|
-
`)),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();M(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;M(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?M(u,d=>{this.extendEndpointRanges(d,h,i[0],i.length),this.recreatePhysicalRanges(d),this.clearOffsetInformation(d)}):M(u,d=>{this.shiftEndpointCoordinates(d,h)}),s&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,n,r,i){M(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=[];M(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)}),M(i,o=>{let s=[];M(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,M(e.ranges,r=>{M(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=[],M(e,i=>{this.resetEndpointValue(i,n)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],M(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=[],M(e,(r,i,o)=>{`${r[2]||""}`!=`${r[3]}`&&M(this.getAllEndpoints(),(s,a)=>{this.hot.propToCol(o[i][1])===s.sourceColumn&&n.indexOf(a)===-1&&n.push(a)})}),M(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(){Xe("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function Ab(t){return t==null||isNaN(t)}function z7(t,e){Y7(t,e),e.add(t)}function Y7(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function G7(t,e,n){return(e=K7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function K7(t){var e=q7(t,"string");return typeof e=="symbol"?e:e+""}function q7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Fg(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 Hb="columnSummary",X7=220;var Jh=new WeakSet;class Z7 extends qe{constructor(){super(...arguments),z7(this,Jh),G7(this,"endpoints",null)}static get PLUGIN_KEY(){return Hb}static get PLUGIN_PRIORITY(){return X7}isEnabled(){return!!this.hot.getSettings()[Hb]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[Hb],this.endpoints=new U7(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 Fg(Jh,e,J7).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 Fg(Jh,e,eZ).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 Fg(Jh,e,Q7).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 Fg(Jh,e,tZ).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 He(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=Ab(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 He(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=Ab(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=Ab(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 He(r,i=>{const o=i[1]===void 0?1:i[1]-i[0]+1,s=this.countEmpty(i,e.sourceColumn);n+=o,n-=s}),n}calculateAverage(e){const n=this.calculateSum(e),r=this.countEntries(e);return n/r}getCellValue(e,n){const r=this.hot.toVisualRow(e),i=this.hot.toVisualColumn(n);let o=this.hot.getSourceDataAtCell(e,n),s="";if(r!==null&&i!==null&&(s=this.hot.getCellMeta(r,i).className||""),s.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&(typeof o=="string"&&(o=o.replace(/,/,".")),o=parseFloat(o)),isNaN(o)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw new Error(tt`ColumnSummary plugin: cell at (${e}, ${n}) is not in a\x20
|
|
258
|
-
numeric format. Cannot do the calculation.`);return o}}function J7(){this.endpoints.initEndpoints()}function Q7(t){t.columns!==void 0&&this.endpoints.refreshCellMetas()}function eZ(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function tZ(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 nZ(t,e){Lk(t,e),e.add(t)}function Nb(t,e,n){Lk(t,e),e.set(t,n)}function Lk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pc(t,e){return t.get(z0(t,e))}function _R(t,e,n){return t.set(z0(t,e),n),n}function z0(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 Ep=new WeakMap,Vg=new WeakMap,Wg=new WeakMap,Xx=new WeakSet;class $k{constructor(){nZ(this,Xx),Nb(this,Ep,!0),Nb(this,Vg,null),Nb(this,Wg,new ResizeObserver(e=>z0(Xx,this,rZ).call(this,e)))}setObservedElement(e){_R(Vg,this,e)}unobserve(){Pc(Wg,this).unobserve(Pc(Vg,this))}observe(){_R(Ep,this,!0),Pc(Wg,this).observe(Pc(Vg,this))}destroy(){Pc(Wg,this).disconnect()}}function rZ(t){if(Pc(Ep,this)||!Array.isArray(t)||!t.length){_R(Ep,this,!1);return}t.forEach(e=>{let{borderBoxSize:n}=e;const{inlineSize:r,blockSize:i}=n[0];this.runLocalHooks("resize",r,i)})}lt($k,Rn);function kl(t,e,n){iZ(t,e),e.set(t,n)}function iZ(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(Fk(t,e))}function Bs(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 Ll=new WeakMap,Db=new WeakMap,js=new WeakMap,Oa=new WeakMap,xa=new WeakMap,Bg=new WeakMap,nc=new WeakMap;class du{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;kl(this,Ll,void 0),kl(this,Db,!1),kl(this,js,null),kl(this,Oa,void 0),kl(this,xa,void 0),kl(this,Bg,!0),kl(this,nc,new $k),Bs(Ll,this,e),Bs(Db,this,n),Bs(Oa,this,this.createEditor()),Bs(xa,this,st(Oa,this).style),st(nc,this).setObservedElement(this.getInputElement()),st(nc,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){st(xa,this).left=`${e}px`,st(xa,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:Gt(this.getInputElement()),height:nn(this.getInputElement())}}observeSize(){st(nc,this).observe()}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const n=this.getInputElement();n.readOnly=e}show(){st(xa,this).display="block",Bs(Bg,this,!1)}hide(){st(nc,this).unobserve(),st(Bg,this)||(st(xa,this).display="none"),Bs(Bg,this,!0)}isVisible(){return st(xa,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 st(Ll,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=st(Ll,this).createElement("div"),n=st(Ll,this).createElement("textarea");return e.style.display="none",Bs(js,this,st(Ll,this).createElement("div")),st(js,this).setAttribute("dir",st(Db,this)?"rtl":"ltr"),Y(st(js,this),du.CLASS_EDITOR_CONTAINER),st(Ll,this).body.appendChild(st(js,this)),Y(e,du.CLASS_EDITOR),Y(n,du.CLASS_INPUT),n.setAttribute("data-hot-input",!0),e.appendChild(n),st(js,this).appendChild(e),e}getInputElement(){return st(Oa,this).querySelector(`.${du.CLASS_INPUT}`)}getEditorElement(){return st(Oa,this)}destroy(){const e=st(js,this)?st(js,this).parentNode:null;st(Oa,this).parentNode.removeChild(st(Oa,this)),Bs(Oa,this,null),Bs(xa,this,null),st(nc,this).destroy(),e&&e.removeChild(st(js,this))}}lt(du,Rn);function kb(t,e,n){return(e=oZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oZ(t){var e=sZ(t,"string");return typeof e=="symbol"?e:e+""}function sZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const aZ=250,lZ=250;class Vk{constructor(e){kb(this,"wasLastActionShow",!0),kb(this,"showDebounced",null),kb(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},lZ)}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]:aZ;this.showDebounced=FE(n=>{this.wasLastActionShow&&this.runLocalHooks("show",n.from.row,n.from.col)},e)}destroy(){this.clearLocalHooks()}}lt(Vk,Rn);function uZ(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function cZ(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function $l(t,e){const n={};return M(t,r=>{r.forAll((i,o)=>{i>=0&&o>=0&&(n[i]||(n[i]=[]),n[i][o]=e(i,o))})}),n}function ja(t,e,n,r,i){M(t,o=>{o.forAll((s,a)=>{s>=0&&a>=0&&hZ(s,a,e,n,r,i)})})}function hZ(t,e,n,r,i,o){const s=i(t,e);let a=r;s.className&&(n==="vertical"?a=uZ(s.className,r):a=cZ(s.className,r)),o(t,e,"className",a)}function Wk(t){return`<span class="selected">✓</span>${t}`}function zm(t,e){let n=!1;return Array.isArray(t)&&M(t,r=>(r.forAll((i,o)=>{if(i>=0&&o>=0&&e(i,o))return n=!0,!1}),n)),n}function Hw(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 xe="---------";function dZ(){return{name:xe}}const Qi="alignment";function fZ(){return{key:Qi,name(){return this.getTranslatedPhrase(Dr)},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:`${Qi}:left`,name(){return this.getTranslatedPhrase(kr)},callback(){const t=this.getSelectedRange(),e=$l(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",e,t,n,r),ja(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Qi}:center`,name(){return this.getTranslatedPhrase(Lr)},callback(){const t=this.getSelectedRange(),e=$l(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",e,t,n,r),ja(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Qi}:right`,name(){return this.getTranslatedPhrase($r)},callback(){const t=this.getSelectedRange(),e=$l(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htRight";this.runHooks("beforeCellAlignment",e,t,n,r),ja(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Qi}:justify`,name(){return this.getTranslatedPhrase(Fr)},callback(){const t=this.getSelectedRange(),e=$l(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",e,t,n,r),ja(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{name:xe},{key:`${Qi}:top`,name(){return this.getTranslatedPhrase(Vr)},callback(){const t=this.getSelectedRange(),e=$l(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htTop";this.runHooks("beforeCellAlignment",e,t,n,r),ja(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Qi}:middle`,name(){return this.getTranslatedPhrase(Wr)},callback(){const t=this.getSelectedRange(),e=$l(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",e,t,n,r),ja(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Qi}:bottom`,name(){return this.getTranslatedPhrase(Br)},callback(){const t=this.getSelectedRange(),e=$l(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htBottom";this.runHooks("beforeCellAlignment",e,t,n,r),ja(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1}]}}}const Nw="clear_column";function gZ(){return{key:Nw,name(){return this.getTranslatedPhrase(Er)},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 jf="col_left";function mZ(){return{key:jf,name(){return this.getTranslatedPhrase(vr)},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 Uf="col_right";function pZ(){return{key:Uf,name(){return this.getTranslatedPhrase(Cr)},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 zf="make_read_only";function wZ(){return{key:zf,checkable:!0,ariaChecked(){return zm(this.getSelectedRange(),(e,n)=>this.getCellMeta(e,n).readOnly)},ariaLabel(){return this.getTranslatedPhrase(qn)},name(){let t=this.getTranslatedPhrase(qn);return zm(this.getSelectedRange(),(n,r)=>this.getCellMeta(n,r).readOnly)&&(t=Wk(t)),t},callback(){const t=this.getSelectedRange(),e=zm(t,(n,r)=>this.getCellMeta(n,r).readOnly);M(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 Dw="redo";function vZ(){return{key:Dw,name(){return this.getTranslatedPhrase(Rr)},callback(){this.redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const Yf="remove_col";function CZ(){return{key:Yf,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(br,e)},callback(){this.alter("remove_col",Iq(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 kw="remove_row";function yZ(){return{key:kw,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(yr,e)},callback(){this.alter("remove_row",Pq(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 Lw="row_above";function bZ(){return{key:Lw,name(){return this.getTranslatedPhrase(pr)},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 $w="row_below";function SZ(){return{key:$w,name(){return this.getTranslatedPhrase(wr)},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 ff="no_items";function RZ(){return{key:ff,name(){return this.getTranslatedPhrase(Ew)},disabled:!0,isCommand:!1}}const Fw="undo";function EZ(){return{key:Fw,name(){return this.getTranslatedPhrase(Sr)},callback(){this.undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const TZ=[Lw,$w,jf,Uf,Nw,kw,Yf,Fw,Dw,zf,Qi,xe,ff],_Z={[xe]:dZ,[ff]:RZ,[Lw]:bZ,[$w]:SZ,[jf]:mZ,[Uf]:pZ,[Nw]:gZ,[kw]:yZ,[Yf]:CZ,[Fw]:EZ,[Dw]:vZ,[zf]:wZ,[Qi]:fZ};function Bk(){const t={};return He(_Z,(e,n)=>{t[n]=e()}),t}function MZ(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(Ar):this.getTranslatedPhrase(xr)},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 IZ(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(Hr)},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 PZ(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(Nr);return zm(this.getSelectedRange(),(r,i)=>t.getCommentMeta(r,i,Ym))?Wk(e):e},callback(){this.getSelectedRangeLast().forAll((n,r)=>{if(n>=0&&r>=0){const i=!!t.getCommentMeta(n,r,Ym);t.updateCommentMeta(n,r,{[Ym]:!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 OZ(t,e){jk(t,e),e.add(t)}function rc(t,e,n){jk(t,e),e.set(t,n)}function jk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xZ(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)}function tl(t,e,n){return t.set(ki(t,e),n),n}function Ie(t,e){return t.get(ki(t,e))}function ki(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 Tp="comments",NZ=60,ea="comment",Od="value",Uk="style",Ym="readOnly",Qh=Tp,MR=`plugin:${Tp}`;var it=new WeakMap,gs=new WeakMap,Vw=new WeakMap,Gm=new WeakMap,IR=new WeakMap,_p=new WeakMap,qi=new WeakSet;class DZ extends qe{constructor(){super(...arguments),OZ(this,qi),xZ(this,"range",{}),rc(this,it,null),rc(this,gs,null),rc(this,Vw,!1),rc(this,Gm,!1),rc(this,IR,null),rc(this,_p,"")}static get PLUGIN_KEY(){return Tp}static get PLUGIN_PRIORITY(){return NZ}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[Tp]}enablePlugin(){var e=this;this.enabled||(Ie(it,this)||(tl(it,this,new du(this.hot.rootDocument,this.hot.isRtl())),Ie(it,this).addLocalHook("resize",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(qi,e,jZ).call(e,...r)})),Ie(gs,this)||tl(gs,this,new Vk(this.getSetting("displayDelay"))),this.addHook("afterContextMenuDefaultOptions",n=>this.addToContextMenu(n)),this.addHook("afterRenderer",(n,r,i,o,s,a)=>ki(qi,this,VZ).call(this,n,a)),this.addHook("afterScroll",()=>ki(qi,this,zZ).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",n=>ki(qi,this,UZ).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 ki(qi,e,YZ).call(e,...r)}),Ie(gs,this).addLocalHook("hide",()=>this.hide()),Ie(gs,this).addLocalHook("show",(n,r)=>this.showAtCell(n,r)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){Ie(gs,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(MR);n.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeLast();tl(Gm,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(MR),this.hot._registerTimeout(()=>{tl(Gm,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell()},group:Qh}),r.addShortcut({keys:[["Escape"]],callback:()=>{Ie(it,this).setValue(Ie(_p,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ie(it,this).isVisible()&&Ie(it,this).isFocused(),group:Qh}),r.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ie(it,this).isVisible()&&Ie(it,this).isFocused(),group:Qh}),r.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{Ie(it,this).setValue(Ie(it,this).getValue()),this.hide(),e.setActiveContextName("grid")},group:Qh})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Qh)}registerListeners(){const{rootDocument:e}=this.hot,n=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",r=>ki(qi,this,$Z).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>ki(qi,this,kZ).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>ki(qi,this,FZ).call(this)),this.eventManager.addEventListener(n,"focus",()=>ki(qi,this,BZ).call(this)),this.eventManager.addEventListener(n,"blur",()=>ki(qi,this,WZ).call(this)),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",r=>ki(qi,this,LZ).call(this,r))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const n=Cu(e.target,"TD","TBODY");return!!(n&&Ce(n,"htCommentCell")&&Cu(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=Ie(it,this).getValue();let r="";e!=null?r=e:n!=null&&(r=n);const i=this.range.from.row,o=this.range.from.col;this.updateCommentMeta(i,o,{[Od]: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,ea),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,Od)}getCommentAtCell(e,n){return this.getCommentMeta(e,n,Od)}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 Ie(gs,this).cancelHiding(),Ie(it,this).setValue((e=i[ea]?i[ea][Od]:null)!==null&&e!==void 0?e:""),Ie(it,this).show(),this.refreshEditor(!0),!0}showAtCell(e,n){return this.setRange({from:this.hot._createCellCoords(e,n)}),this.show()}hide(){Ie(it,this).hide()}refreshEditor(){if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!Ie(it,this).isVisible()))return;const{rowIndexMapper:n,columnIndexMapper:r}=this.hot,{row:i,col:o}=this.range.from;let s=n.getRenderableFromVisualIndex(i),a=r.getRenderableFromVisualIndex(o);const l=s===null;Ie(it,this).setPosition(0,0),s===null&&(s=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(i,-1))),a===null&&(a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(o,-1)));const u=s===null,c=a===null;s=s??0,a=a??0;const{rootWindow:h,view:{_wt:d}}=this.hot,{wtTable:f}=d,m=d.getCell({row:s,col:a},!0),C=this.getCommentMeta(i,o,Uk);C?Ie(it,this).setSize(C.width,C.height):Ie(it,this).resetSize();const w=c?0:f.getColumnWidth(a),S=l&&!u?nn(m):0,{left:R,top:I,width:O,height:D}=m.getBoundingClientRect(),{width:_,height:x}=Ie(it,this).getSize(),{innerWidth:j,innerHeight:X}=this.hot.rootWindow,U=this.hot.rootDocument.documentElement,Z=vn(this.hot.rootDocument),Q=SN(this.hot.rootWindow)?Z:0,le=RN(this.hot.rootWindow)?Z:0;let te=R+h.scrollX+w,ue=I+h.scrollY+S;this.hot.isRtl()&&(te-=_+w),this.hot.isLtr()&&R+O+_>j-Q?te=R+h.scrollX-_-1:this.hot.isRtl()&&te<-(U.scrollWidth-U.clientWidth)&&(te=R+h.scrollX+w+1),I+x>X-le&&(ue-=x-D+1),Ie(it,this).setPosition(te,ue),Ie(it,this).setReadOnlyState(this.getCommentMeta(i,o,Ym)),Ie(it,this).observeSize()}focusEditor(){Ie(it,this).focus()}updateCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n)[ea];let o;i?(o=Kn(i),ww(o,r)):o=r,this.hot.setCellMeta(e,n,ea,o)}getCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n);if(i[ea])return i[ea][r]}addToContextMenu(e){e.items.push({name:xe},MZ(this),IZ(this),PZ(this))}getEditorInputElement(){return Ie(it,this).getInputElement()}destroy(){var e,n;(e=Ie(it,this))===null||e===void 0||e.destroy(),(n=Ie(gs,this))===null||n===void 0||n.destroy(),super.destroy()}}function kZ(t){if(!(!this.hot.view||!this.hot.view._wt)&&!Ie(Vw,this)&&!this.targetIsCommentTextArea(t)){const e=Cu(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 LZ(t){t.stopPropagation()}function $Z(t){const{rootDocument:e}=this.hot;if(!(Ie(Vw,this)||Ie(it,this).isFocused()||Ce(t.target,"wtBorder")||Ie(IR,this)===t.target||!Ie(it,this)))if(tl(IR,this,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const n=this.hot._createCellRange(this.hot.getCoords(t.target));Ie(gs,this).show(n)}else wu(t.target,e)&&!this.targetIsCommentTextArea(t)&&Ie(gs,this).hide()}function FZ(){tl(Vw,this,!1)}function VZ(t,e){e[ea]&&e[ea][Od]&&Y(t,e.commentedCellClassName)}function WZ(){tl(_p,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function BZ(){tl(_p,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(MR)}function jZ(t,e){this.updateCommentMeta(this.range.from.row,this.range.from.col,{[Uk]:{width:t,height:e}})}function UZ(t){Ie(it,this).isFocused()&&jo(t)}function zZ(){Ie(Gm,this)||this.hide()}function YZ(){const t=Ie(it,this).getEditorElement();we(t,/ht-theme-.*/g),Y(t,this.hot.getCurrentThemeName())}function Lb(t,e,n){return(e=GZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GZ(t){var e=KZ(t,"string");return typeof e=="symbol"?e:e+""}function KZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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(e){Lb(this,"hot",void 0),Lb(this,"commands",{}),Lb(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=qZ(a,l.submenu.items)),l.disabled===!0||typeof l.disabled=="function"&&l.disabled.call(this.hot)===!0||tn(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(":")),M(u,c=>c.apply(this.hot,r))}}function qZ(t,e){let n;return M(e,r=>{const i=r.key?r.key.split(":"):null;if(Array.isArray(i)&&i[1]===t)return n=r,!1}),n}function $b(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 Yk{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;$b(this,"hot",void 0),$b(this,"predefinedItems",Bk()),$b(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=n}setPredefinedItems(e){const n={};this.defaultOrderPattern.length=0,He(e,(r,i)=>{let o="";r.name===xe?(n[xe]=r,o=xe):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 JZ(e,this.defaultOrderPattern,this.predefinedItems)}}function JZ(){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),Ae(i)?He(i,(o,s)=>{let a=n[typeof o=="string"?o:s];a||(a=o),Ae(o)?rn(a,o):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=s),r.push(a)}):M(i,(o,s)=>{let a=n[o];!a&&TZ.indexOf(o)>=0||(a||(a={name:o,key:`${s}`}),Ae(o)&&rn(a,o),a.key===void 0&&(a.key=s),r.push(a))}),r}function Aa(t,e,n){return(e=QZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function QZ(t){var e=e5(t,"string");return typeof e=="symbol"?e:e+""}function e5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 t5{constructor(e,n){Aa(this,"top",void 0),Aa(this,"topRelative",void 0),Aa(this,"left",void 0),Aa(this,"leftRelative",void 0),Aa(this,"scrollTop",void 0),Aa(this,"scrollLeft",void 0),Aa(this,"cellHeight",void 0),Aa(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 ed(t,e,n){n5(t,e),e.set(t,n)}function n5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function De(t,e){return t.get(Gk(t,e))}function jg(t,e,n){return t.set(Gk(t,e),n),n}function Gk(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 $n=new WeakMap,es=new WeakMap,ir=new WeakMap,Fb=new WeakMap,ic=new WeakMap;class r5{constructor(e){ed(this,$n,void 0),ed(this,es,void 0),ed(this,ir,void 0),ed(this,Fb,!1),ed(this,ic,{above:0,below:0,left:0,right:0}),jg(Fb,this,e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return De(ic,this)[e]=n,this}setElement(e){return jg($n,this,e),this}setParentElement(e){return jg(es,this,e),this}updatePosition(e){jg(ir,this,new t5(e,De($n,this).ownerDocument.defaultView)),De(Fb,this)?(De(ir,this).fitsBelow(De($n,this))?this.setPositionBelowCursor():De(ir,this).fitsAbove(De($n,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){De($n,this).dir==="rtl"?De(ir,this).fitsOnLeft(De($n,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():De(ir,this).fitsOnRight(De($n,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=De(ic,this).above+De(ir,this).top-De($n,this).offsetHeight;De(es,this)&&(e=De(ir,this).top+De(ir,this).cellHeight-De($n,this).offsetHeight+3),De($n,this).style.top=`${e}px`}setPositionBelowCursor(){let e=De(ic,this).below+De(ir,this).top+1;De(es,this)&&(e=De(ir,this).top-1),De($n,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=De(ir,this).left;if(De(es,this)){const n=De(es,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(De(es,this).querySelector(".htCore")).borderRightWidth,10);e+=De(ir,this).cellWidth+r}else e+=De(ic,this).right;De($n,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=De(ic,this).left+De(ir,this).left-De($n,this).offsetWidth;if(De(es,this)){const n=De(es,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(De(es,this).querySelector(".htCore")).borderLeftWidth,10);e-=r}De($n,this).style.left=`${e}px`}}function Kk(t){let{initialPage:e=-1,size:n=()=>0,onItemSelect:r=()=>{},onClear:i=()=>{}}=t;const o=new Set;let s=ze(e,-1,m()-1);function a(w,S){const R=m()-1;return w<0&&(w=R),w>R&&(w=0),o.has(w)?-1:(o.add(w),r(w,!1)===!1&&(w=a(S===1?++w:--w,S)),w)}function l(w){w>-1&&w<m()&&r(w,!0)!==!1&&(s=w)}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 C(){o.clear(),s=e,i()}return{setCurrentPage:l,getCurrentPage:u,toFirstItem:c,toLastItem:h,toNextItem:d,toPreviousItem:f,getSize:m,clear:C}}function i5(t){return je(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function PR(t){return tn(t,"submenu")}function OR(t){return new RegExp(xe,"i").test(t.name)}function Km(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function Zx(t){return tn(t,"disableSelection")}function o5(t){return Ce(t,"htSeparator")}function s5(t){return Ce(t,"htSubmenu")}function a5(t){return Ce(t,"htDisabled")}function l5(t){return Ce(t,"htSelectionDisabled")}function u5(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function qk(t,e){const n=t.slice(0);for(let r=0;r<n.length&&n[r].name===e;)n.shift();return n}function c5(t,e){let n=t.slice(0);return n.reverse(),n=qk(n,e),n.reverse(),n}function h5(t){const e=[];return M(t,(n,r)=>{r>0?e[e.length-1].name!==n.name&&e.push(n):e.push(n)}),e}function d5(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xe,n=t.slice(0);return n=qk(n,e),n=c5(n,e),n=h5(n),n}function f5(t){return t.checkable===!0}function g5(t){return Kk({size:()=>t.countRows(),onItemSelect(e,n){const r=t.getCell(e,0);if(!r||o5(r)||a5(r)||l5(r))return!1;t.selectCell(e,0,...n?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function m5(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:[["ArrowRight"]],callback:()=>{const r=n.getSelectedLast();if(r){const i=t.openSubMenu(r[0]);i&&i.getNavigator().toFirstItem()}}},{keys:[["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 Xk="menu",Jx=Xk;function p5(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];r(m5(t)),e.forEach(u=>{let{shortcuts:c,contextName:h}=u;i(c,h)});function r(u,c){a(c).addShortcuts(u,{group:Xk})}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?`${Jx}:${u}`:Jx}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 w5(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(ma(n),Y(l,"htItemWrapper"),t.getSettings().ariaTags){const d=!Km(a,t)&&!Zx(a)&&!OR(a);be(n,[...f5(a)?[wU(),lp(c),gN(h)]:[pU(),lp(u)],...d?[Nu(-1)]:[],...Km(a,t)?[EU()]:[],...PR(a)?[so(!1)]:[]])}n.className="",n.appendChild(l),OR(a)?Y(n,"htSeparator"):typeof a.renderer=="function"?(Y(n,"htCustomMenuRenderer"),n.appendChild(a.renderer(e,l,r,i,o,u))):fh(l,u),Km(a,t)?Y(n,"htDisabled"):Zx(a)?Y(n,"htSelectionDisabled"):PR(a)&&Y(n,"htSubmenu")}}function Vb(t,e,n){v5(t,e),e.set(t,n)}function v5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ts(t,e,n){return(e=C5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C5(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)}function Wb(t,e,n){return t.set(Zk(t,e),n),n}function Fl(t,e){return t.get(Zk(t,e))}function Zk(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Qx=215;var td=new WeakMap,Ug=new WeakMap,zg=new WeakMap;class wh{get tableBorderWidth(){return Fl(zg,this)===void 0&&this.hotMenu&&Wb(zg,this,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),Fl(zg,this)}constructor(e,n){var r=this;ts(this,"hot",void 0),ts(this,"options",void 0),ts(this,"eventManager",new Fo(this)),ts(this,"container",void 0),ts(this,"positioner",void 0),ts(this,"hotMenu",null),ts(this,"hotSubMenus",{}),ts(this,"parentMenu",void 0),ts(this,"menuItems",null),ts(this,"origOutsideClickDeselects",null),Vb(this,td,void 0),Vb(this,Ug,void 0),Vb(this,zg,void 0),this.hot=e,this.options=n||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:Qx,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new r5(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=Kc(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return Fl(td,this)}getKeyboardShortcutsCtrl(){return Fl(Ug,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=FE(a=>this.openSubMenu(a),300),n=this.options.minWidth||Qx;let r=!1,i=vu(this.menuItems,a=>(a.key===ff&&(r=!0),u5(a,this.hot)));if(i.length<1&&!r)i.push(Bk()[ff]);else if(i.length===0)return;i=d5(i,xe);let o=!1;const s={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return se(a)&&a<n?n:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:w5(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,themeName:this.hot.getCurrentThemeName(),beforeOnCellMouseOver:(a,l)=>{Fl(td,this).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},afterOnCellContextMenu:a=>{a.preventDefault(),vP()&&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=>{(!vP()||!bu(a))&&o&&this.hasSelectedItem()&&(aa()||HN()?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(),Wb(td,this,g5(this.hotMenu)),Wb(Ug,this,p5(this)),Fl(Ug,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(Fl(td,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);be(r,[so(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const n=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!n||!s5(n))return!1;const r=this.hotMenu.getSourceDataAtRow(e),i=new wh(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&&be(n,[so(!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&&be(i,[so(!1)])}}closeAllSubMenus(){M(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?i5(r):[];this.runLocalHooks("executeCommand",n.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",n.key,i,e)}isCommandPassive(e){return e.isCommand===!1||OR(e)||Km(e,this.hot)||PR(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=mr(r,(l,u,c)=>{const d=this.hotMenu.getCell(c,0)?nn(this.hotMenu.getCell(c,0)):0;return l+(u.name===xe?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&&(mt(r)&&(r=r.call(this.hot),r===null||_t(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"),Y(i,`htMenu handsontable ${this.options.className}`),r&&Y(i,r),this.options.container.appendChild(i)),i}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&be(this.hotMenu.rootElement,[mU(),Nu(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!wu(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!wu(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&Ce(e.target,"htCore")&&wu(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}lt(wh,Rn);function b5(t,e){S5(t,e),e.add(t)}function S5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Bb(t,e,n){return(e=R5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R5(t){var e=E5(t,"string");return typeof e=="symbol"?e:e+""}function E5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Yg(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 xd="contextMenu",T5=70,eA=xd;ie.getSingleton().register("afterContextMenuDefaultOptions");ie.getSingleton().register("beforeContextMenuShow");ie.getSingleton().register("afterContextMenuShow");ie.getSingleton().register("afterContextMenuHide");ie.getSingleton().register("afterContextMenuExecute");var nd=new WeakSet;class Ww extends qe{constructor(){super(...arguments),b5(this,nd),Bb(this,"commandExecutor",new zk(this.hot)),Bb(this,"itemsFactory",null),Bb(this,"menu",null)}static get PLUGIN_KEY(){return xd}static get PLUGIN_PRIORITY(){return T5}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Lw,$w,xe,jf,Uf,xe,kw,Yf,xe,Fw,Dw,xe,zf,xe,Qi]}isEnabled(){return!!this.hot.getSettings()[xd]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[xd];typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.menu=new wh(this.hot,{className:"htContextMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>Yg(nd,this,M5).call(this)),this.menu.addLocalHook("afterOpen",()=>Yg(nd,this,I5).call(this)),this.menu.addLocalHook("afterClose",()=>Yg(nd,this,P5).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=>Yg(nd,this,_5).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=Hw(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:eA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(eA)}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;He(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 Yk(this.hot,Ww.DEFAULT_ITEMS);const e=this.hot.getSettings()[xd],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),M(r,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function _5(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(),Ce(o,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(n||r)&&!i(o)&&!(Ce(o,"current")&&Ce(o,"wtBorder"))))return;const s=Hw(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+s.top,left:t.clientX+s.left})}function M5(){this.hot.runHooks("beforeContextMenuShow",this)}function I5(){this.hot.runHooks("afterContextMenuShow",this)}function P5(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}Ww.SEPARATOR={name:xe};function O5(t){return{key:"copy",name(){return this.getTranslatedPhrase(Tr)},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 x5(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),n=e?ze(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Ea,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 A5(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),n=e?ze(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Ra,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 H5(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),n=e?ze(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Sa,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 N5(t){return{key:"cut",name(){return this.getTranslatedPhrase(_r)},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 D5{constructor(){this.data={}}setData(e,n){this.data[e]=n}getData(e){return this.data[e]||void 0}}class k5{constructor(){this.clipboardData=new D5}preventDefault(){}}function L5(t,e){Jk(t,e),e.add(t)}function oc(t,e,n){Jk(t,e),e.set(t,n)}function Jk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wn(t,e){return t.get(Dc(t,e))}function sc(t,e,n){return t.set(Dc(t,e),n),n}function Dc(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 Ha=new WeakMap,jb=new WeakMap,rd=new WeakMap,xR=new WeakMap,AR=new WeakMap,id=new WeakMap,od=new WeakSet;class $5{constructor(e){let{countRows:n,countColumns:r,rowsLimit:i,columnsLimit:o,countColumnHeaders:s}=e;L5(this,od),oc(this,Ha,void 0),oc(this,jb,void 0),oc(this,rd,void 0),oc(this,xR,void 0),oc(this,AR,void 0),oc(this,id,void 0),sc(jb,this,n),sc(rd,this,r),sc(xR,this,i),sc(AR,this,o),sc(id,this,s)}setSelectedRange(e){sc(Ha,this,e)}getCellsRange(){if(Wn(jb,this).call(this)===0||Wn(rd,this).call(this)===0)return null;const{row:e,col:n}=Wn(Ha,this).getTopStartCorner(),{row:r,col:i}=Wn(Ha,this).getBottomEndCorner(),o=Dc(od,this,F5).call(this,e,r),s=Dc(od,this,Ub).call(this,n,i);return{isRangeTrimmed:r!==o||i!==s,startRow:e,startCol:n,endRow:o,endCol:s}}getMostBottomColumnHeadersRange(){if(Wn(rd,this).call(this)===0||Wn(id,this).call(this)===0)return null;const{col:e}=Wn(Ha,this).getTopStartCorner(),{col:n}=Wn(Ha,this).getBottomEndCorner(),r=Dc(od,this,Ub).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-1,startCol:e,endRow:-1,endCol:r}}getAllColumnHeadersRange(){if(Wn(rd,this).call(this)===0||Wn(id,this).call(this)===0)return null;const{col:e}=Wn(Ha,this).getTopStartCorner(),{col:n}=Wn(Ha,this).getBottomEndCorner(),r=Dc(od,this,Ub).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-Wn(id,this).call(this),startCol:e,endRow:-1,endCol:r}}}function Ub(t,e){return Math.min(e,Math.max(t+Wn(AR,this).call(this)-1,t))}function F5(t,e){return Math.min(e,Math.max(t+Wn(xR,this).call(this)-1,t))}function Qk(t){const e=[],n=[];return M(t,r=>{const i=Math.min(r.startRow,r.endRow),o=Math.max(r.startRow,r.endRow);fe(i,o,l=>{e.indexOf(l)===-1&&e.push(l)});const s=Math.min(r.startCol,r.endCol),a=Math.max(r.startCol,r.endCol);fe(s,a,l=>{n.indexOf(l)===-1&&n.push(l)})}),{rows:e,columns:n}}function V5(t,e){eL(t,e),e.add(t)}function Na(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 sd(t,e,n){return(e=W5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function W5(t){var e=B5(t,"string");return typeof e=="symbol"?e:e+""}function B5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 cr(t,e){return t.get(hr(t,e))}function Eo(t,e,n){return t.set(hr(t,e),n),n}function hr(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")}ie.getSingleton().register("afterCopyLimit");ie.getSingleton().register("modifyCopyableRange");ie.getSingleton().register("beforeCut");ie.getSingleton().register("afterCut");ie.getSingleton().register("beforePaste");ie.getSingleton().register("afterPaste");ie.getSingleton().register("beforeCopy");ie.getSingleton().register("afterCopy");const zb="copyPaste",j5=80,U5=["fragmentSelection"],tA=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var HR=new WeakMap,NR=new WeakMap,DR=new WeakMap,ac=new WeakMap,Gg=new WeakMap,Kg=new WeakMap,lc=new WeakMap,Mp=new WeakMap,Li=new WeakSet;class z5 extends qe{constructor(){super(...arguments),V5(this,Li),sd(this,"columnsLimit",1/0),sd(this,"rowsLimit",1/0),sd(this,"pasteMode","overwrite"),sd(this,"uiContainer",this.hot.rootDocument.body),Na(this,HR,!1),Na(this,NR,!1),Na(this,DR,!1),Na(this,ac,"cells-only"),Na(this,Gg,!1),Na(this,Kg,!1),Na(this,lc,new $5({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),Na(this,Mp,!1),sd(this,"copyableRanges",[])}static get PLUGIN_KEY(){return zb}static get SETTING_KEYS(){return[zb,...U5]}static get PLUGIN_PRIORITY(){return j5}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[zb]}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"),Eo(HR,this,this.getSetting("copyColumnHeaders")),Eo(NR,this,this.getSetting("copyColumnGroupHeaders")),Eo(DR,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=(n=this.getSetting("uiContainer"))!==null&&n!==void 0?n:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",i=>hr(Li,this,K5).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 hr(Li,r,q5).call(r,...o)}),this.addHook("afterSelectionEnd",()=>hr(Li,this,X5).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)}),xN()&&(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 hr(Li,r,Z5).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 hr(Li,r,J5).call(r,...o)}),this.addHook("afterSelection",()=>hr(Li,this,Q5).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";Eo(ac,this,e),Eo(Gg,this,!0),hr(Li,this,nA).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(){Eo(Kg,this,!0),hr(Li,this,nA).call(this,"cut")}getRangedCopyableData(e){return $d(this.getRangedData(e))}getRangedData(e){const n=[],{rows:r,columns:i}=Qk(e);return M(r,o=>{const s=[];M(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 k5;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}cr(lc,this).setSelectedRange(e);const n=new Map([["headers",null],["cells",null]]);cr(ac,this)==="column-headers-only"?n.set("headers",cr(lc,this).getMostBottomColumnHeadersRange()):(cr(ac,this)==="with-column-headers"?n.set("headers",cr(lc,this).getMostBottomColumnHeadersRange()):cr(ac,this)==="with-column-group-headers"&&n.set("headers",cr(lc,this).getAllColumnHeadersRange()),n.set("cells",cr(lc,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:C}=this.hot.getCellMeta(c,a);if(c=C+1,m===!0)continue;d=C,h=a;const w=[],S=o.length%r;for(;w.length<i||h<=u;){const{skipColumnOnPaste:R,visualCol:I}=this.hot.getCellMeta(s,h);if(h=I+1,R===!0)continue;f=I;const O=w.length%i;w.push(e[S][O])}o.push(w)}return Eo(Mp,this,!0),this.hot.populateFromArray(s,a,o,void 0,void 0,"CopyPaste.paste",this.pasteMode),[s,a,d,f]}onCopy(e){var n;const r=this.hot.getFocusManager().getRefocusElement(),i=(n=e.target)===null||n===void 0?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!cr(Gg,this)||this.isEditorOpened()||ol(e.target)&&(i&&e.target!==r||!i&&e.target!==this.hot.rootDocument.body&&!Fm(e.target,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),Eo(Gg,this,!1);const o=this.getRangedData(this.copyableRanges),s=hr(Li,this,Y5).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",o,this.copyableRanges,s)){const l=$d(o);if(e&&e.clipboardData){const u=YP(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",l),e.clipboardData.setData("text/html",[tA,u].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",l);this.hot.runHooks("afterCopy",o,this.copyableRanges,s)}Eo(ac,this,"cells-only")}onCut(e){var n;const r=this.hot.getFocusManager().getRefocusElement(),i=(n=e.target)===null||n===void 0?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!cr(Kg,this)||this.isEditorOpened()||ol(e.target)&&(i&&e.target!==r||!i&&e.target!==this.hot.rootDocument.body&&!Fm(e.target,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),Eo(Kg,this,!1);const o=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",o,this.copyableRanges)){const a=$d(o);if(e&&e.clipboardData){const l=YP(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",a),e.clipboardData.setData("text/html",[tA,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){var n;const r=this.hot.getFocusManager().getRefocusElement(),i=(n=e.target)===null||n===void 0?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||ol(e.target)&&(i&&e.target!==r||!i&&e.target!==this.hot.rootDocument.body&&!Fm(e.target,this.hot.rootElement)))return;e.preventDefault();let o;if(e&&typeof e.clipboardData<"u"){const c=HE(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});c&&/(<table)|(<TABLE)/g.test(c)?o=Yz(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=Nq(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 nA(t){if(xN()){const e=this.hot.getSelectedRangeLast();if(e){const{row:n,col:r}=e.highlight,i=this.hot.getCell(n,r,!0);i&&UU(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function Y5(t){const{rows:e}=Qk(t);let n=0;for(let r=0;r<e.length&&!(e[r]>=0);r++)n+=1;return{columnHeadersCount:n}}function G5(){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&&_N(r)}}}function tL(){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")&&MN(r)}}}function K5(t){t.items.push({name:"---------"},O5(this)),cr(HR,this)&&t.items.push(H5(this)),cr(NR,this)&&t.items.push(A5(this)),cr(DR,this)&&t.items.push(x5(this)),t.items.push(N5(this))}function q5(t,e,n,r,i){cr(Mp,this)&&(i.value=!0),Eo(Mp,this,!1)}function X5(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function Z5(){hr(Li,this,tL).call(this)}function J5(){hr(Li,this,G5).call(this)}function Q5(){hr(Li,this,tL).call(this)}function nL(t,e){return`border_row${t}col${e}`}function Ad(){return{width:1,color:"#000"}}function la(){return{hide:!0}}function eJ(){return{width:1,color:"#000",cornerVisible:!1}}function Yb(t){if(se(t.start)||se(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(se(t.end)||se(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 ad(t){return se(t.start)&&(t.left=t.start),se(t.end)&&(t.right=t.end),t}function Gb(t,e){return{id:nL(t,e),border:eJ(),row:t,col:e,top:la(),bottom:la(),start:la(),end:la()}}function tJ(t,e){return tn(e,"border")&&e.border&&(t.border=e.border),tn(e,"top")&&se(e.top)&&(e.top?(Ae(e.top)||(e.top=Ad()),t.top=e.top):(e.top=la(),t.top=e.top)),tn(e,"bottom")&&se(e.bottom)&&(e.bottom?(Ae(e.bottom)||(e.bottom=Ad()),t.bottom=e.bottom):(e.bottom=la(),t.bottom=e.bottom)),tn(e,"start")&&se(e.start)&&(e.start?(Ae(e.start)||(e.start=Ad()),t.start=e.start):(e.start=la(),t.start=e.start)),tn(e,"end")&&se(e.end)&&(e.end?(Ae(e.end)||(e.end=Ad()),t.end=e.end):(e.end=la(),t.end=e.end)),t}function wa(t,e){let n=!1;return M(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(!tn(s[e],"hide")||s[e].hide===!1)return n=!0,!1}else return n=!0,!1})}),n}function Bw(t){return`<span class="selected">✓</span>${t}`}function nJ(t){return t.some(e=>se(e.left)||se(e.right))}function rJ(t){return t.some(e=>se(e.start)||se(e.end))}const iJ=new Map([["left","start"],["right","end"]]);function oJ(t){var e;return(e=iJ.get(t))!==null&&e!==void 0?e:t}function sJ(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(Yr);return wa(this,"bottom")&&(e=Bw(e)),e},callback(e,n){const r=wa(this,"bottom");t.prepareBorder(n,"bottom",r)}}}function aJ(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let n=this.getTranslatedPhrase(Gr);return wa(this,e)&&(n=Bw(n)),n},callback(n,r){const i=wa(this,e);t.prepareBorder(r,e,i)}}}function lJ(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(Kr)},callback(e,n){t.prepareBorder(n,"noBorders")},disabled(){return!wa(this)}}}function uJ(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let n=this.getTranslatedPhrase(zr);return wa(this,e)&&(n=Bw(n)),n},callback(n,r){const i=wa(this,e);t.prepareBorder(r,e,i)}}}function cJ(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(Ur);return wa(this,"top")&&(e=Bw(e)),e},callback(e,n){const r=wa(this,"top");t.prepareBorder(n,"top",r)}}}function hJ(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 fJ(t,e,n){return(e=gJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gJ(t){var e=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 rA(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 qm="customBorders",pJ=90;var Kb=new WeakSet;class wJ extends qe{constructor(){super(...arguments),hJ(this,Kb),fJ(this,"savedBorders",[])}static get PLUGIN_KEY(){return qm}static get PLUGIN_PRIORITY(){return pJ}isEnabled(){return!!this.hot.getSettings()[qm]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>rA(Kb,this,vJ).call(this,e)),this.addHook("init",()=>rA(Kb,this,CJ).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=Yb(n));const o=Zc(e),s=uf(o,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});M(e,a=>{s(a).forAll((l,u)=>{M(r,c=>{this.prepareBorderFromCustomAdded(l,u,i,oJ(c))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const n=Zc(e),r=uf(n,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return M(e,o=>{r(o).forAll((s,a)=>{M(this.savedBorders,l=>{l.row===s&&l.col===a&&i.push(ad(l))})})}),i}clearBorders(e){e?this.setBorders(e):(M(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=Gb(e,n);r&&(a=tJ(a,r),M(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",ad(a)),this.insertBorderIntoSettings(a,i)}prepareBorderFromCustomAddedRange(e,n){const r=Math.min(e.to.row,this.hot.countRows()-1),i=Math.min(e.to.col,this.hot.countCols()-1);fe(e.from.row,r,o=>{fe(e.from.col,i,s=>{const a=Gb(o,s);let l=0;o===e.from.row&&tn(n,"top")&&(l+=1,a.top=n.top),o===e.to.row&&tn(n,"bottom")&&(l+=1,a.bottom=n.bottom),s===e.from.col&&tn(n,"start")&&(l+=1,a.start=n.start),s===e.to.col&&tn(n,"end")&&(l+=1,a.end=n.end),l>0&&(this.hot.setCellMeta(o,s,"borders",ad(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,n){const r=nL(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=Gb(e,n):o=Yb(o),i?(o[r]=la(),this.countHide(o)===4?this.removeAllBorders(e,n):(this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",ad(o)))):(o[r]=Ad(),this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",ad(o)))}prepareBorder(e,n,r){M(e,i=>{let{start:o,end:s}=i;if(o.row===s.row&&o.col===s.col)n==="noBorders"?this.removeAllBorders(o.row,o.col):this.setBorder(o.row,o.col,n,r);else switch(n){case"noBorders":fe(o.col,s.col,a=>{fe(o.row,s.row,l=>{this.removeAllBorders(l,a)})});break;case"top":fe(o.col,s.col,a=>{this.setBorder(o.row,a,n,r)});break;case"bottom":fe(o.col,s.col,a=>{this.setBorder(s.row,a,n,r)});break;case"start":fe(o.row,s.row,a=>{this.setBorder(a,o.col,n,r)});break;case"end":fe(o.row,s.row,a=>{this.setBorder(a,s.col,n,r)});break}})}createCustomBorders(e){M(e,n=>{const r=Yb(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 mr([n,r,i,o],(a,l)=>{let u=a;return l&&l.hide&&(u+=1),u},0)}clearBordersFromSelectionSettings(e){const n=je(this.hot.selection.highlight.customSelections,r=>r.settings.id).indexOf(e);n>-1&&this.hot.selection.highlight.customSelections[n].clear()}clearNullCellRange(){M(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(){M(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const n=je(this.savedBorders,r=>r.id).indexOf(e);n>-1&&this.savedBorders.splice(n,1)}checkSavedBorders(e){let n=!1;return this.countHide(e)===4?(this.spliceBorder(e.id),n=!0):M(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 M(this.hot.selection.highlight.customSelections,o=>{if(e.id===o.settings.id){const s=this.hot.view._wt.selectionManager.getBorderInstances(o);return M(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):M(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);M(a,l=>{l.changeBorderStyle(r,e)})}return o=!0,!1}}),o}changeBorderSettings(){const e=this.hot.getSettings()[qm];if(Array.isArray(e)){const n=Kn(e);this.checkSettingsCohesion(n),n.length||(this.savedBorders=n),this.createCustomBorders(n)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const n=nJ(e),r=rJ(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 vJ(t){this.hot.getSettings()[qm]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(jr)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[cJ(this),uJ(this),sJ(this),aJ(this),lJ(this)]}})}function CJ(){this.changeBorderSettings()}function yJ(t,e){bJ(t,e),e.add(t)}function bJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qb(t,e,n){return(e=SJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function SJ(t){var e=RJ(t,"string");return typeof e=="symbol"?e:e+""}function RJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 iA(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 oA="dragToScroll",EJ=100;var Xb=new WeakSet;class TJ extends qe{constructor(){super(...arguments),yJ(this,Xb),qb(this,"boundaries",null),qb(this,"callback",null),qb(this,"listening",!1)}static get PLUGIN_KEY(){return oA}static get PLUGIN_PRIORITY(){return EJ}isEnabled(){return!!this.hot.getSettings()[oA]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>iA(Xb,this,sA).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>iA(Xb,this,sA).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=Kc(n)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function sA(t){if(bu(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 _J(t,e){rL(t,e),e.add(t)}function MJ(t,e,n){rL(t,e),e.set(t,n)}function rL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zb(t,e,n){return(e=IJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function IJ(t){var e=PJ(t,"string");return typeof e=="symbol"?e:e+""}function PJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function OJ(t,e){return t.get(eo(t,e))}function iL(t,e,n){return t.set(eo(t,e),n),n}function eo(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")}ie.getSingleton().register("afterDropdownMenuDefaultOptions");ie.getSingleton().register("beforeDropdownMenuShow");ie.getSingleton().register("afterDropdownMenuShow");ie.getSingleton().register("afterDropdownMenuHide");ie.getSingleton().register("afterDropdownMenuExecute");const Xm="dropdownMenu",xJ=230,gf="changeType",Jb=Xm;var jw=new WeakMap,Mo=new WeakSet;class Uw extends qe{static get PLUGIN_KEY(){return Xm}static get PLUGIN_PRIORITY(){return xJ}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[jf,Uf,xe,Yf,xe,Nw,xe,zf,xe,Qi]}constructor(e){super(e),_J(this,Mo),Zb(this,"commandExecutor",new zk(this.hot)),Zb(this,"itemsFactory",null),Zb(this,"menu",null),MJ(this,jw,!1),this.hot.addHook("afterGetColHeader",(n,r)=>eo(Mo,this,HJ).call(this,n,r))}isEnabled(){return this.hot.getSettings()[Xm]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new Yk(this.hot,Uw.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 eo(Mo,e,FJ).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 eo(Mo,e,$J).call(e,...o)});const n=this.hot.getSettings()[Xm],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 wh(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",()=>eo(Mo,this,NJ).call(this)),this.menu.addLocalHook("afterOpen",()=>eo(Mo,this,DJ).call(this)),this.menu.addLocalHook("afterSubmenuOpen",o=>eo(Mo,this,kJ).call(this,o)),this.menu.addLocalHook("afterClose",()=>eo(Mo,this,LJ).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)}),M(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=Hw(this.menu.container,this.hot.rootDocument),s=this.hot.getCell(-1,i.col,!0).querySelector(`.${gf}`),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:Jb},{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:Jb}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Jb)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>eo(Mo,this,AJ).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(),He(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 oL(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function AJ(t){if(Ce(t.target,gf)){const e=Hw(this.menu.container,this.hot.rootDocument),n=t.target.getBoundingClientRect();t.stopPropagation(),iL(jw,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 HJ(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(`.${gf}`);if(this.enabled&&o)return;if(!this.enabled){o&&o.parentNode.removeChild(o);return}const s=this.hot.rootDocument.createElement("button");s.className=gf,s.type="button",s.tabIndex=-1,this.hot.getSettings().ariaTags&&(be(s,[fl(),lp(" ")]),be(e,[hN("menu")])),s.onclick=function(){return!1},e.firstChild.insertBefore(s,e.firstChild.firstChild)}function NJ(){this.hot.runHooks("beforeDropdownMenuShow",this)}function DJ(){this.hot.runHooks("afterDropdownMenuShow",this),eo(Mo,this,oL).call(this,this.menu)}function kJ(t){eo(Mo,this,oL).call(this,t)}function LJ(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function $J(t){return OJ(jw,this)?null:t}function FJ(t){Ce(t.target,gf)&&iL(jw,this,!0)}Uw.SEPARATOR={name:xe};function aA(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=WJ(t,"string");return typeof e=="symbol"?e:e+""}function WJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 BJ{constructor(e){aA(this,"hot",void 0),aA(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:n,endRow:r,endCol:i}=this._getDataRange(),o=this.options,s=[];return fe(e,r,a=>{const l=[];!o.exportHiddenRows&&this._isHiddenRow(a)||(fe(n,i,u=>{!o.exportHiddenColumns&&this._isHiddenColumn(u)||l.push(this.hot.getDataAtCell(a,u))}),s.push(l))}),s}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:n,endRow:r}=this._getDataRange(),i=this.hot.getRowHeader();fe(n,r,o=>{!this.options.exportHiddenRows&&this._isHiddenRow(o)||e.push(i[o])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:n,endCol:r}=this._getDataRange(),i=this.hot.getColHeader();fe(n,r,o=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(o)||e.push(i[o])})}return e}_getDataRange(){const e=this.hot.countCols()-1,n=this.hot.countRows()-1;let[r=0,i=0,o=n,s=e]=this.options.range;return r=Math.max(r,0),i=Math.max(i,0),o=Math.min(o,n),s=Math.min(s,e),{startRow:r,startCol:i,endRow:o,endCol:s}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}function lA(t,e,n){return(e=jJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jJ(t){var e=UJ(t,"string");return typeof e=="symbol"?e:e+""}function UJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Y0{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){lA(this,"dataProvider",void 0),lA(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(n),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let n=Ms(this.constructor.DEFAULT_OPTIONS);const r=new Date;return n=rn(Ms(Y0.DEFAULT_OPTIONS),n),n=rn(n,e),n.filename=lN(n.filename,{YYYY:r.getFullYear(),MM:`${r.getMonth()+1}`.padStart(2,"0"),DD:`${r.getDate()}`.padStart(2,"0")}),n}}const zJ="\r",YJ='"',GJ=`
|
|
259
|
-
`;class KJ extends Y0{static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
|
|
260
|
-
`}}export(){const e=this.options,n=this.dataProvider.getData();let r=this.dataProvider.getColumnHeaders();const i=r.length>0,o=this.dataProvider.getRowHeaders(),s=o.length>0;let a=e.bom?"\uFEFF":"";return i&&(r=je(r,l=>this._escapeCell(l,!0)),s&&(a+=e.columnDelimiter),a+=r.join(e.columnDelimiter),a+=e.rowDelimiter),M(n,(l,u)=>{u>0&&(a+=e.rowDelimiter),s&&(a+=this._escapeCell(o[u])+e.columnDelimiter),a+=l.map(c=>this._escapeCell(c)).join(e.columnDelimiter)}),a}_escapeCell(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=Kt(e);return r!==""&&(n||r.indexOf(zJ)>=0||r.indexOf(YJ)>=0||r.indexOf(GJ)>=0||r.indexOf(this.options.columnDelimiter)>=0)&&(r=r.replace(new RegExp('"',"g"),'""'),r=`"${r}"`),r}}const qJ="csv",kR={[qJ]:KJ};function XJ(t,e,n){return typeof kR[t]=="function"?new kR[t](e,n):null}const ZJ="exportFile",JJ=240;class QJ extends qe{static get PLUGIN_KEY(){return ZJ}static get PLUGIN_PRIORITY(){return JJ}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(!kR[e])throw new Error(`Export format type "${e}" is not supported.`);return XJ(e,new BJ(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 uc(t,e,n){return(e=eQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eQ(t){var e=tQ(t,"string");return typeof e=="symbol"?e:e+""}function tQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Gf{constructor(e,n){let{id:r,stateless:i=!0}=n;uc(this,"hot",void 0),uc(this,"id",void 0),uc(this,"elements",[]),uc(this,"hidden",!1),uc(this,"stateId",""),uc(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 Rw)}getElements(){return this.elements}reset(){M(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(),M(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}lt(Gf,Rn);const mf={};function ul(t,e){if(!mf[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:n,descriptor:r}=mf[t];let i=e;return r.inputValuesDecorator&&(i=r.inputValuesDecorator(i)),function(o){return n.apply(o.meta.instance,[].concat([o],[i]))}}function fu(t){if(!mf[t])throw Error(`Filter condition "${t}" does not exist.`);return mf[t].descriptor}function Xt(t,e,n){n.key=t,mf[t]={condition:e,descriptor:n}}const wn="none";function nQ(){return!0}Xt(wn,nQ,{name:Jn,inputsCount:0,showOperators:!1});const Wd="empty";function rQ(t){return jt(t.value)}Xt(Wd,rQ,{name:ti,inputsCount:0,showOperators:!0});const Zm="not_empty";function iQ(t,e){return!ul(Wd,e)(t)}Xt(Zm,iQ,{name:ni,inputsCount:0,showOperators:!0});const Bd="eq";function oQ(t,e){let[n]=e;return Kt(t.value).toLocaleLowerCase(t.meta.locale)===Kt(n)}Xt(Bd,oQ,{name:ri,inputsCount:1,showOperators:!0});const Jm="neq";function sQ(t,e){return!ul(Bd,e)(t)}Xt(Jm,sQ,{name:ii,inputsCount:1,showOperators:!0});const sL="gt";function aQ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>r}Xt(sL,aQ,{name:ui,inputsCount:1,showOperators:!0});const aL="gte";function lQ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>=r}Xt(aL,lQ,{name:ci,inputsCount:1,showOperators:!0});const lL="lt";function uQ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<r}Xt(lL,uQ,{name:hi,inputsCount:1,showOperators:!0});const uL="lte";function cQ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<=r}Xt(uL,cQ,{name:di,inputsCount:1,showOperators:!0});const G0="date_after";function hQ(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}Xt(G0,hQ,{name:mi,inputsCount:1,showOperators:!0});const K0="date_before";function dQ(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}Xt(K0,dQ,{name:pi,inputsCount:1,showOperators:!0});const Ip="between";function fQ(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=ul(K0,[o]),a=ul(G0,[i]);return s(t)&&a(t)}return t.value>=i&&t.value<=o}Xt(Ip,fQ,{name:fi,inputsCount:2,showOperators:!0});const cL="not_between";function gQ(t,e){return!ul(Ip,e)(t)}Xt(cL,gQ,{name:gi,inputsCount:2,showOperators:!0});const hL="begins_with";function mQ(t,e){let[n]=e;return Kt(t.value).toLocaleLowerCase(t.meta.locale).startsWith(Kt(n))}Xt(hL,mQ,{name:oi,inputsCount:1,showOperators:!0});const dL="ends_with";function pQ(t,e){let[n]=e;return Kt(t.value).toLocaleLowerCase(t.meta.locale).endsWith(Kt(n))}Xt(dL,pQ,{name:si,inputsCount:1,showOperators:!0});const q0="contains";function wQ(t,e){let[n]=e;return Kt(t.value).toLocaleLowerCase(t.meta.locale).indexOf(Kt(n))>=0}Xt(q0,wQ,{name:ai,inputsCount:1,showOperators:!0});const fL="not_contains";function vQ(t,e){return!ul(q0,e)(t)}Xt(fL,vQ,{name:li,inputsCount:1,showOperators:!0});const gL="date_tomorrow";function CQ(t){const e=q(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(q().subtract(-1,"days").startOf("day"),"d"):!1}Xt(gL,CQ,{name:vi,inputsCount:0});const mL="date_today";function yQ(t){const e=q(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(q().startOf("day"),"d"):!1}Xt(mL,yQ,{name:wi,inputsCount:0});const pL="date_yesterday";function bQ(t){const e=q(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(q().subtract(1,"days").startOf("day"),"d"):!1}Xt(pL,bQ,{name:Ci,inputsCount:0});ZU();function SQ(t,e){let n=t;return n===""&&(n=`(${e})`),n}function Kf(t){const e=new Set(t);return function(n){return e.has(n)}}function X0(t){return t??""}function LR(t){return Array.from(new Set(t)).map(e=>X0(e)).sort((e,n)=>typeof e=="number"&&typeof n=="number"?e-n:e===n?0:e>n?1:-1)}function uA(t,e,n,r){const i=[],o=t===e;let s;return o||(s=Kf(e)),t.forEach(a=>{let l=!1;(o||s(a))&&(l=!0);const u={checked:l,value:a,visualValue:SQ(a,n)};r&&r(u),i.push(u)}),i}const gu="by_value";function RQ(t,e){let[n]=e;return n(t.value)}Xt(gu,RQ,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[Kf(e)]},showOperators:!1});const pf={};function EQ(t){if(!pf[t])throw Error(`Operation with id "${t}" does not exist.`);const e=pf[t].func;return function(n,r){return e(n,r)}}function TQ(t){return pf[t].name}function Z0(t,e,n){pf[t]={name:e,func:n}}const al="conjunction",_Q=Si;function MQ(t,e){return t.every(n=>n.func(e))}Z0(al,_Q,MQ);const Pp="disjunction",IQ=Qn;function PQ(t,e){return t.some(n=>n.func(e))}Z0(Pp,IQ,PQ);const J0="disjunctionWithExtraCondition",OQ=Qn;function xQ(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)}Z0(J0,OQ,xQ);const AQ="numeric",wL="text",HQ="date",cA={[AQ]:[wn,xe,Wd,Zm,xe,Bd,Jm,xe,sL,aL,lL,uL,Ip,cL],[wL]:[wn,xe,Wd,Zm,xe,Bd,Jm,xe,hL,dL,xe,q0,fL],[HQ]:[wn,xe,Wd,Zm,xe,Bd,Jm,xe,K0,G0,Ip,xe,gL,mL,pL]};function NQ(t){const e=[];let n=t;return cA[n]||(n=wL),M(cA[n],r=>{let i;r===xe?i={name:xe}:i=Ms(fu(r)),e.push(i)}),e}function ld(t,e,n){return(e=DQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function DQ(t){var e=kQ(t,"string");return typeof e=="symbol"?e:e+""}function kQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Qb="built",eS="building",hA=["click","input","keydown","keypress","keyup","focus","blur","change"];let Do=class vL{static get DEFAULTS(){return Ms({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,n){ld(this,"hot",void 0),ld(this,"eventManager",new Fo(this)),ld(this,"options",void 0),ld(this,"_element",void 0),ld(this,"buildState",void 0),this.hot=e,this.options=rn(vL.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===eS?this._element:this.buildState===Qb?(this.update(),this._element):(this.buildState=eS,this.build(),this.buildState=Qb,this._element)}isBuilt(){return this.buildState===Qb}translateIfPossible(e){return typeof e=="string"&&e.startsWith(Zn)?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=eS),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&&Y(this._element,this.options.className),this.options.children.length)M(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),He(this.options,(r,i)=>{n[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(n[i]=this.translateIfPossible(r))}),this._element.appendChild(n),M(hA,r=>e(n,r))}else M(hA,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}};lt(Do,Rn);function LQ(t,e){CL(t,e),e.add(t)}function $Q(t,e,n){CL(t,e),e.set(t,n)}function CL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qg(t,e){return t.get(Q0(t,e))}function FQ(t,e,n){return t.set(Q0(t,e),n),n}function Q0(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 cc=new WeakMap,dA=new WeakSet;class ll extends Do{static get DEFAULTS(){return Ms({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,n){super(e,rn(ll.DEFAULTS,n)),LQ(this,dA),$Q(this,cc,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>Q0(dA,this,VQ).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");FQ(cc,this,this._element.firstChild),Y(this._element,"htUIInput"),Y(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(qg(cc,this).type=this.options.type,qg(cc,this).placeholder=this.translateIfPossible(this.options.placeholder),qg(cc,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&qg(cc,this).focus()}}function VQ(t){this.options.value=t.target.value}function WQ(t,e){yL(t,e),e.add(t)}function ud(t,e,n){yL(t,e),e.set(t,n)}function yL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hc(t,e,n){return t.set(jd(t,e),n),n}function Mt(t,e){return t.get(jd(t,e))}function jd(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var an=new WeakMap,Xg=new WeakMap,Zg=new WeakMap,tS=new WeakMap,Jg=new WeakMap,Qg=new WeakSet;class wf extends Do{static get DEFAULTS(){return Ms({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,n){super(e,rn(wf.DEFAULTS,n)),WQ(this,Qg),ud(this,an,null),ud(this,Xg,[]),ud(this,Zg,void 0),ud(this,tS,void 0),ud(this,Jg,void 0),this.registerHooks()}getMenu(){return Mt(an,this)}registerHooks(){this.addLocalHook("click",()=>jd(Qg,this,UQ).call(this))}setItems(e){hc(Xg,this,this.translateNames(e)),Mt(an,this)&&Mt(an,this).setMenuItems(Mt(Xg,this))}translateNames(e){return M(e,n=>{n.name=this.translateIfPossible(n.name)}),e}build(){super.build(),hc(an,this,new wh(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),Mt(an,this).setMenuItems(Mt(Xg,this));const e=new Do(this.hot,{className:"htUISelectCaption"}),n=new Do(this.hot,{className:"htUISelectDropdown"});hc(Zg,this,e),hc(tS,this,e.element),hc(Jg,this,n),this.hot.getSettings().ariaTags&&(be(n.element,[fl()]),be(this._element,[cN()])),M([e,n],r=>this._element.appendChild(r.element)),Mt(an,this).addLocalHook("select",r=>jd(Qg,this,BQ).call(this,r)),Mt(an,this).addLocalHook("afterClose",()=>jd(Qg,this,jQ).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=Mt(an,this).hot.getTranslatedPhrase(Jn),Mt(tS,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();Mt(an,this)&&(Mt(an,this).open(),Mt(an,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),Mt(an,this).getNavigator().toFirstItem(),Mt(an,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:n=>{this.closeOptions(),this.runLocalHooks("tabKeydown",n)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){Mt(an,this)&&Mt(an,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){Mt(an,this)&&(Mt(an,this).destroy(),hc(an,this,null)),Mt(Zg,this)&&Mt(Zg,this).destroy(),Mt(Jg,this)&&Mt(Jg,this).destroy(),super.destroy()}}function BQ(t){t.name!==xe&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function jQ(){this.runLocalHooks("afterClose")}function UQ(){this.openOptions()}function zQ(t,e){YQ(t,e),e.add(t)}function YQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fA(t,e,n){return(e=GQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GQ(t){var e=KQ(t,"string");return typeof e=="symbol"?e:e+""}function KQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 gA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var nS=new WeakSet;class $R extends Gf{constructor(e,n){super(e,{id:n.id,stateless:!1}),zQ(this,nS),fA(this,"name",""),fA(this,"addSeparator",!1),this.name=n.name,this.addSeparator=n.addSeparator,this.elements.push(new wf(this.hot,{menuContainer:n.menuContainer})),this.elements.push(new ll(this.hot,{placeholder:Ii})),this.elements.push(new ll(this.hot,{placeholder:Pi})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>gA(nS,this,qQ).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),M(this.getInputElements(),e=>{e.addLocalHook("keydown",n=>gA(nS,this,XQ).call(this,n))})}setState(e){if(this.reset(),!e)return;const n=Ms(e.command);n.name.startsWith(Dt)&&(n.name=this.hot.getTranslatedPhrase(n.name)),this.getSelectElement().setValue(n),M(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()||fu(wn),n=[];return M(this.getInputElements(),(r,i)=>{e.inputsCount>i&&n.push(r.getValue())}),{command:e,args:n}}updateState(e,n){const r=fu(e?e.name:wn);this.state.setValueAtIndex(n,{command:r,args:e?e.args:[]}),e||M(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof wf)[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 ll)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{Y(n.parentNode,"htFiltersMenuCondition"),this.addSeparator&&Y(n.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return Y(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||M(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let n=[fu(wn)];if(e!==null){const{visualIndex:r}=e;n=NQ(this.hot.getDataType(0,r,this.hot.countRows(),r))}M(this.getInputElements(),r=>r.hide()),this.getSelectElement().setItems(n),super.reset(),this.getSelectElement().setValue(n[0])}}function qQ(t){M(this.getInputElements(),(e,n)=>{e[t.inputsCount>n?"show":"hide"](),n===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function XQ(t){Nf(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),jo(t))}function mA(t,e,n){ZQ(t,e),e.set(t,n)}function ZQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cd(t,e){return t.get(bL(t,e))}function pA(t,e,n){return t.set(bL(t,e),n),n}function bL(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 dc=new WeakMap,rS=new WeakMap;class Op extends Do{static get DEFAULTS(){return Ms({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,n){super(e,rn(Op.DEFAULTS,n)),mA(this,dc,void 0),mA(this,rS,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),pA(rS,this,e),pA(dc,this,this._element.firstChild),cd(dc,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(cd(rS,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?cd(dc,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(cd(dc,this).checked=e)}focus(){this.isBuilt()&&cd(dc,this).focus()}}function JQ(t,e){QQ(t,e),e.add(t)}function QQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function eee(t,e,n){return(e=tee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tee(t){var e=nee(t,"string");return typeof e=="symbol"?e:e+""}function nee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 ree(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 wA=0;var vA=new WeakSet;class iee extends Gf{constructor(e,n){super(e,{id:n.id,stateless:!1}),JQ(this,vA),eee(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)=>(Y(n.parentNode,"htFiltersMenuOperators"),M(this.elements,r=>n.appendChild(r.element)),n)}}buildOperatorsElement(){const e=[al,Pp];M(e,n=>{const r=new Op(this.hot,{name:"operator",label:{htmlFor:n,textContent:TQ(n)},value:n,checked:n===e[wA],id:n});r.addLocalHook("change",i=>ree(vA,this,oee).call(this,i)),this.elements.push(r)})}setChecked(e){if(this.elements.length<e)throw Error(tt`Radio button with index ${e} doesn't exist.`);M(this.elements,(n,r)=>{n.setChecked(r===e)})}getActiveOperationId(){const e=this.elements.find(n=>n instanceof Op&&n.isChecked());return e?e.getValue():al}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&M(this.elements,n=>{n.setChecked(n.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:al,n=arguments.length>1?arguments[1]:void 0,r=e;r===J0&&(r=Pp),this.state.setValueAtIndex(n,r)}reset(){this.setChecked(wA)}}function oee(t){this.setState(t.target.value)}function see(t,e,n){aee(t,e),e.set(t,n)}function aee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function iS(t,e){return t.get(SL(t,e))}function lee(t,e,n){return t.set(SL(t,e),n),n}function SL(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 hd=new WeakMap;class vf extends Do{static get DEFAULTS(){return Ms({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,n){super(e,rn(vf.DEFAULTS,n)),see(this,hd,void 0)}build(){super.build(),lee(hd,this,this._element.firstChild)}update(){this.isBuilt()&&(iS(hd,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&iS(hd,this).focus()}activate(){iS(hd,this).click()}}function uee(t,e){RL(t,e),e.add(t)}function fc(t,e,n){RL(t,e),e.set(t,n)}function RL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Te(t,e){return t.get(kc(t,e))}function Co(t,e,n){return t.set(kc(t,e),n),n}function kc(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 CA="multipleSelect.itemBox";var Io=new WeakMap,Vt=new WeakMap,oS=new WeakMap,Us=new WeakMap,Da=new WeakMap,ka=new WeakMap,dd=new WeakSet;class Cf extends Do{static get DEFAULTS(){return Ms({className:"htUIMultipleSelect",value:[]})}constructor(e,n){super(e,rn(Cf.DEFAULTS,n)),uee(this,dd),fc(this,Io,[]),fc(this,Vt,void 0),fc(this,oS,void 0),fc(this,Us,void 0),fc(this,Da,void 0),fc(this,ka,void 0),Co(Us,this,new ll(this.hot,{placeholder:Mi,className:"htUIMultipleSelectSearch"})),Co(Da,this,new vf(this.hot,{textContent:Ri,className:"htUISelectAll"})),Co(ka,this,new vf(this.hot,{textContent:Ei,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return Te(Vt,this)}registerHooks(){Te(Us,this).addLocalHook("keydown",e=>kc(dd,this,hee).call(this,e)),Te(Us,this).addLocalHook("input",e=>kc(dd,this,cee).call(this,e)),Te(Da,this).addLocalHook("click",e=>kc(dd,this,dee).call(this,e)),Te(ka,this).addLocalHook("click",e=>kc(dd,this,fee).call(this,e))}setItems(e){var n;Co(Io,this,e),(n=Te(Vt,this))===null||n===void 0||n.loadData(Te(Io,this))}setLocale(e){Co(oS,this,e)}getLocale(){return Te(oS,this)}getItems(){return[...Te(Io,this)]}getValue(){return mee(Te(Io,this))}getSearchInputElement(){return Te(Us,this)}getSelectAllElement(){return Te(Da,this)}getClearAllElement(){return Te(ka,this)}isSelectedAllValues(){return Te(Io,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,n=e.createElement("div"),r=new Do(this.hot,{className:"htUISelectionControls",children:[Te(Da,this),Te(ka,this)]});this._element.appendChild(Te(Us,this).element),this._element.appendChild(r.element),this._element.appendChild(n);const i=o=>{var s;if(!this._element)return;(s=Te(Vt,this))===null||s===void 0||s.destroy(),Y(o,"htUIMultipleSelectHot"),Co(Vt,this,new this.hot.constructor(o,{data:Te(Io,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:()=>{Te(Vt,this).listen()},colWidths:()=>Te(Vt,this).container.scrollWidth-vn(e),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"})),Te(Vt,this).init(),this.hot.addHook("afterSetTheme",(u,c)=>{c||Te(Vt,this).useTheme(u)});const l=Te(Vt,this).getShortcutManager().getContext("grid");l.removeShortcutsByKeys(["Tab"]),l.removeShortcutsByKeys(["Shift","Tab"]),l.addShortcut({keys:[["Escape"]],callback:u=>{this.runLocalHooks("keydown",u,this)},group:CA}),l.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:u=>{Te(Vt,this).deselectCell(),this.runLocalHooks("keydown",u,this),this.runLocalHooks("listTabKeydown",u,this)},group:CA})};i(n),this.hot._registerTimeout(()=>i(n),100)}focus(){this.isBuilt()&&Te(Vt,this).listen()}reset(){Te(Us,this).reset(),Te(Da,this).reset(),Te(ka,this).reset()}update(){this.isBuilt()&&(Te(Vt,this).loadData(gee(Te(Io,this),this.options.value)),super.update())}destroy(){var e;(e=Te(Vt,this))===null||e===void 0||e.destroy(),Te(Us,this).destroy(),Te(ka,this).destroy(),Te(Da,this).destroy(),Co(Us,this,null),Co(ka,this,null),Co(Da,this,null),Co(Vt,this,null),Co(Io,this,null),super.destroy()}}function cee(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let n;e===""?n=[...Te(Io,this)]:n=Te(Io,this).filter(r=>`${r.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),Te(Vt,this).loadData(n)}function hee(t){this.runLocalHooks("keydown",t,this),IN(Nf,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),jo(t),Te(Vt,this).listen(),Te(Vt,this).selectCell(0,0))}function dee(t){const e=[];t.preventDefault(),Te(Vt,this).getSourceData().forEach((n,r)=>{n.checked=!0,e.push(fD(n,r)[0])}),Te(Vt,this).setSourceDataAtCell(e)}function fee(t){const e=[];t.preventDefault(),Te(Vt,this).getSourceData().forEach((n,r)=>{n.checked=!1,e.push(fD(n,r)[0])}),Te(Vt,this).setSourceDataAtCell(e)}function gee(t,e){const n=Kf(e);return t.map(r=>(r.checked=n(r.value),r))}function mee(t){const e=[];return t.forEach(n=>{n.checked&&e.push(n.value)}),e}function pee(t,e){wee(t,e),e.add(t)}function wee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vee(t,e,n){return(e=Cee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cee(t){var e=yee(t,"string");return typeof e=="symbol"?e:e+""}function yee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 em(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 fd=new WeakSet;class bee extends Gf{constructor(e,n){super(e,{id:n.id,stateless:!1}),pee(this,fd),vee(this,"name",""),this.name=n.name,this.elements.push(new Cf(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>em(fd,this,See).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,n)=>em(fd,this,Ree).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===gu){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?wn:gu},args:[e.getValue()],itemsSnapshot:n}}updateState(e){const n=(r,i,o,s,a)=>{const[l]=vu(i,h=>h.name===gu),u={},c=this.hot.getTranslatedPhrase(Xn);if(l){const h=s(r,a),d=je(h,R=>R.value),f=new Map(h.map(R=>[R.value,this.hot.getCellMeta(R.meta.visualRow,R.meta.visualCol)])),m=LR(d);o&&(l.args[0]=o);const C=[],w=uA(m,l.args[0],c,R=>{R.checked&&C.push(R.value),em(fd,this,yA).call(this,R,f)}),S=e.editedConditionStack.column;u.locale=this.hot.getCellMeta(0,S).locale,u.args=[C],u.command=fu(gu),u.itemsSnapshot=w}else u.args=[],u.command=fu(wn);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 Cf)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{Y(n.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return Y(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||M(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getTranslatedPhrase(Xn),n=this._getColumnVisibleValues(),r=n.map(l=>l.value),i=new Map(n.map(l=>[l.value,l.meta])),o=LR(r),s=uA(o,o,e,l=>{em(fd,this,yA).call(this,l,i)});this.getMultipleSelectElement().setItems(s),super.reset(),this.getMultipleSelectElement().setValue(o);const a=this.hot.getPlugin("filters").getSelectedColumn();a!==null&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,a.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return e===null?[]:je(this.hot.getDataAtCol(e.visualIndex),(n,r)=>({value:X0(n),meta:this.hot.getCellMeta(r,e.visualIndex)}))}}function See(t){Nf(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),jo(t))}function yA(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function Ree(t,e){switch(e.type){case"numeric":return mk(t,e);default:return t}}var EL;function Eee(t,e){Tee(t,e),e.add(t)}function Tee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _ee(t,e,n){return(e=Mee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mee(t){var e=Iee(t,"string");return typeof e=="symbol"?e:e+""}function Iee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Pee(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 bA=new WeakSet;class yf extends Gf{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,n){super(e,{id:n.id,stateless:!0}),Eee(this,bA),_ee(this,"name",""),this.name=n.name,this.elements.push(new ll(this.hot,{type:"button",value:Ti,className:"htUIButton htUIButtonOK",identifier:yf.BUTTON_OK})),this.elements.push(new ll(this.hot,{type:"button",value:_i,className:"htUIButton htUIButtonCancel",identifier:yf.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){M(this.elements,e=>{e.addLocalHook("click",(n,r)=>Pee(bA,this,Oee).call(this,n,r))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(Y(n.parentNode,"htFiltersMenuActionBar"),M(this.elements,r=>n.appendChild(r.element)),n)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}EL=yf;function Oee(t,e){e.options.identifier===EL.BUTTON_OK?this.accept():this.cancel()}function sS(t,e,n){return(e=xee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xee(t){var e=Aee(t,"string");return typeof e=="symbol"?e:e+""}function Aee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 SA="ConditionCollection.filteringStates";class eT{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;sS(this,"hot",void 0),sS(this,"isMapRegistrable",void 0),sS(this,"filteringStates",new Rw),this.hot=e,this.isMapRegistrable=n,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(SA,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==null?void 0:i.conditions)!==null&&r!==void 0?r:[],s=i==null?void 0:i.operation;return this.isMatchInConditions(o,e,s)}isMatchInConditions(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:al;return e.length?EQ(r)(e,n):!0}addCondition(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:al,i=arguments.length>3?arguments[3]:void 0;const o=this.hot.getCellMeta(0,e).locale,s=n.args.map(c=>typeof c=="string"?c.toLocaleLowerCase(o):c),a=n.name||n.command.key;this.runLocalHooks("beforeAdd",e);const l=this.getOperation(e);if(l){if(l!==r)throw Error(tt`The column of index ${e} has been already applied with a \`${l}\`\x20
|
|
261
|
-
filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
|
|
262
|
-
Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
|
|
263
|
-
use it consequently for a particular column).`)}else if(_t(pf[r]))throw new Error(tt`Unexpected operation named \`${r}\`. Possible ones are\x20
|
|
264
|
-
\`disjunction\` and \`conjunction\`.`);const u=this.getConditions(e);u.length===0?this.filteringStates.setValueAtIndex(e,{operation:r,conditions:[{name:a,args:s,func:ul(a,s)}]},i):u.push({name:a,args:s,func:ul(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(SA),this.filteringStates=null,this.clearLocalHooks()}}lt(eT,Rn);function RA(t,e,n){return(e=Hee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hee(t){var e=Nee(t,"string");return typeof e=="symbol"?e:e+""}function Nee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 TL{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];RA(this,"conditionCollection",void 0),RA(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=n}filter(){let e=[];return M(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 M(n,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&r.push(i)}),r}_getIntersectData(e,n){const r=[];return M(n,i=>{const o=i.meta.visualRow;e[o]!==void 0&&(r[o]=e[o])}),r}}function Dee(t,e){kee(t,e),e.add(t)}function kee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vl(t,e,n){return(e=Lee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lee(t){var e=$ee(t,"string");return typeof e=="symbol"?e:e+""}function $ee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function aS(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var tm=new WeakSet;class _L{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];Dee(this,tm),Vl(this,"hot",void 0),Vl(this,"conditionCollection",void 0),Vl(this,"columnDataFactory",void 0),Vl(this,"changes",[]),Vl(this,"grouping",!1),Vl(this,"latestEditedColumnPosition",-1),Vl(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=n,this.columnDataFactory=r,this.conditionCollection.addLocalHook("beforeRemove",i=>aS(tm,this,Fee).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>aS(tm,this,Vee).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>aS(tm,this,Wee).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,M(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=zU(function(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const f=new eT(r.hot,!1),m=[].concat(c,d);f.importAllConditions(m);const C=r.columnDataFactory(h);let w;f.isEmpty()?w=C:w=new TL(f,R=>r.columnDataFactory(R)).filter(),w=je(w,R=>R.meta.visualRow);const S=Kf(w);return f.destroy(),vu(C,R=>S(R.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(),He(this,(e,n)=>{this[n]=null})}}function Fee(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function Vee(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function Wee(){M(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}lt(_L,Rn);function Bee(t){return Kk({initialPage:0,size:()=>t.length,onItemSelect:(n,r)=>{const i=t[n];if(i instanceof Cf)return r;if(i.element&&!qc(i.element))return!1;i.focus()}})}const gd="filters";function jee(t,e){let n=-1,r;const i=Bee(e),o=h=>()=>{r.isOpened()&&r.getKeyboardShortcutsCtrl().listen(gd),i.setCurrentPage(e.indexOf(h))};e.forEach(h=>{h instanceof Do&&(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(gd),callback:()=>{h.isSubMenu()&&h.close(),d.listen(gd)}}]),!h.isSubMenu()&&d.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:m=>{const C=r.getNavigator();C.getCurrentPage()>-1&&(n=C.getCurrentPage()),C.clear(),m.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{r.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:m=>{const C=e[i.getCurrentPage()];C instanceof wf&&(C.openOptions(),m.preventDefault()),C instanceof vf&&(C.activate(),m.preventDefault()),C instanceof Do||m.preventDefault()}}],gd)}function a(){r.focus(),r.getKeyboardShortcutsCtrl().listen(gd)}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 Uee(t,e){ML(t,e),e.add(t)}function lS(t,e,n){ML(t,e),e.set(t,n)}function ML(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function md(t,e,n){return(e=zee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zee(t){var e=Yee(t,"string");return typeof e=="symbol"?e:e+""}function Yee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 FR(t,e,n){return t.set(ar(t,e),n),n}function to(t,e){return t.get(ar(t,e))}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")}const VR="filters",Gee=250,EA=VR;var Xs=new WeakMap,WR=new WeakMap,Lc=new WeakMap,Oi=new WeakSet;class Kee extends qe{static get PLUGIN_KEY(){return VR}static get PLUGIN_PRIORITY(){return Gee}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var n;super(e),n=this,Uee(this,Oi),md(this,"dropdownMenuPlugin",null),md(this,"conditionCollection",null),md(this,"conditionUpdateObserver",null),md(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),md(this,"filtersRowsMap",null),lS(this,Xs,void 0),lS(this,WR,new WeakSet),lS(this,Lc,[]),this.hot.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return ar(Oi,n,tte).call(n,...i)})}isEnabled(){return!!this.hot.getSettings()[VR]}enablePlugin(){var e=this;if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new $f),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",()=>ar(Oi,this,TA).call(this,"accept")),a.addLocalHook("cancel",()=>ar(Oi,this,TA).call(this,"cancel")),a.addLocalHook("change",l=>ar(Oi,this,ete).call(this,a,l)),a),o=()=>`${this.hot.getTranslatedPhrase(yi)}:`,s=()=>`${this.hot.getTranslatedPhrase(bi)}:`;if(!this.components.get("filter_by_condition")){const a=new $R(this.hot,{id:"filter_by_condition",name:o,addSeparator:!1,menuContainer:r});a.addLocalHook("afterClose",()=>ar(Oi,this,_A).call(this)),this.components.set("filter_by_condition",i(a))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new iee(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const a=new $R(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:r});a.addLocalHook("afterClose",()=>ar(Oi,this,_A).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 bee(this.hot,{id:"filter_by_value",name:s}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",i(new yf(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new eT(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new _L(this.hot,this.conditionCollection,a=>this.getDataMapAtColumn(a)),this.conditionUpdateObserver.addLocalHook("update",a=>ar(Oi,this,nte).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 ar(Oi,e,Qee).call(e,...l)}),this.addHook("beforeDropdownMenuShow",()=>ar(Oi,this,Jee).call(this)),this.addHook("afterDropdownMenuShow",()=>ar(Oi,this,Xee).call(this)),this.addHook("afterDropdownMenuHide",()=>ar(Oi,this,Zee).call(this)),this.addHook("afterChange",a=>ar(Oi,this,qee).call(this,a)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!to(Xs,this)&&this.dropdownMenuPlugin.enabled){const a=[{focus:()=>{const u=to(Xs,this).getMenu(),c=u.getNavigator(),h=to(Xs,this).getLastMenuPage();u.focus(),h>0?c.setCurrentPage(h):c.toFirstItem()}},...Array.from(this.components).map(u=>{let[,c]=u;return c.getElements()}).flat()];FR(Xs,this,jee(this.dropdownMenuPlugin.menu,a));const l=u=>{to(Xs,this).listen(),u.preventDefault(),Nf(u.keyCode,"TAB")&&(u.shiftKey?to(Xs,this).toPreviousItem():to(Xs,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:EA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(EA)}addCondition(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:al;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();if(this.hot.runHooks("beforeFilter",o,to(Lc,this))!==!1){if(r){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),i=je(n.filter(),u=>u.meta.visualRow);const l=Kf(i);fe(this.hot.countSourceRows()-1,u=>{l(u)||a.push(u)}),M(a,u=>{this.filtersRowsMap.setValueAtIndex(u,!0)})},!0),!e&&!i.length&&this.hot.deselectCell()}else this.filtersRowsMap.clear();FR(Lc,this,this.exportConditions()),this.hot.runHooks("afterFilter",o),this.hot.view.adjustElementsSize(),this.hot.render()}else this.importConditions(to(Lc,this));this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col)}getSelectedColumn(){var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n?{visualIndex:n.col,physicalIndex:this.hot.toPhysicalColumn(n.col)}:null}getDataMapAtColumn(e){const n=this.hot.toVisualColumn(e),r=[];return M(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),C=(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:X0(C)})}),r}updateValueComponentCondition(e){const n=this.hot.getDataAtCol(e),r=LR(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===Pp&&n.command.key!==wn&&r.command.key!==wn&&i.command.key!==wn?o=J0:i.command.key!==wn&&(n.command.key===wn||r.command.key===wn)&&(o=al),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 TL(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 M(i,s=>{M(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 qee(t){t&&M(t,e=>{const[,n]=e,r=this.hot.propToCol(n);this.conditionCollection.hasConditions(r)&&this.updateValueComponentCondition(r)})}function Xee(){const t=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),t.updateMenuDimensions()}function Zee(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function Jee(){const t=this.dropdownMenuPlugin.menu;to(WR,this).has(t)||to(Xs,this).setMenu(t),to(WR,this).add(t)}function Qee(t){t.items.push({name:xe}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function TA(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!==wn&&(this.conditionCollection.addCondition(i,o,l,u),s.command.key!==wn&&this.conditionCollection.addCondition(i,s,l,u)),a.command.key!==wn&&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 ete(t,e){const n=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),t.constructor===$R&&!e.inputsCount&&this.setListeningDropdownMenu(),n.updateMenuDimensions()}function _A(){this.setListeningDropdownMenu()}function tte(t,e,n){const r=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(r)&&n===this.hot.view.getColumnHeadersCount()-1?Y(e,"htFiltersActive"):we(e,"htFiltersActive")}function nte(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)&&FR(Lc,this,to(Lc,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===gu),s=n.filter(a=>a.name!==gu);if(o.length>=2||s.length>=3)Xe(tt`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
|
|
265
|
-
The overall amount of conditions exceed the capability of the dropdown menu.\x20
|
|
266
|
-
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 IL="internal-use-in-handsontable",BR={licenseKey:IL,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 PL(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[xn])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function OL(t){return Object.keys(t).reduce((e,n)=>(n!=="hyperformula"&&(e[n]=t[n]),e),{})}function rte(t){var e;const n=t[xn],r=OL(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=PL(t);return{...BR,...r,...i}}function ite(t){var e;const n=t[xn],r=OL(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=PL(t);return{...r,...i}}function ote(t,e){return Object.keys(e).some(n=>e[n]!==void 0&&e[n]!==t[n])}function zw(){const t="engine_relationship",e=Uo(xn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function tT(){const t="shared_engine_usage",e=Uo(xn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function ste(t){const e=t.getSettings(),n=e[xn],r=n==null?void 0:n.engine;if(n===!0||_t(r))return null;if(typeof r.hyperformula=="function"||typeof r=="function"){var i;return ate((i=r.hyperformula)!==null&&i!==void 0?i:r,e,t)}else if(typeof r=="object"&&_t(r.hyperformula)){const o=zw(),s=tT().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:IL}),(r.getConfig().leapYear1900!==BR.leapYear1900||VE(r.getConfig().nullDate,BR.nullDate)===!1)&&Xe(tt`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
|
|
267
|
-
settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),r}return null}function ate(t,e,n){const r=e[xn],i=rte(e),o=zw(),s=tT();lte(t,r.functions),ute(t,r.language);const a=t.buildEmpty(i);return o.set(a,[n]),s.set(a,[n.guid]),cte(a,r.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function MA(t){var e;const n=zw(),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 IA(t,e){if(t){const n=zw(),r=n.get(t),i=tT(),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 lte(t,e){e&&e.forEach(n=>{const{name:r,plugin:i,translations:o}=n;try{t.registerFunction(r,i,o)}catch(s){Xe(s.message)}})}function ute(t,e){if(e){const{langCode:n}=e;try{t.registerLanguage(n,e)}catch(r){Xe(r.message)}}}function cte(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){Xe(a.message)}}),t.resumeEvaluation())}function hte(t,e){return(_t(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const xL="DD/MM/YYYY";function AL(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function dte(t){return AL(t)?t.substr(1):t}function fte(t){return typeof t=="string"&&t.startsWith("=")}function nT(t,e){return typeof t=="string"&&e==="date"}function HL(t,e){return q(t,e,!0).isValid()}function NL(t,e){return q(t,e,!0).format(xL)}function gte(t,e){return q(t,xL,!0).format(e)}function DL(t,e){const r=new Date(Date.UTC(0,0,t+-1));return q(r).format(e)}function mte(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 pte(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 wte(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 rT(t,e,n){const r=pte(t,mte(t,e,n));return wte(r)}function Wl(t,e,n){vte(t,e),e.set(t,n)}function vte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vt(t,e){return t.get(kL(t,e))}function La(t,e,n){return t.set(kL(t,e),n),n}function kL(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 pd=new WeakMap,$a=new WeakMap,xi=new WeakMap,nm=new WeakMap,uS=new WeakMap,cS=new WeakMap,rm=new WeakMap;class PA{constructor(e,n,r){Wl(this,pd,void 0),Wl(this,$a,void 0),Wl(this,xi,void 0),Wl(this,nm,[]),Wl(this,uS,[]),Wl(this,cS,void 0),Wl(this,rm,[]),La(pd,this,e),La($a,this,n),La(xi,this,r)}setRemovedHfIndexes(e){return La(rm,this,e.map(n=>{const r=vt($a,this).getVisualFromPhysicalIndex(n);return this.getHfIndexFromVisualIndex(r)})),vt(rm,this)}getRemovedHfIndexes(){return vt(rm,this)}getHfIndexFromVisualIndex(e){const n=vt($a,this).getIndexesSequence(),r=vt($a,this).getNotTrimmedIndexes();return n.indexOf(r[e])}syncMoves(e){const r=`move${$o(vt(pd,this))}s`;vt(xi,this).getEngine().batch(()=>{e.forEach(i=>{const o=i.from!==i.to,s=i.from+1!==i.to;o&&s&&vt(xi,this).getEngine()[r](vt(xi,this).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,n,r){r!==!1&&(La(uS,this,e.map(i=>this.getHfIndexFromVisualIndex(i))),La(cS,this,this.getHfIndexFromVisualIndex(n)))}calculateAndSyncMoves(e,n){if(vt(xi,this).isPerformingUndoRedo()||e===!1||n===!1)return;const r=rT(vt(uS,this),vt(cS,this),vt($a,this).getNumberOfIndexes());vt(xi,this).getSheetId()===null?vt(xi,this).getPostponeAction(()=>this.syncMoves(r)):this.syncMoves(r)}getIndexesChangeSyncMethod(){const e=`set${$o(vt(pd,this))}Order`;return n=>{if(vt(xi,this).isPerformingUndoRedo())return;const r=vt($a,this).getIndexesSequence();if(n==="update"&&r.length>0){const i=vt(nm,this).map(l=>r.indexOf(l)),o=vt(xi,this).getEngine().getSheetDimensions(vt(xi,this).getSheetId());let s;vt(pd,this)==="row"?s=o.height:s=o.width;const a=i.length;for(let l=a;l<s;l+=1)i.push(l);vt(xi,this).getEngine()[e](vt(xi,this).getSheetId(),i)}La(nm,this,r)}}init(){La(nm,this,vt($a,this).getIndexesSequence())}}function Bl(t,e,n){Cte(t,e),e.set(t,n)}function Cte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zs(t,e){return t.get(LL(t,e))}function jl(t,e,n){return t.set(LL(t,e),n),n}function LL(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 WeakMap,om=new WeakMap,hS=new WeakMap,dS=new WeakMap,fS=new WeakMap,gS=new WeakMap,mS=new WeakMap;class yte{constructor(e,n,r){Bl(this,im,void 0),Bl(this,om,void 0),Bl(this,hS,void 0),Bl(this,dS,!1),Bl(this,fS,!1),Bl(this,gS,null),Bl(this,mS,null),jl(im,this,new PA("row",e,this)),jl(om,this,new PA("column",n,this)),jl(hS,this,r)}getForAxis(e){return e==="row"?zs(im,this):zs(om,this)}setPerformUndo(e){jl(dS,this,e)}setPerformRedo(e){jl(fS,this,e)}isPerformingUndoRedo(){return zs(dS,this)||zs(fS,this)}getSheetId(){return zs(mS,this)}getEngine(){return zs(gS,this)}getPostponeAction(){return zs(hS,this)}setupSyncEndpoint(e,n){jl(gS,this,e),jl(mS,this,n),zs(im,this).init(),zs(om,this).init()}}function bte(t,e){$L(t,e),e.add(t)}function gc(t,e,n){return(e=Ste(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ste(t){var e=Rte(t,"string");return typeof e=="symbol"?e:e+""}function Rte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 pS(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 cl(t,e,n){return t.set(at(t,e),n),n}function zc(t,e){return t.get(at(t,e))}function at(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 xn="formulas",Ete=["maxRows","maxColumns","language"],Tte=260;ie.getSingleton().register("afterNamedExpressionAdded");ie.getSingleton().register("afterNamedExpressionRemoved");ie.getSingleton().register("afterSheetAdded");ie.getSingleton().register("afterSheetRemoved");ie.getSingleton().register("afterSheetRenamed");ie.getSingleton().register("afterFormulasValuesUpdate");const vh=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var va=new WeakMap,iT=new WeakMap,wd=new WeakMap,ut=new WeakSet;class _te extends qe{constructor(){var e;super(...arguments),e=this,bte(this,ut),pS(this,va,!1),pS(this,iT,!1),pS(this,wd,[["valuesUpdated",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ut,e,Bte).call(e,...r)}],["namedExpressionAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ut,e,jte).call(e,...r)}],["namedExpressionRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ut,e,Ute).call(e,...r)}],["sheetAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ut,e,zte).call(e,...r)}],["sheetRenamed",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ut,e,Yte).call(e,...r)}],["sheetRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return at(ut,e,Gte).call(e,...r)}]]),gc(this,"staticRegister",Uo("formulas")),gc(this,"engine",null),gc(this,"sheetName",null),gc(this,"indexSyncer",null),gc(this,"rowAxisSyncer",null),gc(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return xn}static get PLUGIN_PRIORITY(){return Tte}static get SETTING_KEYS(){return[xn,...Ete]}get sheetId(){return this.sheetName===null?null:this.engine.getSheetId(this.sheetName)}isEnabled(){return!!this.hot.getSettings()[xn]}enablePlugin(){var e,n=this;if(!this.enabled){if(this.engine=(e=ste(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){Xe("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&&(this.sheetName=r)}this.addHook("beforeLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return at(ut,n,OA).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 at(ut,n,xA).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 at(ut,n,OA).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 at(ut,n,xA).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 at(ut,n,Ote).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 at(ut,n,xte).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 at(ut,n,Mte).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 at(ut,n,Ate).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 at(ut,n,AA).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 at(ut,n,AA).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 at(ut,n,Hte).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 at(ut,n,Nte).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 at(ut,n,Lte).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 at(ut,n,$te).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 at(ut,n,Dte).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 at(ut,n,kte).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 at(ut,n,Fte).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 at(ut,n,Vte).call(n,...i)}),this.indexSyncer=new yte(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 at(ut,n,Pte).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 at(ut,n,Wte).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 at(ut,n,Ite).call(n,...i)}),zc(wd,this).forEach(r=>{let[i,o]=r;return this.engine.on(i,o)}),super.enablePlugin()}}disablePlugin(){zc(wd,this).forEach(e=>{let[n,r]=e;return this.engine.off(n,r)}),IA(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const n=ite(this.hot.getSettings());ote(this.engine.getConfig(),n)&&this.engine.updateConfig(n);const r=this.hot.getSettings()[xn];if(se(r)&&se(r.sheetName)&&r.sheetName!==this.sheetName&&this.switchSheet(r.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[xn].sheetName;i&&this.engine.doesSheetExist(i)?this.switchSheet(this.sheetName):this.sheetName=this.addSheet(i??void 0,this.hot.getSourceDataArray())}super.updatePlugin(e)}destroy(){zc(wd,this).forEach(e=>{var n;let[r,i]=e;return(n=this.engine)===null||n===void 0?void 0:n.off(r,i)}),cl(wd,this,null),IA(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,n){if(se(n)&&!CK(n))return Xe("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return Xe("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 Xe(r.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){jE(`The sheet named \`${e}\` does not exist, switch aborted.`);return}this.sheetName=e;const n=this.engine.getSheetSerialized(this.sheetId);n.length>0&&this.hot.loadData(n,`${$o(xn)}.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))}),MA(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==null?void 0:o.address)!==null&&s!==void 0?s:{};return se(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(se(l)===!1||se(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=MA(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)){Xe(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const o=this.hot.getCellMeta(e,n);return nT(r,o.type)&&(HL(r,o.dateFormat)?r=NL(r,o.dateFormat):fte(r)===!1&&(r=`'${r}`)),this.engine.setCellContents(i,r)}}function Mte(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=DL(s,o.dateFormat)),typeof s=="object"&&s!==null?s.value:s}return t}function Ite(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:C}=h.start,{row:w,col:S}=h.end,R=w-m+1,I=S-C+1;for(let O=0;O<f.length;O+=1)for(let D=0;D<f[O].length;D+=1){const _=f[O][D],x=m+O%R,j=C+D%I,X=this.hot.getCellMeta(x,j);nT(_,X.type)&&(_.startsWith("'")?f[O][D]=_.slice(1):this.isFormulaCellType(x,j,this.sheetId)===!1&&(f[O][D]=gte(_,X.dateFormat)))}return f}function OA(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes($o(xn))||cl(iT,this,_t(this.hot.getSettings().data))}function Pte(){const t=this.hot.getSourceDataArray();let e=!1;t.forEach((n,r)=>{n.forEach((i,o)=>{const s=this.hot.getCellMeta(r,o),a=s.dateFormat;nT(i,s.type)&&(e=!0,HL(i,a)?t[r][o]=NL(i,a):this.isFormulaCellType(r,o)===!1&&(t[r][o]=`'${i}`))})}),e===!0&&(cl(va,this,!0),this.engine.setSheetContent(this.sheetId,t),cl(va,this,!1))}function xA(t,e){if(!(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes($o(xn)))if(this.sheetName=hte(this.engine,this.hot.getSettings()[xn].sheetName),zc(iT,this))this.switchSheet(this.sheetName);else{const r=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,r)){cl(va,this,!0);const i=this.engine.setSheetContent(this.sheetId,r);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(i),cl(va,this,!1)}}}function Ote(t,e,n,r){if(r!=="get"||zc(va,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t);if(i===null||e===null)return;if(!this.isFormulaCellType(i,e)&&this.getCellType(i,e)!=="ARRAY"){AL(n.value)&&(n.value=dte(n.value));return}const s={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let a=this.engine.getCellValue(s),l=this.hot.getCellsMeta().find(c=>c.visualRow===i&&c.visualCol===e);l===void 0&&(l={}),l.type==="date"&&zn(a)&&(a=DL(a,l.dateFormat));const u=typeof a=="object"&&a!==null?a.value:a;n.value=u}function xte(t,e,n,r){if(r!=="get"||zc(va,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||!this.isFormulaCellType(i,o)&&this.getCellType(i,o)!=="ARRAY")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 AA(t,e){if(vh(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 Ate(t,e){if(vh(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)){Xe(`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 Hte(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 Nte(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 Dte(t,e,n){return this.rowAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveRows(this.sheetId,[o,1]))===!1?!1:void 0}function kte(t,e,n){return this.columnAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[o,1]))===!1?!1:void 0}function Lte(t,e,n){if(vh(n))return;const r=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function $te(t,e,n){if(vh(n))return;const r=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function Fte(t,e,n,r){if(vh(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 Vte(t,e,n,r){if(vh(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 Wte(t,e,n){var r;cl(va,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());cl(va,this,!1),i.forEach((o,s)=>{o.forEach((a,l)=>{this.engine.setCellContents({col:l,row:n+s,sheet:this.sheetId},[[a]])})})}function Bte(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function jte(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function Ute(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function zte(t){this.hot.runHooks("afterSheetAdded",t)}function Yte(t,e){this.sheetName=e,this.hot.runHooks("afterSheetRenamed",t,e)}function Gte(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function Kte(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(Zr,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 qte(t){const e=[];return{key:"hidden_columns_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(Jr,n)},callback(){var n,r;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(n=this.columnIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&n!==void 0?n:0,o=(r=this.columnIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&r!==void 0?r:this.countCols()-1,t.showColumns(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countCols()||this.selectColumns(i,o)},disabled:!1,hidden(){const n=je(t.getHiddenColumns(),h=>this.toPhysicalColumn(h));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const r=this.getSelectedRangeLast(),i=r.getTopStartCorner().col,o=r.getBottomEndCorner().col,s=this.columnIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(m=>n.includes(m)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countCols()));else{const h=this.countCols()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return M(c,h=>{e.push(this.toVisualColumn(h))}),e.length===0}}}function Xte(t,e){FL(t,e),e.add(t)}function Zte(t,e,n){FL(t,e),e.set(t,n)}function FL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ul(t,e){return t.get(za(t,e))}function HA(t,e,n){return t.set(za(t,e),n),n}function za(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}ie.getSingleton().register("beforeHideColumns");ie.getSingleton().register("afterHideColumns");ie.getSingleton().register("beforeUnhideColumns");ie.getSingleton().register("afterUnhideColumns");const NA="hiddenColumns",Jte=310;var ns=new WeakMap,zl=new WeakSet;class Qte extends qe{constructor(){super(...arguments),Xte(this,zl),Zte(this,ns,null)}static get PLUGIN_KEY(){return NA}static get PLUGIN_PRIORITY(){return Jte}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[NA]}enablePlugin(){var e=this;this.enabled||(HA(ns,this,new Sw),Ul(ns,this).addLocalHook("init",()=>za(zl,this,one).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,Ul(ns,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return za(zl,e,ine).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>za(zl,this,tne).call(this,n,r,i)),this.addHook("modifyColWidth",(n,r)=>za(zl,this,ene).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 za(zl,e,rne).call(e,...r)}),this.addHook("modifyCopyableRange",n=>za(zl,this,nne).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin(),this.resetCellsMeta()}showColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;const o=Ul(ns,this).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalColumn(u));M(l,u=>{o[u]=!1}),i=mr(o,(u,c,h)=>(c&&u.push(this.hot.toVisualColumn(h)),u),[])}this.hot.runHooks("beforeUnhideColumns",n,i,r&&s)!==!1&&(r&&s&&Ul(ns,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(()=>{M(e,s=>{Ul(ns,this).setValueAtIndex(this.hot.toPhysicalColumn(s),!0)})},!0),this.hot.runHooks("afterHideColumns",n,i,r,r&&i.length>n.length))}hideColumn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.hideColumns(n)}getHiddenColumns(){return je(Ul(ns,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return Ul(ns,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(){M(this.hot.getCellsMeta(),e=>{e.skipColumnOnPaste=!1})}destroy(){HA(ns,this,null),super.destroy()}}function ene(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 tne(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 nne(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 M(t,r=>{let i=!0,o=0;fe(r.startCol,r.endCol,s=>{this.isHidden(s)?(i||n(r.startRow,r.endRow,o,s-1),i=!0):(i&&(o=s),s===r.endCol&&n(r.startRow,r.endRow,o,s),i=!1)})}),e}function rne(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"),Y(e,n)}function ine(t){t.items.push({name:xe},Kte(this),qte(this))}function one(){const t=this.getSetting("columns");Array.isArray(t)&&this.hideColumns(t)}function sne(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(Qr,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 ane(t){const e=[];return{key:"hidden_rows_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(ei,n)},callback(){var n,r;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(n=this.rowIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&n!==void 0?n:0,o=(r=this.rowIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&r!==void 0?r:this.countRows()-1,t.showRows(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countRows()||this.selectRows(i,o)},disabled:!1,hidden(){const n=je(t.getHiddenRows(),h=>this.toPhysicalRow(h));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const r=this.getSelectedRangeLast(),i=r.getTopStartCorner().row,o=r.getBottomEndCorner().row,s=this.rowIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(m=>n.includes(m)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countRows()));else{const h=this.countRows()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return M(c,h=>{e.push(this.toVisualRow(h))}),e.length===0}}}function lne(t,e){VL(t,e),e.add(t)}function une(t,e,n){VL(t,e),e.set(t,n)}function VL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yl(t,e){return t.get(Ya(t,e))}function DA(t,e,n){return t.set(Ya(t,e),n),n}function Ya(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")}ie.getSingleton().register("beforeHideRows");ie.getSingleton().register("afterHideRows");ie.getSingleton().register("beforeUnhideRows");ie.getSingleton().register("afterUnhideRows");const kA="hiddenRows",cne=320;var rs=new WeakMap,Gl=new WeakSet;class hne extends qe{constructor(){super(...arguments),lne(this,Gl),une(this,rs,null)}static get PLUGIN_KEY(){return kA}static get PLUGIN_PRIORITY(){return cne}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[kA]}enablePlugin(){var e=this;this.enabled||(DA(rs,this,new Sw),Yl(rs,this).addLocalHook("init",()=>Ya(Gl,this,wne).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,Yl(rs,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ya(Gl,e,pne).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>Ya(Gl,this,fne).call(this,n,r,i)),this.addHook("modifyRowHeight",(n,r)=>Ya(Gl,this,dne).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 Ya(Gl,e,mne).call(e,...r)}),this.addHook("modifyCopyableRange",n=>Ya(Gl,this,gne).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin(),this.resetCellsMeta()}showRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;const o=Yl(rs,this).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalRow(u));M(l,u=>{o[u]=!1}),i=mr(o,(u,c,h)=>(c&&u.push(this.hot.toVisualRow(h)),u),[])}this.hot.runHooks("beforeUnhideRows",n,i,r&&s)!==!1&&(r&&s&&Yl(rs,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(()=>{M(e,s=>{Yl(rs,this).setValueAtIndex(this.hot.toPhysicalRow(s),!0)})},!0),this.hot.runHooks("afterHideRows",n,i,r,r&&i.length>n.length))}hideRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.hideRows(n)}getHiddenRows(){return je(Yl(rs,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return Yl(rs,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(){M(this.hot.getCellsMeta(),e=>{e.skipRowOnPaste=!1})}destroy(){DA(rs,this,null),super.destroy()}}function dne(t,e){return this.isHidden(e)?0:t}function fne(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 gne(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 M(t,r=>{let i=!0,o=0;fe(r.startRow,r.endRow,s=>{this.isHidden(s)?(i||n(o,s-1,r.startCol,r.endCol),i=!0):(i&&(o=s),s===r.endRow&&n(o,s,r.startCol,r.endCol),i=!1)})}),e}function mne(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"),Y(e,n)}function pne(t){t.items.push({name:xe},sne(this),ane(this))}function wne(){const t=this.getSetting("rows");Array.isArray(t)&&this.hideRows(t)}function vne(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(Mr)},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 Cne(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(Ir)},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 yne(t,e){WL(t,e),e.add(t)}function bne(t,e,n){WL(t,e),e.set(t,n)}function WL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jR(t,e){return t.get(xp(t,e))}function wS(t,e,n){return t.set(xp(t,e),n),n}function xp(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")}ie.getSingleton().register("beforeColumnFreeze");ie.getSingleton().register("afterColumnFreeze");ie.getSingleton().register("beforeColumnUnfreeze");ie.getSingleton().register("afterColumnUnfreeze");const LA="manualColumnFreeze",Sne=110;var su=new WeakMap,vS=new WeakSet;class Rne extends qe{constructor(){super(...arguments),yne(this,vS),bne(this,su,!1)}static get PLUGIN_KEY(){return LA}static get PLUGIN_PRIORITY(){return Sne}isEnabled(){return!!this.hot.getSettings()[LA]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>xp(vS,this,Ene).call(this,e)),this.addHook("beforeColumnMove",(e,n)=>xp(vS,this,Tne).call(this,e,n)),super.enablePlugin())}disablePlugin(){wS(su,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;jR(su,this)||wS(su,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;jR(su,this)||wS(su,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 Ene(t){t.items.push({name:"---------"},vne(this),Cne(this))}function Tne(t,e){if(jR(su,this)){const n=this.hot.getSettings().fixedColumnsStart;if(e<n||t.some(r=>r<n))return!1}}function sm(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=Mne(t,"string");return typeof e=="symbol"?e:e+""}function Mne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 CS=0,$A=1,FA=2,mc="px";let BL=class{constructor(e){sm(this,"hot",void 0),sm(this,"_element",null),sm(this,"state",CS),sm(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=FA}build(){this.state===CS&&(this._element=this.hot.rootDocument.createElement("div"),this.state=$A)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=CS}isAppended(){return this.state===FA}isBuilt(){return this.state>=$A}setPosition(e,n){zn(e)&&(this._element.style.top=e+mc),zn(n)&&(this._element.style[this.inlineProperty]=n+mc)}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+mc),zn(n)&&(this._element.style.height=n+mc)}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+mc),zn(n)&&(this._element.style[`margin${$o(this.inlineProperty)}`]=n+mc)}getOffset(){const e=this._element.style,n=`margin${$o(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[n]?parseInt(e[n],10):0}}};const Ine="ht__manualColumnMove--backlight";let Pne=class extends BL{build(){super.build(),Y(this._element,Ine)}};const One="ht__manualColumnMove--guideline";let xne=class extends BL{build(){super.build(),Y(this._element,One)}};function Ane(t,e){jL(t,e),e.add(t)}function yo(t,e,n){jL(t,e),e.set(t,n)}function jL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dr(t,e,n){return t.set(Ga(t,e),n),n}function he(t,e){return t.get(Ga(t,e))}function Ga(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")}ie.getSingleton().register("beforeColumnMove");ie.getSingleton().register("afterColumnMove");const yS="manualColumnMove",Hne=120,VA="ht__manualColumnMove",Ap="show-ui",UR="on-moving--columns",zR="after-selection--columns";var jn=new WeakMap,qa=new WeakMap,ua=new WeakMap,Qm=new WeakMap,nl=new WeakMap,Bn=new WeakMap,am=new WeakMap,Zi=new WeakMap,Oc=new WeakMap,Hp=new WeakMap,Ud=new WeakMap,Kl=new WeakSet;class Nne extends qe{constructor(){super(...arguments),Ane(this,Kl),yo(this,jn,new Pne(this.hot)),yo(this,qa,new xne(this.hot)),yo(this,ua,[]),yo(this,Qm,0),yo(this,nl,!1),yo(this,Bn,{}),yo(this,am,void 0),yo(this,Zi,void 0),yo(this,Oc,void 0),yo(this,Hp,void 0),yo(this,Ud,void 0)}static get PLUGIN_KEY(){return yS}static get PLUGIN_PRIORITY(){return Hne}isEnabled(){return!!this.hot.getSettings()[yS]}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 Ga(Kl,e,Dne).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 Ga(Kl,e,Lne).call(e,...r)}),this.addHook("afterScrollVertically",()=>Ga(Kl,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 Ga(Kl,e,Vne).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),Y(this.hot.rootElement,VA),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){we(this.hot.rootElement,VA),this.unregisterEvents(),he(jn,this).destroy(),he(qa,this).destroy(),super.disablePlugin()}moveColumn(e,n){return this.moveColumns([e],n)}moveColumns(e,n){const r=he(am,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeColumnMove",e,n,r,i);if(dr(am,this,void 0),o===!1)return;i&&this.hot.columnIndexMapper.moveIndexes(e,n);const s=i&&this.isColumnOrderChanged(e,n);return this.hot.runHooks("afterColumnMove",e,n,r,i,s),s}dragColumn(e,n){return this.dragColumns([e],n)}dragColumns(e,n){const r=this.countFinalIndex(e,n);return dr(am,this,n),this.moveColumns(e,r)}isMovePossible(e,n){const r=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),i=e.length+n>r,o=n<0,s=e.some(l=>l<0),a=e.some(l=>l>=r);return!(i||o||s||a)}isColumnOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}countFinalIndex(e,n){const r=mr(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()[yS];if(Array.isArray(e))this.moveColumns(e,0);else if(e!==void 0){const n=this.persistentStateLoad();n.length&&this.moveColumns(n,0)}}isFixedColumnsStart(e){return e<this.hot.getSettings().fixedColumnsStart}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualColumnMove",this.hot.columnIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualColumnMove",e),e.value?e.value:[]}prepareColumnsToMoving(e,n){const r=[];return fe(e,n,i=>{r.push(i)}),r}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(he(Zi,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const n=this.hot.view._wt.wtTable,r=this.hot.view._wt.wtOverlays.scrollableElement,i=typeof r.scrollX=="number"?r.scrollX:r.scrollLeft;let o=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,he(Zi,this)-1);const s=n.hider.offsetWidth,a=n.TBODY.offsetLeft,l=he(jn,this).getOffset().start,u=he(jn,this).getSize().width;let c=0,h=0;if(this.hot.isRtl()){const m=this.hot.rootWindow,C=Gt(this.hot.rootElement),w=m.innerWidth-he(Oc,this)-C;h=m.innerWidth-he(Bn,this).eventPageX-w-(r.scrollX===void 0?i:0)}else h=he(Bn,this).eventPageX-(he(Oc,this)-(r.scrollX===void 0?i:0));if(he(Hp,this)&&(c=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(he(Zi,this))&&(o+=i),o+=c,he(Zi,this)<0)he(Ud,this)>0?he(Bn,this).col=0:he(Bn,this).col=e>0?e-1:e;else if(he(Bn,this).TD.offsetWidth/2+o<=h){const m=he(Zi,this)>=he(Qm,this)?he(Qm,this)-1:he(Zi,this);he(Bn,this).col=m+1,o+=he(Bn,this).TD.offsetWidth}else he(Bn,this).col=he(Zi,this);let d=h,f=o;h+u+l>=s?d=s-u-l:h+l<a+c&&(d=a+c+Math.abs(l)),o>=s-1?f=s-1:f===0?f=1:r.scrollX!==void 0&&he(Zi,this)<he(Ud,this)&&(f-=he(Oc,this)<=r.scrollX?he(Oc,this):0),he(jn,this).setPosition(null,d),he(qa,this).setPosition(null,f)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>Ga(Kl,this,kne).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Ga(Kl,this,$ne).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){he(jn,this).build(),he(qa,this).build()}destroy(){he(jn,this).destroy(),he(qa,this).destroy(),super.destroy()}}function Dne(t,e,n,r){const i=this.hot.view._wt.wtTable,o=this.hot.selection.isSelectedByColumnHeader(),s=this.hot.getSelectedRangeLast(),a=Ce(t.target,"sortAction");if(!s||!o||he(nl,this)||t.button!==0||a){dr(nl,this,!1),he(ua,this).length=0,we(this.hot.rootElement,[UR,Ap]);return}const l=he(qa,this).isBuilt()&&!he(qa,this).isAppended(),u=he(jn,this).isBuilt()&&!he(jn,this).isAppended();l&&u&&(he(qa,this).appendTo(i.hider),he(jn,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,dr(nl,this,!0);const m=n.firstChild?az(t,n.firstChild).x:t.offsetX;he(Bn,this).eventPageX=t.pageX,dr(Zi,this,e.col),he(Bn,this).TD=n,he(Bn,this).col=e.col,dr(ua,this,this.prepareColumnsToMoving(d,f)),dr(Hp,this,!!this.hot.getSettings().rowHeaders),dr(Qm,this,this.hot.countCols()),dr(Ud,this,this.hot.getSettings().fixedColumnsStart),dr(Oc,this,An(this.hot.rootElement).left);const C=he(Hp,this)?-1:0,w=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,S=e.col<he(Ud,this),R=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),I=Math.abs(m-(this.hot.isRtl()?n.offsetWidth:0)),O=this.getColumnsWidth(d,e.col-1)+I,D=this.getColumnsWidth(C,d-1)+(S?R:0)+O;he(jn,this).setPosition(w,D),he(jn,this).setSize(this.getColumnsWidth(d,f),i.hider.offsetHeight-w),he(jn,this).setOffset(null,-O),Y(this.hot.rootElement,UR)}else we(this.hot.rootElement,zR),dr(nl,this,!1),he(ua,this).length=0}function kne(t){he(nl,this)&&(he(Bn,this).eventPageX=t.pageX,this.refreshPositions())}function Lne(t,e,n,r){!this.hot.getSelectedRangeLast()||!he(nl,this)||(he(ua,this).indexOf(e.col)>-1?we(this.hot.rootElement,Ap):Y(this.hot.rootElement,Ap),r.row=!0,r.column=!0,r.cell=!0,dr(Zi,this,e.col),he(Bn,this).TD=n)}function $ne(){const t=he(Bn,this).col,e=he(ua,this).length;if(dr(Zi,this,void 0),dr(nl,this,!1),we(this.hot.rootElement,[UR,Ap,zR]),this.hot.selection.isSelectedByColumnHeader()&&Y(this.hot.rootElement,zR),e<1||t===void 0)return;const n=he(ua,this)[0],r=this.hot.toPhysicalColumn(n),i=this.dragColumns(he(ua,this),t);if(he(ua,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 Fne(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,n=t.holder.scrollTop,r=e+n;he(jn,this).setPosition(r),he(jn,this).setSize(null,t.hider.offsetHeight-r)}function Vne(){this.moveBySettingsOrLoad()}function Wne(t,e){UL(t,e),e.add(t)}function _n(t,e,n){UL(t,e),e.set(t,n)}function UL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Bt(t,e,n){return t.set(Po(t,e),n),n}function re(t,e){return t.get(Po(t,e))}function Po(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 Np="manualColumnResize",Bne=130,WA="manualColumnWidths";var ta=new WeakMap,lm=new WeakMap,Fi=new WeakMap,Dp=new WeakMap,Ss=new WeakMap,jne=new WeakMap,Yc=new WeakMap,um=new WeakMap,sr=new WeakMap,Zs=new WeakMap,_u=new WeakMap,kp=new WeakMap,zd=new WeakMap,Yd=new WeakMap,Wi=new WeakMap,Gd=new WeakMap,is=new WeakSet;class Une extends qe{static get PLUGIN_KEY(){return Np}static get PLUGIN_PRIORITY(){return Bne}constructor(e){super(e),Wne(this,is),_n(this,ta,null),_n(this,lm,null),_n(this,Fi,[]),_n(this,Dp,null),_n(this,Ss,null),_n(this,jne,null),_n(this,Yc,null),_n(this,um,null),_n(this,sr,this.hot.rootDocument.createElement("DIV")),_n(this,Zs,this.hot.rootDocument.createElement("DIV")),_n(this,_u,null),_n(this,kp,!1),_n(this,zd,0),_n(this,Yd,null),_n(this,Wi,void 0),_n(this,Gd,void 0),Y(re(sr,this),"manualColumnResizer"),Y(re(Zs,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Np]}enablePlugin(){var e=this;this.enabled||(Bt(Wi,this,new ml),re(Wi,this).addLocalHook("init",()=>Po(is,this,zne).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,re(Wi,this)),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Po(is,e,Zne).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 Po(is,e,Jne).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 Po(is,e,Qne).call(e,...r)}),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Bt(Gd,this,re(Wi,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",WA,re(Wi,this).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",WA,e),e.value}setManualSize(e,n){const r=Math.max(n,20),i=this.hot.toPhysicalColumn(e);return re(Wi,this).setValueAtIndex(i,r),r}clearManualSize(e){const n=this.hot.toPhysicalColumn(e);re(Wi,this).setValueAtIndex(n,null)}setupHandlePosition(e){if(!e.parentNode)return;Bt(ta,this,e);const{_wt:n}=this.hot.view,r=n.wtTable.getCoords(re(ta,this)),i=r.col;if(i<0)return;const o=nn(re(ta,this)),s=re(ta,this).getBoundingClientRect(),a=i<n.getSetting("fixedColumnsStart");let l;a&&(l=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(re(ta,this),r.row,r.col)),l||(l=n.wtOverlays.topOverlay.getRelativeCellPosition(re(ta,this),r.row,r.col)),Bt(lm,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),Bt(Fi,this,[]);const u=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&u){const c=this.hot.getSelectedRange();M(c,h=>{const d=h.getTopStartCorner().col,f=h.getBottomEndCorner().col;fe(d,f,m=>{re(Fi,this).includes(m)||re(Fi,this).push(m)})})}re(Fi,this).includes(re(lm,this))||Bt(Fi,this,[re(lm,this)]),Bt(um,this,l.start-6),Bt(Yc,this,parseInt(s.width,10)),re(sr,this).style.top=`${l.top}px`,re(sr,this).style[this.inlineDir]=`${re(um,this)+re(Yc,this)}px`,re(sr,this).style.height=`${o}px`,this.hot.rootElement.appendChild(re(sr,this))}refreshHandlePosition(){re(sr,this).style[this.inlineDir]=`${re(um,this)+re(Dp,this)}px`}setupGuidePosition(){const e=parseInt(nn(re(sr,this)),10),n=parseInt(re(sr,this).style.top,10)+e,r=parseInt(this.hot.view.maximumVisibleElementHeight(0),10);Y(re(sr,this),"active"),Y(re(Zs,this),"active"),re(Zs,this).style.top=`${n}px`,this.refreshGuidePosition(),re(Zs,this).style.height=`${r-e}px`,this.hot.rootElement.appendChild(re(Zs,this))}refreshGuidePosition(){re(Zs,this).style[this.inlineDir]=re(sr,this).style[this.inlineDir]}hideHandleAndGuide(){we(re(sr,this),"active"),we(re(Zs,this),"active")}checkIfColumnHeader(e){const n=Cu(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.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},n=(r,i)=>{const o=this.hot.runHooks("beforeColumnResize",re(Ss,this),r,!0);o!==void 0&&Bt(Ss,this,o),this.setManualSize(r,re(Ss,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",re(Ss,this),r,!0),i&&e()};re(zd,this)>=2&&(re(Fi,this).length>1?(M(re(Fi,this),i=>{n(i)}),e()):M(re(Fi,this),i=>{n(i,!0)})),Bt(zd,this,0),Bt(Yd,this,null)}bindEvents(){const{rootWindow:e,rootElement:n}=this.hot;this.eventManager.addEventListener(n,"mouseover",r=>Po(is,this,Yne).call(this,r)),this.eventManager.addEventListener(n,"mousedown",r=>Po(is,this,Gne).call(this,r)),this.eventManager.addEventListener(e,"mousemove",r=>Po(is,this,Kne).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>Po(is,this,qne).call(this)),this.eventManager.addEventListener(re(sr,this),"contextmenu",()=>Po(is,this,Xne).call(this))}destroy(){super.destroy()}}function zne(){const t=this.hot.getSettings()[Np],e=this.loadManualColumnWidths();typeof e<"u"?this.hot.batchExecution(()=>{e.forEach((n,r)=>{re(Wi,this).setValueAtIndex(r,n)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((n,r)=>{re(Wi,this).setValueAtIndex(r,n)})},!0),Bt(Gd,this,t)):t===!0&&Array.isArray(re(Gd,this))&&this.hot.batchExecution(()=>{re(Gd,this).forEach((n,r)=>{re(Wi,this).setValueAtIndex(r,n)})},!0)}function Yne(t){if(!TN(t.target)&&re(kp,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")&&(re(_u,this)||this.setupHandlePosition(e))}}function Gne(t){t.target.parentNode===this.hot.rootElement&&Ce(t.target,"manualColumnResizer")&&(this.setupHandlePosition(re(ta,this)),this.setupGuidePosition(),Bt(_u,this,!0),re(Yd,this)===null&&(Bt(Yd,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(re(Yd,this))),Bt(zd,this,re(zd,this)+1),this.startX=t.pageX,Bt(Ss,this,re(Yc,this)))}function Kne(t){if(re(_u,this)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();Bt(Dp,this,re(Yc,this)+e),M(re(Fi,this),n=>{Bt(Ss,this,this.setManualSize(n,re(Dp,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function qne(){const t=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},e=(n,r)=>{this.hot.runHooks("beforeColumnResize",re(Ss,this),n,!1),r&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",re(Ss,this),n,!1)};re(_u,this)&&(this.hideHandleAndGuide(),Bt(_u,this,!1),re(Ss,this)!==re(Yc,this)&&(re(Fi,this).length>1?(M(re(Fi,this),r=>{e(r)}),t()):M(re(Fi,this),r=>{e(r,!0)})),this.setupHandlePosition(re(ta,this)))}function Xne(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(re(sr,this)),this.hot.rootElement.removeChild(re(Zs,this)),Bt(_u,this,!1),Bt(kp,this,!0),this.hot._registerImmediate(()=>{Bt(kp,this,!1)})}function Zne(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalColumn(e),i=re(Wi,this).getValueAtIndex(r);this.hot.getSettings()[Np]&&i&&(n=i)}return n}function Jne(t,e){const n=re(Wi,this).getValueAtIndex(this.hot.toPhysicalColumn(e));return typeof n=="number"?n:t}function Qne(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function bS(t,e,n){return(e=ere(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ere(t){var e=tre(t,"string");return typeof e=="symbol"?e:e+""}function tre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const SS=0,BA=1,jA=2,pc="px";let zL=class{constructor(e){bS(this,"hot",void 0),bS(this,"_element",null),bS(this,"state",SS),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=jA}build(){this.state===SS&&(this._element=this.hot.rootDocument.createElement("div"),this.state=BA)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=SS}isAppended(){return this.state===jA}isBuilt(){return this.state>=BA}setPosition(e,n){e!==void 0&&(this._element.style.top=e+pc),n!==void 0&&(this._element.style.left=n+pc)}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+pc),n&&(this._element.style.height=n+pc)}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+pc),n&&(this._element.style.marginLeft=n+pc)}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 nre="ht__manualRowMove--backlight";class rre extends zL{build(){super.build(),Y(this._element,nre)}}const ire="ht__manualRowMove--guideline";class ore extends zL{build(){super.build(),Y(this._element,ire)}}function sre(t,e){YL(t,e),e.add(t)}function wc(t,e,n){YL(t,e),e.set(t,n)}function YL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mu(t,e,n){return t.set(Ka(t,e),n),n}function Ee(t,e){return t.get(Ka(t,e))}function Ka(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")}ie.getSingleton().register("beforeRowMove");ie.getSingleton().register("afterRowMove");const RS="manualRowMove",are=140,UA="ht__manualRowMove",Lp="show-ui",YR="on-moving--rows",GR="after-selection--rows";var Un=new WeakMap,Xa=new WeakMap,ca=new WeakMap,rl=new WeakMap,fr=new WeakMap,cm=new WeakMap,ql=new WeakSet;class lre extends qe{constructor(){super(...arguments),sre(this,ql),wc(this,Un,new rre(this.hot)),wc(this,Xa,new ore(this.hot)),wc(this,ca,[]),wc(this,rl,void 0),wc(this,fr,{}),wc(this,cm,void 0)}static get PLUGIN_KEY(){return RS}static get PLUGIN_PRIORITY(){return are}isEnabled(){return!!this.hot.getSettings()[RS]}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 Ka(ql,e,ure).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 Ka(ql,e,hre).call(e,...r)}),this.addHook("afterScrollHorizontally",()=>Ka(ql,this,fre).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 Ka(ql,e,gre).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),Y(this.hot.rootElement,UA),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){we(this.hot.rootElement,UA),this.unregisterEvents(),Ee(Un,this).destroy(),Ee(Xa,this).destroy(),super.disablePlugin()}moveRow(e,n){return this.moveRows([e],n)}moveRows(e,n){const r=Ee(cm,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeRowMove",e,n,r,i);if(mu(cm,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 mu(cm,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=mr(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()[RS];if(Array.isArray(e))this.moveRows(e,0);else if(e!==void 0){const n=this.persistentStateLoad();n.length&&this.moveRows(n,0)}}isFixedRowTop(e){return e<this.hot.getSettings().fixedRowsTop}isFixedRowBottom(e){return e>this.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualRowMove",this.hot.rowIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualRowMove",e),e.value?e.value:[]}prepareRowsToMoving(){const e=this.hot.getSelectedRangeLast(),n=[];if(!e)return n;const{from:r,to:i}=e,o=Math.min(r.row,i.row),s=Math.max(r.row,i.row);return fe(o,s,a=>{n.push(a)}),n}refreshPositions(){const e=Ee(fr,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=Ee(fr,this).TD,a=this.hot.rootElement,l=An(a),u=of(a),c=o.holder.scrollTop,h=this.hot.rootWindow!==u?u.scrollTop:0,d=l.top-h,f=Ee(fr,this).eventPageY-d+c,m=o.hider.offsetHeight,C=o.TBODY.offsetTop,w=Ee(Un,this).getOffset().top,S=Ee(Un,this).getSize().height,R=s.offsetHeight/2,I=s.offsetHeight;let O=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const D=f>=O+R;this.isFixedRowTop(e.row)&&(O+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?Ee(fr,this).row=n>0?n-1:n:D?(Ee(fr,this).row=e.row+1,O+=e.row===0?I-1:I):Ee(fr,this).row=e.row;let _=f,x=O;f+S+w>=m?_=m-S-w:f+w<C&&(_=C+Math.abs(w)),O>=m-1&&(x=m-1),Ee(Un,this).setPosition(_),Ee(Xa,this).setPosition(x)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>Ka(ql,this,cre).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Ka(ql,this,dre).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Ee(Un,this).build(),Ee(Xa,this).build()}destroy(){Ee(Un,this).destroy(),Ee(Xa,this).destroy(),super.destroy()}}function ure(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||Ee(rl,this)||t.button!==0){mu(rl,this,!1),Ee(ca,this).length=0,we(this.hot.rootElement,[YR,Lp]);return}const l=Ee(Xa,this).isBuilt()&&!Ee(Xa,this).isAppended(),u=Ee(Un,this).isBuilt()&&!Ee(Un,this).isAppended();l&&u&&(Ee(Xa,this).appendTo(i.hider),Ee(Un,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,mu(rl,this,!0),Ee(fr,this).eventPageY=t.pageY,Ee(fr,this).coords=e,Ee(fr,this).TD=n,mu(ca,this,this.prepareRowsToMoving());const m=i.holder.scrollLeft+o.getRowHeaderWidth(),C=this.getRowsHeight(d,e.row-1)+(t.clientY-n.getBoundingClientRect().top);Ee(Un,this).setPosition(null,m),Ee(Un,this).setSize(i.hider.offsetWidth-m,this.getRowsHeight(d,f)),Ee(Un,this).setOffset(-C,null),Y(this.hot.rootElement,YR),this.refreshPositions()}else we(this.hot.rootElement,GR),mu(rl,this,!1),Ee(ca,this).length=0}function cre(t){Ee(rl,this)&&(Ee(fr,this).eventPageY=t.pageY,this.refreshPositions())}function hre(t,e,n,r){!this.hot.getSelectedRangeLast()||!Ee(rl,this)||(Ee(ca,this).indexOf(e.row)>-1?we(this.hot.rootElement,Lp):Y(this.hot.rootElement,Lp),r.row=!0,r.column=!0,r.cell=!0,Ee(fr,this).coords=e,Ee(fr,this).TD=n)}function dre(){const t=Ee(fr,this).row,e=Ee(ca,this).length;if(mu(rl,this,!1),we(this.hot.rootElement,[YR,Lp,GR]),this.hot.selection.isSelectedByRowHeader()&&Y(this.hot.rootElement,GR),e<1||t===void 0)return;const n=Ee(ca,this)[0],r=this.hot.toPhysicalRow(n),i=this.dragRows(Ee(ca,this),t);if(Ee(ca,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 fre(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),n=t.holder.scrollLeft,r=e+n;Ee(Un,this).setPosition(null,r),Ee(Un,this).setSize(t.hider.offsetWidth-r)}function gre(){this.moveBySettingsOrLoad()}function mre(t,e){GL(t,e),e.add(t)}function Mn(t,e,n){GL(t,e),e.set(t,n)}function GL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xt(t,e,n){return t.set(na(t,e),n),n}function ne(t,e){return t.get(na(t,e))}function na(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 $p="manualRowResize",pre=30,zA="manualRowHeights";var ms=new WeakMap,hm=new WeakMap,Vi=new WeakMap,Kd=new WeakMap,Za=new WeakMap,oT=new WeakMap,Gc=new WeakMap,dm=new WeakMap,Vn=new WeakMap,ds=new WeakMap,Mu=new WeakMap,Fp=new WeakMap,qd=new WeakMap,Xd=new WeakMap,Ao=new WeakMap,Zd=new WeakMap,Fa=new WeakSet;class wre extends qe{static get PLUGIN_KEY(){return $p}static get PLUGIN_PRIORITY(){return pre}constructor(e){super(e),mre(this,Fa),Mn(this,ms,null),Mn(this,hm,null),Mn(this,Vi,[]),Mn(this,Kd,null),Mn(this,Za,null),Mn(this,oT,null),Mn(this,Gc,null),Mn(this,dm,null),Mn(this,Vn,this.hot.rootDocument.createElement("DIV")),Mn(this,ds,this.hot.rootDocument.createElement("DIV")),Mn(this,Mu,!1),Mn(this,Fp,!1),Mn(this,qd,0),Mn(this,Xd,null),Mn(this,Ao,void 0),Mn(this,Zd,void 0),Y(ne(Vn,this),"manualRowResizer"),Y(ne(ds,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[$p]}enablePlugin(){this.enabled||(xt(Ao,this,new ml),ne(Ao,this).addLocalHook("init",()=>na(Fa,this,Ere).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,ne(Ao,this)),this.addHook("modifyRowHeight",(e,n)=>na(Fa,this,Rre).call(this,e,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){xt(Zd,this,ne(Ao,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",zA,ne(Ao,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",zA,e),e.value}setManualSize(e,n){const r=this.hot.toPhysicalRow(e),i=Math.max(n,this.hot.view.getDefaultRowHeight());return ne(Ao,this).setValueAtIndex(r,i),i}getLastDesiredRowHeight(){return ne(Kd,this)}setupHandlePosition(e){xt(ms,this,e);const{view:n}=this.hot,{_wt:r}=n,i=r.wtTable.getCoords(ne(ms,this)),o=i.row;if(o<0)return;const s=Gt(ne(ms,this)),a=ne(ms,this).getBoundingClientRect(),l=o<r.getSetting("fixedRowsTop"),u=o>=n.countNotHiddenRowIndexes(0,1)-r.getSetting("fixedRowsBottom");let c;l?c=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ne(ms,this),i.row,i.col):u&&(c=r.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(ne(ms,this),i.row,i.col)),c||(c=r.wtOverlays.inlineStartOverlay.getRelativeCellPosition(ne(ms,this),i.row,i.col)),xt(hm,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(o)),xt(Vi,this,[]);const h=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&h){const d=this.hot.getSelectedRange();M(d,f=>{const m=f.getTopStartCorner().row,C=f.getBottomStartCorner().row;fe(m,C,w=>{ne(Vi,this).includes(w)||ne(Vi,this).push(w)})})}ne(Vi,this).includes(ne(hm,this))||xt(Vi,this,[ne(hm,this)]),xt(dm,this,c.top-6),xt(Gc,this,parseInt(a.height,10)),ne(Vn,this).style.top=`${ne(dm,this)+ne(Gc,this)}px`,ne(Vn,this).style[this.inlineDir]=`${c.start}px`,ne(Vn,this).style.width=`${s}px`,this.hot.rootElement.appendChild(ne(Vn,this))}refreshHandlePosition(){ne(Vn,this).style.top=`${ne(dm,this)+ne(Kd,this)}px`}setupGuidePosition(){const e=parseInt(Gt(ne(Vn,this)),10),n=parseInt(ne(Vn,this).style[this.inlineDir],10)+e,r=parseInt(this.hot.view.maximumVisibleElementWidth(0),10);Y(ne(Vn,this),"active"),Y(ne(ds,this),"active"),ne(ds,this).style.top=ne(Vn,this).style.top,ne(ds,this).style[this.inlineDir]=`${n}px`,ne(ds,this).style.width=`${r-e}px`,this.hot.rootElement.appendChild(ne(ds,this))}refreshGuidePosition(){ne(ds,this).style.top=ne(Vn,this).style.top}hideHandleAndGuide(){we(ne(Vn,this),"active"),we(ne(ds,this),"active")}checkIfRowHeader(e){const n=Cu(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&&ne(Za,this)<n?n:ne(Za,this)}afterMouseDownTimeout(){const e=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},n=(r,i)=>{const o=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(r),r,!0);o!==void 0&&xt(Za,this,o),this.setManualSize(r,ne(Za,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!0),i&&e()};ne(qd,this)>=2&&(ne(Vi,this).length>1?(M(ne(Vi,this),i=>{n(i)}),e()):M(ne(Vi,this),i=>{n(i,!0)})),xt(qd,this,0),xt(Xd,this,null)}bindEvents(){const{rootElement:e,rootWindow:n}=this.hot;this.eventManager.addEventListener(e,"mouseover",r=>na(Fa,this,vre).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>na(Fa,this,Cre).call(this,r)),this.eventManager.addEventListener(n,"mousemove",r=>na(Fa,this,yre).call(this,r)),this.eventManager.addEventListener(n,"mouseup",()=>na(Fa,this,bre).call(this)),this.eventManager.addEventListener(ne(Vn,this),"contextmenu",()=>na(Fa,this,Sre).call(this))}destroy(){super.destroy()}}function vre(t){if(!TN(t.target)&&ne(Fp,this)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(ne(Mu,this)||this.setupHandlePosition(e))}}function Cre(t){Ce(t.target,"manualRowResizer")&&(this.setupHandlePosition(ne(ms,this)),this.setupGuidePosition(),xt(Mu,this,!0),ne(Xd,this)===null&&(xt(Xd,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ne(Xd,this))),xt(qd,this,ne(qd,this)+1),xt(oT,this,t.pageY),xt(Za,this,ne(Gc,this)))}function yre(t){ne(Mu,this)&&(xt(Kd,this,ne(Gc,this)+(t.pageY-ne(oT,this))),M(ne(Vi,this),e=>{xt(Za,this,this.setManualSize(e,ne(Kd,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function bre(){const t=()=>{this.hot.forceFullRender=!0,this.hot.view.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)};ne(Mu,this)&&(this.hideHandleAndGuide(),xt(Mu,this,!1),ne(Za,this)!==ne(Gc,this)&&(ne(Vi,this).length>1?(M(ne(Vi,this),r=>{e(r)}),t()):M(ne(Vi,this),r=>{e(r,!0)})),this.setupHandlePosition(ne(ms,this)))}function Sre(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ne(Vn,this)),this.hot.rootElement.removeChild(ne(ds,this)),xt(Mu,this,!1),xt(Fp,this,!0),this.hot._registerImmediate(()=>{xt(Fp,this,!1)})}function Rre(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalRow(e),i=ne(Ao,this).getValueAtIndex(r);this.hot.getSettings()[$p]&&i&&(n=i)}return n}function Ere(){const t=this.hot.getSettings()[$p],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e<"u"?e.forEach((n,r)=>{ne(Ao,this).setValueAtIndex(r,n)}):Array.isArray(t)?(t.forEach((n,r)=>{ne(Ao,this).setValueAtIndex(r,n)}),xt(Zd,this,t)):t===!0&&Array.isArray(ne(Zd,this))&&ne(Zd,this).forEach((n,r)=>{ne(Ao,this).setValueAtIndex(r,n)})},!0)}var YA={},GA;function Tre(){if(GA)return YA;GA=1;var t=vw();return t("flatMap"),YA}Tre();var KA={},qA={},ES,XA;function _re(){if(XA)return ES;XA=1;var t=Nn(),e=sn(),n=Ps(),r=uE();return ES=function(i,o){(!o||typeof i!="string")&&e(i);var s=r(i);return n(e(s!==void 0?t(s,i):i))},ES}var ZA;function Mre(){if(ZA)return qA;ZA=1;var t=dt(),e=Nn(),n=gr(),r=sn(),i=Ps(),o=_re(),s=lE(),a=ah(),l=hl(),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})}}),qA}var JA;function Ire(){return JA||(JA=1,Mre()),KA}Ire();function Pre(t,e,n){Ore(t,e),e.set(t,n)}function Ore(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xl(t,e,n){return(e=xre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xre(t){var e=Are(t,"string");return typeof e=="symbol"?e:e+""}function Are(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function QA(t,e){return t.get(KL(t,e))}function fm(t,e,n){return t.set(KL(t,e),n),n}function KL(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 Zl=new WeakMap;class ps{constructor(e,n,r,i,o,s){Xl(this,"row",void 0),Xl(this,"col",void 0),Xl(this,"rowspan",void 0),Xl(this,"colspan",void 0),Xl(this,"removed",!1),Xl(this,"cellCoordsFactory",void 0),Xl(this,"cellRangeFactory",void 0),Pre(this,Zl,null),this.row=e,this.col=n,this.rowspan=r,this.colspan=i,this.cellCoordsFactory=o,this.cellRangeFactory=s}static NEGATIVE_VALUES_WARNING(e){let{row:n,col:r,rowspan:i,colspan:o}=e;return tt`The merged cell declared with {row: ${n}, col: ${r},\x20
|
|
268
|
-
rowspan: ${i}, colspan: ${o}} contains negative values, which is\x20
|
|
269
|
-
not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){let{row:n,col:r}=e;return tt`The merged cell declared at [${n}, ${r}] is positioned\x20
|
|
270
|
-
(or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL(e){let{row:n,col:r}=e;return tt`The merged cell declared at [${n}, ${r}] has both "rowspan"\x20
|
|
271
|
-
and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){let{row:n,col:r}=e;return tt`The merged cell declared at [${n}, ${r}] has "rowspan"\x20
|
|
272
|
-
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),fm(Zl,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,fm(Zl,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 fm(Zl,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 QA(Zl,this)||fm(Zl,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),QA(Zl,this)}}function Hre(t,e){Nre(t,e),e.add(t)}function Nre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gm(t,e,n){return(e=Dre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dre(t){var e=kre(t,"string");return typeof e=="symbol"?e:e+""}function kre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Jl(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 Va=new WeakSet;class Vp{constructor(e){Hre(this,Va),gm(this,"plugin",void 0),gm(this,"mergedCells",[]),gm(this,"mergedCellsMatrix",new Map),gm(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:n,col:r}=e;return tt`The merged cell declared at [${n}, ${r}], overlaps\x20
|
|
273
|
-
with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
|
|
274
|
-
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)){Xe(Vp.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 ps(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),Jl(Va,this,eH).call(this,a),a):(u&&Xe(Vp.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),Jl(Va,this,Lre).call(this,r),r):!1}clear(){M(this.mergedCells,e=>{let{row:n,col:r,rowspan:i,colspan:o}=e;fe(n,n+i,s=>{fe(r,r+o,a=>{const l=this.hot.getCell(s,a);l&&(l.removeAttribute("rowspan"),l.removeAttribute("colspan"),l.style.display="")})})}),this.mergedCells.length=0,this.mergedCellsMatrix=new Map}isOverlapping(e){const n=e.getRange();for(let r=0;r<this.mergedCells.length;r++)if(this.mergedCells[r].getRange().overlaps(n))return!0;return!1}isFirstRenderableMergedCell(e,n){const r=this.get(e,n);if(!r)return!1;const{row:i,col:o,rowspan:s,colspan:a}=r,l=this.hot.view.getActiveOverlayName(),u=["top","top_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleRow(),c=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleColumn(),h=ze(u,i,i+s-1),d=ze(c,o,o+a-1);return this.hot.rowIndexMapper.getNearestNotHiddenIndex(h,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(d,1)===n}getFirstRenderableCoords(e,n){const r=this.get(e,n);if(!r||this.isFirstRenderableMergedCell(e,n))return this.hot._createCellCoords(e,n);const i=this.hot.rowIndexMapper.getNearestNotHiddenIndex(r.row,1),o=this.hot.columnIndexMapper.getNearestNotHiddenIndex(r.col,1);return this.hot._createCellCoords(i,o)}getStartMostColumnIndex(e,n){const r=Jl(Va,this,mm).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=Jl(Va,this,mm).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=Jl(Va,this,mm).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=Jl(Va,this,mm).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=>{Jl(Va,this,eH).call(this,s)})}}function mm(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 eH(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 Lre(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 TS(t,e,n){return(e=$re(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $re(t){var e=Fre(t,"string");return typeof e=="symbol"?e:e+""}function Fre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Vre{constructor(e){TS(this,"plugin",void 0),TS(this,"mergedCellsCollection",void 0),TS(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,C=this.getFarthestCollection(e,n,r,i);if(C){if(r==="down"){const w=C.row+C.rowspan-a-m;o[2]+w>=this.plugin.hot.countRows()?o[2]-=m:o[2]+=m?w:0}else if(r==="right"){const w=C.col+C.colspan-l-m;o[3]+w>=this.plugin.hot.countCols()?o[3]-=m:o[3]+=m?w:0}else if(r==="up"){const w=u-m-C.row+1;o[0]+w<0?o[0]+=m:o[0]-=m?w:0}else if(r==="left"){const w=c-m-C.col+1;o[1]+w<0?o[1]+=m:o[1]-=m?w:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:r,foundMergedCells:i,fillSize:s,dragArea:o,cycleLength:d}),o}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),rn(this.currentFillData,e)}getAutofillSize(e,n,r){const[i,o,s,a]=e,[l,u,c,h]=n;switch(r){case"up":return i-l;case"down":return c-s;case"left":return o-u;case"right":return h-a;default:return null}}getDragArea(e,n,r){const[i,o,s,a]=e,[l,u,c,h]=n;switch(r){case"up":return[l,u,i-1,a];case"down":{const d=this.mergedCellsCollection.get(c,a),f=d?d.rowspan-1:0;return[s+1,o,c+f,a]}case"left":return[l,u,s,o-1];case"right":{const d=this.mergedCellsCollection.get(c,a),f=d?d.colspan-1:0;return[i,a+f,c,h]}default:return null}}getFarthestCollection(e,n,r,i){const[o,s,a,l]=e,u=["up","down"].indexOf(r)>-1,c=u?a:l,h=u?o:s,d=this.getAutofillSize(e,n,r),f=u?a-o+1:l-s+1,m=Math.floor(d/f)*f,C=d-m;let w=null,S=null,R=null;switch(r){case"up":w="includesVertically",R=c-C+1;break;case"left":w="includesHorizontally",R=c-C+1;break;case"down":w="includesVertically",R=h+C-1;break;case"right":w="includesHorizontally",R=h+C-1;break}return M(i,I=>{I[w](R)&&I.isFarther(S,r)&&(S=I)}),S}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 M(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:C}=m;return C===h.getWidth()}):!f.every(m=>{let{rowspan:C}=m;return C===h.getHeight()})}}function _S(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)}class jre{constructor(e){_S(this,"plugin",void 0),_S(this,"hot",void 0),_S(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 Ure(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(Or)}return this.getTranslatedPhrase(Pr)},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?ps.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 Jd(t,e,n){return(e=zre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zre(t){var e=Yre(t,"string");return typeof e=="symbol"?e:e+""}function Yre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tH{constructor(e){Jd(this,"data",void 0),Jd(this,"next",null),Jd(this,"prev",null),this.data=e}}class pm{constructor(){Jd(this,"first",null),Jd(this,"last",null)}push(e){const n=new tH(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 tH(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 Gre(t,e){qL(t,e),e.add(t)}function Ql(t,e,n){qL(t,e),e.set(t,n)}function qL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qe(t,e){return t.get(Wp(t,e))}function Ai(t,e,n){return t.set(Wp(t,e),n),n}function Wp(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 os=new WeakMap,ss=new WeakMap,as=new WeakMap,ls=new WeakMap,KR=new WeakMap,wm=new WeakMap,vm=new WeakMap,MS=new WeakSet;class Kre{constructor(e){let{mergedCellsGetter:n,rowIndexMapper:r,columnIndexMapper:i}=e;Gre(this,MS),Ql(this,os,new pm),Ql(this,ss,new pm),Ql(this,as,null),Ql(this,ls,null),Ql(this,KR,null),Ql(this,wm,null),Ql(this,vm,null),Ai(KR,this,n),Ai(wm,this,r),Ai(vm,this,i)}getCurrentVerticalNode(){return Qe(ls,this).data}getFirstVerticalNode(){return Qe(ss,this).first.data}getNextVerticalNode(){return Qe(ls,this).next.data}getPrevVerticalNode(){return Qe(ls,this).prev.data}getCurrentHorizontalNode(){return Qe(as,this).data}getFirstHorizontalNode(){return Qe(os,this).first.data}getNextHorizontalNode(){return Qe(as,this).next.data}getPrevHorizontalNode(){return Qe(as,this).prev.data}setPrevNodeAsActive(){Ai(ls,this,Qe(ls,this).prev),Ai(as,this,Qe(as,this).prev)}setNextNodeAsActive(){Ai(ls,this,Qe(ls,this).next),Ai(as,this,Qe(as,this).next)}buildFocusOrder(e){const n=e.getTopStartCorner(),r=e.getBottomEndCorner(),i=new WeakSet;Ai(os,this,new pm);for(let s=n.row;s<=r.row;s++)if(!Qe(wm,this).isHidden(s))for(let a=n.col;a<=r.col;a++){if(Qe(vm,this).isHidden(a))continue;const l=Wp(MS,this,nH).call(this,e,Qe(os,this),i,s,a);l&&Ai(as,this,l)}Qe(os,this).first&&(Qe(os,this).first.prev=Qe(os,this).last,Qe(os,this).last.next=Qe(os,this).first);const o=new WeakSet;Ai(ss,this,new pm);for(let s=n.col;s<=r.col;s++)if(!Qe(vm,this).isHidden(s))for(let a=n.row;a<=r.row;a++){if(Qe(wm,this).isHidden(a))continue;const l=Wp(MS,this,nH).call(this,e,Qe(ss,this),o,a,s);l&&Ai(ls,this,l)}Qe(ss,this).first&&(Qe(ss,this).first.prev=Qe(ss,this).last,Qe(ss,this).last.next=Qe(ss,this).first)}setActiveNode(e,n){return Qe(os,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return Ai(as,this,r),!1}),Qe(ss,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return Ai(ls,this,r),!1}),this}}function nH(t,e,n,r,i){const o=t.getTopStartCorner(),s=t.getBottomEndCorner(),a=t.highlight.clone().normalize(),l=Qe(KR,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 qre(t){const{hot:e}=t,{rowIndexMapper:n,columnIndexMapper:r}=e;function i(){}function o(s,a,l){const u=t.mergedCellsCollection.get(a,l);if(!Ae(u)){s.removeAttribute("rowspan"),s.removeAttribute("colspan"),s.style.display="";return}const{row:c,col:h,colspan:d,rowspan:f}=u,[m,C]=t.translateMergedCellToRenderable(c,f,h,d),w=t.getSetting("virtualized"),S=n.getRenderableFromVisualIndex(a),R=r.getRenderableFromVisualIndex(l),I=m-S+1,O=C-R+1;let D=n.getNearestNotHiddenIndex(c,1),_=r.getNearestNotHiddenIndex(h,1);if(w){const X=e.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(X)||(D=Math.max(D,e.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(X)||(_=Math.max(_,e.getFirstRenderedVisibleColumn()))}const x=Math.min(f,I),j=Math.min(d,O);D===a&&_===l?(s.setAttribute("rowspan",x),s.setAttribute("colspan",j)):(s.removeAttribute("rowspan"),s.removeAttribute("colspan"),s.style.display="none")}return{before:i,after:o}}function Xre(t,e){XL(t,e),e.add(t)}function Cm(t,e,n){XL(t,e),e.set(t,n)}function XL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function IS(t,e,n){return(e=Zre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zre(t){var e=Jre(t,"string");return typeof e=="symbol"?e:e+""}function Jre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bf(t,e,n){return t.set(et(t,e),n),n}function ht(t,e){return t.get(et(t,e))}function et(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")}ie.getSingleton().register("beforeMergeCells");ie.getSingleton().register("afterMergeCells");ie.getSingleton().register("beforeUnmergeCells");ie.getSingleton().register("afterUnmergeCells");const qR="mergeCells",Qre=150,rH=qR;var io=new WeakMap,oo=new WeakMap,Rs=new WeakMap,iH=new WeakMap,rt=new WeakSet;class eie extends qe{constructor(){super(...arguments),Xre(this,rt),IS(this,"mergedCellsCollection",null),IS(this,"autofillCalculations",null),IS(this,"selectionCalculations",null),Cm(this,io,null),Cm(this,oo,{row:0,col:0}),Cm(this,Rs,new Kre({mergedCellsGetter:(e,n)=>this.mergedCellsCollection.get(e,n),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),Cm(this,iH,qre(this))}static get PLUGIN_KEY(){return qR}static get PLUGIN_PRIORITY(){return Qre}static get DEFAULT_SETTINGS(){return{[Ck]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[qR]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new Vp(this),this.autofillCalculations=new Vre(this),this.selectionCalculations=new jre(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return et(rt,e,tie).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 et(rt,e,rie).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 et(rt,e,iie).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 et(rt,e,oie).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 et(rt,e,sie).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 et(rt,e,sH).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 et(rt,e,sH).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 et(rt,e,lie).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 et(rt,e,uie).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 et(rt,e,cie).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 et(rt,e,oH).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 et(rt,e,oH).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 et(rt,e,nie).call(e,...r)}),this.addHook("afterRenderer",function(){return ht(iH,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 et(rt,e,aie).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 et(rt,e,hie).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 et(rt,e,die).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 et(rt,e,fie).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 et(rt,e,gie).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 et(rt,e,mie).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 et(rt,e,pie).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 et(rt,e,wie).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 et(rt,e,vie).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 et(rt,e,Cie).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 et(rt,e,yie).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 et(rt,e,bie).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 et(rt,e,Sie).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 et(rt,e,Rie).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 et(rt,e,Eie).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(!ON())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==null?void 0:o.name)==="master"?o:o.clone.wtTable).forEach(o=>{const s=o.getRow(i);s&&(s.style.background=cp(s,"backgroundColor").replace(")",", 0.99)"),e.push(s))})}),this.hot._registerTimeout(()=>{e.forEach(r=>{r.style.background=cp(r,"backgroundColor").replace(", 0.99)",")")})},1)}validateSetting(e){return e?ps.containsNegativeValues(e)?(Xe(ps.NEGATIVE_VALUES_WARNING(e)),!1):ps.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(Xe(ps.IS_OUT_OF_BOUNDS_WARNING(e)),!1):ps.isSingleCell(e)?(Xe(ps.IS_SINGLE_CELL(e)),!1):ps.containsZeroSpan(e)?(Xe(ps.ZERO_SPAN_WARNING(e)),!1):!0:!1}generateFromSettings(){const e=this.getSetting("cells").filter(i=>this.validateSetting(i)),n=this.mergedCellsCollection.filterOverlappingMergeCells(e),r=[];n.forEach(i=>{const{row:o,col:s,rowspan:a,colspan:l}=i,u=this.hot._createCellCoords(o,s),c=this.hot._createCellCoords(o+a-1,s+l-1),h=this.hot._createCellRange(u,u,c);this.mergeRange(h,!0,!0);for(let d=o;d<o+a;d++)for(let f=s;f<s+l;f++)(d!==o||f!==s)&&r.push([d,f,null])}),r.length!==0&&this.hot.setDataAtCell(r,void 0,void 0,this.pluginName)}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?!0:this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}unmergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:n,to:r}=e;this.unmergeRange(e,!0),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}mergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=e.getTopStartCorner(),o=e.getBottomEndCorner(),s={row:i.row,col:i.col,rowspan:o.row-i.row+1,colspan:o.col-i.col+1},a=[];let l=null;return this.canMergeRange(s,n)?(this.hot.runHooks("beforeMergeCells",e,n),fe(0,s.rowspan-1,c=>{fe(0,s.colspan-1,h=>{let d=null;a[c]||(a[c]=[]),c===0&&h===0?d=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s.row),this.hot.toPhysicalColumn(s.col)):this.hot.setCellMeta(s.row+c,s.col+h,"hidden",!0),a[c][h]=d})}),this.hot.setCellMeta(s.row,s.col,"spanned",!0),this.mergedCellsCollection.add(s,n)?(r?l=[s.row,s.col,a]:this.hot.populateFromArray(s.row,s.col,a,void 0,void 0,this.pluginName),n||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,s,n),l):!0):!1}unmergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.mergedCellsCollection.getWithinRange(e);r.length!==0&&(this.hot.runHooks("beforeUnmergeCells",e,n),M(r,i=>{this.mergedCellsCollection.remove(i.row,i.col),fe(0,i.rowspan-1,o=>{fe(0,i.colspan-1,s=>{this.hot.removeCellMeta(i.row+o,i.col+s,"hidden"),this.hot.removeCellMeta(i.row+o,i.col+s,"copyable")})}),this.hot.removeCellMeta(i.row,i.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,n),this.hot.render())}toggleMerge(e){const n=this.mergedCellsCollection.get(e.from.row,e.from.col);n.row===e.from.row&&n.col===e.from.col&&n.row+n.rowspan-1===e.to.row&&n.col+n.colspan-1===e.to.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:rH})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(rH)}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(Ae(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(Ae(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(Ae(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(Ae(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 tie(){this.generateFromSettings(),this.hot.render()}function nie(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 rie(t){ht(oo,this).row=t.row,ht(oo,this).col=t.col}function iie(t){const e=this.hot.getSelectedRangeLast(),{highlight:n}=e,{columnIndexMapper:r,rowIndexMapper:i}=this.hot;ht(io,this)&&(i.getRenderableFromVisualIndex(ht(io,this).row)!==null&&(n.row=ht(io,this).row),r.getRenderableFromVisualIndex(ht(io,this).col)!==null&&(n.col=ht(io,this).col),bf(io,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 oie(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 sie(){const t=this.hot.getSelectedRangeLast(),{highlight:e}=t;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){bf(io,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);bf(io,this,e.clone()),n&&e.assign(n)}function oH(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(),C=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleColumn();return[ze(m,u,h),ze(C,c,d),ze(this.hot.getLastRenderedVisibleRow(),u,h),ze(this.hot.getLastRenderedVisibleColumn(),c,d)]}return[u,c,h,d]}function aie(t){t.items.push({name:"---------"},Ure(this))}function sH(){bf(io,this,null)}function lie(){if(ht(io,this).isCell())return;const t=this.hot.getSelectedRangeLast(),e=t.getVerticalDirection(),n=t.getHorizontalDirection(),r=ht(io,this).clone().normalize();ht(Rs,this).setActiveNode(r.row,r.col),ht(oo,this).row>0||ht(oo,this).col>0?ht(Rs,this).setPrevNodeAsActive():(n==="E-W"&&ht(oo,this).col<0||e==="S-N"&&ht(oo,this).row<0)&&ht(Rs,this).setNextNodeAsActive()}function uie(t,e){const n=this.hot.getSelectedRangeLast(),{columnIndexMapper:r,rowIndexMapper:i}=this.hot;let o=null,s=null;if(ht(oo,this).col<0){const{rowEnd:a,colEnd:l}=ht(Rs,this).getPrevHorizontalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(ht(oo,this).col>0){const{rowStart:a,colStart:l}=ht(Rs,this).getNextHorizontalNode();s=r.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}else if(ht(oo,this).row<0){const{rowEnd:a,colEnd:l}=ht(Rs,this).getPrevVerticalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(ht(oo,this).row>0){const{rowStart:a,colStart:l}=ht(Rs,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()}ht(Rs,this).setActiveNode(t,e),bf(oo,this,{row:0,col:0})}function cie(){this.hot.getSelectedRangeLast().isHeader()||ht(Rs,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function hie(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 die(t){if(this.getSetting("virtualized"))return;const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function fie(t){if(this.getSetting("virtualized"))return;const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function gie(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 mie(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function pie(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function wie(t,e,n){n!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function vie(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function Cie(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function yie(t,e){if(e&&e==="area"){const n=this.hot.getSelectedRangeLast(),r=this.mergedCellsCollection.getWithinRange(n);M(r,i=>{n.getBottomEndCorner().row===i.getLastRow()&&n.getBottomEndCorner().col===i.getLastColumn()&&(t[2]=i.row,t[3]=i.col)})}}function bie(t,e,n,r){if(n)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,n,r)}function Sie(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function Rie(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 Eie(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,et(rt,this,Tie).call(this,e,m))}),t}function Tie(t,e){const{view:n,rowIndexMapper:r}=this.hot,i=n.getStylesHandler(),o=n.getDefaultRowHeight();let s=0;for(let l=t;l<t+e;l++)if(!r.isHidden(l)){var a;s+=(a=this.hot.getRowHeight(l))!==null&&a!==void 0?a:o,l===0&&!i.isClassicTheme()&&(s+=1)}return s}function _ie(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:Mk(u.type))(l,u,d)(c,h);if(m===Ts){const C=a+1;if(typeof e[C]<"u")return s(C)}return m}(0)}}const ZL="sort";function Mie(t,e,n){const r=[];return n===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&r.push(`${ZL}-${t.getIndexOfColumnInSortQueue(e)+1}`),r}function Iie(t){const e=t.className.split(" "),n=new RegExp(`^${ZL}-[0-9]{1,2}$`);return e.filter(r=>n.test(r))}function Pie(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)}const Bp="multiColumnSorting",Aie=170,aH=Bp;_k(Bp,_ie);class Hie extends kk{constructor(){super(...arguments),Pie(this,"pluginKey",Bp)}static get PLUGIN_KEY(){return Bp}static get PLUGIN_PRIORITY(){return Aie}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,Rp)),!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:pl,position:"before",group:aH})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(aH)}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),we(e,Iie(e)),this.enabled!==!1&&Y(e,Mie(...r))}onAfterOnCellMouseDown(e,n){U0(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,Rp))):this.sort(this.getColumnNextConfig(n.col)))}}function lH(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=Die(t,"string");return typeof e=="symbol"?e:e+""}function Die(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 kie="multipleSelectionHandles",Lie=160;class $ie extends qe{constructor(){super(...arguments),lH(this,"dragged",[]),lH(this,"lastSetCell",null)}static get PLUGIN_KEY(){return kie}static get PLUGIN_PRIORITY(){return Lie}isEnabled(){return aa()}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(Ce(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(Ce(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(Ce(i.target,"topSelectionHandle-HitArea"))return r.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(Ce(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 XR(){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 JL(){return{label:"",isPlaceholder:!0}}function Fie(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const n=[];if(e===0)return n;M(t,i=>{const o=[];let s=0;n.push(o),M(i,a=>{const l=XR();if(Ae(a)){const{label:c,colspan:h,headerClassName:d}=a;l.label=Kt(c),typeof h=="number"&&h>1&&(l.colspan=h,l.origColspan=h),typeof d=="string"&&(l.headerClassNames=[...d.split(" ")])}else l.label=Kt(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(JL());return!u})});const r=Math.max(...je(n,i=>i.length));return M(n,i=>{if(i.length<r){const o=je(new Array(r-i.length),()=>XR());i.splice(i.length,0,...o)}}),n}function PS(t,e,n){Vie(t,e),e.set(t,n)}function Vie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bo(t,e){return t.get(QL(t,e))}function vd(t,e,n){return t.set(QL(t,e),n),n}function QL(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 uH=["label","collapsible"];var Ys=new WeakMap,eu=new WeakMap,OS=new WeakMap;class Wie{constructor(){PS(this,Ys,[]),PS(this,eu,0),PS(this,OS,1/0)}setColumnsLimit(e){vd(OS,this,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];vd(Ys,this,Fie(e,bo(OS,this))),vd(eu,this,bo(Ys,this).length)}getData(){return bo(Ys,this)}mergeWith(e){M(e,n=>{let{row:r,col:i,...o}=n;const s=this.getHeaderSettings(r,i);s!==null&&rn(s,o,uH)})}map(e){M(bo(Ys,this),n=>{M(n,r=>{const i=e({...r});Ae(i)&&rn(r,i,uH)})})}getHeaderSettings(e,n){var r;if(e>=bo(eu,this)||e<0)return null;const i=bo(Ys,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>=bo(eu,this)||e<0)return i;const o=bo(Ys,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 bo(eu,this)}getColumnsCount(){return bo(eu,this)>0?bo(Ys,this)[0].length:0}clear(){vd(Ys,this,[]),vd(eu,this,0)}}function xS(t,e,n){return(e=Bie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bie(t){var e=jie(t,"string");return typeof e=="symbol"?e:e+""}function jie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 e$="DF-pre-order";function t$(t,e){let n=t.call(e,this);for(let r=0;r<this.childs.length;r++){if(n===!1)return!1;n=t$.call(this.childs[r],t,e)}return n}const Uie="DF-post-order";function n$(t,e){for(let n=0;n<this.childs.length;n++)if(n$.call(this.childs[n],t,e)===!1)return!1;return t.call(e,this)}const r$="BF";function zie(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 Yie=r$,cH=new Map([[e$,t$],[Uie,n$],[r$,zie]]);class jp{constructor(e){xS(this,"data",{}),xS(this,"parent",null),xS(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 jp({...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]:Yie;if(!cH.has(n))throw new Error(`Traversal strategy "${n}" does not exist`);cH.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 AS(t,e,n){Gie(t,e),e.set(t,n)}function Gie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fn(t,e){return t.get(i$(t,e))}function Kie(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")}var vc=new WeakMap,tu=new WeakMap,Cc=new WeakMap;class qie{constructor(e){AS(this,vc,new Map),AS(this,tu,new Map),AS(this,Cc,null),Kie(Cc,this,e)}getRoots(){return Array.from(Fn(vc,this).values())}getRootByColumn(e){let n;return Fn(tu,this).has(e)&&(n=Fn(vc,this).get(Fn(tu,this).get(e))),n}getNode(e,n){const r=this.getRootByColumn(n);if(!r)return;const i=n-Fn(tu,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;Fn(tu,this).clear(),M(Fn(vc,this),n=>{let[,{data:{colspan:r}}]=n;for(let i=e;i<e+r;i++)Fn(tu,this).set(i,e);e+=r})}buildTree(){this.clear();const e=Fn(Cc,this).getColumnsCount();let n=0;for(;n<e;){const r=Fn(Cc,this).getHeaderSettings(0,n),i=new jp;Fn(vc,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=Fn(Cc,this).getHeadersSettings(r,n,i);r+=1,M(o,s=>{const a={...s,headerLevel:r-1,columnIndex:n};let l;r===1?(e.data=a,l=e):(l=new jp(a),e.addChild(l)),r<Fn(Cc,this).getLayersCount()&&this.buildLeaves(l,n,r,s.origColspan),n+=s.origColspan})}clear(){Fn(vc,this).clear(),Fn(tu,this).clear()}}function o$(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 Up(t,e){let{childs:n}=t;if(n.length!==0)return n[0].data[e]}function zp(t){return Up(t,"origColspan")===t.data.origColspan}function sT(t){const{data:e,childs:n}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(zp(t))return sT(n[0]);e.isCollapsed=!1;const i=n.slice(1),o=new Set;let s=0;if(i.length>0)M(i,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;s+=l.colspan,o$(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):zp(a)&&(l.isCollapsed=Up(a,"isCollapsed"))}),{rollbackModification:()=>aT(t),affectedColumns:Array.from(o),colspanCompensation:s}}function aT(t){var e;const{data:n,childs:r}=t;if(n.isCollapsed||n.isHidden||n.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(zp(t))return aT(r[0]);n.isCollapsed=!0;const o=r.slice(1),s=new Set;if(o.length>0)M(o,l=>{o$(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=Up(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):zp(l)&&(u.isCollapsed=Up(l,"isCollapsed"))}),{rollbackModification:()=>sT(t),affectedColumns:Array.from(s),colspanCompensation:a}}function Xie(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(tt`The passed node is not the last node on the tree. Only for\x20
|
|
275
|
-
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 Zie(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(tt`The passed node is not the last node on the tree. Only for\x20
|
|
276
|
-
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 hH=new Map([["collapse",aT],["expand",sT],["hide-column",Xie],["show-column",Zie]]);function Jie(t,e,n){if(!hH.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return hH.get(t)(e,n)}function ym(t){const e=[];return M(t,n=>{n.walkDown(r=>{const i=r.data,{origColspan:o,columnIndex:s,headerLevel:a,crossHiddenColumns:l}=i,u=eoe(e,a);let c=!1;for(let h=s;h<s+o;h++)if(l.includes(h)||c)u.push(JL());else{const f=Qie(i);f.isRoot=!0,u.push(f),c=!0}})}),e}function Qie(t){const{crossHiddenColumns:e,...n}=XR(t);return n}function eoe(t,e){let n;return Array.isArray(t[e])?n=t[e]:(n=[],t[e]=n),n}function HS(t,e,n){toe(t,e),e.set(t,n)}function toe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cd(t,e,n){return t.set(s$(t,e),n),n}function It(t,e){return t.get(s$(t,e))}function s$(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 us=new WeakMap,or=new WeakMap,nu=new WeakMap;class noe{constructor(){HS(this,us,new Wie),HS(this,or,new qie(It(us,this))),HS(this,nu,[[]])}setState(e){It(us,this).setData(e);let n=!1;try{It(or,this).buildTree()}catch{It(or,this).clear(),It(us,this).clear(),n=!0}return Cd(nu,this,ym(It(or,this).getRoots())),n}setColumnsLimit(e){It(us,this).setColumnsLimit(e)}mergeStateWith(e){const n=je(e,r=>{let{row:i,...o}=r;return{row:i<0?this.rowCoordsToLevel(i):i,...o}});It(us,this).mergeWith(n),It(or,this).buildTree(),Cd(nu,this,ym(It(or,this).getRoots()))}mapState(e){It(us,this).map(e),It(or,this).buildTree(),Cd(nu,this,ym(It(or,this).getRoots()))}mapNodes(e){return mr(It(or,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=It(or,this).getNode(n,r);let o;return i&&(o=Jie(e,i,r),Cd(nu,this,ym(It(or,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=It(nu,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=It(or,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=It(or,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)},e$)}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 It(us,this).getLayersCount()}getColumnsCount(){return It(us,this).getColumnsCount()}clear(){Cd(nu,this,[]),It(us,this).clear(),It(or,this).clear()}}function yd(t,e,n){return(e=roe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function roe(t){var e=ioe(t,"string");return typeof e=="symbol"?e:e+""}function ioe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 ooe{constructor(e,n){yd(this,"hot",void 0),yd(this,"nestedHeaderSettingsGetter",void 0),yd(this,"layersCount",0),yd(this,"container",void 0),yd(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>'),fh(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 soe(t,e){a$(t,e),e.add(t)}function dH(t,e,n){return(e=aoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aoe(t){var e=loe(t,"string");return typeof e=="symbol"?e:e+""}function loe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 bd(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 ha(t,e,n){return t.set(Pt(t,e),n),n}function We(t,e){return t.get(Pt(t,e))}function Pt(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 fH="nestedHeaders",uoe=280;var ot=new WeakMap,Wa=new WeakMap,Qd=new WeakMap,Yw=new WeakMap,Yp=new WeakMap,$t=new WeakSet;class coe extends qe{constructor(){super(...arguments),soe(this,$t),bd(this,ot,new noe),bd(this,Wa,null),bd(this,Qd,null),bd(this,Yw,!1),bd(this,Yp,null),dH(this,"ghostTable",new ooe(this.hot,(e,n)=>this.getHeaderSettings(e,n))),dH(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return fH}static get PLUGIN_PRIORITY(){return uoe}isEnabled(){return!!this.hot.getSettings()[fH]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();(!Array.isArray(n)||!Array.isArray(n[0]))&&Xe(tt`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
|
|
277
|
-
passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>Pt($t,this,_oe).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 Pt($t,e,Moe).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 Pt($t,e,goe).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 Pt($t,e,moe).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 Pt($t,e,poe).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 Pt($t,e,woe).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 Pt($t,e,voe).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 Pt($t,e,Coe).call(e,...i)}),this.addHook("afterSelection",()=>Pt($t,this,bm).call(this)),this.addHook("afterSelectionFocusSet",()=>Pt($t,this,bm).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 Pt($t,e,hoe).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",r=>Pt($t,this,boe).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 Pt($t,e,Roe).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 Pt($t,e,Eoe).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 Pt($t,e,doe).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 Pt($t,e,foe).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 Pt($t,e,yoe).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 Pt($t,e,Soe).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 Pt($t,e,Toe).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>Pt($t,this,bm).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>Pt($t,this,bm).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();We(ot,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=We(ot,this).setState(e)),this.detectedOverlappedHeaders&&Xe(tt`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
|
|
278
|
-
is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((n,r)=>{const i=n===!0?"hide-column":"show-column";We(ot,this).triggerColumnModification(i,r)}),!We(Wa,this)&&this.enabled&&ha(Wa,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";We(ot,this).triggerColumnModification(a,o)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),We(ot,this).clear(),We(Wa,this).unsubscribe(),ha(Wa,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return We(ot,this)}getLayersCount(){return We(ot,this).getLayersCount()}getHeaderSettings(e,n){return We(ot,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"),we(a.childNodes[c],"hiddenHeader"),l&&l.childNodes[c]&&(l.childNodes[c].removeAttribute("colspan"),we(l.childNodes[c],"hiddenHeader")),o&&u&&u.childNodes[c]&&(u.childNodes[c].removeAttribute("colspan"),we(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"),we(o,"hiddenHeader"),we(o,"hiddenHeaderText");const{colspan:c,isHidden:h,isPlaceholder:d,headerClassNames:f}=(s=We(ot,this).getHeaderSettings(e,u))!==null&&s!==void 0?s:{};if(d||h)Y(o,"hiddenHeader");else if(c>1){var m,C,w;const{wtOverlays:S}=l._wt,R=(m=S.topInlineStartCornerOverlay)===null||m===void 0?void 0:m.clone.wtTable.THEAD.contains(o),I=(C=S.inlineStartOverlay)===null||C===void 0?void 0:C.clone.wtTable.THEAD.contains(o);((w=S.topOverlay)===null||w===void 0?void 0:w.clone.wtTable.THEAD.contains(o))&&u<r&&Y(o,"hiddenHeaderText");const D=R||I?Math.min(c,r-i):c;D>1&&o.setAttribute("colspan",D)}if(this.hot.view.appendColHeader(u,o,function(){return n.getColumnHeaderValue(...arguments)},e),!d&&!h){const S=o.querySelector("div.relative");S&&f&&f.length>0&&(we(S,this.hot.getColumnMeta(u).headerClassName),Y(S,f))}}}getColumnHeaderValue(e,n){var r;const{isHidden:i,isPlaceholder:o}=(r=We(ot,this).getHeaderSettings(n,e))!==null&&r!==void 0?r:{};return o||i?"":this.hot.getColHeader(e,n)}destroy(){ha(ot,this,null),We(Wa,this)!==null&&(We(Wa,this).unsubscribe(),ha(Wa,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return We(ot,this).getHeaderTreeNodeData(e.row,e.col)}}function bm(){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=We(ot,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 hoe(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=We(Yp,this))===null||n===void 0?void 0:n.row,l=s?t:i.col,u=a<0&&l>=0;if(ha(Yp,this,null),!u)return t;const c=this.hot.getFirstFullyVisibleColumn(),h=this.hot.getLastFullyVisibleColumn(),d=h-c+1,f=We(ot,this).findLeftMostColumnIndex(a,l),m=We(ot,this).findRightMostColumnIndex(a,l),C=m-f+1;if(f<c&&m>h)return f;if(s){let w=null;return f>=c&&m>h?C>d?(e.value="start",w=f):(e.value="end",w=m):f<c&&m<=h&&(C>d?(e.value="end",w=m):(e.value="start",w=f)),w}return f<=c?f:m}function doe(t,e,n){const r=We(ot,this).getHeaderTreeNodeData(e,t);if(!r)return t;const{columnCursor:i,selectionType:o,selectionWidth:s}=n,{isRoot:a,colspan:l}=We(ot,this).getHeaderSettings(e,t);if(o===QE){if(!a)return r.columnIndex}else if(o===iD&&(l>s-i||!a))return null;return t}function foe(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,C=d-a;if(C===0)continue;((i=We(ot,this).getHeaderTreeNodeData(f,d))===null||i===void 0?void 0:i.isRoot)===!1&&(t[m][C]="")}}}function goe(t,e,n,r){this._getHeaderTreeNodeDataByCoords(e)&&(r.column=!0)}function moe(t,e){const n=this._getHeaderTreeNodeDataByCoords(e);if(!n)return;ha(Qd,this,e.clone()),ha(Yw,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):(BE(t)||bu(t)&&l||sz(t))&&o.push(s,s+a-1,e.row),r.selectColumns(...o)}function poe(t,e,n,r){if(!this.hot.view.isMouseDown()||r.column)return;const i=this._getHeaderTreeNodeDataByCoords(e);if(!i)return;const{columnIndex:o,origColspan:s}=i,a=this.hot.getSelectedRangeLast(),l=a.getTopStartCorner(),u=a.getBottomEndCorner(),{from:c}=a;r.column=!0,r.cell=!0;const h=[],d=ze(e.row,-1/0,-1);e.col<c.col?h.push(u.col,o,d):e.col>c.col?h.push(l.col,o+s-1,d):h.push(o,o+s-1,d),this.hot.selection.selectColumns(...h)}function woe(){ha(Yw,this,!1)}function voe(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!We(Yw,this)||!t)return;const e=this.hot.getSelectedRangeLast(),n=e.getTopStartCorner().col,r=e.getBottomEndCorner().col,{columnIndex:i,origColspan:o}=We(ot,this).getHeaderTreeNodeData(We(Qd,this).row,We(Qd,this).col);if(e.setHighlight(We(Qd,this)),o>e.getWidth()||i<n||i+o-1>r){const s=We(ot,this).findTopMostEntireHeaderLevel(ze(n,i,i+o-1),ze(r,i,i+o-1));e.highlight.row=s,e.highlight.col=e.from.col}}function Coe(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=We(ot,this).findLeftMostColumnIndex(n.row,n.col),o=We(ot,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 yoe(t,e,n){const r=t.row,i=this._getHeaderTreeNodeDataByCoords({row:r,col:t.col}),o=this._getHeaderTreeNodeDataByCoords({row:r,col:e.col});ha(Yp,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 boe(t){if(We(ot,this).getLayersCount()>0){t.length=0;for(let e=0;e<We(ot,this).getLayersCount();e++)t.push(this.headerRendererFactory(e))}}function Soe(t){const e=We(ot,this).getLayersCount();let n=t.startColumn,r=!!e;for(let i=0;i<e;i++){const o=We(ot,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?We(ot,this).getHeaderTreeNodeData(0,n).columnIndex:n}function Roe(t,e){const n=this.ghostTable.getWidth(e);return t>n?t:n}function Eoe(t,e,n){var r;const{label:i}=(r=We(ot,this).getHeaderTreeNodeData(n,e))!==null&&r!==void 0?r:{label:""};return i}function Toe(t,e){if(t<0)return this.hot.getCell(t,We(ot,this).findLeftMostColumnIndex(t,e),!0)}function _oe(){this.updatePlugin()}function Moe(t,e){e||this.updatePlugin()}function Sd(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 Ooe{constructor(e,n){Sd(this,"hot",void 0),Sd(this,"data",null),Sd(this,"plugin",void 0),Sd(this,"parentReference",new WeakMap),Sd(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=n,this.plugin=e}setData(e){this.data=e}getData(){return this.data}getRawSourceData(){let e=null;return this.plugin.disableCoreAPIModifiers(),e=this.hot.getSourceData(),this.plugin.enableCoreAPIModifiers(),e}updateWithData(e){this.setData(e),this.rewriteCache()}rewriteCache(){this.cache={levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap},fe(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,n,r){this.cache.levels[n]||(this.cache.levels[n]=[],this.cache.levelCount+=1),this.cache.levels[n].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:r,row:this.cache.rows.length-1,level:n}),this.hasChildren(e)&&M(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&&M(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 He(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:(M(r.__children,i=>{n+=1,i.__children&&(n+=this.countChildren(i))}),n)}getRowParent(e){let n;return isNaN(e)?n=e:n=this.getDataObject(e),this.getRowObjectParent(n)}getRowObjectParent(e){return!e||typeof e!="object"?null:this.cache.nodeInfo.get(e).parent}getRowLevel(e){let n=null;return isNaN(e)?n=e:n=this.getDataObject(e),n?this.getRowObjectLevel(n):null}getRowObjectLevel(e){return e==null?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let n=e;return isNaN(n)||(n=this.getDataObject(n)),!!(n.__children&&n.__children.length)}isChild(e){return this.getRowParent(e)!==null}getChild(e,n){var r;return((r=e.__children)===null||r===void 0?void 0:r[n])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var n;let r=e;return isNaN(r)||(r=this.getDataObject(r)),r&&!!r.__children&&((n=r.__children)===null||n===void 0?void 0:n.length)!==0}addChild(e,n){let r=n;this.hot.runHooks("beforeAddChild",e,r);let i=null;e&&(i=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",i+this.countChildren(e)+1,1);let o=e;e||(o=this.mockParent()),o.__children||(o.__children=[]),r||(r=this.mockNode()),o.__children.push(r),this.rewriteCache();const s=this.getRowIndex(r);this.hot.rowIndexMapper.insertIndexes(s,1),this.hot.runHooks("afterCreateRow",s,1),this.hot.runHooks("afterAddChild",e,r)}addChildAtIndex(e,n,r){let i=r,o;if(i||(i=this.mockNode()),this.hot.runHooks("beforeAddChild",e,i,n),e){const a=this.getRowIndex(e)+n+1;this.hot.runHooks("beforeCreateRow",a,1),e.__children.splice(n,null,i),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(a,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",a,1),o=a}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",n,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),o=this.getRowIndex(this.data[n]);i=this.getDataObject(o),this.hot.runHooks("afterAddChild",e,i,n)}addSibling(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"below";const r=this.translateTrimmedRow(e),i=this.getRowParent(r),o=this.getRowIndexWithinParent(r);switch(n){case"below":this.addChildAtIndex(i,o+1,null);break;case"above":this.addChildAtIndex(i,o,null);break}}detachFromParent(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=null;const i=[];Array.isArray(e)?(fe(e[0],e[2],d=>{const f=this.translateTrimmedRow(d);i.push(this.getDataObject(f))}),fe(0,i.length-2,d=>{this.detachFromParent(i[d],!1)}),r=i[i.length-1]):r=e;const o=this.getRowIndex(r),s=this.countChildren(r),a=this.getRowIndexWithinParent(r),l=this.getRowParent(r),u=this.getRowParent(l),c=this.getRowIndex(u);let h=null;if(this.hot.runHooks("beforeDetachChild",l,r),a!=null){const d=Array.from(new Array(o+s+1).keys()).splice(-1*(s+1));if(this.hot.runHooks("beforeRemoveRow",o,s+1,d,this.plugin.pluginName),l.__children.splice(a,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",o,s+1,d,this.plugin.pluginName),u){h=c+this.countChildren(u);const f=this.getChild(u,this.countChildren(u)-1),m=this.getRowIndex(f);this.hot.runHooks("beforeCreateRow",m+1,s+1,this.plugin.pluginName),u.__children.push(r)}else h=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",h-2,s+1,this.plugin.pluginName),this.data.push(r)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",h-2,s+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",l,r,this.getRowIndex(r)),n&&this.hot.render()}filterData(e,n,r){const i=[];M(r,o=>{i.push(this.getDataObject(o))}),M(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=null;do r=this.getRowParent(r),r!==null&&(n=r);while(r!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndex(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 gH(t,e,n){return(e=xoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xoe(t){var e=Aoe(t,"string");return typeof e=="symbol"?e:e+""}function Aoe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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{constructor(e,n){gH(this,"hot",void 0),gH(this,"plugin",void 0),this.hot=n,this.plugin=e}}class Cs extends lT{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(M(l,c=>{c&&s.removeChild(c)}),Y(n,Cs.CSS_CLASSES.indicatorContainer),i){const{rootDocument:c}=this.hot,h=a.cloneNode(!0);s.innerHTML="",fe(0,i-1,()=>{const d=c.createElement("SPAN");Y(d,Cs.CSS_CLASSES.emptyIndicator),s.appendChild(d)}),s.appendChild(h)}if(this.dataManager.hasChildren(o)){const c=this.hot.rootDocument.createElement("DIV");u&&be(c,[fl()]),Y(n,Cs.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(r)?(Y(c,`${Cs.CSS_CLASSES.button} ${Cs.CSS_CLASSES.expandButton}`),u&&be(n,[so(!1)])):(Y(c,`${Cs.CSS_CLASSES.button} ${Cs.CSS_CLASSES.collapseButton}`),u&&be(n,[so(!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 Hoe extends lT{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),M(r.lastCollapsedRows,(a,l)=>{a>=i&&a<o&&(r.lastCollapsedRows[l]=a+s)})},applyStash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;r.collapseMultipleChildren(r.lastCollapsedRows,i),r.lastCollapsedRows=void 0},trimStash:(i,o)=>{fe(i,i+o-1,s=>{const a=this.lastCollapsedRows.indexOf(s);a>-1&&this.lastCollapsedRows.splice(a,1)})}}}collapseChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(o)):(o=this.dataManager.getDataObject(e),s=e),this.dataManager.hasChildren(o)&&M(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=[];M(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 M(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);M(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 M(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);M(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)&&M(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=[];M(e,o=>{i.push(...this.expandChildren(o,!1,!1))}),r&&this.untrimRows(i),n&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),n=[];M(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.collapseMultipleChildren(n),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),n=[];M(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.expandMultipleChildren(n),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{M(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{M(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)&&M(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);Ce(e.target,Cs.CSS_CLASSES.button)&&(this.areChildrenCollapsed(r)?this.expandChildren(r):this.collapseChildren(r),jo(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}function Noe(t,e,n){Doe(t,e),e.set(t,n)}function Doe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function koe(t,e,n){return(e=Loe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Loe(t){var e=$oe(t,"string");return typeof e=="symbol"?e:e+""}function $oe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Foe(t,e){return t.get(Voe(t,e))}function Voe(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 mH=new WeakMap;class Woe extends lT{constructor(){super(...arguments),koe(this,"dataManager",this.plugin.dataManager),Noe(this,mH,{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(qr)},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(Xr)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const r=this.hot.getSelectedLast(),i=this.dataManager.translateTrimmedRow(r[0]);return!this.dataManager.getRowParent(i)||!r||r[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return fe(0,e.items.length-1,r=>{if(r===0)return M(n,(i,o)=>{e.items.splice(r+o,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return fe(0,e.items.length-1,n=>{const r=Foe(mH,this)[e.items[n].key];r!=null&&(e.items[n].callback=r)}),e}}function Sm(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=joe(t,"string");return typeof e=="symbol"?e:e+""}function joe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Uoe{constructor(e){Sm(this,"plugin",void 0),Sm(this,"hot",void 0),Sm(this,"dataManager",void 0),Sm(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 C=this.dataManager.translateTrimmedRow(m);return l=this.shouldAllowMoving(C,a),C}),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 _t(i)&&(Xe(tt`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
|
|
279
|
-
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 zoe(t,e){l$(t,e),e.add(t)}function pH(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 NS(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 ep(t,e){return t.get(un(t,e))}function Gp(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")}const Kp="nestedRows",Koe=300,wH=Kp,qoe="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var Gw=new WeakMap,yc=new WeakMap,pn=new WeakSet;class Xoe extends qe{constructor(){super(...arguments),zoe(this,pn),NS(this,"dataManager",null),NS(this,"headersUI",null),NS(this,"collapsedRowsMap",null),pH(this,Gw,!1),pH(this,yc,!1)}static get PLUGIN_KEY(){return Kp}static get PLUGIN_PRIORITY(){return Koe}isEnabled(){return!!this.hot.getSettings()[Kp]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new $f),this.dataManager=new Ooe(this,this.hot),this.collapsingUI=new Hoe(this,this.hot),this.headersUI=new Cs(this,this.hot),this.contextMenuUI=new Woe(this,this.hot),this.rowMoveController=new Uoe(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return un(pn,e,cse).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 un(pn,e,hse).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 un(pn,e,Qoe).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 un(pn,e,ese).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 un(pn,e,tse).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 un(pn,e,Joe).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 un(pn,e,ise).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 un(pn,e,rse).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 un(pn,e,ose).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 un(pn,e,sse).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 un(pn,e,ase).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 un(pn,e,lse).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 un(pn,e,nse).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 un(pn,e,use).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 un(pn,e,Zoe).call(e,...r)}),this.addHook("beforeLoadData",n=>un(pn,this,vH).call(this,n)),this.addHook("beforeUpdateData",n=>un(pn,this,vH).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:wH,relativeToGroup:pl,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(wH)}disableCoreAPIModifiers(){Gp(yc,this,!0)}enableCoreAPIModifiers(){Gp(yc,this,!1)}onModifyRowData(e){if(!ep(yc,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!ep(yc,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,n,r){return ep(yc,this)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,n,r),!1)}destroy(){super.destroy()}}function Zoe(t,e,n,r){return this.rowMoveController.onBeforeRowMove(t,e,n,r)}function Joe(t,e,n){this.collapsingUI.toggleState(t,e,n)}function Qoe(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),Gp(Gw,this,!0),this.dataManager.getData().slice()}function ese(t){return this.contextMenuUI.appendOptions(t)}function tse(t,e){this.headersUI.appendLevelIndicators(t,e)}function nse(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function rse(t,e,n,r){r!==this.pluginName&&this.hot._registerTimeout(()=>{Gp(Gw,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function ise(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 ose(){this.collapsingUI.collapsedRowsStash.stash()}function sse(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function ase(){this.collapsingUI.collapsedRowsStash.stash()}function lse(t,e,n){this.collapsingUI.collapsedRowsStash.shiftStash(n,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function use(){this.dataManager.rewriteCache()}function cse(){this.headersUI.updateRowHeaderWidth()}function hse(t,e){ep(Gw,this)&&(e.skipRender=!0)}function vH(t){if(!yK(t)){jE(qoe),this.hot.getSettings()[Kp]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function DS(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 gse{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;DS(this,"rootWindow",void 0),DS(this,"prefix",void 0),DS(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(){M(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 mse(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)}ie.getSingleton().register("persistentStateSave");ie.getSingleton().register("persistentStateLoad");ie.getSingleton().register("persistentStateReset");const CH="persistentState",vse=0;class Cse extends qe{constructor(){super(...arguments),mse(this,"storage",void 0)}static get PLUGIN_KEY(){return CH}static get PLUGIN_PRIORITY(){return vse}isEnabled(){return!!this.hot.getSettings()[CH]}enablePlugin(){this.enabled||(this.storage||(this.storage=new gse(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 yse(t,e){bse(t,e),e.add(t)}function bse(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(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)}function yH(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 LS="search",Ese=190,Tse="htSearchResult",_se=function(t,e,n,r,i){t.getCellMeta(e,n).isSearchResult=i},Mse=function(t,e,n){return _t(t)||t===null||!t.toLocaleLowerCase||t.length===0||_t(e)||e===null?!1:e.toString().toLocaleLowerCase(n.locale).indexOf(t.toLocaleLowerCase(n.locale))!==-1};var $S=new WeakSet;class Ise extends qe{constructor(){super(...arguments),yse(this,$S),kS(this,"callback",_se),kS(this,"queryMethod",Mse),kS(this,"searchResultClass",Tse)}static get PLUGIN_KEY(){return LS}static get PLUGIN_PRIORITY(){return Ese}isEnabled(){return this.hot.getSettings()[LS]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[LS];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 yH($S,e,bH).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 yH($S,e,bH).call(e,...i)};this.hot.addHook("beforeRenderer",n),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("beforeRenderer",n)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getCallback(),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getQueryMethod();const i=this.hot.countRows(),o=this.hot.countCols(),s=[],a=this.hot;return fe(0,i-1,l=>{fe(0,o-1,u=>{const c=this.hot.getDataAtCell(l,u),h=this.hot.getCellMeta(l,u),d=h.search.callback||n,m=(h.search.queryMethod||r)(e,c,h);if(m){const C={row:l,col:u,data:c};s.push(C)}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){Ae(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function bH(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 Rm(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=Ose(t,"string");return typeof e=="symbol"?e:e+""}function Ose(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 u${constructor(e){Rm(this,"viewportWidth",void 0),Rm(this,"overwriteColumnWidthFn",void 0),Rm(this,"baseWidths",new Map),Rm(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 xse extends u${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>=Xc?(i.push([d,m]),a+=m):f!==m&&(i.push([d,m]),o.push(d),s-=m)}),s<=Xc){this.stretchedWidths.clear();return}const l=s/a;let u=-1,c=0;i.forEach((h,d)=>{let[f,m]=h,C=m;o.includes(f)||(C=Math.round(m*l)),this.stretchedWidths.set(f,C),u=f,d<i.length-1&&(c+=C)}),this.stretchedWidths.size>1&&this.stretchedWidths.set(u,Math.round(this.viewportWidth-c))}}function SH(t,e,n){Ase(t,e),e.set(t,n)}function Ase(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function FS(t,e){return t.get(c$(t,e))}function Em(t,e,n){return t.set(c$(t,e),n),n}function c$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Tm=new WeakMap,Rd=new WeakMap;class Hse extends u${constructor(){super(...arguments),SH(this,Tm,0),SH(this,Rd,-1)}prepare(e){super.prepare(e),Em(Tm,this,0),Em(Rd,this,-1)}setColumnBaseWidth(e,n){super.setColumnBaseWidth(e,n),Em(Rd,this,e),Em(Tm,this,n)}calculate(){if(FS(Rd,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+FS(Tm,this),0);this.stretchedWidths.set(FS(Rd,this),n)}}function Nse(t,e){h$(t,e),e.add(t)}function _m(t,e,n){h$(t,e),e.set(t,n)}function h$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ft(t,e){return t.get($c(t,e))}function VS(t,e,n){return t.set($c(t,e),n),n}function $c(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Dse="stretchColumns";var On=new WeakMap,bc=new WeakMap,WS=new WeakMap,Mm=new WeakMap,Ed=new WeakSet;class kse{constructor(e){Nse(this,Ed),_m(this,On,void 0),_m(this,bc,void 0),_m(this,WS,new Map([["all",new xse($c(Ed,this,RH).bind(this))],["last",new Hse($c(Ed,this,RH).bind(this))]])),_m(this,Mm,"none"),VS(On,this,e),VS(bc,this,Ft(On,this).columnIndexMapper.createAndRegisterIndexMap(Dse,"physicalIndexToValue"))}useStrategy(e){VS(Mm,this,Ft(WS,this).has(e)?e:"none")}refreshStretching(){if(Ft(Mm,this)==="none"){Ft(bc,this).clear();return}Ft(On,this).batchExecution(()=>{Ft(bc,this).clear();const e=Ft(WS,this).get(Ft(Mm,this));let r=Ft(On,this).view.getViewportWidth();$c(Ed,this,Lse).call(this)&&(r-=vn(Ft(On,this).rootDocument)),e.prepare({viewportWidth:r});for(let i=0;i<Ft(On,this).countCols();i++)Ft(On,this).columnIndexMapper.isHidden(Ft(On,this).toPhysicalColumn(i))||e.setColumnBaseWidth(i,$c(Ed,this,$se).call(this,i));e.calculate(),e.getWidths().forEach(i=>{let[o,s]=i;Ft(bc,this).setValueAtIndex(Ft(On,this).toPhysicalColumn(o),s)})},!0)}getStretchedWidth(e){return Ft(bc,this).getValueAtIndex(Ft(On,this).toPhysicalColumn(e))}}function Lse(){const{view:t}=Ft(On,this);if(t.isVerticallyScrollableByWindow())return!1;const e=t.getViewportHeight(),n=Ft(On,this).countRows(),r=t.getStylesHandler().getDefaultRowHeight();let i=0,o=!1;for(let a=0;a<n;a++){var s;if(i+=((s=Ft(On,this).getRowHeight(a))!==null&&s!==void 0?s:r)+(a===0?1:0),i>e){o=!0;break}}return o}function $se(t){var e;return(e=Ft(On,this).getColWidth(t,"StretchColumns"))!==null&&e!==void 0?e:Xc}function RH(t,e){return Ft(On,this).runHooks("beforeStretchingColumnWidth",t,e)}function Fse(t,e){d$(t,e),e.add(t)}function BS(t,e,n){d$(t,e),e.set(t,n)}function d$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jS(t,e,n){return t.set(qp(t,e),n),n}function Js(t,e){return t.get(qp(t,e))}function qp(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 Vse="stretchColumns",Wse=155;var xc=new WeakMap,Im=new WeakMap,Td=new WeakMap,US=new WeakSet;class Bse extends qe{constructor(){super(...arguments),Fse(this,US),BS(this,xc,new kse(this.hot)),BS(this,Im,null),BS(this,Td,new ResizeObserver(e=>{requestAnimationFrame(()=>{var n;(n=this.hot)!==null&&n!==void 0&&n.view.isHorizontallyScrollableByWindow()&&e.forEach(r=>{let{contentRect:i}=r;Js(Im,this)!==null&&Js(Im,this)!==i.width&&(this.hot.refreshDimensions(),this.hot.view.adjustElementsSize()),jS(Im,this,i.width)})})}))}static get PLUGIN_KEY(){return Vse}static get PLUGIN_PRIORITY(){return Wse}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(Js(xc,this).useStrategy(this.hot.getSettings().stretchH),Js(Td,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 qp(US,e,Use).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 qp(US,e,jse).call(e,...r)},10),super.enablePlugin())}updatePlugin(){Js(xc,this).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),Js(Td,this).unobserve(this.hot.rootElement)}getColumnWidth(e){return Js(xc,this).getStretchedWidth(e)}destroy(){Js(Td,this).disconnect(),jS(Td,this,null),jS(xc,this,null),super.destroy()}}function jse(t,e,n){if(n===this.pluginName)return;const r=this.getColumnWidth(e);return typeof r=="number"?r:t}function Use(t){t&&Js(xc,this).refreshStretching()}function zse(t,e){Yse(t,e),e.add(t)}function Yse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pm(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=Kse(t,"string");return typeof e=="symbol"?e:e+""}function Kse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 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")}const qse="touchScroll",Xse=200;var Om=new WeakSet;class Zse extends qe{constructor(){super(...arguments),zse(this,Om),Pm(this,"scrollbars",[]),Pm(this,"clones",[]),Pm(this,"lockedCollection",!1),Pm(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return qse}static get PLUGIN_PRIORITY(){return Xse}static get SETTING_KEYS(){return!0}isEnabled(){return PN()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>zS(Om,this,Jse).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>zS(Om,this,Qse).call(this)),this.addHook("afterMomentumScroll",()=>zS(Om,this,eae).call(this))}}function Jse(){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 Qse(){this.freezeOverlays=!0,M(this.clones,t=>{Y(t,"hide-tween")})}function eae(){this.freezeOverlays=!1,M(this.clones,t=>{we(t,"hide-tween"),Y(t,"show-tween")}),this.hot._registerTimeout(()=>{M(this.clones,t=>{we(t,"show-tween")})},400),M(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function tae(t,e){nae(t,e),e.add(t)}function nae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rae(t,e,n){return(e=iae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iae(t){var e=oae(t,"string");return typeof e=="symbol"?e:e+""}function oae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 sae(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 tp="trimRows",aae=330;var EH=new WeakSet;class lae extends qe{constructor(){super(...arguments),tae(this,EH),rae(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return tp}static get PLUGIN_PRIORITY(){return aae}isEnabled(){return!!this.hot.getSettings()[tp]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new $f),this.trimmedRowsMap.addLocalHook("init",()=>sae(EH,this,uae).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[tp];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),M(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(()=>{M(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&&(M(e,l=>{o[l]=!1}),i=mr(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 uae(){const t=this.hot.getSettings()[tp];Array.isArray(t)&&this.hot.batchExecution(()=>{M(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}function cae(t,e,n){return(e=hae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hae(t){var e=dae(t,"string");return typeof e=="symbol"?e:e+""}function dae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 fo{constructor(e){cae(this,"actionType",""),this.actionType=e}undo(){throw new Error("Not implemented")}redo(){throw new Error("Not implemented")}}function xm(t,e,n){return(e=fae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fae(t){var e=gae(t,"string");return typeof e=="symbol"?e:e+""}function gae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class uT extends fo{constructor(e){let{stateBefore:n,range:r,type:i,alignment:o}=e;super("cell_alignment"),xm(this,"stateBefore",void 0),xm(this,"range",void 0),xm(this,"type",void 0),xm(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 uT({stateBefore:r,range:i,type:o,alignment:s}))})}undo(e,n){M(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){ja(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 TH(t,e,n){return(e=mae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mae(t){var e=pae(t,"string");return typeof e=="symbol"?e:e+""}function pae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 fo{constructor(e){let{columns:n,finalIndex:r}=e;super("col_move"),TH(this,"columns",void 0),TH(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 cT({columns:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),rT(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 _H(t,e,n){return(e=wae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wae(t){var e=vae(t,"string");return typeof e=="symbol"?e:e+""}function vae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 fo{constructor(e){let{currentSortState:n,newSortState:r}=e;super("col_sort"),_H(this,"previousSortState",void 0),_H(this,"nextSortState",void 0),this.previousSortState=n,this.nextSortState=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnSort",(r,i,o)=>{o&&n.done(()=>new hT({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 MH(t,e,n){return(e=Cae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cae(t){var e=yae(t,"string");return typeof e=="symbol"?e:e+""}function yae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 fo{constructor(e){let{index:n,amount:r}=e;super("insert_col"),MH(this,"index",void 0),MH(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateCol",(r,i,o)=>{n.done(()=>new dT({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 IH(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 fT extends fo{constructor(e){let{index:n,amount:r}=e;super("insert_row"),IH(this,"index",void 0),IH(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateRow",(r,i,o)=>{n.done(()=>new fT({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 Am(t,e,n){return(e=Rae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rae(t){var e=Eae(t,"string");return typeof e=="symbol"?e:e+""}function Eae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gT extends fo{constructor(e){let{changes:n,selected:r,countCols:i,countRows:o}=e;super("change"),Am(this,"changes",void 0),Am(this,"selected",void 0),Am(this,"countCols",void 0),Am(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 gT({changes:l,selected:u,countCols:e.countCols(),countRows:e.countRows()})};n.done(a,i)})}undo(e,n){const r=Kn(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=Kn(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 PH(t,e,n){return(e=Tae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tae(t){var e=_ae(t,"string");return typeof e=="symbol"?e:e+""}function _ae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 fo{constructor(e){let{conditionsStack:n,previousConditionsStack:r}=e;super("filter"),PH(this,"conditionsStack",void 0),PH(this,"previousConditionsStack",void 0),this.conditionsStack=n,this.previousConditionsStack=r}static startRegisteringEvents(e,n){e.addHook("beforeFilter",(r,i)=>{n.done(()=>new mT({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 Mae(t,e,n){return(e=Iae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Iae(t){var e=Pae(t,"string");return typeof e=="symbol"?e:e+""}function Pae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 fo{constructor(e){let{data:n,cellRange:r}=e;super("merge_cells"),Mae(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 pT({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 OH={},xH;function Oae(){if(xH)return OH;xH=1;var t=dt(),e=lh(),n=t1();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}}),OH}Oae();function f$(t,e,n,r,i){const o=["visualRow","visualCol","row","col","prop"],s=o.length,a=[];return fe(r,i,l=>{fe(e,n,u=>{const c=t.getCellMeta(u,l);if(Object.keys(c).length!==s){const h=Object.fromEntries(Object.entries(c).filter(d=>{let[f]=d;return o.includes(f)===!1}));a.push([c.visualRow,c.visualCol,h])}})}),a}function Gs(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=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)}class wT extends fo{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"),Gs(this,"index",void 0),Gs(this,"indexes",void 0),Gs(this,"data",void 0),Gs(this,"amount",void 0),Gs(this,"headers",void 0),Gs(this,"columnPositions",void 0),Gs(this,"rowPositions",void 0),Gs(this,"fixedColumnsStart",void 0),Gs(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=[];fe(l.length-1,w=>{const S=[],R=l[w];fe(u,c,I=>{S.push(R[e.toPhysicalColumn(I)])}),h.push(S)}),fe(i-1,w=>{f.push(e.toPhysicalColumn(u+w))}),Array.isArray(e.getSettings().colHeaders)&&fe(i-1,w=>{d.push(e.getSettings().colHeaders[e.toPhysicalColumn(u+w)]||null)});const m=e.columnIndexMapper.getIndexesSequence(),C=e.rowIndexMapper.getIndexesSequence();return new wT({index:u,indexes:f,data:h,amount:i,headers:d,columnPositions:m,rowPositions:C,fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:f$(e,0,e.countRows(),u,c)})};n.done(a,s)})}undo(e,n){const r=e.getSettings();r.fixedColumnsStart=this.fixedColumnsStart;const i=this.indexes.slice(0).sort(),o=(c,h,d)=>d[this.indexes.indexOf(i[h])],s=this.data.length,a=[];for(let c=0;c<s;c++)a.push(je(this.data[c],o));const l=je(this.headers,o),u=[];e.alter("insert_col_start",this.indexes[0],this.indexes.length,"UndoRedo.undo"),M(e.getSourceDataArray(),(c,h)=>{M(i,(d,f)=>{c[d]=a[h][f],u.push([h,d,c[d]])})}),e.setSourceDataAtCell(u,void 0,void 0,"UndoRedo.undo"),typeof this.headers<"u"&&M(l,(c,h)=>{e.getSettings().colHeaders[i[h]]=c}),this.removedCellMetas.forEach(c=>{let[h,d,f]=c;e.setCellMetaObject(h,d,f)}),e.batchExecution(()=>{e.rowIndexMapper.setIndexesSequence(this.rowPositions),e.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),e.addHookOnce("afterViewRender",n),e.render()}redo(e,n){e.addHookOnce("afterRemoveCol",n),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}}function Sc(t,e,n){return(e=Hae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hae(t){var e=Nae(t,"string");return typeof e=="symbol"?e:e+""}function Nae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 vT extends fo{constructor(e){let{index:n,data:r,fixedRowsBottom:i,fixedRowsTop:o,rowIndexesSequence:s,removedCellMetas:a}=e;super("remove_row"),Sc(this,"index",void 0),Sc(this,"data",void 0),Sc(this,"fixedRowsBottom",void 0),Sc(this,"fixedRowsTop",void 0),Sc(this,"rowIndexesSequence",void 0),Sc(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=Kn(e.getSourceData(l,0,l+i-1,e.countSourceCols()-1));return new vT({index:l,data:c,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:f$(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.alter("insert_row_above",this.index,this.data.length,"UndoRedo.undo"),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"),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence)}redo(e,n){e.addHookOnce("afterRemoveRow",n),e.alter("remove_row",this.index,this.data.length,"UndoRedo.redo")}}function AH(t,e,n){return(e=Dae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dae(t){var e=kae(t,"string");return typeof e=="symbol"?e:e+""}function kae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class CT extends fo{constructor(e){let{rows:n,finalIndex:r}=e;super("row_move"),AH(this,"rows",void 0),AH(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 CT({rows:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),rT(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 Lae(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 yT extends fo{constructor(e){let{cellRange:n}=e;super("unmerge_cells"),Lae(this,"cellRange",void 0),this.cellRange=n}static startRegisteringEvents(e,n){e.addHook("afterUnmergeCells",(r,i)=>{i||n.done(()=>new yT({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 Vae(t,e){[uT,cT,hT,dT,fT,gT,mT,pT,wT,vT,CT,yT].forEach(n=>n.startRegisteringEvents(t,e))}function Wae(t,e){Bae(t,e),e.add(t)}function Bae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function YS(t,e,n){return(e=jae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jae(t){var e=Uae(t,"string");return typeof e=="symbol"?e:e+""}function Uae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 GS(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="undoRedo",zae="undoRedo",Yae=1e3;ie.getSingleton().register("beforeUndo");ie.getSingleton().register("afterUndo");ie.getSingleton().register("beforeRedo");ie.getSingleton().register("afterRedo");const NH=new Set;var Hm=new WeakSet;class Gae extends qe{static get PLUGIN_KEY(){return zae}static get PLUGIN_PRIORITY(){return Yae}static get SETTING_KEYS(){return!0}constructor(e){super(e),Wae(this,Hm),YS(this,"doneActions",[]),YS(this,"undoneActions",[]),YS(this,"ignoreNewActions",!1),Vae(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 GS(Hm,e,Kae).call(e,...r)}),this.registerShortcuts(),GS(Hm,this,qae).call(this),super.enablePlugin())}disablePlugin(){super.disablePlugin(),this.clear(),this.unregisterShortcuts(),GS(Hm,this,Xae).call(this)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("grid"),i={runOnlyIf:o=>!o.altKey,group:HH};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(HH)}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=Kn(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=Kn(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 Kae(t,e){e==="loadData"&&this.clear()}function qae(){const t=e=>{NH.has(e)||(Xe(tt`The "${e}" method is deprecated and it will be removed\x20
|
|
280
|
-
from the Core API in the future. Please use the method from the UndoRedo plugin\x20
|
|
281
|
-
(e.g. \`hotInstance.getPlugin("undoRedo").${e}()\`).`),NH.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 Xae(){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 Zae(){Ye(Fd),Ye(m8),Ye(Vd),Ye(K8),Ye(n7),Ye(kk),Ye(Z7),Ye(DZ),Ye(Ww),Ye(z5),Ye(wJ),Ye(TJ),Ye(Uw),Ye(QJ),Ye(Kee),Ye(_te),Ye(Qte),Ye(hne),Ye(Rne),Ye(Nne),Ye(Une),Ye(lre),Ye(wre),Ye(eie),Ye(Hie),Ye($ie),Ye(coe),Ye(Xoe),Ye(Cse),Ye(Ise),Ye(Bse),Ye(Zse),Ye(lae),Ye(Gae)}function Jae(){F9(),l6(),w6(),L6(),Zae()}/**
|
|
282
|
-
* @preserve
|
|
283
|
-
* Authors: Stefan Salzl
|
|
284
|
-
* Last updated: Jan 08, 2018
|
|
285
|
-
*
|
|
286
|
-
* Description: Definition file for German - Germany language-country.
|
|
287
|
-
*/const Qae={languageCode:"de-DE",[pr]:"Zeile einfügen oberhalb",[wr]:"Zeile einfügen unterhalb",[vr]:"Spalte einfügen links",[Cr]:"Spalte einfügen rechts",[yr]:["Zeile löschen","Zeilen löschen"],[br]:["Spalte löschen","Spalten löschen"],[Sr]:"Rückgangig",[Rr]:"Wiederholen",[qn]:"Nur Lesezugriff",[Er]:"Spalteninhalt löschen",[Dr]:"Ausrichtung",[kr]:"Linksbündig",[Lr]:"Zentriert",[$r]:"Rechtsbündig",[Fr]:"Blocksatz",[Vr]:"Oben",[Wr]:"Mitte",[Br]:"Unten",[Mr]:"Spalte fixieren",[Ir]:"Spaltenfixierung aufheben",[jr]:"Rahmen",[Ur]:"Oben",[zr]:"Rechts",[Yr]:"Unten",[Gr]:"Links",[Kr]:"Kein Rahmen",[xr]:"Kommentar hinzufügen",[Ar]:"Kommentar bearbeiten",[Hr]:"Kommentar löschen",[Nr]:"Schreibschutz Kommentar",[Pr]:"Zellen verbinden",[Or]:"Zellen teilen",[Tr]:"Kopieren",[_r]:"Ausschneiden",[qr]:"Nachfolgerzeile einfügen",[Xr]:"Von Vorgängerzeile abkoppeln",[Zr]:["Spalte ausblenden","Spalten ausblenden"],[Jr]:["Spalte einblenden","Spalten einblenden"],[Qr]:["Zeile ausblenden","Zeilen ausblenden"],[ei]:["Zeile einblenden","Zeilen einblenden"],[Jn]:"Kein Filter",[ti]:"Ist leer",[ni]:"Ist nicht leer",[ri]:"Ist gleich",[ii]:"Ist ungleich",[oi]:"Beginnt mit",[si]:"Endet mit",[ai]:"Enthält",[li]:"Enthält nicht",[ui]:"Größer als",[ci]:"Größer gleich",[hi]:"Kleiner als",[di]:"Kleiner gleich",[fi]:"Zwischen",[gi]:"Außerhalb",[mi]:"Nach",[pi]:"Vor",[wi]:"Heute",[vi]:"Morgen",[Ci]:"Gestern",[Xn]:"Leere Zellen",[yi]:"Per Bedingung filtern",[bi]:"Nach Zahlen filtern",[Si]:"Und",[Qn]:"Oder",[Ri]:"Alles auswählen",[Ei]:"Auswahl aufheben",[Ti]:"OK",[_i]:"Abbrechen",[Mi]:"Suchen",[Ii]:"Wert",[Pi]:"Alternativwert"};/**
|
|
288
|
-
* @preserve
|
|
289
|
-
* Authors: Handsoncode, Enrique Enciso
|
|
290
|
-
* Last updated: Nov 18, 2022
|
|
291
|
-
*
|
|
292
|
-
* Description: Definition file for Spanish - Mexico language-country.
|
|
293
|
-
*/const ele={languageCode:"es-MX",[pr]:"Insertar fila arriba",[wr]:"Insertar fila abajo",[vr]:"Insertar columna izquierda",[Cr]:"Insertar columna derecha",[yr]:["Eliminar fila","Eliminar filas"],[br]:["Eliminar columna","Eliminar columnas"],[Sr]:"Deshacer",[Rr]:"Rehacer",[qn]:"Solo lectura",[Er]:"Limpiar columna",[Dr]:"Alineación",[kr]:"Izquierda",[Lr]:"Centro",[$r]:"Derecha",[Fr]:"Justificar",[Vr]:"Superior",[Wr]:"Medio",[Br]:"Inferior",[Mr]:"Congelar columna",[Ir]:"Descongelar columna",[jr]:"Bordes",[Ur]:"Superior",[zr]:"Derecho",[Yr]:"Inferior",[Gr]:"Izquierdo",[Kr]:"Quitar borde(s)",[xr]:"Agregar comentario",[Ar]:"Editar comentario",[Hr]:"Borrar comentario",[Nr]:"Comentario Solo de lectura",[Pr]:"Unir celdas",[Or]:"Separar celdas",[Tr]:"Copiar",[Sa]:["Copiar con encabezado","Copiar con encabezados"],[Ra]:["Copiar con encabezado de grupo","Copiar con encabezados de grupos"],[Ea]:["Copiar solo el encabezado","Copiar solo los encabezados"],[_r]:"Cortar",[qr]:"Insertar fila hija",[Xr]:"Separar del padre",[Zr]:["Esconder columna","Esconder columnas"],[Jr]:["Mostrar columna","Mostrar columnas"],[Qr]:["Esconder fila","Esconder filas"],[ei]:["Mostrar fila","Mostrar filas"],[Jn]:"Ninguna",[ti]:"Está vacío",[ni]:"No está vacío",[ri]:"Es igual a",[ii]:"No es igual a",[oi]:"Comienza con",[si]:"Termina con",[ai]:"Contiene",[li]:"No contiene",[ui]:"Mayor que",[ci]:"Mayor o igual que",[hi]:"Menor que",[di]:"Menor o igual que",[fi]:"Es entre",[gi]:"No es entre",[mi]:"Después",[pi]:"Antes",[wi]:"Hoy",[vi]:"Mañana",[Ci]:"Ayer",[Xn]:"Celdas vacías",[yi]:"Filtrar por condición",[bi]:"Filtrar por valor",[Si]:"Y",[Qn]:"O",[Ri]:"Seleccionar todo",[Ei]:"Borrar",[Ti]:"OK",[_i]:"Cancelar",[Mi]:"Buscar",[Ii]:"Valor",[Pi]:"Valor secundario"};/**
|
|
294
|
-
* @preserve
|
|
295
|
-
* Authors: Stefan Salzl, Thomas Senn
|
|
296
|
-
* Last updated: Feb 05, 2018
|
|
297
|
-
*
|
|
298
|
-
* Description: Definition file for French - France language-country.
|
|
299
|
-
*/const tle={languageCode:"fr-FR",[pr]:"Insérer une ligne en haut",[wr]:"Insérer une ligne en bas",[vr]:"Insérer une colonne à gauche",[Cr]:"Insérer une colonne à droite",[yr]:["Supprimer une ligne","Supprimer les lignes"],[br]:["Supprimer une colonne","Supprimer les colonnes"],[Sr]:"Annuler",[Rr]:"Rétablir",[qn]:"Lecture seule",[Er]:"Effacer la colonne",[Dr]:"Alignement",[kr]:"Gauche",[Lr]:"Centre",[$r]:"Droite",[Fr]:"Justifié",[Vr]:"En haut",[Wr]:"Au milieu",[Br]:"En bas",[Mr]:"Figer la colonne",[Ir]:"Libérer la colonne",[jr]:"Bordures",[Ur]:"Supérieure",[zr]:"Droite",[Yr]:"Inférieure",[Gr]:"Gauche",[Kr]:"Pas de bordure",[xr]:"Ajouter commentaire",[Ar]:"Modifier commentaire",[Hr]:"Supprimer commentaire",[Nr]:"Commentaire en lecture seule",[Pr]:"Fusionner les cellules",[Or]:"Séparer les cellules",[Tr]:"Copier",[_r]:"Couper",[qr]:"Insérer une sous-ligne",[Xr]:"Détacher de la ligne précédente",[Zr]:["Masquer colonne","Masquer les colonnes"],[Jr]:["Afficher colonne","Afficher les colonnes"],[Qr]:["Masquer ligne","Masquer les lignes"],[ei]:["Afficher ligne","Afficher les lignes"],[Jn]:"Aucun",[ti]:"Est vide",[ni]:"N'est pas vide",[ri]:"Egal à",[ii]:"Est différent de",[oi]:"Commence par",[si]:"Finit par",[ai]:"Contient",[li]:"Ne contient pas",[ui]:"Supérieur à",[ci]:"Supérieur ou égal à",[hi]:"Inférieur à",[di]:"Inférieur ou égal à",[fi]:"Est compris entre",[gi]:"N'est pas compris entre",[mi]:"Après le",[pi]:"Avant le",[wi]:"Aujourd'hui",[vi]:"Demain",[Ci]:"Hier",[Xn]:"Cellules vides",[yi]:"Filtrer par conditions",[bi]:"Filtrer par valeurs",[Si]:"Et",[Qn]:"Ou",[Ri]:"Tout sélectionner",[Ei]:"Effacer la sélection",[Ti]:"OK",[_i]:"Annuler",[Mi]:"Chercher",[Ii]:"Valeur",[Pi]:"Valeur de remplacement"};/**
|
|
300
|
-
* @preserve
|
|
301
|
-
* Authors: Andrea Cattaneo
|
|
302
|
-
* Last updated: Sep 14, 2018
|
|
303
|
-
*
|
|
304
|
-
* Description: Definition file for Italian - Italy language-country.
|
|
305
|
-
*/const nle={languageCode:"it-IT",[pr]:"Inserisci riga sopra",[wr]:"Inserisci riga sotto",[vr]:"Inserisci colonna a sinistra",[Cr]:"Inserisci colonna a destra",[yr]:["Rimuovi riga","Rimuovi righe"],[br]:["Rimuovi colonna","Rimuovi colonne"],[Sr]:"Annulla",[Rr]:"Ripeti",[qn]:"Sola lettura",[Er]:"Svuota colonna",[Dr]:"Allineamento",[kr]:"Sinistra",[Lr]:"Centro",[$r]:"Destra",[Fr]:"Giustificato",[Vr]:"In alto",[Wr]:"A metà",[Br]:"In basso",[Mr]:"Blocca colonna",[Ir]:"Sblocca colonna",[jr]:"Bordi",[Ur]:"Sopra",[zr]:"Destra",[Yr]:"Sotto",[Gr]:"Sinistra",[Kr]:"Rimuovi bordo(i)",[xr]:"Aggiungi commento",[Ar]:"Modifica commento",[Hr]:"Rimuovi commento",[Nr]:"Commento in sola lettura",[Pr]:"Unisci celle",[Or]:"Separa celle",[Tr]:"Copia",[Sa]:["Copia con intestazione","Copia con intestazioni"],[Ra]:"Copia con intestazione completa",[Ea]:["Copia solo intestazione","Copia solo intestazioni"],[_r]:"Taglia",[qr]:"Inserisci riga figlia",[Xr]:"Scollega da riga madre",[Zr]:["Nascondi colonna","Nascondi colonne"],[Jr]:["Mostra colonna","Mostra colonne"],[Qr]:["Nascondi riga","Nascondi righe"],[ei]:["Mostra riga","Mostra righe"],[Jn]:"Nessuna",[ti]:"È vuoto",[ni]:"Non è vuoto",[ri]:"È uguale a",[ii]:"È diverso da",[oi]:"Inizia con",[si]:"Termina con",[ai]:"Contiene",[li]:"Non contiene",[ui]:"Maggiore",[ci]:"Maggiore o uguale",[hi]:"Minore",[di]:"Minore o uguale",[fi]:"È compreso tra",[gi]:"Non è compreso tra",[mi]:"Dopo",[pi]:"Prima",[wi]:"Oggi",[vi]:"Domani",[Ci]:"Ieri",[Xn]:"Celle vuote",[yi]:"Filtra per condizione",[bi]:"Filtra per valore",[Si]:"E",[Qn]:"O",[Ri]:"Seleziona tutto",[Ei]:"Pulisci",[Ti]:"OK",[_i]:"Annulla",[Mi]:"Cerca",[Ii]:"Valore",[Pi]:"Sostituisci con"};/**
|
|
306
|
-
* @preserve
|
|
307
|
-
* Authors: hand-dot
|
|
308
|
-
* Last updated: Jan 9, 2023
|
|
309
|
-
*
|
|
310
|
-
* Description: Definition file for Japanese - Japan language-country.
|
|
311
|
-
*/const rle={languageCode:"ja-JP",[pr]:"行を上に挿入",[wr]:"行を下に挿入",[vr]:"列を左に挿入",[Cr]:"列を右に挿入",[yr]:["行を削除","行を削除"],[br]:["列を削除","列を削除"],[Sr]:"元に戻す",[Rr]:"やり直し",[qn]:"読み取り専用",[Er]:"列をクリア",[Dr]:"配置",[kr]:"左揃え",[Lr]:"中央揃え",[$r]:"右揃え",[Fr]:"両端揃え",[Vr]:"上揃え",[Wr]:"中央揃え(垂直)",[Br]:"下揃え",[Mr]:"列を固定",[Ir]:"列の固定を解除",[jr]:"枠線",[Ur]:"上",[zr]:"右",[Yr]:"下",[Gr]:"左",[Kr]:"枠線を削除",[xr]:"コメントを追加",[Ar]:"コメントを編集",[Hr]:"コメントを削除",[Nr]:"読み取り専用コメント",[Pr]:"セルを結合",[Or]:"セルの結合を解除",[Tr]:"コピー",[Sa]:["ヘッダ付きでコピー","ヘッダ付きでコピー"],[Ra]:["グループヘッダ付きでコピー","グループヘッダ付きでコピー"],[Ea]:["ヘッダのみコピー","ヘッダのみコピー"],[_r]:"切り取り",[qr]:"子の行を挿入",[Xr]:"親の行と切り離す",[Zr]:["列を非表示","列を非表示"],[Jr]:["列を表示","列を表示"],[Qr]:["行を非表示","行を非表示"],[ei]:["行を表示","行を表示"],[Jn]:"なし",[ti]:"空白",[ni]:"空白ではない",[ri]:"次と等しい",[ii]:"次と等しくない",[oi]:"次で始まる",[si]:"次で終わる",[ai]:"次を含む",[li]:"次を含まない",[ui]:"次より大きい",[ci]:"以上",[hi]:"次より小さい",[di]:"以下",[fi]:"次の間にある",[gi]:"次の間にない",[mi]:"次より後の日付",[pi]:"次より前の日付",[wi]:"今日",[vi]:"明日",[Ci]:"昨日",[Xn]:"空白のセル",[yi]:"条件でフィルタ",[bi]:"値でフィルタ",[Si]:"かつ",[Qn]:"もしくは",[Ri]:"すべて選択",[Ei]:"クリア",[Ti]:"OK",[_i]:"キャンセル",[Mi]:"検索",[Ii]:"値",[Pi]:"値2"};/**
|
|
312
|
-
* @preserve
|
|
313
|
-
* Authors: Hwang, Gun-gu
|
|
314
|
-
* Last updated: Aug 20, 2018
|
|
315
|
-
*
|
|
316
|
-
* Description: Definition file for Korean - Korea language-country.
|
|
317
|
-
*/const ile={languageCode:"ko-KR",[pr]:"위쪽에 행 삽입",[wr]:"아래쪽에 행 삽입",[vr]:"왼쪽에 열 삽입",[Cr]:"오른쪽에 열 삽입",[yr]:["행 삭제","여러 행 삭제"],[br]:["열 삭제","여러 열 삭제"],[Sr]:"되돌리기",[Rr]:"다시하기",[qn]:"읽기 전용",[Er]:"열 지우기",[Dr]:"정렬",[kr]:"왼쪽",[Lr]:"중앙",[$r]:"오른쪽",[Fr]:"자동",[Vr]:"위쪽",[Wr]:"가운데",[Br]:"아래쪽",[Mr]:"열 고정",[Ir]:"열 고정 해제",[jr]:"테두리",[Ur]:"위쪽",[zr]:"오른쪽",[Yr]:"아래쪽",[Gr]:"왼쪽",[Kr]:"테두리 지우기",[xr]:"댓글 달기",[Ar]:"댓글 편집",[Hr]:"댓글 삭제",[Nr]:"읽기 전용 댓글",[Pr]:"셀 병합",[Or]:"셀 병합 해제",[Tr]:"복사",[_r]:"잘라내기",[qr]:"자녀 행 추가",[Xr]:"부모행에서 제거",[Zr]:["열 숨기기","여러 열 숨기기"],[Jr]:["열 숨기기 해제","여러 열 숨기기 해제"],[Qr]:["행 숨기기","여러 행 숨기기"],[ei]:["행 숨기기 해제","여러 행 숨기기 해제"],[Jn]:"조건없음",[ti]:"비어있음",[ni]:"비어있지 않음",[ri]:"같",[ii]:"같지 않음",[oi]:"시작 문자",[si]:"끝 문자",[ai]:"포함",[li]:"포함하지 않음",[ui]:"보다 큼",[ci]:"크거나 같음",[hi]:"보다 작",[di]:"작거나 같음",[fi]:"사이",[gi]:"사이 제외",[mi]:"다음",[pi]:"전",[wi]:"오늘",[vi]:"내일",[Ci]:"어제",[Xn]:"공란",[yi]:"조건부 필터",[bi]:"값 필터",[Si]:"그리고",[Qn]:"또는",[Ri]:"전체선택",[Ei]:"지우기",[Ti]:"확인",[_i]:"취소",[Mi]:"찾기",[Ii]:"값",[Pi]:"두번째 값"};/**
|
|
318
|
-
* @preserve
|
|
319
|
-
* Authors: Tomas Rapkauskas, Anton Brouwer, webjazznl
|
|
320
|
-
* Last updated: Dec 5, 2022
|
|
321
|
-
*
|
|
322
|
-
* Description: Definition file for Dutch - The Netherlands language-country.
|
|
323
|
-
*/const ole={languageCode:"nl-NL",[pr]:"Rij boven invoegen",[wr]:"Rij onder invoegen",[vr]:"Kolom links invoegen",[Cr]:"Kolom rechts invoegen",[yr]:["Rij verwijderen","Rijen verwijderen"],[br]:["Kolom verwijderen","Kolommen verwijderen"],[Sr]:"Ongedaan maken",[Rr]:"Opnieuw uitvoeren",[qn]:"Alleen lezen",[Er]:"Kolom leegmaken",[Dr]:"Uitlijning",[kr]:"Links",[Lr]:"Gecentreerd",[$r]:"Rechts",[Fr]:"Uitvullen",[Vr]:"Boven",[Wr]:"Midden",[Br]:"Onder",[Mr]:"Kolom blokkeren",[Ir]:"Kolom blokkering opheffen",[jr]:"Randen",[Ur]:"Boven",[zr]:"Rechts",[Yr]:"Onder",[Gr]:"Links",[Kr]:"Rand(en) verwijderen",[xr]:"Opmerking toevoegen",[Ar]:"Opmerking bewerken",[Hr]:"Opmerking verwijderen",[Nr]:"Opmerking Alleen-lezen",[Pr]:"Cellen samenvoegen",[Or]:"Samenvoeging van cellen opheffen",[Tr]:"Kopiëren",[Sa]:["Kopiëren met koptekst","Kopiëren met kopteksten"],[Ra]:["Kopiëren met groepskoptekst","Kopiëren met groepskopteksten"],[Ea]:["Kopiëren koptekst","Kopiëren kopteksten"],[_r]:"Knippen",[qr]:"Geneste rij invoegen",[Xr]:"Geneste rij ontkoppelen",[Zr]:["Kolom verbergen","Kolommen verbergen"],[Jr]:["Kolom zichbaar maken","Kolommen zichtbaar maken"],[Qr]:["Rij verbergen","Rijen verbergen"],[ei]:["Rij zichtbaar maken","Rijen zichtbaar maken"],[Jn]:"Geen",[ti]:"Is leeg",[ni]:"Is niet leeg",[ri]:"Is gelijk aan",[ii]:"Is niet gelijk aan",[oi]:"Begint met",[si]:"Eindigt op",[ai]:"Bevat",[li]:"Bevat niet",[ui]:"Is groter",[ci]:"Is groter of gelijk aan",[hi]:"Is kleiner dan",[di]:"Is kleiner dan of gelijk aan",[fi]:"Is tussen",[gi]:"Ligt niet tussen",[mi]:"Na",[pi]:"Voor",[wi]:"Vandaag",[vi]:"Morgen",[Ci]:"Gisteren",[Xn]:"Cellen leegmaken",[yi]:"Filteren op conditie",[bi]:"Filteren op waarde",[Si]:"En",[Qn]:"Of",[Ri]:"Alles selecteren",[Ei]:"Leeg maken",[Ti]:"OK",[_i]:"Annuleren",[Mi]:"Zoeken",[Ii]:"Waarde",[Pi]:"Tweede waarde"};/**
|
|
324
|
-
* @preserve
|
|
325
|
-
* Authors: Handsoncode
|
|
326
|
-
* Last updated: Dec 5, 2022
|
|
327
|
-
*
|
|
328
|
-
* Description: Definition file for Polish - Poland language-country.
|
|
329
|
-
*/const sle={languageCode:"pl-PL",[Ew]:"Brak dostępnych opcji",[pr]:"Wstaw wiersz powyżej",[wr]:"Wstaw wiersz poniżej",[vr]:"Wstaw kolumnę z lewej",[Cr]:"Wstaw kolumnę z prawej",[yr]:["Usuń wiersz","Usuń wiersze"],[br]:["Usuń kolumnę","Usuń kolumny"],[Sr]:"Cofnij",[Rr]:"Ponów",[qn]:"Tylko do odczytu",[Er]:"Wyczyść kolumnę",[Dr]:"Wyrównanie",[kr]:"Do lewej",[Lr]:"Do środka",[$r]:"Do prawej",[Fr]:"Wyjustuj",[Vr]:"Do góry",[Wr]:"Wyśrodkuj",[Br]:"Do dołu",[Mr]:"Zablokuj kolumnę",[Ir]:"Odblokuj kolumnę",[jr]:"Obramowanie",[Ur]:"Krawędź górna",[zr]:"Krawędź prawa",[Yr]:"Krawędź dolna",[Gr]:"Krawędź lewa",[Kr]:"Usuń obramowanie(a)",[xr]:"Dodaj komentarz",[Ar]:"Edytuj komentarz",[Hr]:"Usuń komentarz",[Nr]:"Komentarz tylko do odczytu",[Pr]:"Scal komórki",[Or]:"Rozdziel komórki",[Tr]:"Kopiuj",[Sa]:["Kopiuj z nagłówkiem","Kopiuj z nagłówkami"],[Ra]:["Kopiuj z nagłówkiem grupowym","Kopiuj z nagłówkami grupowymi"],[Ea]:["Kopiuj sam nagłówek","Kopiuj same nagłówki"],[_r]:"Wytnij",[qr]:"Wstaw wiersz podrzędny",[Xr]:"Odłącz od nadrzędnego",[Zr]:["Ukryj kolumnę","Ukryj kolumny"],[Jr]:["Pokaż kolumnę","Pokaż kolumny"],[Qr]:["Ukryj wiersz","Ukryj wiersze"],[ei]:["Pokaż wiersz","Pokaż wiersze"],[Jn]:"Brak",[ti]:"Komórka jest pusta",[ni]:"Komórka nie jest pusta",[ri]:"Jest równe",[ii]:"Jest różne od",[oi]:"Tekst zaczyna się od",[si]:"Tekst kończy się na",[ai]:"Tekst zawiera fragment",[li]:"Tekst nie zawiera fragmentu",[ui]:"Większe niż",[ci]:"Większe lub równe",[hi]:"Mniejsze niż",[di]:"Mniejsze lub równe",[fi]:"Jest pomiędzy",[gi]:"Nie jest pomiędzy",[mi]:"Data późniejsza niż",[pi]:"Data wcześniejsza niż",[wi]:"Dzisiaj",[vi]:"Jutro",[Ci]:"Wczoraj",[Xn]:"Puste miejsca",[yi]:"Filtruj wg warunku",[bi]:"Filtruj wg wartości",[Si]:"Oraz",[Qn]:"Lub",[Ri]:"Zaznacz wszystko",[Ei]:"Wyczyść",[Ti]:"OK",[_i]:"Anuluj",[Mi]:"Szukaj",[Ii]:"Wartość",[Pi]:"Druga wartość",[Tw]:"Zaznaczony",[_w]:"Odznaczony"};/**
|
|
330
|
-
* @preserve
|
|
331
|
-
* Authors: Júlio C. Zuppa
|
|
332
|
-
* Last updated: Jan 12, 2018
|
|
333
|
-
*
|
|
334
|
-
* Description: Definition file for Portuguese - Brazil language-country.
|
|
335
|
-
*/const ale={languageCode:"pt-BR",[pr]:"Inserir linha acima",[wr]:"Inserir linha abaixo",[vr]:"Inserir coluna esquerda",[Cr]:"Inserir coluna direita",[yr]:["Excluir linha","Excluir linhas"],[br]:["Excluir coluna","Excluir colunas"],[Sr]:"Desfazer",[Rr]:"Refazer",[qn]:"Somente leitura",[Er]:"Limpar coluna",[Dr]:"Alinhamento",[kr]:"Esquerda",[Lr]:"Centralizado",[$r]:"Direita",[Fr]:"Justificado",[Vr]:"Superior",[Wr]:"Meio",[Br]:"Inferior",[Mr]:"Congelar coluna",[Ir]:"Descongelar coluna",[jr]:"Bordas",[Ur]:"Superior",[zr]:"Direita",[Yr]:"Inferior",[Gr]:"Esquerda",[Kr]:"Excluir bordas(s)",[xr]:"Incluir comentário",[Ar]:"Editar comentário",[Hr]:"Remover comentário",[Nr]:"Comentário somente leitura",[Pr]:"Mesclar células",[Or]:"Desfazer mesclagem de células",[Tr]:"Copiar",[_r]:"Recortar",[qr]:"Inserir linha filha",[Xr]:"Desanexar da linha pai",[Zr]:["Ocultar coluna","Ocultar colunas"],[Jr]:["Exibir coluna","Exibir colunas"],[Qr]:["Ocultar linha","Ocultar linhas"],[ei]:["Exibir linha","Exibir linhas"],[Jn]:"Nenhum",[ti]:"É vazio",[ni]:"Não é vazio",[ri]:"É igual a",[ii]:"É diferente de",[oi]:"Começa com",[si]:"Termina com",[ai]:"Contém",[li]:"Não contém",[ui]:"Maior que",[ci]:"Maior ou igual a",[hi]:"Menor que",[di]:"Maior ou igual a",[fi]:"Está entre",[gi]:"Não está entre",[mi]:"Depois",[pi]:"Antes",[wi]:"Hoje",[vi]:"Amanhã",[Ci]:"Ontem",[Xn]:"Células vazias",[yi]:"Filtrar por condição",[bi]:"Filtrar por valor",[Si]:"E",[Qn]:"Ou",[Ri]:"Selecionar tudo",[Ei]:"Limpar",[Ti]:"OK",[_i]:"Cancelar",[Mi]:"Localizar",[Ii]:"Valor",[Pi]:"Segundo valor"};/**
|
|
336
|
-
* @preserve
|
|
337
|
-
* Authors: Alexey Rogachev
|
|
338
|
-
* Last updated: Feb 28, 2018
|
|
339
|
-
*
|
|
340
|
-
* Description: Definition file for Russian - Russia language-country.
|
|
341
|
-
*/const lle={languageCode:"ru-RU",[pr]:"Вставить строку выше",[wr]:"Вставить строку ниже",[vr]:"Вставить столбец слева",[Cr]:"Вставить столбец справа",[yr]:["Удалить строку","Удалить строки"],[br]:["Удалить столбец","Удалить столбцы"],[Sr]:"Отменить",[Rr]:"Повторить",[qn]:"Только для чтения",[Er]:"Очистить столбец",[Dr]:"Выравнивание",[kr]:"По левому краю",[Lr]:"По центру",[$r]:"По правому краю",[Fr]:"По ширине",[Vr]:"По верхнему краю",[Wr]:"По центру",[Br]:"По нижнему краю",[Mr]:"Закрепить столбец",[Ir]:"Открепить столбец",[jr]:"Границы",[Ur]:"Сверху",[zr]:"Справа",[Yr]:"Снизу",[Gr]:"Слева",[Kr]:"Удалить границу(ы)",[xr]:"Добавить комментарий",[Ar]:"Редактировать комментарий",[Hr]:"Удалить комментарий",[Nr]:"Комментарий только для чтения",[Pr]:"Объединить ячейки",[Or]:"Разделить ячейки",[Tr]:"Копировать",[_r]:"Вырезать",[qr]:"Вставить дочернюю строку",[Xr]:"Отделить от родителя",[Zr]:["Скрыть столбец","Скрыть столбцы"],[Jr]:["Показать столбец","Показать столбцы"],[Qr]:["Скрыть строку","Скрыть строки"],[ei]:["Показать строку","Показать строки"],[Jn]:"Отсутствует",[ti]:"Пусто",[ni]:"Не пусто",[ri]:"Равно",[ii]:"Не равно",[oi]:"Начинается на",[si]:"Заканчивается на",[ai]:"Содержит",[li]:"Не содержит",[ui]:"Больше чем",[ci]:"Больше или равно",[hi]:"Меньше чем",[di]:"Меньше или равно",[fi]:"Между",[gi]:"Не между",[mi]:"После",[pi]:"До",[wi]:"Сегодня",[vi]:"Завтра",[Ci]:"Вчера",[Xn]:"Пустые ячейки",[yi]:"Фильтр по условию",[bi]:"Фильтр по значению",[Si]:"И",[Qn]:"Или",[Ri]:"Выбрать все",[Ei]:"Убрать",[Ti]:"OK",[_i]:"Отмена",[Mi]:"Поиск",[Ii]:"Значение",[Pi]:"Второе значение"};/**
|
|
342
|
-
* @preserve
|
|
343
|
-
* Authors: soakit, HChenZi
|
|
344
|
-
* Last updated: Mar 09, 2023
|
|
345
|
-
*
|
|
346
|
-
* Description: Definition file for Chinese - China language-country.
|
|
347
|
-
*/const ule={languageCode:"zh-CN",[pr]:"上方插入行",[wr]:"下方插入行",[vr]:"左方插入列",[Cr]:"右方插入列",[yr]:["移除该行","移除多行"],[br]:["移除该列","移除多列"],[Sr]:"撤销",[Rr]:"恢复",[qn]:"只读",[Er]:"清空该列",[Dr]:"对齐",[kr]:"左对齐",[Lr]:"水平居中",[$r]:"右对齐",[Fr]:"两端对齐",[Vr]:"顶端对齐",[Wr]:"垂直居中",[Br]:"底端对齐",[Mr]:"冻结该列",[Ir]:"取消冻结",[jr]:"边框",[Ur]:"上",[zr]:"右",[Yr]:"下",[Gr]:"左",[Kr]:"移除边框",[xr]:"插入批注",[Ar]:"编辑批注",[Hr]:"删除批注",[Nr]:"只读批注",[Pr]:"合并",[Or]:"取消合并",[Tr]:"复制",[Sa]:"带标题的复制",[Ra]:"带标题组的复制",[Ea]:"仅复制标题",[_r]:"剪切",[qr]:"插入子行",[Xr]:"与母行分离",[Zr]:["隐藏该列","隐藏多列"],[Jr]:["显示该列","显示多列"],[Qr]:["隐藏该行","隐藏多行"],[ei]:["显示该行","显示多行"],[Jn]:"无",[ti]:"为空",[ni]:"不为空",[ri]:"等于",[ii]:"不等于",[oi]:"开头是",[si]:"结尾是",[ai]:"包含",[li]:"不包含",[ui]:"大于",[ci]:"大于或等于",[hi]:"小于",[di]:"小于或等于",[fi]:"在此范围",[gi]:"不在此范围",[mi]:"之后",[pi]:"之前",[wi]:"今天",[vi]:"明天",[Ci]:"昨天",[Xn]:"空白单元格",[yi]:"按条件过滤",[bi]:"按值过滤",[Si]:"且",[Qn]:"或",[Ri]:"全选",[Ei]:"清除",[Ti]:"确认",[_i]:"取消",[Mi]:"搜索",[Ii]:"值",[Pi]:"第二值"};Jae();const DH={de:Qae,en:w0,es:ele,fr:tle,it:nle,ja:rle,ko:ile,nl:ole,pl:sle,pt:ale,ru:lle,zh:ule},cle=document.documentElement.lang,g$=DH[cle]??DH.en;v0(g$);const xle=({config:t,data:e=[],onChange:n})=>{const{appearance:r}=b$(),[i,o]=bh.useState("ht-theme-main"),s=bh.useCallback((l,u)=>{var h,d;if(u==="loadData")return;const c=(d=(h=a.current)==null?void 0:h.hotInstance)==null?void 0:d.getSourceData();n(c)},[]),a=bh.useRef(null);return bh.useEffect(()=>{a.current&&a.current.hotInstance.loadData(e)},[e]),bh.useEffect(()=>{o(r==="dark"?"ht-theme-main-dark":"ht-theme-main")},[r]),NT.jsx(ZD,{themeName:i,language:g$.languageCode,ref:a,...t,afterChange:s,children:t.columns.map(l=>NT.jsx(qD,{data:l.data,...l},l.data))})};export{xle as default};
|