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.
Files changed (147) hide show
  1. package/Readme.md +36 -0
  2. package/assets/VanillaJSONEditor-EdDEEERs.js +3833 -0
  3. package/assets/add-CXBzlfCv.js +1 -0
  4. package/assets/add-form-C1pPO9IW.js +1 -0
  5. package/assets/add-group-BIVpnHvQ.js +1 -0
  6. package/assets/add-group-form-BWu1FoyP.js +1 -0
  7. package/assets/add-user-BXbPJ4kC.js +1 -0
  8. package/assets/add-user-form-Dm9-szTc.js +1 -0
  9. package/assets/{app-DiNg6K-6.css → app-DMmad2-f.css} +6 -6
  10. package/assets/{app-layout-CLIcmUo6.js → app-layout-HvBcNP7X.js} +1 -1
  11. package/assets/app-shell-CeSqdfTT.js +1 -0
  12. package/assets/app-sidebar-BtgeHCOh.js +1 -0
  13. package/assets/{app-sidebar-header-C5wVa7ER.js → app-sidebar-header-pNKH1knV.js} +2 -2
  14. package/assets/app.js +33 -33
  15. package/assets/{breadcrumbs-DlS-hpHL.js → breadcrumbs-CQNon4Vl.js} +1 -1
  16. package/assets/{button-CcO4Q6h6.js → button-CQ9t1kLz.js} +1 -1
  17. package/assets/checkbox-W0nGAXIj.js +1 -0
  18. package/assets/dashboard-DOZBrGfi.js +1 -0
  19. package/assets/{date-picker-DMW7NWSI.js → date-picker-B__dVVqj.js} +2 -2
  20. package/assets/dropdown-menu-SEBnEIiL.js +1 -0
  21. package/assets/{field-renderer-CvC9UdC0.js → field-renderer-hXvJ0krZ.js} +139 -139
  22. package/assets/form-BMkoRYG6.js +1 -0
  23. package/assets/form-yYsjEajF.js +1 -0
  24. package/assets/{geo-json-BVpmaj6P.js → geo-json-paEzaL-W.js} +1 -1
  25. package/assets/handsontable-Wf0rBy4A.js +347 -0
  26. package/assets/home-BGYylio4.js +2 -0
  27. package/assets/{icon-CgDnRol2.js → icon-Bz9BMaD0.js} +1 -1
  28. package/assets/index-BC0yfOHo.js +1 -0
  29. package/assets/index-BbXEMx9n.js +1 -0
  30. package/assets/index-BcE9FUM6.js +1 -0
  31. package/assets/index-C0SL3SHw.js +41 -0
  32. package/assets/index-Cdb9ACvz.js +1 -0
  33. package/assets/index-D5ir9iUV.js +1 -0
  34. package/assets/index-DEk3sC8d.js +1 -0
  35. package/assets/index-DTRTjOmh.js +10 -0
  36. package/assets/index-DrWfGwtf.js +1 -0
  37. package/assets/index-K81GbF6O.js +1 -0
  38. package/assets/init-user-D9K13Tol.js +1 -0
  39. package/assets/{input-coEb8Hta.js → input-DF7Ue23C.js} +1 -1
  40. package/assets/{input-error-Dt30bqav.js → input-error-BBygona6.js} +1 -1
  41. package/assets/{label-BH_NLtVH.js → label-Z506NKsW.js} +1 -1
  42. package/assets/{list-table-CJgy5FsP.js → list-table-CE3swbOx.js} +3 -3
  43. package/assets/list-vQjhDdnO.js +1 -0
  44. package/assets/login-BKGj0WOS.js +6 -0
  45. package/assets/manifest.json +552 -601
  46. package/assets/{material-icon-DpKyAc3Z.js → material-icon-CItZiB53.js} +1 -1
  47. package/assets/module-BtDdcMyj.js +1 -0
  48. package/assets/multi-select-DOrUHH4A.js +11 -0
  49. package/assets/nav-footer-BoqrRyzw.js +1 -0
  50. package/assets/nav-main-BL-Hmm6O.js +1 -0
  51. package/assets/nav-user-KahV1IDw.js +1 -0
  52. package/assets/{pagination-render-S4EXTE9a.js → pagination-render-B57pOpFy.js} +1 -1
  53. package/assets/popover-I249Gg2O.js +1 -0
  54. package/assets/register-r-RETuTI.js +1 -0
  55. package/assets/select-D1N8zRPY.js +6 -0
  56. package/assets/{sidebar-C9-ESAx1.js → sidebar-VU5deMRj.js} +1 -1
  57. package/assets/{toast-editor-X2U_pFls.js → toast-editor-BQpTg1Td.js} +43 -43
  58. package/assets/tooltip-D2ehgLlB.js +1 -0
  59. package/assets/user-info-DBYoAJYJ.js +9 -0
  60. package/assets/{user-menu-content-D25M1xxo.js → user-menu-content-qkvdkUVd.js} +2 -2
  61. package/assets/utils-DjqsqOe8.js +1 -0
  62. package/assets/welcome-Z0ubrSPJ.js +1 -0
  63. package/controllers/add.js +1 -1
  64. package/controllers/addGroup.js +1 -1
  65. package/controllers/addUser.js +1 -1
  66. package/controllers/catalog/Catalog.js +1 -1
  67. package/controllers/ckeditorUpload.js +1 -1
  68. package/controllers/dashboard.js +1 -1
  69. package/controllers/edit.js +1 -1
  70. package/controllers/editGroup.js +1 -1
  71. package/controllers/editUser.js +1 -1
  72. package/controllers/form.js +1 -1
  73. package/controllers/getAllWidgets.js +1 -1
  74. package/controllers/initUser.js +1 -1
  75. package/controllers/list.js +1 -1
  76. package/controllers/login.js +3 -1
  77. package/controllers/media-manager/mediaManagerApi.js +1 -1
  78. package/controllers/navigation/edit.js +1 -1
  79. package/controllers/processInstallFinalize.js +1 -1
  80. package/controllers/processInstallStep.js +1 -1
  81. package/controllers/register.js +1 -1
  82. package/controllers/remove.js +1 -1
  83. package/controllers/timezones.js +1 -1
  84. package/controllers/view.js +1 -1
  85. package/controllers/welcome.js +1 -1
  86. package/controllers/widgets/Action.js +1 -1
  87. package/controllers/widgets/Custom.js +1 -1
  88. package/controllers/widgets/Info.js +1 -1
  89. package/controllers/widgets/switch.js +1 -1
  90. package/controllers/widgetsDB.js +1 -1
  91. package/helpers/accessRightsHelper.js +1 -1
  92. package/helpers/inertiaAddHelper.d.ts +1 -0
  93. package/interfaces/adminpanelConfig.d.ts +5 -1
  94. package/lib/datatable/NodeTable.js +2 -0
  95. package/lib/v4/POWCaptcha.js +1 -1
  96. package/lib/v4/model/AbstractModel.js +2 -0
  97. package/lib/v4/model/adapter/sequelize.d.ts +26 -0
  98. package/lib/v4/model/adapter/sequelize.js +280 -0
  99. package/lib/v4/model/adapter/waterline.js +3 -1
  100. package/package.json +6 -3
  101. package/policies/checkAuth.js +1 -1
  102. package/system/bindAuthorization.js +17 -2
  103. package/system/bindInertia.js +1 -1
  104. package/system/defaults.js +3 -0
  105. package/assets/VanillaJSONEditor-OdBvR1ds.js +0 -3807
  106. package/assets/add-DtkqVKek.js +0 -1
  107. package/assets/add-form-D7Gz1uwX.js +0 -1
  108. package/assets/add-group-BIUZK9CR.js +0 -1
  109. package/assets/add-group-form-CFw1igaY.js +0 -1
  110. package/assets/add-user-5Ko0sxsj.js +0 -1
  111. package/assets/add-user-form-fxpU-oac.js +0 -1
  112. package/assets/app-shell-Dgf4uNFy.js +0 -1
  113. package/assets/app-sidebar-D5-eQKSx.js +0 -1
  114. package/assets/checkbox-zNG98WS7.js +0 -1
  115. package/assets/dashboard-BmEpxYnQ.js +0 -1
  116. package/assets/dropdown-menu-CKLjASQo.js +0 -1
  117. package/assets/floating-ui.react-dom-DEWQUtJU.js +0 -1
  118. package/assets/form-BZkPiK2Z.js +0 -1
  119. package/assets/form-XjYeizmY.js +0 -1
  120. package/assets/handsontable-D_wNwOhu.js +0 -347
  121. package/assets/home-CmIZ3AL2.js +0 -2
  122. package/assets/index-B6nPyxx_.js +0 -1
  123. package/assets/index-B7QLmddv.js +0 -1
  124. package/assets/index-BNKtUMNI.js +0 -1
  125. package/assets/index-C4BeqGbx.js +0 -41
  126. package/assets/index-CJTkueDA.js +0 -1
  127. package/assets/index-CNFwBlc7.js +0 -1
  128. package/assets/index-D8YaJIVm.js +0 -1
  129. package/assets/index-DZ2G3GiC.js +0 -10
  130. package/assets/index-DlfDI23T.js +0 -1
  131. package/assets/index-Dv6YbCDH.js +0 -1
  132. package/assets/index-S2Olh4hE.js +0 -1
  133. package/assets/init-user-DXTgLYcI.js +0 -1
  134. package/assets/list-BBJBZzsm.js +0 -1
  135. package/assets/login-B7INjWDi.js +0 -6
  136. package/assets/module-D8kHGWhF.js +0 -1
  137. package/assets/multi-select-CgIsryRX.js +0 -11
  138. package/assets/nav-footer-BioIOL2n.js +0 -1
  139. package/assets/nav-main-CcQo_Ho4.js +0 -1
  140. package/assets/nav-user-p58e1wG0.js +0 -1
  141. package/assets/popover-DXKNm8mO.js +0 -1
  142. package/assets/register-B-p6hoZb.js +0 -1
  143. package/assets/select-B1LhFAX0.js +0 -6
  144. package/assets/tooltip-DXyAGFz-.js +0 -1
  145. package/assets/user-info-D89n2REb.js +0 -1
  146. package/assets/utils-jAU0Cazi.js +0 -1
  147. package/assets/welcome-D1l61QW1.js +0 -1
@@ -0,0 +1,347 @@
1
+ import{c as UT,W as Dt,R as XH,r as Th,j as zT}from"./app.js";import{u as $$}from"./use-appearance-CL_TqHcP.js";import"./compiler-runtime-tM4jBQ-T.js";var YT={},_h,GT;function on(){if(GT)return _h;GT=1;var t=function(e){return e&&e.Math===Math&&e};return _h=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof UT=="object"&&UT)||t(typeof _h=="object"&&_h)||function(){return this}()||Function("return this")(),_h}var sv={},av,KT;function Cn(){return KT||(KT=1,av=function(t){try{return!!t()}catch{return!0}}),av}var lv,qT;function go(){if(qT)return lv;qT=1;var t=Cn();return lv=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),lv}var uv,XT;function ow(){if(XT)return uv;XT=1;var t=Cn();return uv=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),uv}var cv,ZT;function sn(){if(ZT)return cv;ZT=1;var t=ow(),e=Function.prototype.call;return cv=t?e.bind(e):function(){return e.apply(e,arguments)},cv}var hv={},QT;function F$(){if(QT)return hv;QT=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);return hv.f=n?function(i){var o=e(this,i);return!!o&&o.enumerable}:t,hv}var dv,JT;function sw(){return JT||(JT=1,dv=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),dv}var fv,e_;function qt(){if(e_)return fv;e_=1;var t=ow(),e=Function.prototype,n=e.call,r=t&&e.bind.bind(n,n);return fv=t?r:function(i){return function(){return n.apply(i,arguments)}},fv}var gv,t_;function Nu(){if(t_)return gv;t_=1;var t=qt(),e=t({}.toString),n=t("".slice);return gv=function(r){return n(e(r),8,-1)},gv}var mv,n_;function V$(){if(n_)return mv;n_=1;var t=qt(),e=Cn(),n=Nu(),r=Object,i=t("".split);return mv=e(function(){return!r("z").propertyIsEnumerable(0)})?function(o){return n(o)==="String"?i(o,""):r(o)}:r,mv}var pv,r_;function uE(){return r_||(r_=1,pv=function(t){return t==null}),pv}var wv,i_;function Pf(){if(i_)return wv;i_=1;var t=uE(),e=TypeError;return wv=function(n){if(t(n))throw new e("Can't call method on "+n);return n},wv}var vv,o_;function Of(){if(o_)return vv;o_=1;var t=V$(),e=Pf();return vv=function(n){return t(e(n))},vv}var Cv,s_;function an(){if(s_)return Cv;s_=1;var t=typeof document=="object"&&document.all;return Cv=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},Cv}var yv,a_;function mo(){if(a_)return yv;a_=1;var t=an();return yv=function(e){return typeof e=="object"?e!==null:t(e)},yv}var bv,l_;function ah(){if(l_)return bv;l_=1;var t=on(),e=an(),n=function(r){return e(r)?r:void 0};return bv=function(r,i){return arguments.length<2?n(t[r]):t[r]&&t[r][i]},bv}var Sv,u_;function xf(){if(u_)return Sv;u_=1;var t=qt();return Sv=t({}.isPrototypeOf),Sv}var Rv,c_;function aw(){if(c_)return Rv;c_=1;var t=on(),e=t.navigator,n=e&&e.userAgent;return Rv=n?String(n):"",Rv}var Ev,h_;function W$(){if(h_)return Ev;h_=1;var t=on(),e=aw(),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]))),Ev=a,Ev}var Tv,d_;function cE(){if(d_)return Tv;d_=1;var t=W$(),e=Cn(),n=on(),r=n.String;return Tv=!!Object.getOwnPropertySymbols&&!e(function(){var i=Symbol("symbol detection");return!r(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&t&&t<41}),Tv}var _v,f_;function ZH(){if(f_)return _v;f_=1;var t=cE();return _v=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",_v}var Mv,g_;function hE(){if(g_)return Mv;g_=1;var t=ah(),e=an(),n=xf(),r=ZH(),i=Object;return Mv=r?function(o){return typeof o=="symbol"}:function(o){var s=t("Symbol");return e(s)&&n(s.prototype,i(o))},Mv}var Iv,m_;function lw(){if(m_)return Iv;m_=1;var t=String;return Iv=function(e){try{return t(e)}catch{return"Object"}},Iv}var Pv,p_;function pr(){if(p_)return Pv;p_=1;var t=an(),e=lw(),n=TypeError;return Pv=function(r){if(t(r))return r;throw new n(e(r)+" is not a function")},Pv}var Ov,w_;function Af(){if(w_)return Ov;w_=1;var t=pr(),e=uE();return Ov=function(n,r){var i=n[r];return e(i)?void 0:t(i)},Ov}var xv,v_;function B$(){if(v_)return xv;v_=1;var t=sn(),e=an(),n=mo(),r=TypeError;return xv=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")},xv}var Av={exports:{}},Hv,C_;function gl(){return C_||(C_=1,Hv=!1),Hv}var Nv,y_;function dE(){if(y_)return Nv;y_=1;var t=on(),e=Object.defineProperty;return Nv=function(n,r){try{e(t,n,{value:r,configurable:!0,writable:!0})}catch{t[n]=r}return r},Nv}var b_;function fE(){if(b_)return Av.exports;b_=1;var t=gl(),e=on(),n=dE(),r="__core-js_shared__",i=Av.exports=e[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.42.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"}),Av.exports}var Dv,S_;function QH(){if(S_)return Dv;S_=1;var t=fE();return Dv=function(e,n){return t[e]||(t[e]=n||{})},Dv}var kv,R_;function lh(){if(R_)return kv;R_=1;var t=Pf(),e=Object;return kv=function(n){return e(t(n))},kv}var Lv,E_;function po(){if(E_)return Lv;E_=1;var t=qt(),e=lh(),n=t({}.hasOwnProperty);return Lv=Object.hasOwn||function(i,o){return n(e(i),o)},Lv}var $v,T_;function JH(){if(T_)return $v;T_=1;var t=qt(),e=0,n=Math.random(),r=t(1 .toString);return $v=function(i){return"Symbol("+(i===void 0?"":i)+")_"+r(++e+n,36)},$v}var Fv,__;function Yo(){if(__)return Fv;__=1;var t=on(),e=QH(),n=po(),r=JH(),i=cE(),o=ZH(),s=t.Symbol,a=e("wks"),l=o?s.for||s:s&&s.withoutSetter||r;return Fv=function(u){return n(a,u)||(a[u]=i&&n(s,u)?s[u]:l("Symbol."+u)),a[u]},Fv}var Vv,M_;function j$(){if(M_)return Vv;M_=1;var t=sn(),e=mo(),n=hE(),r=Af(),i=B$(),o=Yo(),s=TypeError,a=o("toPrimitive");return Vv=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)},Vv}var Wv,I_;function e1(){if(I_)return Wv;I_=1;var t=j$(),e=hE();return Wv=function(n){var r=t(n,"string");return e(r)?r:r+""},Wv}var Bv,P_;function gE(){if(P_)return Bv;P_=1;var t=on(),e=mo(),n=t.document,r=e(n)&&e(n.createElement);return Bv=function(i){return r?n.createElement(i):{}},Bv}var jv,O_;function t1(){if(O_)return jv;O_=1;var t=go(),e=Cn(),n=gE();return jv=!t&&!e(function(){return Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a!==7}),jv}var x_;function n1(){if(x_)return sv;x_=1;var t=go(),e=sn(),n=F$(),r=sw(),i=Of(),o=e1(),s=po(),a=t1(),l=Object.getOwnPropertyDescriptor;return sv.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])},sv}var Uv={},zv,A_;function r1(){if(A_)return zv;A_=1;var t=go(),e=Cn();return zv=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),zv}var Yv,H_;function ln(){if(H_)return Yv;H_=1;var t=mo(),e=String,n=TypeError;return Yv=function(r){if(t(r))return r;throw new n(e(r)+" is not an object")},Yv}var N_;function ml(){if(N_)return Uv;N_=1;var t=go(),e=t1(),n=r1(),r=ln(),i=e1(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l="enumerable",u="configurable",c="writable";return Uv.f=t?n?function(d,f,g){if(r(d),f=i(f),r(g),typeof d=="function"&&f==="prototype"&&"value"in g&&c in g&&!g[c]){var C=a(d,f);C&&C[c]&&(d[f]=g.value,g={configurable:u in g?g[u]:C[u],enumerable:l in g?g[l]:C[l],writable:!1})}return s(d,f,g)}:s:function(d,f,g){if(r(d),f=i(f),r(g),e)try{return s(d,f,g)}catch{}if("get"in g||"set"in g)throw new o("Accessors not supported");return"value"in g&&(d[f]=g.value),d},Uv}var Gv,D_;function uh(){if(D_)return Gv;D_=1;var t=go(),e=ml(),n=sw();return Gv=t?function(r,i,o){return e.f(r,i,n(1,o))}:function(r,i,o){return r[i]=o,r},Gv}var Kv={exports:{}},qv,k_;function U$(){if(k_)return qv;k_=1;var t=go(),e=po(),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 qv={EXISTS:i,PROPER:o,CONFIGURABLE:s},qv}var Xv,L_;function z$(){if(L_)return Xv;L_=1;var t=qt(),e=an(),n=fE(),r=t(Function.toString);return e(n.inspectSource)||(n.inspectSource=function(i){return r(i)}),Xv=n.inspectSource,Xv}var Zv,$_;function Y$(){if($_)return Zv;$_=1;var t=on(),e=an(),n=t.WeakMap;return Zv=e(n)&&/native code/.test(String(n)),Zv}var Qv,F_;function mE(){if(F_)return Qv;F_=1;var t=QH(),e=JH(),n=t("keys");return Qv=function(r){return n[r]||(n[r]=e(r))},Qv}var Jv,V_;function pE(){return V_||(V_=1,Jv={}),Jv}var eC,W_;function i1(){if(W_)return eC;W_=1;var t=Y$(),e=on(),n=mo(),r=uh(),i=po(),o=fE(),s=mE(),a=pE(),l="Object already initialized",u=e.TypeError,c=e.WeakMap,h,d,f,g=function(v){return f(v)?d(v):h(v,{})},C=function(v){return function(P){var O;if(!n(P)||(O=d(P)).type!==v)throw new u("Incompatible receiver, "+v+" required");return O}};if(t||o.state){var y=o.state||(o.state=new c);y.get=y.get,y.has=y.has,y.set=y.set,h=function(v,P){if(y.has(v))throw new u(l);return P.facade=v,y.set(v,P),P},d=function(v){return y.get(v)||{}},f=function(v){return y.has(v)}}else{var E=s("state");a[E]=!0,h=function(v,P){if(i(v,E))throw new u(l);return P.facade=v,r(v,E,P),P},d=function(v){return i(v,E)?v[E]:{}},f=function(v){return i(v,E)}}return eC={set:h,get:d,has:f,enforce:g,getterFor:C},eC}var B_;function o1(){if(B_)return Kv.exports;B_=1;var t=qt(),e=Cn(),n=an(),r=po(),i=go(),o=U$().CONFIGURABLE,s=z$(),a=i1(),l=a.enforce,u=a.get,c=String,h=Object.defineProperty,d=t("".slice),f=t("".replace),g=t([].join),C=i&&!e(function(){return h(function(){},"length",{value:8}).length!==8}),y=String(String).split("String"),E=Kv.exports=function(v,P,O){d(c(P),0,7)==="Symbol("&&(P="["+f(c(P),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),O&&O.getter&&(P="get "+P),O&&O.setter&&(P="set "+P),(!r(v,"name")||o&&v.name!==P)&&(i?h(v,"name",{value:P,configurable:!0}):v.name=P),C&&O&&r(O,"arity")&&v.length!==O.arity&&h(v,"length",{value:O.arity});try{O&&r(O,"constructor")&&O.constructor?i&&h(v,"prototype",{writable:!1}):v.prototype&&(v.prototype=void 0)}catch{}var L=l(v);return r(L,"source")||(L.source=g(y,typeof P=="string"?P:"")),v};return Function.prototype.toString=E(function(){return n(this)&&u(this).source||s(this)},"toString"),Kv.exports}var tC,j_;function wE(){if(j_)return tC;j_=1;var t=an(),e=ml(),n=o1(),r=dE();return tC=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},tC}var nC={},rC,U_;function G$(){if(U_)return rC;U_=1;var t=Math.ceil,e=Math.floor;return rC=Math.trunc||function(r){var i=+r;return(i>0?e:t)(i)},rC}var iC,z_;function Hf(){if(z_)return iC;z_=1;var t=G$();return iC=function(e){var n=+e;return n!==n||n===0?0:t(n)},iC}var oC,Y_;function K$(){if(Y_)return oC;Y_=1;var t=Hf(),e=Math.max,n=Math.min;return oC=function(r,i){var o=t(r);return o<0?e(o+i,0):n(o,i)},oC}var sC,G_;function q$(){if(G_)return sC;G_=1;var t=Hf(),e=Math.min;return sC=function(n){var r=t(n);return r>0?e(r,9007199254740991):0},sC}var aC,K_;function ch(){if(K_)return aC;K_=1;var t=q$();return aC=function(e){return t(e.length)},aC}var lC,q_;function X$(){if(q_)return lC;q_=1;var t=Of(),e=K$(),n=ch(),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 lC={includes:r(!0),indexOf:r(!1)},lC}var uC,X_;function s1(){if(X_)return uC;X_=1;var t=qt(),e=po(),n=Of(),r=X$().indexOf,i=pE(),o=t([].push);return uC=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},uC}var cC,Z_;function vE(){return Z_||(Z_=1,cC=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),cC}var Q_;function Z$(){if(Q_)return nC;Q_=1;var t=s1(),e=vE(),n=e.concat("length","prototype");return nC.f=Object.getOwnPropertyNames||function(i){return t(i,n)},nC}var hC={},J_;function Q$(){return J_||(J_=1,hC.f=Object.getOwnPropertySymbols),hC}var dC,eM;function J$(){if(eM)return dC;eM=1;var t=ah(),e=qt(),n=Z$(),r=Q$(),i=ln(),o=e([].concat);return dC=t("Reflect","ownKeys")||function(a){var l=n.f(i(a)),u=r.f;return u?o(l,u(a)):l},dC}var fC,tM;function a1(){if(tM)return fC;tM=1;var t=po(),e=J$(),n=n1(),r=ml();return fC=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))}},fC}var gC,nM;function eF(){if(nM)return gC;nM=1;var t=Cn(),e=an(),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 gC=r,gC}var mC,rM;function dt(){if(rM)return mC;rM=1;var t=on(),e=n1().f,n=uh(),r=wE(),i=dE(),o=a1(),s=eF();return mC=function(a,l){var u=a.target,c=a.global,h=a.stat,d,f,g,C,y,E;if(c?f=t:h?f=t[u]||i(u,{}):f=t[u]&&t[u].prototype,f)for(g in l){if(y=l[g],a.dontCallGetSet?(E=e(f,g),C=E&&E.value):C=f[g],d=s(c?g:u+(h?".":"#")+g,a.forced),!d&&C!==void 0){if(typeof y==typeof C)continue;o(y,C)}(a.sham||C&&C.sham)&&n(y,"sham",!0),r(f,g,y,a)}},mC}var pC,iM;function Nf(){if(iM)return pC;iM=1;var t=ow(),e=Function.prototype,n=e.apply,r=e.call;return pC=typeof Reflect=="object"&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),pC}var wC,oM;function l1(){if(oM)return wC;oM=1;var t=qt(),e=pr();return wC=function(n,r,i){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[i]))}catch{}},wC}var vC,sM;function tF(){if(sM)return vC;sM=1;var t=mo();return vC=function(e){return t(e)||e===null},vC}var CC,aM;function nF(){if(aM)return CC;aM=1;var t=tF(),e=String,n=TypeError;return CC=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")},CC}var yC,lM;function u1(){if(lM)return yC;lM=1;var t=l1(),e=mo(),n=Pf(),r=nF();return yC=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),yC}var bC,uM;function rF(){if(uM)return bC;uM=1;var t=ml().f;return bC=function(e,n,r){r in e||t(e,r,{configurable:!0,get:function(){return n[r]},set:function(i){n[r]=i}})},bC}var SC,cM;function iF(){if(cM)return SC;cM=1;var t=an(),e=mo(),n=u1();return SC=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},SC}var RC,hM;function oF(){if(hM)return RC;hM=1;var t=Yo(),e=t("toStringTag"),n={};return n[e]="z",RC=String(n)==="[object z]",RC}var EC,dM;function c1(){if(dM)return EC;dM=1;var t=oF(),e=an(),n=Nu(),r=Yo(),i=r("toStringTag"),o=Object,s=n(function(){return arguments}())==="Arguments",a=function(l,u){try{return l[u]}catch{}};return EC=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},EC}var TC,fM;function uw(){if(fM)return TC;fM=1;var t=c1(),e=String;return TC=function(n){if(t(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(n)},TC}var _C,gM;function sF(){if(gM)return _C;gM=1;var t=uw();return _C=function(e,n){return e===void 0?arguments.length<2?"":n:t(e)},_C}var MC,mM;function aF(){if(mM)return MC;mM=1;var t=mo(),e=uh();return MC=function(n,r){t(r)&&"cause"in r&&e(n,"cause",r.cause)},MC}var IC,pM;function lF(){if(pM)return IC;pM=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 IC=function(s,a){if(o&&typeof s=="string"&&!e.prepareStackTrace)for(;a--;)s=n(s,i,"");return s},IC}var PC,wM;function uF(){if(wM)return PC;wM=1;var t=Cn(),e=sw();return PC=!t(function(){var n=new Error("a");return"stack"in n?(Object.defineProperty(n,"stack",e(1,7)),n.stack!==7):!0}),PC}var OC,vM;function cF(){if(vM)return OC;vM=1;var t=uh(),e=lF(),n=uF(),r=Error.captureStackTrace;return OC=function(i,o,s,a){n&&(r?r(i,o):t(i,"stack",e(s,a)))},OC}var xC,CM;function hF(){if(CM)return xC;CM=1;var t=ah(),e=po(),n=uh(),r=xf(),i=u1(),o=a1(),s=rF(),a=iF(),l=sF(),u=aF(),c=cF(),h=go(),d=gl();return xC=function(f,g,C,y){var E="stackTraceLimit",v=y?2:1,P=f.split("."),O=P[P.length-1],L=t.apply(null,P);if(L){var T=L.prototype;if(!d&&e(T,"cause")&&delete T.cause,!C)return L;var A=t("Error"),K=g(function(U,j){var Z=l(y?j:U,void 0),J=y?new L(U):new L;return Z!==void 0&&n(J,"message",Z),c(J,K,J.stack,2),this&&r(T,this)&&a(J,this,K),arguments.length>v&&u(J,arguments[v]),J});if(K.prototype=T,O!=="Error"?i?i(K,A):o(K,A,{name:!0}):h&&E in L&&(s(K,L,E),s(K,L,"prepareStackTrace")),o(K,L),!d)try{T.name!==O&&n(T,"name",O),T.constructor=K}catch{}return K}},xC}var yM;function dF(){if(yM)return YT;yM=1;var t=dt(),e=on(),n=Nf(),r=hF(),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)}}),YT}dF();var bM={},AC,SM;function h1(){if(SM)return AC;SM=1;var t=Nu();return AC=Array.isArray||function(n){return t(n)==="Array"},AC}var HC,RM;function d1(){if(RM)return HC;RM=1;var t=go(),e=h1(),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 HC=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},HC}var NC,EM;function f1(){if(EM)return NC;EM=1;var t=TypeError,e=9007199254740991;return NC=function(n){if(n>e)throw t("Maximum allowed index exceeded");return n},NC}var TM;function fF(){if(TM)return bM;TM=1;var t=dt(),e=lh(),n=ch(),r=d1(),i=f1(),o=Cn(),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 g=0;g<f;g++)h[d]=arguments[g],d++;return r(h,d),d}}),bM}fF();var _M={},DC,MM;function gF(){if(MM)return DC;MM=1;var t=Nu(),e=qt();return DC=function(n){if(t(n)==="Function")return e(n)},DC}var kC,IM;function g1(){if(IM)return kC;IM=1;var t=gF(),e=pr(),n=ow(),r=t(t.bind);return kC=function(i,o){return e(i),o===void 0?i:n?r(i,o):function(){return i.apply(o,arguments)}},kC}var LC,PM;function m1(){return PM||(PM=1,LC={}),LC}var $C,OM;function mF(){if(OM)return $C;OM=1;var t=Yo(),e=m1(),n=t("iterator"),r=Array.prototype;return $C=function(i){return i!==void 0&&(e.Array===i||r[n]===i)},$C}var FC,xM;function CE(){if(xM)return FC;xM=1;var t=c1(),e=Af(),n=uE(),r=m1(),i=Yo(),o=i("iterator");return FC=function(s){if(!n(s))return e(s,o)||e(s,"@@iterator")||r[t(s)]},FC}var VC,AM;function pF(){if(AM)return VC;AM=1;var t=sn(),e=pr(),n=ln(),r=lw(),i=CE(),o=TypeError;return VC=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")},VC}var WC,HM;function Yi(){if(HM)return WC;HM=1;var t=sn(),e=ln(),n=Af();return WC=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},WC}var BC,NM;function hh(){if(NM)return BC;NM=1;var t=g1(),e=sn(),n=ln(),r=lw(),i=mF(),o=ch(),s=xf(),a=pF(),l=CE(),u=Yi(),c=TypeError,h=function(f,g){this.stopped=f,this.result=g},d=h.prototype;return BC=function(f,g,C){var y=C&&C.that,E=!!(C&&C.AS_ENTRIES),v=!!(C&&C.IS_RECORD),P=!!(C&&C.IS_ITERATOR),O=!!(C&&C.INTERRUPTED),L=t(g,y),T,A,K,U,j,Z,J,se=function(ue){return T&&u(T,"normal",ue),new h(!0,ue)},te=function(ue){return E?(n(ue),O?L(ue[0],ue[1],se):L(ue[0],ue[1])):O?L(ue,se):L(ue)};if(v)T=f.iterator;else if(P)T=f;else{if(A=l(f),!A)throw new c(r(f)+" is not iterable");if(i(A)){for(K=0,U=o(f);U>K;K++)if(j=te(f[K]),j&&s(d,j))return j;return new h(!1)}T=a(f,A)}for(Z=v?f.next:T.next;!(J=e(Z,T)).done;){try{j=te(J.value)}catch(ue){u(T,"throw",ue)}if(typeof j=="object"&&j&&s(d,j))return j}return new h(!1)},BC}var jC,DM;function p1(){if(DM)return jC;DM=1;var t=go(),e=ml(),n=sw();return jC=function(r,i,o){t?e.f(r,i,n(0,o)):r[i]=o},jC}var kM;function wF(){if(kM)return _M;kM=1;var t=dt(),e=hh(),n=p1();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}}),_M}wF();var LM={},UC,$M;function Ps(){if($M)return UC;$M=1;var t=qt(),e=Set.prototype;return UC={Set,add:t(e.add),has:t(e.has),remove:t(e.delete),proto:e},UC}var zC,FM;function Du(){if(FM)return zC;FM=1;var t=Ps().has;return zC=function(e){return t(e),e},zC}var YC,VM;function ku(){if(VM)return YC;VM=1;var t=sn();return YC=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},YC}var GC,WM;function Df(){if(WM)return GC;WM=1;var t=qt(),e=ku(),n=Ps(),r=n.Set,i=n.proto,o=t(i.forEach),s=t(i.keys),a=s(new r).next;return GC=function(l,u,c){return c?e({iterator:s(l),next:a},u):o(l,u)},GC}var KC,BM;function yE(){if(BM)return KC;BM=1;var t=Ps(),e=Df(),n=t.Set,r=t.add;return KC=function(i){var o=new n;return e(i,function(s){r(o,s)}),o},KC}var qC,jM;function kf(){if(jM)return qC;jM=1;var t=l1(),e=Ps();return qC=t(e.proto,"size","get")||function(n){return n.size},qC}var XC,UM;function Os(){return UM||(UM=1,XC=function(t){return{iterator:t,next:t.next,done:!1}}),XC}var ZC,zM;function Lu(){if(zM)return ZC;zM=1;var t=pr(),e=ln(),n=sn(),r=Hf(),i=Os(),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)}},ZC=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)},ZC}var QC,YM;function vF(){if(YM)return QC;YM=1;var t=Du(),e=Ps(),n=yE(),r=kf(),i=Lu(),o=Df(),s=ku(),a=e.has,l=e.remove;return QC=function(c){var h=t(this),d=i(c),f=n(h);return r(h)<=d.size?o(h,function(g){d.includes(g)&&l(f,g)}):s(d.getIterator(),function(g){a(h,g)&&l(f,g)}),f},QC}var JC,GM;function $u(){if(GM)return JC;GM=1;var t=ah(),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 JC=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}},JC}var KM;function CF(){if(KM)return LM;KM=1;var t=dt(),e=vF(),n=$u(),r=!n("difference",function(i){return i.size===0});return t({target:"Set",proto:!0,real:!0,forced:r},{difference:e}),LM}CF();var qM={},ey,XM;function yF(){if(XM)return ey;XM=1;var t=Du(),e=Ps(),n=kf(),r=Lu(),i=Df(),o=ku(),s=e.Set,a=e.add,l=e.has;return ey=function(c){var h=t(this),d=r(c),f=new s;return n(h)>d.size?o(d.getIterator(),function(g){l(h,g)&&a(f,g)}):i(h,function(g){d.includes(g)&&a(f,g)}),f},ey}var ZM;function bF(){if(ZM)return qM;ZM=1;var t=dt(),e=Cn(),n=yF(),r=$u(),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}),qM}bF();var QM={},ty,JM;function SF(){if(JM)return ty;JM=1;var t=Du(),e=Ps().has,n=kf(),r=Lu(),i=Df(),o=ku(),s=Yi();return ty=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},ty}var eI;function RF(){if(eI)return QM;eI=1;var t=dt(),e=SF(),n=$u(),r=!n("isDisjointFrom",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isDisjointFrom:e}),QM}RF();var tI={},ny,nI;function EF(){if(nI)return ny;nI=1;var t=Du(),e=kf(),n=Df(),r=Lu();return ny=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},ny}var rI;function TF(){if(rI)return tI;rI=1;var t=dt(),e=EF(),n=$u(),r=!n("isSubsetOf",function(i){return i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSubsetOf:e}),tI}TF();var iI={},ry,oI;function _F(){if(oI)return ry;oI=1;var t=Du(),e=Ps().has,n=kf(),r=Lu(),i=ku(),o=Yi();return ry=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},ry}var sI;function MF(){if(sI)return iI;sI=1;var t=dt(),e=_F(),n=$u(),r=!n("isSupersetOf",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSupersetOf:e}),iI}MF();var aI={},iy,lI;function IF(){if(lI)return iy;lI=1;var t=Du(),e=Ps(),n=yE(),r=Lu(),i=ku(),o=e.add,s=e.has,a=e.remove;return iy=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},iy}var uI;function PF(){if(uI)return aI;uI=1;var t=dt(),e=IF(),n=$u();return t({target:"Set",proto:!0,real:!0,forced:!n("symmetricDifference")},{symmetricDifference:e}),aI}PF();var cI={},oy,hI;function OF(){if(hI)return oy;hI=1;var t=Du(),e=Ps().add,n=yE(),r=Lu(),i=ku();return oy=function(s){var a=t(this),l=r(s).getIterator(),u=n(a);return i(l,function(c){e(u,c)}),u},oy}var dI;function xF(){if(dI)return cI;dI=1;var t=dt(),e=OF(),n=$u();return t({target:"Set",proto:!0,real:!0,forced:!n("union")},{union:e}),cI}xF();var fI={},gI={},sy,mI;function AF(){if(mI)return sy;mI=1;var t=xf(),e=TypeError;return sy=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")},sy}var ay,pI;function HF(){if(pI)return ay;pI=1;var t=Cn();return ay=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),ay}var ly,wI;function w1(){if(wI)return ly;wI=1;var t=po(),e=an(),n=lh(),r=mE(),i=HF(),o=r("IE_PROTO"),s=Object,a=s.prototype;return ly=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},ly}var uy,vI;function NF(){if(vI)return uy;vI=1;var t=o1(),e=ml();return uy=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)},uy}var cy={},hy,CI;function DF(){if(CI)return hy;CI=1;var t=s1(),e=vE();return hy=Object.keys||function(r){return t(r,e)},hy}var yI;function kF(){if(yI)return cy;yI=1;var t=go(),e=r1(),n=ml(),r=ln(),i=Of(),o=DF();return cy.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},cy}var dy,bI;function v1(){if(bI)return dy;bI=1;var t=ah();return dy=t("document","documentElement"),dy}var fy,SI;function bE(){if(SI)return fy;SI=1;var t=ln(),e=kF(),n=vE(),r=pE(),i=v1(),o=gE(),s=mE(),a=">",l="<",u="prototype",c="script",h=s("IE_PROTO"),d=function(){},f=function(v){return l+c+a+v+l+"/"+c+a},g=function(v){v.write(f("")),v.close();var P=v.parentWindow.Object;return v=null,P},C=function(){var v=o("iframe"),P="java"+c+":",O;return v.style.display="none",i.appendChild(v),v.src=String(P),O=v.contentWindow.document,O.open(),O.write(f("document.F=Object")),O.close(),O.F},y,E=function(){try{y=new ActiveXObject("htmlfile")}catch{}E=typeof document<"u"?document.domain&&y?g(y):C():g(y);for(var v=n.length;v--;)delete E[u][n[v]];return E()};return r[h]=!0,fy=Object.create||function(P,O){var L;return P!==null?(d[u]=t(P),L=new d,d[u]=null,L[h]=P):L=E(),O===void 0?L:e.f(L,O)},fy}var gy,RI;function C1(){if(RI)return gy;RI=1;var t=Cn(),e=an(),n=mo(),r=bE(),i=w1(),o=wE(),s=Yo(),a=gl(),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 g={};return c[l].call(g)!==g});return f?c={}:a&&(c=r(c)),e(c[l])||o(c,l,function(){return this}),gy={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:u},gy}var EI;function LF(){if(EI)return gI;EI=1;var t=dt(),e=on(),n=AF(),r=ln(),i=an(),o=w1(),s=NF(),a=p1(),l=Cn(),u=po(),c=Yo(),h=C1().IteratorPrototype,d=go(),f=gl(),g="constructor",C="Iterator",y=c("toStringTag"),E=TypeError,v=e[C],P=f||!i(v)||v.prototype!==h||!l(function(){v({})}),O=function(){if(n(this,h),o(this)===h)throw new E("Abstract class Iterator not directly constructable")},L=function(T,A){d?s(h,T,{configurable:!0,get:function(){return A},set:function(K){if(r(this),this===h)throw new E("You can't redefine this property");u(this,T)?this[T]=K:a(this,T,K)}}):h[T]=A};return u(h,y)||L(y,C),(P||!u(h,g)||h[g]===Object)&&L(g,O),O.prototype=h,t({global:!0,constructor:!0,forced:P},{Iterator:O}),gI}var TI;function $F(){return TI||(TI=1,LF()),fI}$F();var _I={},MI={},my,II;function FF(){if(II)return my;II=1;var t=wE();return my=function(e,n,r){for(var i in n)t(e,i,n[i],r);return e},my}var py,PI;function VF(){return PI||(PI=1,py=function(t,e){return{value:t,done:e}}),py}var wy,OI;function SE(){if(OI)return wy;OI=1;var t=sn(),e=bE(),n=uh(),r=FF(),i=Yo(),o=i1(),s=Af(),a=C1().IteratorPrototype,l=VF(),u=Yi(),c=i("toStringTag"),h="IteratorHelper",d="WrapForValidIterator",f=o.set,g=function(E){var v=o.getterFor(E?d:h);return r(e(a),{next:function(){var O=v(this);if(E)return O.nextHandler();if(O.done)return l(void 0,!0);try{var L=O.nextHandler();return O.returnHandlerResult?L:l(L,O.done)}catch(T){throw O.done=!0,T}},return:function(){var P=v(this),O=P.iterator;if(P.done=!0,E){var L=s(O,"return");return L?t(L,O):l(void 0,!0)}if(P.inner)try{u(P.inner.iterator,"normal")}catch(T){return u(O,"throw",T)}return O&&u(O,"normal"),l(void 0,!0)}})},C=g(!0),y=g(!1);return n(y,c,"Iterator Helper"),wy=function(E,v,P){var O=function(T,A){A?(A.iterator=T.iterator,A.next=T.next):A=T,A.type=v?d:h,A.returnHandlerResult=!!P,A.nextHandler=E,A.counter=0,A.done=!1,f(this,A)};return O.prototype=v?C:y,O},wy}var vy,xI;function y1(){if(xI)return vy;xI=1;var t=ln(),e=Yi();return vy=function(n,r,i,o){try{return o?r(t(i)[0],i[1]):r(i)}catch(s){e(n,"throw",s)}},vy}var Cy,AI;function pl(){if(AI)return Cy;AI=1;var t=on();return Cy=function(e,n){var r=t.Iterator,i=r&&r.prototype,o=i&&i[e],s=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){s=!0}},-1)}catch(a){a instanceof n||(s=!1)}if(!s)return o},Cy}var HI;function WF(){if(HI)return MI;HI=1;var t=dt(),e=sn(),n=pr(),r=ln(),i=Os(),o=SE(),s=y1(),a=gl(),l=Yi(),u=pl(),c=!a&&u("filter",TypeError),h=o(function(){for(var d=this.iterator,f=this.predicate,g=this.next,C,y,E;;){if(C=r(e(g,d)),y=this.done=!!C.done,y)return;if(E=C.value,s(d,f,[E,this.counter++],!0))return E}});return t({target:"Iterator",proto:!0,real:!0,forced:a||c},{filter:function(f){r(this);try{n(f)}catch(g){l(this,"throw",g)}return c?e(c,this,f):new h(i(this),{predicate:f})}}),MI}var NI;function BF(){return NI||(NI=1,WF()),_I}BF();var DI={},kI={},LI;function jF(){if(LI)return kI;LI=1;var t=dt(),e=sn(),n=hh(),r=pr(),i=ln(),o=Os(),s=Yi(),a=pl(),l=a("forEach",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{forEach:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;n(h,function(f){c(f,d++)},{IS_RECORD:!0})}}),kI}var $I;function UF(){return $I||($I=1,jF()),DI}UF();var FI={},VI={},WI;function zF(){if(WI)return VI;WI=1;var t=dt(),e=sn(),n=pr(),r=ln(),i=Os(),o=SE(),s=y1(),a=Yi(),l=pl(),u=gl(),c=!u&&l("map",TypeError),h=o(function(){var d=this.iterator,f=r(e(this.next,d)),g=this.done=!!f.done;if(!g)return s(d,this.mapper,[f.value,this.counter++],!0)});return t({target:"Iterator",proto:!0,real:!0,forced:u||c},{map:function(f){r(this);try{n(f)}catch(g){a(this,"throw",g)}return c?e(c,this,f):new h(i(this),{mapper:f})}}),VI}var BI;function YF(){return BI||(BI=1,zF()),FI}YF();var jI={},UI={},yy,zI;function RE(){if(zI)return yy;zI=1;var t=qt();return yy=t([].slice),yy}var by,YI;function b1(){if(YI)return by;YI=1;var t=TypeError;return by=function(e,n){if(e<n)throw new t("Not enough arguments");return e},by}var Sy,GI;function GF(){if(GI)return Sy;GI=1;var t=aw();return Sy=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),Sy}var Ry,KI;function S1(){if(KI)return Ry;KI=1;var t=on(),e=aw(),n=Nu(),r=function(i){return e.slice(0,i.length)===i};return Ry=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"}(),Ry}var Ey,qI;function KF(){if(qI)return Ey;qI=1;var t=S1();return Ey=t==="NODE",Ey}var Ty,XI;function R1(){if(XI)return Ty;XI=1;var t=on(),e=Nf(),n=g1(),r=an(),i=po(),o=Cn(),s=v1(),a=RE(),l=gE(),u=b1(),c=GF(),h=KF(),d=t.setImmediate,f=t.clearImmediate,g=t.process,C=t.Dispatch,y=t.Function,E=t.MessageChannel,v=t.String,P=0,O={},L="onreadystatechange",T,A,K,U;o(function(){T=t.location});var j=function(te){if(i(O,te)){var ue=O[te];delete O[te],ue()}},Z=function(te){return function(){j(te)}},J=function(te){j(te.data)},se=function(te){t.postMessage(v(te),T.protocol+"//"+T.host)};return(!d||!f)&&(d=function(ue){u(arguments.length,1);var pt=r(ue)?ue:y(ue),be=a(arguments,1);return O[++P]=function(){e(pt,void 0,be)},A(P),P},f=function(ue){delete O[ue]},h?A=function(te){g.nextTick(Z(te))}:C&&C.now?A=function(te){C.now(Z(te))}:E&&!c?(K=new E,U=K.port2,K.port1.onmessage=J,A=n(U.postMessage,U)):t.addEventListener&&r(t.postMessage)&&!t.importScripts&&T&&T.protocol!=="file:"&&!o(se)?(A=se,t.addEventListener("message",J,!1)):L in l("script")?A=function(te){s.appendChild(l("script"))[L]=function(){s.removeChild(this),j(te)}}:A=function(te){setTimeout(Z(te),0)}),Ty={set:d,clear:f},Ty}var ZI;function qF(){if(ZI)return UI;ZI=1;var t=dt(),e=on(),n=R1().clear;return t({global:!0,bind:!0,enumerable:!0,forced:e.clearImmediate!==n},{clearImmediate:n}),UI}var QI={},_y,JI;function XF(){if(JI)return _y;JI=1;var t=on(),e=Nf(),n=an(),r=S1(),i=aw(),o=RE(),s=b1(),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 _y=function(u,c){var h=c?2:1;return l?function(d,f){var g=s(arguments.length,1)>h,C=n(d)?d:a(d),y=g?o(arguments,h):[],E=g?function(){e(C,this,y)}:C;return c?u(E,f):u(E)}:u},_y}var eP;function ZF(){if(eP)return QI;eP=1;var t=dt(),e=on(),n=R1().set,r=XF(),i=e.setImmediate?r(n,!1):n;return t({global:!0,bind:!0,enumerable:!0,forced:e.setImmediate!==i},{setImmediate:i}),QI}var tP;function QF(){return tP||(tP=1,qF(),ZF()),jI}QF();/*! @license DOMPurify 3.2.5 | (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.5/LICENSE */const{entries:E1,setPrototypeOf:nP,isFrozen:JF,getPrototypeOf:eV,getOwnPropertyDescriptor:tV}=Object;let{freeze:zn,seal:fo,create:T1}=Object,{apply:aR,construct:lR}=typeof Reflect<"u"&&Reflect;zn||(zn=function(e){return e});fo||(fo=function(e){return e});aR||(aR=function(e,n,r){return e.apply(n,r)});lR||(lR=function(e,n){return new e(...n)});const ig=Yn(Array.prototype.forEach),nV=Yn(Array.prototype.lastIndexOf),rP=Yn(Array.prototype.pop),Mh=Yn(Array.prototype.push),rV=Yn(Array.prototype.splice),Wm=Yn(String.prototype.toLowerCase),My=Yn(String.prototype.toString),iP=Yn(String.prototype.match),Ih=Yn(String.prototype.replace),iV=Yn(String.prototype.indexOf),oV=Yn(String.prototype.trim),xo=Yn(Object.prototype.hasOwnProperty),Dn=Yn(RegExp.prototype.test),Ph=sV(TypeError);function Yn(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return aR(t,e,r)}}function sV(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return lR(t,n)}}function Fe(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wm;nP&&nP(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=n(i);o!==i&&(JF(e)||(e[r]=o),i=o)}t[i]=!0}return t}function aV(t){for(let e=0;e<t.length;e++)xo(t,e)||(t[e]=null);return t}function lu(t){const e=T1(null);for(const[n,r]of E1(t))xo(t,n)&&(Array.isArray(r)?e[n]=aV(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=lu(r):e[n]=r);return e}function Oh(t,e){for(;t!==null;){const r=tV(t,e);if(r){if(r.get)return Yn(r.get);if(typeof r.value=="function")return Yn(r.value)}t=eV(t)}function n(){return null}return n}const oP=zn(["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"]),Iy=zn(["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"]),Py=zn(["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"]),lV=zn(["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"]),Oy=zn(["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"]),uV=zn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),sP=zn(["#text"]),aP=zn(["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"]),xy=zn(["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"]),lP=zn(["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"]),og=zn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),cV=fo(/\{\{[\w\W]*|[\w\W]*\}\}/gm),hV=fo(/<%[\w\W]*|[\w\W]*%>/gm),dV=fo(/\$\{[\w\W]*/gm),fV=fo(/^data-[\-\w.\u00B7-\uFFFF]+$/),gV=fo(/^aria-[\-\w]+$/),_1=fo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),mV=fo(/^(?:\w+script|data):/i),pV=fo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),M1=fo(/^html$/i),wV=fo(/^[a-z][.\w]*(-[.\w]+)+$/i);var uP=Object.freeze({__proto__:null,ARIA_ATTR:gV,ATTR_WHITESPACE:pV,CUSTOM_ELEMENT:wV,DATA_ATTR:fV,DOCTYPE_NAME:M1,ERB_EXPR:hV,IS_ALLOWED_URI:_1,IS_SCRIPT_OR_DATA:mV,MUSTACHE_EXPR:cV,TMPLIT_EXPR:dV});const xh={element:1,text:3,progressingInstruction:7,comment:8,document:9},vV=function(){return typeof window>"u"?null:window},CV=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}},cP=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function I1(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:vV();const e=we=>I1(we);if(e.version="3.2.5",e.removed=[],!t||!t.document||t.document.nodeType!==xh.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,g=l.prototype,C=Oh(g,"cloneNode"),y=Oh(g,"remove"),E=Oh(g,"nextSibling"),v=Oh(g,"childNodes"),P=Oh(g,"parentNode");if(typeof s=="function"){const we=n.createElement("template");we.content&&we.content.ownerDocument&&(n=we.content.ownerDocument)}let O,L="";const{implementation:T,createNodeIterator:A,createDocumentFragment:K,getElementsByTagName:U}=n,{importNode:j}=r;let Z=cP();e.isSupported=typeof E1=="function"&&typeof P=="function"&&T&&T.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:J,ERB_EXPR:se,TMPLIT_EXPR:te,DATA_ATTR:ue,ARIA_ATTR:pt,IS_SCRIPT_OR_DATA:be,ATTR_WHITESPACE:ke,CUSTOM_ELEMENT:wt}=uP;let{IS_ALLOWED_URI:fn}=uP,et=null;const m=Fe({},[...oP,...Iy,...Py,...Oy,...sP]);let w=null;const p=Fe({},[...aP,...xy,...lP,...og]);let I=Object.seal(T1(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}})),$=null,B=null,Y=!0,q=!0,b=!1,R=!0,S=!1,k=!0,_=!1,H=!1,W=!1,x=!1,N=!1,V=!1,F=!0,z=!1;const oe="user-content-";let ce=!0,Re=!1,Ne={},We=null;const Se=Fe({},["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 Le=null;const vt=Fe({},["audio","video","img","source","image","track"]);let yo=null;const Ns=Fe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ki="http://www.w3.org/1998/Math/MathML",Ct="http://www.w3.org/2000/svg",Zt="http://www.w3.org/1999/xhtml";let ft=Zt,yt=!1,$e=null;const qi=Fe({},[Ki,Ct,Zt],My);let yl=Fe({},["mi","mo","mn","ms","mtext"]),bl=Fe({},["annotation-xml"]);const A$=Fe({},["title","style","font","a","script"]);let Rh=null;const H$=["application/xhtml+xml","text/html"],N$="text/html";let gn=null,Uu=null;const D$=n.createElement("form"),AT=function(D){return D instanceof RegExp||D instanceof Function},iv=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Uu&&Uu===D)){if((!D||typeof D!="object")&&(D={}),D=lu(D),Rh=H$.indexOf(D.PARSER_MEDIA_TYPE)===-1?N$:D.PARSER_MEDIA_TYPE,gn=Rh==="application/xhtml+xml"?My:Wm,et=xo(D,"ALLOWED_TAGS")?Fe({},D.ALLOWED_TAGS,gn):m,w=xo(D,"ALLOWED_ATTR")?Fe({},D.ALLOWED_ATTR,gn):p,$e=xo(D,"ALLOWED_NAMESPACES")?Fe({},D.ALLOWED_NAMESPACES,My):qi,yo=xo(D,"ADD_URI_SAFE_ATTR")?Fe(lu(Ns),D.ADD_URI_SAFE_ATTR,gn):Ns,Le=xo(D,"ADD_DATA_URI_TAGS")?Fe(lu(vt),D.ADD_DATA_URI_TAGS,gn):vt,We=xo(D,"FORBID_CONTENTS")?Fe({},D.FORBID_CONTENTS,gn):Se,$=xo(D,"FORBID_TAGS")?Fe({},D.FORBID_TAGS,gn):{},B=xo(D,"FORBID_ATTR")?Fe({},D.FORBID_ATTR,gn):{},Ne=xo(D,"USE_PROFILES")?D.USE_PROFILES:!1,Y=D.ALLOW_ARIA_ATTR!==!1,q=D.ALLOW_DATA_ATTR!==!1,b=D.ALLOW_UNKNOWN_PROTOCOLS||!1,R=D.ALLOW_SELF_CLOSE_IN_ATTR!==!1,S=D.SAFE_FOR_TEMPLATES||!1,k=D.SAFE_FOR_XML!==!1,_=D.WHOLE_DOCUMENT||!1,x=D.RETURN_DOM||!1,N=D.RETURN_DOM_FRAGMENT||!1,V=D.RETURN_TRUSTED_TYPE||!1,W=D.FORCE_BODY||!1,F=D.SANITIZE_DOM!==!1,z=D.SANITIZE_NAMED_PROPS||!1,ce=D.KEEP_CONTENT!==!1,Re=D.IN_PLACE||!1,fn=D.ALLOWED_URI_REGEXP||_1,ft=D.NAMESPACE||Zt,yl=D.MATHML_TEXT_INTEGRATION_POINTS||yl,bl=D.HTML_INTEGRATION_POINTS||bl,I=D.CUSTOM_ELEMENT_HANDLING||{},D.CUSTOM_ELEMENT_HANDLING&&AT(D.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(I.tagNameCheck=D.CUSTOM_ELEMENT_HANDLING.tagNameCheck),D.CUSTOM_ELEMENT_HANDLING&&AT(D.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(I.attributeNameCheck=D.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),D.CUSTOM_ELEMENT_HANDLING&&typeof D.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(I.allowCustomizedBuiltInElements=D.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),S&&(q=!1),N&&(x=!0),Ne&&(et=Fe({},sP),w=[],Ne.html===!0&&(Fe(et,oP),Fe(w,aP)),Ne.svg===!0&&(Fe(et,Iy),Fe(w,xy),Fe(w,og)),Ne.svgFilters===!0&&(Fe(et,Py),Fe(w,xy),Fe(w,og)),Ne.mathMl===!0&&(Fe(et,Oy),Fe(w,lP),Fe(w,og))),D.ADD_TAGS&&(et===m&&(et=lu(et)),Fe(et,D.ADD_TAGS,gn)),D.ADD_ATTR&&(w===p&&(w=lu(w)),Fe(w,D.ADD_ATTR,gn)),D.ADD_URI_SAFE_ATTR&&Fe(yo,D.ADD_URI_SAFE_ATTR,gn),D.FORBID_CONTENTS&&(We===Se&&(We=lu(We)),Fe(We,D.FORBID_CONTENTS,gn)),ce&&(et["#text"]=!0),_&&Fe(et,["html","head","body"]),et.table&&(Fe(et,["tbody"]),delete $.tbody),D.TRUSTED_TYPES_POLICY){if(typeof D.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ph('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof D.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ph('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');O=D.TRUSTED_TYPES_POLICY,L=O.createHTML("")}else O===void 0&&(O=CV(f,i)),O!==null&&typeof L=="string"&&(L=O.createHTML(""));zn&&zn(D),Uu=D}},HT=Fe({},[...Iy,...Py,...lV]),NT=Fe({},[...Oy,...uV]),k$=function(D){let ee=P(D);(!ee||!ee.tagName)&&(ee={namespaceURI:ft,tagName:"template"});const ge=Wm(D.tagName),_t=Wm(ee.tagName);return $e[D.namespaceURI]?D.namespaceURI===Ct?ee.namespaceURI===Zt?ge==="svg":ee.namespaceURI===Ki?ge==="svg"&&(_t==="annotation-xml"||yl[_t]):!!HT[ge]:D.namespaceURI===Ki?ee.namespaceURI===Zt?ge==="math":ee.namespaceURI===Ct?ge==="math"&&bl[_t]:!!NT[ge]:D.namespaceURI===Zt?ee.namespaceURI===Ct&&!bl[_t]||ee.namespaceURI===Ki&&!yl[_t]?!1:!NT[ge]&&(A$[ge]||!HT[ge]):!!(Rh==="application/xhtml+xml"&&$e[D.namespaceURI]):!1},Xo=function(D){Mh(e.removed,{element:D});try{P(D).removeChild(D)}catch{y(D)}},rg=function(D,ee){try{Mh(e.removed,{attribute:ee.getAttributeNode(D),from:ee})}catch{Mh(e.removed,{attribute:null,from:ee})}if(ee.removeAttribute(D),D==="is")if(x||N)try{Xo(ee)}catch{}else try{ee.setAttribute(D,"")}catch{}},DT=function(D){let ee=null,ge=null;if(W)D="<remove></remove>"+D;else{const yn=iP(D,/^[\r\n\t ]+/);ge=yn&&yn[0]}Rh==="application/xhtml+xml"&&ft===Zt&&(D='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+D+"</body></html>");const _t=O?O.createHTML(D):D;if(ft===Zt)try{ee=new d().parseFromString(_t,Rh)}catch{}if(!ee||!ee.documentElement){ee=T.createDocument(ft,"template",null);try{ee.documentElement.innerHTML=yt?L:_t}catch{}}const En=ee.body||ee.documentElement;return D&&ge&&En.insertBefore(n.createTextNode(ge),En.childNodes[0]||null),ft===Zt?U.call(ee,_?"html":"body")[0]:_?ee.documentElement:En},kT=function(D){return A.call(D.ownerDocument||D,D,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},ov=function(D){return D instanceof h&&(typeof D.nodeName!="string"||typeof D.textContent!="string"||typeof D.removeChild!="function"||!(D.attributes instanceof c)||typeof D.removeAttribute!="function"||typeof D.setAttribute!="function"||typeof D.namespaceURI!="string"||typeof D.insertBefore!="function"||typeof D.hasChildNodes!="function")},LT=function(D){return typeof a=="function"&&D instanceof a};function Ds(we,D,ee){ig(we,ge=>{ge.call(e,D,ee,Uu)})}const $T=function(D){let ee=null;if(Ds(Z.beforeSanitizeElements,D,null),ov(D))return Xo(D),!0;const ge=gn(D.nodeName);if(Ds(Z.uponSanitizeElement,D,{tagName:ge,allowedTags:et}),D.hasChildNodes()&&!LT(D.firstElementChild)&&Dn(/<[/\w!]/g,D.innerHTML)&&Dn(/<[/\w!]/g,D.textContent)||D.nodeType===xh.progressingInstruction||k&&D.nodeType===xh.comment&&Dn(/<[/\w]/g,D.data))return Xo(D),!0;if(!et[ge]||$[ge]){if(!$[ge]&&VT(ge)&&(I.tagNameCheck instanceof RegExp&&Dn(I.tagNameCheck,ge)||I.tagNameCheck instanceof Function&&I.tagNameCheck(ge)))return!1;if(ce&&!We[ge]){const _t=P(D)||D.parentNode,En=v(D)||D.childNodes;if(En&&_t){const yn=En.length;for(let Jn=yn-1;Jn>=0;--Jn){const Zo=C(En[Jn],!0);Zo.__removalCount=(D.__removalCount||0)+1,_t.insertBefore(Zo,E(D))}}}return Xo(D),!0}return D instanceof l&&!k$(D)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&Dn(/<\/no(script|embed|frames)/i,D.innerHTML)?(Xo(D),!0):(S&&D.nodeType===xh.text&&(ee=D.textContent,ig([J,se,te],_t=>{ee=Ih(ee,_t," ")}),D.textContent!==ee&&(Mh(e.removed,{element:D.cloneNode()}),D.textContent=ee)),Ds(Z.afterSanitizeElements,D,null),!1)},FT=function(D,ee,ge){if(F&&(ee==="id"||ee==="name")&&(ge in n||ge in D$))return!1;if(!(q&&!B[ee]&&Dn(ue,ee))){if(!(Y&&Dn(pt,ee))){if(!w[ee]||B[ee]){if(!(VT(D)&&(I.tagNameCheck instanceof RegExp&&Dn(I.tagNameCheck,D)||I.tagNameCheck instanceof Function&&I.tagNameCheck(D))&&(I.attributeNameCheck instanceof RegExp&&Dn(I.attributeNameCheck,ee)||I.attributeNameCheck instanceof Function&&I.attributeNameCheck(ee))||ee==="is"&&I.allowCustomizedBuiltInElements&&(I.tagNameCheck instanceof RegExp&&Dn(I.tagNameCheck,ge)||I.tagNameCheck instanceof Function&&I.tagNameCheck(ge))))return!1}else if(!yo[ee]){if(!Dn(fn,Ih(ge,ke,""))){if(!((ee==="src"||ee==="xlink:href"||ee==="href")&&D!=="script"&&iV(ge,"data:")===0&&Le[D])){if(!(b&&!Dn(be,Ih(ge,ke,"")))){if(ge)return!1}}}}}}return!0},VT=function(D){return D!=="annotation-xml"&&iP(D,wt)},WT=function(D){Ds(Z.beforeSanitizeAttributes,D,null);const{attributes:ee}=D;if(!ee||ov(D))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:w,forceKeepAttr:void 0};let _t=ee.length;for(;_t--;){const En=ee[_t],{name:yn,namespaceURI:Jn,value:Zo}=En,Eh=gn(yn);let Nn=yn==="value"?Zo:oV(Zo);if(ge.attrName=Eh,ge.attrValue=Nn,ge.keepAttr=!0,ge.forceKeepAttr=void 0,Ds(Z.uponSanitizeAttribute,D,ge),Nn=ge.attrValue,z&&(Eh==="id"||Eh==="name")&&(rg(yn,D),Nn=oe+Nn),k&&Dn(/((--!?|])>)|<\/(style|title)/i,Nn)){rg(yn,D);continue}if(ge.forceKeepAttr||(rg(yn,D),!ge.keepAttr))continue;if(!R&&Dn(/\/>/i,Nn)){rg(yn,D);continue}S&&ig([J,se,te],jT=>{Nn=Ih(Nn,jT," ")});const BT=gn(D.nodeName);if(FT(BT,Eh,Nn)){if(O&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Jn)switch(f.getAttributeType(BT,Eh)){case"TrustedHTML":{Nn=O.createHTML(Nn);break}case"TrustedScriptURL":{Nn=O.createScriptURL(Nn);break}}try{Jn?D.setAttributeNS(Jn,yn,Nn):D.setAttribute(yn,Nn),ov(D)?Xo(D):rP(e.removed)}catch{}}}Ds(Z.afterSanitizeAttributes,D,null)},L$=function we(D){let ee=null;const ge=kT(D);for(Ds(Z.beforeSanitizeShadowDOM,D,null);ee=ge.nextNode();)Ds(Z.uponSanitizeShadowNode,ee,null),$T(ee),WT(ee),ee.content instanceof o&&we(ee.content);Ds(Z.afterSanitizeShadowDOM,D,null)};return e.sanitize=function(we){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=null,ge=null,_t=null,En=null;if(yt=!we,yt&&(we="<!-->"),typeof we!="string"&&!LT(we))if(typeof we.toString=="function"){if(we=we.toString(),typeof we!="string")throw Ph("dirty is not a string, aborting")}else throw Ph("toString is not a function");if(!e.isSupported)return we;if(H||iv(D),e.removed=[],typeof we=="string"&&(Re=!1),Re){if(we.nodeName){const Zo=gn(we.nodeName);if(!et[Zo]||$[Zo])throw Ph("root node is forbidden and cannot be sanitized in-place")}}else if(we instanceof a)ee=DT("<!---->"),ge=ee.ownerDocument.importNode(we,!0),ge.nodeType===xh.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?ee=ge:ee.appendChild(ge);else{if(!x&&!S&&!_&&we.indexOf("<")===-1)return O&&V?O.createHTML(we):we;if(ee=DT(we),!ee)return x?null:V?L:""}ee&&W&&Xo(ee.firstChild);const yn=kT(Re?we:ee);for(;_t=yn.nextNode();)$T(_t),WT(_t),_t.content instanceof o&&L$(_t.content);if(Re)return we;if(x){if(N)for(En=K.call(ee.ownerDocument);ee.firstChild;)En.appendChild(ee.firstChild);else En=ee;return(w.shadowroot||w.shadowrootmode)&&(En=j.call(r,En,!0)),En}let Jn=_?ee.outerHTML:ee.innerHTML;return _&&et["!doctype"]&&ee.ownerDocument&&ee.ownerDocument.doctype&&ee.ownerDocument.doctype.name&&Dn(M1,ee.ownerDocument.doctype.name)&&(Jn="<!DOCTYPE "+ee.ownerDocument.doctype.name+`>
2
+ `+Jn),S&&ig([J,se,te],Zo=>{Jn=Ih(Jn,Zo," ")}),O&&V?O.createHTML(Jn):Jn},e.setConfig=function(){let we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};iv(we),H=!0},e.clearConfig=function(){Uu=null,H=!1},e.isValidAttribute=function(we,D,ee){Uu||iv({});const ge=gn(we),_t=gn(D);return FT(ge,_t,ee)},e.addHook=function(we,D){typeof D=="function"&&Mh(Z[we],D)},e.removeHook=function(we,D){if(D!==void 0){const ee=nV(Z[we],D);return ee===-1?void 0:rV(Z[we],ee,1)[0]}return rP(Z[we])},e.removeHooks=function(we){Z[we]=[]},e.removeAllHooks=function(){Z=cP()},e}var yV=I1();//! moment.js
3
+ //! version : 2.30.1
4
+ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
5
+ //! license : MIT
6
+ //! momentjs.com
7
+ var P1;function X(){return P1.apply(null,arguments)}function bV(t){P1=t}function Bo(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function bu(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function Qe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function EE(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(Qe(t,e))return!1;return!0}function ur(t){return t===void 0}function wa(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function Lf(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function O1(t,e){var n=[],r,i=t.length;for(r=0;r<i;++r)n.push(e(t[r],r));return n}function tl(t,e){for(var n in e)Qe(e,n)&&(t[n]=e[n]);return Qe(e,"toString")&&(t.toString=e.toString),Qe(e,"valueOf")&&(t.valueOf=e.valueOf),t}function xs(t,e,n,r){return J1(t,e,n,r,!0).utc()}function SV(){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=SV()),t._pf}var uR;Array.prototype.some?uR=Array.prototype.some:uR=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 TE(t){var e=null,n=!1,r=t._d&&!isNaN(t._d.getTime());if(r&&(e=Pe(t),n=uR.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 cw(t){var e=xs(NaN);return t!=null?tl(Pe(e),t):Pe(e).userInvalidated=!0,e}var hP=X.momentProperties=[],Ay=!1;function _E(t,e){var n,r,i,o=hP.length;if(ur(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),ur(e._i)||(t._i=e._i),ur(e._f)||(t._f=e._f),ur(e._l)||(t._l=e._l),ur(e._strict)||(t._strict=e._strict),ur(e._tzm)||(t._tzm=e._tzm),ur(e._isUTC)||(t._isUTC=e._isUTC),ur(e._offset)||(t._offset=e._offset),ur(e._pf)||(t._pf=Pe(e)),ur(e._locale)||(t._locale=e._locale),o>0)for(n=0;n<o;n++)r=hP[n],i=e[r],ur(i)||(t[r]=i);return t}function $f(t){_E(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Ay===!1&&(Ay=!0,X.updateOffset(this),Ay=!1)}function jo(t){return t instanceof $f||t!=null&&t._isAMomentObject!=null}function x1(t){X.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function wo(t,e){var n=!0;return tl(function(){if(X.deprecationHandler!=null&&X.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])Qe(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[o];r.push(i)}x1(t+`
9
+ Arguments: `+Array.prototype.slice.call(r).join("")+`
10
+ `+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var dP={};function A1(t,e){X.deprecationHandler!=null&&X.deprecationHandler(t,e),dP[t]||(x1(e),dP[t]=!0)}X.suppressDeprecationWarnings=!1;X.deprecationHandler=null;function As(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function RV(t){var e,n;for(n in t)Qe(t,n)&&(e=t[n],As(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 cR(t,e){var n=tl({},t),r;for(r in e)Qe(e,r)&&(bu(t[r])&&bu(e[r])?(n[r]={},tl(n[r],t[r]),tl(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)Qe(t,r)&&!Qe(e,r)&&bu(t[r])&&(n[r]=tl({},n[r]));return n}function ME(t){t!=null&&this.set(t)}var hR;Object.keys?hR=Object.keys:hR=function(t){var e,n=[];for(e in t)Qe(t,e)&&n.push(e);return n};var EV={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function TV(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return As(r)?r.call(e,n):r}function Ms(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 IE=/(\[[^\[]*\])|(\\)?([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,sg=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Hy={},Uc={};function Ce(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(Uc[t]=i),e&&(Uc[e[0]]=function(){return Ms(i.apply(this,arguments),e[1],e[2])}),n&&(Uc[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function _V(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function MV(t){var e=t.match(IE),n,r;for(n=0,r=e.length;n<r;n++)Uc[e[n]]?e[n]=Uc[e[n]]:e[n]=_V(e[n]);return function(i){var o="",s;for(s=0;s<r;s++)o+=As(e[s])?e[s].call(i,t):e[s];return o}}function Bm(t,e){return t.isValid()?(e=H1(e,t.localeData()),Hy[e]=Hy[e]||MV(e),Hy[e](t)):t.localeData().invalidDate()}function H1(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(sg.lastIndex=0;n>=0&&sg.test(t);)t=t.replace(sg,r),sg.lastIndex=0,n-=1;return t}var IV={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function PV(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(IE).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var OV="Invalid date";function xV(){return this._invalidDate}var AV="%d",HV=/\d{1,2}/;function NV(t){return this._ordinal.replace("%d",t)}var DV={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 kV(t,e,n,r){var i=this._relativeTime[n];return As(i)?i(t,e,n,r):i.replace(/%d/i,t)}function LV(t,e){var n=this._relativeTime[t>0?"future":"past"];return As(n)?n(e):n.replace(/%s/i,e)}var fP={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 vo(t){return typeof t=="string"?fP[t]||fP[t.toLowerCase()]:void 0}function PE(t){var e={},n,r;for(r in t)Qe(t,r)&&(n=vo(r),n&&(e[n]=t[r]));return e}var $V={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 FV(t){var e=[],n;for(n in t)Qe(t,n)&&e.push({unit:n,priority:$V[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var N1=/\d/,Gi=/\d\d/,D1=/\d{3}/,OE=/\d{4}/,hw=/[+-]?\d{6}/,Tt=/\d\d?/,k1=/\d\d\d\d?/,L1=/\d\d\d\d\d\d?/,dw=/\d{1,3}/,xE=/\d{1,4}/,fw=/[+-]?\d{1,6}/,dh=/\d+/,gw=/[+-]?\d+/,VV=/Z|[+-]\d\d:?\d\d/gi,mw=/Z|[+-]\d\d(?::?\d\d)?/gi,WV=/[+-]?\d+(\.\d{1,3})?/,Ff=/[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,fh=/^[1-9]\d?/,AE=/^([1-9]\d|\d)/,cp;cp={};function le(t,e,n){cp[t]=As(e)?e:function(r,i){return r&&n?n:e}}function BV(t,e){return Qe(cp,t)?cp[t](e._strict,e._locale):new RegExp(jV(t))}function jV(t){return ga(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,o){return n||r||i||o}))}function ga(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function lo(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function je(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=lo(e)),n}var dR={};function ct(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),wa(e)&&(r=function(o,s){s[e]=je(o)}),i=t.length,n=0;n<i;n++)dR[t[n]]=r}function Vf(t,e){ct(t,function(n,r,i,o){i._w=i._w||{},e(n,i._w,i,o)})}function UV(t,e,n){e!=null&&Qe(dR,t)&&dR[t](e,n._a,n,t)}function pw(t){return t%4===0&&t%100!==0||t%400===0}var Hn=0,sa=1,Ss=2,dn=3,Fo=4,aa=5,mu=6,zV=7,YV=8;Ce("Y",0,0,function(){var t=this.year();return t<=9999?Ms(t,4):"+"+t});Ce(0,["YY",2],0,function(){return this.year()%100});Ce(0,["YYYY",4],0,"year");Ce(0,["YYYYY",5],0,"year");Ce(0,["YYYYYY",6,!0],0,"year");le("Y",gw);le("YY",Tt,Gi);le("YYYY",xE,OE);le("YYYYY",fw,hw);le("YYYYYY",fw,hw);ct(["YYYYY","YYYYYY"],Hn);ct("YYYY",function(t,e){e[Hn]=t.length===2?X.parseTwoDigitYear(t):je(t)});ct("YY",function(t,e){e[Hn]=X.parseTwoDigitYear(t)});ct("Y",function(t,e){e[Hn]=parseInt(t,10)});function Ld(t){return pw(t)?366:365}X.parseTwoDigitYear=function(t){return je(t)+(je(t)>68?1900:2e3)};var $1=gh("FullYear",!0);function GV(){return pw(this.year())}function gh(t,e){return function(n){return n!=null?(F1(this,t,n),X.updateOffset(this,e),this):af(this,t)}}function af(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 F1(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&&!pw(o)?28:a,i?r.setUTCFullYear(o,s,a):r.setFullYear(o,s,a)}}function KV(t){return t=vo(t),As(this[t])?this[t]():this}function qV(t,e){if(typeof t=="object"){t=PE(t);var n=FV(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=vo(t),As(this[t]))return this[t](e);return this}function XV(t,e){return(t%e+e)%e}var Gt;Array.prototype.indexOf?Gt=Array.prototype.indexOf:Gt=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function HE(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=XV(e,12);return t+=(e-n)/12,n===1?pw(t)?29:28:31-n%7%2}Ce("M",["MM",2],"Mo",function(){return this.month()+1});Ce("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)});Ce("MMMM",0,0,function(t){return this.localeData().months(this,t)});le("M",Tt,fh);le("MM",Tt,Gi);le("MMM",function(t,e){return e.monthsShortRegex(t)});le("MMMM",function(t,e){return e.monthsRegex(t)});ct(["M","MM"],function(t,e){e[sa]=je(t)-1});ct(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[sa]=i:Pe(n).invalidMonth=t});var ZV="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),V1="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),W1=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,QV=Ff,JV=Ff;function eW(t,e){return t?Bo(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||W1).test(e)?"format":"standalone"][t.month()]:Bo(this._months)?this._months:this._months.standalone}function tW(t,e){return t?Bo(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[W1.test(e)?"format":"standalone"][t.month()]:Bo(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function nW(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=xs([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?e==="MMM"?(i=Gt.call(this._shortMonthsParse,s),i!==-1?i:null):(i=Gt.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=Gt.call(this._shortMonthsParse,s),i!==-1?i:(i=Gt.call(this._longMonthsParse,s),i!==-1?i:null)):(i=Gt.call(this._longMonthsParse,s),i!==-1?i:(i=Gt.call(this._shortMonthsParse,s),i!==-1?i:null))}function rW(t,e,n){var r,i,o;if(this._monthsParseExact)return nW.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=xs([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 B1(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=je(e);else if(e=t.localeData().monthsParse(e),!wa(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,HE(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function j1(t){return t!=null?(B1(this,t),X.updateOffset(this,!0),this):af(this,"Month")}function iW(){return HE(this.year(),this.month())}function oW(t){return this._monthsParseExact?(Qe(this,"_monthsRegex")||U1.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(Qe(this,"_monthsShortRegex")||(this._monthsShortRegex=QV),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function sW(t){return this._monthsParseExact?(Qe(this,"_monthsRegex")||U1.call(this),t?this._monthsStrictRegex:this._monthsRegex):(Qe(this,"_monthsRegex")||(this._monthsRegex=JV),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function U1(){function t(l,u){return u.length-l.length}var e=[],n=[],r=[],i,o,s,a;for(i=0;i<12;i++)o=xs([2e3,i]),s=ga(this.monthsShort(o,"")),a=ga(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 aW(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 lf(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 hp(t,e,n){var r=7+e-n,i=(7+lf(t,0,r).getUTCDay()-e)%7;return-i+r-1}function z1(t,e,n,r,i){var o=(7+n-r)%7,s=hp(t,r,i),a=1+7*(e-1)+o+s,l,u;return a<=0?(l=t-1,u=Ld(l)+a):a>Ld(t)?(l=t+1,u=a-Ld(t)):(l=t,u=a),{year:l,dayOfYear:u}}function uf(t,e,n){var r=hp(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,o,s;return i<1?(s=t.year()-1,o=i+ma(s,e,n)):i>ma(t.year(),e,n)?(o=i-ma(t.year(),e,n),s=t.year()+1):(s=t.year(),o=i),{week:o,year:s}}function ma(t,e,n){var r=hp(t,e,n),i=hp(t+1,e,n);return(Ld(t)-r+i)/7}Ce("w",["ww",2],"wo","week");Ce("W",["WW",2],"Wo","isoWeek");le("w",Tt,fh);le("ww",Tt,Gi);le("W",Tt,fh);le("WW",Tt,Gi);Vf(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=je(t)});function lW(t){return uf(t,this._week.dow,this._week.doy).week}var uW={dow:0,doy:6};function cW(){return this._week.dow}function hW(){return this._week.doy}function dW(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function fW(t){var e=uf(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Ce("d",0,"do","day");Ce("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});Ce("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});Ce("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});Ce("e",0,0,"weekday");Ce("E",0,0,"isoWeekday");le("d",Tt);le("e",Tt);le("E",Tt);le("dd",function(t,e){return e.weekdaysMinRegex(t)});le("ddd",function(t,e){return e.weekdaysShortRegex(t)});le("dddd",function(t,e){return e.weekdaysRegex(t)});Vf(["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});Vf(["d","e","E"],function(t,e,n,r){e[r]=je(t)});function gW(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function mW(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function NE(t,e){return t.slice(e,7).concat(t.slice(0,e))}var pW="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Y1="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),wW="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),vW=Ff,CW=Ff,yW=Ff;function bW(t,e){var n=Bo(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?NE(n,this._week.dow):t?n[t.day()]:n}function SW(t){return t===!0?NE(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function RW(t){return t===!0?NE(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function EW(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=xs([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=Gt.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=Gt.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Gt.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=Gt.call(this._weekdaysParse,s),i!==-1||(i=Gt.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Gt.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=Gt.call(this._shortWeekdaysParse,s),i!==-1||(i=Gt.call(this._weekdaysParse,s),i!==-1)?i:(i=Gt.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Gt.call(this._minWeekdaysParse,s),i!==-1||(i=Gt.call(this._weekdaysParse,s),i!==-1)?i:(i=Gt.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function TW(t,e,n){var r,i,o;if(this._weekdaysParseExact)return EW.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=xs([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 _W(t){if(!this.isValid())return t!=null?this:NaN;var e=af(this,"Day");return t!=null?(t=gW(t,this.localeData()),this.add(t-e,"d")):e}function MW(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function IW(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=mW(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function PW(t){return this._weekdaysParseExact?(Qe(this,"_weekdaysRegex")||DE.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Qe(this,"_weekdaysRegex")||(this._weekdaysRegex=vW),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function OW(t){return this._weekdaysParseExact?(Qe(this,"_weekdaysRegex")||DE.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Qe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=CW),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function xW(t){return this._weekdaysParseExact?(Qe(this,"_weekdaysRegex")||DE.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Qe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=yW),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function DE(){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=xs([2e3,1]).day(o),a=ga(this.weekdaysMin(s,"")),l=ga(this.weekdaysShort(s,"")),u=ga(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 kE(){return this.hours()%12||12}function AW(){return this.hours()||24}Ce("H",["HH",2],0,"hour");Ce("h",["hh",2],0,kE);Ce("k",["kk",2],0,AW);Ce("hmm",0,0,function(){return""+kE.apply(this)+Ms(this.minutes(),2)});Ce("hmmss",0,0,function(){return""+kE.apply(this)+Ms(this.minutes(),2)+Ms(this.seconds(),2)});Ce("Hmm",0,0,function(){return""+this.hours()+Ms(this.minutes(),2)});Ce("Hmmss",0,0,function(){return""+this.hours()+Ms(this.minutes(),2)+Ms(this.seconds(),2)});function G1(t,e){Ce(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}G1("a",!0);G1("A",!1);function K1(t,e){return e._meridiemParse}le("a",K1);le("A",K1);le("H",Tt,AE);le("h",Tt,fh);le("k",Tt,fh);le("HH",Tt,Gi);le("hh",Tt,Gi);le("kk",Tt,Gi);le("hmm",k1);le("hmmss",L1);le("Hmm",k1);le("Hmmss",L1);ct(["H","HH"],dn);ct(["k","kk"],function(t,e,n){var r=je(t);e[dn]=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[dn]=je(t),Pe(n).bigHour=!0});ct("hmm",function(t,e,n){var r=t.length-2;e[dn]=je(t.substr(0,r)),e[Fo]=je(t.substr(r)),Pe(n).bigHour=!0});ct("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[dn]=je(t.substr(0,r)),e[Fo]=je(t.substr(r,2)),e[aa]=je(t.substr(i)),Pe(n).bigHour=!0});ct("Hmm",function(t,e,n){var r=t.length-2;e[dn]=je(t.substr(0,r)),e[Fo]=je(t.substr(r))});ct("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[dn]=je(t.substr(0,r)),e[Fo]=je(t.substr(r,2)),e[aa]=je(t.substr(i))});function HW(t){return(t+"").toLowerCase().charAt(0)==="p"}var NW=/[ap]\.?m?\.?/i,DW=gh("Hours",!0);function kW(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var q1={calendar:EV,longDateFormat:IV,invalidDate:OV,ordinal:AV,dayOfMonthOrdinalParse:HV,relativeTime:DV,months:ZV,monthsShort:V1,week:uW,weekdays:pW,weekdaysMin:wW,weekdaysShort:Y1,meridiemParse:NW},Mt={},Ah={},cf;function LW(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 gP(t){return t&&t.toLowerCase().replace("_","-")}function $W(t){for(var e=0,n,r,i,o;e<t.length;){for(o=gP(t[e]).split("-"),n=o.length,r=gP(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=ww(o.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&LW(o,r)>=n-1)break;n--}e++}return cf}function FW(t){return!!(t&&t.match("^[^/\\\\]*$"))}function ww(t){var e=null,n;if(Mt[t]===void 0&&typeof module<"u"&&module&&module.exports&&FW(t))try{e=cf._abbr,n=require,n("./locale/"+t),ll(e)}catch{Mt[t]=null}return Mt[t]}function ll(t,e){var n;return t&&(ur(e)?n=Sa(t):n=LE(t,e),n?cf=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),cf._abbr}function LE(t,e){if(e!==null){var n,r=q1;if(e.abbr=t,Mt[t]!=null)A1("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=Mt[t]._config;else if(e.parentLocale!=null)if(Mt[e.parentLocale]!=null)r=Mt[e.parentLocale]._config;else if(n=ww(e.parentLocale),n!=null)r=n._config;else return Ah[e.parentLocale]||(Ah[e.parentLocale]=[]),Ah[e.parentLocale].push({name:t,config:e}),null;return Mt[t]=new ME(cR(r,e)),Ah[t]&&Ah[t].forEach(function(i){LE(i.name,i.config)}),ll(t),Mt[t]}else return delete Mt[t],null}function VW(t,e){if(e!=null){var n,r,i=q1;Mt[t]!=null&&Mt[t].parentLocale!=null?Mt[t].set(cR(Mt[t]._config,e)):(r=ww(t),r!=null&&(i=r._config),e=cR(i,e),r==null&&(e.abbr=t),n=new ME(e),n.parentLocale=Mt[t],Mt[t]=n),ll(t)}else Mt[t]!=null&&(Mt[t].parentLocale!=null?(Mt[t]=Mt[t].parentLocale,t===ll()&&ll(t)):Mt[t]!=null&&delete Mt[t]);return Mt[t]}function Sa(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return cf;if(!Bo(t)){if(e=ww(t),e)return e;t=[t]}return $W(t)}function WW(){return hR(Mt)}function $E(t){var e,n=t._a;return n&&Pe(t).overflow===-2&&(e=n[sa]<0||n[sa]>11?sa:n[Ss]<1||n[Ss]>HE(n[Hn],n[sa])?Ss:n[dn]<0||n[dn]>24||n[dn]===24&&(n[Fo]!==0||n[aa]!==0||n[mu]!==0)?dn:n[Fo]<0||n[Fo]>59?Fo:n[aa]<0||n[aa]>59?aa:n[mu]<0||n[mu]>999?mu:-1,Pe(t)._overflowDayOfYear&&(e<Hn||e>Ss)&&(e=Ss),Pe(t)._overflowWeeks&&e===-1&&(e=zV),Pe(t)._overflowWeekday&&e===-1&&(e=YV),Pe(t).overflow=e),t}var BW=/^\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)?)?$/,jW=/^\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)?)?$/,UW=/Z|[+-]\d\d(?::?\d\d)?/,ag=[["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]],Ny=[["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/]],zW=/^\/?Date\((-?\d+)/i,YW=/^(?:(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}))$/,GW={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 X1(t){var e,n,r=t._i,i=BW.exec(r)||jW.exec(r),o,s,a,l,u=ag.length,c=Ny.length;if(i){for(Pe(t).iso=!0,e=0,n=u;e<n;e++)if(ag[e][1].exec(i[1])){s=ag[e][0],o=ag[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(i[3]){for(e=0,n=c;e<n;e++)if(Ny[e][1].exec(i[3])){a=(i[2]||" ")+Ny[e][0];break}if(a==null){t._isValid=!1;return}}if(!o&&a!=null){t._isValid=!1;return}if(i[4])if(UW.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=s+(a||"")+(l||""),VE(t)}else t._isValid=!1}function KW(t,e,n,r,i,o){var s=[qW(t),V1.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return o&&s.push(parseInt(o,10)),s}function qW(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function XW(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function ZW(t,e,n){if(t){var r=Y1.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 QW(t,e,n){if(t)return GW[t];if(e)return 0;var r=parseInt(n,10),i=r%100,o=(r-i)/100;return o*60+i}function Z1(t){var e=YW.exec(XW(t._i)),n;if(e){if(n=KW(e[4],e[3],e[2],e[5],e[6],e[7]),!ZW(e[1],n,t))return;t._a=n,t._tzm=QW(e[8],e[9],e[10]),t._d=lf.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),Pe(t).rfc2822=!0}else t._isValid=!1}function JW(t){var e=zW.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(X1(t),t._isValid===!1)delete t._isValid;else return;if(Z1(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:X.createFromInputFallback(t)}X.createFromInputFallback=wo("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 Pc(t,e,n){return t??e??n}function eB(t){var e=new Date(X.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function FE(t){var e,n,r=[],i,o,s;if(!t._d){for(i=eB(t),t._w&&t._a[Ss]==null&&t._a[sa]==null&&tB(t),t._dayOfYear!=null&&(s=Pc(t._a[Hn],i[Hn]),(t._dayOfYear>Ld(s)||t._dayOfYear===0)&&(Pe(t)._overflowDayOfYear=!0),n=lf(s,0,t._dayOfYear),t._a[sa]=n.getUTCMonth(),t._a[Ss]=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[dn]===24&&t._a[Fo]===0&&t._a[aa]===0&&t._a[mu]===0&&(t._nextDay=!0,t._a[dn]=0),t._d=(t._useUTC?lf:aW).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[dn]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==o&&(Pe(t).weekdayMismatch=!0)}}function tB(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=Pc(e.GG,t._a[Hn],uf(Et(),1,4).year),r=Pc(e.W,1),i=Pc(e.E,1),(i<1||i>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,u=uf(Et(),o,s),n=Pc(e.gg,t._a[Hn],u.year),r=Pc(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>ma(n,o,s)?Pe(t)._overflowWeeks=!0:l!=null?Pe(t)._overflowWeekday=!0:(a=z1(n,r,i,o,s),t._a[Hn]=a.year,t._dayOfYear=a.dayOfYear)}X.ISO_8601=function(){};X.RFC_2822=function(){};function VE(t){if(t._f===X.ISO_8601){X1(t);return}if(t._f===X.RFC_2822){Z1(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=H1(t._f,t._locale).match(IE)||[],c=i.length,n=0;n<c;n++)o=i[n],r=(e.match(BV(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),Uc[o]?(r?Pe(t).empty=!1:Pe(t).unusedTokens.push(o),UV(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[dn]<=12&&Pe(t).bigHour===!0&&t._a[dn]>0&&(Pe(t).bigHour=void 0),Pe(t).parsedDateParts=t._a.slice(0),Pe(t).meridiem=t._meridiem,t._a[dn]=nB(t._locale,t._a[dn],t._meridiem),u=Pe(t).era,u!==null&&(t._a[Hn]=t._locale.erasConvertYear(u,t._a[Hn])),FE(t),$E(t)}function nB(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 rB(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=_E({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],VE(e),TE(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));tl(t,n||e)}function iB(t){if(!t._d){var e=PE(t._i),n=e.day===void 0?e.date:e.day;t._a=O1([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),FE(t)}}function oB(t){var e=new $f($E(Q1(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Q1(t){var e=t._i,n=t._f;return t._locale=t._locale||Sa(t._l),e===null||n===void 0&&e===""?cw({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),jo(e)?new $f($E(e)):(Lf(e)?t._d=e:Bo(n)?rB(t):n?VE(t):sB(t),TE(t)||(t._d=null),t))}function sB(t){var e=t._i;ur(e)?t._d=new Date(X.now()):Lf(e)?t._d=new Date(e.valueOf()):typeof e=="string"?JW(t):Bo(e)?(t._a=O1(e.slice(0),function(n){return parseInt(n,10)}),FE(t)):bu(e)?iB(t):wa(e)?t._d=new Date(e):X.createFromInputFallback(t)}function J1(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),(bu(t)&&EE(t)||Bo(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,oB(o)}function Et(t,e,n,r){return J1(t,e,n,r,!1)}var aB=wo("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Et.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:cw()}),lB=wo("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Et.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:cw()});function eN(t,e){var n,r;if(e.length===1&&Bo(e[0])&&(e=e[0]),!e.length)return Et();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function uB(){var t=[].slice.call(arguments,0);return eN("isBefore",t)}function cB(){var t=[].slice.call(arguments,0);return eN("isAfter",t)}var hB=function(){return Date.now?Date.now():+new Date},Hh=["year","quarter","month","week","day","hour","minute","second","millisecond"];function dB(t){var e,n=!1,r,i=Hh.length;for(e in t)if(Qe(t,e)&&!(Gt.call(Hh,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[Hh[r]]){if(n)return!1;parseFloat(t[Hh[r]])!==je(t[Hh[r]])&&(n=!0)}return!0}function fB(){return this._isValid}function gB(){return Go(NaN)}function vw(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=dB(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=Sa(),this._bubble()}function jm(t){return t instanceof vw}function fR(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function mB(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++)je(t[s])!==je(e[s])&&o++;return o+i}function tN(t,e){Ce(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Ms(~~(n/60),2)+e+Ms(~~n%60,2)})}tN("Z",":");tN("ZZ","");le("Z",mw);le("ZZ",mw);ct(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=WE(mw,t)});var pB=/([\+\-]|\d\d)/gi;function WE(t,e){var n=(e||"").match(t),r,i,o;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(pB)||["-",0,0],o=+(i[1]*60)+je(i[2]),o===0?0:i[0]==="+"?o:-o)}function BE(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(jo(t)||Lf(t)?t.valueOf():Et(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),X.updateOffset(n,!1),n):Et(t).local()}function gR(t){return-Math.round(t._d.getTimezoneOffset())}X.updateOffset=function(){};function wB(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=WE(mw,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=gR(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?iN(this,Go(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,X.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:gR(this)}function vB(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function CB(t){return this.utcOffset(0,t)}function yB(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(gR(this),"m")),this}function bB(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=WE(VV,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function SB(t){return this.isValid()?(t=t?Et(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function RB(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function EB(){if(!ur(this._isDSTShifted))return this._isDSTShifted;var t={},e;return _E(t,this),t=Q1(t),t._a?(e=t._isUTC?xs(t._a):Et(t._a),this._isDSTShifted=this.isValid()&&mB(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function TB(){return this.isValid()?!this._isUTC:!1}function _B(){return this.isValid()?this._isUTC:!1}function nN(){return this.isValid()?this._isUTC&&this._offset===0:!1}var MB=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,IB=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Go(t,e){var n=t,r=null,i,o,s;return jm(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:wa(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=MB.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:je(r[Ss])*i,h:je(r[dn])*i,m:je(r[Fo])*i,s:je(r[aa])*i,ms:je(fR(r[mu]*1e3))*i}):(r=IB.exec(t))?(i=r[1]==="-"?-1:1,n={y:Sl(r[2],i),M:Sl(r[3],i),w:Sl(r[4],i),d:Sl(r[5],i),h:Sl(r[6],i),m:Sl(r[7],i),s:Sl(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(s=PB(Et(n.from),Et(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),o=new vw(n),jm(t)&&Qe(t,"_locale")&&(o._locale=t._locale),jm(t)&&Qe(t,"_isValid")&&(o._isValid=t._isValid),o}Go.fn=vw.prototype;Go.invalid=gB;function Sl(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function mP(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 PB(t,e){var n;return t.isValid()&&e.isValid()?(e=BE(e,t),t.isBefore(e)?n=mP(t,e):(n=mP(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function rN(t,e){return function(n,r){var i,o;return r!==null&&!isNaN(+r)&&(A1(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=Go(n,r),iN(this,i,t),this}}function iN(t,e,n,r){var i=e._milliseconds,o=fR(e._days),s=fR(e._months);t.isValid()&&(r=r??!0,s&&B1(t,af(t,"Month")+s*n),o&&F1(t,"Date",af(t,"Date")+o*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&X.updateOffset(t,o||s))}var OB=rN(1,"add"),xB=rN(-1,"subtract");function oN(t){return typeof t=="string"||t instanceof String}function AB(t){return jo(t)||Lf(t)||oN(t)||wa(t)||NB(t)||HB(t)||t===null||t===void 0}function HB(t){var e=bu(t)&&!EE(t),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,o,s=r.length;for(i=0;i<s;i+=1)o=r[i],n=n||Qe(t,o);return e&&n}function NB(t){var e=Bo(t),n=!1;return e&&(n=t.filter(function(r){return!wa(r)&&oN(t)}).length===0),e&&n}function DB(t){var e=bu(t)&&!EE(t),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,o;for(i=0;i<r.length;i+=1)o=r[i],n=n||Qe(t,o);return e&&n}function kB(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 LB(t,e){arguments.length===1&&(arguments[0]?AB(arguments[0])?(t=arguments[0],e=void 0):DB(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||Et(),r=BE(n,this).startOf("day"),i=X.calendarFormat(this,r)||"sameElse",o=e&&(As(e[i])?e[i].call(this,n):e[i]);return this.format(o||this.localeData().calendar(i,this,Et(n)))}function $B(){return new $f(this)}function FB(t,e){var n=jo(t)?t:Et(t);return this.isValid()&&n.isValid()?(e=vo(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function VB(t,e){var n=jo(t)?t:Et(t);return this.isValid()&&n.isValid()?(e=vo(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function WB(t,e,n,r){var i=jo(t)?t:Et(t),o=jo(e)?e:Et(e);return this.isValid()&&i.isValid()&&o.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function BB(t,e){var n=jo(t)?t:Et(t),r;return this.isValid()&&n.isValid()?(e=vo(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 jB(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function UB(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function zB(t,e,n){var r,i,o;if(!this.isValid())return NaN;if(r=BE(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=vo(e),e){case"year":o=Um(this,r)/12;break;case"month":o=Um(this,r);break;case"quarter":o=Um(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:lo(o)}function Um(t,e){if(t.date()<e.date())return-Um(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}X.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";X.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function YB(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function GB(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?Bm(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):As(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Bm(n,"Z")):Bm(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function KB(){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 qB(t){t||(t=this.isUtc()?X.defaultFormatUtc:X.defaultFormat);var e=Bm(this,t);return this.localeData().postformat(e)}function XB(t,e){return this.isValid()&&(jo(t)&&t.isValid()||Et(t).isValid())?Go({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ZB(t){return this.from(Et(),t)}function QB(t,e){return this.isValid()&&(jo(t)&&t.isValid()||Et(t).isValid())?Go({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function JB(t){return this.to(Et(),t)}function sN(t){var e;return t===void 0?this._locale._abbr:(e=Sa(t),e!=null&&(this._locale=e),this)}var aN=wo("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 lN(){return this._locale}var dp=1e3,zc=60*dp,fp=60*zc,uN=(365*400+97)*24*fp;function Yc(t,e){return(t%e+e)%e}function cN(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-uN:new Date(t,e,n).valueOf()}function hN(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-uN:Date.UTC(t,e,n)}function ej(t){var e,n;if(t=vo(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?hN:cN,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-=Yc(e+(this._isUTC?0:this.utcOffset()*zc),fp);break;case"minute":e=this._d.valueOf(),e-=Yc(e,zc);break;case"second":e=this._d.valueOf(),e-=Yc(e,dp);break}return this._d.setTime(e),X.updateOffset(this,!0),this}function tj(t){var e,n;if(t=vo(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?hN:cN,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+=fp-Yc(e+(this._isUTC?0:this.utcOffset()*zc),fp)-1;break;case"minute":e=this._d.valueOf(),e+=zc-Yc(e,zc)-1;break;case"second":e=this._d.valueOf(),e+=dp-Yc(e,dp)-1;break}return this._d.setTime(e),X.updateOffset(this,!0),this}function nj(){return this._d.valueOf()-(this._offset||0)*6e4}function rj(){return Math.floor(this.valueOf()/1e3)}function ij(){return new Date(this.valueOf())}function oj(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function sj(){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 aj(){return this.isValid()?this.toISOString():null}function lj(){return TE(this)}function uj(){return tl({},Pe(this))}function cj(){return Pe(this).overflow}function hj(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ce("N",0,0,"eraAbbr");Ce("NN",0,0,"eraAbbr");Ce("NNN",0,0,"eraAbbr");Ce("NNNN",0,0,"eraName");Ce("NNNNN",0,0,"eraNarrow");Ce("y",["y",1],"yo","eraYear");Ce("y",["yy",2],0,"eraYear");Ce("y",["yyy",3],0,"eraYear");Ce("y",["yyyy",4],0,"eraYear");le("N",jE);le("NN",jE);le("NNN",jE);le("NNNN",Sj);le("NNNNN",Rj);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});le("y",dh);le("yy",dh);le("yyy",dh);le("yyyy",dh);le("yo",Ej);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 dj(t,e){var n,r,i,o=this._eras||Sa("en")._eras;for(n=0,r=o.length;n<r;++n){switch(typeof o[n].since){case"string":i=X(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=X(o[n].until).startOf("day").valueOf(),o[n].until=i.valueOf();break}}return o}function fj(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 gj(t,e){var n=t.since<=t.until?1:-1;return e===void 0?X(t.since).year():X(t.since).year()+(e-t.offset)*n}function mj(){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 pj(){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 wj(){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 vj(){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()-X(i[t].since).year())*n+i[t].offset;return this.year()}function Cj(t){return Qe(this,"_erasNameRegex")||UE.call(this),t?this._erasNameRegex:this._erasRegex}function yj(t){return Qe(this,"_erasAbbrRegex")||UE.call(this),t?this._erasAbbrRegex:this._erasRegex}function bj(t){return Qe(this,"_erasNarrowRegex")||UE.call(this),t?this._erasNarrowRegex:this._erasRegex}function jE(t,e){return e.erasAbbrRegex(t)}function Sj(t,e){return e.erasNameRegex(t)}function Rj(t,e){return e.erasNarrowRegex(t)}function Ej(t,e){return e._eraYearOrdinalRegex||dh}function UE(){var t=[],e=[],n=[],r=[],i,o,s,a,l,u=this.eras();for(i=0,o=u.length;i<o;++i)s=ga(u[i].name),a=ga(u[i].abbr),l=ga(u[i].narrow),e.push(s),t.push(a),n.push(l),r.push(s),r.push(a),r.push(l);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}Ce(0,["gg",2],0,function(){return this.weekYear()%100});Ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Cw(t,e){Ce(0,[t,t.length],0,e)}Cw("gggg","weekYear");Cw("ggggg","weekYear");Cw("GGGG","isoWeekYear");Cw("GGGGG","isoWeekYear");le("G",gw);le("g",gw);le("GG",Tt,Gi);le("gg",Tt,Gi);le("GGGG",xE,OE);le("gggg",xE,OE);le("GGGGG",fw,hw);le("ggggg",fw,hw);Vf(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=je(t)});Vf(["gg","GG"],function(t,e,n,r){e[r]=X.parseTwoDigitYear(t)});function Tj(t){return dN.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function _j(t){return dN.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Mj(){return ma(this.year(),1,4)}function Ij(){return ma(this.isoWeekYear(),1,4)}function Pj(){var t=this.localeData()._week;return ma(this.year(),t.dow,t.doy)}function Oj(){var t=this.localeData()._week;return ma(this.weekYear(),t.dow,t.doy)}function dN(t,e,n,r,i){var o;return t==null?uf(this,r,i).year:(o=ma(t,r,i),e>o&&(e=o),xj.call(this,t,e,n,r,i))}function xj(t,e,n,r,i){var o=z1(t,e,n,r,i),s=lf(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}Ce("Q",0,"Qo","quarter");le("Q",N1);ct("Q",function(t,e){e[sa]=(je(t)-1)*3});function Aj(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Ce("D",["DD",2],"Do","date");le("D",Tt,fh);le("DD",Tt,Gi);le("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});ct(["D","DD"],Ss);ct("Do",function(t,e){e[Ss]=je(t.match(Tt)[0])});var fN=gh("Date",!0);Ce("DDD",["DDDD",3],"DDDo","dayOfYear");le("DDD",dw);le("DDDD",D1);ct(["DDD","DDDD"],function(t,e,n){n._dayOfYear=je(t)});function Hj(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Ce("m",["mm",2],0,"minute");le("m",Tt,AE);le("mm",Tt,Gi);ct(["m","mm"],Fo);var Nj=gh("Minutes",!1);Ce("s",["ss",2],0,"second");le("s",Tt,AE);le("ss",Tt,Gi);ct(["s","ss"],aa);var Dj=gh("Seconds",!1);Ce("S",0,0,function(){return~~(this.millisecond()/100)});Ce(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Ce(0,["SSS",3],0,"millisecond");Ce(0,["SSSS",4],0,function(){return this.millisecond()*10});Ce(0,["SSSSS",5],0,function(){return this.millisecond()*100});Ce(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Ce(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Ce(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Ce(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});le("S",dw,N1);le("SS",dw,Gi);le("SSS",dw,D1);var nl,gN;for(nl="SSSS";nl.length<=9;nl+="S")le(nl,dh);function kj(t,e){e[mu]=je(("0."+t)*1e3)}for(nl="S";nl.length<=9;nl+="S")ct(nl,kj);gN=gh("Milliseconds",!1);Ce("z",0,0,"zoneAbbr");Ce("zz",0,0,"zoneName");function Lj(){return this._isUTC?"UTC":""}function $j(){return this._isUTC?"Coordinated Universal Time":""}var Q=$f.prototype;Q.add=OB;Q.calendar=LB;Q.clone=$B;Q.diff=zB;Q.endOf=tj;Q.format=qB;Q.from=XB;Q.fromNow=ZB;Q.to=QB;Q.toNow=JB;Q.get=KV;Q.invalidAt=cj;Q.isAfter=FB;Q.isBefore=VB;Q.isBetween=WB;Q.isSame=BB;Q.isSameOrAfter=jB;Q.isSameOrBefore=UB;Q.isValid=lj;Q.lang=aN;Q.locale=sN;Q.localeData=lN;Q.max=lB;Q.min=aB;Q.parsingFlags=uj;Q.set=qV;Q.startOf=ej;Q.subtract=xB;Q.toArray=oj;Q.toObject=sj;Q.toDate=ij;Q.toISOString=GB;Q.inspect=KB;typeof Symbol<"u"&&Symbol.for!=null&&(Q[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});Q.toJSON=aj;Q.toString=YB;Q.unix=rj;Q.valueOf=nj;Q.creationData=hj;Q.eraName=mj;Q.eraNarrow=pj;Q.eraAbbr=wj;Q.eraYear=vj;Q.year=$1;Q.isLeapYear=GV;Q.weekYear=Tj;Q.isoWeekYear=_j;Q.quarter=Q.quarters=Aj;Q.month=j1;Q.daysInMonth=iW;Q.week=Q.weeks=dW;Q.isoWeek=Q.isoWeeks=fW;Q.weeksInYear=Pj;Q.weeksInWeekYear=Oj;Q.isoWeeksInYear=Mj;Q.isoWeeksInISOWeekYear=Ij;Q.date=fN;Q.day=Q.days=_W;Q.weekday=MW;Q.isoWeekday=IW;Q.dayOfYear=Hj;Q.hour=Q.hours=DW;Q.minute=Q.minutes=Nj;Q.second=Q.seconds=Dj;Q.millisecond=Q.milliseconds=gN;Q.utcOffset=wB;Q.utc=CB;Q.local=yB;Q.parseZone=bB;Q.hasAlignedHourOffset=SB;Q.isDST=RB;Q.isLocal=TB;Q.isUtcOffset=_B;Q.isUtc=nN;Q.isUTC=nN;Q.zoneAbbr=Lj;Q.zoneName=$j;Q.dates=wo("dates accessor is deprecated. Use date instead.",fN);Q.months=wo("months accessor is deprecated. Use month instead",j1);Q.years=wo("years accessor is deprecated. Use year instead",$1);Q.zone=wo("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",vB);Q.isDSTShifted=wo("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",EB);function Fj(t){return Et(t*1e3)}function Vj(){return Et.apply(null,arguments).parseZone()}function mN(t){return t}var Je=ME.prototype;Je.calendar=TV;Je.longDateFormat=PV;Je.invalidDate=xV;Je.ordinal=NV;Je.preparse=mN;Je.postformat=mN;Je.relativeTime=kV;Je.pastFuture=LV;Je.set=RV;Je.eras=dj;Je.erasParse=fj;Je.erasConvertYear=gj;Je.erasAbbrRegex=yj;Je.erasNameRegex=Cj;Je.erasNarrowRegex=bj;Je.months=eW;Je.monthsShort=tW;Je.monthsParse=rW;Je.monthsRegex=sW;Je.monthsShortRegex=oW;Je.week=lW;Je.firstDayOfYear=hW;Je.firstDayOfWeek=cW;Je.weekdays=bW;Je.weekdaysMin=RW;Je.weekdaysShort=SW;Je.weekdaysParse=TW;Je.weekdaysRegex=PW;Je.weekdaysShortRegex=OW;Je.weekdaysMinRegex=xW;Je.isPM=HW;Je.meridiem=kW;function gp(t,e,n,r){var i=Sa(),o=xs().set(r,e);return i[n](o,t)}function pN(t,e,n){if(wa(t)&&(e=t,t=void 0),t=t||"",e!=null)return gp(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=gp(t,r,n,"month");return i}function zE(t,e,n,r){typeof t=="boolean"?(wa(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,wa(e)&&(n=e,e=void 0),e=e||"");var i=Sa(),o=t?i._week.dow:0,s,a=[];if(n!=null)return gp(e,(n+o)%7,r,"day");for(s=0;s<7;s++)a[s]=gp(e,(s+o)%7,r,"day");return a}function Wj(t,e){return pN(t,e,"months")}function Bj(t,e){return pN(t,e,"monthsShort")}function jj(t,e,n){return zE(t,e,n,"weekdays")}function Uj(t,e,n){return zE(t,e,n,"weekdaysShort")}function zj(t,e,n){return zE(t,e,n,"weekdaysMin")}ll("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=je(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}});X.lang=wo("moment.lang is deprecated. Use moment.locale instead.",ll);X.langData=wo("moment.langData is deprecated. Use moment.localeData instead.",Sa);var ks=Math.abs;function Yj(){var t=this._data;return this._milliseconds=ks(this._milliseconds),this._days=ks(this._days),this._months=ks(this._months),t.milliseconds=ks(t.milliseconds),t.seconds=ks(t.seconds),t.minutes=ks(t.minutes),t.hours=ks(t.hours),t.months=ks(t.months),t.years=ks(t.years),this}function wN(t,e,n,r){var i=Go(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function Gj(t,e){return wN(this,t,e,1)}function Kj(t,e){return wN(this,t,e,-1)}function pP(t){return t<0?Math.floor(t):Math.ceil(t)}function qj(){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+=pP(mR(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=lo(t/1e3),r.seconds=i%60,o=lo(i/60),r.minutes=o%60,s=lo(o/60),r.hours=s%24,e+=lo(s/24),l=lo(vN(e)),n+=l,e-=pP(mR(l)),a=lo(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function vN(t){return t*4800/146097}function mR(t){return t*146097/4800}function Xj(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=vo(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+vN(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(mR(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 Ra(t){return function(){return this.as(t)}}var CN=Ra("ms"),Zj=Ra("s"),Qj=Ra("m"),Jj=Ra("h"),eU=Ra("d"),tU=Ra("w"),nU=Ra("M"),rU=Ra("Q"),iU=Ra("y"),oU=CN;function sU(){return Go(this)}function aU(t){return t=vo(t),this.isValid()?this[t+"s"]():NaN}function Fu(t){return function(){return this.isValid()?this._data[t]:NaN}}var lU=Fu("milliseconds"),uU=Fu("seconds"),cU=Fu("minutes"),hU=Fu("hours"),dU=Fu("days"),fU=Fu("months"),gU=Fu("years");function mU(){return lo(this.days()/7)}var ea=Math.round,$c={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function pU(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function wU(t,e,n,r){var i=Go(t).abs(),o=ea(i.as("s")),s=ea(i.as("m")),a=ea(i.as("h")),l=ea(i.as("d")),u=ea(i.as("M")),c=ea(i.as("w")),h=ea(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,pU.apply(null,d)}function vU(t){return t===void 0?ea:typeof t=="function"?(ea=t,!0):!1}function CU(t,e){return $c[t]===void 0?!1:e===void 0?$c[t]:($c[t]=e,t==="s"&&($c.ss=e-1),!0)}function yU(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=$c,i,o;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},$c,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),o=wU(this,!n,r,i),n&&(o=i.pastFuture(+this,o)),i.postformat(o)}var Dy=Math.abs;function zu(t){return(t>0)-(t<0)||+t}function yw(){if(!this.isValid())return this.localeData().invalidDate();var t=Dy(this._milliseconds)/1e3,e=Dy(this._days),n=Dy(this._months),r,i,o,s,a=this.asSeconds(),l,u,c,h;return a?(r=lo(t/60),i=lo(r/60),t%=60,r%=60,o=lo(n/12),n%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=zu(this._months)!==zu(a)?"-":"",c=zu(this._days)!==zu(a)?"-":"",h=zu(this._milliseconds)!==zu(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=vw.prototype;Ke.isValid=fB;Ke.abs=Yj;Ke.add=Gj;Ke.subtract=Kj;Ke.as=Xj;Ke.asMilliseconds=CN;Ke.asSeconds=Zj;Ke.asMinutes=Qj;Ke.asHours=Jj;Ke.asDays=eU;Ke.asWeeks=tU;Ke.asMonths=nU;Ke.asQuarters=rU;Ke.asYears=iU;Ke.valueOf=oU;Ke._bubble=qj;Ke.clone=sU;Ke.get=aU;Ke.milliseconds=lU;Ke.seconds=uU;Ke.minutes=cU;Ke.hours=hU;Ke.days=dU;Ke.weeks=mU;Ke.months=fU;Ke.years=gU;Ke.humanize=yU;Ke.toISOString=yw;Ke.toString=yw;Ke.toJSON=yw;Ke.locale=sN;Ke.localeData=lN;Ke.toIsoString=wo("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",yw);Ke.lang=aN;Ce("X",0,0,"unix");Ce("x",0,0,"valueOf");le("x",gw);le("X",WV);ct("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)});ct("x",function(t,e,n){n._d=new Date(je(t))});//! moment.js
11
+ X.version="2.30.1";bV(Et);X.fn=Q;X.min=uB;X.max=cB;X.now=hB;X.utc=xs;X.unix=Fj;X.months=Wj;X.isDate=Lf;X.locale=ll;X.invalid=cw;X.duration=Go;X.isMoment=jo;X.weekdays=jj;X.parseZone=Vj;X.localeData=Sa;X.isDuration=jm;X.monthsShort=Bj;X.weekdaysMin=zj;X.defineLocale=LE;X.updateLocale=VW;X.locales=WW;X.weekdaysShort=Uj;X.normalizeUnits=vo;X.relativeTimeRounding=vU;X.relativeTimeThreshold=CU;X.calendarFormat=kB;X.prototype=Q;X.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 bU(t){const e=t.length;let n=0;for(;n<e;)t[n]=[t[n]],n+=1}function wP(t,e){const n=e.length;let r=0;for(;r<n;)t.push(e[r]),r+=1}function zm(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 wr(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 Eu(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 Be(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 SU(t){const e=[];return M(t,n=>{e.indexOf(n)===-1&&e.push(n)}),e}function vP(){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 CP(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function nt(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 wr(t,(o,s,a)=>{const l=s.replace(/\r?\n\s*/g,""),u=n[a]?n[a]:"";return o+l+u},"").trim()}function Pt(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 ae(t){return typeof t<"u"}function It(t){return typeof t>"u"}function Ut(t){return t===null||t===""||It(t)}function RU(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const Od="length",$d=t=>parseInt(t,16),yP=t=>parseInt(t,10),mp=(t,e,n)=>t.substr(e,n),Fd=t=>t.codePointAt(0)-65,pR=t=>`${t}`.replace(/\-/g,""),EU=t=>$d(mp(pR(t),$d("12"),Fd("F")))/($d(mp(pR(t),Fd("B"),~~![][Od]))||9),TU=()=>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 bP=!1;const SP={invalid:()=>nt`
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 nt`
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:()=>nt`
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:()=>""},RP={invalid:()=>nt`
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 nt`
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:()=>nt`
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 _U(t,e){const n=!Ut(t),r=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",i="15.3.0";let o,s="invalid",a="invalid";t=pR(t||"");const l=MU(t);if(n||r||l)if(l){const u=X("29/04/2025","DD/MM/YYYY"),c=Math.floor(u.toDate().getTime()/864e5),h=EU(t);o=X((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(TU()&&(s="valid",a="valid"),!bP&&s!=="valid"&&(SP[s]({keyValidityDate:o,hotVersion:i})&&console[s==="non_commercial"?"info":"warn"](SP[s]({keyValidityDate:o,hotVersion:i})),bP=!0),a!=="valid"&&e.parentNode&&RP[a]({keyValidityDate:o,hotVersion:i})){const c=document.createElement("div");c.className="handsontable hot-display-license-info",c.innerHTML=RP[a]({keyValidityDate:o,hotVersion:i}),e.parentNode.insertBefore(c,e.nextSibling)}}function MU(t){let e=[][Od],n=e;if(t[Od]!==Fd("Z"))return!1;for(let r="",i="B<H4P+".split(""),o=Fd(i.shift());o;o=Fd(i.shift()||"A"))--o<""[Od]?n=n|(yP(`${yP($d(r)+($d(mp(t,Math.abs(o),2))+[]).padStart(2,"0"))}`)%97||2)>>1:r=mp(t,o,o?i[Od]===1?9:8:6);return n===e}function Uo(t){return t[0].toUpperCase()+t.substr(1)}function yN(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function bN(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function SN(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 EP(t){return YE(`${t}`,{ALLOWED_TAGS:[]})}function YE(t,e){return yV.sanitize(t,e)}const Vu=t=>["tabindex",t],IU=()=>["role","treegrid"],la=()=>["role","presentation"],PU=()=>["role","gridcell"],OU=()=>["role","rowheader"],RN=()=>["role","rowgroup"],xU=()=>["role","columnheader"],wR=()=>["role","row"],AU=()=>["role","menu"],HU=()=>["role","menuitem"],NU=()=>["role","menuitemcheckbox"],DU=()=>["role","combobox"],EN=()=>["role","listbox"],kU=()=>["role","option"],LU=()=>["role","checkbox"],$U=()=>["scope","col"],FU=()=>["scope","row"],VU=()=>["type","text"],hf=t=>["aria-label",t],Wu=()=>["aria-hidden","true"],WU=()=>["aria-disabled","true"],BU=()=>["aria-multiselectable","true"],TN=t=>["aria-haspopup",t],_N=t=>["aria-rowcount",t],bw=t=>["aria-colcount",t],MN=t=>["aria-rowindex",t],GE=t=>["aria-colindex",t],ho=t=>["aria-expanded",t],jU=t=>["aria-sort",t],TP=()=>["aria-readonly","true"],_P=()=>["aria-invalid","true"],IN=t=>["aria-checked",t],KE=()=>["aria-selected","true"],UU=()=>["aria-autocomplete","list"],zU=t=>["aria-controls",t],YU=t=>["aria-activedescendant",t],GU=t=>["aria-live",t],KU=t=>["aria-relevant",t],qU=t=>["aria-setsize",t],XU=t=>["aria-posinset",t];function ZU(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 Ym(t,e){const n=t.closest(".handsontable");return!!n&&(n.parentNode===e||n===e)}function QU(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function Qc(t){return QU(t)&&t.parent}function Tu(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 lg(t,e,n){const r=[];let i=t;for(;i&&(i=Tu(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 JU(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 Su(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 ez(t){let e=0,n=t;if(n.previousSibling)for(;n=n.previousSibling;)e+=1;return e}function Rl(t,e,n){const r=n.parentElement.querySelector(`.ht_clone_${t}`);return r?r.contains(e):null}function PN(t){return!t||!t.length?[]:t.filter(e=>!!e)}function ON(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 ve(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function G(t,e){typeof e=="string"&&(e=e.split(" ")),e=PN(e),e.length>0&&t.classList.add(...e)}function pe(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:n,regexes:r}=ON(e,!0);n=PN(n),n.length>0&&t.classList.remove(...n),r.forEach(i=>{t.classList.forEach(o=>{i.test(o)&&t.classList.remove(o)})})}function ye(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 mh(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}=ON(e,!0);n.forEach(i=>{i!==""&&t.removeAttribute(i)}),r.forEach(i=>{t.getAttributeNames().forEach(o=>{i.test(o)&&t.removeAttribute(o)})})}function xN(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--)xN(e[n])}}function va(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const tz=/(<(.*)>|&(.*);)/;function ph(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;tz.test(e)?t.innerHTML=n?YE(e):e:_u(t,e)}function _u(t,e){const n=t.firstChild;n&&n.nodeType===3&&n.nextSibling===null?n.textContent=e:(va(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function Jc(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 Jc(r.host.impl);if(r.host)return Jc(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 nz(t){const n=t.ownerDocument.defaultView;let r=t;for(;r.parentNode;){if(r.style.height==="0px"||r.style.height==="0")return n.getComputedStyle(r).overflow==="hidden";r=r.parentNode}return!1}function 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 AN(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function qE(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function XE(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?AN(e):t.scrollTop}function HN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?qE(e):t.scrollLeft}function pp(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 rz(t){return t.scrollHeight-t.clientHeight}function iz(t){return t.scrollWidth-t.clientWidth}function df(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 wp(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 Kt(t){return t.offsetWidth}function nn(t){return t.offsetHeight}function Vd(t){return t.clientHeight||t.innerHeight}function NN(t){return t.clientWidth||t.innerWidth}function DN(t){return t.selectionStart?t.selectionStart:0}function oz(t){return t.selectionEnd?t.selectionEnd:0}function MP(){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 Sw(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 ky;function sz(){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 ky===void 0&&(ky=sz(t)),ky}function kN(t){return t instanceof Window?t.document.body.scrollHeight>t.innerHeight:t.offsetWidth!==t.clientWidth}function LN(t){return t instanceof Window?t.document.body.scrollWidth>t.innerWidth:t.offsetHeight!==t.clientHeight}function ZE(t,e,n){t.style.transform=`translate3d(${e},${n},0)`}function Rw(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function Gm(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function $N(t){return Gm(t)&&t.hasAttribute("data-hot-input")===!1}function FN(t){return!t.parentNode}function az(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 VN(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();ye(t,"contenteditable",!0),n&&ye(t,...Wu()),e&&G(t,"invisibleSelection"),i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i)}function WN(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&&pe(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function lz(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;VN(t,n),e(),WN(t,n)}function pa(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 ot(t){return typeof t=="function"}function Ew(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 BN(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 uz(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 vR(t,e,n,r,i,o,s,a){return ae(a)?t.call(e,n,r,i,o,s,a):ae(s)?t.call(e,n,r,i,o,s):ae(o)?t.call(e,n,r,i,o):ae(i)?t.call(e,n,r,i):ae(r)?t.call(e,n,r):ae(n)?t.call(e,n):t.call(e)}var IP={},Ly,PP;function cz(){if(PP)return Ly;PP=1;var t=qt(),e=h1(),n=an(),r=Nu(),i=uw(),o=t([].push);return Ly=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,g){if(d)return d=!1,g;if(e(this))return g;for(var C=0;C<h;C++)if(l[C]===f)return g}}},Ly}var OP;function hz(){if(OP)return IP;OP=1;var t=dt(),e=ah(),n=Nf(),r=sn(),i=qt(),o=Cn(),s=an(),a=hE(),l=RE(),u=cz(),c=cE(),h=String,d=e("JSON","stringify"),f=i(/./.exec),g=i("".charAt),C=i("".charCodeAt),y=i("".replace),E=i(1 .toString),v=/[\uD800-\uDFFF]/g,P=/^[\uD800-\uDBFF]$/,O=/^[\uDC00-\uDFFF]$/,L=!c||o(function(){var U=e("Symbol")("stringify detection");return d([U])!=="[null]"||d({a:U})!=="{}"||d(Object(U))!=="{}"}),T=o(function(){return d("\uDF06\uD834")!=='"\\udf06\\ud834"'||d("\uDEAD")!=='"\\udead"'}),A=function(U,j){var Z=l(arguments),J=u(j);if(!(!s(J)&&(U===void 0||a(U))))return Z[1]=function(se,te){if(s(J)&&(te=r(J,this,h(se),te)),!a(te))return te},n(d,null,Z)},K=function(U,j,Z){var J=g(Z,j-1),se=g(Z,j+1);return f(P,U)&&!f(O,se)||f(O,U)&&!f(P,J)?"\\u"+E(C(U,0),16):U};return d&&t({target:"JSON",stat:!0,arity:3,forced:L||T},{stringify:function(j,Z,J){var se=l(arguments),te=n(L?A:d,null,se);return T&&typeof te=="string"?y(te,v,K):te}}),IP}hz();function ff(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]=ff(n):Array.isArray(n)?n.length&&typeof n[0]=="object"&&!Array.isArray(n[0])?e[r]=[ff(n[0])]:e[r]=[]:e[r]=null)})),e}function dz(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 Tw(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]={}),Tw(t[r],e[r])):t[r]=e[r]})}function Gn(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function Is(t){const e={};return He(t,(n,r)=>{e[r]=n}),e}function ut(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=g=>{let C=g;return(Array.isArray(C)||Ae(C))&&(C=Gn(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 QE(t,e){return JSON.stringify(t)===JSON.stringify(e)}function Ae(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ea(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 fz(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 $y(t,e,n){if(typeof e!="string")return;const r=e.split(".");let i=t;r.forEach((o,s)=>{o==="__proto__"||o==="constructor"||o==="prototype"||(s!==r.length-1?(tn(i,o)||(i[o]={}),i=i[o]):i[o]=n)})}function JE(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 zi(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 vp(t){return window.requestAnimationFrame(t)}function Cp(t){window.cancelAnimationFrame(t)}function jN(){return"ontouchstart"in window}function gz(){return typeof window<"u"}let Yu;function mz(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Yu||(typeof Intl=="object"?Yu=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?Yu=(n,r)=>`${n}`.localeCompare(r):Yu=(n,r)=>n===r?0:n>r?-1:1,Yu)}const ro=t=>{const e={value:!1};return e.test=(n,r)=>{e.value=t(n,r)},e},wl={chrome:ro((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:ro(t=>/CriOS/.test(t)),edge:ro(t=>/Edge/.test(t)),edgeWebKit:ro(t=>/EdgiOS/.test(t)),firefox:ro(t=>/Firefox/.test(t)),firefoxWebKit:ro(t=>/FxiOS/.test(t)),mobile:ro(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:ro((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},Wf={mac:ro(t=>/^Mac/.test(t)),win:ro(t=>/^Win/.test(t)),linux:ro(t=>/^Linux/.test(t)),ios:ro(t=>/iPhone|iPad|iPod/i.test(t))};function pz(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};He(wl,n=>{let{test:r}=n;return void r(t,e)})}function wz(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};He(Wf,e=>{let{test:n}=e;return void n(t)})}gz()&&(pz(),wz());function UN(){return wl.chrome.value}function vz(){return wl.chromeWebKit.value}function Fy(){return wl.firefox.value}function Cz(){return wl.firefoxWebKit.value}function yp(){return wl.safari.value}function yz(){return wl.edge.value}function ua(){return wl.mobile.value}function zN(){return Wf.ios.value}function YN(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&Wf.mac.value}function xP(){return Wf.win.value}function AP(){return Wf.mac.value}const me={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:Fy()?182:174,AUDIO_MUTE:Fy()?181:173,AUDIO_UP:Fy()?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},bz=[me.ALT,me.ARROW_DOWN,me.ARROW_LEFT,me.ARROW_RIGHT,me.ARROW_UP,me.AUDIO_DOWN,me.AUDIO_MUTE,me.AUDIO_UP,me.BACKSPACE,me.CAPS_LOCK,me.DELETE,me.END,me.ENTER,me.ESCAPE,me.F1,me.F2,me.F3,me.F4,me.F5,me.F6,me.F7,me.F8,me.F9,me.F10,me.F11,me.F12,me.F13,me.F14,me.F15,me.F16,me.F17,me.F18,me.F19,me.HOME,me.INSERT,me.MEDIA_NEXT,me.MEDIA_PLAY_PAUSE,me.MEDIA_PREV,me.MEDIA_STOP,me.NULL,me.NUM_LOCK,me.PAGE_DOWN,me.PAGE_UP,me.PAUSE,me.SCROLL_LOCK,me.SHIFT,me.TAB];function Sz(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 GN(t){return bz.includes(t)}function Rz(t){return[me.CONTROL,me.COMMAND_LEFT,me.COMMAND_RIGHT,me.COMMAND_FIREFOX].includes(t)}function Bf(t,e){const n=e.split("|");let r=!1;return M(n,i=>{if(t===me[i])return r=!0,!1}),r}function Ko(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function du(t){return t.isImmediatePropagationEnabled===!1}function Mu(t){return t.button===2}function e0(t){return t.button===0}function Ez(t){return t instanceof TouchEvent}function Tz(t,e){const n={x:t.offsetX,y:t.offsetY};let r=t.target;if(!pa(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 Ze(){ae(console)&&console.warn(...arguments)}function t0(){ae(console)&&console.error(...arguments)}const fu=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","beforeCompositionStart","afterGetCellMeta","afterGetColHeader","afterGetRowHeader","afterInit","afterLoadData","afterUpdateData","afterMomentumScroll","afterOnCellCornerMouseDown","afterOnCellCornerDblClick","afterOnCellMouseDown","afterOnCellMouseUp","afterOnCellContextMenu","afterOnCellMouseOver","afterOnCellMouseOut","afterRemoveCol","afterRemoveRow","beforeRenderer","afterRenderer","afterRowSequenceChange","beforeViewportScrollVertically","beforeViewportScrollHorizontally","beforeViewportScroll","afterScrollHorizontally","afterScrollVertically","afterScroll","afterSelection","afterSelectionByProp","afterSelectionEnd","afterSelectionEndByProp","afterSelectionFocusSet","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","afterSetTheme","afterUpdateSettings","afterValidate","beforeLanguageChange","afterLanguageChange","beforeAutofill","afterAutofill","beforeCellAlignment","beforeChange","beforeChangeRender","beforeDrawBorders","beforeGetCellMeta","beforeRemoveCellMeta","beforeInit","beforeInitWalkontable","beforeLoadData","beforeUpdateData","beforeKeyDown","beforeOnCellMouseDown","beforeOnCellMouseUp","beforeOnCellContextMenu","beforeOnCellMouseOver","beforeOnCellMouseOut","beforeRemoveCol","beforeRemoveRow","beforeViewRender","afterViewRender","beforeRender","afterRender","beforeRowWrap","beforeColumnWrap","beforeSetCellMeta","beforeSelectionFocusSet","beforeSetRangeStartOnly","beforeSetRangeStart","beforeSetRangeEnd","beforeSelectionHighlightSet","beforeTouchScroll","beforeValidate","beforeValueRender","construct","init","modifyColHeader","modifyColWidth","modifyFiltersMultiSelectValue","modifyFocusedElement","modifyRowHeader","modifyRowHeight","modifyRowHeightByOverlayName","modifyData","modifySourceData","modifyRowData","modifyGetCellCoords","modifyGetCoordsElement","modifyFocusOnTabNavigation","beforeHighlightingRowHeader","beforeHighlightingColumnHeader","persistentStateLoad","persistentStateReset","persistentStateSave","beforeColumnSort","afterColumnSort","modifyAutofillRange","modifyCopyableRange","beforeCut","afterCut","beforeCopy","afterCopy","beforePaste","afterPaste","beforeColumnFreeze","afterColumnFreeze","beforeColumnMove","afterColumnMove","beforeColumnUnfreeze","afterColumnUnfreeze","beforeRowMove","afterRowMove","beforeColumnResize","afterColumnResize","beforeRowResize","afterRowResize","afterGetColumnHeaderRenderers","afterGetRowHeaderRenderers","beforeStretchingColumnWidth","beforeFilter","afterFilter","afterFormulasValuesUpdate","afterNamedExpressionAdded","afterNamedExpressionRemoved","afterSheetAdded","afterSheetRenamed","afterSheetRemoved","modifyColumnHeaderHeight","modifyColumnHeaderValue","beforeUndo","beforeUndoStackChange","afterUndo","afterUndoStackChange","beforeRedo","beforeRedoStackChange","afterRedo","afterRedoStackChange","modifyRowHeaderWidth","modifyTransformFocus","modifyTransformStart","modifyTransformEnd","afterModifyTransformFocus","afterModifyTransformStart","afterModifyTransformEnd","afterViewportRowCalculatorOverride","afterViewportColumnCalculatorOverride","afterPluginsInitialized","beforeHideRows","afterHideRows","beforeUnhideRows","afterUnhideRows","beforeHideColumns","afterHideColumns","beforeUnhideColumns","afterUnhideColumns","beforeTrimRow","afterTrimRow","beforeUntrimRow","afterUntrimRow","beforeDropdownMenuShow","afterDropdownMenuShow","afterDropdownMenuHide","beforeAddChild","afterAddChild","beforeDetachChild","afterDetachChild","beforeBeginEditing","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],Vy=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"]]),Wy=new Map([[]]);var HP={},By,NP;function _z(){if(NP)return By;NP=1;var t=ch();return By=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},By}var jy,DP;function Mz(){if(DP)return jy;DP=1;var t=on();return jy=function(e,n){var r=t[e],i=r&&r.prototype;return i&&i[n]},jy}var Uy,kP;function _w(){if(kP)return Uy;kP=1;var t=Yo(),e=bE(),n=ml().f,r=t("unscopables"),i=Array.prototype;return i[r]===void 0&&n(i,r,{configurable:!0,value:e(null)}),Uy=function(o){i[r][o]=!0},Uy}var LP;function Iz(){if(LP)return HP;LP=1;var t=dt(),e=qt(),n=pr(),r=Of(),i=_z(),o=Mz(),s=_w(),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"),HP}Iz();var $P={},FP={},VP;function Pz(){if(VP)return FP;VP=1;var t=dt(),e=sn(),n=hh(),r=pr(),i=ln(),o=Os(),s=Yi(),a=pl(),l=a("find",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{find:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return n(h,function(f,g){if(c(f,d++))return g(f)},{IS_RECORD:!0,INTERRUPTED:!0}).result}}),FP}var WP;function Oz(){return WP||(WP=1,Pz()),$P}Oz();function xz(t,e){KN(t,e),e.add(t)}function zy(t,e,n){KN(t,e),e.set(t,n)}function KN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function BP(t,e,n){return t.set(bp(t,e),n),n}function Sn(t,e){return t.get(bp(t,e))}function bp(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 Az=100;var ki=new WeakMap,Oc=new WeakMap,Yy=new WeakMap,Gy=new WeakSet;class jP{constructor(){xz(this,Gy),zy(this,ki,new Map),zy(this,Oc,new Map),zy(this,Yy,new Set),fu.forEach(e=>bp(Gy,this,UP).call(this,e))}getHooks(e){var n;return(n=Sn(ki,this).get(e))!==null&&n!==void 0?n:[]}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Sn(ki,this).has(e)||(bp(Gy,this,UP).call(this,e),fu.push(e));const i=Sn(ki,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=Sn(Yy,this).has(e);!u&&o!==0&&(u=!0,Sn(Yy,this).add(e)),u&&i.length>1&&Sn(ki,this).set(e,i.toSorted((c,h)=>c.orderIndex-h.orderIndex))}}has(e){return Sn(ki,this).has(e)&&Sn(ki,this).get(e).length>0}remove(e,n){if(!Sn(ki,this).has(e))return!1;const r=Sn(ki,this).get(e),i=r.find(o=>o.callback===n);if(i){let o=Sn(Oc,this).get(e);return i.skip=!0,o+=1,o>Az&&(Sn(ki,this).set(e,r.filter(s=>!s.skip)),o=0),Sn(Oc,this).set(e,o),!0}return!1}destroy(){Sn(ki,this).clear(),Sn(Oc,this).clear(),BP(ki,this,null),BP(Oc,this,null)}}function UP(t){Sn(ki,this).set(t,[]),Sn(Oc,this).set(t,0)}function Hz(t,e,n){return(e=Nz(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nz(t){var e=Dz(t,"string");return typeof e=="symbol"?e:e+""}function Dz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const kz=nt`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 re{constructor(){Hz(this,"globalBucket",new jP)}static getSingleton(){return $z()}getBucket(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=new jP),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)):(Vy.has(e)&&Ze(SN(kz,{hookName:e,removedInVersion:Vy.get(e)})),Wy.has(e)&&Ze(Wy.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=vR(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=vR(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)||fu.push(e)}deregister(e){this.isRegistered(e)&&fu.splice(fu.indexOf(e),1)}isDeprecated(e){return Wy.has(e)||Vy.has(e)}isRegistered(e){return fu.indexOf(e)>=0}getRegistered(){return fu}}const Lz=new re;function $z(){return Lz}const Ky=new Map;function qo(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";Ky.has(t)||Ky.set(t,new Map);const e=Ky.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 CR=new WeakMap,{register:Fz,getItem:qN,hasItem:XN,getNames:Nle,getValues:Dle}=qo("editors");function Vz(t){const e={},n=t;this.getConstructor=function(){return t},this.getInstance=function(r){return r.guid in e||(e[r.guid]=new n(r)),e[r.guid]},re.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function ZN(t,e){let n;if(typeof t=="function")CR.get(t)||$i(null,t),n=CR.get(t);else if(typeof t=="string")n=qN(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 yR(t){if(typeof t=="function")return t;if(!XN(t))throw Error(`No registered editor found under "${t}" name`);return qN(t).getConstructor()}function $i(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const n=new Vz(e);typeof t=="string"&&Fz(t,n),CR.set(e,n)}function Wz(t,e,n){return(e=Bz(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bz(t){var e=jz(t,"string");return typeof e=="symbol"?e:e+""}function jz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 zo{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;Wz(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,Uz(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 Uz(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),Ko(this)},t}function zz(t,e){Yz(t,e),e.add(t)}function Yz(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function El(t,e,n){return(e=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)}function qy(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ug=new WeakSet;class bR{constructor(e,n,r){zz(this,ug),El(this,"hot",void 0),El(this,"tableMeta",void 0),El(this,"selection",void 0),El(this,"eventManager",void 0),El(this,"destroyed",!1),El(this,"activeEditor",void 0),El(this,"cellProperties",void 0),this.hot=e,this.tableMeta=n,this.selection=r,this.eventManager=new zo(e),this.hot.addHook("afterDocumentKeyDown",i=>qy(ug,this,zP).call(this,i)),this.hot.addHook("beforeCompositionStart",i=>qy(ug,this,zP).call(this,i)),this.hot.view._wt.update("onCellDblClick",(i,o,s)=>qy(ug,this,qz).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=ZN(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 zP(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||du(t))return;const{keyCode:n}=t,r=(t.ctrlKey||t.metaKey)&&!t.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!GN(n)&&!Rz(n)&&!r&&!this.isEditorOpened()&&this.openEditor("",t)}function qz(t,e){e.isCell()&&this.openEditor(null,t,!0)}const YP=new WeakMap;bR.getInstance=function(t,e,n){let r=YP.get(t);return r||(r=new bR(t,e,n),YP.set(t,r)),r};function Xz(t,e){QN(t,e),e.add(t)}function Nh(t,e,n){QN(t,e),e.set(t,n)}function QN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gt(t,e){return t.get(ia(t,e))}function Dh(t,e,n){return t.set(ia(t,e),n),n}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 Gc=Object.freeze({CELL:"cell",MIXED:"mixed"});var en=new WeakMap,cg=new WeakMap,hg=new WeakMap,dg=new WeakMap,fg=new WeakMap,Ga=new WeakSet;class Zz{constructor(e){var n=this;Xz(this,Ga),Nh(this,en,void 0),Nh(this,cg,void 0),Nh(this,hg,1),Nh(this,dg,null),Nh(this,fg,new Map);const r=e.getSettings();Dh(en,this,e),Dh(cg,this,r.imeFastEdit?Gc.MIXED:Gc.CELL),gt(en,this).addHook("afterUpdateSettings",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ia(Ga,n,Jz).call(n,...o)}),gt(en,this).addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ia(Ga,n,GP).call(n,...o)}),gt(en,this).addHook("afterSelectionFocusSet",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ia(Ga,n,GP).call(n,...o)}),gt(en,this).addHook("afterSelectionEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ia(Ga,n,Qz).call(n,...o)})}getFocusMode(){return gt(cg,this)}setFocusMode(e){Object.values(Gc).includes(e)?Dh(cg,this,e):Ze(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return gt(hg,this)}setRefocusDelay(e){Dh(hg,this,e)}setRefocusElementGetter(e){Dh(dg,this,e)}getRefocusElement(){var e;return typeof gt(dg,this)=="function"?gt(dg,this).call(this):(e=gt(en,this).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const n=r=>{var i,o;const s=(i=gt(en,this).getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;if(!s)return;let a=gt(en,this).runHooks("modifyFocusedElement",s.row,s.col,r);pa(a)||(a=r),a&&!((o=gt(en,this).getActiveEditor())!==null&&o!==void 0&&o.isOpened())&&a.focus({preventScroll:!0})};e?n(e):ia(Ga,this,n0).call(this,r=>n(r))}refocusToEditorTextarea(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gt(hg,this);if(gt(en,this).getSettings().imeFastEdit&&!((e=gt(en,this).getActiveEditor())!==null&&e!==void 0&&e.isOpened())){var r,i;(r=gt(en,this).getActiveEditor())===null||r===void 0||(i=r.refreshValue)===null||i===void 0||i.call(r),gt(fg,this).has(n)||gt(fg,this).set(n,Ew(()=>{if(!gt(en,this).isDestroyed){var o;(o=this.getRefocusElement())===null||o===void 0||o.select()}},n)),gt(fg,this).get(n)()}}}function n0(t){var e;const n=(e=gt(en,this).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||!gt(en,this).selection.isCellVisible(n)){t(null);return}const r=gt(en,this).getCell(n.row,n.col,!0);r===null?gt(en,this).addHookOnce("afterScroll",()=>{t(gt(en,this).getCell(n.row,n.col,!0))}):t(r)}function GP(){ia(Ga,this,n0).call(this,t=>{const{activeElement:e}=gt(en,this).rootDocument;e&&$N(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function Qz(){ia(Ga,this,n0).call(this,t=>{this.getFocusMode()===Gc.MIXED&&(t==null?void 0:t.nodeName)==="TD"&&this.refocusToEditorTextarea()})}function Jz(t){typeof t.imeFastEdit=="boolean"&&this.setFocusMode(t.imeFastEdit?Gc.MIXED:Gc.CELL)}var KP={},Xy,qP;function eY(){if(qP)return Xy;qP=1;var t=mo(),e=Nu(),n=Yo(),r=n("match");return Xy=function(i){var o;return t(i)&&((o=i[r])!==void 0?!!o:e(i)==="RegExp")},Xy}var Zy,XP;function tY(){if(XP)return Zy;XP=1;var t=ln();return Zy=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},Zy}var Qy,ZP;function nY(){if(ZP)return Qy;ZP=1;var t=sn(),e=po(),n=xf(),r=tY(),i=RegExp.prototype;return Qy=function(o){var s=o.flags;return s===void 0&&!("flags"in i)&&!e(o,"flags")&&n(i,o)?t(r,o):s},Qy}var Jy,QP;function rY(){if(QP)return Jy;QP=1;var t=qt(),e=lh(),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 g=c+l.length,C=h.length,y=a;return d!==void 0&&(d=e(d),y=s),i(f,y,function(E,v){var P;switch(r(v,0)){case"$":return"$";case"&":return l;case"`":return o(u,0,c);case"'":return o(u,g);case"<":P=d[o(v,1,-1)];break;default:var O=+v;if(O===0)return E;if(O>C){var L=n(O/10);return L===0?E:L<=C?h[L-1]===void 0?r(v,1):h[L-1]+r(v,1):E}P=h[O-1]}return P===void 0?"":P})},Jy}var JP;function iY(){if(JP)return KP;JP=1;var t=dt(),e=sn(),n=qt(),r=Pf(),i=an(),o=mo(),s=eY(),a=uw(),l=Af(),u=nY(),c=rY(),h=Yo(),d=gl(),f=h("replace"),g=TypeError,C=n("".indexOf),y=n("".replace),E=n("".slice),v=Math.max;return t({target:"String",proto:!0},{replaceAll:function(O,L){var T=r(this),A,K,U,j,Z,J,se,te,ue,pt,be=0,ke="";if(o(O)){if(A=s(O),A&&(K=a(r(u(O))),!~C(K,"g")))throw new g("`.replaceAll` does not allow non-global regexes");if(U=l(O,f),U)return e(U,O,T,L);if(d&&A)return y(a(T),O,L)}for(j=a(T),Z=a(O),J=i(L),J||(L=a(L)),se=Z.length,te=v(1,se),ue=C(j,Z);ue!==-1;)pt=J?a(L(Z,ue,j)):c(Z,j,ue,[],void 0,L),ke+=E(j,be,ue)+pt,be=ue+se,ue=ue+te>j.length?-1:C(j,Z,ue+te);return be<j.length&&(ke+=E(j,be)),ke}}),KP}iY();var eO={},tO={},nO;function oY(){if(nO)return tO;nO=1;var t=dt(),e=hh(),n=pr(),r=ln(),i=Os(),o=Yi(),s=pl(),a=Nf(),l=Cn(),u=TypeError,c=l(function(){[].keys().reduce(function(){},void 0)}),h=!c&&s("reduce",u);return t({target:"Iterator",proto:!0,real:!0,forced:c||h},{reduce:function(f){r(this);try{n(f)}catch(v){o(this,"throw",v)}var g=arguments.length<2,C=g?void 0:arguments[1];if(h)return a(h,this,g?[f]:[f,C]);var y=i(this),E=0;if(e(y,function(v){g?(g=!1,C=v):C=f(C,v,E),E++},{IS_RECORD:!0}),g)throw new u("Reduce of empty iterator with no initial value");return C}}),tO}var rO;function sY(){return rO||(rO=1,oY()),eO}sY();const JN={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">"},aY=new RegExp(Object.keys(JN).map(t=>`(${t})`).join("|"),"gi");function lY(t){return(t&&t.nodeName||"")==="TABLE"}function iO(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,g=[];for(let y=0;y<s;y+=1){const E=!f&&n&&y===0;let v="";if(f)v=`<th>${t.getColHeader(y-c)}</th>`;else if(E)v=`<th>${t.getRowHeader(d-h)}</th>`;else{const P=i[d][y],{hidden:O,rowspan:L,colspan:T}=t.getCellMeta(d-h,y-c);if(!O){const A=[];if(L&&A.push(`rowspan="${L}"`),T&&A.push(`colspan="${T}"`),Ut(P))v=`<td ${A.join(" ")}></td>`;else{const K=P.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
35
+ `).replace(/\x20/gi,"&nbsp;").replace(/\t/gi,"&#9;");v=`<td ${A.join(" ")}>${K}</td>`}}}g.push(v)}const C=["<tr>",...g,"</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 oO(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=Ut(l)?"":l.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
36
+ `).replace(/\x20{2,}/gi,c=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(c.length-1)} </span>`).replace(/\t/gi,"&#9;");s.push(`<td>${u}</td>`)}n.push("<tr>",...s,"</tr>"),r+1===e&&n.push("</tbody>")}return n.push("</table>"),n.join("")}function uY(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 P=o.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,O=>{const L=O.match(/<td\b[^>]*?>/g)[0],T=/<p.*?>/g,A=O.substring(L.length,O.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(T,`
37
+ `).replace(`
38
+ `,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^&nbsp;$/mg,"");return`${L}${A}</td>`});i.insertAdjacentHTML("afterbegin",`${P}`),o=i.querySelector("table")}if(!o||!lY(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((P,O)=>P+O.colSpan,0)-(a?1:0):0,c=o.tFoot&&Array.from(o.tFoot.rows)||[],h=[];let d=!1,f=0,g=0;if(o.tHead){const P=Array.from(o.tHead.rows).filter(O=>{const L=O.querySelector("td")!==null;return L&&h.push(O),!L});f=P.length,d=f>0,f>1?n.nestedHeaders=Array.from(P).reduce((O,L)=>{const T=Array.from(L.cells).reduce((A,K,U)=>{if(a&&U===0)return A;const{colSpan:j,innerHTML:Z}=K,J=j>1?{label:Z,colspan:j}:Z;return A.push(J),A},[]);return O.push(T),O},[]):d&&(n.colHeaders=Array.from(P[0].children).reduce((O,L,T)=>(a&&T===0||O.push(L.innerHTML),O),[]))}h.length&&(n.fixedRowsTop=h.length),c.length&&(n.fixedRowsBottom=c.length);const C=[...h,...Array.from(o.tBodies).reduce((P,O)=>(P.push(...Array.from(O.rows)),P),[]),...c];g=C.length;const y=new Array(g);for(let P=0;P<g;P++)y[P]=new Array(u);const E=[],v=[];for(let P=0;P<g;P++){const O=C[P],L=Array.from(O.cells),T=L.length;for(let A=0;A<T;A++){const K=L[A],{nodeName:U,innerHTML:j,rowSpan:Z,colSpan:J}=K,se=y[P].findIndex(te=>te===void 0);if(U==="TD"){if(Z>1||J>1){for(let be=P;be<P+Z;be++)if(be<g)for(let ke=se;ke<se+J;ke++)y[be][ke]=null;const ue=K.getAttribute("style");ue&&ue.includes("mso-ignore:colspan")||E.push({col:se,row:P,rowspan:Z,colspan:J})}let te="";s&&/excel/gi.test(s.content)?te=j.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
39
+ `):te=j.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
40
+ `),y[P][se]=te.replace(aY,ue=>JN[ue])}else v.push(j)}}return E.length&&(n.mergeCells=E),v.length&&(n.rowHeaders=v),y.length&&(n.data=y),n}function Un(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 cY(t){return Un(t,[","])}function de(t,e,n){let r=-1;for(typeof e=="function"?(n=e,e=t):r=t-1;++r<=e&&n(r)!==!1;);}function sO(t,e,n){let r=t+1;for(typeof e=="function"&&(n=e,e=0);--r>=e&&n(r)!==!1;);}function eD(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function Ue(t,e,n){return Math.min(t,e)===t?e:Math.max(t,n)===t?n:t}const SR="asc",hY="desc",aO=new Map([[SR,[-1,1]],[hY,[1,-1]]]),dY=t=>`The priority '${t}' is already declared in a map.`,fY=t=>`The priority '${t}' is not a number.`;function gY(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=new Map;t=ot(t)?t:dY,e=ot(e)?e:fY;function r(o,s){if(!Un(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]:SR;const[s,a]=aO.get(o)||aO.get(SR);return[...n].sort((l,u)=>l[0]<u[0]?s:a).map(l=>l[1])}return{addItem:r,getItems:i}}const mY=t=>`The id '${t}' is already declared in a map.`;function Mw(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=ot(t)?t:mY;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 pY=t=>`'${t}' value is already declared in a unique set.`;function wY(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=ot(t)?t:pY;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 r0=t=>`There is already registered "${t}" plugin.`,vY=t=>`There is already registered plugin on priority "${t}".`,CY=t=>`The priority "${t}" is not a number.`,tD=gY({errorPriorityExists:vY,errorPriorityNaN:CY}),nD=wY({errorItemExists:r0}),RR=Mw({errorIdExists:r0});function rD(){return[...tD.getItems(),...nD.getItems()]}function i0(t){const e=Uo(t);return RR.getItem(e)}function yY(t){return!!i0(t)}function ze(t,e,n){[t,e,n]=SY(t,e,n),i0(t)===void 0&&bY(t,e,n)}function bY(t,e,n){const r=Uo(t);if(RR.hasItem(r))throw new Error(r0(r));n===void 0?nD.addItem(r):tD.addItem(n,r),RR.addItem(r,e)}function SY(t,e,n){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,n=e.PLUGIN_PRIORITY),[t,e,n]}const{register:RY,getItem:EY,hasItem:iD,getNames:kle,getValues:Lle}=qo("renderers");function ER(t){if(typeof t=="function")return t;if(!iD(t))throw Error(`No registered renderer found under "${t}" name`);return EY(t)}function to(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),RY(t,e)}const{register:TY,getItem:_Y,hasItem:oD,getNames:$le,getValues:Fle}=qo("validators");function MY(t){if(typeof t=="function")return t;if(!oD(t))throw Error(`No registered validator found under "${t}" name`);return _Y(t)}function xc(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),TY(t,e)}var lO={},uO;function IY(){if(uO)return lO;uO=1;var t=dt(),e=lh(),n=ch(),r=Hf(),i=_w();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"),lO}IY();var cO={},hO;function PY(){if(hO)return cO;hO=1;var t=dt(),e=qt(),n=Pf(),r=Hf(),i=uw(),o=Cn(),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)}}),cO}PY();function kh(t,e,n){return(e=OY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OY(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)}class AY{constructor(){kh(this,"count",0),kh(this,"startColumn",null),kh(this,"endColumn",null),kh(this,"startPosition",null),kh(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 g=u[this.endColumn]+c-u[this.startColumn-1];if(g<=i&&(this.startColumn-=1),g>=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 Lh(t,e,n){return(e=HY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function HY(t){var e=NY(t,"string");return typeof e=="symbol"?e:e+""}function NY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 DY{constructor(){Lh(this,"count",0),Lh(this,"startRow",null),Lh(this,"endRow",null),Lh(this,"startPosition",null),Lh(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 $h(t,e,n){return(e=kY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kY(t){var e=LY(t,"string");return typeof e=="symbol"?e:e+""}function LY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 sD{constructor(){$h(this,"count",0),$h(this,"startColumn",null),$h(this,"endColumn",null),$h(this,"startPosition",null),$h(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 Fh(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=FY(t,"string");return typeof e=="symbol"?e:e+""}function FY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class aD{constructor(){Fh(this,"count",0),Fh(this,"startRow",null),Fh(this,"endRow",null),Fh(this,"startPosition",null),Fh(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 Vh(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{constructor(){Vh(this,"count",0),Vh(this,"startColumn",0),Vh(this,"endColumn",0),Vh(this,"startPosition",0),Vh(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalColumns:n}=e;this.count=n,this.endColumn=this.count-1}process(){}finalize(){}}function Wh(t,e,n){return(e=jY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jY(t){var e=UY(t,"string");return typeof e=="symbol"?e:e+""}function UY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 zY{constructor(){Wh(this,"count",0),Wh(this,"startRow",0),Wh(this,"endRow",0),Wh(this,"startPosition",0),Wh(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalRows:n}=e;this.count=n,this.endRow=this.count-1}process(){}finalize(){}}function dO(t,e,n){return(e=YY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function YY(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 KY extends sD{constructor(){super(...arguments),dO(this,"columnStartOffset",0),dO(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 fO(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)}class ZY extends aD{constructor(){super(...arguments),fO(this,"rowStartOffset",0),fO(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 gO(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=JY(t,"string");return typeof e=="symbol"?e:e+""}function JY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 lD{constructor(e){gO(this,"calculationTypes",[]),gO(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 bo(t,e,n){return(e=eG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eG(t){var e=tG(t,"string");return typeof e=="symbol"?e:e+""}function tG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 eh=50;class nG extends lD{constructor(e){let{calculationTypes:n,viewportWidth:r,scrollOffset:i,totalColumns:o,columnWidthFn:s,overrideFn:a,inlineStartOffset:l}=e;super(n),bo(this,"viewportWidth",0),bo(this,"scrollOffset",0),bo(this,"zeroBasedScrollOffset",0),bo(this,"totalColumns",0),bo(this,"columnWidthFn",null),bo(this,"columnWidth",0),bo(this,"overrideFn",null),bo(this,"inlineStartOffset",0),bo(this,"totalCalculatedWidth",0),bo(this,"startPositions",[]),bo(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)?eh:n}}function Xi(t,e,n){return(e=rG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rG(t){var e=iG(t,"string");return typeof e=="symbol"?e:e+""}function iG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class oG extends lD{constructor(e){let{calculationTypes:n,viewportHeight:r,scrollOffset:i,totalRows:o,defaultRowHeight:s,rowHeightFn:a,overrideFn:l,horizontalScrollbarHeight:u}=e;super(n),Xi(this,"viewportHeight",0),Xi(this,"scrollOffset",0),Xi(this,"zeroBasedScrollOffset",0),Xi(this,"totalRows",0),Xi(this,"rowHeightFn",null),Xi(this,"rowHeight",0),Xi(this,"overrideFn",null),Xi(this,"horizontalScrollbarHeight",0),Xi(this,"innerViewportHeight",0),Xi(this,"totalCalculatedHeight",0),Xi(this,"startPositions",[]),Xi(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 sG(t,e,n){aG(t,e),e.set(t,n)}function aG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mO(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=uG(t,"string");return typeof e=="symbol"?e:e+""}function uG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gu(t,e){return t.get(uD(t,e))}function pO(t,e,n){return t.set(uD(t,e),n),n}function uD(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 Ls=new WeakMap;class Iu{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;mO(this,"row",null),mO(this,"col",null),sG(this,Ls,!1),pO(Ls,this,r),typeof e<"u"&&typeof n<"u"&&(this.row=e,this.col=n)}isValid(e){const{countRows:n,countCols:r,countRowHeaders:i,countColHeaders:o}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col)||this.row<-o||this.col<-i||this.row>=n||this.col>=r)}isEqual(e){return e===this?!0:this.row===e.row&&this.col===e.col}isHeader(){return!this.isCell()}isCell(){return this.row>=0&&this.col>=0}isRtl(){return Gu(Ls,this)}isSouthEastOf(e){return this.row>=e.row&&(Gu(Ls,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(Gu(Ls,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(Gu(Ls,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(Gu(Ls,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 Iu&&pO(Ls,this,e.isRtl()),this}clone(){return new Iu(this.row,this.col,Gu(Ls,this))}toObject(){return{row:this.row,col:this.col}}}function cG(t,e,n){hG(t,e),e.set(t,n)}function hG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function eb(t,e,n){return(e=dG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dG(t){var e=fG(t,"string");return typeof e=="symbol"?e:e+""}function fG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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(cD(t,e))}function gG(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 er=new WeakMap;class jf{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;eb(this,"highlight",null),eb(this,"from",null),eb(this,"to",null),cG(this,er,!1),this.highlight=e.clone(),this.from=n.clone(),this.to=r.clone(),gG(er,this,i)}setHighlight(e){return this.highlight=e.clone(),this}setFrom(e){return this.from=e.clone(),this}setTo(e){return this.to=e.clone(),this}normalize(){return this.highlight.normalize(),this.from.normalize(),this.to.normalize(),this}isValid(e){return this.from.isValid(e)&&this.to.isValid(e)}isSingle(){return this.isSingleCell()||this.isSingleHeader()}isSingleCell(){return this.from.row>=0&&this.from.row===this.to.row&&this.from.col>=0&&this.from.col===this.to.col}isSingleHeader(){return(this.from.row<0||this.from.col<0)&&this.from.row===this.to.row&&this.from.col===this.to.col}isHeader(){return this.from.isHeader()&&this.to.isHeader()?!0:this.from.col<0&&this.to.col<0||this.from.row<0&&this.to.row<0}containsHeaders(){return this.from.isHeader()||this.to.isHeader()}getOuterHeight(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1}getOuterWidth(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1}getHeight(){if(this.from.row<0&&this.to.row<0)return 0;const e=Math.max(this.from.row,0),n=Math.max(this.to.row,0);return Math.max(e,n)-Math.min(e,n)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),n=Math.max(this.to.col,0);return Math.max(e,n)-Math.min(e,n)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:n,col:r}=e,i=this.getOuterTopStartCorner(),o=this.getOuterBottomEndCorner();return i.row<=n&&o.row>=n&&i.col<=r&&o.col>=r}includesRange(e){return this.includes(e.getOuterTopStartCorner())&&this.includes(e.getOuterBottomEndCorner())}isEqual(e){return Math.min(this.from.row,this.to.row)===Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)===Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)===Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)===Math.max(e.from.col,e.to.col)}overlaps(e){return e.isSouthEastOf(this.getOuterTopLeftCorner())&&e.isNorthWestOf(this.getOuterBottomRightCorner())}isSouthEastOf(e){return this.getOuterTopLeftCorner().isSouthEastOf(e)||this.getOuterBottomRightCorner().isSouthEastOf(e)}isNorthWestOf(e){return this.getOuterTopLeftCorner().isNorthWestOf(e)||this.getOuterBottomRightCorner().isNorthWestOf(e)}isOverlappingHorizontally(e){return this.getOuterTopEndCorner().col>=e.getOuterTopStartCorner().col&&this.getOuterTopEndCorner().col<=e.getOuterTopEndCorner().col||this.getOuterTopStartCorner().col<=e.getOuterTopEndCorner().col&&this.getOuterTopStartCorner().col>=e.getOuterTopStartCorner().col}isOverlappingVertically(e){return this.getOuterBottomStartCorner().row>=e.getOuterTopRightCorner().row&&this.getOuterBottomStartCorner().row<=e.getOuterBottomStartCorner().row||this.getOuterTopEndCorner().row<=e.getOuterBottomStartCorner().row&&this.getOuterTopEndCorner().row>=e.getOuterTopRightCorner().row}expand(e){const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();return e.row<n.row||e.col<n.col||e.row>r.row||e.col>r.col?(this.from=this._createCellCoords(Math.min(n.row,e.row),Math.min(n.col,e.col)),this.to=this._createCellCoords(Math.max(r.row,e.row),Math.max(r.col,e.col)),!0):!1}expandByRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(this.includesRange(e)||!this.overlaps(e))return!1;const r=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner(),o=this.getDirection(),s=e.getOuterTopStartCorner(),a=e.getOuterBottomEndCorner(),l=Math.min(r.row,s.row),u=Math.min(r.col,s.col),c=Math.max(i.row,a.row),h=Math.max(i.col,a.col),d=this._createCellCoords(l,u),f=this._createCellCoords(c,h);return this.from=d,this.to=f,this.setDirection(o),n&&(this.highlight.row===this.getOuterBottomRightCorner().row&&this.getVerticalDirection()==="N-S"&&this.flipDirectionVertically(),this.highlight.col===this.getOuterTopRightCorner().col&&this.getHorizontalDirection()==="W-E"&&this.flipDirectionHorizontally()),!0}getDirection(){if(this.from.isNorthWestOf(this.to))return"NW-SE";if(this.from.isNorthEastOf(this.to))return"NE-SW";if(this.from.isSouthEastOf(this.to))return"SE-NW";if(this.from.isSouthWestOf(this.to))return"SW-NE"}setDirection(e){switch(e){case"NW-SE":[this.from,this.to]=[this.getOuterTopLeftCorner(),this.getOuterBottomRightCorner()];break;case"NE-SW":[this.from,this.to]=[this.getOuterTopRightCorner(),this.getOuterBottomLeftCorner()];break;case"SE-NW":[this.from,this.to]=[this.getOuterBottomRightCorner(),this.getOuterTopLeftCorner()];break;case"SW-NE":[this.from,this.to]=[this.getOuterBottomLeftCorner(),this.getOuterTopRightCorner()];break}}getVerticalDirection(){return["NE-SW","NW-SE"].indexOf(this.getDirection())>-1?"N-S":"S-N"}getHorizontalDirection(){return["NW-SE","SW-NE"].indexOf(this.getDirection())>-1?"W-E":"E-W"}flipDirectionVertically(){switch(this.getDirection()){case"NW-SE":this.setDirection("SW-NE");break;case"NE-SW":this.setDirection("SE-NW");break;case"SE-NW":this.setDirection("NE-SW");break;case"SW-NE":this.setDirection("NW-SE");break}}flipDirectionHorizontally(){switch(this.getDirection()){case"NW-SE":this.setDirection("NE-SW");break;case"NE-SW":this.setDirection("NW-SE");break;case"SE-NW":this.setDirection("SW-NE");break;case"SW-NE":this.setDirection("SE-NW");break}}getTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getTopLeftCorner(){return Zi(er,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(er,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(er,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(er,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(er,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(er,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(er,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(er,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 Iu))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(er,this)?"left":"right"),n.bottom===r.bottom&&i.push("bottom"),n.left===r.left&&i.push(Zi(er,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 jf(this.highlight,this.from,this.to,Zi(er,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,n){return new Iu(e,n,Zi(er,this))}}function Qo(t,e,n){mG(t,e),e.set(t,n)}function mG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fe(t,e){return t.get(hD(t,e))}function Oa(t,e,n){return t.set(hD(t,e),n),n}function hD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Qi=new WeakMap,tb=new WeakMap,mn=new WeakMap,Ku=new WeakMap,gg=new WeakMap,So=new WeakMap,nb=new WeakMap,Bh=new WeakMap,Tl=new WeakMap,Jo=new WeakMap;let dD=class{constructor(e,n,r,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;Qo(this,Qi,void 0),Qo(this,tb,void 0),Qo(this,mn,void 0),Qo(this,Ku,void 0),Qo(this,gg,void 0),Qo(this,So,void 0),Qo(this,nb,void 0),Qo(this,Bh,void 0),Qo(this,Tl,[null,null]),Qo(this,Jo,[null,null]),Oa(Qi,this,r),Oa(tb,this,n),Oa(mn,this,o),Oa(Ku,this,s),Oa(gg,this,a),Oa(So,this,i),Oa(nb,this,e),this.registerEvents()}registerEvents(){fe(So,this).addEventListener(fe(mn,this).holder,"contextmenu",r=>this.onContextMenu(r)),fe(So,this).addEventListener(fe(mn,this).TABLE,"mouseover",r=>this.onMouseOver(r)),fe(So,this).addEventListener(fe(mn,this).TABLE,"mouseout",r=>this.onMouseOut(r));const e=()=>{fe(So,this).addEventListener(fe(mn,this).holder,"touchstart",r=>this.onTouchStart(r)),fe(So,this).addEventListener(fe(mn,this).holder,"touchend",r=>this.onTouchEnd(r)),this.momentumScrolling||(this.momentumScrolling={}),fe(So,this).addEventListener(fe(mn,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||fe(Qi,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,fe(Qi,this).getSetting("onAfterMomentumScroll"))},200)})},n=()=>{fe(So,this).addEventListener(fe(mn,this).holder,"mouseup",r=>this.onMouseUp(r)),fe(So,this).addEventListener(fe(mn,this).holder,"mousedown",r=>this.onMouseDown(r))};ua()?e():(jN()&&e(),n())}selectedCellWasTouched(e){const r=this.parentCell(e).coords;if(fe(Bh,this)&&r){const[i,o]=[r.row,fe(Bh,this).from.row],[s,a]=[r.col,fe(Bh,this).from.col];return i===o&&s===a}return!1}parentCell(e){const n={},r=fe(mn,this).TABLE,i=lg(e,["TD","TH"],r);return i?(n.coords=fe(mn,this).getCoords(i),n.TD=i):ve(e,"wtBorder")&&ve(e,"current")?(n.coords=fe(Ku,this).getFocusSelection().cellRange.highlight,n.TD=fe(mn,this).getCell(n.coords)):ve(e,"wtBorder")&&ve(e,"area")&&fe(Ku,this).getAreaSelection().cellRange&&(n.coords=fe(Ku,this).getAreaSelection().cellRange.to,n.TD=fe(mn,this).getCell(n.coords)),n}onMouseDown(e){const n=fe(tb,this).rootDocument.activeElement,r=BN(ZU,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);ve(i,"corner")?fe(Qi,this).getSetting("onCellCornerMouseDown",e,i):o.TD&&fe(Qi,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,o.coords,o.TD),(e.button===0||this.touchApplied)&&o.TD&&(fe(Jo,this)[0]=o.TD,clearTimeout(fe(Tl,this)[0]),fe(Tl,this)[0]=setTimeout(()=>{fe(Jo,this)[0]=null},1e3))}onContextMenu(e){if(fe(Qi,this).has("onCellContextMenu")){const n=this.parentCell(e.target);n.TD&&this.callListener("onCellContextMenu",e,n.coords,n.TD)}}onMouseOver(e){if(!fe(Qi,this).has("onCellMouseOver"))return;const n=fe(mn,this).TABLE,r=lg(e.target,["TD","TH"],n),i=fe(gg,this)||this;r&&r!==i.lastMouseOver&&Su(r,n)&&(i.lastMouseOver=r,this.callListener("onCellMouseOver",e,fe(mn,this).getCoords(r),r))}onMouseOut(e){if(!fe(Qi,this).has("onCellMouseOut"))return;const n=fe(mn,this).TABLE,r=lg(e.target,["TD","TH"],n),i=lg(e.relatedTarget,["TD","TH"],n),o=fe(gg,this)||this;r&&r!==i&&Su(r,n)&&(this.callListener("onCellMouseOut",e,fe(mn,this).getCoords(r),r),i===null&&(o.lastMouseOver=null))}onMouseUp(e){const n=this.parentCell(e.target);n.TD&&fe(Qi,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,n.coords,n.TD),!(e.button!==0&&!this.touchApplied)&&(n.TD===fe(Jo,this)[0]&&n.TD===fe(Jo,this)[1]?(ve(e.target,"corner")?this.callListener("onCellCornerDblClick",e,n.coords,n.TD):this.callListener("onCellDblClick",e,n.coords,n.TD),fe(Jo,this)[0]=null,fe(Jo,this)[1]=null):n.TD===fe(Jo,this)[0]&&(fe(Jo,this)[1]=n.TD,clearTimeout(fe(Tl,this)[1]),fe(Tl,this)[1]=setTimeout(()=>{fe(Jo,this)[1]=null},500)))}onTouchStart(e){Oa(Bh,this,fe(Ku,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=ae(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&o&&fe(Qi,this).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];zN()&&(vz()||Cz())&&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=fe(Qi,this).getSettingPure(e);o&&o(n,r,i,fe(nb,this).call(this))}destroy(){clearTimeout(fe(Tl,this)[0]),clearTimeout(fe(Tl,this)[1]),fe(So,this).destroy()}};function rb(t,e,n){return(e=pG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pG(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 vG{constructor(e,n,r){rb(this,"offset",void 0),rb(this,"total",void 0),rb(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 ib(t,e,n){return(e=CG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function CG(t){var e=yG(t,"string");return typeof e=="symbol"?e:e+""}function yG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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,n,r){ib(this,"offset",void 0),ib(this,"total",void 0),ib(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 mg(t,e,n){return(e=SG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function SG(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 EG{constructor(){mg(this,"currentSize",0),mg(this,"nextSize",0),mg(this,"currentOffset",0),mg(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}const TG=0,wO=1,TR=2;function ob(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 IG{constructor(){ob(this,"size",new EG),ob(this,"workingSpace",TG),ob(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=wO,e.workingSpace=TR,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=TR,e.workingSpace=wO,this.sharedSize=e.getViewSize()}}var vO={},sb,CO;function PG(){if(CO)return sb;CO=1;var t=lw(),e=TypeError;return sb=function(n,r){if(!delete n[r])throw new e("Cannot delete property "+t(r)+" of "+t(n))},sb}var yO;function OG(){if(yO)return vO;yO=1;var t=dt(),e=lh(),n=ch(),r=d1(),i=PG(),o=f1(),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 g=d;g--;){var C=g+f;g in h?h[C]=h[g]:i(h,C)}for(var y=0;y<f;y++)h[y]=arguments[y]}return r(h,d+f)}}),vO}OG();function xG(t,e,n){return(e=AG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function AG(t){var e=HG(t,"string");return typeof e=="symbol"?e:e+""}function HG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bO{constructor(e,n){xG(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 NG(t,e,n){return(e=DG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function DG(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 LG{constructor(e){NG(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 bO(o,n),l=new bO(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(TR)?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 qu(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=FG(t,"string");return typeof e=="symbol"?e:e+""}function FG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 fD{constructor(e,n){qu(this,"rootNode",void 0),qu(this,"nodesPool",void 0),qu(this,"sizeSet",new IG),qu(this,"collectedNodes",[]),qu(this,"viewDiffer",new LG(this.sizeSet)),qu(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 gD extends fD{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 SO(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){SO(this,"nodeType",void 0),SO(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 jh(t,e,n){return(e=jG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jG(t){var e=UG(t,"string");return typeof e=="symbol"?e:e+""}function UG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Uf{constructor(e,n){jh(this,"nodesPool",null),jh(this,"nodeType",void 0),jh(this,"rootNode",void 0),jh(this,"table",null),jh(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new BG(e):null,this.nodeType=e,this.rootNode=n}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function RO(t,e,n){return(e=zG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zG(t){var e=YG(t,"string");return typeof e=="symbol"?e:e+""}function YG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 GG extends Uf{constructor(){super("TH"),RO(this,"orderViews",new WeakMap),RO(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new gD(e,r=>this.nodesPool.obtain(this.sourceRowIndex,r)),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,rowHeaderFunctions:n,rowHeadersCount:r,rows:i,cells:o}=this.table;for(let s=0;s<e;s++){const a=this.table.renderedRowToSource(s),l=i.getRenderedNode(s);this.sourceRowIndex=a;const u=this.obtainOrderView(l),c=o.obtainOrderView(l);u.appendView(c).setSize(r).setOffset(0).start();for(let h=r-1;h>=0;h--){u.render();const d=u.getCurrentNode();d.className="",d.removeAttribute("style"),mh(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&ye(d,[OU(),FU(),GE(h+1),Vu(-1)]),n[h](a,d,h)}u.end()}}}class KG extends Uf{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&&va(r)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&ye(this.rootNode,[RN()]);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()&&ye(s,[wR(),MN(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"),mh(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&ye(u,[GE(a+1+this.table.rowHeadersCount),Vu(-1),xU(),...a>=0?[$U()]:[wR()]]),r[n](l,u,n)}}}}let EO=!1;class qG extends Uf{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;!EO&&e>1e3&&(EO=!0,Ze(nt`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&&G(r,"rowHeader")}}function XG(t,e,n){return(e=ZG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ZG(t){var e=QG(t,"string");return typeof e=="symbol"?e:e+""}function QG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Xu={rowEven:"ht__row_even",rowOdd:"ht__row_odd"};let TO=!1;class JG extends Uf{constructor(e){super("TR",e),XG(this,"orderView",void 0),this.orderView=new fD(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;!TO&&e>1e3&&(TO=!0,Ze(nt`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()&&ye(this.rootNode,[RN()]),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;ye(o,[wR(),MN(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?ve(o,Xu.rowEven)||(pe(o,Xu.rowOdd),G(o,Xu.rowEven)):ve(o,Xu.rowOdd)||(pe(o,Xu.rowEven),G(o,Xu.rowOdd))}this.orderView.end()}}function _O(t,e,n){return(e=e2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e2(t){var e=t2(t,"string");return typeof e=="symbol"?e:e+""}function t2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 n2 extends Uf{constructor(){super("TD"),_O(this,"orderViews",new WeakMap),_O(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new gD(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),g=c.getCurrentNode();if(ve(g,"hide")||(g.className=""),g.removeAttribute("style"),g.removeAttribute("dir"),mh(g,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,f,g),this.table.isAriaEnabled()){var o,s;ye(g,[...g.hasAttribute("role")?[]:[PU()],Vu(-1),GE(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=r2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r2(t){var e=i2(t,"string");return typeof e=="symbol"?e:e+""}function i2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 o2{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 s2{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 o2(e,{cellRenderer:a,stylesHandler:l}),this.renderer.setRenderers({rowHeaders:new GG,columnHeaders:new KG(n),colGroup:new qG(r),rows:new JG(i),cells:new n2}),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 ab(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 u2{constructor(e,n){ab(this,"dataAccessObject",void 0),ab(this,"wtSettings",void 0),ab(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 MO(t,e,n){return(e=c2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c2(t){var e=h2(t,"string");return typeof e=="symbol"?e:e+""}function h2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 d2{constructor(e,n){MO(this,"dataAccessObject",void 0),MO(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 es(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 wh{constructor(e,n,r,i,o){es(this,"wtSettings",null),es(this,"domBindings",void 0),es(this,"TBODY",null),es(this,"THEAD",null),es(this,"COLGROUP",null),es(this,"hasTableHeight",!0),es(this,"hasTableWidth",!0),es(this,"isTableVisible",!1),es(this,"tableOffset",0),es(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,xN(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 d2(this.dataAccessObject,this.wtSettings),this.columnUtils=new u2(this.dataAccessObject,this.wtSettings),this.tableRenderer=new s2({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||!ve(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")&&ye(r,[la()]),r}createHider(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ve(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtHider",n&&n.insertBefore(r,e),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&ye(r,[la()]),r}createHolder(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ve(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.style.position="relative",r.className="wtHolder",ye(r,[Vu(-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")&&ye(r.parentNode,[la()])),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&ye(r,[la()]),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(),g=this.correctHeaderWidth;this.correctHeaderWidth=f!==0,g!==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=Math.max(this.getFirstRenderedRow(),0),g=Math.max(this.getFirstRenderedColumn(),0);this.rowFilter=new bG(f,o,c),this.columnFilter=new vG(g,s,l);let C=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const y={};this.wtSettings.getSetting("beforeDraw",!0,y),C=y.skipRender!==!0}C&&(this.tableRenderer.setHeaderContentRenderers(a,u),(this.is(Rs)||this.is(ul))&&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(Rs))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||i.createVisibleCalculators(),r.refresh(!1),r.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(Rs)&&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=Vd(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(Rs))&&!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=Tu(n,["TD","TH"])),n===null)return null;const r=n.parentNode;if(!r)return null;const i=r.parentNode;let o=ez(r),s=n.cellIndex;Rl(xu,n,this.wtRootElement)||Rl(Pu,n,this.wtRootElement)?i.nodeName==="THEAD"&&(o-=i.childNodes.length):Rl(ul,n,this.wtRootElement)||Rl(Rs,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)),Rl(xu,n,this.wtRootElement)||Rl(Ou,n,this.wtRootElement)||Rl(ul,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=Vd(this.TBODY)-1,i=this.wot.stylesHandler.areCellsBorderBox(),o=i?nn:Vd,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 Kt(this.TABLE)}getHeight(){return nn(this.TABLE)}getTotalWidth(){const e=Kt(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=nn(this.hider);return e!==0?e:this.getHeight()}isVisible(){return Jc(this.TABLE)}_modifyRowHeaderWidth(e){let n=ot(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 m2="stickyRowsBottom",o0={getFirstRenderedRow(){const t=this.getRenderedRowsCount();return t===0?-1:this.wtSettings.getSetting("totalRows")-t},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()===0?-1:this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsBottom"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return 0}};Ea(o0,"MIXIN_NAME",m2,{writable:!1,enumerable:!1});const p2="stickyColumnsStart",Iw={getFirstRenderedColumn(){return this.getRenderedColumnsCount()===0?-1:0},getFirstVisibleColumn(){return this.getFirstRenderedColumn()},getFirstPartiallyVisibleColumn(){return this.getFirstRenderedColumn()},getLastRenderedColumn(){return this.getRenderedColumnsCount()-1},getLastVisibleColumn(){return this.getLastRenderedColumn()},getLastPartiallyVisibleColumn(){return this.getLastRenderedColumn()},getRenderedColumnsCount(){return Math.min(this.wtSettings.getSetting("totalColumns"),this.wtSettings.getSetting("fixedColumnsStart"))},getVisibleColumnsCount(){return this.getRenderedColumnsCount()},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};Ea(Iw,"MIXIN_NAME",p2,{writable:!1,enumerable:!1});class s0 extends wh{constructor(e,n,r,i){super(e,n,r,i,ul)}}ut(s0,o0);ut(s0,Iw);const Pu="top",Rs="bottom",Ou="inline_start",xu="top_inline_start_corner",ul="bottom_inline_start_corner",mD=[Pu,Rs,Ou,xu,ul],w2=new Map([[Pu,`ht_clone_${Pu}`],[Rs,`ht_clone_${Rs}`],[Ou,`ht_clone_${Ou} ht_clone_left`],[xu,`ht_clone_${xu} ht_clone_top_left_corner`],[ul,`ht_clone_${ul} ht_clone_bottom_left_corner`]]);function v2(t,e){C2(t,e),e.add(t)}function C2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function y2(t,e,n){return(e=b2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function b2(t){var e=S2(t,"string");return typeof e=="symbol"?e:e+""}function S2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 pg(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 Uh=new WeakSet;class R2{constructor(e){v2(this,Uh),y2(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=zi(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=zi(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 pg(Uh,this,PO).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return pg(Uh,this,PO).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return pg(Uh,this,IO).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return pg(Uh,this,IO).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function IO(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(HN(s,s));if(l>u){const c=NN(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=XE(o,o);if(s.top>a){const l=Vd(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 Ji(t,e,n){return(e=E2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function E2(t){var e=T2(t,"string");return typeof e=="symbol"?e:e+""}function T2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 a0{get eventManager(){return new zo(this)}constructor(e,n){Ji(this,"wtTable",void 0),Ji(this,"wtScroll",void 0),Ji(this,"wtViewport",void 0),Ji(this,"wtOverlays",void 0),Ji(this,"selectionManager",void 0),Ji(this,"wtEvent",void 0),Ji(this,"guid",`wt_${yN()}`),Ji(this,"drawInterrupted",!1),Ji(this,"drawn",!1),Ji(this,"activeOverlayName","master"),Ji(this,"domBindings",void 0),Ji(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=n,this.wtScroll=new R2(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){_u(r,e[n])}])}}createCellCoords(e,n){return new Iu(e,n,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,n,r){return new jf(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()||nz(this.wtTable.wtRootElement.parentNode)?this.drawInterrupted=!0:this.wtTable.draw(e),this}getCell(e){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1))return this.wtTable.getCell(e);const r=this.wtSettings.getSetting("totalRows"),i=this.wtSettings.getSetting("fixedRowsTop"),o=this.wtSettings.getSetting("fixedRowsBottom"),s=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<i&&e.col<s)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<i)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<s&&e.row>=r-o){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col<s)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);if(e.row<r&&e.row>=r-o&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,n,r){return this.wtScroll.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this.wtScroll.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this.wtScroll.scrollViewportVertically(e,n)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){const e=this;return{get drawn(){return e.drawn},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get wtTable(){return e.wtTable},get wtViewport(){return e.wtViewport},get wtSettings(){return e.wtSettings},get rootWindow(){return e.domBindings.rootWindow},get totalRows(){return e.wtSettings.getSetting("totalRows")},get totalColumns(){return e.wtSettings.getSetting("totalColumns")},get fixedRowsTop(){return e.wtSettings.getSetting("fixedRowsTop")},get fixedRowsBottom(){return e.wtSettings.getSetting("fixedRowsBottom")},get fixedColumnsStart(){return e.wtSettings.getSetting("fixedColumnsStart")}}}getTableDao(){const e=this;return{get wot(){return e},get parentTableOffset(){return e.cloneSource.wtTable.tableOffset},get cloneSource(){return e.cloneSource},get workspaceWidth(){return e.wtViewport.getWorkspaceWidth()},get wtViewport(){return e.wtViewport},get wtOverlays(){return e.wtOverlays},get selectionManager(){return e.selectionManager},get stylesHandler(){return e.stylesHandler},get drawn(){return e.drawn},set drawn(n){e.drawn=n},get wtTable(){return e.wtTable},get startColumnRendered(){return e.wtViewport.columnsRenderCalculator.startColumn},get startColumnVisible(){return e.wtViewport.columnsVisibleCalculator.startColumn},get startColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.startColumn},get endColumnRendered(){return e.wtViewport.columnsRenderCalculator.endColumn},get endColumnVisible(){return e.wtViewport.columnsVisibleCalculator.endColumn},get endColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.endColumn},get countColumnsRendered(){return e.wtViewport.columnsRenderCalculator.count},get countColumnsVisible(){return e.wtViewport.columnsVisibleCalculator.count},get startRowRendered(){return e.wtViewport.rowsRenderCalculator.startRow},get startRowVisible(){return e.wtViewport.rowsVisibleCalculator.startRow},get startRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.startRow},get endRowRendered(){return e.wtViewport.rowsRenderCalculator.endRow},get endRowVisible(){return e.wtViewport.rowsVisibleCalculator.endRow},get endRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.endRow},get countRowsRendered(){return e.wtViewport.rowsRenderCalculator.count},get countRowsVisible(){return e.wtViewport.rowsVisibleCalculator.count},get columnHeaders(){return e.wtSettings.getSetting("columnHeaders")},get rowHeaders(){return e.wtSettings.getSetting("rowHeaders")}}}}function OO(t,e,n){return(e=_2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _2(t){var e=M2(t,"string");return typeof e=="symbol"?e:e+""}function M2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 I2 extends a0{constructor(e,n,r){super(e,n),OO(this,"cloneSource",void 0),OO(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 dD(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,r.event),this.findOriginalHeaders()}}function P2(t,e,n){return(e=O2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O2(t){var e=x2(t,"string");return typeof e=="symbol"?e:e+""}function x2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 zf{constructor(e,n,r,i,o){P2(this,"wtSettings",null),Ea(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=df(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=df(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=pp(e.TABLE)}getRelativeCellPosition(e,n,r){if(this.clone.wtTable.holder.contains(e)===!1){Ze(`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(mD.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=`${w2.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")&&ye(o,[la()]),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===Pu||u==="vertical"&&this.type===Ou?this.mainTableScrollableElement=i:i.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=pp(e.TABLE),new I2(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 A2 extends zf{constructor(e,n,r,i,o,s){super(e,n,ul,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 s0(...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 Rw(n),this.repositionOverlay();let r=nn(this.clone.wtTable.TABLE);const i=Kt(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 H2="calculatedColumns",Pw={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}};Ea(Pw,"MIXIN_NAME",H2,{writable:!1,enumerable:!1});class l0 extends wh{constructor(e,n,r,i){super(e,n,r,i,Rs)}}ut(l0,o0);ut(l0,Pw);function N2(t,e,n){return(e=D2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D2(t){var e=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 L2 extends zf{constructor(e,n,r,i){super(e,n,Rs,r,i),N2(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 l0(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,n=this.clone.wtTable.holder.parentNode;n.style.top="";let r=0;const i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!i||i!=="vertical")?(r=this.getOverlayOffset(),n.style.bottom=`${r}px`):(r=this.getScrollPosition(),this.repositionOverlay());const o=this.adjustHeaderBordersPosition(r);return this.adjustElementsSize(),o}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;n.hasVerticalScroll()||(o+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(o+=vn(r)),i.style.bottom=`${o}px`}setScrollPosition(e){const{rootWindow:n}=this.domBindings,r=this.mainTableScrollableElement;let i=!1;if(r===n&&e!==n.scrollY){const o=n.scrollY;n.scrollTo(qE(n),top),i=o!==n.scrollY}else if(e!==r.scrollTop){const o=r.scrollTop;r.scrollTop=e,i=o!==r.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const{wtTable:r,stylesHandler:i}=this.wot,o=i.getDefaultRowHeight();let s=e,a=0;for(;s<n;){const l=r.getRowHeight(s);a+=l===void 0?o:l,s+=1}return a}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=n.getWorkspaceWidth();n.hasVerticalScroll()&&(u-=vn(r)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=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 XE(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=ve(s,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(G(s,"innerBorderBottom"),o=!a):(pe(s,"innerBorderBottom"),o=a)}return o}}const $2="calculatedRows",u0={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}};Ea(u0,"MIXIN_NAME",$2,{writable:!1,enumerable:!1});class c0 extends wh{constructor(e,n,r,i){super(e,n,r,i,Ou)}}ut(c0,u0);ut(c0,Iw);const F2="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++)vR(this._localHooks[t][l],this,e,n,r,i,o,s)}},clearLocalHooks(){return this._localHooks={},this}};Ea(Rn,"MIXIN_NAME",F2,{writable:!1,enumerable:!1});let pD=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")}};ut(pD,Rn);const wD="active-header",h0="header",d0="area",Wd="focus",V2="fill",W2="row",B2="column",j2="custom-selection",f0=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 xO={},AO;function U2(){if(AO)return xO;AO=1;var t=_w();return t("flat"),xO}U2();function z2(t,e){vD(t,e),e.add(t)}function HO(t,e,n){vD(t,e),e.set(t,n)}function vD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ht(t,e){return t.get(Bd(t,e))}function NO(t,e,n){return t.set(Bd(t,e),n),n}function Bd(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Io=new WeakMap,In=new WeakMap,wg=new WeakSet;class Y2{constructor(){z2(this,wg),HO(this,Io,void 0),HO(this,In,void 0)}setActiveOverlay(e){return NO(In,this,e),this}setActiveSelection(e){return NO(Io,this,e),this}scan(){const e=Ht(Io,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]=Ht(Io,this).getCorners(),{wtTable:s}=Ht(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 g=s.getColumnHeader(h,f);const C=Ht(In,this).getSetting("onBeforeHighlightingColumnHeader",h,f,{selectionType:Ht(Io,this).settings.selectionType,columnCursor:u,selectionWidth:o-r+1});C!==null&&(C!==h&&(g=s.getColumnHeader(C,f)),e(g))}u+=1}}}scanRowsInHeadersRange(e){const[n,r,i,o]=Ht(Io,this).getCorners(),{wtTable:s}=Ht(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 g=s.getRowHeader(h,f);const C=Ht(In,this).getSetting("onBeforeHighlightingRowHeader",h,f,{selectionType:Ht(Io,this).settings.selectionType,rowCursor:u,selectionHeight:i-n+1});C!==null&&(C!==h&&(g=s.getRowHeader(C,f)),e(g))}u+=1}}}scanCellsRange(e){const{wtTable:n}=Ht(In,this);Bd(wg,this,G2).call(this,(r,i)=>{const o=n.getCell(Ht(In,this).createCellCoords(r,i)),s=Ht(In,this).getSetting("onAfterDrawSelection",r,i,Ht(Io,this).settings.layerLevel);typeof s=="string"&&G(o,s),e(o)})}scanRowsInCellsRange(e){const[n,,r]=Ht(Io,this).getCorners(),{wtTable:i}=Ht(In,this);Bd(wg,this,DO).call(this,(o,s)=>{if(o>=n&&o<=r){const a=i.getCell(Ht(In,this).createCellCoords(o,s));e(a)}})}scanColumnsInCellsRange(e){const[,n,,r]=Ht(Io,this).getCorners(),{wtTable:i}=Ht(In,this);Bd(wg,this,DO).call(this,(o,s)=>{if(s>=n&&s<=r){const a=i.getCell(Ht(In,this).createCellCoords(o,s));e(a)}})}}function G2(t){let[e,n,r,i]=Ht(Io,this).getCorners();if(e<0&&r<0||n<0&&i<0)return;const{wtTable:o}=Ht(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(Ht(In,this).createCellCoords(e,n));if(!pa(a))return}for(let a=e;a<=r;a+=1)for(let l=n;l<=i;l+=1)t(a,l)}function DO(t){const{wtTable:e}=Ht(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 kO{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=f0(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(),Ko(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(" "),ua()&&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),g=parseInt(u.width,10),C=parseInt(c.width,10),y=this.wot.wtTable.getWidth(),E=this.wot.wtTable.getHeight();u.top=`${parseInt(r-g-1,10)}px`,u[l]=`${parseInt(i-g-1,10)}px`,c.top=`${parseInt(r-C/4*3,10)}px`,c[l]=`${parseInt(i-C/4*3,10)}px`;const v=Math.min(parseInt(i+o,10),y-g-f*2),P=Math.min(parseInt(i+o-C/4,10),y-C-f*2);h[l]=`${v}px`,d[l]=`${P}px`;const O=Math.min(parseInt(r+s,10),E-g-f*2),L=Math.min(parseInt(r+s-C/4,10),E-C-f*2);h.top=`${O}px`,d.top=`${L}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(u.display="block",c.display="block",this.isPartRange(e,n)?(h.display="none",d.display="none"):(h.display="block",d.display="block")):(u.display="none",h.display="none",c.display="none",d.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||n===this.wot.wtSettings.getSetting("fixedColumnsStart")?(u.zIndex="9999",c.zIndex="9999"):(u.zIndex="",c.zIndex="")}appear(e){if(this.disabled)return;let[n,r,i,o]=e;if(n<0&&i<0||r<0&&o<0){this.disappear();return}const{wtTable:s,rootDocument:a,rootWindow:l}=this.wot,u=n!==i||r!==o,c=s.getFirstRenderedRow(),h=s.getLastRenderedRow(),d=s.getFirstRenderedColumn(),f=s.getLastRenderedColumn();if(d<0&&f<0||c<0&&h<0){this.disappear();return}let g;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}g=s.getCell(this.wot.createCellCoords(n,r))}else if(g=s.getCell(this.wot.createCellCoords(n,r)),!pa(g)){this.disappear();return}const C=u?s.getCell(this.wot.createCellCoords(i,o)):g,y=An(g),E=u?An(C):y,v=An(s.TABLE),P=y.top,O=y.left,L=this.wot.wtSettings.getSetting("rtlMode");let T=0,A=0;if(L){const be=Kt(s.TABLE),ke=Kt(g),wt=l.innerWidth-v.left-be;A=O+ke-E.left,T=l.innerWidth-O-ke-wt-1}else A=E.left+Kt(C)-O,T=O-v.left-1;if(this.isEntireColumnSelected(n,i)){const be=n,ke=this.getDimensionsFromHeader("columns",r,o,be,v);let wt=null;ke&&([wt,T,A]=ke),wt&&(g=wt)}let K=P-v.top-1,U=E.top+nn(C)-P;if(this.isEntireRowSelected(r,o)){const be=r,ke=this.getDimensionsFromHeader("rows",n,i,be,v);let wt=null;ke&&([wt,K,U]=ke),wt&&(g=wt)}const j=l.getComputedStyle(g);parseInt(j.borderTopWidth,10)>0&&(K+=1,U=U>0?U-1:0),parseInt(j[L?"borderRightWidth":"borderLeftWidth"],10)>0&&(T+=1,A=A>0?A-1:0);const Z=L?"right":"left";this.topStyle.top=`${K}px`,this.topStyle[Z]=`${T}px`,this.topStyle.width=`${A}px`,this.topStyle.display="block",this.startStyle.top=`${K}px`,this.startStyle[Z]=`${T}px`,this.startStyle.height=`${U}px`,this.startStyle.display="block";const J=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${K+U-J}px`,this.bottomStyle[Z]=`${T}px`,this.bottomStyle.width=`${A}px`,this.bottomStyle.display="block",this.endStyle.top=`${K}px`,this.endStyle[Z]=`${T+A-J}px`,this.endStyle.height=`${U+1}px`,this.endStyle.display="block";let se=this.settings.border.cornerVisible;se=typeof se=="function"?se(this.settings.layerLevel):se;const te=this.wot.getSetting("onModifyGetCellCoords",i,o,!1,"render");let[ue,pt]=[i,o];if(te&&Array.isArray(te)&&([,,ue,pt]=te),ua()||!se||this.isPartRange(ue,pt))this.cornerStyle.display="none";else{this.cornerStyle.top=`${K+U+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle[Z]=`${T+A+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 be=df(s.TABLE);const ke=be===l;ke&&(be=a.documentElement);const wt=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,fn=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),et=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(o===this.wot.getSetting("totalColumns")-1){const m=ke?C.getBoundingClientRect().left:C.offsetLeft;let w=!1,p=0;L?(p=m-parseInt(this.cornerDefaultStyle.width,10)/2,w=p<0):(p=m+Kt(C)+parseInt(this.cornerDefaultStyle.width,10)/2,w=p>=NN(be)),w&&(this.cornerStyle[Z]=`${Math.floor(T+A+this.cornerCenterPointOffset-fn-wt)}px`,this.cornerStyle[L?"borderLeftWidth":"borderRightWidth"]=0)}if(i===this.wot.getSetting("totalRows")-1){const p=(ke?C.getBoundingClientRect().top:C.offsetTop)+nn(C)+parseInt(this.cornerDefaultStyle.height,10)/2>=Vd(be),I=this.wot.stylesHandler.isClassicTheme();if(p){const $=Math.floor(K+U+this.cornerCenterPointOffset-et-wt);I?(this.cornerStyle.top=`${$}px`,this.cornerStyle.borderBottomWidth=0):this.cornerStyle.top=`${$-1}px`}}this.cornerStyle.display="block"}ua()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(i,o,K,T,A,U)}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,g=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 Kt(...arguments)},c="ht__selection--columns",f="left";break}if(a.classList.contains(c)){const y=this.wot.getSetting("columnHeaders").length;if(g=l(n,y-i),C=l(r,y-i),!g||!C)return!1;const E=An(g),v=An(C);return g&&C&&(h=E[f]-o[f]-1,d=v[f]+u(C)-E[f]),[g,h,d]}return!1}changeBorderStyle(e,n){const r=this[e].style,i=n[e];!i||i.hide?G(this[e],"hidden"):(ve(this[e],"hidden")&&pe(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?G(this[e],"hidden"):pe(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",ua()&&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 K2(t,e){CD(t,e),e.add(t)}function Zu(t,e,n){CD(t,e),e.set(t,n)}function CD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oe(t,e){return t.get(g0(t,e))}function LO(t,e,n){return t.set(g0(t,e),n),n}function g0(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,cr=new WeakMap,lb=new WeakMap,xd=new WeakMap,ub=new WeakMap,_l=new WeakMap,$O=new WeakSet;class q2{constructor(e){K2(this,$O),Zu(this,Pn,void 0),Zu(this,cr,void 0),Zu(this,lb,new Y2),Zu(this,xd,new WeakMap),Zu(this,ub,new WeakSet),Zu(this,_l,new Map),LO(cr,this,e)}setActiveOverlay(e){return LO(Pn,this,e),Oe(lb,this).setActiveOverlay(Oe(Pn,this)),Oe(xd,this).has(Oe(Pn,this))||Oe(xd,this).set(Oe(Pn,this),new Set),this}getFocusSelection(){return Oe(cr,this)!==null?Oe(cr,this).getFocus():null}getAreaSelection(){return Oe(cr,this)!==null?Oe(cr,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(Oe(_l,this).has(e)){const r=Oe(_l,this).get(e);if(r.has(Oe(Pn,this)))return r.get(Oe(Pn,this));const i=new kO(Oe(Pn,this),e.settings);return r.set(Oe(Pn,this),i),i}const n=new kO(Oe(Pn,this),e.settings);return Oe(_l,this).set(e,new Map([[Oe(Pn,this),n]])),n}getBorderInstances(e){var n,r;return Array.from((n=(r=Oe(_l,this).get(e))===null||r===void 0?void 0:r.values())!==null&&n!==void 0?n:[])}destroyBorders(e){Oe(_l,this).get(e).forEach(n=>n.destroy()),Oe(_l,this).delete(e)}render(e){if(Oe(cr,this)===null)return;e&&g0($O,this,X2).call(this);const n=Array.from(Oe(cr,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(ub,this).has(s)||(Oe(ub,this).add(s),s.addLocalHook("destroy",()=>this.destroyBorders(s)));const h=this.getBorderInstance(s);if(s.isEmpty()){h==null||h.disappear();continue}a&&Oe(lb,this).setActiveSelection(s).scan().forEach(g=>{if(r.has(g)){const C=r.get(g);C.has(a)&&u===!0?C.set(a,C.get(a)+1):C.set(a,1)}else r.set(g,new Map([[a,1]]));l&&(i.has(g)||i.set(g,[]),g.nodeName==="TH"&&i.get(g).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(xd,this).get(Oe(Pn,this)).add(u)),G(s,l),s.nodeName==="TD"&&Array.isArray((a=Oe(cr,this).options)===null||a===void 0?void 0:a.cellAttributes)&&ye(s,Oe(cr,this).options.cellAttributes)}),Array.from(i.keys()).forEach(o=>{ye(o,[...i.get(o)])})}}function X2(){const t=Oe(xd,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(cr,this).options)===null||r===void 0?void 0:r.cellAttributes)&&(s=Oe(cr,this).options.cellAttributes.map(a=>a[0])),Array.isArray((i=Oe(cr,this).options)===null||i===void 0?void 0:i.headerAttributes)&&(s=[...s,...Oe(cr,this).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=o.length;a<l;a++)pe(o[a],n),mh(o[a],s)}),t.clear()}class Z2 extends zf{constructor(e,n,r,i){super(e,n,Ou,r,i)}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new c0(...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),ZE(r,`${o}px`,"0px")):(o=this.getScrollPosition(),Rw(r));const s=this.adjustHeaderBordersPosition(o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:n}=this.domBindings;let r=!1;this.isRtl()&&(e=-e);const i=this.mainTableScrollableElement;if(i===n&&e!==n.scrollX){const o=n.scrollX;n.scrollTo(e,AN(n)),r=o!==n.scrollX}else if(e!==i.scrollLeft){const o=i.scrollLeft;i.scrollLeft=e,r=o!==i.scrollLeft}return r}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,n){const r=this.wtSettings.getSetting("defaultColumnWidth");let i=e,o=0;for(;i<n;)o+=this.wot.wtTable.getColumnWidth(i)||r,i+=1;return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="vertical"){let u=n.getWorkspaceHeight();n.hasHorizontalScroll()&&(u-=vn(r)),u=Math.min(u,e.wtRootElement.scrollHeight),s.height=`${u}px`}else s.height="";this.clone.wtTable.holder.style.height=s.height;const l=Kt(this.clone.wtTable.TABLE);s.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=f0(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&&!ve(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,iz(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(HN(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?pe(r,"emptyRows"):G(r,"emptyRows");let l=!1;if(!a){if(o&&!i.length)G(r,"innerBorderLeft innerBorderInlineStart");else if(!o&&i.length){const u=ve(r,"innerBorderInlineStart");e?(G(r,"innerBorderLeft innerBorderInlineStart"),l=!u):(pe(r,"innerBorderLeft innerBorderInlineStart"),l=u)}}return l}}const Q2="stickyRowsTop",m0={getFirstRenderedRow(){return this.getRenderedRowsCount()===0?-1:0},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsTop"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};Ea(m0,"MIXIN_NAME",Q2,{writable:!1,enumerable:!1});class p0 extends wh{constructor(e,n,r,i){super(e,n,r,i,xu)}}ut(p0,m0);ut(p0,Iw);function FO(t,e,n){return(e=J2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function J2(t){var e=eK(t,"string");return typeof e=="symbol"?e:e+""}function eK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 tK extends zf{constructor(e,n,r,i,o,s){super(e,n,xu,r,i),FO(this,"topOverlay",void 0),FO(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 p0(...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();ZE(e,`${i}px`,`${o}px`)}else Rw(e);let n=nn(this.clone.wtTable.TABLE);const r=Kt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),e.style.height=`${n}px`,e.style.width=`${r}px`,!1}}class w0 extends wh{constructor(e,n,r,i){super(e,n,r,i,Pu)}}ut(w0,m0);ut(w0,Pw);function nK(t,e,n){return(e=rK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rK(t){var e=iK(t,"string");return typeof e=="symbol"?e:e+""}function iK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class oK extends zf{constructor(e,n,r,i){super(e,n,Pu,r,i),nK(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 w0(...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(),ZE(e,"0px",`${i}px`)}else i=this.getScrollPosition(),Rw(e);const s=this.adjustHeaderBordersPosition(i,o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:n}=this.domBindings,r=this.mainTableScrollableElement;let i=!1;if(r===n&&e!==n.scrollY){const o=n.scrollY;n.scrollTo(qE(n),e),i=o!==n.scrollY}else if(e!==r.scrollTop){const o=r.scrollTop;r.scrollTop=e,i=o!==r.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const r=this.wot.stylesHandler.getDefaultRowHeight();let i=e,o=0;for(;i<n;){const s=this.wot.wtTable.getRowHeight(i);o+=s===void 0?r:s,i+=1}return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=n.getWorkspaceWidth();n.hasVerticalScroll()&&(u-=vn(r)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=nn(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=f0(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&&!ve(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,rz(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 XE(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?pe(i,"emptyColumns"):G(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=ve(i,"innerBorderTop");this.cachedFixedRowsTop=r.getSetting("fixedRowsTop"),e||r.getSetting("totalRows")===0?(G(i,"innerBorderTop"),a=!h):(pe(i,"innerBorderTop"),a=h)}}return a}}function vg(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 $s(t,e,n){return(e=aK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aK(t){var e=lK(t,"string");return typeof e=="symbol"?e:e+""}function lK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ml(t,e,n){return t.set(yD(t,e),n),n}function Fs(t,e){return t.get(yD(t,e))}function yD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Qu=new WeakMap,Cg=new WeakMap,Ju=new WeakMap,yg=new WeakMap;class uK{constructor(e,n,r,i,o,s){$s(this,"wot",null),vg(this,Qu,[]),$s(this,"topOverlay",null),$s(this,"bottomOverlay",null),$s(this,"inlineStartOverlay",null),$s(this,"topInlineStartCornerOverlay",null),$s(this,"bottomInlineStartCornerOverlay",null),$s(this,"browserLineHeight",void 0),$s(this,"wtSettings",null),vg(this,Cg,!1),vg(this,Ju,0),vg(this,yg,null),$s(this,"resizeObserver",new ResizeObserver(c=>{vp(()=>{!Array.isArray(c)||!c.length||(Ml(Ju,this,Fs(Ju,this)+1),Fs(Ju,this)===100&&(Ze("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()),Fs(yg,this)!==null&&clearTimeout(Fs(yg,this)),Ml(yg,this,setTimeout(()=>{Ml(Ju,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:pp(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=[...Fs(Qu,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 oK(...e),this.bottomOverlay=new L2(...e),this.inlineStartOverlay=new Z2(...e),this.topInlineStartCornerOverlay=new tK(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new A2(...e,this.bottomOverlay,this.inlineStartOverlay),Ml(Qu,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){Ml(Cg,this,Fs(Qu,this).reduce((e,n)=>n.hasRenderingStateChanged()||e,!1)),Fs(Qu,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),Fs(Qu,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||!UN())&&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",()=>{vp(()=>{clearTimeout(c),this.wtSettings.getSetting("onWindowResize"),c=setTimeout(()=>{Ml(Ju,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=Bf(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let n=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,r=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;e.deltaMode===1&&(r+=r*this.browserLineHeight,n+=n*this.browserLineHeight);const i=this.scrollVertically(n),o=this.scrollHorizontally(r);return i||o}scrollVertically(e){const n=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,n!==this.scrollableElement.scrollTop}scrollHorizontally(e){const n=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,n!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const e=this.topOverlay.clone.wtTable.holder,n=this.inlineStartOverlay.clone.wtTable.holder;let r=this.scrollableElement.scrollLeft,i=this.scrollableElement.scrollTop;if(this.wot.wtViewport.isHorizontallyScrollableByWindow()&&(r=this.scrollableElement.scrollX),this.wot.wtViewport.isVerticallyScrollableByWindow()&&(i=this.scrollableElement.scrollY),this.horizontalScrolling=this.lastScrollX!==r,this.verticalScrolling=this.lastScrollY!==i,this.lastScrollX=r,this.lastScrollY=i,this.horizontalScrolling){e.scrollLeft=r;const o=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;o&&(o.scrollLeft=r)}this.verticalScrolling&&(n.scrollTop=i),this.refreshAll()}syncScrollWithMaster(){if(!Fs(Cg,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),Ml(Cg,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=pp(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),g=()=>i?!1:this.scrollableElement.scrollLeft>Math.max(0,c-n.holder.clientWidth),C=f()?1:0,y=g()?1:0;d.width=`${c+y}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 VO(t,e,n){return(e=cK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cK(t){var e=hK(t,"string");return typeof e=="symbol"?e:e+""}function hK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class dK{constructor(e){VO(this,"settings",{}),VO(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);_u(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 v0 extends wh{constructor(e,n,r,i){super(e,n,r,i,"master")}alignOverlaysWithTrimmingContainer(){const e=df(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=wp(e,"height",n),o=wp(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=Jc(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}}}ut(v0,u0);ut(v0,Pw);class fK{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 zY:new ZY],["fullyVisible",()=>new DY],["partiallyVisible",()=>new aD]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new BY:new KY],["fullyVisible",()=>new AY],["partiallyVisible",()=>new sD]]),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+=Kt(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 oG({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 nG({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 gK(t,e){bD(t,e),e.add(t)}function Il(t,e,n){bD(t,e),e.set(t,n)}function bD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Rt(t,e){return t.get(Lo(t,e))}function ko(t,e,n){return t.set(Lo(t,e),n),n}function Lo(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const WO=23;var fs=new WeakMap,oa=new WeakMap,C0=new WeakMap,_R=new WeakMap,za=new WeakMap,Ad=new WeakMap,gf=new WeakMap,ps=new WeakSet;class mK{constructor(e){gK(this,ps),Il(this,fs,void 0),Il(this,oa,void 0),Il(this,C0,void 0),Il(this,_R,void 0),Il(this,za,!0),Il(this,Ad,{}),Il(this,gf,{}),ko(oa,this,e.rootTable.parentElement.parentElement),ko(_R,this,e.rootDocument)}isClassicTheme(){return Rt(za,this)}getCSSVariableValue(e){var n;if(Rt(za,this))return null;if(Rt(Ad,this)[`--ht-${e}`])return Rt(Ad,this)[`--ht-${e}`];const r=(n=Lo(ps,this,CK).call(this,`--ht-${e}`))!==null&&n!==void 0?n:Lo(ps,this,SD).call(this,`--ht-${e}`);if(r!==null)return Rt(Ad,this)[`--ht-${e}`]=r,r}getStyleForTD(e){var n;return(n=Rt(gf,this))===null||n===void 0?void 0:n.td[e]}getDefaultRowHeight(){if(Rt(za,this))return WO;const e=Lo(ps,this,pK).call(this);return!e&&ve(Rt(oa,this),"ht-wrapper")?(Ze(`The "${Rt(fs,this)}" theme is enabled, but its stylesheets are missing or not imported correctly. Import the correct CSS files in order to use that theme.`),ko(za,this,!0),this.useTheme(),WO):e}areCellsBorderBox(){return this.getStyleForTD("box-sizing")==="border-box"}useTheme(e){if(!e){Lo(ps,this,BO).call(this),ko(za,this,!0),ko(fs,this,e||void 0);return}e&&e!==Rt(fs,this)&&(Rt(fs,this)&&Lo(ps,this,yK).call(this),ko(fs,this,e),ko(za,this,!1),Lo(ps,this,wK).call(this),Lo(ps,this,BO).call(this))}getThemeName(){return Rt(fs,this)}removeClassNames(){ve(Rt(oa,this),Rt(fs,this))&&pe(Rt(oa,this),Rt(fs,this))}}function pK(){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 wK(){pe(Rt(oa,this),/ht-theme-.*/g),G(Rt(oa,this),Rt(fs,this))}function BO(){this.isClassicTheme()||ko(C0,this,getComputedStyle(Rt(oa,this)));const t=Lo(ps,this,vK).call(this,["box-sizing","border-bottom-width"]);Rt(gf,this).td={...Rt(gf,this).td,"box-sizing":t["box-sizing"],"border-bottom-width":t["border-bottom-width"]}}function vK(t){const e=Rt(_R,this),n=Rt(oa,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 CK(t){const e=Math.ceil(parseFloat(Lo(ps,this,SD).call(this,t)));return Number.isNaN(e)?null:e}function SD(t){const e=Rt(C0,this).getPropertyValue(t);return e===""?null:e}function yK(){ko(gf,this,{}),ko(Ad,this,{}),ko(za,this,!0)}class bK extends a0{constructor(e,n){super(e,new dK(n)),this.stylesHandler=new mK(this.domBindings);const r=this.wtSettings.getSetting("facade",this);this.wtTable=new v0(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=new fK(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new q2(this.wtSettings.getSetting("selections")),this.wtEvent=new dD(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new uK(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)}),pe(this.wtTable.wtRootElement.parentNode,n),G(this.wtTable.wtRootElement.parentNode,r)}getOverlayByName(e){var n;if(!mD.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 y0{constructor(e){e instanceof a0?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=n=>{const r=new y0(n);return()=>r},this._wot=new bK(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 jO(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 SK(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 RK=new Map([["mousedown",jO],["mouseover",SK],["touchstart",jO]]);function UO(t,e){let{coords:n,selection:r,controller:i,cellCoordsFactory:o}=e;RK.get(t.type)({coords:n,selection:r,controller:i,cellCoordsFactory:o,isShiftKey:t.shiftKey,isLeftClick:e0(t)||t.type==="touchstart",isRightClick:Mu(t)})}const RD=new WeakMap,b0=Symbol("rootInstance");function EK(t){RD.set(t,!0)}function TK(t){return t===b0}function Km(t){return RD.has(t)}function _K(t,e){ED(t,e),e.add(t)}function xa(t,e,n){ED(t,e),e.set(t,n)}function ED(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Aa(t,e,n){return(e=MK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function MK(t){var e=IK(t,"string");return typeof e=="symbol"?e:e+""}function IK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yt(t,e){return t.get(Kc(t,e))}function tr(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")}var cb=new WeakMap,bg=new WeakMap,Sg=new WeakMap,Vs=new WeakMap,Ro=new WeakMap,hb=new WeakMap,db=new WeakMap,ec=new WeakMap,Hd=new WeakSet;class PK{constructor(e){_K(this,Hd),Aa(this,"hot",void 0),Aa(this,"eventManager",void 0),Aa(this,"settings",void 0),Aa(this,"THEAD",void 0),Aa(this,"TBODY",void 0),Aa(this,"_wt",void 0),Aa(this,"activeWt",void 0),xa(this,cb,0),xa(this,bg,0),Aa(this,"postponedAdjustElementsSize",!1),xa(this,Sg,!1),xa(this,Vs,void 0),xa(this,Ro,void 0),xa(this,hb,0),xa(this,db,0),xa(this,ec,null),this.hot=e,this.eventManager=new zo(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){if(!this.hot.isRenderSuspended()){const e=this.hot.forceFullRender;this.hot.runHooks("beforeRender",e),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize()),this._wt.draw(!e),Kc(Hd,this,xK).call(this),this.hot.runHooks("afterRender",e),this.hot.forceFullRender=!1}}adjustElementsSize(){this.hot.isRenderSuspended()?this.postponedAdjustElementsSize=!0:this._wt.wtOverlays.adjustElementsSize()}getCellAtCoords(e,n){const r=this._wt.getCell(e,n);return r<0?null:r}scrollViewport(e,n,r){return this._wt.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this._wt.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this._wt.scrollViewportVertically(e,n)}createElements(){const{rootElement:e,rootDocument:n}=this.hot,r=e.getAttribute("style");r&&e.setAttribute("data-originalstyle",r),G(e,"handsontable"),tr(Ro,this,n.createElement("TABLE")),G(Yt(Ro,this),"htCore"),this.hot.getSettings().tableClassName&&G(Yt(Ro,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(ye(Yt(Ro,this),[la()]),ye(e,[IU(),_N(-1),bw(this.hot.countCols()),BU()])),this.THEAD=n.createElement("THEAD"),Yt(Ro,this).appendChild(this.THEAD),this.TBODY=n.createElement("TBODY"),Yt(Ro,this).appendChild(this.TBODY),this.hot.table=Yt(Ro,this),this.hot.container.insertBefore(Yt(Ro,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=>{tr(Sg,this,!0),this.isTextSelectionAllowed(a.target)||(MP(i),a.preventDefault(),i.focus())}),this.eventManager.addEventListener(e,"mouseup",()=>{tr(Sg,this,!1)}),this.eventManager.addEventListener(e,"mousemove",a=>{Yt(Sg,this)&&!this.isTextSelectionAllowed(a.target)&&(this.settings.fragmentSelection&&MP(i),a.preventDefault())}),this.eventManager.addEventListener(o,"keyup",a=>{r.isInProgress()&&!a.shiftKey&&r.finish()}),this.eventManager.addEventListener(o,"mouseup",a=>{r.isInProgress()&&e0(a)&&r.finish(),tr(Vs,this,!1);const l=$N(n.activeElement);Gm(n.activeElement)&&!l||(l||!r.isSelected()&&!r.isSelectedByAnyHeader()&&!e.contains(a.target)&&!Mu(a))&&this.hot.unlisten()}),this.eventManager.addEventListener(o,"contextmenu",a=>{r.isInProgress()&&Mu(a)&&(r.finish(),tr(Vs,this,!1))}),this.eventManager.addEventListener(o,"touchend",()=>{r.isInProgress()&&r.finish(),tr(Vs,this,!1)}),this.eventManager.addEventListener(o,"mousedown",a=>{const l=a.target,u=a.x||a.clientX,c=a.y||a.clientY;let h=a.target;if(Yt(Vs,this)||!e||!this.hot.view)return;const{holder:d}=this._wt.wtTable;if(h===d){const g=vn(n);if(n.elementFromPoint(u+g,c)!==d||n.elementFromPoint(u,c+g)!==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=Qc(i);for(;s!==null;)this.eventManager.addEventListener(s.document.documentElement,"click",()=>{this.hot.unlisten()}),s=Qc(s);this.eventManager.addEventListener(Yt(Ro,this),"selectstart",a=>{this.settings.fragmentSelection||Gm(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&&G(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&&pe(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:Yt(Ro,this),isDataViewInstance:()=>Km(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),tr(bg,this,o.length),this.hot.getSettings().ariaTags&&Kc(Hd,this,TD).call(this)===this.hot.countCols()&&Kc(Hd,this,OK).call(this,Yt(bg,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),tr(cb,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),g=this.hot.colToProp(d);let C=this.hot.getDataAtRowProp(h,g);this.hot.hasHook("beforeValueRender")&&(C=this.hot.runHooks("beforeValueRender",C,f)),this.hot.runHooks("beforeRenderer",a,l,u,g,C,f),this.hot.getCellRenderer(f)(this.hot,a,l,u,g,C,f),this.hot.runHooks("afterRenderer",a,l,u,g,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&&Jc(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,tr(Vs,this,!0),tr(ec,this,{x:o.clientX,y:o.clientY}),this.hot.runHooks("beforeOnCellMouseDown",o,u,a,c),!du(o)&&(UO(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,tr(Vs,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",o,u,a),!du(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),!du(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),!du(o)&&(Yt(Vs,this)&&(!Yt(ec,this)||Yt(ec,this).x!==o.clientX||Yt(ec,this).y!==o.clientY)&&UO(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,tr(ec,this,null))},onCellMouseUp:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",o,u,a),!(du(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[g,C,y,E]=f;return[g>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(g,1)):g,C>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(C,1)):C,y>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(y,-1)):y,E>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(E,-1)):E]}},onModifyGetCoordsElement:(o,s)=>{const a=this.hot.rowIndexMapper,l=this.hot.columnIndexMapper,u=s>=0?l.getVisualFromRenderableIndex(s):s,c=o>=0?a.getVisualFromRenderableIndex(o):o,h=this.hot.runHooks("modifyGetCoordsElement",c,u);if(Array.isArray(h)){const[d,f]=h;return[d>=0?a.getRenderableFromVisualIndex(a.getNearestNotHiddenIndex(d,1)):d,f>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(f,1)):f]}},viewportRowCalculatorOverride:o=>{let s=this.settings.viewportRowRenderingOffset;if(s==="auto"&&this.settings.fixedRowsTop&&(s=10),s>0||s==="auto"){const a=this.countRenderableRows(),l=o.startRow,u=o.endRow;if(typeof s=="number")o.startRow=Math.max(l-s,0),o.endRow=Math.min(u+s,a-1);else if(s==="auto"){const c=Math.max(1,Math.ceil(u/a*12));o.startRow=Math.max(l-c,0),o.endRow=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",o)},viewportColumnCalculatorOverride:o=>{let s=this.settings.viewportColumnRenderingOffset;if(s==="auto"&&this.settings.fixedColumnsStart&&(s=10),s>0||s==="auto"){const a=this.countRenderableColumns(),l=o.startColumn,u=o.endColumn;if(typeof s=="number"&&(o.startColumn=Math.max(l-s,0),o.endColumn=Math.min(u+s,a-1)),s==="auto"){const c=Math.max(1,Math.ceil(u/a*6));o.startColumn=Math.max(l-c,0),o.endColumn=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",o)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const o=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||o}};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new y0(e),this.activeWt=this._wt;const n=this._wt.wtTable.spreader,{width:r,height:i}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(r,i),this.eventManager.addEventListener(n,"mousedown",o=>{o.target===n&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(n,"contextmenu",o=>{o.target===n&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&this.hot.render()})}isTextSelectionAllowed(e){if(Gm(e))return!0;const n=Su(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 Yt(Vs,this)}isSelectedOnlyCell(){var e,n;return(e=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingleCell())!==null&&e!==void 0?e:!1}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,n){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,n)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,n){if(n.firstChild){const r=n.firstChild;if(!ve(r,"relative")){va(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;ve(s,"relative")?(this.updateCellHeader(s.querySelector(".colHeader"),e,r,i),s.className="",G(s,["relative",...o()])):(va(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&&(ye(a,...la()),ye(l,...la())),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&&(ve(e,"colHeader")?o=s.wtTable.columnFilter.sourceToRendered(n):ve(e,"rowHeader")&&(o=s.wtTable.rowFilter.sourceToRendered(n))),o>-1?ph(e,r(n,i)):(_u(e," "),G(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){tr(hb,this,e),tr(db,this,n)}getLastSize(){return{width:Yt(hb,this),height:Yt(db,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 Yt(cb,this)}getRowHeadersCount(){return Yt(bg,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 TD(){return parseInt(this.hot.rootElement.getAttribute(bw()[0]),10)}function OK(t){const e=Kc(Hd,this,TD).call(this)+t;ye(this.hot.rootElement,...bw(e))}function xK(){const t=this.hot.rootElement;this.hasVerticalScroll()?G(t,"htHasScrollY"):pe(t,"htHasScrollY"),this.hasHorizontalScroll()?G(t,"htHasScrollX"):pe(t,"htHasScrollX")}var zO={},YO={},GO;function AK(){if(GO)return YO;GO=1;var t=dt(),e=sn(),n=hh(),r=pr(),i=ln(),o=Os(),s=Yi(),a=pl(),l=a("every",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{every:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return!n(h,function(f,g){if(!c(f,d++))return g()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),YO}var KO;function HK(){return KO||(KO=1,AK()),zO}HK();const NK="ABCDEFGHIJKLMNOPQRSTUVWXYZ",qO=NK.length;function DK(t){let e=t+1,n="",r;for(;e>0;)r=(e-1)%qO,n=String.fromCharCode(65+r)+n,e=parseInt((e-r)/qO,10);return n}function _D(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 MD(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&Ae(t[0])&&(e=JE(t[0]))),e}function kK(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function LK(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function zh(t,e,n){return(e=$K(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $K(t){var e=FK(t,"string");return typeof e=="symbol"?e:e+""}function FK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class VK{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];zh(this,"hot",void 0),zh(this,"data",void 0),zh(this,"dataType","array"),zh(this,"colToProp",()=>{}),zh(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)}):de(n,r,u=>{l[u-n]=this.getAtPhysicalCell(e,u,a)});else if(Ae(a)||ot(a))if(i?l=[]:l={},!o||i){const c=this.countFirstRowKeys()-1;de(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?$y(l,d,f):l[d]=f}})}else He(a,(u,c)=>{const h=this.getAtPhysicalCell(e,c,a);s?$y(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=zi(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:$y(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?fz(r,n):r[n]}else typeof n=="function"?i=n(r):i=r[n];if(this.hot.hasHook("modifySourceData")){const o=zi(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 de(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 MD(this.data)}destroy(){this.data=null,this.hot=null}}var XO={},ZO={},QO;function WK(){if(QO)return ZO;QO=1;var t=dt(),e=sn(),n=hh(),r=pr(),i=ln(),o=Os(),s=Yi(),a=pl(),l=a("some",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{some:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return n(h,function(f,g){if(c(f,d++))return g()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),ZO}var JO;function BK(){return JO||(JO=1,WK()),XO}BK();function ex(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 Bu{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;ex(this,"indexedValues",[]),ex(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,ot(this.initValueOrFn)?de(e-1,n=>this.indexedValues.push(this.initValueOrFn(n))):de(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}}ut(Bu,Rn);function S0(t,e,n,r){const i=n.length?n[0]:void 0;return[...t.slice(0,i),...n.map((o,s)=>ot(r)?r(o,s):r),...i===void 0?[]:t.slice(i)]}function R0(t,e){return Eu(t,(n,r)=>e.includes(r)===!1)}class vl extends Bu{insert(e,n){this.indexedValues=S0(this.indexedValues,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){this.indexedValues=R0(this.indexedValues,e),super.remove(e)}}class Ow extends vl{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return wr(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}function E0(t,e,n){return[...t.slice(0,e),...n,...t.slice(e)]}function mf(t,e){return Eu(t,n=>e.includes(n)===!1)}function T0(t,e){return Be(t,n=>n-e.filter(r=>r<n).length)}function _0(t,e){const n=e[0],r=e.length;return Be(t,i=>i>=n?i+r:i)}function zK(t,e,n){return(e=YK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function YK(t){var e=GK(t,"string");return typeof e=="symbol"?e:e+""}function GK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class xw extends Bu{constructor(){super(...arguments),zK(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=mf(this.orderOfIndexes,[e]),ot(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=S0(this.indexedValues,e,n,this.initValueOrFn),this.orderOfIndexes=_0(this.orderOfIndexes,n),super.insert(e,n)}remove(e){this.indexedValues=R0(this.indexedValues,e),this.orderOfIndexes=mf(this.orderOfIndexes,e),this.orderOfIndexes=T0(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class Yf extends vl{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return wr(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}const tx=new Map([["indexesSequence",{getListWithInsertedItems:E0,getListWithRemovedItems:mf}],["physicallyIndexed",{getListWithInsertedItems:S0,getListWithRemovedItems:R0}]]),ID=t=>{if(tx.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return tx.get(t)};class PD extends Bu{constructor(){super(e=>e)}insert(e,n){const r=_0(this.indexedValues,n);this.indexedValues=E0(r,e,n),super.insert(e,n)}remove(e){const n=mf(this.indexedValues,e);this.indexedValues=T0(n,e),super.remove(e)}}const nx=new Map([["hiding",Ow],["index",Bu],["linkedPhysicalIndexToValue",xw],["physicalIndexToValue",vl],["trimming",Yf]]);function KK(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!nx.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(nx.get(t))(e)}function qK(t,e,n){return(e=XK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function XK(t){var e=ZK(t,"string");return typeof e=="symbol"?e:e+""}function ZK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class M0{constructor(){qK(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);ae(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 It(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)})}}ut(M0,Rn);function fb(t,e,n){return(e=QK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function QK(t){var e=JK(t,"string");return typeof e=="symbol"?e:e+""}function JK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 rx extends M0{constructor(e,n){super(),fb(this,"mergedValuesCache",[]),fb(this,"aggregationFunction",void 0),fb(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=Be(this.get(),o=>o.getValues()),r=[],i=ae(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 Be(r,this.aggregationFunction)}getMergedValueAtIndex(e,n){const r=this.getMergedValues(n)[e];return ae(r)?r:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function eq(t,e,n){tq(t,e),e.set(t,n)}function tq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nq(t,e,n){return t.set(OD(t,e),n),n}function rq(t,e){return t.get(OD(t,e))}function OD(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 gb=new WeakMap;class xD{constructor(){eq(this,gb,[])}subscribe(e){return this.addLocalHook("change",e),this._write(rq(gb,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){nq(gb,this,e)}}ut(xD,Rn);function ix(t,e){const n=[];let r=0,i=0;for(;r<t.length&&i<e.length;r++,i++)t[r]!==e[i]&&n.push({op:"replace",index:i,oldValue:t[r],newValue:e[i]});for(;r<e.length;r++)n.push({op:"insert",index:r,oldValue:void 0,newValue:e[r]});for(;i<t.length;i++)n.push({op:"remove",index:i,oldValue:t[i],newValue:void 0});return n}function Yh(t,e,n){iq(t,e),e.set(t,n)}function iq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function eo(t,e){return t.get(AD(t,e))}function Rg(t,e,n){return t.set(AD(t,e),n),n}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 Eg=new WeakMap,Gh=new WeakMap,Tg=new WeakMap,_g=new WeakMap,Mg=new WeakMap;class oq{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yh(this,Eg,new Set),Yh(this,Gh,[]),Yh(this,Tg,[]),Yh(this,_g,!1),Yh(this,Mg,!1),Rg(Mg,this,e??!1)}createObserver(){const e=new xD;return eo(Eg,this).add(e),e.addLocalHook("unsubscribe",()=>{eo(Eg,this).delete(e)}),e._writeInitialChanges(ix(eo(Gh,this),eo(Tg,this))),e}emit(e){let n=eo(Tg,this);(!eo(_g,this)||eo(Gh,this).length!==e.length)&&(e.length===0?e=new Array(n.length).fill(eo(Mg,this)):Rg(Gh,this,new Array(e.length).fill(eo(Mg,this))),eo(_g,this)||(Rg(_g,this,!0),n=eo(Gh,this)));const r=ix(n,e);eo(Eg,this).forEach(i=>i._write(r)),Rg(Tg,this,e)}}function kn(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=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)}class MR{constructor(){kn(this,"indexesSequence",new PD),kn(this,"trimmingMapsCollection",new rx(e=>e.some(n=>n===!0),!1)),kn(this,"hidingMapsCollection",new rx(e=>e.some(n=>n===!0),!1)),kn(this,"variousMapsCollection",new M0),kn(this,"hidingChangesObservable",new oq({initialIndexValue:!1})),kn(this,"notTrimmedIndexesCache",[]),kn(this,"notHiddenIndexesCache",[]),kn(this,"isBatched",!1),kn(this,"indexesSequenceChanged",!1),kn(this,"indexesChangeSource",void 0),kn(this,"trimmedIndexesChanged",!1),kn(this,"hiddenIndexesChanged",!1),kn(this,"renderablePhysicalIndexesCache",[]),kn(this,"fromPhysicalToVisualIndexesCache",new Map),kn(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,KK(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 Yf?this.trimmingMapsCollection.register(e,n):n instanceof Ow?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 ae(n)?n:null}getPhysicalFromRenderableIndex(e){const n=this.renderablePhysicalIndexesCache[e];return ae(n)?n:null}getVisualFromPhysicalIndex(e){const n=this.fromPhysicalToVisualIndexesCache.get(e);return ae(n)?n:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const n=this.fromVisualToRenderableIndexesCache.get(e);return ae(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=Be(e,u=>this.getPhysicalFromVisualIndex(u)),i=this.getNotTrimmedIndexesLength(),o=e.length,s=mf(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(E0(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=ae(r)?r:this.getNumberOfIndexes(),o=this.getIndexesSequence().includes(r)?this.getIndexesSequence().indexOf(r):this.getNumberOfIndexes(),s=Be(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)}}}ut(MR,Rn);function lq(t,e){return He(e,(n,r)=>{It(t[r])&&(t[r]=n)}),t}function HD(t){const n=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return n?`${n[1].toLowerCase()}-${n[2].toUpperCase()}`:t}function ND(t){ae(t)&&t0(nt`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 uq(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:cq,getValues:hq}=qo("phraseFormatters");function dq(t,e){cq(t,e)}function fq(){return hq()}dq("pluralize",uq);const DD="ContextMenu:items",_e=DD,Aw=`${_e}.noItems`,vr=`${_e}.insertRowAbove`,Cr=`${_e}.insertRowBelow`,yr=`${_e}.insertColumnOnTheLeft`,br=`${_e}.insertColumnOnTheRight`,Sr=`${_e}.removeRow`,Rr=`${_e}.removeColumn`,Er=`${_e}.undo`,Tr=`${_e}.redo`,Kn=`${_e}.readOnly`,_r=`${_e}.clearColumn`,Mr=`${_e}.copy`,Ta=`${_e}.copyWithHeaders`,_a=`${_e}.copyWithGroupHeaders`,Ma=`${_e}.copyHeadersOnly`,Ir=`${_e}.cut`,Pr=`${_e}.freezeColumn`,Or=`${_e}.unfreezeColumn`,xr=`${_e}.mergeCells`,Ar=`${_e}.unmergeCells`,Hr=`${_e}.addComment`,Nr=`${_e}.editComment`,Dr=`${_e}.removeComment`,kr=`${_e}.readOnlyComment`,Lr=`${_e}.align`,$r=`${_e}.align.left`,Fr=`${_e}.align.center`,Vr=`${_e}.align.right`,Wr=`${_e}.align.justify`,Br=`${_e}.align.top`,jr=`${_e}.align.middle`,Ur=`${_e}.align.bottom`,zr=`${_e}.borders`,Yr=`${_e}.borders.top`,Gr=`${_e}.borders.right`,Kr=`${_e}.borders.bottom`,qr=`${_e}.borders.left`,Xr=`${_e}.borders.remove`,Zr=`${_e}.nestedHeaders.insertChildRow`,Qr=`${_e}.nestedHeaders.detachFromParent`,Jr=`${_e}.hideColumn`,ei=`${_e}.showColumn`,ti=`${_e}.hideRow`,ni=`${_e}.showRow`,Xn="Filters:",$t=`${Xn}conditions`,Zn=`${$t}.none`,ri=`${$t}.isEmpty`,ii=`${$t}.isNotEmpty`,oi=`${$t}.isEqualTo`,si=`${$t}.isNotEqualTo`,ai=`${$t}.beginsWith`,li=`${$t}.endsWith`,ui=`${$t}.contains`,ci=`${$t}.doesNotContain`,gq=`${$t}.byValue`,hi=`${$t}.greaterThan`,di=`${$t}.greaterThanOrEqualTo`,fi=`${$t}.lessThan`,gi=`${$t}.lessThanOrEqualTo`,mi=`${$t}.isBetween`,pi=`${$t}.isNotBetween`,wi=`${$t}.after`,vi=`${$t}.before`,Ci=`${$t}.today`,yi=`${$t}.tomorrow`,bi=`${$t}.yesterday`,Si=`${Xn}labels.filterByCondition`,Ri=`${Xn}labels.filterByValue`,Ei=`${Xn}labels.conjunction`,Qn=`${Xn}labels.disjunction`,qn=`${Xn}values.blankCells`,Ti=`${Xn}buttons.selectAll`,_i=`${Xn}buttons.clear`,Mi=`${Xn}buttons.ok`,Ii=`${Xn}buttons.cancel`,Pi=`${Xn}buttons.placeholder.search`,Oi=`${Xn}buttons.placeholder.value`,xi=`${Xn}buttons.placeholder.secondValue`,I0="CheckboxRenderer:",Hw=`${I0}checked`,Nw=`${I0}unchecked`,mq=Object.freeze(Object.defineProperty({__proto__:null,CHECKBOX_CHECKED:Hw,CHECKBOX_RENDERER_NAMESPACE:I0,CHECKBOX_UNCHECKED:Nw,CONTEXTMENU_ITEMS_ADD_COMMENT:Hr,CONTEXTMENU_ITEMS_ALIGNMENT:Lr,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:Ur,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:Fr,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:Wr,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:$r,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:jr,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:Vr,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:Br,CONTEXTMENU_ITEMS_BORDERS:zr,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:Kr,CONTEXTMENU_ITEMS_BORDERS_LEFT:qr,CONTEXTMENU_ITEMS_BORDERS_RIGHT:Gr,CONTEXTMENU_ITEMS_BORDERS_TOP:Yr,CONTEXTMENU_ITEMS_CLEAR_COLUMN:_r,CONTEXTMENU_ITEMS_COPY:Mr,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:Ma,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:_a,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:Ta,CONTEXTMENU_ITEMS_CUT:Ir,CONTEXTMENU_ITEMS_EDIT_COMMENT:Nr,CONTEXTMENU_ITEMS_FREEZE_COLUMN:Pr,CONTEXTMENU_ITEMS_HIDE_COLUMN:Jr,CONTEXTMENU_ITEMS_HIDE_ROW:ti,CONTEXTMENU_ITEMS_INSERT_LEFT:yr,CONTEXTMENU_ITEMS_INSERT_RIGHT:br,CONTEXTMENU_ITEMS_MERGE_CELLS:xr,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:Qr,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:Zr,CONTEXTMENU_ITEMS_NO_ITEMS:Aw,CONTEXTMENU_ITEMS_READ_ONLY:Kn,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:kr,CONTEXTMENU_ITEMS_REDO:Tr,CONTEXTMENU_ITEMS_REMOVE_BORDERS:Xr,CONTEXTMENU_ITEMS_REMOVE_COLUMN:Rr,CONTEXTMENU_ITEMS_REMOVE_COMMENT:Dr,CONTEXTMENU_ITEMS_REMOVE_ROW:Sr,CONTEXTMENU_ITEMS_ROW_ABOVE:vr,CONTEXTMENU_ITEMS_ROW_BELOW:Cr,CONTEXTMENU_ITEMS_SHOW_COLUMN:ei,CONTEXTMENU_ITEMS_SHOW_ROW:ni,CONTEXTMENU_ITEMS_UNDO:Er,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:Or,CONTEXTMENU_ITEMS_UNMERGE_CELLS:Ar,CONTEXT_MENU_ITEMS_NAMESPACE:DD,FILTERS_BUTTONS_CANCEL:Ii,FILTERS_BUTTONS_CLEAR:_i,FILTERS_BUTTONS_OK:Mi,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:Pi,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:xi,FILTERS_BUTTONS_PLACEHOLDER_VALUE:Oi,FILTERS_BUTTONS_SELECT_ALL:Ti,FILTERS_CONDITIONS_AFTER:wi,FILTERS_CONDITIONS_BEFORE:vi,FILTERS_CONDITIONS_BEGINS_WITH:ai,FILTERS_CONDITIONS_BETWEEN:mi,FILTERS_CONDITIONS_BY_VALUE:gq,FILTERS_CONDITIONS_CONTAINS:ui,FILTERS_CONDITIONS_EMPTY:ri,FILTERS_CONDITIONS_ENDS_WITH:li,FILTERS_CONDITIONS_EQUAL:oi,FILTERS_CONDITIONS_GREATER_THAN:hi,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:di,FILTERS_CONDITIONS_LESS_THAN:fi,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:gi,FILTERS_CONDITIONS_NAMESPACE:$t,FILTERS_CONDITIONS_NONE:Zn,FILTERS_CONDITIONS_NOT_BETWEEN:pi,FILTERS_CONDITIONS_NOT_CONTAIN:ci,FILTERS_CONDITIONS_NOT_EMPTY:ii,FILTERS_CONDITIONS_NOT_EQUAL:si,FILTERS_CONDITIONS_TODAY:Ci,FILTERS_CONDITIONS_TOMORROW:yi,FILTERS_CONDITIONS_YESTERDAY:bi,FILTERS_DIVS_FILTER_BY_CONDITION:Si,FILTERS_DIVS_FILTER_BY_VALUE:Ri,FILTERS_LABELS_CONJUNCTION:Ei,FILTERS_LABELS_DISJUNCTION:Qn,FILTERS_NAMESPACE:Xn,FILTERS_VALUES_BLANK_CELLS:qn},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 P0={languageCode:"en-US",[Aw]:"No available options",[vr]:"Insert row above",[Cr]:"Insert row below",[yr]:"Insert column left",[br]:"Insert column right",[Sr]:["Remove row","Remove rows"],[Rr]:["Remove column","Remove columns"],[Er]:"Undo",[Tr]:"Redo",[Kn]:"Read only",[_r]:"Clear column",[Lr]:"Alignment",[$r]:"Left",[Fr]:"Center",[Vr]:"Right",[Wr]:"Justify",[Br]:"Top",[jr]:"Middle",[Ur]:"Bottom",[Pr]:"Freeze column",[Or]:"Unfreeze column",[zr]:"Borders",[Yr]:"Top",[Gr]:"Right",[Kr]:"Bottom",[qr]:"Left",[Xr]:"Remove border(s)",[Hr]:"Add comment",[Nr]:"Edit comment",[Dr]:"Delete comment",[kr]:"Read-only comment",[xr]:"Merge cells",[Ar]:"Unmerge cells",[Mr]:"Copy",[Ta]:["Copy with header","Copy with headers"],[_a]:["Copy with group header","Copy with group headers"],[Ma]:["Copy header only","Copy headers only"],[Ir]:"Cut",[Zr]:"Insert child row",[Qr]:"Detach from parent",[Jr]:["Hide column","Hide columns"],[ei]:["Show column","Show columns"],[ti]:["Hide row","Hide rows"],[ni]:["Show row","Show rows"],[Zn]:"None",[ri]:"Is empty",[ii]:"Is not empty",[oi]:"Is equal to",[si]:"Is not equal to",[ai]:"Begins with",[li]:"Ends with",[ui]:"Contains",[ci]:"Does not contain",[hi]:"Greater than",[di]:"Greater than or equal to",[fi]:"Less than",[gi]:"Less than or equal to",[mi]:"Is between",[pi]:"Is not between",[wi]:"After",[vi]:"Before",[Ci]:"Today",[yi]:"Tomorrow",[bi]:"Yesterday",[qn]:"Blank cells",[Si]:"Filter by condition",[Ri]:"Filter by value",[Ei]:"And",[Qn]:"Or",[Ti]:"Select all",[_i]:"Clear",[Mi]:"OK",[Ii]:"Cancel",[Pi]:"Search",[Oi]:"Value",[xi]:"Second value",[Hw]:"Checked",[Nw]:"Unchecked"},pq=mq,IR=P0.languageCode,{register:wq,getItem:kD,hasItem:vq,getValues:Cq}=qo("languagesDictionaries");O0(P0);function O0(t,e){let n=t,r=e;return Ae(t)&&(r=t,n=r.languageCode),yq(n,r),wq(n,Gn(r)),Gn(r)}function yq(t,e){t!==IR&&lq(e,kD(IR))}function LD(t){return x0(t)?Gn(kD(t)):null}function x0(t){return vq(t)}function bq(){return Cq()}function $D(t,e,n){const r=LD(t);if(r===null)return null;const i=r[e];if(It(i))return null;const o=Sq(i,n);return Array.isArray(o)?o[0]:o}function Sq(t,e){let n=t;return M(fq(),r=>{n=r(t,e)}),n}function Rq(t){let e=HD(t);return x0(e)||(e=IR,ND(t)),e}function Eq(t,e,n){return(e=Tq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tq(t){var e=_q(t,"string");return typeof e=="symbol"?e:e+""}function _q(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Ia extends pD{constructor(e,n){super(e,null),Eq(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 mb(t){let{activeHeaderClassName:e,...n}=t;return new Ia({className:e,...n,selectionType:wD})}function Mq(t){let{areaCornerVisible:e,...n}=t;return new Ia({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...n,selectionType:d0})}function Iq(t){let{...e}=t;return new Ia({className:"highlight",...e,selectionType:d0})}function Pq(t){let{columnClassName:e,...n}=t;return new Ia({className:e,...n,selectionType:B2})}function Oq(t){let{cellCornerVisible:e,...n}=t;return new Ia({className:"current",headerAttributes:[KE()],border:{width:2,color:"#4b89ff",cornerVisible:e},...n,selectionType:Wd})}function xq(t){let{border:e,visualCellRange:n,...r}=t;return new Ia({...e,...r,selectionType:j2},n)}function Aq(t){let{...e}=t;return new Ia({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:V2})}function ox(t){let{headerClassName:e,...n}=t;return new Ia({className:e,...n,selectionType:h0})}function Hq(t){let{rowClassName:e,...n}=t;return new Ia({className:e,...n,selectionType:W2})}function Nq(t,e){Dq(t,e),e.add(t)}function Dq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nr(t,e,n){return(e=kq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kq(t){var e=Lq(t,"string");return typeof e=="symbol"?e:e+""}function Lq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 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")}var ts=new WeakSet;class $q{constructor(e){Nq(this,ts),nr(this,"options",void 0),nr(this,"layerLevel",0),nr(this,"focus",void 0),nr(this,"fill",void 0),nr(this,"layeredAreas",new Map),nr(this,"areas",new Map),nr(this,"rowHeaders",new Map),nr(this,"columnHeaders",new Map),nr(this,"activeRowHeaders",new Map),nr(this,"activeColumnHeaders",new Map),nr(this,"activeCornerHeaders",new Map),nr(this,"rowHighlights",new Map),nr(this,"columnHighlights",new Map),nr(this,"customSelections",[]),this.options=e,this.focus=Oq(e),this.fill=Aq(e)}isEnabledFor(e,n){let r=e;e===Wd&&(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 Ws(ts,this,Bs).call(this,this.layeredAreas,Mq)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return Ws(ts,this,Bs).call(this,this.areas,Iq)}getAreas(){return[...this.areas.values()]}createRowHeader(){return Ws(ts,this,Bs).call(this,this.rowHeaders,ox)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return Ws(ts,this,Bs).call(this,this.columnHeaders,ox)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return Ws(ts,this,Bs).call(this,this.activeRowHeaders,mb)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return Ws(ts,this,Bs).call(this,this.activeColumnHeaders,mb)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return Ws(ts,this,Bs).call(this,this.activeCornerHeaders,mb)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return Ws(ts,this,Bs).call(this,this.rowHighlights,Hq)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return Ws(ts,this,Bs).call(this,this.columnHighlights,Pq)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(xq({...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 Bs(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 sx(t,e,n){return(e=Fq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fq(t){var e=Vq(t,"string");return typeof e=="symbol"?e:e+""}function Vq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Wq{constructor(e){sx(this,"ranges",[]),sx(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 Bq(t,e){FD(t,e),e.add(t)}function pb(t,e,n){FD(t,e),e.set(t,n)}function FD(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(Jt(t,e))}function Ig(t,e,n){return t.set(Jt(t,e),n),n}function Jt(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 Pg=new WeakMap,mt=new WeakMap,Vo=new WeakMap,cn=new WeakSet;class PR{constructor(e,n){Bq(this,cn),pb(this,Pg,void 0),pb(this,mt,void 0),pb(this,Vo,{x:0,y:0}),Ig(Pg,this,e),Ig(mt,this,n)}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=Ge(mt,this).createCellCoords(e,n);let o=Ge(Pg,this).current().highlight;const s=Ge(mt,this).visualToRenderableCoords(o);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),s.row!==null&&s.col!==null){const{width:u,height:c}=Jt(cn,this,VD).call(this),{row:h,col:d}=Jt(cn,this,lx).call(this,o),f=Ge(mt,this).fixedRowsBottom(),g=Ge(mt,this).minSpareRows(),C=Ge(mt,this).minSpareCols(),y=Ge(mt,this).autoWrapRow(),E=Ge(mt,this).autoWrapCol(),v=Ge(mt,this).createCellCoords(h+i.row,d+i.col);if(v.row>=c){const L=zi(r&&g>0&&f===0),T=v.col+1,A=Ge(mt,this).createCellCoords(v.row-c,T>=u?T-u:T);this.runLocalHooks("beforeColumnWrap",L,Jt(cn,this,tc).call(this,A),T>=u),L.value?this.runLocalHooks("insertRowRequire",Ge(mt,this).countRenderableRows()):E&&v.assign(A)}else if(v.row<0){const L=zi(E),T=v.col-1,A=Ge(mt,this).createCellCoords(c+v.row,T<0?u+T:T);this.runLocalHooks("beforeColumnWrap",L,Jt(cn,this,tc).call(this,A),T<0),E&&v.assign(A)}if(v.col>=u){const L=zi(r&&C>0),T=v.row+1,A=Ge(mt,this).createCellCoords(T>=c?T-c:T,v.col-u);this.runLocalHooks("beforeRowWrap",L,Jt(cn,this,tc).call(this,A),T>=c),L.value?this.runLocalHooks("insertColRequire",Ge(mt,this).countRenderableColumns()):y&&v.assign(A)}else if(v.col<0){const L=zi(y),T=v.row-1,A=Ge(mt,this).createCellCoords(T<0?c+T:T,u+v.col);this.runLocalHooks("beforeRowWrap",L,Jt(cn,this,tc).call(this,A),T<0),y&&v.assign(A)}const{rowDir:P,colDir:O}=Jt(cn,this,ax).call(this,v);a=P,l=O,o=Jt(cn,this,tc).call(this,v)}return this.runLocalHooks("afterTransformStart",o,a,l),o}transformEnd(e,n){const r=Ge(mt,this).createCellCoords(e,n),i=Ge(Pg,this).current(),o=Ge(mt,this).visualToRenderableCoords(i.highlight),s=Jt(cn,this,wb).call(this,i.to.row,i.from.row),a=Jt(cn,this,vb).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}=Jt(cn,this,lx).call(this,i.highlight),f=Ge(mt,this).createCellCoords(s+r.row,a+r.col),g=i.getTopStartCorner(),C=i.getTopEndCorner(),y=i.getBottomEndCorner();if(r.col<0&&a>=d&&f.col<d){const O=f.col-d;f.col=Jt(cn,this,vb).call(this,g.col,C.col)+O}else if(r.col>0&&a<=d&&f.col>d){const O=Jt(cn,this,vb).call(this,C.col,g.col),L=Math.max(f.col-O,1);f.col=O+L}if(r.row<0&&s>=h&&f.row<h){const O=f.row-h;f.row=Jt(cn,this,wb).call(this,g.row,y.row)+O}else if(r.row>0&&s<=h&&f.row>h){const O=Jt(cn,this,wb).call(this,y.row,g.row),L=Math.max(f.row-O,1);f.row=O+L}const{rowDir:E,colDir:v}=Jt(cn,this,ax).call(this,f);u=E,c=v;const P=Jt(cn,this,tc).call(this,f);r.row===0&&r.col!==0?l.col=P.col:r.row!==0&&r.col===0?l.row=P.row:(l.row=P.row,l.col=P.col)}return this.runLocalHooks("afterTransformEnd",l,u,c),l}setOffsetSize(e){let{x:n,y:r}=e;Ig(Vo,this,{x:n,y:r})}resetOffsetSize(){Ig(Vo,this,{x:0,y:0})}}function ax(t){const{width:e,height:n}=Jt(cn,this,VD).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 VD(){return{width:Ge(Vo,this).x+Ge(mt,this).countRenderableColumns(),height:Ge(Vo,this).y+Ge(mt,this).countRenderableRows()}}function wb(t,e){const n=Ge(mt,this).findFirstNonHiddenRenderableRow(t,e);return n===null?null:Ge(Vo,this).y+n}function vb(t,e){const n=Ge(mt,this).findFirstNonHiddenRenderableColumn(t,e);return n===null?null:Ge(Vo,this).x+n}function lx(t){const{row:e,col:n}=Ge(mt,this).visualToRenderableCoords(t);if(e===null||n===null)throw new Error("Renderable coords are not visible.");return Ge(mt,this).createCellCoords(Ge(Vo,this).y+e,Ge(Vo,this).x+n)}function tc(t){const e=t.clone();return e.col=t.col-Ge(Vo,this).x,e.row=t.row-Ge(Vo,this).y,Ge(mt,this).renderableToVisualCoords(e)}ut(PR,Rn);const Dw=0,kw=1,WD=2,A0=3,jq=[A0,WD],Uq=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],Cb=Symbol("root"),ux=Symbol("child");function th(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Cb;if(e!==Cb&&e!==ux)throw new Error("The second argument is used internally only and cannot be overwritten.");const n=Array.isArray(t),r=e===Cb;let i=Dw;if(n){const o=t[0];t.length===0?i=kw:r&&o instanceof jf?i=A0:r&&Array.isArray(o)?i=th(o,ux):t.length>=2&&t.length<=4&&!t.some((a,l)=>!Uq[l].includes(typeof a))&&(i=WD)}return i}function pf(t){let{createCellCoords:e,createCellRange:n,keepDirection:r=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!jq.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(o){const s=t===A0;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))),It(u)&&(u=a),It(c)&&(c=l),!r){const f=a,g=l,C=u,y=c;a=Math.min(f,C),l=Math.min(g,y),u=Math.max(f,C),c=Math.max(g,y)}const h=e(a,l),d=e(u,c);return n(h,h,d)}}function zq(t){const e=th(t.getSelected());if(e===Dw||e===kw)return[];const n=pf(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 wr(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function Yq(t){const e=th(t.getSelected());if(e===Dw||e===kw)return[];const n=pf(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 wr(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function nc(t,e,n){Gq(t,e),e.set(t,n)}function Gq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pl(t,e,n){return(e=Kq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kq(t){var e=qq(t,"string");return typeof e=="symbol"?e:e+""}function qq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bt(t,e){return t.get(BD(t,e))}function ns(t,e,n){return t.set(BD(t,e),n),n}function BD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Tn=new WeakMap,Ol=new WeakMap,Og=new WeakMap,Kh=new WeakMap,xg=new WeakMap,qh=new WeakMap;class jD{constructor(e,n){var r=this;Pl(this,"settings",void 0),Pl(this,"tableProps",void 0),Pl(this,"inProgress",!1),Pl(this,"selectedRange",new Wq((i,o,s)=>this.tableProps.createCellRange(i,o,s))),Pl(this,"highlight",void 0),nc(this,Tn,void 0),nc(this,Ol,void 0),Pl(this,"selectedByRowHeader",new Set),Pl(this,"selectedByColumnHeader",new Set),nc(this,Og,!1),nc(this,Kh,!1),nc(this,xg,"unknown"),nc(this,qh,-1),this.settings=e,this.tableProps=n,this.highlight=new $q({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[KE()],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)}),ns(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})),ns(Ol,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})),bt(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)}),bt(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)}),bt(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)}),bt(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)}),bt(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)}),bt(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)}),bt(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)}),bt(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)}),bt(Ol,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformFocus",...o)}),bt(Ol,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformFocus",...o)})}getSelectedRange(){return this.selectedRange}markSource(e){ns(xg,this,e)}markEndSource(){ns(xg,this,"unknown")}getSelectionSource(){return bt(xg,this)}setExpectedLayers(e){ns(qh,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,ns(qh,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=It(n)?this.tableProps.getShortcutManager().isCtrlPressed():n,a=e.clone();ns(Og,this,!1),this.runLocalHooks(`beforeSetRangeStart${r?"Only":""}`,a),(!o||o&&!s&&It(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=bt(qh,this)===-1||this.selectedRange.size()===bt(qh,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(),g=>void g.clear()),M(this.highlight.getLayeredAreas(),g=>void g.clear()),M(this.highlight.getRowHeaders(),g=>void g.clear()),M(this.highlight.getColumnHeaders(),g=>void g.clear()),M(this.highlight.getActiveRowHeaders(),g=>void g.clear()),M(this.highlight.getActiveColumnHeaders(),g=>void g.clear()),M(this.highlight.getActiveCornerHeaders(),g=>void g.clear()),M(this.highlight.getRowHighlights(),g=>void g.clear()),M(this.highlight.getColumnHighlights(),g=>void g.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(d0,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 g=this.selectedRange.previous();this.highlight.useLayerLevel(n-1),this.highlight.createArea().add(g.from).commit().syncWith(g),this.highlight.createLayeredArea().add(g.from).commit().syncWith(g),this.highlight.useLayerLevel(n)}if(this.highlight.isEnabledFor(h0,e.highlight)){if(!e.isSingleHeader()){const y=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),E=this.tableProps.createCellCoords(e.to.row,-1),v=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),P=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(a.add(y).commit(),l.add(v).commit(),d.add(y).commit(),f.add(v).commit()):(a.add(y).add(E).commit(),l.add(v).add(P).commit(),d.add(y).add(E).commit(),f.add(v).add(P).commit())}const g=!bt(Kh,this)&&this.isEntireRowSelected()&&(i>0&&i===e.getWidth()||i===0&&this.isSelectedByRowHeader()),C=!bt(Kh,this)&&this.isEntireColumnSelected()&&(r>0&&r===e.getHeight()||r===0&&this.isSelectedByColumnHeader());g&&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(),g&&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(Wd,n.highlight)&&r.add(n.highlight).commit().syncWith(n),this.inProgress||(ns(Og,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?bt(Tn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):bt(Tn,this).resetOffsetSize(),this.setRangeStart(bt(Tn,this).transformStart(e,n,r))}transformEnd(e,n){this.settings.navigableHeaders?bt(Tn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):bt(Tn,this).resetOffsetSize(),this.setRangeEnd(bt(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()?bt(Ol,this).setOffsetSize({x:o<0?Math.abs(o):-s,y:i<0?Math.abs(i):-a}):bt(Ol,this).setOffsetSize({x:o<0?0:-s,y:i<0?0:-a});const l=bt(Ol,this).transformStart(e,n);this.setRangeFocus(l.normalize())}shiftRows(e,n){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||r.getOuterTopStartCorner().row>=e){const{from:i,to:o,highlight:s}=r,a=this.tableProps.countRows(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=u?-1:0,h=u?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(Ue(i.row+h,c,a-1),i.col),f=this.tableProps.createCellCoords(Ue(o.row+n,c,a-1),o.col);this.markSource("shift"),s.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(Ue(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,Ue(i.col+h,c,a-1)),f=this.tableProps.createCellCoords(o.row,Ue(o.col+n,c,a-1));this.markSource("shift"),s.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(s.row,Ue(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=zi(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&bt(Og,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;ns(Kh,this,f),d&&Number.isInteger(d==null?void 0:d.row)&&Number.isInteger(d==null?void 0:d.col)&&(h=this.tableProps.createCellCoords(Ue(d.row,u,o-1),Ue(d.col,c,s-1)));const g=this.tableProps.createCellCoords(u,c),C=this.tableProps.createCellCoords(o-1,s-1);this.clear(),this.setRangeStartOnly(g,void 0,h),c<0&&this.selectedByRowHeader.add(this.getLayerLevel()),u<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(C),this.finish(),ns(Kh,this,!1)}selectCells(e){var n=this;const r=th(e);if(r===kw)return!1;if(r===Dw)throw new Error(nt`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=pf(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,g=0;Number.isInteger(r==null?void 0:r.row)&&Number.isInteger(r==null?void 0:r.col)?(f=Ue(r.row,u,s-1),g=Ue(r.col,Math.min(i,o),Math.max(i,o))):(f=Ue(r,u,s-1),g=i);const C=this.tableProps.createCellCoords(f,g),y=l===0?0:Ue(C.row,u,-1),E=s-1,v=this.tableProps.createCellCoords(y,i),P=this.tableProps.createCellCoords(E,o);this.runLocalHooks("beforeSelectColumns",v,P,C),v.row=y,P.row=E,this.setRangeStartOnly(v,void 0,C),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(P),this.runLocalHooks("afterSelectColumns",v,P,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=Ue(r.row,Math.min(e,n),Math.max(e,n)),d=Ue(r.col,a,o-1)):(h=e,d=Ue(r,a,o-1));const f=this.tableProps.createCellCoords(h,d),g=s===0?0:Ue(f.col,a,-1),C=o-1,y=this.tableProps.createCellCoords(e,g),E=this.tableProps.createCellCoords(n,C);this.runLocalHooks("beforeSelectRows",y,E,f),y.col=g,E.col=C,this.setRangeStartOnly(y,void 0,f),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(E),this.runLocalHooks("afterSelectRows",y,E,f),this.finish()}return c}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),n=this.tableProps.countCols();if(e===0||n===0){this.deselect();return}const r=this.selectedRange.peekByIndex(this.selectedRange.size()-1),{from:i,to:o,highlight:s}=r;this.clear(),s.assign({row:Ue(s.row,-1/0,e-1),col:Ue(s.col,-1/0,n-1)}),i.assign({row:Ue(i.row,-1/0,e-1),col:Ue(i.col,-1/0,n-1)}),o.assign({row:Ue(o.row,0,e-1),col:Ue(o.col,0,n-1)}),this.selectedRange.ranges.push(r),this.highlight.isEnabledFor(Wd,this.selectedRange.current().highlight)&&this.highlight.getFocus().add(s).commit().syncWith(r),this.applyAndCommit(r)}commit(){if(this.highlight.getCustomSelections().forEach(i=>{i.commit()}),!this.isSelected())return;const n=this.getLayerLevel(),r=this.selectedRange.current();this.highlight.isEnabledFor(Wd,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)}}ut(jD,Rn);const cx=/^(\r\n|\n\r|\r|\n)/,Xq=/^[^\t\r\n]+/,hx=/^\t/;function Zq(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(hx))t=t.replace(hx,""),n+=1,e[r][n]="";else if(t.match(cx))t=t.replace(cx,""),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(Xq);o=s?s[0]:"",t=t.slice(o.length)}e[r][n]=o}return e}function jd(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 xl(t,e,n){return(e=Qq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qq(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)}class Fc{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,n,r){xl(this,"hot",void 0),xl(this,"metaManager",void 0),xl(this,"tableMeta",void 0),xl(this,"dataSource",void 0),xl(this,"duckSchema",void 0),xl(this,"colToPropCache",void 0),xl(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=JE(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 MD(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&&ae(this.colToPropCache[n])?this.colToPropCache[n]:n}propToCol(e){const n=this.propToColCache.get(e);if(ae(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]?ff(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 g=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?g=Gn(this.getSchema()):(g=[],de(h-1,()=>g.push(null))):this.hot.dataType==="function"?g=this.tableMeta.dataSchema(l+a):(g={},Tw(g,this.getSchema())),d.push(g),a+=1}this.hot.rowIndexMapper.insertIndexes(l,a),i==="below"&&(s=Math.min(s+1,o)),this.spliceData(s,0,d);const f=this.hot.toVisualRow(s);return this.hot.countSourceRows()===d.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),a>0&&(e==null?this.metaManager.createRow(null,a):r!=="auto"&&this.metaManager.createRow(s,n)),this.hot.runHooks("afterCreateRow",f,a,r),{delta:a,startPhysicalIndex:s}}createCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:r,mode:i="start"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!this.hot.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");const o=this.dataSource,s=this.tableMeta.maxCols,a=this.hot.countSourceCols();let l=e;if((typeof l!="number"||l>=a)&&(l=a),this.hot.runHooks("beforeCreateCol",l,n,r)===!1)return{delta:0};let c=a;l<this.hot.countCols()&&(c=this.hot.toPhysicalColumn(l));const h=this.hot.countSourceRows();let d=this.hot.countCols(),f=0,g=c;i==="end"&&(g=Math.min(g+1,a));const C=g;for(;f<n&&d<s;){if(typeof l!="number"||l>=d)if(h>0)for(let E=0;E<h;E+=1)typeof o[E]>"u"&&(o[E]=[]),o[E].push(null);else o.push([null]);else for(let E=0;E<h;E++)o[E].splice(g,0,null);f+=1,g+=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 y=this.hot.toVisualColumn(C);return this.hot.runHooks("afterCreateCol",y,f,r),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=ae(this.tableMeta.columns)||ae(this.tableMeta.dataSchema)||this.tableMeta.colHeaders;this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&!c&&this.hot.columnIndexMapper.setIndexesSequence([])}return o.slice(0).sort((c,h)=>h-c).forEach(c=>{this.metaManager.removeRow(c,1)}),this.hot.runHooks("afterRemoveRow",i,l,o,r),!0}removeCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;if(this.hot.dataType==="object"||this.tableMeta.columns)throw new Error("cannot remove column with object data source or columns option specified");let i=typeof e!="number"?-n:e;i=(this.hot.countCols()+i)%this.hot.countCols();const o=this.visualColumnsToPhysical(i,n),s=o.slice(0).sort((h,d)=>d-h);if(this.hot.runHooks("beforeRemoveCol",i,n,o,r)===!1)return!1;let l=!0;const u=s.length,c=this.dataSource;for(let h=0;h<u;h++)l&&o[0]!==o[h]-h&&(l=!1);if(l)for(let h=0,d=this.hot.countSourceRows();h<d;h++)c[h].splice(o[0],n),h===0&&this.metaManager.removeColumn(o[0],n);else for(let h=0,d=this.hot.countSourceRows();h<d;h++)for(let f=0;f<u;f++)c[h].splice(s[f],1),h===0&&this.metaManager.removeColumn(s[f],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(o),!this.tableMeta.rowHeaders&&this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,n,o,r),this.refreshDuckSchema(),!0}spliceCol(e,n,r){const i=this.hot.getDataAtCol(e),o=i.slice(n,n+r),s=i.slice(n+r);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];wP(l,s);let c=0;for(;c<r;)l.push(null),c+=1;return bU(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];wP(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=zi(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=zi(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,Fc.DESTINATION_RENDERER)}countCachedColumns(){return this.colToPropCache.length}getRange(e,n,r){const i=[];let o,s,a;const l=this.tableMeta.maxRows,u=this.tableMeta.maxCols;if(l===0||u===0)return[];const c=r===Fc.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,h=Math.min(Math.max(l-1,0),Math.max(e.row,n.row)),d=Math.min(Math.max(u-1,0),Math.max(e.col,n.col));for(o=Math.min(e.row,n.row);o<=h;o++){a=[];const f=o>=0?this.hot.toPhysicalRow(o):o;for(s=Math.min(e.col,n.col);s<=d&&f!==null;s++)a.push(c.call(this,o,this.colToProp(s)));f!==null&&i.push(a)}return i}getText(e,n){return jd(this.getRange(e,n,Fc.DESTINATION_RENDERER))}getCopyableText(e,n){return jd(this.getRange(e,n,Fc.DESTINATION_CLIPBOARD_GENERATOR))}destroy(){this.hot=null,this.metaManager=null,this.dataSource=null,this.duckSchema=null,this.colToPropCache.length=0,this.propToColCache.clear(),this.propToColCache=void 0}}const{register:e3,getItem:t3,hasItem:UD,getNames:Ble,getValues:jle}=qo("cellTypes");function n3(t){if(!UD(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 t3(t)}function Po(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:n,renderer:r,validator:i}=e;n&&$i(t,n),r&&to(t,r),i&&xc(t,i),e3(t,e)}function r3(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 Lw(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const r=typeof e.type=="string"?n3(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(r3(s,n)){var a;i[s]=o,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(s)}}),rn(t,i)}function i3(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function n(){}dz(n,t);for(let r=0;r<e.length;r++)n.prototype[e[r]]=void 0;return n}function qm(t){return Number.isInteger(t)&&t>=0}function Xm(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function Ag(t){return t==null}const zD=()=>({_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),Ut(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),Ut(r)===!1)return typeof r=="object"?(i=this.getCellMeta(t,e),QE(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 dx(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)}function a3(){return class{}}class l3{constructor(e){dx(this,"metaCtor",a3()),dx(this,"meta",void 0),this.meta=this.metaCtor.prototype,rn(this.meta,zD()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var n;rn(this.meta,e),Lw(this.meta,{...e,type:(n=e.type)!==null&&n!==void 0?n:this.meta.type},e)}}function u3(t,e,n){return(e=c3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c3(t){var e=h3(t,"string");return typeof e=="symbol"?e:e+""}function h3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class d3{constructor(e){u3(this,"meta",void 0);const n=e.getMetaConstructor();this.meta=new n}getMeta(){return this.meta}updateMeta(e){rn(this.meta,e),Lw(this.meta,e,e)}}function Hg(t,e,n){return(e=f3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f3(t){var e=g3(t,"string");return typeof e=="symbol"?e:e+""}function g3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Sp{constructor(e){Hg(this,"valueFactory",void 0),Hg(this,"data",[]),Hg(this,"index",[]),Hg(this,"holes",new Set),this.valueFactory=e}obtain(e){Xm(()=>qm(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;Xm(()=>qm(e)||Ag(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=Ag(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;Xm(()=>qm(e)||Ag(e),"Expecting an unsigned number or null/undefined argument.");const r=this.index.splice(Ag(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 fx(t,e,n){return(e=m3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m3(t){var e=p3(t,"string");return typeof e=="symbol"?e:e+""}function p3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 w3=["data","width"];class v3{constructor(e){fx(this,"globalMeta",void 0),fx(this,"metas",new Sp(()=>this._createMeta())),this.globalMeta=e,this.metas=new Sp(()=>this._createMeta())}updateMeta(e,n){const r=this.getMeta(e);rn(r,n),Lw(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 i3(this.globalMeta.getMetaConstructor(),w3).prototype}}function gx(t,e,n){return(e=C3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C3(t){var e=y3(t,"string");return typeof e=="symbol"?e:e+""}function y3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class b3{constructor(e){gx(this,"columnMeta",void 0),gx(this,"metas",new Sp(()=>this._createRow())),this.columnMeta=e}updateMeta(e,n,r){const i=this.getMeta(e,n);rn(i,r),Lw(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++)ae(n[r])&&e.push(...n[r].values());return e}getMetasAtRow(e){Xm(()=>qm(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 Sp(e=>this._createMeta(e))}_createMeta(e){const n=this.columnMeta.getMetaConstructor(e);return new n}}class YD{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 l3(e),this.tableMeta=new d3(this.globalMeta),this.columnMeta=new v3(this.globalMeta),this.cellMeta=new b3(this.columnMeta),r.forEach(i=>new i(this)),this.globalMeta.updateMeta(n)}getGlobalMeta(){return this.globalMeta.getMeta()}updateGlobalMeta(e){this.globalMeta.updateMeta(e)}getTableMeta(){return this.tableMeta.getMeta()}updateTableMeta(e){this.tableMeta.updateMeta(e)}getColumnMeta(e){return this.columnMeta.getMeta(e)}updateColumnMeta(e,n){this.columnMeta.updateMeta(e,n)}getCellMeta(e,n,r){const i=this.cellMeta.getMeta(e,n);return i.visualRow=r.visualRow,i.visualCol=r.visualColumn,i.row=e,i.col=n,r.skipMetaExtension||this.runLocalHooks("afterGetCellMeta",i),i}getCellMetaKeyValue(e,n,r){if(typeof r!="string")throw new Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,n,r)}setCellMeta(e,n,r,i){this.cellMeta.setMeta(e,n,r,i)}updateCellMeta(e,n,r){this.cellMeta.updateMeta(e,n,r)}removeCellMeta(e,n,r){this.cellMeta.removeMeta(e,n,r)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createRow(e,n)}removeRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeRow(e,n)}createColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createColumn(e,n),this.columnMeta.createColumn(e,n)}removeColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeColumn(e,n),this.columnMeta.removeColumn(e,n)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}ut(YD,Rn);function mx(t,e,n,r){const{hotInstance:i,dataMap:o,dataSource:s,internalSource:a,source:l,metaManager:u,firstRun:c}=r,h=Uo(a),d=i.getSettings();Array.isArray(d.dataSchema)?i.dataType="array":ot(d.dataSchema)?i.dataType="function":i.dataType="object",o&&o.destroy(),t=i.runHooks(`before${h}`,t,c,l);const f=new Fc(i,t,u);if(e(f),typeof t=="object"&&t!==null)t.push&&t.splice||(t=[t]);else if(t===null){const g=f.getSchema();t=[];let C,y=0,E=0;for(y=0,E=d.startRows;y<E;y++)if((i.dataType==="object"||i.dataType==="function")&&d.dataSchema)C=Gn(g),t.push(C);else if(i.dataType==="array")C=Gn(g[0]),t.push(C);else{C=[];for(let v=0,P=d.startCols;v<P;v++)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&&ye(i.rootElement,[_N(-1),bw(i.countCols()+(i.view?i.countRowHeaders():0))])}function px(t,e,n){return(e=S3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S3(t){var e=R3(t,"string");return typeof e=="symbol"?e:e+""}function R3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class E3{constructor(e){var n=this;px(this,"metaManager",void 0),px(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",function(){return n.extendCellMeta(...arguments)}),re.getSingleton().add("beforeRender",r=>{r&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var n;const{row:r,col:i}=e;if((n=this.metaSyncMemo.get(r))!==null&&n!==void 0&&n.has(i))return;const{visualRow:o,visualCol:s}=e,a=this.metaManager.hot,l=a.colToProp(s);e.prop=l,a.runHooks("beforeGetCellMeta",o,s,e);const u=tn(e,"type")?e.type:null;let c=ot(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 T3(t,e,n){_3(t,e),e.set(t,n)}function _3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yb(t,e,n){return(e=M3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M3(t){var e=I3(t,"string");return typeof e=="symbol"?e:e+""}function I3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function P3(t,e){return t.get(O3(t,e))}function O3(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 wx=new WeakMap;class x3{constructor(e){yb(this,"metaManager",void 0),yb(this,"usageTracker",new Set),yb(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}]])),T3(this,wx,(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,P3(wx,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 GD="gridDefault",Cl="editorManager.handlingEditor",A3={name:"editorCloseAndSave",callback(t){t._getEditorManager().closeEditorAndSaveChanges()}},H3="hooksRefRegisterer",KD={_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={}}};Ea(KD,"MIXIN_NAME",H3,{writable:!1,enumerable:!1});function Eo(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=D3(t,"string");return typeof e=="symbol"?e:e+""}function D3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const k3="base",Bt=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class vh{static get EDITOR_TYPE(){return k3}constructor(e){Eo(this,"hot",void 0),Eo(this,"state",Bt.VIRGIN),Eo(this,"_opened",!1),Eo(this,"_fullEditMode",!1),Eo(this,"_closeCallback",null),Eo(this,"TD",null),Eo(this,"row",null),Eo(this,"col",null),Eo(this,"prop",null),Eo(this,"originalValue",null),Eo(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:Bt.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!==Bt.VIRGIN)return;const r=this.hot,i=r.rowIndexMapper.getRenderableFromVisualIndex(this.row),o=r.columnIndexMapper.getRenderableFromVisualIndex(this.col),s=()=>{if(this.state=Bt.EDITING,this.isInFullEditMode()){const l=typeof e=="string"?e:Pt(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===Bt.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===Bt.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=Bt.WAITING,this.saveValue(i,n),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",s=>{this.state=Bt.FINISHED,this.discardEditor(s)}):(this.state=Bt.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=Bt.FINISHED,this.discardEditor()}discardEditor(e){this.state===Bt.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=Bt.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Bt.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===Bt.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=Kt(n),l=An(this.hot.rootElement),u=Kt(this.hot.rootElement),c=r.topOverlay.holder,h=r.inlineStartOverlay.holder,d=c!==o?c.scrollTop:0,f=h!==o?h.scrollLeft:0,g=o.innerWidth-l.left-u,{wtTable:C}=(e=r.getParentOverlay(n))!==null&&e!==void 0?e:this.hot.view._wt,y=C.name,E=["master","inline_start"].includes(y)?d:0,v=["master","top","bottom"].includes(y)?f:0,P=s.top===l.top?0:1;let O=s.top-l.top-P-E,L=0;this.hot.isRtl()?L=o.innerWidth-s.left-a-g-1+v:L=s.left-l.left-1-v,["top","top_inline_start_corner"].includes(y)&&(O+=r.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(y)&&(L+=Math.abs(r.inlineStartOverlay.getOverlayOffset()));const T=this.hot.hasColHeaders(),A=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),K=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),j=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(T&&A<=0||A===j)&&(O+=1),K<=0&&(L+=1);const Z=i.rowsRenderCalculator.startPosition,J=i.columnsRenderCalculator.startPosition,se=Math.abs(r.inlineStartOverlay.getScrollPosition()),te=r.topOverlay.getScrollPosition(),ue=vn(this.hot.rootDocument);let pt=n.offsetTop;if(["inline_start","master"].includes(y)&&(pt+=Z-te),["bottom","bottom_inline_start_corner"].includes(y)){const{wtViewport:Y,wtTable:q}=r.bottomOverlay.clone;pt+=Y.getWorkspaceHeight()-q.getHeight()-ue}let be=n.offsetLeft;this.hot.isRtl()?(be>=0?be=C.getWidth()-n.offsetLeft:be=Math.abs(be),be+=J-se-a):["top","master","bottom"].includes(y)&&(be+=J-se);const ke=o.getComputedStyle(this.TD),wt=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",fn=parseInt(ke[wt],10)>0?0:1,et=parseInt(ke.borderTopWidth,10)>0?0:1,m=Kt(n)+fn,w=nn(n)+et,p=kN(c)?ue:0,I=LN(h)?ue:0,$=this.hot.view.maximumVisibleElementWidth(be)-p+fn,B=Math.max(this.hot.view.maximumVisibleElementHeight(pt)-I+et,this.hot.view.getDefaultRowHeight());return{top:O,start:L,height:w,maxHeight:B,width:m,maxWidth:$}}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}}ut(vh,KD);const L3={name:"editorCloseAndSaveByArrowKeys",callback(t,e,n){const r=t._getEditorManager(),i=r.getActiveEditor();i.isInFullEditMode()&&i.state===Bt.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())}},$3={name:"editorCloseAndSaveByEnter",callback(t,e){const n=t._getEditorManager();n.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),n.moveSelectionAfterEnter(e)}},F3={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},V3={name:"editorFastOpen",callback(t,e){const{highlight:n}=t.getSelectedRangeLast();n.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},W3={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),Ko(e))}};function B3(){return[A3,L3,$3,F3,V3,W3]}const j3={name:"extendCellsSelectionDown",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(1,0),e.markEndSource())}},U3={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{selection:e,rowIndexMapper:n}=t,{to:r}=t.getSelectedRangeLast(),i=Math.min(r.row+t.countVisibleRows(),t.countRows()-1),o=n.getNearestNotHiddenIndex(i,-1);if(o!==null){const s=t._createCellCoords(o,r.col),a=r.row-t.getFirstFullyVisibleRow(),l=Math.min(s.row-a,t.countRows()-1);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}},z3={name:"extendCellsSelectionLeft",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,-1*t.getDirectionFactor()),e.markEndSource())}},Y3={name:"extendCellsSelectionRight",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,t.getDirectionFactor()),e.markEndSource())}},G3={name:"extendCellsSelectionToColumns",callback(t){const{selection:e}=t,{highlight:n,from:r,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByRowHeader()?e.selectAll(!0,!0):t.selectColumns(r.col,i.col,n),e.markEndSource()}},K3={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(t.countRows()-1,-1),l=i.clone();l.row=r.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},q3={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&r.isCell()){const s=n.getNearestNotHiddenIndex(t.countCols()-1,-1),a=i.clone();a.col=r.col,e.markSource("keyboard"),e.setRangeStart(a,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(o.row,s)),e.markEndSource()}}},X3={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&r.isCell()){const s=parseInt(t.getSettings().fixedColumnsStart,10),a=n.getNearestNotHiddenIndex(s,1),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},Z3={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},Q3={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},J3={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(0,1),l=i.clone();l.row=r.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},eX={name:"extendCellsSelectionToRows",callback(t){const{selection:e}=t,{highlight:n,from:r,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByColumnHeader()?e.selectAll(!0,!0):t.selectRows(r.row,i.row,n),e.markEndSource()}},tX={name:"extendCellsSelectionUp",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(-1,0),e.markEndSource())}},nX={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{selection:e,rowIndexMapper:n}=t,{to:r}=t.getSelectedRangeLast(),i=Math.max(r.row-t.countVisibleRows(),0),o=n.getNearestNotHiddenIndex(i,1);if(o!==null){const s=t._createCellCoords(o,r.col),a=r.row-t.getFirstFullyVisibleRow(),l=Math.max(s.row-a,0);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}};function rX(){return[j3,U3,z3,Y3,G3,K3,q3,X3,Z3,Q3,J3,eX,tX,nX]}const iX={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(1,0),e.markEndSource()}},oX={name:"moveCellSelectionDownByViewportHeight",callback(t){const{selection:e}=t,{navigableHeaders:n}=t.getSettings(),r=n?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+r;o=o===0?1:o,i===t.countRows()-1?o=1:i+o>t.countRows()&&(o=t.countRows()-i-1),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}},sX={name:"moveCellSelectionInlineEnd",callback(t,e){const{selection:n}=t,r=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;n.markSource("keyboard"),n.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?n.transformFocus(-o.row,-o.col):n.transformStart(-o.row,-o.col),n.markEndSource()}},aX={name:"moveCellSelectionInlineStart",callback(t,e){const{selection:n}=t,r=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;n.markSource("keyboard"),n.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?n.transformFocus(o.row,o.col):n.transformStart(o.row,o.col),n.markEndSource()}},lX={name:"moveCellSelectionLeft",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,-1*t.getDirectionFactor()),e.markEndSource()}},uX={name:"moveCellSelectionRight",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,t.getDirectionFactor()),e.markEndSource()}},cX={name:"moveCellSelectionToMostBottom",callback(t){const{selection:e}=t,{col:n}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);r===null&&(r=-1),e.setRangeStart(t._createCellCoords(r,n))}},hX={name:"moveCellSelectionToMostBottomInlineEnd",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:r}=t,i=parseInt(t.getSettings().fixedRowsBottom,10),o=n.getNearestNotHiddenIndex(t.countRows()-i-1,-1),s=r.getNearestNotHiddenIndex(t.countCols()-1,-1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(o,s)),e.markEndSource()}},dX={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t;e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(t.getSelectedRangeLast().highlight.row,n.getNearestNotHiddenIndex(t.countCols()-1,-1))),e.markEndSource()}},fX={name:"moveCellSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,r=parseInt(t.getSettings().fixedColumnsStart,10),i=t.getSelectedRangeLast().highlight.row,o=n.getNearestNotHiddenIndex(r,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(i,o)),e.markEndSource()}},gX={name:"moveCellSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,r=t.getSelectedRangeLast().highlight.row;let i=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);i===null&&(i=t.isRtl()?-1:-t.countRowHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,i)),e.markEndSource()}},mX={name:"moveCellSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{row:r}=t.getSelectedRangeLast().highlight;let i=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);i===null&&(i=t.isRtl()?-t.countRowHeaders():-1),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,i)),e.markEndSource()}},pX={name:"moveCellSelectionToMostTop",callback(t){const{selection:e}=t,{col:n}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);r===null&&(r=-t.countColHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,n)),e.markEndSource()}},wX={name:"moveCellSelectionToMostTopInlineStart",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:r}=t,i=parseInt(t.getSettings().fixedRowsTop,10),o=parseInt(t.getSettings().fixedColumnsStart,10),s=n.getNearestNotHiddenIndex(i,1),a=r.getNearestNotHiddenIndex(o,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(s,a)),e.markEndSource()}},vX={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(-1,0),e.markEndSource()}},CX={name:"moveCellSelectionUpByViewportHight",callback(t){const{selection:e}=t,{navigableHeaders:n}=t.getSettings(),r=n?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+r;o=o===0?-1:-o,i===-r?o=-1:i+o<r&&(o=-(i+r)),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}};function yX(){return[iX,oX,sX,aX,lX,uX,cX,hX,dX,fX,gX,mX,pX,wX,vX,CX]}const bX={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},SX={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"})}}},RX={name:"selectAllCells",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!0}),e.markEndSource()}},EX={name:"selectAllCellsAndHeaders",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!1}),e.markEndSource()}},TX={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()))}},_X=[...B3(),...rX(),...yX(),bX,SX,RX,EX,TX];function qD(t){const e={};return _X.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 MX(t){const e=t.getShortcutManager().addContext("editor"),n=qD(t),r={group:Cl};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 IX(t){const e=t.getShortcutManager().addContext("grid"),n=qD(t),r={runOnlyIf:()=>{const{navigableHeaders:i}=t.getSettings();return ae(t.getSelected())&&(i||!i&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:GD};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:Cl,runOnlyIf:()=>ae(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 PX(t){[IX,MX].forEach(e=>e(t))}function OX(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.rootElement,r=vx(t),i=vx(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 vx(t){const n=t.rootDocument.createElement("input");return n.type="text",n.name="__htFocusCatcher",n.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&ye(n,[hf("Focus catcher")]),n}function xX(t){const e=AX(t);let n;const{activate:r,deactivate:i}=OX(t,{onFocusFromTop(){var h;const d=(h=e(n))!==null&&h!==void 0?h:OR(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:xR(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,g,C)=>{if(a&&(o.wrapped&&o.flipped||l)&&(l=!1,C.value=!0),s){var y;n=(y=t.getSelectedRangeLast())===null||y===void 0?void 0:y.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:GD,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?OR(t):xR(t)),u(),!1;h.preventDefault()},position:"after"}])}function OR(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 xR(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 AX(t){return e=>{if(!e)return null;const n=OR(t),r=xR(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 Ch(t){pa(t)&&t.scrollIntoView({block:"nearest",inline:"nearest"})}function $w(t){const{selection:e,view:n}=t,r=t.getSelectedRangeLast(),i=e.getSelectionSource(),o=n.getFirstFullyVisibleColumn(),s=n.getLastFullyVisibleColumn(),a=r.getTopStartCorner().col,l=r.getBottomEndCorner().col,u=a<=o,c=l>=s,h=n.getFirstFullyVisibleRow(),d=n.getLastFullyVisibleRow(),f=r.getTopStartCorner().row,g=r.getBottomEndCorner().row,C=f<=h,y=g>=d;return{getComputedColumnTarget(E){return i==="mouse"||i==="keyboard"?E.col:u&&c?r.highlight.col:u?a:c?l:E.col},getComputedRowTarget(E){return i==="mouse"||i==="keyboard"?E.row:C&&y?r.highlight.row:C?f:y?g:E.row}}}function HX(t){return e=>{const n=$w(t).getComputedColumnTarget(e);t.scrollViewportTo({col:n},()=>{const r=!!t.getSettings().colHeaders;Ch(t.getCell(r?-1:0,n,!0))})}}function NX(){return()=>{}}function DX(t){return e=>{t.scrollViewportTo(e.toObject(),()=>{const{row:n,col:r}=t.getSelectedRangeLast().highlight;Ch(t.getCell(n,r,!0))})}}function kX(t){return e=>{const n=$w(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:o}=r;Ch(t.getCell(i,o,!0))})}}function LX(t){return e=>{const n=$w(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:o}=r;Ch(t.getCell(i,o,!0))})}}function $X(t){return e=>{const n=$w(t).getComputedRowTarget(e);t.scrollViewportTo({row:n},()=>{const r=!!t.getSettings().rowHeaders;Ch(t.getCell(n,r?-1:0,!0))})}}function FX(t){return e=>{const n=t.selection.getSelectionSource(),{row:r,col:i}=e,o=()=>{Ch(t.getCell(r,i,!0))};if(r<0&&i>=0)t.scrollViewportTo({col:i},o);else if(i<0&&r>=0)t.scrollViewportTo({row:r},o);else{if(n==="mouse"&&(i===t.view.getLastPartiallyVisibleColumn()||r===t.view.getLastPartiallyVisibleRow()))return;t.scrollViewportTo({row:r,col:i},o)}}}function VX(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=DX(t):e.isSelectedByCorner()?s=NX():e.isSelectedByRowHeader()?s=$X(t):e.isSelectedByColumnHeader()?s=HX(t):e.getSelectedRange().size()===1&&e.isMultiple()?s=kX(t):e.getSelectedRange().size()===1&&!e.isMultiple()?s=FX(t):e.getSelectedRange().size()>1&&(s=LX(t)),(o=s)===null||o===void 0||o(i)}}}const Cx=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"]]),Ng=t=>t.map(e=>{const n=e.toLowerCase();return Cx.has(n)?Cx.get(n):n}).sort().join("+"),WX=t=>t.split("+"),yx=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"]]),bb=t=>{let{which:e,key:n}=t;if(yx.has(e))return yx.get(e);const r=String.fromCharCode(e).toLowerCase();return/^[a-z0-9]$/.test(r)?r:n.toLowerCase()},XD=Symbol("shortcut-context");function ZD(t){return Ae(t)&&t.__kindOf===XD}const BX=t=>{const e=Mw({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:g=!1,relativeToGroup:C,position:y,forwardToContext:E}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(It(c))throw new Error("You need to define the shortcut's group.");if(ot(u)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(nt`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 v={callback:u,group:c,runOnlyIf:h,captureCtrl:d,preventDefault:f,stopPropagation:g};ae(C)&&(v.relativeToGroup=C,v.position=y),ZD(E)&&(v.forwardToContext=E),l.forEach(P=>{const O=Ng(P);if(e.hasItem(O)){const T=e.getItem(O);let A=T.findIndex(K=>K.group===C);A!==-1?y==="before"?A-=1:A+=1:A=T.length,T.splice(A,0,v)}else e.addItem(O,[v])})},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=Ng(l);e.removeItem(u)};return{__kindOf:XD,addShortcut:n,addShortcuts:r,getShortcuts:l=>{const u=Ng(l),c=e.getItem(u);return ae(c)?c.slice():[]},hasShortcut:l=>{const u=Ng(l);return e.hasItem(u)},removeShortcutsByKeys:i,removeShortcutsByGroup:l=>{e.getItems().forEach(c=>{let[h,d]=c;const f=d.filter(g=>g.group!==l);f.length===0?i(WX(h)):(d.length=0,d.push(...f))})}}};function jX(){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 UX=["meta","alt","shift","control"],Xh=jX(),Zh=[];let Dg=0;function zX(t,e,n,r,i){const o=f=>UX.includes(f),s=function(f){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const C=[];return f.altKey&&C.push("alt"),g&&(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"||du(f))return;const C=bb(f);let y=[];o(C)||(y=s(f));const E=[C].concat(y);!i(f,E)&&(AP()&&y.includes("meta")||!AP()&&y.includes("control"))&&i(f,[C].concat(s(f,!0))),r(f)},l=f=>{if(typeof f.key=="string"){const g=bb(f);o(g)&&Xh.press(g)}},u=f=>{if(typeof f.key=="string"){const g=bb(f);o(g)&&Xh.release(g)}},c=()=>{Xh.releaseAll()};return{mount:()=>{let f=t;for(Dg+=1;f;)Dg===1&&(f.document.documentElement.addEventListener("keydown",l),Zh.push({event:"keydown",listener:l}),f.document.documentElement.addEventListener("keyup",u),Zh.push({event:"keyup",listener:u})),f.document.documentElement.addEventListener("keydown",a),f.document.documentElement.addEventListener("blur",c),f=Qc(f)},unmount:()=>{let f=t;for(Dg-=1;f;){if(Dg===0){for(let g=0;g<Zh.length;g++){const{event:C,listener:y}=Zh[g];f.document.documentElement.removeEventListener(C,y)}Zh.length=0}f.document.documentElement.removeEventListener("keydown",a),f.document.documentElement.removeEventListener("blur",c),f=Qc(f)}},isPressed:f=>Xh.isPressed(f),releasePressedKeys:()=>Xh.releaseAll()}}const YX=t=>{let{ownerWindow:e,handleEvent:n,beforeKeyDown:r,afterKeyDown:i}=t;const o=Mw({errorIdExists:g=>`The "${g}" context name is already registered.`});let s="grid";const a=g=>{const C=BX(g);return o.addItem(g,C),C},l=()=>s,u=g=>o.getItem(g),c=g=>{if(!o.hasItem(g))throw new Error(nt`You've tried to activate the "${g}" shortcut context\x20
60
+ that does not exist. Before activation, register the context using the "addContext" method.`);s=g};let h=!1;const d=function(g,C){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const E=ZD(y)?y:u(y);let v=!1;if(!E.hasShortcut(C))return v;const P=E.getShortcuts(C);for(let O=0;O<P.length;O++){const{callback:L,runOnlyIf:T,preventDefault:A,stopPropagation:K,captureCtrl:U,forwardToContext:j}=P[O];if(T(g)===!0){if(h=U,v=L(g,C)===!1,h=!1,A&&g.preventDefault(),K&&(Ko(g),g.stopPropagation()),v)break;j&&d(g,C,j)}}return v},f=zX(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 bx(t){const{classNames:e}=JU(t,/ht-theme-[a-zA-Z0-9_-]+/);return e.pop()}let Sb=null;const Rb=new Map;function QD(t,e){var n,r=this;let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this;const s=new zo(o);let a,l,u,c,h,d,f=!0;TK(i)&&EK(this),this.rootElement=t,this.rootDocument=t.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const g=(n=e==null?void 0:e.layoutDirection)!==null&&n!==void 0?n:"inherit",C=["rtl","ltr"].includes(g)?g: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=Rq(e.language);const y=Object.fromEntries(Object.entries(e).filter(m=>{let[w]=m;return!(re.getSingleton().isRegistered(w)||re.getSingleton().isDeprecated(w))})),E=new YD(o,y,[E3,x3]),v=E.getTableMeta(),P=E.getGlobalMeta(),O=Mw();this.container=this.rootDocument.createElement("div"),t.insertBefore(this.container,t.firstChild),Km(this)&&(_U(e.licenseKey,t),G(t,"ht-wrapper")),this.guid=`ht_${yN()}`,Rb.set(this.guid,this),this.columnIndexMapper=new MR,this.rowIndexMapper=new MR,this.columnIndexMapper.addLocalHook("indexesSequenceChange",m=>{o.runHooks("afterColumnSequenceChange",m)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",m=>{o.runHooks("afterRowSequenceChange",m)}),s.addEventListener(this.rootDocument.documentElement,"compositionstart",m=>{o.runHooks("beforeCompositionStart",m)}),l=new VK(o),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const L=m=>{const{row:w,col:p}=m;return o._createCellCoords(w>=0?o.rowIndexMapper.getRenderableFromVisualIndex(w):w,p>=0?o.columnIndexMapper.getRenderableFromVisualIndex(p):p)},T=m=>{const{row:w,col:p}=m;return o._createCellCoords(w>=0?o.rowIndexMapper.getVisualFromRenderableIndex(w):w,p>=0?o.columnIndexMapper.getVisualFromRenderableIndex(p):p)},A=(m,w)=>{const p=w>m?1:-1,I=Math.min(m,w),$=Math.max(m,w),B=o.rowIndexMapper.getNearestNotHiddenIndex(m,p);return B===null||p===1&&B>$||p===-1&&B<I?null:B>=0?o.rowIndexMapper.getRenderableFromVisualIndex(B):B},K=(m,w)=>{const p=w>m?1:-1,I=Math.min(m,w),$=Math.max(m,w),B=o.columnIndexMapper.getNearestNotHiddenIndex(m,p);return B===null||p===1&&B>$||p===-1&&B<I?null:B>=0?o.columnIndexMapper.getRenderableFromVisualIndex(B):B};let U=new jD(v,{rowIndexMapper:o.rowIndexMapper,columnIndexMapper:o.columnIndexMapper,countCols:()=>o.countCols(),countRows:()=>o.countRows(),propToCol:m=>a.propToCol(m),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:(m,w)=>o._createCellCoords(m,w),createCellRange:(m,w,p)=>o._createCellRange(m,w,p),visualToRenderableCoords:L,renderableToVisualCoords:T,findFirstNonHiddenRenderableRow:A,findFirstNonHiddenRenderableColumn:K,isDisabledCellSelection:(m,w)=>m<0||w<0?o.getSettings().disableVisualSelection:o.getCellMeta(m,w).disableVisualSelection});this.selection=U;const j=m=>{let{hiddenIndexesChanged:w}=m;this.forceFullRender=!0,w&&this.selection.commit()};this.columnIndexMapper.addLocalHook("cacheUpdated",j),this.rowIndexMapper.addLocalHook("cacheUpdated",j),this.selection.addLocalHook("afterSetRangeEnd",(m,w)=>{const p=zi(!1),I=this.selection.getSelectedRange(),{from:$,to:B}=I.current(),Y=I.size()-1;this.runHooks("afterSelection",$.row,$.col,B.row,B.col,p,Y),this.runHooks("afterSelectionByProp",$.row,o.colToProp($.col),B.row,o.colToProp(B.col),p,Y),w&&(!p.isTouched()||p.isTouched()&&!p.value)&&d.scrollTo(m);const q=U.isSelectedByRowHeader(),b=U.isSelectedByColumnHeader();q&&b?G(this.rootElement,["ht__selection--rows","ht__selection--columns"]):q?(pe(this.rootElement,"ht__selection--columns"),G(this.rootElement,"ht__selection--rows")):b?(pe(this.rootElement,"ht__selection--rows"),G(this.rootElement,"ht__selection--columns")):pe(this.rootElement,["ht__selection--rows","ht__selection--columns"]),U.getSelectionSource()!=="shift"&&c.closeEditor(null),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("beforeSetFocus",m=>{this.runHooks("beforeSelectionFocusSet",m.row,m.col)}),this.selection.addLocalHook("afterSetFocus",m=>{const w=zi(!1);this.runHooks("afterSelectionFocusSet",m.row,m.col,w),(!w.isTouched()||w.isTouched()&&!w.value)&&d.scrollTo(m),c.closeEditor(),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("afterSelectionFinished",m=>{const w=m.length-1,{from:p,to:I}=m[w];this.runHooks("afterSelectionEnd",p.row,p.col,I.row,I.col,w),this.runHooks("afterSelectionEndByProp",p.row,o.colToProp(p.col),I.row,o.colToProp(I.col),w)}),this.selection.addLocalHook("afterIsMultipleSelection",m=>{const w=this.runHooks("afterIsMultipleSelection",m.value);m.value&&(m.value=w)}),this.selection.addLocalHook("afterDeselect",()=>{c.closeEditor(),o.view.render(),pe(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeStart",...w)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeStartOnly",...w)}).addLocalHook("beforeSetRangeEnd",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeEnd",...w)}).addLocalHook("beforeSelectColumns",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeSelectColumns",...w)}).addLocalHook("afterSelectColumns",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("afterSelectColumns",...w)}).addLocalHook("beforeSelectRows",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeSelectRows",...w)}).addLocalHook("afterSelectRows",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("afterSelectRows",...w)}).addLocalHook("beforeModifyTransformStart",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("modifyTransformStart",...w)}).addLocalHook("afterModifyTransformStart",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformStart",...w)}).addLocalHook("beforeModifyTransformFocus",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("modifyTransformFocus",...w)}).addLocalHook("afterModifyTransformFocus",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformFocus",...w)}).addLocalHook("beforeModifyTransformEnd",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("modifyTransformEnd",...w)}).addLocalHook("afterModifyTransformEnd",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformEnd",...w)}).addLocalHook("beforeRowWrap",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeRowWrap",...w)}).addLocalHook("beforeColumnWrap",function(){for(var m=arguments.length,w=new Array(m),p=0;p<m;p++)w[p]=arguments[p];return r.runHooks("beforeColumnWrap",...w)}).addLocalHook("insertRowRequire",m=>this.alter("insert_row_above",m,1,"auto")).addLocalHook("insertColRequire",m=>this.alter("insert_col_start",m,1,"auto")),u={alter(m,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,I=arguments.length>3?arguments[3]:void 0,$=arguments.length>4?arguments[4]:void 0;const B=Y=>{if(Y.length===0)return[];const q=[...Y];return q.sort((R,S)=>{let[k]=R,[_]=S;return k===_?0:k>_?1:-1}),wr(q,(R,S)=>{let[k,_]=S;const H=R[R.length-1],[W,x]=H,N=W+x;if(k<=N){const V=Math.max(_-(N-k),0);H[1]+=V}else R.push([k,_]);return R},[q[0]])};switch(m){case"insert_row_below":case"insert_row_above":const Y=o.countSourceRows();if(v.maxRows===Y)return;const q=m==="insert_row_below"?"below":"above";w=w??(q==="below"?Y:0);const{delta:b,startPhysicalIndex:R}=a.createRow(w,p,{source:I,mode:q});U.shiftRows(o.toVisualRow(R),b);break;case"insert_col_start":case"insert_col_end":const S=m==="insert_col_end"?"end":"start";w=w??(S==="end"?o.countSourceCols():0);const{delta:k,startPhysicalIndex:_}=a.createCol(w,p,{source:I,mode:S});if(k){if(Array.isArray(v.colHeaders)){const x=[o.toVisualColumn(_),0];x.length+=k,Array.prototype.splice.apply(v.colHeaders,x)}U.shiftColumns(o.toVisualColumn(_),k)}break;case"remove_row":const H=x=>{let N=0;M(x,V=>{let[F,z]=V;const oe=Ut(F)?o.countRows()-1:Math.max(F-N,0);if(Number.isInteger(F)&&(F=Math.max(F-N,0)),!a.removeRow(F,z,I))return;if(U.isSelected()){const{row:Se}=o.getSelectedRangeLast().highlight;Se>=F&&Se<=F+z-1&&c.closeEditor(!0)}const Re=o.countRows(),Ne=v.fixedRowsTop;Ne>=oe+1&&(v.fixedRowsTop-=Math.min(z,Ne-oe));const We=v.fixedRowsBottom;We&&oe>=Re-We&&(v.fixedRowsBottom-=Math.min(z,We)),Re===0?U.deselect():I==="ContextMenu.removeRow"?U.refresh():U.shiftRows(F,-z),N+=z})};Array.isArray(w)?H(B(w)):H([[w,p]]);break;case"remove_col":const W=x=>{let N=0;M(x,V=>{let[F,z]=V;const oe=Ut(F)?o.countCols()-1:Math.max(F-N,0);let ce=o.toPhysicalColumn(oe);if(Number.isInteger(F)&&(F=Math.max(F-N,0)),!a.removeCol(F,z,I))return;if(U.isSelected()){const{col:Se}=o.getSelectedRangeLast().highlight;Se>=F&&Se<=F+z-1&&c.closeEditor(!0)}o.countCols()===0?U.deselect():I==="ContextMenu.removeColumn"?U.refresh():U.shiftColumns(F,-z);const We=v.fixedColumnsStart;We>=oe+1&&(v.fixedColumnsStart-=Math.min(z,We-oe)),Array.isArray(v.colHeaders)&&(typeof ce>"u"&&(ce=-1),v.colHeaders.splice(ce,z)),N+=z})};Array.isArray(w)?W(B(w)):W([[w,p]]);break;default:throw new Error(`There is no such action "${m}"`)}$||u.adjustRowsAndCols(),o.view.render(),o.view.adjustElementsSize()},adjustRowsAndCols(){const m=v.minRows,w=v.minSpareRows,p=v.minCols,I=v.minSpareCols;if(m){const $=o.countRows();$<m&&a.createRow($,m-$,{source:"auto"})}if(w){const $=o.countEmptyRows(!0);if($<w){const B=w-$,Y=Math.min(B,v.maxRows-o.countSourceRows());a.createRow(o.countRows(),Y,{source:"auto"})}}{let $;(p||I)&&($=o.countEmptyCols(!0));let B=o.countCols();if(p&&!v.columns&&B<p){const Y=p-B;$+=Y,a.createCol(B,Y,{source:"auto"})}if(I&&!v.columns&&o.dataType==="array"&&$<I){B=o.countCols();const Y=I-$,q=Math.min(Y,v.maxCols-B);a.createCol(B,q,{source:"auto"})}}},populateFromArray(m,w,p,I,$){let B,Y,q,b;const R=[],S={},k=[],_=m.row,H=m.col;if(Y=w.length,Y===0)return!1;let W=0,x=0;switch(Ae(p)&&(W=p.col-H+1,x=p.row-_+1),$){case"shift_down":const N=zm(w),V=N.length,F=Math.max(V,W),z=o.getData().slice(_),oe=zm(z).slice(H,H+F);for(q=0;q<F;q+=1)if(q<V){for(B=0,Y=N[q].length;B<x-Y;B+=1)N[q].push(N[q][B%Y]);q<oe.length?k.push(N[q].concat(oe[q])):k.push(N[q].concat(new Array(z.length).fill(null)))}else k.push(N[q%V].concat(oe[q]));o.populateFromArray(_,H,zm(k));break;case"shift_right":const ce=w.length,Re=Math.max(ce,x),Ne=o.getData().slice(_).map(Ct=>Ct.slice(H));for(B=0;B<Re;B+=1)if(B<ce){for(q=0,b=w[B].length;q<W-b;q+=1)w[B].push(w[B][q%b]);if(B<Ne.length)for(let Ct=0;Ct<Ne[B].length;Ct+=1)w[B].push(Ne[B][Ct]);else w[B].push(...new Array(Ne[0].length).fill(null))}else w.push(w[B%Y].slice(0,Re).concat(Ne[B]));o.populateFromArray(_,H,w);break;case"overwrite":default:S.row=m.row,S.col=m.col;let We=0,Se=0,Le=!0,vt;const yo=function(Zt){let ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const yt=w[Zt%w.length];return ft!==null?yt[ft%yt.length]:yt},Ns=w.length,Ki=p?p.row-m.row+1:0;for(p?Y=Ki:Y=Math.max(Ns,Ki),B=0;B<Y&&!(p&&S.row>p.row&&Ki>Ns||!v.allowInsertRow&&S.row>o.countRows()-1||S.row>=v.maxRows);B++){const Ct=B-We,Zt=yo(Ct).length,ft=p?p.col-m.col+1:0;if(p?b=ft:b=Math.max(Zt,ft),S.col=m.col,vt=o.getCellMeta(S.row,S.col),(I==="CopyPaste.paste"||I==="Autofill.fill")&&vt.skipRowOnPaste){We+=1,S.row+=1,Y+=1;continue}for(Se=0,q=0;q<b&&!(p&&S.col>p.col&&ft>Zt||!v.allowInsertColumn&&S.col>o.countCols()-1||S.col>=v.maxCols);q++){if(vt=o.getCellMeta(S.row,S.col),(I==="CopyPaste.paste"||I==="Autofill.fill")&&vt.skipColumnOnPaste){Se+=1,S.col+=1,b+=1;continue}if(vt.readOnly&&I!=="UndoRedo.undo"){S.col+=1;continue}const yt=q-Se;let $e=yo(Ct,yt),qi=o.getDataAtCell(S.row,S.col);if($e!==null&&typeof $e=="object")if(Array.isArray($e)&&qi===null&&(qi=[]),qi===null||typeof qi!="object")Le=!1;else{const yl=ff(Array.isArray(qi)?qi:qi[0]||qi),bl=ff(Array.isArray($e)?$e:$e[0]||$e);QE(yl,bl)||Array.isArray(yl)&&Array.isArray(bl)?$e=Gn($e):Le=!1}else qi!==null&&typeof qi=="object"&&(Le=!1);Le&&R.push([S.row,S.col,$e]),Le=!0,S.col+=1}S.row+=1}o.setDataAtCell(R,null,null,I||"populateFromArray");break}}};function Z(m){const w=HD(m);x0(w)?(o.runHooks("beforeLanguageChange",w),P.language=w,o.runHooks("afterLanguageChange",w)):ND(m)}function J(m,w){const p=m==="className"?o.rootElement:o.table;if(f)G(p,w);else{let I=[],$=[];P[m]&&(I=Array.isArray(P[m])?P[m]:CP(P[m])),w&&($=Array.isArray(w)?w:CP(w));const B=vP(I,$),Y=vP($,I);B.length&&pe(p,B),Y.length&&G(p,Y)}P[m]=w}this.init=function(){l.setData(v.data),o.runHooks("beforeInit"),(ua()||YN())&&G(o.rootElement,"mobile"),this.updateSettings(e,!0),this.view=new PK(this);const m=v.themeName||bx(o.rootElement);o.useTheme(m),o.view.addClassNameToLicenseElement(o.getCurrentThemeName()),c=bR.getInstance(o,v,U),d=VX(o),h=new Zz(o),Km(this)&&xX(o),o.runHooks("init"),this.render(),f&&o.rootElement.offsetParent===null&&az(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 se(){let m=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,m=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&m===!1&&(m=!0,this.onQueueEmpty(this.valid))}}}function te(m){const w=m.replace(",",".");return isNaN(parseFloat(w))===!1?parseFloat(w):m}function ue(m,w,p){if(!m.length){p();return}const I=o.getActiveEditor(),$=new se;let B=!0;$.onQueueEmpty=()=>{I&&B&&I.cancelChanges(),p()};for(let Y=m.length-1;Y>=0;Y--){const[q,b]=m[Y],R=a.propToCol(b);let S;Number.isInteger(R)?S=o.getCellMeta(q,R):S={...Object.getPrototypeOf(v),...v},o.getCellValidator(S)&&($.addValidatorToQueue(),o.validateCell(m[Y][3],S,function(k,_){return function(H){if(typeof H!="boolean")throw new Error("Validation error: result is not boolean");H===!1&&_.allowInvalid===!1&&(B=!1,m.splice(k,1),_.valid=!0),$.removeValidatorFormQueue()}}(Y,S),w))}$.checkIfQueueIsEmpty()}function pt(m,w){for(let I=m.length-1;I>=0;I--){let $=!1;if(m[I]===null){m.splice(I,1);continue}if(!((m[I][2]===null||m[I][2]===void 0)&&(m[I][3]===null||m[I][3]===void 0))){if(v.allowInsertRow)for(;m[I][0]>o.countRows()-1;){const{delta:B}=a.createRow(void 0,void 0,{source:"auto"});if(B===0){$=!0;break}}if(o.dataType==="array"&&(!v.columns||v.columns.length===0)&&v.allowInsertColumn)for(;a.propToCol(m[I][1])>o.countCols()-1;){const{delta:B}=a.createCol(void 0,void 0,{source:"auto"});if(B===0){$=!0;break}}$||a.set(m[I][0],m[I][1],m[I][3])}}if(m.length>0){u.adjustRowsAndCols(),o.runHooks("beforeChangeRender",m,w),c.closeEditor(),o.render(),c.prepareEditor(),o.view.adjustElementsSize(),o.runHooks("afterChange",m,w||"edit");const I=o.getActiveEditor();I&&ae(I.refreshValue)&&I.refreshValue()}else o.render()}this._createCellCoords=function(m,w){return o.view._wt.createCellCoords(m,w)},this._createCellRange=function(m,w,p){return o.view._wt.createCellRange(m,w,p)},this.validateCell=function(m,w,p,I){let $=o.getCellValidator(w);function B(Y){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||w.hidden===!0){p(Y);return}const b=w.visualCol,R=w.visualRow,S=o.getCell(R,b,!0);if(S&&S.nodeName!=="TH"){const k=o.rowIndexMapper.getRenderableFromVisualIndex(R),_=o.columnIndexMapper.getRenderableFromVisualIndex(b);o.view._wt.getSetting("cellRenderer",k,_,S)}p(Y)}RU($)&&($=function(Y){return function(q,b){b(Y.test(q))}}($)),ot($)?(m=o.runHooks("beforeValidate",m,w.visualRow,w.prop,I),o._registerImmediate(()=>{$.call(w,m,Y=>{o&&(Y=o.runHooks("afterValidate",Y,m,w.visualRow,w.prop,I),w.valid=Y,B(Y),o.runHooks("postAfterValidate",Y,m,w.visualRow,w.prop,I))})})):o._registerImmediate(()=>{w.valid=!0,B(w.valid,!1)})};function be(m,w,p){return Array.isArray(m)?m:[[m,w,p]]}function ke(m,w){const p=o.runHooks("beforeChange",m,w||"edit"),I=m.filter(B=>B!==null);if(p===!1||I.length===0){var $;return($=o.getActiveEditor())===null||$===void 0||$.cancelChanges(),[]}for(let B=I.length-1;B>=0;B--){const[Y,q,,b]=I[B],R=a.propToCol(q);let S;Number.isInteger(R)?S=o.getCellMeta(Y,R):S={...Object.getPrototypeOf(v),...v};const{type:k,checkedTemplate:_,uncheckedTemplate:H}=S;if(k==="numeric"&&typeof b=="string"&&cY(b)&&(I[B][3]=te(b)),k==="checkbox"){const W=Pt(b),x=W===Pt(_),N=W===Pt(H);(x||N)&&(I[B][3]=x?_:H)}}return I}this.setDataAtCell=function(m,w,p,I){const $=be(m,w,p),B=[];let Y=I,q,b,R;for(q=0,b=$.length;q<b;q++){if(typeof $[q]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof $[q][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`");$[q][1]>=this.countCols()?R=$[q][1]:R=a.colToProp($[q][1]),B.push([$[q][0],R,l.getAtCell(this.toPhysicalRow($[q][0]),$[q][1]),$[q][2]])}!Y&&typeof m=="object"&&(Y=w);const S=ke(B,Y);o.runHooks("afterSetDataAtCell",S,Y),ue(S,Y,()=>{pt(S,Y)})},this.setDataAtRowProp=function(m,w,p,I){const $=be(m,w,p),B=[];let Y=I,q,b;for(q=0,b=$.length;q<b;q++)B.push([$[q][0],$[q][1],l.getAtCell(this.toPhysicalRow($[q][0]),$[q][1]),$[q][2]]);!Y&&typeof m=="object"&&(Y=w);const R=ke(B,I);o.runHooks("afterSetDataAtRowProp",R,Y),ue(R,Y,()=>{pt(R,Y)})},this.listen=function(){o&&!o.isListening()&&(Rb.forEach(m=>{o!==m&&m.unlisten()}),Sb=o.guid,o.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(Sb=null,o.runHooks("afterUnlisten"))},this.isListening=function(){return Sb===o.guid},this.destroyEditor=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;c.closeEditor(m),o.view.render(),w&&U.isSelected()&&c.prepareEditor()},this.populateFromArray=function(m,w,p,I,$,B,Y){if(!(typeof p=="object"&&typeof p[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const q=typeof I=="number"?o._createCellCoords(I,$):null;return u.populateFromArray(o._createCellCoords(m,w),p,q,B,Y)},this.spliceCol=function(m,w,p){for(var I=arguments.length,$=new Array(I>3?I-3:0),B=3;B<I;B++)$[B-3]=arguments[B];return a.spliceCol(m,w,p,...$)},this.spliceRow=function(m,w,p){for(var I=arguments.length,$=new Array(I>3?I-3:0),B=3;B<I;B++)$[B-3]=arguments[B];return a.spliceRow(m,w,p,...$)},this.getSelected=function(){if(U.isSelected())return Be(U.getSelectedRange(),m=>{let{from:w,to:p}=m;return[w.row,w.col,p.row,p.col]})},this.getSelectedLast=function(){const m=this.getSelected();let w;return m&&m.length>0&&(w=m[m.length-1]),w},this.getSelectedRange=function(){if(U.isSelected())return Array.from(U.getSelectedRange())},this.getSelectedRangeLast=function(){const m=this.getSelectedRange();let w;return m&&m.length>0&&(w=m[m.length-1]),w},this.emptySelectedCells=function(m){if(!U.isSelected()||this.countRows()===0||this.countCols()===0)return;const w=[];M(U.getSelectedRange(),p=>{if(p.isSingleHeader())return;const I=p.getTopStartCorner(),$=p.getBottomEndCorner();de(I.row,$.row,B=>{de(I.col,$.col,Y=>{this.getCellMeta(B,Y).readOnly||w.push([B,Y,null])})})}),w.length>0&&this.setDataAtCell(w,m)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const m=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(m,0),!this.isRenderSuspended()&&m===this.renderSuspendedCounter&&o.view.render()},this.render=function(){this.view&&(this.forceFullRender=!0,this.isRenderSuspended()||o.view.render())},this.batchRender=function(m){this.suspendRender();const w=m();return this.resumeRender(),w},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const w=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(w,0),(!this.isExecutionSuspended()&&w===this.executionSuspendedCounter||m)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const p=m();return this.resumeExecution(w),p},this.batch=function(m){this.suspendRender(),this.suspendExecution();const w=m();return this.resumeExecution(),this.resumeRender(),w},this.refreshDimensions=function(){if(!o.view)return;const m=o.view,{width:w,height:p}=m.getLastSize(),{width:I,height:$}=o.rootElement.getBoundingClientRect(),B=I!==w||$!==p;o.runHooks("beforeRefreshDimensions",{width:w,height:p},{width:I,height:$},B)!==!1&&((B||m._wt.wtOverlays.scrollableElement===o.rootWindow)&&(m.setLastSize(I,$),o.render(),m.adjustElementsSize()),o.runHooks("afterRefreshDimensions",{width:w,height:p},{width:I,height:$},B))},this.updateData=function(m,w){mx(m,p=>{a=p},p=>{a=p,o.columnIndexMapper.fitToLength(this.getInitialColumnCount()),o.rowIndexMapper.fitToLength(this.countSourceRows()),u.adjustRowsAndCols(),U.refresh()},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"updateData",source:w,metaManager:E,firstRun:f})},this.loadData=function(m,w){mx(m,p=>{a=p},()=>{E.clearCellsCache(),o.initIndexMappers(),u.adjustRowsAndCols(),U.refresh(),f&&(f=[null,"loadData"])},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"loadData",source:w,metaManager:E,firstRun:f})},this.getInitialColumnCount=function(){const m=v.columns;let w=0;if(Array.isArray(m))w=m.length;else if(ot(m))if(o.dataType==="array"){const p=this.countSourceCols();for(let I=0;I<p;I+=1)m(I)&&(w+=1)}else(o.dataType==="object"||o.dataType==="function")&&(w=a.colToPropCache.length);else if(ae(v.dataSchema)){const p=a.getSchema();w=Array.isArray(p)?p.length:JE(p)}else w=this.countSourceCols();return w},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(m,w,p,I){return It(m)?a.getAll():a.getRange(o._createCellCoords(m,w),o._createCellCoords(p,I),a.DESTINATION_RENDERER)},this.getCopyableText=function(m,w,p,I){return a.getCopyableText(o._createCellCoords(m,w),o._createCellCoords(p,I))},this.getCopyableData=function(m,w){return a.getCopyable(m,a.colToProp(w))},this.getSchema=function(){return a.getSchema()},this.updateSettings=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const p=(f?o.loadData:o.updateData).bind(this);let I=!1,$,B;if(ae(m.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(ae(m.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(ae(m.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');m.language&&Z(m.language);for($ in m)if(!($==="data"||$==="language"))if($==="className")J("className",m.className);else if($==="tableClassName"&&o.table)J("tableClassName",m.tableClassName),o.view._wt.wtOverlays.syncOverlayTableClassNames();else if(re.getSingleton().isRegistered($)||re.getSingleton().isDeprecated($)){const S=m[$];ot(S)?(re.getSingleton().addAsFixed($,S,o),v[$]=S):Array.isArray(S)&&(re.getSingleton().add($,S,o),v[$]=S)}else!w&&tn(m,$)&&(P[$]=m[$]);m.data===void 0&&v.data===void 0?p(null,"updateSettings"):m.data!==void 0?p(m.data,"updateSettings"):m.columns!==void 0&&(a.createMap(),o.initIndexMappers());const Y=o.countCols(),q=v.columns;if(q&&ot(q)&&(I=!0),(m.cell!==void 0||m.cells!==void 0||m.columns!==void 0)&&E.clearCache(),Y>0)for($=0,B=0;$<Y;$++){if(q){const S=I?q($):q[B];S&&E.updateColumnMeta(B,S)}B+=1}ae(m.cell)&&He(m.cell,S=>{o.setCellMetaObject(S.row,S.col,S)}),o.runHooks("afterCellMetaReset");let b=o.rootElement.style.height;b!==""&&(b=parseInt(o.rootElement.style.height,10));let R=m.height;if(ot(R)&&(R=R()),w&&o.rootElement.getAttribute("style")&&o.rootElement.setAttribute("data-initialstyle",o.rootElement.getAttribute("style")),R===null){const S=o.rootElement.getAttribute("data-initialstyle");S&&(S.indexOf("height")>-1||S.indexOf("overflow")>-1)?o.rootElement.setAttribute("style",S):(o.rootElement.style.height="",o.rootElement.style.overflow="")}else R!==void 0&&(o.rootElement.style.height=isNaN(R)?`${R}`:`${R}px`,o.rootElement.style.overflow="hidden");if(typeof m.width<"u"){let S=m.width;ot(S)&&(S=S()),o.rootElement.style.width=isNaN(S)?`${S}`:`${S}px`}if(!w){if(o.view){o.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),o.view._wt.exportSettingsAsClassNames();const S=o.getCurrentThemeName(),k=tn(m,"themeName");S&&k&&S!==m.themeName&&(o.view.getStylesHandler().removeClassNames(),o.view.removeClassNameFromLicenseElement(S));const _=k&&m.themeName||bx(o.rootElement);o.useTheme(_),o.view.addClassNameToLicenseElement(o.getCurrentThemeName())}o.runHooks("afterUpdateSettings",m)}u.adjustRowsAndCols(),o.view&&!f&&(o.render(),o.view._wt.wtOverlays.adjustElementsSize()),!w&&o.view&&(b===""||R===""||R===void 0)&&b!==R&&o.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const m=o.getSelectedLast();if(v.getValue){if(ot(v.getValue))return v.getValue.call(o);if(m)return o.getData()[m[0][0]][v.getValue]}else if(m)return o.getDataAtCell(m[0],m[1])},this.getSettings=function(){return v},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(m,w,p,I,$){u.alter(m,w,p,I,$)},this.getCell=function(m,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,I=w,$=m;if(w>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(w)))return null;I=this.columnIndexMapper.getRenderableFromVisualIndex(w)}if(m>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(m)))return null;$=this.rowIndexMapper.getRenderableFromVisualIndex(m)}return $===null||I===null||$===void 0||I===void 0?null:o.view.getCellAtCoords(o._createCellCoords($,I),p)},this.getCoords=function(m){const w=this.view._wt.wtTable.getCoords(m);if(w===null)return null;const{row:p,col:I}=w;let $=p,B=I;return p>=0&&($=this.rowIndexMapper.getVisualFromRenderableIndex(p)),I>=0&&(B=this.columnIndexMapper.getVisualFromRenderableIndex(I)),o._createCellCoords($,B)},this.colToProp=function(m){return a.colToProp(m)},this.propToCol=function(m){return a.propToCol(m)},this.toVisualRow=m=>this.rowIndexMapper.getVisualFromPhysicalIndex(m),this.toVisualColumn=m=>this.columnIndexMapper.getVisualFromPhysicalIndex(m),this.toPhysicalRow=m=>this.rowIndexMapper.getPhysicalFromVisualIndex(m),this.toPhysicalColumn=m=>this.columnIndexMapper.getPhysicalFromVisualIndex(m),this.getDataAtCell=function(m,w){return a.get(m,a.colToProp(w))},this.getDataAtRowProp=function(m,w){return a.get(m,w)},this.getDataAtCol=function(m){const w=[],p=a.getRange(o._createCellCoords(0,m),o._createCellCoords(v.data.length-1,m),a.DESTINATION_RENDERER);for(let I=0;I<p.length;I+=1)for(let $=0;$<p[I].length;$+=1)w.push(p[I][$]);return w},this.getDataAtProp=function(m){const w=[],p=a.getRange(o._createCellCoords(0,a.propToCol(m)),o._createCellCoords(v.data.length-1,a.propToCol(m)),a.DESTINATION_RENDERER);for(let I=0;I<p.length;I+=1)for(let $=0;$<p[I].length;$+=1)w.push(p[I][$]);return w},this.getSourceData=function(m,w,p,I){let $;return m===void 0?$=l.getData():$=l.getByRange(o._createCellCoords(m,w),o._createCellCoords(p,I)),$},this.getSourceDataArray=function(m,w,p,I){let $;return m===void 0?$=l.getData(!0):$=l.getByRange(o._createCellCoords(m,w),o._createCellCoords(p,I),!0),$},this.getSourceDataAtCol=function(m){return l.getAtColumn(m)},this.setSourceDataAtCell=function(m,w,p,I){const $=be(m,w,p),B=this.hasHook("afterSetSourceDataAtCell"),Y=[];B&&M($,b=>{let[R,S,k]=b;Y.push([R,S,l.getAtCell(R,S),k])}),M($,b=>{let[R,S,k]=b;l.setAtCell(R,S,k)}),B&&this.runHooks("afterSetSourceDataAtCell",Y,I),this.render();const q=o.getActiveEditor();q&&ae(q.refreshValue)&&q.refreshValue()},this.getSourceDataAtRow=function(m){return l.getAtRow(m)},this.getSourceDataAtCell=function(m,w){return l.getAtCell(m,w)},this.getDataAtRow=function(m){return a.getRange(o._createCellCoords(m,0),o._createCellCoords(m,this.countCols()-1),a.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(m,w,p,I){const $=m===void 0?[0,0,this.countRows(),this.countCols()]:[m,w,p,I],[B,Y]=$;let[,,q,b]=$,R=null,S=null;q===void 0&&(q=B),b===void 0&&(b=Y);let k="mixed";return de(Math.max(Math.min(B,q),0),Math.max(B,q),_=>{let H=!0;return de(Math.max(Math.min(Y,b),0),Math.max(Y,b),W=>(S=this.getCellMeta(_,W).type,R?H=R===S:R=S,H)),k=H?S:"mixed",H}),k},this.removeCellMeta=function(m,w,p){const[I,$]=[this.toPhysicalRow(m),this.toPhysicalColumn(w)];let B=E.getCellMetaKeyValue(I,$,p);o.runHooks("beforeRemoveCellMeta",m,w,p,B)!==!1&&(E.removeCellMeta(I,$,p),o.runHooks("afterRemoveCellMeta",m,w,p,B)),B=null},this.spliceCellsMeta=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var p=arguments.length,I=new Array(p>2?p-2:0),$=2;$<p;$++)I[$-2]=arguments[$];if(I.length>0&&!Array.isArray(I[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");w>0&&E.removeRow(this.toPhysicalRow(m),w),I.length>0&&M(I.reverse(),B=>{E.createRow(this.toPhysicalRow(m)),M(B,(Y,q)=>this.setCellMetaObject(m,q,Y))}),o.render()},this.setCellMetaObject=function(m,w,p){typeof p=="object"&&He(p,(I,$)=>{this.setCellMeta(m,w,$,I)})},this.setCellMeta=function(m,w,p,I){if(o.runHooks("beforeSetCellMeta",m,w,p,I)===!1)return;let B=m,Y=w;m<this.countRows()&&(B=this.toPhysicalRow(m)),w<this.countCols()&&(Y=this.toPhysicalColumn(w)),E.setCellMeta(B,Y,p,I),o.runHooks("afterSetCellMeta",m,w,p,I)},this.getCellsMeta=function(){return E.getCellsMeta()},this.getCellMeta=function(m,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipMetaExtension:!1},I=this.toPhysicalRow(m),$=this.toPhysicalColumn(w);return I===null&&(I=m),$===null&&($=w),E.getCellMeta(I,$,{visualRow:m,visualColumn:w,...p})},this.getColumnMeta=function(m){return E.getColumnMeta(this.toPhysicalColumn(m))},this.getCellMetaAtRow=function(m){return E.getCellsMetaAtRow(m)},this.isColumnModificationAllowed=function(){return!(o.dataType==="object"||v.columns)},this.getCellRenderer=function(m,w){const p=typeof m=="number"?o.getCellMeta(m,w).renderer:m.renderer;return typeof p=="string"?ER(p):It(p)?ER("text"):p},this.getCellEditor=function(m,w){const p=typeof m=="number"?o.getCellMeta(m,w).editor:m.editor;return typeof p=="string"?yR(p):It(p)?yR("text"):p},this.getCellValidator=function(m,w){const p=typeof m=="number"?o.getCellMeta(m,w).validator:m.validator;return typeof p=="string"?MY(p):p},this.validateCells=function(m){this._validateCells(m)},this.validateRows=function(m,w){if(!Array.isArray(m))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(w,m)},this.validateColumns=function(m,w){if(!Array.isArray(m))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(w,void 0,m)},this._validateCells=function(m,w,p){const I=new se;m&&(I.onQueueEmpty=m);let $=o.countRows()-1;for(;$>=0;){if(w!==void 0&&w.indexOf($)===-1){$-=1;continue}let B=o.countCols()-1;for(;B>=0;){if(p!==void 0&&p.indexOf(B)===-1){B-=1;continue}I.addValidatorToQueue(),o.validateCell(o.getDataAtCell($,B),o.getCellMeta($,B),Y=>{if(typeof Y!="boolean")throw new Error("Validation error: result is not boolean");Y===!1&&(I.valid=!1),I.removeValidatorFormQueue()},"validateCells"),B-=1}$-=1}I.checkIfQueueIsEmpty()},this.getRowHeader=function(m){let w=v.rowHeaders,p=m;return p!==void 0&&(p=o.runHooks("modifyRowHeader",p)),p===void 0?(w=[],de(o.countRows()-1,I=>{w.push(o.getRowHeader(I))})):Array.isArray(w)&&w[p]!==void 0?w=w[p]:ot(w)?w=w(p):w&&typeof w!="string"&&typeof w!="number"&&(w=p+1),w},this.hasRowHeaders=function(){return!!v.rowHeaders},this.hasColHeaders=function(){if(v.colHeaders!==void 0&&v.colHeaders!==null)return!!v.colHeaders;for(let m=0,w=o.countCols();m<w;m++)if(o.getColHeader(m))return!0;return!1},this.getColHeader=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const p=o.runHooks("modifyColHeader",m);if(p===void 0){const q=[],b=o.countCols();for(let R=0;R<b;R++)q.push(o.getColHeader(R));return q}let I=v.colHeaders;const $=function(q){const b=[],R=o.countCols();let S=0;for(;S<R;S++)ot(v.columns)&&v.columns(S)&&b.push(S);return b[q]},B=o.toPhysicalColumn(p),Y=$(B);return v.colHeaders===!1?I=null:v.columns&&ot(v.columns)&&v.columns(Y)&&v.columns(Y).title?I=v.columns(Y).title:v.columns&&v.columns[B]&&v.columns[B].title?I=v.columns[B].title:Array.isArray(v.colHeaders)&&v.colHeaders[B]!==void 0?I=v.colHeaders[B]:ot(v.colHeaders)?I=v.colHeaders(B):v.colHeaders&&typeof v.colHeaders!="string"&&typeof v.colHeaders!="number"&&(I=DK(p)),I=o.runHooks("modifyColumnHeaderValue",I,m,w),I},this._getColWidthFromSettings=function(m){let w;if(m>=0&&(w=o.getCellMeta(0,m).width),(w===void 0||w===v.width)&&(w=v.colWidths),w!=null){switch(typeof w){case"object":w=w[m];break;case"function":w=w(m);break}typeof w=="string"&&(w=parseInt(w,10))}return w},this.getColWidth=function(m,w){let p=o._getColWidthFromSettings(m);return p=o.runHooks("modifyColWidth",p,m,w),p===void 0&&(p=eh),p},this._getRowHeightFromSettings=function(m){const w=this.view.getDefaultRowHeight();let p=v.rowHeights;if(p!=null){switch(typeof p){case"object":p=p[m];break;case"function":p=p(m);break}typeof p=="string"&&(p=parseInt(p,10))}return p!=null&&p<w?w:p},this.getRowHeight=function(m,w){let p=o._getRowHeightFromSettings(m);return p=o.runHooks("modifyRowHeight",p,m,w),p},this.countSourceRows=function(){return l.countRows()},this.countSourceCols=function(){return l.countFirstRowKeys()},this.countRows=function(){return a.getLength()},this.countCols=function(){const m=v.maxCols,w=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(m,w)},this.countRenderedRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=0;return sO(o.countRows()-1,p=>{if(o.isEmptyRow(p))w+=1;else if(m===!0)return!1}),w},this.countEmptyCols=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=0;return sO(o.countCols()-1,p=>{if(o.isEmptyCol(p))w+=1;else if(m===!0)return!1}),w},this.isEmptyRow=function(m){return v.isEmptyRow.call(o,m)},this.isEmptyCol=function(m){return v.isEmptyCol.call(o,m)},this.selectCell=function(m,w,p,I){let $=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,B=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return It(m)||It(w)?!1:this.selectCells([[m,w,p,I]],$,B)},this.selectCells=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;w===!1&&d.suspend();const I=U.selectCells(m);return I&&p&&o.listen(),d.resume(),I},this.selectColumns=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,p=arguments.length>2?arguments[2]:void 0;return U.selectColumns(m,w,p)},this.selectRows=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,p=arguments.length>2?arguments[2]:void 0;return U.selectRows(m,w,p)},this.deselectCell=function(){U.deselect()},this.selectAll=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:m,p=arguments.length>2?arguments[2]:void 0;d.skipNextScrollCycle(),U.selectAll(m,w,p)};const wt=(m,w)=>m.getNearestNotHiddenIndex(w,1,!0);this.scrollViewportTo=function(m,w){if(typeof m=="number"){var p;m={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:(p=arguments[4])!==null&&p!==void 0?p:!0}}const{row:I,col:$,considerHiddenIndexes:B}=m??{};let Y=I,q=$;if(ot(w)&&this.addHookOnce("afterScroll",w),B===void 0||B){const k=Number.isInteger(I)&&I>=0,_=Number.isInteger($)&&$>=0,H=k?wt(this.rowIndexMapper,I):void 0,W=_?wt(this.columnIndexMapper,$):void 0;if(H===null||W===null)return!1;Y=k?o.rowIndexMapper.getRenderableFromVisualIndex(H):I,q=_?o.columnIndexMapper.getRenderableFromVisualIndex(W):$}const b=Number.isInteger(Y),R=Number.isInteger(q);let S=!1;return b&&Y>=0&&R&&q>=0?S=o.view.scrollViewport(o._createCellCoords(Y,q),m.horizontalSnap,m.verticalSnap):b&&Y>=0&&(R&&q<0||!R)?S=o.view.scrollViewportVertically(Y,m.verticalSnap):R&&q>=0&&(b&&Y<0||!b)&&(S=o.view.scrollViewportHorizontally(q,m.horizontalSnap)),ot(w)&&(S?this.view.render():(this.removeHook("afterScroll",w),this._registerMicrotask(()=>w()))),S},this.scrollToFocusedCell=function(m){if(!this.selection.isSelected())return!1;ot(m)&&this.addHookOnce("afterScroll",m);const{highlight:w}=this.getSelectedRangeLast(),p=this.scrollViewportTo(w.toObject());return p?this.view.render():ot(m)&&(this.removeHook("afterScroll",m),this._registerMicrotask(()=>m())),p},this.destroy=function(){if(o._clearTimeouts(),o._clearImmediates(),o.view&&o.view.destroy(),l&&l.destroy(),l=null,this.getShortcutManager().destroy(),E.clearCache(),Rb.delete(this.guid),Km(o)){const m=this.rootDocument.querySelector(".hot-display-license-info");m&&m.parentNode.removeChild(m)}va(o.rootElement),s.destroy(),c&&c.destroy(),o.batchExecution(()=>{o.rowIndexMapper.unregisterAll(),o.columnIndexMapper.unregisterAll(),O.getItems().forEach(m=>{let[,w]=m;w.destroy()}),O.clear(),o.runHooks("afterDestroy")},!0),re.getSingleton().destroy(o),He(o,(m,w,p)=>{ot(m)?p[w]=fn(w):w!=="guid"&&(p[w]=null)}),o.isDestroyed=!0,a&&a.destroy(),a=null,u=null,U=null,c=null,o=null};function fn(m){return()=>{throw new Error(`The "${m}" 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(m){return O.getItem(Uo(m))},this.getPluginName=function(m){return m===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:O.getId(m)},this.getInstance=function(){return o},this.addHook=function(m,w,p){re.getSingleton().add(m,w,o,p)},this.hasHook=function(m){return re.getSingleton().has(m,o)||re.getSingleton().has(m)},this.addHookOnce=function(m,w,p){re.getSingleton().once(m,w,o,p)},this.removeHook=function(m,w){re.getSingleton().remove(m,w,o)},this.runHooks=function(m,w,p,I,$,B,Y){return re.getSingleton().run(o,m,w,p,I,$,B,Y)},this.getTranslatedPhrase=function(m,w){return $D(v.language,m,w)},this.toHTML=()=>iO(this),this.toTableElement=()=>{const m=this.rootDocument.createElement("div");return m.insertAdjacentHTML("afterbegin",iO(this)),m.firstElementChild},this.timeouts=[],this.useTheme=m=>{this.view.getStylesHandler().useTheme(m),this.runHooks("afterSetTheme",m,!!f)},this.getCurrentThemeName=()=>this.view.getStylesHandler().getThemeName(),this._registerTimeout=function(m){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=m;typeof p=="function"&&(p=setTimeout(p,w)),this.timeouts.push(p)},this._clearTimeouts=function(){M(this.timeouts,m=>{clearTimeout(m)})},this.immediates=[],this._registerImmediate=function(m){this.immediates.push(setImmediate(m))},this._clearImmediates=function(){M(this.immediates,m=>{clearImmediate(m)})},this._registerMicrotask=function(m){this.rootWindow.queueMicrotask(()=>{this.isDestroyed||m()})},this._getEditorManager=function(){return c};const et=YX({handleEvent(){return o.isListening()},beforeKeyDown:m=>this.runHooks("beforeKeyDown",m),afterKeyDown:m=>{this.isDestroyed||o.runHooks("afterDocumentKeyDown",m)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",m=>{m.ctrlKey===!1&&m.metaKey===!1&&et.releasePressedKeys()}),this.getShortcutManager=function(){return et},this.getFocusManager=function(){return h},rD().forEach(m=>{const w=i0(m);O.addItem(m,new w(this))}),PX(o),et.setActiveContextName("grid"),re.getSingleton().run(o,"construct")}function Sx(t,e,n){t.addEventListener(e,n,!1)}function Rx(t,e,n){t.removeEventListener(e,n,!1)}function kg(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function JD(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=kg(s).fontSize,o.style.fontFamily=kg(s).fontFamily,o.style.whiteSpace="pre",r.appendChild(o);const f=parseInt(((h=kg(s))===null||h===void 0?void 0:h.paddingInlineStart)||0,10),g=parseInt(((d=kg(s))===null||d===void 0?void 0:d.paddingInlineEnd)||0,10),C=o.clientWidth+f+g+1;r.removeChild(o);const y=s.style;y.height=`${n.minHeight}px`,n.minWidth>C?y.width=`${n.minWidth}px`:C>n.maxWidth?y.width=`${n.maxWidth}px`:y.width=`${C}px`;const E=s.scrollHeight?s.scrollHeight-1:0;n.minHeight>E?y.height=`${n.minHeight}px`:n.maxHeight<E?(y.height=`${n.maxHeight}px`,y.overflowY="visible"):y.height=`${E}px`}function l(){t.defaultView.setTimeout(a,0)}function u(h){if(h&&h.minHeight)if(h.minHeight==="inherit")n.minHeight=s.clientHeight;else{const d=parseInt(h.minHeight,10);isNaN(d)||(n.minHeight=d)}if(h&&h.maxHeight)if(h.maxHeight==="inherit")n.maxHeight=s.clientHeight;else{const d=parseInt(h.maxHeight,10);isNaN(d)||(n.maxHeight=d)}if(h&&h.minWidth)if(h.minWidth==="inherit")n.minWidth=s.clientWidth;else{const d=parseInt(h.minWidth,10);isNaN(d)||(n.minWidth=d)}if(h&&h.maxWidth)if(h.maxWidth==="inherit")n.maxWidth=s.clientWidth;else{const d=parseInt(h.maxWidth,10);isNaN(d)||(n.maxWidth=d)}o.firstChild||(o.className="autoResize",o.style.display="inline-block",o.appendChild(i))}function c(h,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s=h,u(d),s.nodeName==="TEXTAREA"&&(s.style.resize="none",s.style.height=`${n.minHeight}px`,s.style.minWidth=`${n.minWidth}px`,s.style.maxWidth=`${n.maxWidth}px`,s.style.overflowY="hidden"),f&&(Sx(s,"input",a),Sx(s,"keydown",l)),a()}return{init:c,resize:a,unObserve(){Rx(s,"input",a),Rx(s,"keydown",l)}}}function Ex(t,e){const n=DN(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}Sw(e,i)}function Al(t,e,n){return(e=GX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GX(t){var e=KX(t,"string");return typeof e=="symbol"?e:e+""}function KX(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const qX="ht_editor_visible",Lg="ht_editor_hidden",Tx="textEditor",XX="text";class ju extends vh{static get EDITOR_TYPE(){return XX}constructor(e){super(e),Al(this,"eventManager",new zo(this)),Al(this,"autoResize",JD(this.hot.rootDocument)),Al(this,"TEXTAREA",void 0),Al(this,"textareaStyle",void 0),Al(this,"TEXTAREA_PARENT",void 0),Al(this,"textareaParentStyle",void 0),Al(this,"layerClass",void 0),this.eventManager=new zo(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(),Ym(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!==Bt.FINISHED&&!this.isOpened()&&this.hideEditableElement()}}beginEditing(e,n){this.state===Bt.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,n))}focus(){this.TEXTAREA.select(),Sw(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),ye(this.TEXTAREA,[["data-hot-input",""],Vu(-1)]),G(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"),G(this.TEXTAREA_PARENT,"handsontableInputHolder"),ve(this.TEXTAREA_PARENT,this.layerClass)&&pe(this.TEXTAREA_PARENT,this.layerClass),G(this.TEXTAREA_PARENT,Lg),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){yz()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",pe(this.TEXTAREA_PARENT,this.layerClass),G(this.TEXTAREA_PARENT,Lg)}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;de(e.length-1,r=>{const i=e[r];if(ve(i,"handsontableEditor"))return n=!0,!1}),ve(this.TEXTAREA_PARENT,Lg)&&pe(this.TEXTAREA_PARENT,Lg),n?(this.layerClass=qX,G(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),G(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!==Bt.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(){zN()&&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===Bt.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===Bt.EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={runOnlyIf:()=>ae(this.hot.getSelected()),group:Tx},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;Ex(a,this.TEXTAREA)}},{keys:[["End"]],callback:(o,s)=>{let[a]=s;Ex(a,this.TEXTAREA)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(Tx)}}const ZX="base";function Gf(t,e,n,r,i,o,s){const a=s.ariaTags,l=[],u=[],c=[],h=[];s.className&&G(e,s.className),s.readOnly?(l.push(s.readOnlyCellClassName),a&&h.push(TP())):a&&c.push(TP()[0]),s.valid===!1&&s.invalidCellClassName?(l.push(s.invalidCellClassName),a&&h.push(_P())):(u.push(s.invalidCellClassName),a&&c.push(_P()[0])),s.wordWrap===!1&&s.noWordWrapClassName&&l.push(s.noWordWrapClassName),!o&&s.placeholder&&l.push(s.placeholderCellClassName),pe(e,u),G(e,l),mh(e,c),ye(e,h)}Gf.RENDERER_TYPE=ZX;const QX="text";function Pa(t,e,n,r,i,o,s){Gf.apply(this,[t,e,n,r,i,o,s]);let a=o;!a&&s.placeholder&&(a=s.placeholder),a=Pt(a),s.trimWhitespace&&(a=a.trim()),_u(e,a)}Pa.RENDERER_TYPE=QX;const JX="text",ek={CELL_TYPE:JX,editor:ju,renderer:Pa};Po(ek);De.editors={BaseEditor:vh};function De(t,e){const n=new QD(t,e||{},b0);return n.init(),n}De.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new QD(t,e,b0)};De.DefaultSettings=zD();De.hooks=re.getSingleton();De.CellCoords=Iu;De.CellRange=jf;De.packageName="handsontable";De.buildDate="24/04/2025 10:59:00";De.version="15.3.0";De.languages={dictionaryKeys:pq,getLanguageDictionary:LD,getLanguagesDictionaries:bq,registerLanguageDictionary:O0,getTranslatedPhrase:$D};function AR(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 e4(t){if(Array.isArray(t))return AR(t)}function t4(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wf(t,e,n){return e=Rp(e),l4(t,tk()?Reflect.construct(e,n||[],Rp(t).constructor):e.apply(t,n))}function nh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _x(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,nk(r.key),r)}}function rh(t,e,n){return e&&_x(t.prototype,e),n&&_x(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function n4(t,e,n){return(e=nk(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rp(t){return Rp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rp(t)}function vf(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&&HR(t,e)}function tk(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tk=function(){return!!t})()}function r4(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function i4(){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 Mx(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 o4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Mx(Object(n),!0).forEach(function(r){n4(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mx(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function s4(t,e){if(t==null)return{};var n,r,i=a4(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 a4(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 l4(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 t4(t)}function HR(t,e){return HR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},HR(t,e)}function u4(t){return e4(t)||r4(t)||h4(t)||i4()}function c4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==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 nk(t){var e=c4(t,"string");return typeof e=="symbol"?e:e+""}function h4(t,e){if(t){if(typeof t=="string")return AR(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)?AR(t,e):void 0}}var Eb=null,d4="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.",f4="The Handsontable instance bound to this component was destroyed and cannot be used properly.",Ep="global",g4="hot-wrapper-editor-container";function m4(){if(typeof console<"u"){var t;(t=console).warn.apply(t,arguments)}}function NR(t,e){var n=Dt.Children.toArray(t),r=Dt.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 rk(t){return t?t.type.WrappedComponent?t.type.WrappedComponent:t.type:null}function ik(t,e){if(typeof t>"u"||e===null)return null;var n=sk(e.props,!1);return n.className="".concat(g4," ").concat(n.className),XH.createPortal(Dt.createElement("div",Object.assign({},n),e),t.body)}function ok(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ep,r=NR(t,"hot-editor"),i=rk(r);return r?Dt.cloneElement(r,{emitEditorInstance:function(s,a){e.get(i)||e.set(i,new Map);var l=e.get(i);l.set(a??Ep,s)},editorColumnScope:n,isEditor:!0}):null}function p4(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),Eb||(Eb=n.createDocumentFragment());var o=i??n.createElement("DIV");Eb.appendChild(o);var s=Dt.cloneElement(t,o4({key:"".concat(e.row,"-").concat(e.col)},e));return{portal:XH.createPortal(s,o,r),portalContainer:o}}function sk(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 w4(){return typeof window<"u"}var ak=function(){function t(){nh(this,t)}return rh(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(y){return!a&&u.includes(y)?o[y]===n[y]:!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 g in n)g!=="settings"&&g!=="children"&&!c(g)&&n.hasOwnProperty(g)&&(h[g]=n[g]);return h}}])}(),lk=function(t){function e(){return nh(this,e),wf(this,e,arguments)}return vf(e,t),rh(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 ok(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=ak.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=ik(r,this.getLocalEditorElement());return Dt.createElement(Dt.Fragment,null,i)}}])}(Dt.Component),v4=function(t){function e(){var n;return nh(this,e),n=wf(this,e,arguments),n.state={portals:[]},n}return vf(e,t),rh(e,[{key:"render",value:function(){return Dt.createElement(Dt.Fragment,null,this.state.portals)}}])}(Dt.Component),C4="15.3.0";function y4(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var uk={exports:{}},Tb,Ix;function b4(){if(Ix)return Tb;Ix=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Tb=t,Tb}var _b,Px;function S4(){if(Px)return _b;Px=1;var t=b4();function e(){}function n(){}return n.resetWarningCache=e,_b=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},_b}uk.exports=S4()();var R4=uk.exports,Mb=y4(R4),H0=function(t){function e(){var n;return nh(this,e),n=wf(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 vf(e,t),rh(e,[{key:"hotInstance",get:function(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn(f4),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 w4()?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(),g=i.getPortalContainerCache(),C="".concat(l,"-").concat(u),y=s.guid,E="".concat(y,"-").concat(C),v="".concat(C,"-").concat(y);if(f.has(C)&&(a.innerHTML=f.get(C).innerHTML),a&&!a.getAttribute("ghost-table")){for(var P=i.portalCache.get(v),O=g.get(E);a.firstChild;)a.removeChild(a.firstChild);if(P&&O)a.appendChild(O);else{var L=p4(r,{TD:a,row:l,col:u,prop:c,value:h,cellProperties:d,isRenderer:!0},a.ownerDocument,v,O),T=L.portal,A=L.portalContainer;g.set(E,A),a.appendChild(A),i.portalCache.set(v,T)}}return f.set(C,a),a}}},{key:"getEditorClass",value:function(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ep,s=rk(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 nh(this,s),l=wf(this,s,[a]),r.hotCustomEditorInstance=l,l.editorComponent=r,l}return vf(s,o),rh(s,[{key:"focus",value:function(){}},{key:"getValue",value:function(){}},{key:"setValue",value:function(){}},{key:"open",value:function(){}},{key:"close",value:function(){}}])}(De.editors.BaseEditor);return Object.getOwnPropertyNames(De.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 NR(this.props.children,"hot-renderer")}},{key:"getGlobalEditorElement",value:function(){return ok(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=ak.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,Ep);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=yR("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=ER("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&&m4(d4)}},{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:u4(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 De.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===lk},o=Dt.Children.toArray(this.props.children),s=o.filter(function(u){return i(u)}).map(function(u,c){return Dt.cloneElement(u,{_componentRendererColumns:r.componentRendererColumns,_emitColumnSettings:r.setHotColumnSettings.bind(r),_columnIndex:c,_getChildElementByType:NR.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=sk(this.props),l=ik(this.getOwnerDocument(),this.getGlobalEditorElement());return Dt.createElement(Dt.Fragment,null,Dt.createElement("div",Object.assign({ref:this.setHotElementRef.bind(this)},a),s),Dt.createElement(v4,{ref:this.setRenderersPortalManagerRef.bind(this)}),l)}}],[{key:"version",get:function(){return C4}}])}(Dt.Component);H0.propTypes={style:Mb.object,id:Mb.string,className:Mb.string};var E4=["children"],ck=Dt.forwardRef(function(t,e){var n,r=t.children,i=s4(t,E4),o=typeof Dt.useId=="function"?Dt.useId():void 0,s=(n=i.id)!==null&&n!==void 0?n:o;return Dt.createElement(H0,Object.assign({id:s},i,{ref:e}),r)});ck.version=H0.version;Dt.Component;const Ox="handsontableEditor",T4="handsontable";class N0 extends ju{static get EDITOR_TYPE(){return T4}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(),Sw(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:Ox,relativeToGroup:Cl,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(),Ko(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(Ox)}}function _4(t,e){hk(t,e),e.add(t)}function xx(t,e,n){hk(t,e),e.set(t,n)}function hk(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=M4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M4(t){var e=I4(t,"string");return typeof e=="symbol"?e:e+""}function I4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ib(t,e){return t.get(DR(t,e))}function DR(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const P4="autocomplete";var Pb=new WeakMap,Ax=new WeakMap,Ob=new WeakSet;class D0 extends N0{constructor(){super(...arguments),_4(this,Ob),$g(this,"query",null),$g(this,"strippedChoices",[]),$g(this,"rawChoices",[]),xx(this,Pb,this.hot.guid.slice(0,9)),xx(this,Ax,Ew(()=>{this.focus()},100)),$g(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=EP(Pt(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 P4}getValue(){const e=this.rawChoices.find(n=>this.stripValueIfNeeded(n)===this.TEXTAREA.value);return ae(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),G(this.htContainer,"autocompleteEditor"),G(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&ye(this.TEXTAREA,[VU(),DU(),TN("listbox"),UU()])}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.hot.getSettings().ariaTags&&ye(this.TEXTAREA,[ho("false"),zU(`${Ib(Pb,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.addHook("afterScroll",Ib(Ax,this)),this.htEditor.updateSettings({colWidths:e?[Kt(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(a,l,u,c,h,d,f)=>{Pa(a,l,u,c,h,d,f);const{filteringCaseSensitive:g,allowHtml:C,locale:y}=this.cellProperties,E=this.query;let v=Pt(d),P,O;v&&!C&&(P=g===!0?v.indexOf(E):v.toLocaleLowerCase(y).indexOf(E.toLocaleLowerCase(y)),P!==-1&&(O=v.substr(P,E.length),v=v.replace(O,`<strong>${O}</strong>`))),n&&ye(l,[kU(),...r?[qU(i)]:[],...r?[XU(r.indexOf(d)+1)]:[],["id",`${this.htEditor.rootElement.id}_${u}-${c}`]]),l.innerHTML=v},afterSelectionEnd:(a,l)=>{if(n){const u=h=>{ye(h,[KE()]),ye(this.TEXTAREA,...YU(h.id))},c=this.htEditor.getCell(a,l,!0);c!==null?u(c):this.htEditor.addHookOnce("afterScrollVertically",()=>{const h=this.htEditor.getCell(a,l,!0);u(h)})}}}),n&&(ye(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...la()),ye(this.htEditor.rootElement,[EN(),GU("polite"),KU("text"),["id",`${Ib(Pb,this)}-listbox-${o}-${s}`]]),ye(this.TEXTAREA,...ho("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&ye(this.TEXTAREA,[ho("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=DN(this.TEXTAREA),r=oz(this.TEXTAREA),i=this.cellProperties.sortByRelevance,o=this.cellProperties.filter;let s=null,a=null,l=e;i&&(s=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),l,this.cellProperties.filteringCaseSensitive));const u=Array.isArray(s)?s.length:0;if(o===!1)u&&(a=s[0]);else{const c=[];for(let h=0,d=l.length;h<d&&!(i&&u<=h);h++)u?c.push(l[s[h]]):c.push(l[h]);a=0,l=c}this.strippedChoices=l,l.length===0?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData(zm([l])),l.length>0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(a)),this.hot.listen(),Sw(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()}),DR(Ob,this,Hx).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),DR(Ob,this,Hx).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}highlightBestMatchingChoice(e){typeof e=="number"?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getHeight(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),n=parseInt(e.borderTopWidth,10)+parseInt(e.borderBottomWidth,10),r=Math.min(this.cellProperties.visibleRows,this.strippedChoices.length);return Array.from({length:r},(o,s)=>s).reduce((o,s)=>{const a=this.htEditor.getRowHeight(s)||this.htEditor.view.getDefaultRowHeight();return o+a},0)+n+1}getWidth(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),n=parseInt(e.borderInlineStartWidth,10)+parseInt(e.borderInlineEndWidth,10);return this.htEditor.getColWidth(0)+n}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:n}=this.cellProperties,r=Be(e,o=>Pt(o));return Be(r,o=>n?o:EP(o))}allowKeyEventPropagation(e){const n=this.htEditor.getSelectedRangeLast(),r={row:n?n.from.row:-1};let i=!1;return e===me.ARROW_DOWN&&r.row>0&&r.row<this.htEditor.countRows()-1&&(i=!0),e===me.ARROW_UP&&r.row>-1&&(i=!0),i}onBeforeKeyDown(e){if(Sz(e.keyCode)||e.keyCode===me.BACKSPACE||e.keyCode===me.DELETE||e.keyCode===me.INSERT){let n=10;if(e.keyCode===me.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(n+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},n)}}}function Hx(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getWidth()+vn(this.hot.rootDocument)})}const O4="checkbox";class dk extends vh{static get EDITOR_TYPE(){return O4}beginEditing(e,n){if(n&&n.type==="mouseup"&&n.target.nodeName==="TD"){const r=this.TD.querySelector('input[type="checkbox"]');ve(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 rl=()=>window,ao=()=>window.document,kR=(t,e)=>window.setTimeout(t,e),gs=function(t,e,n,r){t.addEventListener(e,n,!!r)},js=function(t,e,n,r){t.removeEventListener(e,n,!!r)},x4=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},Li=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},xb=function(t,e){Li(t,e)||(t.className=t.className===""?e:t.className+" "+e)},Ab=function(t,e){t.className=x4((" "+t.className+" ").replace(" "+e+" "," "))},k0=function(t){return/Array/.test(Object.prototype.toString.call(t))},Wi=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},A4=function(t){let e=t.getDay();return e===0||e===6},H4=function(t){return t%4===0&&t%100!==0||t%400===0},Nx=function(t,e){return[31,H4(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},Fg=function(t){Wi(t)&&t.setHours(0,0,0,0)},Vg=function(t,e){return t.getTime()===e.getTime()},Tp=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?Wi(e[r])?n&&(t[r]=new Date(e[r].getTime())):k0(e[r])?n&&(t[r]=e[r].slice(0)):t[r]=Tp({},e[r],n):(n||!i)&&(t[r]=e[r]);return t},Dx=function(t,e,n){let r=ao().createEvent("HTMLEvents");r.initEvent(e,!0,!1),r=Tp(r,n),t.dispatchEvent(r)},kx=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},rs={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},Lx=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},N4=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>"},D4=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)},k4=function(t,e,n,r,i){let o=new Date(r,n,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(o).isoWeek():D4(o,i))+"</td>"},L4=function(t,e,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},$4=function(t){return"<tbody>"+t.join("")+"</tbody>"},F4=function(t){let e,n=[];for(t.showWeekNumber&&n.push("<th></th>"),e=0;e<7;e++)n.push('<th scope="col"><abbr title="'+Lx(t,e)+'">'+Lx(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?n.reverse():n).join("")+"</tr></thead>"},V4=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,g,C=!0,y=!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>",k0(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 g='<div class="pika-label">'+n+u.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",u.showMonthAfterYear?d+=g+f:d+=f+g,c&&(r===0||u.minMonth>=r)&&(C=!1),h&&(r===11||u.maxMonth<=r)&&(y=!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'+(y?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),d+="</div>"},W4=function(t,e,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+F4(t)+$4(e)+"</table>"};function LR(t){let e=this,n=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||rl().event;let o=i.target||i.srcElement;if(o)if(Li(o,"is-disabled")||(Li(o,"pika-button")&&!Li(o,"is-empty")&&!Li(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&&kR(function(){e.hide(),n.blurFieldOnSelect&&n.field&&n.field.blur()},100)):Li(o,"pika-prev")?e.prevMonth():Li(o,"pika-next")&&e.nextMonth()),Li(o,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||rl().event;let o=i.target||i.srcElement;o&&(Li(o,"pika-select-month")?e.gotoMonth(o.value):Li(o,"pika-select-year")&&e.gotoYear(o.value))},e._onKeyChange=function(i){if(i=i||rl().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(),Wi(o)&&e.setDate(o),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=ao().activeElement;do if(Li(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=kR(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||rl().event;let o=i.target||i.srcElement,s=o;if(o){!hasEventListeners&&Li(o,"pika-select")&&(o.onchange||(o.setAttribute("onchange","return;"),gs(o,"change",e._onChange)));do if(Li(s,"pika-single")||s===n.trigger)return;while(s=s.parentNode);e._v&&o!==n.trigger&&s!==n.trigger&&e.hide()}},e.el=ao().createElement("div"),e.el.className="pika-single"+(n.isRTL?" is-rtl":"")+(n.theme?" "+n.theme:""),gs(e.el,"mousedown",e._onMouseDown,!0),gs(e.el,"touchend",e._onMouseDown,!0),gs(e.el,"change",e._onChange),n.keyboardInput&&gs(ao(),"keydown",e._onKeyChange),n.field&&(n.container?n.container.appendChild(e.el):n.bound?ao().body.appendChild(e.el):n.field.parentNode.insertBefore(e.el,n.field.nextSibling),gs(n.field,"change",e._onInputChange),n.defaultDate||(n.defaultDate=e._parseFieldValue(),n.setDefaultDate=!0));let r=n.defaultDate;Wi(r)?n.setDefaultDate?e.setDate(r,!0):e.gotoDate(r):e.gotoDate(new Date),n.bound?(this.hide(),e.el.className+=" is-bound",gs(n.trigger,"click",e._onInputClick),gs(n.trigger,"focus",e._onInputFocus),gs(n.trigger,"blur",e._onInputBlur)):this.show()}LR.prototype={config:function(t){this._o||(this._o=Tp({},rs,!0));let e=Tp(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,Wi(e.minDate)||(e.minDate=!1),Wi(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),k0(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))||rs.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,Wi(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 Wi(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="",Dx(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!Wi(t))return;let n=this._o.minDate,r=this._o.maxDate;Wi(n)&&t<n?t=n:Wi(r)&&t>r&&(t=r),this._d=new Date(t.getTime()),Fg(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),Dx(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(Wi(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]=kx(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=kx({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?(Fg(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=rs.minDate,this._o.minYear=rs.minYear,this._o.minMonth=rs.minMonth,this._o.startRange=rs.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(Fg(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=rs.maxDate,this._o.maxYear=rs.maxYear,this._o.maxMonth=rs.maxMonth,this._o.endRange=rs.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">'+V4(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"&&kR(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=rl().innerWidth||ao().documentElement.clientWidth,i=rl().innerHeight||ao().documentElement.clientHeight,o=ao().body.scrollTop||ao().documentElement.scrollTop,u=!0,c=!0,l=t.getBoundingClientRect(),s=l.left+rl().pageXOffset,a=l.bottom+rl().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",xb(this.el,u?"left-aligned":"right-aligned"),xb(this.el,c?"bottom-aligned":"top-aligned"),Ab(this.el,u?"right-aligned":"left-aligned"),Ab(this.el,c?"top-aligned":"bottom-aligned"))},render:function(t,e,n){let r=this._o,i=new Date,o=Nx(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];Fg(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=Nx(h,u),g=o+s,C=g;for(;C>7;)C-=7;g+=7-C;let y=!1;for(let E=0,v=0;E<g;E++){let P=new Date(t,e,1+(E-s)),O=Wi(this._d)?Vg(P,this._d):!1,L=Vg(P,i),T=r.events.indexOf(P.toDateString())!==-1,A=E<s||E>=o+s,K=1+(E-s),U=e,j=t,Z=r.startRange&&Vg(r.startRange,P),J=r.endRange&&Vg(r.endRange,P),se=r.startRange&&r.endRange&&r.startRange<P&&P<r.endRange,te=r.minDate&&P<r.minDate||r.maxDate&&P>r.maxDate||r.disableWeekends&&A4(P)||r.disableDayFn&&r.disableDayFn(P);A&&(E<s?(K=f+K,U=u,j=h):(K=K-o,U=c,j=d));let ue={day:K,month:U,year:j,hasEvent:T,isSelected:O,isToday:L,isDisabled:te,isEmpty:A,isStartRange:Z,isEndRange:J,isInRange:se,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&O&&(y=!0),l.push(N4(ue)),++v===7&&(r.showWeekNumber&&l.unshift(k4(this,E-s,e,t,r.firstWeekOfYearMinDays)),a.push(L4(l,r.isRTL,r.pickWholeWeek,y)),l=[],v=0,y=!1)}return W4(r,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),Ab(this.el,"is-hidden"),this._o.bound&&(gs(ao(),"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&&js(ao(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),xb(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(),js(this.el,"mousedown",this._onMouseDown,!0),js(this.el,"touchend",this._onMouseDown,!0),js(this.el,"change",this._onChange),t.keyboardInput&&js(ao(),"keydown",this._onKeyChange),t.field&&(js(t.field,"change",this._onInputChange),t.bound&&(js(t.trigger,"click",this._onInputClick),js(t.trigger,"focus",this._onInputFocus),js(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function B4(t,e){j4(t,e),e.add(t)}function j4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $x(t,e,n){return(e=U4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function U4(t){var e=z4(t,"string");return typeof e=="symbol"?e:e+""}function z4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Hb(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 fk="date",Fx="dateEditor",Y4="DD/MM/YYYY";var Wg=new WeakSet;class gk extends ju{constructor(){super(...arguments),B4(this,Wg),$x(this,"parentDestroyed",!1),$x(this,"$datePicker",null)}static get EDITOR_TYPE(){return fk}init(){if(typeof X!="function")throw new Error("You need to include moment.js to your project.");if(typeof LR!="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||(pe(this.datePicker,/ht-theme-.*/g),G(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"),G(this.datePicker,"htDatepickerHolder");const e=this.hot.getCurrentThemeName();pe(this.datePicker,/ht-theme-.*/g),G(this.datePicker,e),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",n=>{ve(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:Fx})}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(Fx),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=Hb(Wg,this,Nb).call(this),r=this.hot.view.isMouseDown(),i=e?GN(e.keyCode):!1;let o;this.datePicker.style.display="block",this.$datePicker=new LR(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(X),this.$datePicker._onInputFocus=function(){},this.originalValue?(o=this.originalValue,X(o,n,!0).isValid()&&this.$datePicker.setMoment(X(o,n),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!i&&!r&&this.setValue("")):this.cellProperties.defaultDate?(o=this.cellProperties.defaultDate,X(o,n,!0).isValid()&&this.$datePicker.setMoment(X(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&&Tw(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:Hb(Wg,this,Nb).call(this),r.reposition=r.reposition||!1,r.isRTL=!1,r.onSelect=s=>{let a=s;isNaN(a.getTime())||(a=X(a).format(Hb(Wg,this,Nb).call(this))),this.setValue(a),i&&i(),ua()&&this.hideDatepicker()},r.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),o&&o()},r}refreshDimensions(e){var n;if(super.refreshDimensions(e),this.state!==Bt.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-Kt(this.datePicker):d+=h.left,this.datePickerStyle.left=`${d}px`}else this.hideDatepicker()}}function Nb(){var t;return(t=this.cellProperties.dateFormat)!==null&&t!==void 0?t:Y4}const G4="dropdown";class mk extends D0{static get EDITOR_TYPE(){return G4}prepare(e,n,r,i,o,s){s.filter=!1,s.strict=!0,super.prepare(e,n,r,i,o,s)}}const K4="numeric";class pk extends ju{static get EDITOR_TYPE(){return K4}}function q4(t,e,n){return(e=X4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function X4(t){var e=Z4(t,"string");return typeof e=="symbol"?e:e+""}function Z4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Q4="password";class wk extends ju{constructor(){super(...arguments),q4(this,"autoResize",JD(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}))}static get EDITOR_TYPE(){return Q4}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,va(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const Db="ht_editor_visible",Vx="selectEditor",J4="select";class vk extends vh{static get EDITOR_TYPE(){return J4}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(...Wu()),e.appendChild(this.hot.rootDocument.createTextNode("▼")),G(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",ve(this.selectWrapper,Db)&&pe(this.selectWrapper,Db),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),va(this.select),He(l,(u,c)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=c,ph(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!==Bt.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",G(this.selectWrapper,Db)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={group:Vx};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(Vx)}}const e9="time";class Ck extends ju{static get EDITOR_TYPE(){return e9}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.TEXTAREA.dir="ltr"}}function t9(){$i(vh),$i(D0),$i(dk),$i(gk),$i(mk),$i(N0),$i(pk),$i(wk),$i(vk),$i(ju),$i(Ck)}const n9="html";function L0(t,e,n,r,i,o,s){Gf.apply(this,[t,e,n,r,i,o,s]),ph(e,o??"",!1)}L0.RENDERER_TYPE=n9;const r9="autocomplete";function yh(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=s.allowHtml?L0:Pa,u=a.createElement("DIV"),c=t.getSettings().ariaTags;if(u.className="htAutocompleteArrow",c&&u.setAttribute(...Wu()),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),G(e,"htAutocomplete"),!t.acArrowListener){const h=new zo(t);t.acArrowListener=function(d){ve(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()})}}yh.RENDERER_TYPE=r9;const i9="dropdown";function $0(t,e,n,r,i,o,s){yh.apply(this,[t,e,n,r,i,o,s])}$0.RENDERER_TYPE=i9;const Wx=new WeakMap,Bx=new WeakMap,o9="htBadValue",ih="data-row",oh="data-col",s9="checkboxRenderer",yk="checkbox";re.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,n){const{label:r,type:i,row:o,column:s,prop:a}=e;if(i===yk){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 F0(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=t.getSettings().ariaTags;Gf.apply(this,[t,e,n,r,i,o,s]),a9(t);let u=l9(a);const c=s.label;let h=!1;if(typeof s.checkedTemplate>"u"&&(s.checkedTemplate=!0),typeof s.uncheckedTemplate>"u"&&(s.uncheckedTemplate=!1),va(e),o===s.checkedTemplate||Pt(o).toLocaleLowerCase(s.locale)===Pt(s.checkedTemplate).toLocaleLowerCase(s.locale)?u.checked=!0:o===s.uncheckedTemplate||Pt(o).toLocaleLowerCase(s.locale)===Pt(s.uncheckedTemplate).toLocaleLowerCase(s.locale)?u.checked=!1:Ut(o)?G(u,"noValue"):(u.style.display="none",G(u,o9),h=!0),ye(u,[[ih,n],[oh,r]]),l&&ye(u,[hf(u.checked?t.getTranslatedPhrase(Hw):t.getTranslatedPhrase(Nw)),IN(u.checked),LU()]),!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 E=t.getDataAtRowProp(n,c.property);C=E!==null?E:""}const y=u9(a,C,c.separated!==!0);c.position==="before"?c.separated?(e.appendChild(y),e.appendChild(u)):(y.appendChild(u),u=y):(!c.position||c.position==="after")&&(c.separated?(e.appendChild(u),e.appendChild(y)):(y.insertBefore(u,y.firstChild),u=y))}(!c||c&&!c.separated)&&e.appendChild(u),h&&e.appendChild(a.createTextNode("#bad-value#")),Wx.has(t)||(Wx.set(t,!0),d());function d(){const y=t.getShortcutManager().getContext("grid"),E={group:s9,relativeToGroup:Cl,position:"before"};y.addShortcuts([{keys:[["space"]],callback:()=>(f(),!g()),runOnlyIf:()=>{var v;return(v=t.getSelectedRangeLast())===null||v===void 0?void 0:v.highlight.isCell()}},{keys:[["enter"]],callback:()=>(f(),!g()),runOnlyIf:()=>{const v=t.getSelectedRangeLast();return t.getSettings().enterBeginsEditing&&(v==null?void 0:v.highlight.isCell())&&!t.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(f(!0),!g()),runOnlyIf:()=>{var v;return(v=t.getSelectedRangeLast())===null||v===void 0?void 0:v.highlight.isCell()}}],E)}function f(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const y=t.getSelectedRange(),E=[],v=new Map;let P=[],O=0;if(y){for(let L=0;L<y.length;L++){const{row:T,col:A}=y[L].getTopStartCorner(),{row:K,col:U}=y[L].getBottomEndCorner();for(let j=T;j<=K;j+=1)for(let Z=A;Z<=U;Z+=1){const J=t.getCellMeta(j,Z);if(J.hidden)continue;const se={checkedTemplate:J.checkedTemplate,uncheckedTemplate:J.uncheckedTemplate};if(J.type!=="checkbox"){C===!0&&!J.readOnly&&(v.has(E.length)?v.set(E.length,[...v.get(E.length),[j,Z,null]]):v.set(E.length,[[j,Z,null]]));continue}if(J.readOnly===!0)continue;typeof J.checkedTemplate>"u"&&(J.checkedTemplate=!0),typeof J.uncheckedTemplate>"u"&&(J.uncheckedTemplate=!1);const te=t.getDataAtCell(j,Z);C===!1?[J.checkedTemplate,J.checkedTemplate.toString()].includes(te)?P.push([j,Z,J.uncheckedTemplate,se]):[J.uncheckedTemplate,J.uncheckedTemplate.toString(),null,void 0].includes(te)&&P.push([j,Z,J.checkedTemplate,se]):P.push([j,Z,J.uncheckedTemplate,se]),O+=1}E.push(O),O=0}P.every(L=>{let[,,T]=L;return T===P[0][2]})?P=P.map(L=>{let[T,A,K]=L;return[T,A,K]}):P=P.map(L=>{let[T,A,,K]=L;return[T,A,K.checkedTemplate]}),P.length>0&&E.forEach((L,T)=>{let A=P.splice(0,L);v.size&&v.has(T)&&(A=[...A,...v.get(T)]),t.setDataAtCell(A)})}}function g(){const C=t.getSelectedRange();if(C){for(let y=0;y<C.length;y++){const E=C[y].getTopStartCorner(),v=C[y].getBottomEndCorner();for(let P=E.row;P<=v.row;P++)for(let O=E.col;O<=v.col;O++){if(t.getCellMeta(P,O).readOnly)continue;const T=t.getCell(P,O);if(pa(T)&&T.querySelectorAll("input[type=checkbox]").length>0)return!0}}return!1}}}F0.RENDERER_TYPE=yk;function a9(t){let e=Bx.get(t);if(!e){const{rootElement:n}=t;e=new zo(t),e.addEventListener(n,"click",r=>h9(r,t)),e.addEventListener(n,"mouseup",r=>c9(r,t)),e.addEventListener(n,"change",r=>d9(r,t)),Bx.set(t,e)}return e}function l9(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function u9(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 c9(t,e){const{target:n}=t;V0(n)&&(!n.hasAttribute(ih)||!n.hasAttribute(oh)||setTimeout(e.listen,10))}function h9(t,e){const{target:n}=t;if(!V0(n)||!n.hasAttribute(ih)||!n.hasAttribute(oh))return;const r=parseInt(n.getAttribute(ih),10),i=parseInt(n.getAttribute(oh),10);e.getCellMeta(r,i).readOnly&&t.preventDefault()}function d9(t,e){const{target:n}=t;if(!V0(n)||!n.hasAttribute(ih)||!n.hasAttribute(oh))return;const r=parseInt(n.getAttribute(ih),10),i=parseInt(n.getAttribute(oh),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 V0(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const f9="handsontable";function W0(t,e,n,r,i,o,s){yh.apply(this,[t,e,n,r,i,o,s])}W0.RENDERER_TYPE=f9;var g9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function m9(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 kb,jx;function p9(){return jx||(jx=1,kb={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}}}),kb}/*!
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 Lb,Ux;function bk(){if(Ux)return Lb;Ux=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,g){if(!isNaN(+l))return+l;let C="",y=l.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(y!==l)return-1*n(y,u,c,h,d,f);for(let T=0;T<t.length;T++){let A=t[T];if(C=l.replace(RegExp(`([0-9 ])(${A.key})$`),"$1"),C!==l)return n(C,u,c,h,d,f)*A.factor}if(C=l.replace("%",""),C!==l)return n(C,u,c,h,d,f)/100;let E=parseFloat(l);if(isNaN(E))return;let v=h(E);if(v&&v!=="."&&(C=l.replace(new RegExp(`${e(v)}$`),""),C!==l))return n(C,u,c,h,d,f);let P={};Object.keys(f).forEach(T=>{P[f[T]]=T});let O=Object.keys(P).sort().reverse(),L=O.length;for(let T=0;T<L;T++){let A=O[T],K=P[A];if(C=l.replace(A,""),C!==l){let U;switch(K){case"thousand":U=Math.pow(10,3);break;case"million":U=Math.pow(10,6);break;case"billion":U=Math.pow(10,9);break;case"trillion":U=Math.pow(10,12);break}return n(C,u,c,h,d,f)*U}}}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,g){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],g=+h[2];return!isNaN(d)&&!isNaN(f)&&!isNaN(g)}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=U0();let h=c.currentDelimiters(),d=c.currentCurrency().symbol,f=c.currentOrdinal(),g=c.getZeroFormat(),C=c.currentAbbreviations(),y;if(typeof l=="string")o(l,h)?y=s(l):y=i(l,h,d,f,g,C);else if(typeof l=="number")y=l;else return;if(y!==void 0)return y}return Lb={unformat:a},Lb}/*!
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 $b,zx;function B0(){if(zx)return $b;zx=1;let t=bk();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:(y,E)=>E.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:y=>y.output==="byte"},characteristic:{type:"number",restriction:y=>y>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:r},average:"boolean",lowPrecision:{type:"boolean",restriction:(y,E)=>E.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:i},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:y=>y>=0,message:"value must be positive"},{restriction:(y,E)=>!E.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:y=>y>=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:(y,E)=>E.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},c={languageTag:{type:"string",mandatory:!0,restriction:y=>y.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(y,E){let v=d(y),P=g(E);return v&&P}function d(y){return t.unformat(y)!==void 0}function f(y,E,v,P=!1){let O=Object.keys(y).map(L=>{if(!E[L])return console.error(`${v} Invalid key: ${L}`),!1;let T=y[L],A=E[L];if(typeof A=="string"&&(A={type:A}),A.type==="format"){if(!f(T,u,`[Validate ${L}]`,!0))return!1}else if(typeof T!==A.type)return console.error(`${v} ${L} type mismatched: "${A.type}" expected, "${typeof T}" provided`),!1;if(A.restrictions&&A.restrictions.length){let K=A.restrictions.length;for(let U=0;U<K;U++){let{restriction:j,message:Z}=A.restrictions[U];if(!j(T,y))return console.error(`${v} ${L} invalid value: ${Z}`),!1}}return A.restriction&&!A.restriction(T,y)?(console.error(`${v} ${L} invalid value: ${A.message}`),!1):A.validValues&&A.validValues.indexOf(T)===-1?(console.error(`${v} ${L} invalid value: must be among ${JSON.stringify(A.validValues)}, "${T}" provided`),!1):!(A.children&&!f(T,A.children,`[Validate ${L}]`))});return P||O.push(...Object.keys(E).map(L=>{let T=E[L];if(typeof T=="string"&&(T={type:T}),T.mandatory){let A=T.mandatory;if(typeof A=="function"&&(A=A(y)),A&&y[L]===void 0)return console.error(`${v} Missing mandatory key "${L}"`),!1}return!0})),O.reduce((L,T)=>L&&T,!0)}function g(y){return f(y,u,"[Validate format]")}function C(y){return f(y,c,"[Validate language]")}return $b={validate:h,validateFormat:g,validateInput:d,validateLanguage:C},$b}/*!
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 w9(t,e){let n=t.match(/^{([^}]*)}/);return n?(e.prefix=n[1],t.slice(n[0].length)):t}function v9(t,e){let n=t.match(/{([^}]*)}$/);return n?(e.postfix=n[1],t.slice(0,-n[0].length)):t}function C9(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 y9(t,e){t.indexOf(",")!==-1&&(e.thousandSeparated=!0)}function b9(t,e){t.indexOf(" ")!==-1&&(e.spaceSeparated=!0,e.spaceSeparatedCurrency=!0,(e.average||e.forceAverage)&&(e.spaceSeparatedAbbreviation=!0))}function S9(t,e){let n=t.match(/[1-9]+[0-9]*/);n&&(e.totalLength=+n[0])}function R9(t,e){let r=t.split(".")[0].match(/0+/);r&&(e.characteristic=r[0].length)}function E9(t,e){let n=t.split(".")[1];if(n){let r=n.match(/0+/);r&&(e.mantissa=r[0].length)}}function T9(t,e){const n=t.split(".")[1];n&&(e.trimMantissa=n.indexOf("[")!==-1)}function _9(t,e){t.indexOf("a")!==-1&&(e.average=!0)}function M9(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 I9(t,e){t.match(/\[\.]/)?e.optionalMantissa=!0:t.match(/\./)&&(e.optionalMantissa=!1)}function P9(t,e){if(t.indexOf(".")!==-1){let n=t.split(".")[0];e.optionalCharacteristic=n.indexOf("0")===-1}}function O9(t,e){t.match(/^\+?\([^)]*\)$/)&&(e.negative="parenthesis"),t.match(/^\+?-/)&&(e.negative="sign")}function x9(t,e){t.match(/^\+/)&&(e.forceSign=!0)}function A9(t,e={}){return typeof t!="string"?t:(t=w9(t,e),t=v9(t,e),C9(t,e),S9(t,e),R9(t,e),P9(t,e),_9(t,e),M9(t,e),E9(t,e),I9(t,e),T9(t,e),y9(t,e),b9(t,e),O9(t,e),x9(t,e),e)}var j0={parseFormat:A9};/*!
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 Fb,Yx;function U0(){if(Yx)return Fb;Yx=1;const t=p9(),e=B0(),n=j0;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(g=>g.split("-")[0]===d);if(!o[f]){l(h);return}l(f);return}l(c)},r.registerLanguage(t),i=t.languageTag,Fb=r,Fb}function H9(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 N9(t,e){t.forEach(n=>{let r;try{r=H9(`../languages/${n}`)}catch{console.error(`Unable to load "${n}". No matching language file found.`)}r&&e.registerLanguage(r)})}var D9=t=>({loadLanguagesInNode:e=>N9(e,t)}),Sk={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 g(T){var A,K,U,j=p.prototype={constructor:p,toString:null,valueOf:null},Z=new p(1),J=20,se=4,te=-7,ue=21,pt=-1e7,be=1e7,ke=!1,wt=1,fn=0,et={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},m="0123456789abcdefghijklmnopqrstuvwxyz",w=!0;function p(b,R){var S,k,_,H,W,x,N,V,F=this;if(!(F instanceof p))return new p(b,R);if(R==null){if(b&&b._isBigNumber===!0){F.s=b.s,!b.c||b.e>be?F.c=F.e=null:b.e<pt?F.c=[F.e=0]:(F.e=b.e,F.c=b.c.slice());return}if((x=typeof b=="number")&&b*0==0){if(F.s=1/b<0?(b=-b,-1):1,b===~~b){for(H=0,W=b;W>=10;W/=10,H++);H>be?F.c=F.e=null:(F.e=H,F.c=[b]);return}V=String(b)}else{if(!r.test(V=String(b)))return U(F,V,x);F.s=V.charCodeAt(0)==45?(V=V.slice(1),-1):1}(H=V.indexOf("."))>-1&&(V=V.replace(".","")),(W=V.search(/e/i))>0?(H<0&&(H=W),H+=+V.slice(W+1),V=V.substring(0,W)):H<0&&(H=V.length)}else{if(v(R,2,m.length,"Base"),R==10&&w)return F=new p(b),Y(F,J+F.e+1,se);if(V=String(b),x=typeof b=="number"){if(b*0!=0)return U(F,V,x,R);if(F.s=1/b<0?(V=V.slice(1),-1):1,p.DEBUG&&V.replace(/^0\.0*|\./,"").length>15)throw Error(a+b)}else F.s=V.charCodeAt(0)===45?(V=V.slice(1),-1):1;for(S=m.slice(0,R),H=W=0,N=V.length;W<N;W++)if(S.indexOf(k=V.charAt(W))<0){if(k=="."){if(W>H){H=N;continue}}else if(!_&&(V==V.toUpperCase()&&(V=V.toLowerCase())||V==V.toLowerCase()&&(V=V.toUpperCase()))){_=!0,W=-1,H=0;continue}return U(F,String(b),x,R)}x=!1,V=K(V,R,10,F.s),(H=V.indexOf("."))>-1?V=V.replace(".",""):H=V.length}for(W=0;V.charCodeAt(W)===48;W++);for(N=V.length;V.charCodeAt(--N)===48;);if(V=V.slice(W,++N)){if(N-=W,x&&p.DEBUG&&N>15&&(b>c||b!==o(b)))throw Error(a+F.s*b);if((H=H-W-1)>be)F.c=F.e=null;else if(H<pt)F.c=[F.e=0];else{if(F.e=H,F.c=[],W=(H+1)%u,H<0&&(W+=u),W<N){for(W&&F.c.push(+V.slice(0,W)),N-=u;W<N;)F.c.push(+V.slice(W,W+=u));W=u-(V=V.slice(W)).length}else W-=N;for(;W--;V+="0");F.c.push(+V)}}else F.c=[F.e=0]}p.clone=g,p.ROUND_UP=0,p.ROUND_DOWN=1,p.ROUND_CEIL=2,p.ROUND_FLOOR=3,p.ROUND_HALF_UP=4,p.ROUND_HALF_DOWN=5,p.ROUND_HALF_EVEN=6,p.ROUND_HALF_CEIL=7,p.ROUND_HALF_FLOOR=8,p.EUCLID=9,p.config=p.set=function(b){var R,S;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(R="DECIMAL_PLACES")&&(S=b[R],v(S,0,f,R),J=S),b.hasOwnProperty(R="ROUNDING_MODE")&&(S=b[R],v(S,0,8,R),se=S),b.hasOwnProperty(R="EXPONENTIAL_AT")&&(S=b[R],S&&S.pop?(v(S[0],-1e9,0,R),v(S[1],0,f,R),te=S[0],ue=S[1]):(v(S,-1e9,f,R),te=-(ue=S<0?-S:S))),b.hasOwnProperty(R="RANGE"))if(S=b[R],S&&S.pop)v(S[0],-1e9,-1,R),v(S[1],1,f,R),pt=S[0],be=S[1];else if(v(S,-1e9,f,R),S)pt=-(be=S<0?-S:S);else throw Error(s+R+" cannot be zero: "+S);if(b.hasOwnProperty(R="CRYPTO"))if(S=b[R],S===!!S)if(S)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ke=S;else throw ke=!S,Error(s+"crypto unavailable");else ke=S;else throw Error(s+R+" not true or false: "+S);if(b.hasOwnProperty(R="MODULO_MODE")&&(S=b[R],v(S,0,9,R),wt=S),b.hasOwnProperty(R="POW_PRECISION")&&(S=b[R],v(S,0,f,R),fn=S),b.hasOwnProperty(R="FORMAT"))if(S=b[R],typeof S=="object")et=S;else throw Error(s+R+" not an object: "+S);if(b.hasOwnProperty(R="ALPHABET"))if(S=b[R],typeof S=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(S))w=S.slice(0,10)=="0123456789",m=S;else throw Error(s+R+" invalid: "+S)}else throw Error(s+"Object expected: "+b);return{DECIMAL_PLACES:J,ROUNDING_MODE:se,EXPONENTIAL_AT:[te,ue],RANGE:[pt,be],CRYPTO:ke,MODULO_MODE:wt,POW_PRECISION:fn,FORMAT:et,ALPHABET:m}},p.isBigNumber=function(b){if(!b||b._isBigNumber!==!0)return!1;if(!p.DEBUG)return!0;var R,S,k=b.c,_=b.e,H=b.s;e:if({}.toString.call(k)=="[object Array]"){if((H===1||H===-1)&&_>=-1e9&&_<=f&&_===o(_)){if(k[0]===0){if(_===0&&k.length===1)return!0;break e}if(R=(_+1)%u,R<1&&(R+=u),String(k[0]).length==R){for(R=0;R<k.length;R++)if(S=k[R],S<0||S>=l||S!==o(S))break e;if(S!==0)return!0}}}else if(k===null&&_===null&&(H===null||H===1||H===-1))return!0;throw Error(s+"Invalid BigNumber: "+b)},p.maximum=p.max=function(){return $(arguments,-1)},p.minimum=p.min=function(){return $(arguments,1)},p.random=function(){var b=9007199254740992,R=Math.random()*b&2097151?function(){return o(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(S){var k,_,H,W,x,N=0,V=[],F=new p(Z);if(S==null?S=J:v(S,0,f),W=i(S/u),ke)if(crypto.getRandomValues){for(k=crypto.getRandomValues(new Uint32Array(W*=2));N<W;)x=k[N]*131072+(k[N+1]>>>11),x>=9e15?(_=crypto.getRandomValues(new Uint32Array(2)),k[N]=_[0],k[N+1]=_[1]):(V.push(x%1e14),N+=2);N=W/2}else if(crypto.randomBytes){for(k=crypto.randomBytes(W*=7);N<W;)x=(k[N]&31)*281474976710656+k[N+1]*1099511627776+k[N+2]*4294967296+k[N+3]*16777216+(k[N+4]<<16)+(k[N+5]<<8)+k[N+6],x>=9e15?crypto.randomBytes(7).copy(k,N):(V.push(x%1e14),N+=7);N=W/7}else throw ke=!1,Error(s+"crypto unavailable");if(!ke)for(;N<W;)x=R(),x<9e15&&(V[N++]=x%1e14);for(W=V[--N],S%=u,W&&S&&(x=h[u-S],V[N]=o(W/x)*x);V[N]===0;V.pop(),N--);if(N<0)V=[H=0];else{for(H=-1;V[0]===0;V.splice(0,1),H-=u);for(N=1,x=V[0];x>=10;x/=10,N++);N<u&&(H-=u-N)}return F.e=H,F.c=V,F}}(),p.sum=function(){for(var b=1,R=arguments,S=new p(R[0]);b<R.length;)S=S.plus(R[b++]);return S},K=function(){var b="0123456789";function R(S,k,_,H){for(var W,x=[0],N,V=0,F=S.length;V<F;){for(N=x.length;N--;x[N]*=k);for(x[0]+=H.indexOf(S.charAt(V++)),W=0;W<x.length;W++)x[W]>_-1&&(x[W+1]==null&&(x[W+1]=0),x[W+1]+=x[W]/_|0,x[W]%=_)}return x.reverse()}return function(S,k,_,H,W){var x,N,V,F,z,oe,ce,Re,Ne=S.indexOf("."),We=J,Se=se;for(Ne>=0&&(F=fn,fn=0,S=S.replace(".",""),Re=new p(k),oe=Re.pow(S.length-Ne),fn=F,Re.c=R(L(y(oe.c),oe.e,"0"),10,_,b),Re.e=Re.c.length),ce=R(S,k,_,W?(x=m,b):(x=b,m)),V=F=ce.length;ce[--F]==0;ce.pop());if(!ce[0])return x.charAt(0);if(Ne<0?--V:(oe.c=ce,oe.e=V,oe.s=H,oe=A(oe,Re,We,Se,_),ce=oe.c,z=oe.r,V=oe.e),N=V+We+1,Ne=ce[N],F=_/2,z=z||N<0||ce[N+1]!=null,z=Se<4?(Ne!=null||z)&&(Se==0||Se==(oe.s<0?3:2)):Ne>F||Ne==F&&(Se==4||z||Se==6&&ce[N-1]&1||Se==(oe.s<0?8:7)),N<1||!ce[0])S=z?L(x.charAt(1),-We,x.charAt(0)):x.charAt(0);else{if(ce.length=N,z)for(--_;++ce[--N]>_;)ce[N]=0,N||(++V,ce=[1].concat(ce));for(F=ce.length;!ce[--F];);for(Ne=0,S="";Ne<=F;S+=x.charAt(ce[Ne++]));S=L(S,V,x.charAt(0))}return S}}(),A=function(){function b(k,_,H){var W,x,N,V,F=0,z=k.length,oe=_%d,ce=_/d|0;for(k=k.slice();z--;)N=k[z]%d,V=k[z]/d|0,W=ce*N+V*oe,x=oe*N+W%d*d+F,F=(x/H|0)+(W/d|0)+ce*V,k[z]=x%H;return F&&(k=[F].concat(k)),k}function R(k,_,H,W){var x,N;if(H!=W)N=H>W?1:-1;else for(x=N=0;x<H;x++)if(k[x]!=_[x]){N=k[x]>_[x]?1:-1;break}return N}function S(k,_,H,W){for(var x=0;H--;)k[H]-=x,x=k[H]<_[H]?1:0,k[H]=x*W+k[H]-_[H];for(;!k[0]&&k.length>1;k.splice(0,1));}return function(k,_,H,W,x){var N,V,F,z,oe,ce,Re,Ne,We,Se,Le,vt,yo,Ns,Ki,Ct,Zt,ft=k.s==_.s?1:-1,yt=k.c,$e=_.c;if(!yt||!yt[0]||!$e||!$e[0])return new p(!k.s||!_.s||(yt?$e&&yt[0]==$e[0]:!$e)?NaN:yt&&yt[0]==0||!$e?ft*0:ft/0);for(Ne=new p(ft),We=Ne.c=[],V=k.e-_.e,ft=H+V+1,x||(x=l,V=C(k.e/u)-C(_.e/u),ft=ft/u|0),F=0;$e[F]==(yt[F]||0);F++);if($e[F]>(yt[F]||0)&&V--,ft<0)We.push(1),z=!0;else{for(Ns=yt.length,Ct=$e.length,F=0,ft+=2,oe=o(x/($e[0]+1)),oe>1&&($e=b($e,oe,x),yt=b(yt,oe,x),Ct=$e.length,Ns=yt.length),yo=Ct,Se=yt.slice(0,Ct),Le=Se.length;Le<Ct;Se[Le++]=0);Zt=$e.slice(),Zt=[0].concat(Zt),Ki=$e[0],$e[1]>=x/2&&Ki++;do{if(oe=0,N=R($e,Se,Ct,Le),N<0){if(vt=Se[0],Ct!=Le&&(vt=vt*x+(Se[1]||0)),oe=o(vt/Ki),oe>1)for(oe>=x&&(oe=x-1),ce=b($e,oe,x),Re=ce.length,Le=Se.length;R(ce,Se,Re,Le)==1;)oe--,S(ce,Ct<Re?Zt:$e,Re,x),Re=ce.length,N=1;else oe==0&&(N=oe=1),ce=$e.slice(),Re=ce.length;if(Re<Le&&(ce=[0].concat(ce)),S(Se,ce,Le,x),Le=Se.length,N==-1)for(;R($e,Se,Ct,Le)<1;)oe++,S(Se,Ct<Le?Zt:$e,Le,x),Le=Se.length}else N===0&&(oe++,Se=[0]);We[F++]=oe,Se[0]?Se[Le++]=yt[yo]||0:(Se=[yt[yo]],Le=1)}while((yo++<Ns||Se[0]!=null)&&ft--);z=Se[0]!=null,We[0]||We.splice(0,1)}if(x==l){for(F=1,ft=We[0];ft>=10;ft/=10,F++);Y(Ne,H+(Ne.e=F+V*u-1)+1,W,z)}else Ne.e=V,Ne.r=+z;return Ne}}();function I(b,R,S,k){var _,H,W,x,N;if(S==null?S=se:v(S,0,8),!b.c)return b.toString();if(_=b.c[0],W=b.e,R==null)N=y(b.c),N=k==1||k==2&&(W<=te||W>=ue)?O(N,W):L(N,W,"0");else if(b=Y(new p(b),R,S),H=b.e,N=y(b.c),x=N.length,k==1||k==2&&(R<=H||H<=te)){for(;x<R;N+="0",x++);N=O(N,H)}else if(R-=W,N=L(N,H,"0"),H+1>x){if(--R>0)for(N+=".";R--;N+="0");}else if(R+=H-x,R>0)for(H+1==x&&(N+=".");R--;N+="0");return b.s<0&&_?"-"+N:N}function $(b,R){for(var S,k,_=1,H=new p(b[0]);_<b.length;_++)k=new p(b[_]),(!k.s||(S=E(H,k))===R||S===0&&H.s===R)&&(H=k);return H}function B(b,R,S){for(var k=1,_=R.length;!R[--_];R.pop());for(_=R[0];_>=10;_/=10,k++);return(S=k+S*u-1)>be?b.c=b.e=null:S<pt?b.c=[b.e=0]:(b.e=S,b.c=R),b}U=function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,R=/^([^.]+)\.$/,S=/^\.([^.]+)$/,k=/^-?(Infinity|NaN)$/,_=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(H,W,x,N){var V,F=x?W:W.replace(_,"");if(k.test(F))H.s=isNaN(F)?null:F<0?-1:1;else{if(!x&&(F=F.replace(b,function(z,oe,ce){return V=(ce=ce.toLowerCase())=="x"?16:ce=="b"?2:8,!N||N==V?oe:z}),N&&(V=N,F=F.replace(R,"$1").replace(S,"0.$1")),W!=F))return new p(F,V);if(p.DEBUG)throw Error(s+"Not a"+(N?" base "+N:"")+" number: "+W);H.s=null}H.c=H.e=null}}();function Y(b,R,S,k){var _,H,W,x,N,V,F,z=b.c,oe=h;if(z){e:{for(_=1,x=z[0];x>=10;x/=10,_++);if(H=R-_,H<0)H+=u,W=R,N=z[V=0],F=o(N/oe[_-W-1]%10);else if(V=i((H+1)/u),V>=z.length)if(k){for(;z.length<=V;z.push(0));N=F=0,_=1,H%=u,W=H-u+1}else break e;else{for(N=x=z[V],_=1;x>=10;x/=10,_++);H%=u,W=H-u+_,F=W<0?0:o(N/oe[_-W-1]%10)}if(k=k||R<0||z[V+1]!=null||(W<0?N:N%oe[_-W-1]),k=S<4?(F||k)&&(S==0||S==(b.s<0?3:2)):F>5||F==5&&(S==4||k||S==6&&(H>0?W>0?N/oe[_-W]:0:z[V-1])%10&1||S==(b.s<0?8:7)),R<1||!z[0])return z.length=0,k?(R-=b.e+1,z[0]=oe[(u-R%u)%u],b.e=-R||0):z[0]=b.e=0,b;if(H==0?(z.length=V,x=1,V--):(z.length=V+1,x=oe[u-H],z[V]=W>0?o(N/oe[_-W]%oe[W])*x:0),k)for(;;)if(V==0){for(H=1,W=z[0];W>=10;W/=10,H++);for(W=z[0]+=x,x=1;W>=10;W/=10,x++);H!=x&&(b.e++,z[0]==l&&(z[0]=1));break}else{if(z[V]+=x,z[V]!=l)break;z[V--]=0,x=1}for(H=z.length;z[--H]===0;z.pop());}b.e>be?b.c=b.e=null:b.e<pt&&(b.c=[b.e=0])}return b}function q(b){var R,S=b.e;return S===null?b.toString():(R=y(b.c),R=S<=te||S>=ue?O(R,S):L(R,S,"0"),b.s<0?"-"+R:R)}return j.absoluteValue=j.abs=function(){var b=new p(this);return b.s<0&&(b.s=1),b},j.comparedTo=function(b,R){return E(this,new p(b,R))},j.decimalPlaces=j.dp=function(b,R){var S,k,_,H=this;if(b!=null)return v(b,0,f),R==null?R=se:v(R,0,8),Y(new p(H),b+H.e+1,R);if(!(S=H.c))return null;if(k=((_=S.length-1)-C(this.e/u))*u,_=S[_])for(;_%10==0;_/=10,k--);return k<0&&(k=0),k},j.dividedBy=j.div=function(b,R){return A(this,new p(b,R),J,se)},j.dividedToIntegerBy=j.idiv=function(b,R){return A(this,new p(b,R),0,1)},j.exponentiatedBy=j.pow=function(b,R){var S,k,_,H,W,x,N,V,F,z=this;if(b=new p(b),b.c&&!b.isInteger())throw Error(s+"Exponent not an integer: "+q(b));if(R!=null&&(R=new p(R)),x=b.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!b.c||!b.c[0])return F=new p(Math.pow(+q(z),x?b.s*(2-P(b)):+q(b))),R?F.mod(R):F;if(N=b.s<0,R){if(R.c?!R.c[0]:!R.s)return new p(NaN);k=!N&&z.isInteger()&&R.isInteger(),k&&(z=z.mod(R))}else{if(b.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||x&&z.c[1]>=24e7:z.c[0]<8e13||x&&z.c[0]<=9999975e7)))return H=z.s<0&&P(b)?-0:0,z.e>-1&&(H=1/H),new p(N?1/H:H);fn&&(H=i(fn/u+2))}for(x?(S=new p(.5),N&&(b.s=1),V=P(b)):(_=Math.abs(+q(b)),V=_%2),F=new p(Z);;){if(V){if(F=F.times(z),!F.c)break;H?F.c.length>H&&(F.c.length=H):k&&(F=F.mod(R))}if(_){if(_=o(_/2),_===0)break;V=_%2}else if(b=b.times(S),Y(b,b.e+1,1),b.e>14)V=P(b);else{if(_=+q(b),_===0)break;V=_%2}z=z.times(z),H?z.c&&z.c.length>H&&(z.c.length=H):k&&(z=z.mod(R))}return k?F:(N&&(F=Z.div(F)),R?F.mod(R):H?Y(F,fn,se,W):F)},j.integerValue=function(b){var R=new p(this);return b==null?b=se:v(b,0,8),Y(R,R.e+1,b)},j.isEqualTo=j.eq=function(b,R){return E(this,new p(b,R))===0},j.isFinite=function(){return!!this.c},j.isGreaterThan=j.gt=function(b,R){return E(this,new p(b,R))>0},j.isGreaterThanOrEqualTo=j.gte=function(b,R){return(R=E(this,new p(b,R)))===1||R===0},j.isInteger=function(){return!!this.c&&C(this.e/u)>this.c.length-2},j.isLessThan=j.lt=function(b,R){return E(this,new p(b,R))<0},j.isLessThanOrEqualTo=j.lte=function(b,R){return(R=E(this,new p(b,R)))===-1||R===0},j.isNaN=function(){return!this.s},j.isNegative=function(){return this.s<0},j.isPositive=function(){return this.s>0},j.isZero=function(){return!!this.c&&this.c[0]==0},j.minus=function(b,R){var S,k,_,H,W=this,x=W.s;if(b=new p(b,R),R=b.s,!x||!R)return new p(NaN);if(x!=R)return b.s=-R,W.plus(b);var N=W.e/u,V=b.e/u,F=W.c,z=b.c;if(!N||!V){if(!F||!z)return F?(b.s=-R,b):new p(z?W:NaN);if(!F[0]||!z[0])return z[0]?(b.s=-R,b):new p(F[0]?W:se==3?-0:0)}if(N=C(N),V=C(V),F=F.slice(),x=N-V){for((H=x<0)?(x=-x,_=F):(V=N,_=z),_.reverse(),R=x;R--;_.push(0));_.reverse()}else for(k=(H=(x=F.length)<(R=z.length))?x:R,x=R=0;R<k;R++)if(F[R]!=z[R]){H=F[R]<z[R];break}if(H&&(_=F,F=z,z=_,b.s=-b.s),R=(k=z.length)-(S=F.length),R>0)for(;R--;F[S++]=0);for(R=l-1;k>x;){if(F[--k]<z[k]){for(S=k;S&&!F[--S];F[S]=R);--F[S],F[k]+=l}F[k]-=z[k]}for(;F[0]==0;F.splice(0,1),--V);return F[0]?B(b,F,V):(b.s=se==3?-1:1,b.c=[b.e=0],b)},j.modulo=j.mod=function(b,R){var S,k,_=this;return b=new p(b,R),!_.c||!b.s||b.c&&!b.c[0]?new p(NaN):!b.c||_.c&&!_.c[0]?new p(_):(wt==9?(k=b.s,b.s=1,S=A(_,b,0,3),b.s=k,S.s*=k):S=A(_,b,0,wt),b=_.minus(S.times(b)),!b.c[0]&&wt==1&&(b.s=_.s),b)},j.multipliedBy=j.times=function(b,R){var S,k,_,H,W,x,N,V,F,z,oe,ce,Re,Ne,We,Se=this,Le=Se.c,vt=(b=new p(b,R)).c;if(!Le||!vt||!Le[0]||!vt[0])return!Se.s||!b.s||Le&&!Le[0]&&!vt||vt&&!vt[0]&&!Le?b.c=b.e=b.s=null:(b.s*=Se.s,!Le||!vt?b.c=b.e=null:(b.c=[0],b.e=0)),b;for(k=C(Se.e/u)+C(b.e/u),b.s*=Se.s,N=Le.length,z=vt.length,N<z&&(Re=Le,Le=vt,vt=Re,_=N,N=z,z=_),_=N+z,Re=[];_--;Re.push(0));for(Ne=l,We=d,_=z;--_>=0;){for(S=0,oe=vt[_]%We,ce=vt[_]/We|0,W=N,H=_+W;H>_;)V=Le[--W]%We,F=Le[W]/We|0,x=ce*V+F*oe,V=oe*V+x%We*We+Re[H]+S,S=(V/Ne|0)+(x/We|0)+ce*F,Re[H--]=V%Ne;Re[H]=S}return S?++k:Re.splice(0,1),B(b,Re,k)},j.negated=function(){var b=new p(this);return b.s=-b.s||null,b},j.plus=function(b,R){var S,k=this,_=k.s;if(b=new p(b,R),R=b.s,!_||!R)return new p(NaN);if(_!=R)return b.s=-R,k.minus(b);var H=k.e/u,W=b.e/u,x=k.c,N=b.c;if(!H||!W){if(!x||!N)return new p(_/0);if(!x[0]||!N[0])return N[0]?b:new p(x[0]?k:_*0)}if(H=C(H),W=C(W),x=x.slice(),_=H-W){for(_>0?(W=H,S=N):(_=-_,S=x),S.reverse();_--;S.push(0));S.reverse()}for(_=x.length,R=N.length,_-R<0&&(S=N,N=x,x=S,R=_),_=0;R;)_=(x[--R]=x[R]+N[R]+_)/l|0,x[R]=l===x[R]?0:x[R]%l;return _&&(x=[_].concat(x),++W),B(b,x,W)},j.precision=j.sd=function(b,R){var S,k,_,H=this;if(b!=null&&b!==!!b)return v(b,1,f),R==null?R=se:v(R,0,8),Y(new p(H),b,R);if(!(S=H.c))return null;if(_=S.length-1,k=_*u+1,_=S[_]){for(;_%10==0;_/=10,k--);for(_=S[0];_>=10;_/=10,k++);}return b&&H.e+1>k&&(k=H.e+1),k},j.shiftedBy=function(b){return v(b,-9007199254740991,c),this.times("1e"+b)},j.squareRoot=j.sqrt=function(){var b,R,S,k,_,H=this,W=H.c,x=H.s,N=H.e,V=J+4,F=new p("0.5");if(x!==1||!W||!W[0])return new p(!x||x<0&&(!W||W[0])?NaN:W?H:1/0);if(x=Math.sqrt(+q(H)),x==0||x==1/0?(R=y(W),(R.length+N)%2==0&&(R+="0"),x=Math.sqrt(+R),N=C((N+1)/2)-(N<0||N%2),x==1/0?R="5e"+N:(R=x.toExponential(),R=R.slice(0,R.indexOf("e")+1)+N),S=new p(R)):S=new p(x+""),S.c[0]){for(N=S.e,x=N+V,x<3&&(x=0);;)if(_=S,S=F.times(_.plus(A(H,_,V,1))),y(_.c).slice(0,x)===(R=y(S.c)).slice(0,x))if(S.e<N&&--x,R=R.slice(x-3,x+1),R=="9999"||!k&&R=="4999"){if(!k&&(Y(_,_.e+J+2,0),_.times(_).eq(H))){S=_;break}V+=4,x+=4,k=1}else{(!+R||!+R.slice(1)&&R.charAt(0)=="5")&&(Y(S,S.e+J+2,1),b=!S.times(S).eq(H));break}}return Y(S,S.e+J+1,se,b)},j.toExponential=function(b,R){return b!=null&&(v(b,0,f),b++),I(this,b,R,1)},j.toFixed=function(b,R){return b!=null&&(v(b,0,f),b=b+this.e+1),I(this,b,R)},j.toFormat=function(b,R,S){var k,_=this;if(S==null)b!=null&&R&&typeof R=="object"?(S=R,R=null):b&&typeof b=="object"?(S=b,b=R=null):S=et;else if(typeof S!="object")throw Error(s+"Argument not an object: "+S);if(k=_.toFixed(b,R),_.c){var H,W=k.split("."),x=+S.groupSize,N=+S.secondaryGroupSize,V=S.groupSeparator||"",F=W[0],z=W[1],oe=_.s<0,ce=oe?F.slice(1):F,Re=ce.length;if(N&&(H=x,x=N,N=H,Re-=H),x>0&&Re>0){for(H=Re%x||x,F=ce.substr(0,H);H<Re;H+=x)F+=V+ce.substr(H,x);N>0&&(F+=V+ce.slice(H)),oe&&(F="-"+F)}k=z?F+(S.decimalSeparator||"")+((N=+S.fractionGroupSize)?z.replace(new RegExp("\\d{"+N+"}\\B","g"),"$&"+(S.fractionGroupSeparator||"")):z):F}return(S.prefix||"")+k+(S.suffix||"")},j.toFraction=function(b){var R,S,k,_,H,W,x,N,V,F,z,oe,ce=this,Re=ce.c;if(b!=null&&(x=new p(b),!x.isInteger()&&(x.c||x.s!==1)||x.lt(Z)))throw Error(s+"Argument "+(x.isInteger()?"out of range: ":"not an integer: ")+q(x));if(!Re)return new p(ce);for(R=new p(Z),V=S=new p(Z),k=N=new p(Z),oe=y(Re),H=R.e=oe.length-ce.e-1,R.c[0]=h[(W=H%u)<0?u+W:W],b=!b||x.comparedTo(R)>0?H>0?R:V:x,W=be,be=1/0,x=new p(oe),N.c[0]=0;F=A(x,R,0,1),_=S.plus(F.times(k)),_.comparedTo(b)!=1;)S=k,k=_,V=N.plus(F.times(_=V)),N=_,R=x.minus(F.times(_=R)),x=_;return _=A(b.minus(S),k,0,1),N=N.plus(_.times(V)),S=S.plus(_.times(k)),N.s=V.s=ce.s,H=H*2,z=A(V,k,H,se).minus(ce).abs().comparedTo(A(N,S,H,se).minus(ce).abs())<1?[V,k]:[N,S],be=W,z},j.toNumber=function(){return+q(this)},j.toPrecision=function(b,R){return b!=null&&v(b,1,f),I(this,b,R,2)},j.toString=function(b){var R,S=this,k=S.s,_=S.e;return _===null?k?(R="Infinity",k<0&&(R="-"+R)):R="NaN":(b==null?R=_<=te||_>=ue?O(y(S.c),_):L(y(S.c),_,"0"):b===10&&w?(S=Y(new p(S),J+_+1,se),R=L(y(S.c),S.e,"0")):(v(b,2,m.length,"Base"),R=K(L(y(S.c),_,"0"),10,b,k,!0)),k<0&&S.c[0]&&(R="-"+R)),R},j.valueOf=j.toJSON=function(){return q(this)},j._isBigNumber=!0,T!=null&&p.set(T),p}function C(T){var A=T|0;return T>0||T===A?A:A-1}function y(T){for(var A,K,U=1,j=T.length,Z=T[0]+"";U<j;){for(A=T[U++]+"",K=u-A.length;K--;A="0"+A);Z+=A}for(j=Z.length;Z.charCodeAt(--j)===48;);return Z.slice(0,j+1||1)}function E(T,A){var K,U,j=T.c,Z=A.c,J=T.s,se=A.s,te=T.e,ue=A.e;if(!J||!se)return null;if(K=j&&!j[0],U=Z&&!Z[0],K||U)return K?U?0:-se:J;if(J!=se)return J;if(K=J<0,U=te==ue,!j||!Z)return U?0:!j^K?1:-1;if(!U)return te>ue^K?1:-1;for(se=(te=j.length)<(ue=Z.length)?te:ue,J=0;J<se;J++)if(j[J]!=Z[J])return j[J]>Z[J]^K?1:-1;return te==ue?0:te>ue^K?1:-1}function v(T,A,K,U){if(T<A||T>K||T!==o(T))throw Error(s+(U||"Argument")+(typeof T=="number"?T<A||T>K?" out of range: ":" not an integer: ":" not a primitive number: ")+String(T))}function P(T){var A=T.c.length-1;return C(T.e/u)==A&&T.c[A]%2!=0}function O(T,A){return(T.length>1?T.charAt(0)+"."+T.slice(1):T)+(A<0?"e":"e+")+A}function L(T,A,K){var U,j;if(A<0){for(j=K+".";++A;j+=K);T=j+T}else if(U=T.length,++A>U){for(j=K,A-=U;--A;j+=K);T+=j}else A<U&&(T=T.slice(0,A)+"."+T.slice(A));return T}n=g(),n.default=n.BigNumber=n,t.exports?t.exports=n:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=n)})(g9)})(Sk);var Rk=Sk.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 Ao=U0(),k9=B0(),L9=j0,$9=Rk,bn={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},Kf={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:Ek,decimalSuffixes:_p}=Ao.currentBytes(),z0={general:{scale:1024,suffixes:_p},binary:{scale:1024,suffixes:Ek},decimal:{scale:1e3,suffixes:_p}};function F9(t,e={},n){if(typeof e=="string"&&(e=L9.parseFormat(e)),!k9.validateFormat(e))return"ERROR: invalid format";let i=e.prefix||"",o=e.postfix||"",s=V9(t,e,n);return s=o6(s,i),s=s6(s,o),s}function V9(t,e,n){switch(e.output){case"currency":return e=Ac(e,Ao.currentCurrencyDefaultFormat()),K9(t,e,Ao);case"percent":return e=Ac(e,Ao.currentPercentageDefaultFormat()),G9(t,e,Ao,n);case"byte":return e=Ac(e,Ao.currentByteDefaultFormat()),U9(t,e,Ao,n);case"time":return e=Ac(e,Ao.currentTimeDefaultFormat()),Y9(t);case"ordinal":return e=Ac(e,Ao.currentOrdinalDefaultFormat()),z9(t,e,Ao);case"number":default:return qf({instance:t,providedFormat:e})}}function W9(t){let e=z0.decimal;return Fw(t._value,e.suffixes,e.scale).suffix}function B9(t){let e=z0.binary;return Fw(t._value,e.suffixes,e.scale).suffix}function j9(t){let e=z0.general;return Fw(t._value,e.suffixes,e.scale).suffix}function Fw(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 U9(t,e,n,r){let i=e.base||"binary",o=Object.assign({},Kf,e);const{binarySuffixes:s,decimalSuffixes:a}=n.currentBytes();let u={general:{scale:1024,suffixes:a||_p,marker:"bd"},binary:{scale:1024,suffixes:s||Ek,marker:"b"},decimal:{scale:1e3,suffixes:a||_p,marker:"d"}}[i],{value:c,suffix:h}=Fw(t._value,u.suffixes,u.scale);return`${qf({instance:r(c),providedFormat:e,state:n,defaults:n.currentByteDefaultFormat()})}${o.spaceSeparated?" ":""}${h}`}function z9(t,e,n){let r=n.currentOrdinal(),i=Object.assign({},Kf,e),o=qf({instance:t,providedFormat:e,state:n}),s=r(t._value);return`${o}${i.spaceSeparated?" ":""}${s}`}function Y9(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 G9(t,e,n,r){let i=e.prefixSymbol,o=qf({instance:r(t._value*100),providedFormat:e,state:n}),s=Object.assign({},Kf,e);return i?`%${s.spaceSeparated?" ":""}${o}`:`${o}${s.spaceSeparated?" ":""}%`}function K9(t,e,n){const r=n.currentCurrency();let i=Object.assign({},e),o=Object.assign({},Kf,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=qf({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 q9({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]&&bn[e]?(a=r[e],t=t/bn[e]):l>=bn.trillion||n&&s(l/bn.trillion)===1?(a=r.trillion,t=t/bn.trillion):l<bn.trillion&&l>=bn.billion||n&&s(l/bn.billion)===1?(a=r.billion,t=t/bn.billion):l<bn.billion&&l>=bn.million||n&&s(l/bn.million)===1?(a=r.million,t=t/bn.million):(l<bn.million&&l>=bn.thousand||n&&s(l/bn.thousand)===1)&&(a=r.thousand,t=t/bn.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 X9({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 Bg(t){let e="";for(let n=0;n<t;n++)e+="0";return e}function Z9(t,e){let n=t.toString(),[r,i]=n.split("e"),[o,s=""]=r.split(".");if(+i>0)n=o+s+Bg(i-s.length);else{let a=".";+o<0?a=`-0${a}`:a=`0${a}`;let l=(Bg(-i-1)+Math.abs(o)+s).substr(0,e);l.length<e&&(l+=Bg(e-l.length)),n=a+l}return+i>0&&e>0&&(n+=`.${Bg(e)}`),n}function Q9(t,e,n=Math.round){return t.toString().indexOf("e")!==-1?Z9(t,e):new $9(n(+`${t}e+${e}`)/Math.pow(10,e)).toFixed(e)}function J9(t,e,n,r,i,o){if(r===-1)return t;let s=Q9(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 e6(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 t6(t,e){let n=[],r=0;for(let i=t;i>0;i--)r===e&&(n.unshift(i),r=0),r++;return n}function n6(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)),t6(u.length,a).forEach((f,g)=>{u=u.slice(0,f+g)+s+u.slice(f+g)}),h&&(u=`-${u}`)),c?l=u+i+c:l=u,l}function r6(t,e){return t+e}function i6(t,e,n){return e===0?t:+t==0?t.replace("-",""):e>0?`+${t}`:n==="sign"?t:`(${t.replace("-","")})`}function o6(t,e){return e+t}function s6(t,e){return t+e}function qf({instance:t,providedFormat:e,state:n=Ao,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({},Kf,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,g=a?!1:e.optionalMantissa===void 0?f===-1:s.optionalMantissa,C=s.trimMantissa,y=s.thousandSeparated,E=s.spaceSeparated,v=s.negative,P=s.forceSign,O=s.exponential,L=s.roundingFunction,T="";if(d){let K=q9({value:o,forceAverage:c,lowPrecision:h,abbreviations:n.currentAbbreviations(),spaceSeparated:E,roundingFunction:L,totalLength:a});o=K.value,T+=K.abbreviation,a&&(f=K.mantissaPrecision)}if(O){let K=X9({value:o,characteristicPrecision:l});o=K.value,T=K.abbreviation+T}let A=J9(o.toString(),o,g,f,C,L);return A=e6(A,o,u,l),A=n6(A,o,y,n,r),(d||O)&&(A=r6(A,T)),(P||o<0)&&(A=i6(A,o,v)),A}function Ac(t,e){if(!t)return e;let n=Object.keys(t);return n.length===1&&n[0]==="output"?e:t}var a6=t=>({format:(...e)=>F9(...e,t),getByteUnit:(...e)=>j9(...e,t),getBinaryByteUnit:(...e)=>B9(...e,t),getDecimalByteUnit:(...e)=>W9(...e,t),formatOrDefault:Ac});/*!
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 Ca=Rk;function l6(t,e,n){let r=new Ca(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Ca(i),t._value=r.plus(i).toNumber(),t}function Tk(t,e,n){let r=new Ca(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Ca(i),t._value=r.minus(i).toNumber(),t}function u6(t,e,n){let r=new Ca(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Ca(i),t._value=r.times(i).toNumber(),t}function c6(t,e,n){let r=new Ca(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Ca(i),t._value=r.dividedBy(i).toNumber(),t}function h6(t,e,n){let r=e;return n.isNumbro(e)&&(r=e._value),t._value=r,t}function d6(t,e,n){let r=n(t._value);return Tk(r,e,n),Math.abs(r._value)}var f6=t=>({add:(e,n)=>l6(e,n,t),subtract:(e,n)=>Tk(e,n,t),multiply:(e,n)=>u6(e,n,t),divide:(e,n)=>c6(e,n,t),set:(e,n)=>h6(e,n,t),difference:(e,n)=>d6(e,n,t),BigNumber:Ca});/*!
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 g6="2.5.0",Hs=U0(),m6=B0(),p6=D9(zt),w6=bk();let Hl=a6(zt),uu=f6(zt);const v6=j0;class _k{constructor(e){this._value=e}clone(){return zt(this._value)}format(e={}){return Hl.format(this,e)}formatCurrency(e){return typeof e=="string"&&(e=v6.parseFormat(e)),e=Hl.formatOrDefault(e,Hs.currentCurrencyDefaultFormat()),e.output="currency",Hl.format(this,e)}formatTime(e={}){return e.output="time",Hl.format(this,e)}binaryByteUnits(){return Hl.getBinaryByteUnit(this)}decimalByteUnits(){return Hl.getDecimalByteUnit(this)}byteUnits(){return Hl.getByteUnit(this)}difference(e){return uu.difference(this,e)}add(e){return uu.add(this,e)}subtract(e){return uu.subtract(this,e)}multiply(e){return uu.multiply(this,e)}divide(e){return uu.divide(this,e)}set(e){return uu.set(this,Mk(e))}value(){return this._value}valueOf(){return this._value}}function Mk(t){let e=t;return zt.isNumbro(t)?e=t._value:typeof t=="string"?e=zt.unformat(t):isNaN(t)&&(e=NaN),e}function zt(t){return new _k(Mk(t))}zt.version=g6;zt.isNumbro=function(t){return t instanceof _k};zt.language=Hs.currentLanguage;zt.registerLanguage=Hs.registerLanguage;zt.setLanguage=Hs.setLanguage;zt.languages=Hs.languages;zt.languageData=Hs.languageData;zt.zeroFormat=Hs.setZeroFormat;zt.defaultFormat=Hs.currentDefaults;zt.setDefaults=Hs.setDefaults;zt.defaultCurrencyFormat=Hs.currentCurrencyDefaultFormat;zt.validate=m6.validate;zt.loadLanguagesInNode=p6.loadLanguagesInNode;zt.unformat=w6.unformat;zt.BigNumber=uu.BigNumber;var C6=zt,Nl=m9(C6);const y6="numeric";function Ik(t,e){if(Un(t)){const n=e.numericFormat,r=n&&n.culture||"-",i=n&&n.pattern;if(typeof r<"u"&&!Nl.languages()[r]){const o=r.replace("-",""),s=Nl.allLanguages?Nl.allLanguages[r]:Nl[o];s&&Nl.registerLanguage(s)}Nl.setLanguage(r),t=Nl(t).format(i||"0")}return t}function Y0(t,e,n,r,i,o,s){let a=o;if(Un(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=Ik(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"}Pa(t,e,n,r,i,a,s)}Y0.RENDERER_TYPE=y6;const b6="password";function G0(t,e,n,r,i,o,s){Pa.apply(this,[t,e,n,r,i,o,s]);const a=s.hashLength||e.innerHTML.length,l=s.hashSymbol||"*";let u="";de(a-1,()=>{u+=l}),ph(e,u)}G0.RENDERER_TYPE=b6;const S6="select";function K0(t,e,n,r,i,o,s){Pa.apply(this,[t,e,n,r,i,o,s])}K0.RENDERER_TYPE=S6;const R6="time";function q0(t,e,n,r,i,o,s){Pa.apply(this,[t,e,n,r,i,o,s]),e.dir="ltr"}q0.RENDERER_TYPE=R6;function E6(){to(yh),to(Gf),to(F0),to($0),to(W0),to(L0),to(Y0),to(G0),to(K0),to(Pa),to(q0)}const T6="autocomplete";function Vw(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,Gx(n,e)):Gx(n,e)(this.source):e(!0)}Vw.VALIDATOR_TYPE=T6;function Gx(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 _6(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const M6="date";function X0(t,e){const n=ZN(fk,this.instance);let r=t,i=!0;r==null&&(r="");let o=X(r,this.dateFormat||n.defaultDateFormat,!0).isValid(),s=X(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=I6(r,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,a,"dateValidator"),i=!0}else i=!1;e(i)}X0.VALIDATOR_TYPE=M6;function I6(t,e){const n=X(_6(t)),r=X(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 P6="dropdown";function Z0(t,e){Vw.apply(this,[t,e])}Z0.VALIDATOR_TYPE=P6;const O6="numeric";function Q0(t,e){let n=t;n==null&&(n=""),this.allowEmpty&&n===""?e(!0):e(n===""?!1:Un(t))}Q0.VALIDATOR_TYPE=O6;const x6=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],A6="time";function J0(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=X(i,x6,!0).isValid()?X(i):X(i,n);let a=s.isValid(),l=X(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)}J0.VALIDATOR_TYPE=A6;function H6(){xc(Vw),xc(Z0),xc(X0),xc(Q0),xc(J0)}const N6="autocomplete",D6={CELL_TYPE:N6,editor:D0,renderer:yh,validator:Vw},k6="checkbox",L6={CELL_TYPE:k6,editor:dk,renderer:F0},$6="date";function Pk(t,e,n,r,i,o,s){yh.apply(this,[t,e,n,r,i,o,s])}Pk.RENDERER_TYPE=$6;const F6="date",V6={CELL_TYPE:F6,editor:gk,renderer:Pk,validator:X0},W6="dropdown",B6={CELL_TYPE:W6,editor:mk,renderer:$0,validator:Z0,filter:!1,strict:!0},j6="handsontable",U6={CELL_TYPE:j6,editor:N0,renderer:W0},z6="numeric",Y6={CELL_TYPE:z6,editor:pk,renderer:Y0,validator:Q0,dataType:"number"},G6="password",K6={CELL_TYPE:G6,editor:wk,renderer:G0,copyable:!1},q6="select",X6={CELL_TYPE:q6,editor:vk,renderer:K0},Z6="time",Q6={CELL_TYPE:Z6,editor:Ck,renderer:q0,validator:J0};function J6(){Po(D6),Po(L6),Po(V6),Po(B6),Po(U6),Po(Y6),Po(K6),Po(X6),Po(ek),Po(Q6)}function e8(t,e){Ok(t,e),e.add(t)}function t8(t,e,n){Ok(t,e),e.set(t,n)}function Ok(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rc(t,e,n){return(e=n8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n8(t){var e=r8(t,"string");return typeof e=="symbol"?e:e+""}function r8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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){return t.get(xk(t,e))}function xk(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 Kx=new Map([["plugin",yY],["cell-type",UD],["editor",XN],["renderer",iD],["validator",oD]]),Ak=Symbol("mainSetting"),i8="base",jg=[];let Dl=null;var kl=new WeakMap,qx=new WeakSet;class Xe{static get PLUGIN_KEY(){return i8}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}constructor(e){e8(this,qx),rc(this,"eventManager",new zo(this)),rc(this,"pluginName",null),rc(this,"pluginsInitializedCallbacks",[]),rc(this,"isPluginsReady",!1),rc(this,"enabled",!1),rc(this,"initialized",!1),t8(this,kl,{}),Ea(this,"hot",e,{writable:!1}),Dl=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(!Kx.has(s))throw new Error(`Unknown plugin dependency type "${s}" was found.`);Kx.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("");jg.push(o)}}if(Dl||(Dl=rD()),Dl.indexOf(this.pluginName)>=0&&Dl.splice(Dl.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),Dl.length===0){if(jg.length>0){const i=[`${jg.join(`
251
+ `)}
252
+ `,"You have to import and register them manually."].join("");throw jg.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[Ak]===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){ic(kl,this)[e]=ic(kl,this)[e]||[];const i=ic(kl,this)[e];this.hot.addHook(e,n,r),i.push(n),ic(kl,this)[e]=i}removeHooks(e){M(ic(kl,this)[e]||[],n=>{this.hot.removeHook(e,n)})}clearHooks(){const e=ic(kl,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=xk(qx,this,o8).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 o8(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 Ll(t,e,n){return(e=s8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s8(t){var e=a8(t,"string");return typeof e=="symbol"?e:e+""}function a8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Hk=class{constructor(e){Ll(this,"hot",null),Ll(this,"container",null),Ll(this,"injected",!1),Ll(this,"rows",[]),Ll(this,"columns",[]),Ll(this,"samples",null),Ll(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,n){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={row:e};this.rows.push(r),this.samples=n,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol(e)),this.table.tr.appendChild(this.createRow(e)),e===0&&G(this.table.table,"htGhostTableFirstRow"),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}addColumnHeadersRow(e){const n=this.hot.getColHeader(0);if(n!=null){const r={row:-1};this.rows.push(r),this.container=this.createContainer(this.hot.rootElement.className),this.samples=e,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.appendColumnHeadersRow(),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}}addColumn(e,n){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={col:e};this.columns.push(r),this.samples=n,this.table=this.createTable(this.hot.table.className),this.getSetting("useHeaders")&&this.hot.getColHeader(e)!==null&&this.hot.view.appendColHeader(e,this.table.th,void 0,-1),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}getHeights(e){this.injected||this.injectTable(),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),G(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 G(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 Ug(t,e,n){return(e=l8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l8(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)}class Ww{static get SAMPLE_COUNT(){return 3}constructor(e){Ug(this,"samples",null),Ug(this,"dataFactory",null),Ug(this,"customSampleCount",null),Ug(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:Ww.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 de(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 de(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=`${Pt(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 c8(t,e){Nk(t,e),e.add(t)}function Vb(t,e,n){Nk(t,e),e.set(t,n)}function Nk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qh(t,e,n){return(e=h8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h8(t){var e=d8(t,"string");return typeof e=="symbol"?e:e+""}function d8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function il(t,e){return t.get(dr(t,e))}function Mp(t,e,n){return t.set(dr(t,e),n),n}function dr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("modifyAutoColumnSizeSeed");const Wb="autoColumnSize",f8=10,g8="autoColumnSize";var eT=new WeakMap,Hc=new WeakMap,sh=new WeakMap,Fi=new WeakSet;class Ud extends Xe{static get PLUGIN_KEY(){return Wb}static get PLUGIN_PRIORITY(){return f8}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),c8(this,Fi),Qh(this,"ghostTable",new Hk(this.hot)),Qh(this,"samplesGenerator",new Ww((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}})),Qh(this,"inProgress",!1),Qh(this,"measuredColumns",0),Qh(this,"columnWidthsMap",new vl),Vb(this,eT,!1),Vb(this,Hc,[]),Vb(this,sh,[]),this.hot.columnIndexMapper.registerMap(g8,this.columnWidthsMap),this.addHook("beforeColumnResize",(n,r,i)=>dr(Fi,this,Xx).call(this,n,r,i))}isEnabled(){return this.hot.getSettings()[Wb]!==!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 dr(Fi,e,w8).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 dr(Fi,e,v8).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 dr(Fi,e,y8).call(e,...i)}),this.addHook("beforeRender",()=>dr(Fi,this,p8).call(this)),this.addHook("modifyColWidth",(r,i)=>this.getColumnWidth(i,r)),this.addHook("init",()=>dr(Fi,this,C8).call(this)),super.enablePlugin()}updatePlugin(){Mp(sh,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,n,r)=>dr(Fi,this,Xx).call(this,e,n,r))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const e=this.getFirstVisibleColumn(),n=this.getLastVisibleColumn();if(e===-1||n===-1)return;const r=this.hot.forceFullRender;this.calculateColumnsWidth({from:e,to:n},void 0,r)}calculateColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countRows()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof n=="number"?{from:n,to:n}:n;de(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))&&dr(Fi,this,Dk).call(this,s,o)}),this.ghostTable.columns.length&&(dr(Fi,this,kk).call(this),this.measuredColumns=i.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0;const i=this.hot.countCols()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){Cp(o),this.inProgress=!1;return}this.calculateColumnsWidth({from:r,to:Math.min(r+Ud.CALCULATION_STEP,i)},e,n),r=r+Ud.CALCULATION_STEP+1,r<i?o=vp(s):(Cp(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()[Wb];let n=Ud.SYNC_CALCULATION_LIMIT;const r=this.hot.countCols()-1;return Ae(e)&&(n=e.syncLimit,bN(n)?n=eD(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,eh))),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=il(Hc,this).length;return(s-1<o||il(Hc,this)[o]!==i)&&r.push(this.hot.toVisualColumn(o)),s-1<o?il(Hc,this).push(i):il(Hc,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 m8(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)||dr(Fi,this,Dk).call(this,n,e))}),this.ghostTable.columns.length&&(dr(Fi,this,kk).call(this),this.ghostTable.clean())}function Dk(t,e){this.samplesGenerator.generateColumnSamples(t,e).forEach((r,i)=>this.ghostTable.addColumn(i,r))}function kk(){this.hot.batchExecution(()=>{this.ghostTable.getWidths((t,e)=>{const n=this.hot.toPhysicalColumn(t);this.columnWidthsMap.setValueAtIndex(n,e)})},!0)}function p8(){this.calculateVisibleColumnsWidth(),this.inProgress||(dr(Fi,this,m8).call(this,il(sh,this)),Mp(sh,this,[]))}function w8(t,e){e||this.recalculateAllColumnsWidth()}function v8(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},[]);il(sh,this).push(...e)}function Xx(t,e,n){let r=t;return n&&(this.calculateColumnsWidth(e,void 0,!0),r=this.getColumnWidth(e,void 0,!1)),r}function C8(){Mp(Hc,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth(),Mp(eT,this,!0)}function y8(t){if(!il(eT,this))return;const e=t.reduce((n,r)=>{var i;const o=(i=r.address)===null||i===void 0?void 0:i.col;if(Number.isInteger(o)){const s=this.hot.toVisualColumn(o);n.indexOf(s)===-1&&n.push(s)}return n},[]);il(sh,this).push(...e)}const pu={horizontal:"horizontal",vertical:"vertical"};function b8(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(pu),e.autoInsertRow=!0):Ae(t)?(ae(t.autoInsertRow)?t.direction===pu.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,ae(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(pu)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function R8(t,e){E8(t,e),e.add(t)}function E8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oc(t,e,n){return(e=T8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T8(t){var e=_8(t,"string");return typeof e=="symbol"?e:e+""}function _8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Jh(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("modifyAutofillRange");re.getSingleton().register("beforeAutofill");re.getSingleton().register("afterAutofill");const Zx="autofill",M8=20,I8=["fillHandle"],P8="insert_row_below",O8=200;var sc=new WeakSet;class x8 extends Xe{constructor(){super(...arguments),R8(this,sc),oc(this,"addingStarted",!1),oc(this,"mouseDownOnCellCorner",!1),oc(this,"mouseDragOutside",!1),oc(this,"handleDraggedCells",0),oc(this,"directions",[]),oc(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return Zx}static get PLUGIN_PRIORITY(){return M8}static get SETTING_KEYS(){return[Zx,...I8]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>Jh(sc,this,H8).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>Jh(sc,this,A8).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,n)=>Jh(sc,this,N8).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}=b8(l,u,(f,g)=>this.hot._createCellCoords(f,g));if(h&&h.row>-1&&h.col>-1){const f=this.getSelectionData(),g=o.clone(),C=this.hot._createCellRange(h,h,d),y=this.hot.runHooks("beforeAutofill",f,g,C,c);if(y===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let E=y;const v=y;if(["up","left"].indexOf(c)>-1&&!(v.length===1&&v[0].length===0))if(E=[],c==="up"){const P=d.row-h.row+1,O=P%v.length;for(let L=0;L<P;L++)E.push(v[(L+(v.length-O))%v.length])}else{const P=d.col-h.col+1,O=P%v[0].length;for(let L=0;L<v.length;L++){E.push([]);for(let T=0;T<P;T++)E[L].push(v[L][(T+(v[L].length-O))%v[L].length])}}this.hot.populateFromArray(h.row,h.col,E,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(u),this.hot.runHooks("afterAutofill",E,g,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(pu.vertical)&&this.directions.includes(pu.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(pu.vertical))i=this.hot._createCellCoords(e.row,r.col);else if(this.directions.includes(pu.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(P8,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},O8)}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(!Ut(u))return-1}const s=n[o][e[1]-1],a=n[o][e[3]+1];(!Ut(s)||!Ut(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(...Be(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)+Kt(this.hot.table);return e.clientY>r&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>Jh(sc,this,D8).call(this)),this.eventManager.addEventListener(e,"mousemove",n=>Jh(sc,this,k8).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 A8(){this.selectAdjacent()&&this.fillIn()}function H8(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function N8(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function D8(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function k8(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 L8(t,e){Lk(t,e),e.add(t)}function Qx(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 ac(t,e,n){return(e=$8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $8(t){var e=F8(t,"string");return typeof e=="symbol"?e:e+""}function F8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 $k(t,e,n){return t.set(ys(t,e),n),n}function Ip(t,e){return t.get(ys(t,e))}function ys(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Bb="autoRowSize",V8=40,W8="autoRowSize";var Cf=new WeakMap,tT=new WeakMap,Xs=new WeakSet;class zd extends Xe{static get PLUGIN_KEY(){return Bb}static get PLUGIN_PRIORITY(){return V8}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),L8(this,Xs),ac(this,"headerHeight",null),ac(this,"ghostTable",new Hk(this.hot)),ac(this,"samplesGenerator",new Ww((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}})),ac(this,"inProgress",!1),ac(this,"measuredRows",0),ac(this,"rowHeightsMap",new vl),Qx(this,Cf,[]),Qx(this,tT,!1),this.hot.rowIndexMapper.registerMap(W8,this.rowHeightsMap),this.addHook("beforeRowResize",(n,r,i)=>ys(Xs,this,Jx).call(this,n,r,i))}isEnabled(){const e=this.hot.getSettings()[Bb];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 ys(Xs,e,U8).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 ys(Xs,e,z8).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 ys(Xs,e,G8).call(e,...i)}),this.addHook("beforeRender",()=>ys(Xs,this,j8).call(this)),this.addHook("modifyRowHeight",(r,i)=>this.getRowHeight(i,r)),this.addHook("init",()=>ys(Xs,this,Y8).call(this)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin()}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,n,r)=>ys(Xs,this,Jx).call(this,e,n,r))}calculateVisibleRowsHeight(){if(!this.hot.countCols())return;const e=this.getFirstVisibleRow(),n=this.getLastVisibleRow();if(e===-1||n===-1)return;const r=this.hot.forceFullRender;this.calculateRowsHeight({from:e,to:n},void 0,r)}calculateRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countCols()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof n=="number"?{from:n,to:n}:n;if(this.hot.getColHeader(0)!==null){const s=this.samplesGenerator.generateRowSamples(-1,o);this.ghostTable.addColumnHeadersRow(s.get(-1))}de(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){Cp(o),this.inProgress=!1;return}this.calculateRowsHeight({from:r,to:Math.min(r+zd.CALCULATION_STEP,i)},e,n),r=r+zd.CALCULATION_STEP+1,r<i?o=vp(s):(Cp(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateRowsHeight({from:0,to:a},e,n),r=a+1),r<i?s():(this.inProgress=!1,this.hot.view.adjustElementsSize())}recalculateAllRowsHeight(){this.hot.view.isVisible()&&this.calculateAllRowsHeight({from:0,to:this.hot.countCols()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[Bb];let n=zd.SYNC_CALCULATION_LIMIT;const r=this.hot.countRows()-1;return Ae(e)&&(n=e.syncLimit,bN(n)?n=eD(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(()=>{de(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 B8(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 j8(){this.calculateVisibleRowsHeight(),this.inProgress||(ys(Xs,this,B8).call(this,Ip(Cf,this)),$k(Cf,this,[]))}function Jx(t,e,n){let r=t;return n&&(this.calculateRowsHeight(e,void 0,!0),r=this.getRowHeight(e)),r}function U8(t,e){e||this.recalculateAllRowsHeight()}function z8(t){const e=t.reduce((n,r)=>{let[i]=r;return n.indexOf(i)===-1&&n.push(i),n},[]);Ip(Cf,this).push(...e)}function Y8(){this.recalculateAllRowsHeight(),$k(tT,this,!0)}function G8(t){if(!Ip(tT,this))return;const e=t.reduce((n,r)=>{var i;const o=(i=r.address)===null||i===void 0?void 0:i.row;if(Number.isInteger(o)){const s=this.hot.toVisualRow(o);n.indexOf(s)===-1&&n.push(s)}return n},[]);Ip(Cf,this).push(...e)}const{getListWithInsertedItems:K8,getListWithRemovedItems:q8}=ID("physicallyIndexed");class X8 extends Bu{constructor(){super(e=>e)}insert(e,n){const r=_0(this.indexedValues,n);this.indexedValues=K8(r,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){const n=q8(this.indexedValues,e);this.indexedValues=T0(n,e),super.remove(e)}}const{getListWithInsertedItems:Z8,getListWithRemovedItems:Q8}=ID("physicallyIndexed");class J8 extends Bu{constructor(){super(e=>e)}insert(e,n){this.indexedValues=Z8(this.indexedValues,e,n,(r,i)=>this.getNextValue(i)),super.insert(e,n)}remove(e){this.indexedValues=Q8(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}function eZ(t,e){tZ(t,e),e.add(t)}function tZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nZ(t,e,n){return(e=rZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rZ(t){var e=iZ(t,"string");return typeof e=="symbol"?e:e+""}function iZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oZ(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 eA="bindRowsWithHeaders",sZ=210,aZ="loose",tA=new Map([["loose",X8],["strict",J8]]);var nA=new WeakSet;class lZ extends Xe{constructor(){super(...arguments),eZ(this,nA),nZ(this,"headerIndexes",null)}static get PLUGIN_KEY(){return eA}static get PLUGIN_PRIORITY(){return sZ}isEnabled(){return!!this.hot.getSettings()[eA]}enablePlugin(){var e;if(this.enabled)return;const n=(e=tA.get(this.getSetting()))!==null&&e!==void 0?e:tA.get(aZ);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new n),this.addHook("modifyRowHeader",r=>oZ(nA,this,uZ).call(this,r)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function uZ(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function cZ(t,e){Fk(t,e),e.add(t)}function hZ(t,e,n){Fk(t,e),e.set(t,n)}function Fk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rA(t,e,n){return(e=dZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dZ(t){var e=fZ(t,"string");return typeof e=="symbol"?e:e+""}function fZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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){return t.get(Vc(t,e))}function jb(t,e,n){return t.set(Vc(t,e),n),n}function Vc(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 Zm="collapsibleColumns",gZ=290,mZ=["nestedHeaders"],qc="collapsibleIndicator",oA=Zm,sA=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var lc=new WeakMap,ed=new WeakSet;class pZ extends Xe{constructor(){super(...arguments),cZ(this,ed),rA(this,"nestedHeadersPlugin",null),rA(this,"headerStateManager",null),hZ(this,lc,null)}static get PLUGIN_KEY(){return Zm}static get PLUGIN_PRIORITY(){return gZ}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[Zm,...mZ]}isEnabled(){return!!this.hot.getSettings()[Zm]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();n||Ze("You need to configure the Nested Headers plugin in order to use collapsible headers."),jb(lc,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>Vc(ed,this,CZ).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 Vc(ed,e,yZ).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 Vc(ed,e,wZ).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(r,i,o)=>Vc(ed,this,vZ).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),jb(lc,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:oA,relativeToGroup:Cl,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(oA)}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)};de(0,e-1,s=>{const a=n.childNodes[s],l=r.childNodes[s],u=i?i.childNodes[s]:null;de(0,a.childNodes.length-1,c=>{let h=a.childNodes[c].querySelector(`.${qc}`);o(h),l&&l.childNodes[c]&&(h=l.childNodes[c].querySelector(`.${qc}`),o(h)),i&&u&&u.childNodes[c]&&(h=u.childNodes[c].querySelector(`.${qc}`),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(!sA.has(n))throw new Error(`Unsupported action is passed (${n}).`);if(!Array.isArray(e))return;const r=Eu(e,f=>{let{row:g}=f;return g<0});let i=r.length>0;M(r,f=>{var g;let{row:C,col:y}=f;const{collapsible:E,isCollapsed:v}=(g=this.headerStateManager.getHeaderSettings(C,y))!==null&&g!==void 0?g:{};if(!E||v&&n==="collapse"||!v&&n==="expand")return i=!1,!1});const o=[],s=[];i&&M(r,f=>{let{row:g,col:C}=f;const{colspanCompensation:y,affectedColumns:E,rollbackModification:v}=this.headerStateManager.triggerNodeModification(n,g,C);y>0&&(s.push(...E),o.push(v))});const a=this.getCollapsedColumns();let l=[];n==="collapse"?l=SU([...a,...s]):n==="expand"&&(l=Eu(a,f=>!s.includes(f)));const u=sA.get(n);if(this.hot.runHooks(u.beforeHook,a,l,i)===!1){M(o,f=>{f()});return}this.hot.batchExecution(()=>{M(s,f=>{iA(lc,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:g}=d.highlight;if((this.hot.rowIndexMapper.isHidden(f)||this.hot.columnIndexMapper.isHidden(g))&&s.includes(g)){const y=f>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(f,1,!0):f,E=g>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(g,1,!0):g;y!==null&&E!==null&&this.hot.selectCell(y,E)}}this.hot.runHooks(u.afterHook,a,l,i,h),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return iA(lc,this).getHiddenIndexes()}destroy(){jb(lc,this,null),super.destroy()}}function wZ(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(`.${qc}`);if(mh(e,[ho("")[0]]),a)u||(u=this.hot.rootDocument.createElement("div"),G(u,qc),e.querySelector("div:first-child").appendChild(u)),pe(u,["collapsed","expanded"]),s?(G(u,"collapsed"),_u(u,"+"),l&&ye(e,...ho(!1))):(G(u,"expanded"),_u(u,"-"),l&&ye(e,...ho(!0))),l&&ye(u,...Wu());else{var c;(c=u)===null||c===void 0||c.remove()}}function vZ(t,e){ve(t.target,qc)&&(ve(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):ve(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),Ko(t))}function CZ(){this.updatePlugin()}function yZ(t,e){e||this.updatePlugin()}function $l(t,e,n){return(e=bZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bZ(t){var e=SZ(t,"string");return typeof e=="symbol"?e:e+""}function SZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const RZ=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],EZ=!1,TZ=!0,_Z=!0;class MZ{constructor(e,n){$l(this,"hot",void 0),$l(this,"sortingStates",new xw),$l(this,"sortEmptyCells",EZ),$l(this,"indicator",TZ),$l(this,"headerAction",_Z),$l(this,"compareFunctionFactory",void 0),$l(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)=>{RZ.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(ae(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 Vk(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?_s:Ut(i)?Ut(o)?_s:s&&t==="asc"?kt:Lt:Ut(o)?s&&t==="asc"?Lt:kt:isNaN(i)&&!isNaN(o)?t==="asc"?Lt:kt:!isNaN(i)&&isNaN(o)||(isNaN(i)||isNaN(o)||(i=parseFloat(i),o=parseFloat(o)),i<o)?t==="asc"?kt:Lt:i>o?t==="asc"?Lt:kt:_s}}const Wk="default";function IZ(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 _s;if(a){if(Ut(r))return t==="asc"?kt:Lt;if(Ut(i))return t==="asc"?Lt:kt}return isNaN(o)?Lt:isNaN(s)?kt:o<s?t==="asc"?kt:Lt:o>s?t==="asc"?Lt:kt:_s}}const PZ="numeric";function OZ(t,e,n){const r=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:o}=n;return function(s,a){const l=Ut(s),u=Ut(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 Lt;if(l===!1&&u)return kt}return d===!1&&f?t==="asc"?kt:Lt:d&&f===!1?t==="asc"?Lt:kt:d===!1&&f===!1?Vk(t,e,n)(s,a):c===i&&h===r?t==="asc"?kt:Lt:c===r&&h===i?t==="asc"?Lt:kt:_s}}const xZ="checkbox";function AZ(t,e,n){return Gk(t,e.dateFormat,n)}const HZ="date";function NZ(t,e,n){return Gk(t,e.timeFormat,n)}const DZ="time",{register:Xf,getItem:aA,hasItem:kZ}=qo("sorting.compareFunctionFactory"),{register:Bk,getItem:LZ}=qo("sorting.mainSortComparator");function jk(t){return kZ(t)?aA(t):aA(Wk)}Xf(xZ,OZ);Xf(HZ,AZ);Xf(Wk,Vk);Xf(PZ,IZ);Xf(DZ,NZ);const _s=0,kt=-1,Lt=1;function $Z(t,e){const n=LZ(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 Pp="asc",Op="desc",Uk="colHeader";function FZ(t){if(Ae(t)===!1)return!1;const{column:e,sortOrder:n}=t;return Number.isInteger(e)&&[Pp,Op].includes(n)}function VZ(t){if(t.some(n=>FZ(n)===!1))return!1;const e=t.map(n=>{let{column:r}=n;return r});return new Set(e).size===e.length}function lA(t){if(t!==Op)return t===Pp?Op:Pp}function zk(t){return t.querySelector(`.${Uk}`)}function Yk(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 nT(t,e,n){return t===-1&&e>=0&&Mu(n)===!1}function Gk(t,e,n){return function(r,i){const{sortEmptyCells:o}=n;if(r===i)return _s;if(Ut(r))return Ut(i)?_s:o&&t==="asc"?kt:Lt;if(Ut(i))return o&&t==="asc"?Lt:kt;const s=X(r,e),a=X(i,e);return s.isValid()?a.isValid()?a.isAfter(s)?t==="asc"?kt:Lt:a.isBefore(s)?t==="asc"?Lt:kt:_s:kt:Lt}}function WZ(t,e){Ze(nt`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20
253
+ Only \`${t}\` will work. The \`${e}\` plugin will remain disabled.`)}const BZ="ascending",jZ="descending",Kk="indicatorDisabled",qk="columnSorting",Xk="sortAction",Zk=new Map([[Pp,BZ],[Op,jZ]]);function UZ(t,e,n,r){const i=[qk];if(r&&i.push(Xk),n===!1)return i.push(Kk),i;const o=t.getSortOrderOfColumn(e);return ae(o)&&i.push(Zk.get(o)),i}function zZ(){return Array.from(Zk.values()).concat(Xk,Kk,qk)}function YZ(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:jk(u.type))(l,u,d)(c,h)}(0)}}function GZ(t,e){KZ(t,e),e.add(t)}function KZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zg(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=XZ(t,"string");return typeof e=="symbol"?e:e+""}function XZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 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 xp="columnSorting",ZZ=50,Ap="append",QZ="replace",uA=xp;Bk(xp,YZ);re.getSingleton().register("beforeColumnSort");re.getSingleton().register("afterColumnSort");const td=new WeakMap;var cu=new WeakSet;class Qk extends Xe{constructor(){super(...arguments),GZ(this,cu),zg(this,"columnStatesManager",null),zg(this,"columnMetaCache",null),zg(this,"pluginKey",xp),zg(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return xp}static get PLUGIN_PRIORITY(){return ZZ}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;if(td.has(this.hot)&&td.get(this.hot)!==this.pluginKey){this.hot.updateSettings({[this.pluginKey]:!1}),WZ(td.get(this.hot),this.pluginKey);return}this.enabled||(td.set(this.hot,this.pluginKey),this.columnStatesManager=new MZ(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new vl(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)=>Nc(cu,this,JZ).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 Nc(cu,e,t7).call(e,...r)}),this.addHook("afterOnCellMouseDown",(n,r)=>this.onAfterOnCellMouseDown(n,r)),this.addHook("afterInit",()=>Nc(cu,this,$R).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 Nc(cu,e,e7).call(e,...r)}),this.hot.view&&Nc(cu,this,$R).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(n,r)=>{const i=zk(r);Yk(n,r)===!1||i===null||this.updateHeaderClasses(i)};td.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:Cl,position:"before",group:uA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(uA)}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())}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return ae(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 VZ(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=Be(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 ae(n)&&Array.isArray(n.initialConfig)&&(n.initialConfig=Be(n.initialConfig,r)),n}getColumnNextConfig(e){const n=this.columnStatesManager.getSortOrderOfColumn(e);if(ae(n)){const i=lA(n);return ae(i)?{column:e,sortOrder:i}:void 0}const r=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<r)return{column:e,sortOrder:lA()}}getNextSortConfig(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ap;const r=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=r!==-1,o=this.getSortConfig(),s=this.getColumnNextConfig(e);if(i){if(It(s))return[...o.slice(0,r),...o.slice(r+1)];if(n===Ap)return[...o.slice(0,r),...o.slice(r+1),s];if(n===QZ)return[...o.slice(0,r),s,...o.slice(r+1)]}return ae(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])):ot(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=>Be(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=Be(n,u=>u[0]);$Z(n,this.pluginKey,Be(e,u=>u.sortOrder),Be(e,u=>this.getFirstCellSettings(u.column)));for(let u=n.length;u<r;u+=1)n.push([u].concat(i(u)));const s=Be(n,u=>u[0]),a=new Map(Be(o,(u,c)=>[u,s[c]])),l=Be(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(pe(e,zZ()),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];G(e,UZ(...r))}}onUpdateSettings(e){super.onUpdateSettings(e),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),ae(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,n){return this.getFirstCellSettings(n)[this.pluginKey].headerAction&&ve(e.target,Uk)}onAfterOnCellMouseDown(e,n){if(nT(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 $R(){const t=this.getAllSavedSortSettings();if(Ae(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function JZ(t,e){const n=zk(e);if(Yk(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);ye(e,...jU(s?`${s}ending`:"none"))}}function e7(t){t===!0&&this.hot.view&&Nc(cu,this,$R).call(this)}function t7(t,e,n,r){nT(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(r.column=!0)}function Fl(t,e,n){return(e=n7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n7(t){var e=r7(t,"string");return typeof e=="symbol"?e:e+""}function r7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class i7{constructor(e,n){Fl(this,"plugin",void 0),Fl(this,"hot",void 0),Fl(this,"endpoints",[]),Fl(this,"settings",void 0),Fl(this,"settingsType","array"),Fl(this,"currentEndpoint",null),Fl(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(){Ze("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function Ub(t){return t==null||isNaN(t)}function o7(t,e){s7(t,e),e.add(t)}function s7(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a7(t,e,n){return(e=l7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l7(t){var e=u7(t,"string");return typeof e=="symbol"?e:e+""}function u7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}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 zb="columnSummary",c7=220;var nd=new WeakSet;class h7 extends Xe{constructor(){super(...arguments),o7(this,nd),a7(this,"endpoints",null)}static get PLUGIN_KEY(){return zb}static get PLUGIN_PRIORITY(){return c7}isEnabled(){return!!this.hot.getSettings()[zb]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[zb],this.endpoints=new i7(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 Yg(nd,e,d7).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 Yg(nd,e,g7).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 Yg(nd,e,f7).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 Yg(nd,e,m7).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=Ub(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=Ub(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=Ub(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(nt`ColumnSummary plugin: cell at (${e}, ${n}) is not in a\x20
258
+ numeric format. Cannot do the calculation.`);return o}}function d7(){this.endpoints.initEndpoints()}function f7(t){t.columns!==void 0&&this.endpoints.refreshCellMetas()}function g7(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function m7(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 p7(t,e){Jk(t,e),e.add(t)}function Yb(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 Dc(t,e){return t.get(rT(t,e))}function FR(t,e,n){return t.set(rT(t,e),n),n}function rT(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 Hp=new WeakMap,Gg=new WeakMap,Kg=new WeakMap,cA=new WeakSet;class eL{constructor(){p7(this,cA),Yb(this,Hp,!0),Yb(this,Gg,null),Yb(this,Kg,new ResizeObserver(e=>rT(cA,this,w7).call(this,e)))}setObservedElement(e){FR(Gg,this,e)}unobserve(){Dc(Kg,this).unobserve(Dc(Gg,this))}observe(){FR(Hp,this,!0),Dc(Kg,this).observe(Dc(Gg,this))}destroy(){Dc(Kg,this).disconnect()}}function w7(t){if(Dc(Hp,this)||!Array.isArray(t)||!t.length){FR(Hp,this,!1);return}t.forEach(e=>{let{borderBoxSize:n}=e;const{inlineSize:r,blockSize:i}=n[0];this.runLocalHooks("resize",r,i)})}ut(eL,Rn);function Vl(t,e,n){v7(t,e),e.set(t,n)}function v7(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function at(t,e){return t.get(tL(t,e))}function Us(t,e,n){return t.set(tL(t,e),n),n}function tL(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 Wl=new WeakMap,Gb=new WeakMap,zs=new WeakMap,Ha=new WeakMap,Na=new WeakMap,qg=new WeakMap,uc=new WeakMap;class wu{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;Vl(this,Wl,void 0),Vl(this,Gb,!1),Vl(this,zs,null),Vl(this,Ha,void 0),Vl(this,Na,void 0),Vl(this,qg,!0),Vl(this,uc,new eL),Us(Wl,this,e),Us(Gb,this,n),Us(Ha,this,this.createEditor()),Us(Na,this,at(Ha,this).style),at(uc,this).setObservedElement(this.getInputElement()),at(uc,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){at(Na,this).left=`${e}px`,at(Na,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:Kt(this.getInputElement()),height:nn(this.getInputElement())}}observeSize(){at(uc,this).observe()}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const n=this.getInputElement();n.readOnly=e}show(){at(Na,this).display="block",Us(qg,this,!1)}hide(){at(uc,this).unobserve(),at(qg,this)||(at(Na,this).display="none"),Us(qg,this,!0)}isVisible(){return at(Na,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 at(Wl,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=at(Wl,this).createElement("div"),n=at(Wl,this).createElement("textarea");return e.style.display="none",Us(zs,this,at(Wl,this).createElement("div")),at(zs,this).setAttribute("dir",at(Gb,this)?"rtl":"ltr"),G(at(zs,this),wu.CLASS_EDITOR_CONTAINER),at(Wl,this).body.appendChild(at(zs,this)),G(e,wu.CLASS_EDITOR),G(n,wu.CLASS_INPUT),n.setAttribute("data-hot-input",!0),e.appendChild(n),at(zs,this).appendChild(e),e}getInputElement(){return at(Ha,this).querySelector(`.${wu.CLASS_INPUT}`)}getEditorElement(){return at(Ha,this)}destroy(){const e=at(zs,this)?at(zs,this).parentNode:null;at(Ha,this).parentNode.removeChild(at(Ha,this)),Us(Ha,this,null),Us(Na,this,null),at(uc,this).destroy(),e&&e.removeChild(at(zs,this))}}ut(wu,Rn);function Kb(t,e,n){return(e=C7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C7(t){var e=y7(t,"string");return typeof e=="symbol"?e:e+""}function y7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 b7=250,S7=250;class nL{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")},S7)}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]:b7;this.showDebounced=Ew(n=>{this.wasLastActionShow&&this.runLocalHooks("show",n.from.row,n.from.col)},e)}destroy(){this.clearLocalHooks()}}ut(nL,Rn);function R7(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function E7(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function Bl(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 Ya(t,e,n,r,i){M(t,o=>{o.forAll((s,a)=>{s>=0&&a>=0&&T7(s,a,e,n,r,i)})})}function T7(t,e,n,r,i,o){const s=i(t,e);let a=r;s.className&&(n==="vertical"?a=R7(s.className,r):a=E7(s.className,r)),o(t,e,"className",a)}function rL(t){return`<span class="selected">✓</span>${t}`}function Qm(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 Bw(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 _7(){return{name:xe}}const io="alignment";function M7(){return{key:io,name(){return this.getTranslatedPhrase(Lr)},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:`${io}:left`,name(){return this.getTranslatedPhrase($r)},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",e,t,n,r),Ya(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${io}:center`,name(){return this.getTranslatedPhrase(Fr)},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",e,t,n,r),Ya(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${io}:right`,name(){return this.getTranslatedPhrase(Vr)},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htRight";this.runHooks("beforeCellAlignment",e,t,n,r),Ya(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${io}:justify`,name(){return this.getTranslatedPhrase(Wr)},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",e,t,n,r),Ya(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:`${io}:top`,name(){return this.getTranslatedPhrase(Br)},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htTop";this.runHooks("beforeCellAlignment",e,t,n,r),Ya(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${io}:middle`,name(){return this.getTranslatedPhrase(jr)},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",e,t,n,r),Ya(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${io}:bottom`,name(){return this.getTranslatedPhrase(Ur)},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htBottom";this.runHooks("beforeCellAlignment",e,t,n,r),Ya(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1}]}}}const jw="clear_column";function I7(){return{key:jw,name(){return this.getTranslatedPhrase(_r)},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 Zf="col_left";function P7(){return{key:Zf,name(){return this.getTranslatedPhrase(yr)},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 Qf="col_right";function O7(){return{key:Qf,name(){return this.getTranslatedPhrase(br)},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 Jf="make_read_only";function x7(){return{key:Jf,checkable:!0,ariaChecked(){return Qm(this.getSelectedRange(),(e,n)=>this.getCellMeta(e,n).readOnly)},ariaLabel(){return this.getTranslatedPhrase(Kn)},name(){let t=this.getTranslatedPhrase(Kn);return Qm(this.getSelectedRange(),(n,r)=>this.getCellMeta(n,r).readOnly)&&(t=rL(t)),t},callback(){const t=this.getSelectedRange(),e=Qm(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 Uw="redo";function A7(){return{key:Uw,name(){return this.getTranslatedPhrase(Tr)},callback(){this.getPlugin("undoRedo").redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const eg="remove_col";function H7(){return{key:eg,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(Rr,e)},callback(){this.alter("remove_col",zq(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 zw="remove_row";function N7(){return{key:zw,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(Sr,e)},callback(){this.alter("remove_row",Yq(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 Yw="row_above";function D7(){return{key:Yw,name(){return this.getTranslatedPhrase(vr)},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 Gw="row_below";function k7(){return{key:Gw,name(){return this.getTranslatedPhrase(Cr)},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 yf="no_items";function L7(){return{key:yf,name(){return this.getTranslatedPhrase(Aw)},disabled:!0,isCommand:!1}}const Kw="undo";function $7(){return{key:Kw,name(){return this.getTranslatedPhrase(Er)},callback(){this.getPlugin("undoRedo").undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const F7=[Yw,Gw,Zf,Qf,jw,zw,eg,Kw,Uw,Jf,io,xe,yf],V7={[xe]:_7,[yf]:L7,[Yw]:D7,[Gw]:k7,[Zf]:P7,[Qf]:O7,[jw]:I7,[zw]:N7,[eg]:H7,[Kw]:$7,[Uw]:A7,[Jf]:x7,[io]:M7};function iL(){const t={};return He(V7,(e,n)=>{t[n]=e()}),t}function W7(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(Nr):this.getTranslatedPhrase(Hr)},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 B7(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(Dr)},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 j7(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(kr);return Qm(this.getSelectedRange(),(r,i)=>t.getCommentMeta(r,i,Jm))?rL(e):e},callback(){this.getSelectedRangeLast().forAll((n,r)=>{if(n>=0&&r>=0){const i=!!t.getCommentMeta(n,r,Jm);t.updateCommentMeta(n,r,{[Jm]:!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 U7(t,e){oL(t,e),e.add(t)}function cc(t,e,n){oL(t,e),e.set(t,n)}function oL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function z7(t,e,n){return(e=Y7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Y7(t){var e=G7(t,"string");return typeof e=="symbol"?e:e+""}function G7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ol(t,e,n){return t.set(ar(t,e),n),n}function Ie(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 Np="comments",K7=60,ta="comment",Nd="value",sL="style",Jm="readOnly",rd=Np,VR=`plugin:${Np}`;var it=new WeakMap,ws=new WeakMap,qw=new WeakMap,ep=new WeakMap,WR=new WeakMap,Dp=new WeakMap,Ai=new WeakSet;class q7 extends Xe{constructor(){super(...arguments),U7(this,Ai),z7(this,"range",{}),cc(this,it,null),cc(this,ws,null),cc(this,qw,!1),cc(this,ep,!1),cc(this,WR,null),cc(this,Dp,"")}static get PLUGIN_KEY(){return Np}static get PLUGIN_PRIORITY(){return K7}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[Np]}enablePlugin(){var e=this;this.enabled||(Ie(it,this)||(ol(it,this,new wu(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 ar(Ai,e,r5).call(e,...r)})),Ie(ws,this)||ol(ws,this,new nL(this.getSetting("displayDelay"))),this.addHook("afterContextMenuDefaultOptions",n=>this.addToContextMenu(n)),this.addHook("afterRenderer",(n,r,i,o,s,a)=>ar(Ai,this,e5).call(this,n,a)),this.addHook("afterScroll",()=>ar(Ai,this,i5).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",n=>ar(Ai,this,hA).call(this,n)),this.addHook("beforeCompositionStart",n=>ar(Ai,this,hA).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 ar(Ai,e,o5).call(e,...r)}),Ie(ws,this).addLocalHook("hide",()=>this.hide()),Ie(ws,this).addLocalHook("show",(n,r)=>this.showAtCell(n,r)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){Ie(ws,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(VR);n.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeLast();ol(ep,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(VR),this.hot._registerTimeout(()=>{ol(ep,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell()},group:rd}),r.addShortcut({keys:[["Escape"]],callback:()=>{Ie(it,this).setValue(Ie(Dp,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ie(it,this).isVisible()&&Ie(it,this).isFocused(),group:rd}),r.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ie(it,this).isVisible()&&Ie(it,this).isFocused(),group:rd}),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:rd})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(rd)}registerListeners(){const{rootDocument:e}=this.hot,n=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",r=>ar(Ai,this,Q7).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>ar(Ai,this,X7).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>ar(Ai,this,J7).call(this)),this.eventManager.addEventListener(n,"focus",()=>ar(Ai,this,n5).call(this)),this.eventManager.addEventListener(n,"blur",()=>ar(Ai,this,t5).call(this)),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",r=>ar(Ai,this,Z7).call(this,r))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const n=Tu(e.target,"TD","TBODY");return!!(n&&ve(n,"htCommentCell")&&Tu(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,{[Nd]: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,ta),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,Nd)}getCommentAtCell(e,n){return this.getCommentMeta(e,n,Nd)}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(ws,this).cancelHiding(),Ie(it,this).setValue((e=i[ta]?i[ta][Nd]: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,g=d.getCell({row:s,col:a},!0),C=this.getCommentMeta(i,o,sL);C?Ie(it,this).setSize(C.width,C.height):Ie(it,this).resetSize();const y=c?0:f.getColumnWidth(a),E=l&&!u?nn(g):0,{left:v,top:P,width:O,height:L}=g.getBoundingClientRect(),{width:T,height:A}=Ie(it,this).getSize(),{innerWidth:K,innerHeight:U}=this.hot.rootWindow,j=this.hot.rootDocument.documentElement,Z=vn(this.hot.rootDocument),J=kN(this.hot.rootWindow)?Z:0,se=LN(this.hot.rootWindow)?Z:0;let te=v+h.scrollX+y,ue=P+h.scrollY+E;this.hot.isRtl()&&(te-=T+y),this.hot.isLtr()&&v+O+T>K-J?te=v+h.scrollX-T-1:this.hot.isRtl()&&te<-(j.scrollWidth-j.clientWidth)&&(te=v+h.scrollX+y+1),P+A>U-se&&(ue-=A-L+1),Ie(it,this).setPosition(te,ue),Ie(it,this).setReadOnlyState(this.getCommentMeta(i,o,Jm)),Ie(it,this).observeSize()}focusEditor(){Ie(it,this).focus()}updateCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n)[ta];let o;i?(o=Gn(i),Tw(o,r)):o=r,this.hot.setCellMeta(e,n,ta,o)}getCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n);if(i[ta])return i[ta][r]}addToContextMenu(e){e.items.push({name:xe},W7(this),B7(this),j7(this))}getEditorInputElement(){return Ie(it,this).getInputElement()}destroy(){var e,n;(e=Ie(it,this))===null||e===void 0||e.destroy(),(n=Ie(ws,this))===null||n===void 0||n.destroy(),super.destroy()}}function X7(t){if(!(!this.hot.view||!this.hot.view._wt)&&!Ie(qw,this)&&!this.targetIsCommentTextArea(t)){const e=Tu(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 Z7(t){t.stopPropagation()}function Q7(t){const{rootDocument:e}=this.hot;if(!(Ie(qw,this)||Ie(it,this).isFocused()||ve(t.target,"wtBorder")||Ie(WR,this)===t.target||!Ie(it,this)))if(ol(WR,this,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const n=this.hot._createCellRange(this.hot.getCoords(t.target));Ie(ws,this).show(n)}else Su(t.target,e)&&!this.targetIsCommentTextArea(t)&&Ie(ws,this).hide()}function J7(){ol(qw,this,!1)}function e5(t,e){e[ta]&&e[ta][Nd]&&G(t,e.commentedCellClassName)}function t5(){ol(Dp,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function n5(){ol(Dp,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(VR)}function r5(t,e){this.updateCommentMeta(this.range.from.row,this.range.from.col,{[sL]:{width:t,height:e}})}function hA(t){Ie(it,this).isFocused()&&Ko(t)}function i5(){Ie(ep,this)||this.hide()}function o5(){const t=Ie(it,this).getEditorElement();pe(t,/ht-theme-.*/g),G(t,this.hot.getCurrentThemeName())}function qb(t,e,n){return(e=s5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s5(t){var e=a5(t,"string");return typeof e=="symbol"?e:e+""}function a5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class aL{constructor(e){qb(this,"hot",void 0),qb(this,"commands",{}),qb(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=l5(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 l5(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 Xb(t,e,n){return(e=u5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u5(t){var e=c5(t,"string");return typeof e=="symbol"?e:e+""}function c5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 lL{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Xb(this,"hot",void 0),Xb(this,"predefinedItems",iL()),Xb(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 h5(e,this.defaultOrderPattern,this.predefinedItems)}}function h5(){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&&F7.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 Da(t,e,n){return(e=d5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d5(t){var e=f5(t,"string");return typeof e=="symbol"?e:e+""}function f5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class g5{constructor(e,n){Da(this,"top",void 0),Da(this,"topRelative",void 0),Da(this,"left",void 0),Da(this,"leftRelative",void 0),Da(this,"scrollTop",void 0),Da(this,"scrollLeft",void 0),Da(this,"cellHeight",void 0),Da(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 id(t,e,n){m5(t,e),e.set(t,n)}function m5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Me(t,e){return t.get(uL(t,e))}function Xg(t,e,n){return t.set(uL(t,e),n),n}function uL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ln=new WeakMap,rr=new WeakMap,ir=new WeakMap,Zb=new WeakMap,hc=new WeakMap;class p5{constructor(e){id(this,Ln,void 0),id(this,rr,void 0),id(this,ir,void 0),id(this,Zb,!1),id(this,hc,{above:0,below:0,left:0,right:0}),Xg(Zb,this,e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Me(hc,this)[e]=n,this}setElement(e){return Xg(Ln,this,e),this}setParentElement(e){return Xg(rr,this,e),this}updatePosition(e){Xg(ir,this,new g5(e,Me(Ln,this).ownerDocument.defaultView)),Me(Zb,this)?(Me(ir,this).fitsBelow(Me(Ln,this))?this.setPositionBelowCursor():Me(ir,this).fitsAbove(Me(Ln,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){Me(Ln,this).dir==="rtl"?Me(ir,this).fitsOnLeft(Me(Ln,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Me(ir,this).fitsOnRight(Me(Ln,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Me(hc,this).above+Me(ir,this).top-Me(Ln,this).offsetHeight;if(Me(rr,this)){const r=Me(rr,this).ownerDocument.defaultView.getComputedStyle(Me(rr,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),o=Number.parseInt(r.borderTop,10);e=Me(ir,this).top+Me(ir,this).cellHeight-Me(Ln,this).scrollHeight+i+o}Me(Ln,this).style.top=`${e}px`}setPositionBelowCursor(){let e=Me(hc,this).below+Me(ir,this).top+1;if(Me(rr,this)){const r=Me(rr,this).ownerDocument.defaultView.getComputedStyle(Me(rr,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),o=Number.parseInt(r.borderTop,10);e=Me(ir,this).top-i-o-1}Me(Ln,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=Me(ir,this).left;if(Me(rr,this)){const n=Me(rr,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(Me(rr,this).querySelector(".htCore")).borderRightWidth,10);e+=Me(ir,this).cellWidth+r}else e+=Me(hc,this).right;Me(Ln,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=Me(hc,this).left+Me(ir,this).left-Me(Ln,this).offsetWidth;if(Me(rr,this)){const n=Me(rr,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(Me(rr,this).querySelector(".htCore")).borderLeftWidth,10);e-=r}Me(Ln,this).style.left=`${e}px`}}function cL(t){let{initialPage:e=-1,size:n=()=>0,onItemSelect:r=()=>{},onClear:i=()=>{}}=t;const o=new Set;let s=Ue(e,-1,g()-1);function a(y,E){const v=g()-1;return y<0&&(y=v),y>v&&(y=0),o.has(y)?-1:(o.add(y),r(y,!1)===!1&&(y=a(E===1?++y:--y,E)),y)}function l(y){y>-1&&y<g()&&r(y,!0)!==!1&&(s=y)}function u(){return s}function c(){g()>0&&(o.clear(),s=a(0,1))}function h(){g()>0&&(o.clear(),s=a(g()-1,-1))}function d(){g()>0&&(o.clear(),s=a(++s,1))}function f(){g()>0&&(o.clear(),s=a(--s,-1))}function g(){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:g,clear:C}}function w5(t){return Be(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function BR(t){return tn(t,"submenu")}function jR(t){return new RegExp(xe,"i").test(t.name)}function tp(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function dA(t){return tn(t,"disableSelection")}function v5(t){return ve(t,"htSeparator")}function C5(t){return ve(t,"htSubmenu")}function y5(t){return ve(t,"htDisabled")}function b5(t){return ve(t,"htSelectionDisabled")}function S5(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function hL(t,e){const n=t.slice(0);for(let r=0;r<n.length&&n[r].name===e;)n.shift();return n}function R5(t,e){let n=t.slice(0);return n.reverse(),n=hL(n,e),n.reverse(),n}function E5(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 T5(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xe,n=t.slice(0);return n=hL(n,e),n=R5(n,e),n=E5(n),n}function _5(t){return t.checkable===!0}function M5(t){return cL({size:()=>t.countRows(),onItemSelect(e,n){const r=t.getCell(e,0);if(!r||v5(r)||y5(r)||b5(r))return!1;t.selectCell(e,0,...n?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function I5(t){const{hot:e,hotMenu:n}=t;return[{keys:[["Control/Meta","A"]],forwardToContext:e.getShortcutManager().getContext("grid"),callback:()=>t.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(r,i)=>{const o=e.getSettings(),s=typeof o.tabMoves=="function"?o.tabMoves(r):o.tabMoves;i.includes("shift")?e.selection.transformStart(-s.row,-s.col):e.selection.transformStart(s.row,s.col),t.close(!0)}},{keys:[["Escape"]],callback:()=>t.close()},{keys:[["ArrowDown"]],callback:()=>t.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>t.getNavigator().toPreviousItem()},{keys:[[e.isRtl()?"ArrowLeft":"ArrowRight"]],callback:()=>{const r=n.getSelectedLast();if(r){const i=t.openSubMenu(r[0]);i&&i.getNavigator().toFirstItem()}}},{keys:[[e.isRtl()?"ArrowRight":"ArrowLeft"]],callback:()=>{n.getSelectedLast()&&t.isSubMenu()&&(t.close(),t.isSubMenu()&&t.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>t.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>t.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:r=>{const i=n.getSelectedLast();i&&(n.getSourceDataAtRow(i[0]).submenu?t.openSubMenu(i[0]).getNavigator().toFirstItem():(t.executeCommand(r),t.close(!0)))}},{keys:[["PageUp"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(-n.countVisibleRows(),0):t.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(n.countVisibleRows(),0):t.getNavigator().toLastItem()}}]}const dL="menu",fA=dL;function P5(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];r(I5(t)),e.forEach(u=>{let{shortcuts:c,contextName:h}=u;i(c,h)});function r(u,c){a(c).addShortcuts(u,{group:dL})}function i(u,c){const h=a(c);u.forEach(d=>{let{keys:f}=d;f.forEach(g=>h.removeShortcutsByKeys(g))}),n.push({shortcuts:u,contextName:c}),r(u,c)}function o(){return[...n]}function s(u){return u?`${fA}:${u}`:fA}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 O5(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(va(n),G(l,"htItemWrapper"),t.getSettings().ariaTags){const d=!tp(a,t)&&!dA(a)&&!jR(a);ye(n,[..._5(a)?[NU(),hf(c),IN(h)]:[HU(),hf(u)],...d?[Vu(-1)]:[],...tp(a,t)?[WU()]:[],...BR(a)?[ho(!1)]:[]])}n.className="",n.appendChild(l),jR(a)?G(n,"htSeparator"):typeof a.renderer=="function"?(G(n,"htCustomMenuRenderer"),n.appendChild(a.renderer(e,l,r,i,o,u))):ph(l,u),tp(a,t)?G(n,"htDisabled"):dA(a)?G(n,"htSelectionDisabled"):BR(a)&&G(n,"htSubmenu")}}function Qb(t,e,n){x5(t,e),e.set(t,n)}function x5(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=A5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A5(t){var e=H5(t,"string");return typeof e=="symbol"?e:e+""}function H5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Jb(t,e,n){return t.set(fL(t,e),n),n}function jl(t,e){return t.get(fL(t,e))}function fL(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 gA=215;var od=new WeakMap,Zg=new WeakMap,Qg=new WeakMap;class bh{get tableBorderWidth(){return jl(Qg,this)===void 0&&this.hotMenu&&Jb(Qg,this,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),jl(Qg,this)}constructor(e,n){var r=this;is(this,"hot",void 0),is(this,"options",void 0),is(this,"eventManager",new zo(this)),is(this,"container",void 0),is(this,"positioner",void 0),is(this,"hotMenu",null),is(this,"hotSubMenus",{}),is(this,"parentMenu",void 0),is(this,"menuItems",null),is(this,"origOutsideClickDeselects",null),Qb(this,od,void 0),Qb(this,Zg,void 0),Qb(this,Qg,void 0),this.hot=e,this.options=n||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:gA,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new p5(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=Qc(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return jl(od,this)}getKeyboardShortcutsCtrl(){return jl(Zg,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=Ew(a=>this.openSubMenu(a),300),n=this.options.minWidth||gA;let r=!1,i=Eu(this.menuItems,a=>(a.key===yf&&(r=!0),S5(a,this.hot)));if(i.length<1&&!r)i.push(iL()[yf]);else if(i.length===0)return;i=T5(i,xe);let o=!1;const s={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return ae(a)&&a<n?n:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:O5(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,themeName:this.hot.getCurrentThemeName(),beforeRefreshDimensions:()=>!1,beforeOnCellMouseOver:(a,l)=>{jl(od,this).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},afterOnCellContextMenu:a=>{a.preventDefault(),xP()&&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=>{(!xP()||!Mu(a))&&o&&this.hasSelectedItem()&&(ua()||YN()?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(),Jb(od,this,M5(this.hotMenu)),Jb(Zg,this,P5(this)),jl(Zg,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(jl(od,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);ye(r,[ho(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const n=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!n||!C5(n))return!1;const r=this.hotMenu.getSourceDataAtRow(e),i=new bh(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&&ye(n,[ho(!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&&ye(i,[ho(!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?w5(r):[];this.runLocalHooks("executeCommand",n.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",n.key,i,e)}isCommandPassive(e){return e.isCommand===!1||jR(e)||tp(e,this.hot)||BR(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=wr(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&&(ot(r)&&(r=r.call(this.hot),r===null||It(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"),G(i,`htMenu handsontable ${this.options.className}`),r&&G(i,r),this.options.container.appendChild(i)),i}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&ye(this.hotMenu.rootElement,[AU(),Vu(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!Su(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!Su(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&ve(e.target,"htCore")&&Su(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}ut(bh,Rn);function N5(t,e){D5(t,e),e.add(t)}function D5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function eS(t,e,n){return(e=k5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k5(t){var e=L5(t,"string");return typeof e=="symbol"?e:e+""}function L5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jg(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 Dd="contextMenu",$5=70,mA=Dd;re.getSingleton().register("afterContextMenuDefaultOptions");re.getSingleton().register("beforeContextMenuShow");re.getSingleton().register("afterContextMenuShow");re.getSingleton().register("afterContextMenuHide");re.getSingleton().register("afterContextMenuExecute");var sd=new WeakSet;class Xw extends Xe{constructor(){super(...arguments),N5(this,sd),eS(this,"commandExecutor",new aL(this.hot)),eS(this,"itemsFactory",null),eS(this,"menu",null)}static get PLUGIN_KEY(){return Dd}static get PLUGIN_PRIORITY(){return $5}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Yw,Gw,xe,Zf,Qf,xe,zw,eg,xe,Kw,Uw,xe,Jf,xe,io]}isEnabled(){return!!this.hot.getSettings()[Dd]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[Dd];typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.menu=new bh(this.hot,{className:"htContextMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>Jg(sd,this,V5).call(this)),this.menu.addLocalHook("afterOpen",()=>Jg(sd,this,W5).call(this)),this.menu.addLocalHook("afterClose",()=>Jg(sd,this,B5).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=>Jg(sd,this,F5).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=Bw(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:mA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(mA)}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 lL(this.hot,Xw.DEFAULT_ITEMS);const e=this.hot.getSettings()[Dd],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 F5(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(),ve(o,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(n||r)&&!i(o)&&!(ve(o,"current")&&ve(o,"wtBorder"))))return;const s=Bw(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+s.top,left:t.clientX+s.left})}function V5(){this.hot.runHooks("beforeContextMenuShow",this)}function W5(){this.hot.runHooks("afterContextMenuShow",this)}function B5(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}Xw.SEPARATOR={name:xe};function j5(t){return{key:"copy",name(){return this.getTranslatedPhrase(Mr)},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 U5(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),n=e?Ue(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Ma,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 z5(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),n=e?Ue(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(_a,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 Y5(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),n=e?Ue(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Ta,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 G5(t){return{key:"cut",name(){return this.getTranslatedPhrase(Ir)},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 K5{constructor(){this.data={}}setData(e,n){this.data[e]=n}getData(e){return this.data[e]||void 0}}class q5{constructor(){this.clipboardData=new K5}preventDefault(){}composedPath(){return[]}}function X5(t,e){gL(t,e),e.add(t)}function dc(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 Vn(t,e){return t.get(Wc(t,e))}function fc(t,e,n){return t.set(Wc(t,e),n),n}function Wc(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 ka=new WeakMap,tS=new WeakMap,ad=new WeakMap,UR=new WeakMap,zR=new WeakMap,ld=new WeakMap,ud=new WeakSet;class Z5{constructor(e){let{countRows:n,countColumns:r,rowsLimit:i,columnsLimit:o,countColumnHeaders:s}=e;X5(this,ud),dc(this,ka,void 0),dc(this,tS,void 0),dc(this,ad,void 0),dc(this,UR,void 0),dc(this,zR,void 0),dc(this,ld,void 0),fc(tS,this,n),fc(ad,this,r),fc(UR,this,i),fc(zR,this,o),fc(ld,this,s)}setSelectedRange(e){fc(ka,this,e)}getCellsRange(){if(Vn(tS,this).call(this)===0||Vn(ad,this).call(this)===0)return null;const{row:e,col:n}=Vn(ka,this).getTopStartCorner(),{row:r,col:i}=Vn(ka,this).getBottomEndCorner(),o=Wc(ud,this,Q5).call(this,e,r),s=Wc(ud,this,nS).call(this,n,i);return{isRangeTrimmed:r!==o||i!==s,startRow:e,startCol:n,endRow:o,endCol:s}}getMostBottomColumnHeadersRange(){if(Vn(ad,this).call(this)===0||Vn(ld,this).call(this)===0)return null;const{col:e}=Vn(ka,this).getTopStartCorner(),{col:n}=Vn(ka,this).getBottomEndCorner(),r=Wc(ud,this,nS).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-1,startCol:e,endRow:-1,endCol:r}}getAllColumnHeadersRange(){if(Vn(ad,this).call(this)===0||Vn(ld,this).call(this)===0)return null;const{col:e}=Vn(ka,this).getTopStartCorner(),{col:n}=Vn(ka,this).getBottomEndCorner(),r=Wc(ud,this,nS).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-Vn(ld,this).call(this),startCol:e,endRow:-1,endCol:r}}}function nS(t,e){return Math.min(e,Math.max(t+Vn(zR,this).call(this)-1,t))}function Q5(t,e){return Math.min(e,Math.max(t+Vn(UR,this).call(this)-1,t))}function mL(t){const e=[],n=[];return M(t,r=>{const i=Math.min(r.startRow,r.endRow),o=Math.max(r.startRow,r.endRow);de(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);de(s,a,l=>{n.indexOf(l)===-1&&n.push(l)})}),{rows:e,columns:n}}function J5(t,e){pL(t,e),e.add(t)}function La(t,e,n){pL(t,e),e.set(t,n)}function pL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cd(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)}function hr(t,e){return t.get(fr(t,e))}function Oo(t,e,n){return t.set(fr(t,e),n),n}function fr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("afterCopyLimit");re.getSingleton().register("modifyCopyableRange");re.getSingleton().register("beforeCut");re.getSingleton().register("afterCut");re.getSingleton().register("beforePaste");re.getSingleton().register("afterPaste");re.getSingleton().register("beforeCopy");re.getSingleton().register("afterCopy");const rS="copyPaste",nQ=80,rQ=["fragmentSelection"],pA=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var YR=new WeakMap,GR=new WeakMap,KR=new WeakMap,gc=new WeakMap,em=new WeakMap,tm=new WeakMap,mc=new WeakMap,kp=new WeakMap,Vi=new WeakSet;class iQ extends Xe{constructor(){super(...arguments),J5(this,Vi),cd(this,"columnsLimit",1/0),cd(this,"rowsLimit",1/0),cd(this,"pasteMode","overwrite"),cd(this,"uiContainer",this.hot.rootDocument.body),La(this,YR,!1),La(this,GR,!1),La(this,KR,!1),La(this,gc,"cells-only"),La(this,em,!1),La(this,tm,!1),La(this,mc,new Z5({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),La(this,kp,!1),cd(this,"copyableRanges",[])}static get PLUGIN_KEY(){return rS}static get SETTING_KEYS(){return[rS,...rQ]}static get PLUGIN_PRIORITY(){return nQ}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[rS]}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"),Oo(YR,this,this.getSetting("copyColumnHeaders")),Oo(GR,this,this.getSetting("copyColumnGroupHeaders")),Oo(KR,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=(n=this.getSetting("uiContainer"))!==null&&n!==void 0?n:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",i=>fr(Vi,this,aQ).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 fr(Vi,r,lQ).call(r,...o)}),this.addHook("afterSelectionEnd",()=>fr(Vi,this,uQ).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)}),yp()&&(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 fr(Vi,r,cQ).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 fr(Vi,r,hQ).call(r,...o)}),this.addHook("afterSelection",()=>fr(Vi,this,dQ).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";Oo(gc,this,e),Oo(em,this,!0),fr(Vi,this,wA).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(){Oo(tm,this,!0),fr(Vi,this,wA).call(this,"cut")}getRangedCopyableData(e){return jd(this.getRangedData(e))}getRangedData(e){const n=[],{rows:r,columns:i}=mL(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 q5;e&&r.clipboardData.setData("text/plain",e),n&&r.clipboardData.setData("text/html",n),this.onPaste(r)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}hr(mc,this).setSelectedRange(e);const n=new Map([["headers",null],["cells",null]]);hr(gc,this)==="column-headers-only"?n.set("headers",hr(mc,this).getMostBottomColumnHeadersRange()):(hr(gc,this)==="with-column-headers"?n.set("headers",hr(mc,this).getMostBottomColumnHeadersRange()):hr(gc,this)==="with-column-group-headers"&&n.set("headers",hr(mc,this).getAllColumnHeadersRange()),n.set("cells",hr(mc,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:g,visualRow:C}=this.hot.getCellMeta(c,a);if(c=C+1,g===!0)continue;d=C,h=a;const y=[],E=o.length%r;for(;y.length<i||h<=u;){const{skipColumnOnPaste:v,visualCol:P}=this.hot.getCellMeta(s,h);if(h=P+1,v===!0)continue;f=P;const O=y.length%i;y.push(e[E][O])}o.push(y)}return Oo(kp,this,!0),this.hot.populateFromArray(s,a,o,void 0,void 0,"CopyPaste.paste",this.pasteMode),[s,a,d,f]}onCopy(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!hr(em,this)||this.isEditorOpened()||pa(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Ym(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),Oo(em,this,!1);const o=this.getRangedData(this.copyableRanges),s=fr(Vi,this,oQ).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",o,this.copyableRanges,s)){const l=jd(o);if(e&&e.clipboardData){const u=oO(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",l),e.clipboardData.setData("text/html",[pA,u].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",l);this.hot.runHooks("afterCopy",o,this.copyableRanges,s)}Oo(gc,this,"cells-only")}onCut(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!hr(tm,this)||this.isEditorOpened()||pa(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Ym(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),Oo(tm,this,!1);const o=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",o,this.copyableRanges)){const a=jd(o);if(e&&e.clipboardData){const l=oO(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",a),e.clipboardData.setData("text/html",[pA,l].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",a);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",o,this.copyableRanges)}}onPaste(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||pa(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Ym(n,this.hot.rootElement)))return;e.preventDefault();let o;if(e&&typeof e.clipboardData<"u"){const c=YE(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});c&&/(<table)|(<TABLE)/g.test(c)?o=uY(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=Zq(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 wA(t){if(yp()){const e=this.hot.getSelectedRangeLast();if(e){const{row:n,col:r}=e.highlight,i=this.hot.getCell(n,r,!0);i&&lz(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function oQ(t){const{rows:e}=mL(t);let n=0;for(let r=0;r<e.length&&!(e[r]>=0);r++)n+=1;return{columnHeadersCount:n}}function sQ(){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&&VN(r)}}}function wL(){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")&&WN(r)}}}function aQ(t){t.items.push({name:"---------"},j5(this)),hr(YR,this)&&t.items.push(Y5(this)),hr(GR,this)&&t.items.push(z5(this)),hr(KR,this)&&t.items.push(U5(this)),t.items.push(G5(this))}function lQ(t,e,n,r,i){hr(kp,this)&&(i.value=!0),Oo(kp,this,!1)}function uQ(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function cQ(){fr(Vi,this,wL).call(this)}function hQ(){fr(Vi,this,sQ).call(this)}function dQ(){fr(Vi,this,wL).call(this)}function vL(t,e){return`border_row${t}col${e}`}function kd(){return{width:1,color:"#000"}}function ca(){return{hide:!0}}function fQ(){return{width:1,color:"#000",cornerVisible:!1}}function iS(t){if(ae(t.start)||ae(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(ae(t.end)||ae(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 hd(t){return ae(t.start)&&(t.left=t.start),ae(t.end)&&(t.right=t.end),t}function oS(t,e){return{id:vL(t,e),border:fQ(),row:t,col:e,top:ca(),bottom:ca(),start:ca(),end:ca()}}function gQ(t,e){return tn(e,"border")&&e.border&&(t.border=e.border),tn(e,"top")&&ae(e.top)&&(e.top?(Ae(e.top)||(e.top=kd()),t.top=e.top):(e.top=ca(),t.top=e.top)),tn(e,"bottom")&&ae(e.bottom)&&(e.bottom?(Ae(e.bottom)||(e.bottom=kd()),t.bottom=e.bottom):(e.bottom=ca(),t.bottom=e.bottom)),tn(e,"start")&&ae(e.start)&&(e.start?(Ae(e.start)||(e.start=kd()),t.start=e.start):(e.start=ca(),t.start=e.start)),tn(e,"end")&&ae(e.end)&&(e.end?(Ae(e.end)||(e.end=kd()),t.end=e.end):(e.end=ca(),t.end=e.end)),t}function ya(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 Zw(t){return`<span class="selected">✓</span>${t}`}function mQ(t){return t.some(e=>ae(e.left)||ae(e.right))}function pQ(t){return t.some(e=>ae(e.start)||ae(e.end))}const wQ=new Map([["left","start"],["right","end"]]);function vQ(t){var e;return(e=wQ.get(t))!==null&&e!==void 0?e:t}function CQ(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(Kr);return ya(this,"bottom")&&(e=Zw(e)),e},callback(e,n){const r=ya(this,"bottom");t.prepareBorder(n,"bottom",r)}}}function yQ(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let n=this.getTranslatedPhrase(qr);return ya(this,e)&&(n=Zw(n)),n},callback(n,r){const i=ya(this,e);t.prepareBorder(r,e,i)}}}function bQ(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(Xr)},callback(e,n){t.prepareBorder(n,"noBorders")},disabled(){return!ya(this)}}}function SQ(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let n=this.getTranslatedPhrase(Gr);return ya(this,e)&&(n=Zw(n)),n},callback(n,r){const i=ya(this,e);t.prepareBorder(r,e,i)}}}function RQ(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(Yr);return ya(this,"top")&&(e=Zw(e)),e},callback(e,n){const r=ya(this,"top");t.prepareBorder(n,"top",r)}}}function EQ(t,e){TQ(t,e),e.add(t)}function TQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _Q(t,e,n){return(e=MQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function MQ(t){var e=IQ(t,"string");return typeof e=="symbol"?e:e+""}function IQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 vA(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="customBorders",PQ=90;var sS=new WeakSet;class OQ extends Xe{constructor(){super(...arguments),EQ(this,sS),_Q(this,"savedBorders",[])}static get PLUGIN_KEY(){return np}static get PLUGIN_PRIORITY(){return PQ}isEnabled(){return!!this.hot.getSettings()[np]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>vA(sS,this,xQ).call(this,e)),this.addHook("init",()=>vA(sS,this,AQ).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=iS(n));const o=th(e),s=pf(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,vQ(c))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const n=th(e),r=pf(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(hd(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=oS(e,n);r&&(a=gQ(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",hd(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);de(e.from.row,r,o=>{de(e.from.col,i,s=>{const a=oS(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",hd(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,n){const r=vL(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=oS(e,n):o=iS(o),i?(o[r]=ca(),this.countHide(o)===4?this.removeAllBorders(e,n):(this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",hd(o)))):(o[r]=kd(),this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",hd(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":de(o.col,s.col,a=>{de(o.row,s.row,l=>{this.removeAllBorders(l,a)})});break;case"top":de(o.col,s.col,a=>{this.setBorder(o.row,a,n,r)});break;case"bottom":de(o.col,s.col,a=>{this.setBorder(s.row,a,n,r)});break;case"start":de(o.row,s.row,a=>{this.setBorder(a,o.col,n,r)});break;case"end":de(o.row,s.row,a=>{this.setBorder(a,s.col,n,r)});break}})}createCustomBorders(e){M(e,n=>{const r=iS(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 wr([n,r,i,o],(a,l)=>{let u=a;return l&&l.hide&&(u+=1),u},0)}clearBordersFromSelectionSettings(e){const n=Be(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=Be(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()[np];if(Array.isArray(e)){const n=Gn(e);this.checkSettingsCohesion(n),n.length||(this.savedBorders=n),this.createCustomBorders(n)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const n=mQ(e),r=pQ(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 xQ(t){this.hot.getSettings()[np]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(zr)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[RQ(this),SQ(this),CQ(this),yQ(this),bQ(this)]}})}function AQ(){this.changeBorderSettings()}function HQ(t,e){NQ(t,e),e.add(t)}function NQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function aS(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)}function CA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const yA="dragToScroll",LQ=100;var lS=new WeakSet;class $Q extends Xe{constructor(){super(...arguments),HQ(this,lS),aS(this,"boundaries",null),aS(this,"callback",null),aS(this,"listening",!1)}static get PLUGIN_KEY(){return yA}static get PLUGIN_PRIORITY(){return LQ}isEnabled(){return!!this.hot.getSettings()[yA]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>CA(lS,this,bA).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>CA(lS,this,bA).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=Qc(n)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function bA(t){if(Mu(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 FQ(t,e){CL(t,e),e.add(t)}function VQ(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 uS(t,e,n){return(e=WQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WQ(t){var e=BQ(t,"string");return typeof e=="symbol"?e:e+""}function BQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jQ(t,e){return t.get(oo(t,e))}function yL(t,e,n){return t.set(oo(t,e),n),n}function oo(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("afterDropdownMenuDefaultOptions");re.getSingleton().register("beforeDropdownMenuShow");re.getSingleton().register("afterDropdownMenuShow");re.getSingleton().register("afterDropdownMenuHide");re.getSingleton().register("afterDropdownMenuExecute");const rp="dropdownMenu",UQ=230,bf="changeType",cS=rp;var Qw=new WeakMap,Ho=new WeakSet;class Jw extends Xe{static get PLUGIN_KEY(){return rp}static get PLUGIN_PRIORITY(){return UQ}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Zf,Qf,xe,eg,xe,jw,xe,Jf,xe,io]}constructor(e){super(e),FQ(this,Ho),uS(this,"commandExecutor",new aL(this.hot)),uS(this,"itemsFactory",null),uS(this,"menu",null),VQ(this,Qw,!1),this.hot.addHook("afterGetColHeader",(n,r)=>oo(Ho,this,YQ).call(this,n,r))}isEnabled(){return this.hot.getSettings()[rp]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new lL(this.hot,Jw.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 oo(Ho,e,QQ).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 oo(Ho,e,ZQ).call(e,...o)});const n=this.hot.getSettings()[rp],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 bh(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",()=>oo(Ho,this,GQ).call(this)),this.menu.addLocalHook("afterOpen",()=>oo(Ho,this,KQ).call(this)),this.menu.addLocalHook("afterSubmenuOpen",o=>oo(Ho,this,qQ).call(this,o)),this.menu.addLocalHook("afterClose",()=>oo(Ho,this,XQ).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=Bw(this.menu.container,this.hot.rootDocument),s=this.hot.getCell(-1,i.col,!0).querySelector(`.${bf}`),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:cS},{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:cS}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(cS)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>oo(Ho,this,zQ).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 bL(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function zQ(t){if(ve(t.target,bf)){const e=Bw(this.menu.container,this.hot.rootDocument),n=t.target.getBoundingClientRect();t.stopPropagation(),yL(Qw,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 YQ(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(`.${bf}`);if(this.enabled&&o)return;if(!this.enabled){o&&o.parentNode.removeChild(o);return}const s=this.hot.rootDocument.createElement("button");s.className=bf,s.type="button",s.tabIndex=-1,this.hot.getSettings().ariaTags&&(ye(s,[Wu(),hf(" ")]),ye(e,[TN("menu")])),s.onclick=function(){return!1},e.firstChild.insertBefore(s,e.firstChild.firstChild)}function GQ(){this.hot.runHooks("beforeDropdownMenuShow",this)}function KQ(){this.hot.runHooks("afterDropdownMenuShow",this),oo(Ho,this,bL).call(this,this.menu)}function qQ(t){oo(Ho,this,bL).call(this,t)}function XQ(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function ZQ(t){return jQ(Qw,this)?null:t}function QQ(t){ve(t.target,bf)&&yL(Qw,this,!0)}Jw.SEPARATOR={name:xe};function SA(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=eJ(t,"string");return typeof e=="symbol"?e:e+""}function eJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 tJ{constructor(e){SA(this,"hot",void 0),SA(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 de(e,r,a=>{const l=[];!o.exportHiddenRows&&this._isHiddenRow(a)||(de(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();de(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();de(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 RA(t,e,n){return(e=nJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nJ(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)}class iT{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){RA(this,"dataProvider",void 0),RA(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(n),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let n=Is(this.constructor.DEFAULT_OPTIONS);const r=new Date;return n=rn(Is(iT.DEFAULT_OPTIONS),n),n=rn(n,e),n.filename=SN(n.filename,{YYYY:r.getFullYear(),MM:`${r.getMonth()+1}`.padStart(2,"0"),DD:`${r.getDate()}`.padStart(2,"0")}),n}}function iJ(t,e){oJ(t,e),e.add(t)}function oJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function EA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const SL="\r",sJ='"',aJ=`
259
+ `,lJ="=",uJ="+",cJ="-",hJ="@",dJ=" ";var hS=new WeakSet;class fJ extends iT{constructor(){super(...arguments),iJ(this,hS)}static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
260
+ `,sanitizeValues:!1}}export(){const e=this.options,n=this.dataProvider.getData();let r=this.dataProvider.getColumnHeaders();const i=r.length>0,o=this.dataProvider.getRowHeaders(),s=o.length>0;let a=e.bom?"\uFEFF":"";return i&&(r=Be(r,l=>this._escapeCell(l,{force:!0,sanitizeValue:e.sanitizeValues})),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],{sanitizeValue:e.sanitizeValues}),a+=e.columnDelimiter);const c=l.map(h=>this._escapeCell(h,{sanitizeValue:e.sanitizeValues})).join(e.columnDelimiter);a+=c}),a}_escapeCell(e){let{force:n=!1,sanitizeValue:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=Pt(e);return i===""||(r&&(n=!0),r instanceof RegExp?i=EA(hS,this,mJ).call(this,i,r):typeof r=="function"?i=r(i):r&&(i=EA(hS,this,gJ).call(this,i)),(n||i.indexOf(SL)>=0||i.indexOf(sJ)>=0||i.indexOf(aJ)>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(new RegExp('"',"g"),'""'),i=`"${i}"`)),i}}function gJ(t){return t.startsWith(lJ)||t.startsWith(uJ)||t.startsWith(cJ)||t.startsWith(hJ)||t.startsWith(dJ)||t.startsWith(SL)?`'${t}`:t}function mJ(t,e){return e.test(t)?`'${t}`:t}const pJ="csv",qR={[pJ]:fJ};function wJ(t,e,n){return typeof qR[t]=="function"?new qR[t](e,n):null}const vJ="exportFile",CJ=240;class yJ extends Xe{static get PLUGIN_KEY(){return vJ}static get PLUGIN_PRIORITY(){return CJ}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(!qR[e])throw new Error(`Export format type "${e}" is not supported.`);return wJ(e,new tJ(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 pc(t,e,n){return(e=bJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bJ(t){var e=SJ(t,"string");return typeof e=="symbol"?e:e+""}function SJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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){let{id:r,stateless:i=!0}=n;pc(this,"hot",void 0),pc(this,"id",void 0),pc(this,"elements",[]),pc(this,"hidden",!1),pc(this,"stateId",""),pc(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 xw)}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}}ut(tg,Rn);const Sf={};function dl(t,e){if(!Sf[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:n,descriptor:r}=Sf[t];let i=e;return r.inputValuesDecorator&&(i=r.inputValuesDecorator(i)),function(o){return n.apply(o.meta.instance,[].concat([o],[i]))}}function vu(t){if(!Sf[t])throw Error(`Filter condition "${t}" does not exist.`);return Sf[t].descriptor}function Xt(t,e,n){n.key=t,Sf[t]={condition:e,descriptor:n}}const wn="none";function RJ(){return!0}Xt(wn,RJ,{name:Zn,inputsCount:0,showOperators:!1});const Yd="empty";function EJ(t){return Ut(t.value)}Xt(Yd,EJ,{name:ri,inputsCount:0,showOperators:!0});const ip="not_empty";function TJ(t,e){return!dl(Yd,e)(t)}Xt(ip,TJ,{name:ii,inputsCount:0,showOperators:!0});const Gd="eq";function _J(t,e){let[n]=e;return Pt(t.value).toLocaleLowerCase(t.meta.locale)===Pt(n)}Xt(Gd,_J,{name:oi,inputsCount:1,showOperators:!0});const op="neq";function MJ(t,e){return!dl(Gd,e)(t)}Xt(op,MJ,{name:si,inputsCount:1,showOperators:!0});const RL="gt";function IJ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>r}Xt(RL,IJ,{name:hi,inputsCount:1,showOperators:!0});const EL="gte";function PJ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>=r}Xt(EL,PJ,{name:di,inputsCount:1,showOperators:!0});const TL="lt";function OJ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<r}Xt(TL,OJ,{name:fi,inputsCount:1,showOperators:!0});const _L="lte";function xJ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<=r}Xt(_L,xJ,{name:gi,inputsCount:1,showOperators:!0});const oT="date_after";function AJ(t,e){let[n]=e;const r=X(t.value,t.meta.dateFormat),i=X(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)>=0}Xt(oT,AJ,{name:wi,inputsCount:1,showOperators:!0});const sT="date_before";function HJ(t,e){let[n]=e;const r=X(t.value,t.meta.dateFormat),i=X(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)<=0}Xt(sT,HJ,{name:vi,inputsCount:1,showOperators:!0});const Lp="between";function NJ(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=dl(sT,[o]),a=dl(oT,[i]);return s(t)&&a(t)}return t.value>=i&&t.value<=o}Xt(Lp,NJ,{name:mi,inputsCount:2,showOperators:!0});const ML="not_between";function DJ(t,e){return!dl(Lp,e)(t)}Xt(ML,DJ,{name:pi,inputsCount:2,showOperators:!0});const IL="begins_with";function kJ(t,e){let[n]=e;return Pt(t.value).toLocaleLowerCase(t.meta.locale).startsWith(Pt(n))}Xt(IL,kJ,{name:ai,inputsCount:1,showOperators:!0});const PL="ends_with";function LJ(t,e){let[n]=e;return Pt(t.value).toLocaleLowerCase(t.meta.locale).endsWith(Pt(n))}Xt(PL,LJ,{name:li,inputsCount:1,showOperators:!0});const aT="contains";function $J(t,e){let[n]=e;return Pt(t.value).toLocaleLowerCase(t.meta.locale).indexOf(Pt(n))>=0}Xt(aT,$J,{name:ui,inputsCount:1,showOperators:!0});const OL="not_contains";function FJ(t,e){return!dl(aT,e)(t)}Xt(OL,FJ,{name:ci,inputsCount:1,showOperators:!0});const xL="date_tomorrow";function VJ(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().subtract(-1,"days").startOf("day"),"d"):!1}Xt(xL,VJ,{name:yi,inputsCount:0});const AL="date_today";function WJ(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().startOf("day"),"d"):!1}Xt(AL,WJ,{name:Ci,inputsCount:0});const HL="date_yesterday";function BJ(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().subtract(1,"days").startOf("day"),"d"):!1}Xt(HL,BJ,{name:bi,inputsCount:0});mz();function jJ(t,e){let n=t;return n===""&&(n=`(${e})`),n}function ng(t){const e=new Set(t);return function(n){return e.has(n)}}function lT(t){return t??""}function XR(t){return Array.from(new Set(t)).map(e=>lT(e)).sort((e,n)=>typeof e=="number"&&typeof n=="number"?e-n:e===n?0:e>n?1:-1)}function TA(t,e,n,r){const i=[],o=t===e;let s;return o||(s=ng(e)),t.forEach(a=>{let l=!1;(o||s(a))&&(l=!0);const u={checked:l,value:a,visualValue:jJ(a,n)};r&&r(u),i.push(u)}),i}const Cu="by_value";function UJ(t,e){let[n]=e;return n(t.value)}Xt(Cu,UJ,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[ng(e)]},showOperators:!1});const Rf={};function zJ(t){if(!Rf[t])throw Error(`Operation with id "${t}" does not exist.`);const e=Rf[t].func;return function(n,r){return e(n,r)}}function YJ(t){return Rf[t].name}function uT(t,e,n){Rf[t]={name:e,func:n}}const cl="conjunction",GJ=Ei;function KJ(t,e){return t.every(n=>n.func(e))}uT(cl,GJ,KJ);const $p="disjunction",qJ=Qn;function XJ(t,e){return t.some(n=>n.func(e))}uT($p,qJ,XJ);const cT="disjunctionWithExtraCondition",ZJ=Qn;function QJ(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)}uT(cT,ZJ,QJ);const JJ="numeric",NL="text",eee="date",_A={[JJ]:[wn,xe,Yd,ip,xe,Gd,op,xe,RL,EL,TL,_L,Lp,ML],[NL]:[wn,xe,Yd,ip,xe,Gd,op,xe,IL,PL,xe,aT,OL],[eee]:[wn,xe,Yd,ip,xe,Gd,op,xe,sT,oT,Lp,xe,xL,AL,HL]};function tee(t){const e=[];let n=t;return _A[n]||(n=NL),M(_A[n],r=>{let i;r===xe?i={name:xe}:i=Is(vu(r)),e.push(i)}),e}function dd(t,e,n){return(e=nee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nee(t){var e=ree(t,"string");return typeof e=="symbol"?e:e+""}function ree(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const dS="built",fS="building",MA=["click","input","keydown","keypress","keyup","focus","blur","change"];let Wo=class DL{static get DEFAULTS(){return Is({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,n){dd(this,"hot",void 0),dd(this,"eventManager",new zo(this)),dd(this,"options",void 0),dd(this,"_element",void 0),dd(this,"buildState",void 0),this.hot=e,this.options=rn(DL.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===fS?this._element:this.buildState===dS?(this.update(),this._element):(this.buildState=fS,this.build(),this.buildState=dS,this._element)}isBuilt(){return this.buildState===dS}translateIfPossible(e){return typeof e=="string"&&e.startsWith(Xn)?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=fS),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&&G(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(MA,r=>e(n,r))}else M(MA,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}};ut(Wo,Rn);function iee(t,e){kL(t,e),e.add(t)}function oee(t,e,n){kL(t,e),e.set(t,n)}function kL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nm(t,e){return t.get(hT(t,e))}function see(t,e,n){return t.set(hT(t,e),n),n}function hT(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 wc=new WeakMap,IA=new WeakSet;class hl extends Wo{static get DEFAULTS(){return Is({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,n){super(e,rn(hl.DEFAULTS,n)),iee(this,IA),oee(this,wc,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>hT(IA,this,aee).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");see(wc,this,this._element.firstChild),G(this._element,"htUIInput"),G(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(nm(wc,this).type=this.options.type,nm(wc,this).placeholder=this.translateIfPossible(this.options.placeholder),nm(wc,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&nm(wc,this).focus()}}function aee(t){this.options.value=t.target.value}function lee(t,e){LL(t,e),e.add(t)}function fd(t,e,n){LL(t,e),e.set(t,n)}function LL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vc(t,e,n){return t.set(Kd(t,e),n),n}function Ot(t,e){return t.get(Kd(t,e))}function Kd(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var un=new WeakMap,rm=new WeakMap,im=new WeakMap,gS=new WeakMap,om=new WeakMap,sm=new WeakSet;class Ef extends Wo{static get DEFAULTS(){return Is({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,n){super(e,rn(Ef.DEFAULTS,n)),lee(this,sm),fd(this,un,null),fd(this,rm,[]),fd(this,im,void 0),fd(this,gS,void 0),fd(this,om,void 0),this.registerHooks()}getMenu(){return Ot(un,this)}registerHooks(){this.addLocalHook("click",()=>Kd(sm,this,hee).call(this))}setItems(e){vc(rm,this,this.translateNames(e)),Ot(un,this)&&Ot(un,this).setMenuItems(Ot(rm,this))}translateNames(e){return M(e,n=>{n.name=this.translateIfPossible(n.name)}),e}build(){super.build(),vc(un,this,new bh(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),Ot(un,this).setMenuItems(Ot(rm,this));const e=new Wo(this.hot,{className:"htUISelectCaption"}),n=new Wo(this.hot,{className:"htUISelectDropdown"});vc(im,this,e),vc(gS,this,e.element),vc(om,this,n),this.hot.getSettings().ariaTags&&(ye(n.element,[Wu()]),ye(this._element,[EN()])),M([e,n],r=>this._element.appendChild(r.element)),Ot(un,this).addLocalHook("select",r=>Kd(sm,this,uee).call(this,r)),Ot(un,this).addLocalHook("afterClose",()=>Kd(sm,this,cee).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=Ot(un,this).hot.getTranslatedPhrase(Zn),Ot(gS,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();Ot(un,this)&&(Ot(un,this).open(),Ot(un,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),Ot(un,this).getNavigator().toFirstItem(),Ot(un,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:n=>{this.closeOptions(),this.runLocalHooks("tabKeydown",n)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){Ot(un,this)&&Ot(un,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){Ot(un,this)&&(Ot(un,this).destroy(),vc(un,this,null)),Ot(im,this)&&Ot(im,this).destroy(),Ot(om,this)&&Ot(om,this).destroy(),super.destroy()}}function uee(t){t.name!==xe&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function cee(){this.runLocalHooks("afterClose")}function hee(){this.openOptions()}function dee(t,e){fee(t,e),e.add(t)}function fee(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=gee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gee(t){var e=mee(t,"string");return typeof e=="symbol"?e:e+""}function mee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 OA(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 mS=new WeakSet;class ZR extends tg{constructor(e,n){super(e,{id:n.id,stateless:!1}),dee(this,mS),PA(this,"name",""),PA(this,"addSeparator",!1),this.name=n.name,this.addSeparator=n.addSeparator,this.elements.push(new Ef(this.hot,{menuContainer:n.menuContainer})),this.elements.push(new hl(this.hot,{placeholder:Oi})),this.elements.push(new hl(this.hot,{placeholder:xi})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>OA(mS,this,pee).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),M(this.getInputElements(),e=>{e.addLocalHook("keydown",n=>OA(mS,this,wee).call(this,n))})}setState(e){if(this.reset(),!e)return;const n=Is(e.command);n.name.startsWith($t)&&(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()||vu(wn),n=[];return M(this.getInputElements(),(r,i)=>{e.inputsCount>i&&n.push(r.getValue())}),{command:e,args:n}}updateState(e,n){const r=vu(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 Ef)[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 hl)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{G(n.parentNode,"htFiltersMenuCondition"),this.addSeparator&&G(n.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return G(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=[vu(wn)];if(e!==null){const{visualIndex:r}=e;n=tee(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 pee(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 wee(t){Bf(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Ko(t))}function xA(t,e,n){vee(t,e),e.set(t,n)}function vee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gd(t,e){return t.get($L(t,e))}function AA(t,e,n){return t.set($L(t,e),n),n}function $L(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,pS=new WeakMap;class Fp extends Wo{static get DEFAULTS(){return Is({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,n){super(e,rn(Fp.DEFAULTS,n)),xA(this,Cc,void 0),xA(this,pS,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),AA(pS,this,e),AA(Cc,this,this._element.firstChild),gd(Cc,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(gd(pS,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?gd(Cc,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(gd(Cc,this).checked=e)}focus(){this.isBuilt()&&gd(Cc,this).focus()}}function Cee(t,e){yee(t,e),e.add(t)}function yee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bee(t,e,n){return(e=See(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function See(t){var e=Ree(t,"string");return typeof e=="symbol"?e:e+""}function Ree(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Eee(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 HA=0;var NA=new WeakSet;class Tee extends tg{constructor(e,n){super(e,{id:n.id,stateless:!1}),Cee(this,NA),bee(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)=>(G(n.parentNode,"htFiltersMenuOperators"),M(this.elements,r=>n.appendChild(r.element)),n)}}buildOperatorsElement(){const e=[cl,$p];M(e,n=>{const r=new Fp(this.hot,{name:"operator",label:{htmlFor:n,textContent:YJ(n)},value:n,checked:n===e[HA],id:n});r.addLocalHook("change",i=>Eee(NA,this,_ee).call(this,i)),this.elements.push(r)})}setChecked(e){if(this.elements.length<e)throw Error(nt`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 Fp&&n.isChecked());return e?e.getValue():cl}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]:cl,n=arguments.length>1?arguments[1]:void 0,r=e;r===cT&&(r=$p),this.state.setValueAtIndex(n,r)}reset(){this.setChecked(HA)}}function _ee(t){this.setState(t.target.value)}function Mee(t,e,n){Iee(t,e),e.set(t,n)}function Iee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wS(t,e){return t.get(FL(t,e))}function Pee(t,e,n){return t.set(FL(t,e),n),n}function FL(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 md=new WeakMap;class Tf extends Wo{static get DEFAULTS(){return Is({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,n){super(e,rn(Tf.DEFAULTS,n)),Mee(this,md,void 0)}build(){super.build(),Pee(md,this,this._element.firstChild)}update(){this.isBuilt()&&(wS(md,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&wS(md,this).focus()}activate(){wS(md,this).click()}}function Oee(t,e){VL(t,e),e.add(t)}function yc(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 Te(t,e){return t.get(Bc(t,e))}function To(t,e,n){return t.set(Bc(t,e),n),n}function Bc(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const DA="multipleSelect.itemBox";var No=new WeakMap,Wt=new WeakMap,vS=new WeakMap,Ys=new WeakMap,$a=new WeakMap,Fa=new WeakMap,pd=new WeakSet;class _f extends Wo{static get DEFAULTS(){return Is({className:"htUIMultipleSelect",value:[]})}constructor(e,n){super(e,rn(_f.DEFAULTS,n)),Oee(this,pd),yc(this,No,[]),yc(this,Wt,void 0),yc(this,vS,void 0),yc(this,Ys,void 0),yc(this,$a,void 0),yc(this,Fa,void 0),To(Ys,this,new hl(this.hot,{placeholder:Pi,className:"htUIMultipleSelectSearch"})),To($a,this,new Tf(this.hot,{textContent:Ti,className:"htUISelectAll"})),To(Fa,this,new Tf(this.hot,{textContent:_i,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return Te(Wt,this)}registerHooks(){Te(Ys,this).addLocalHook("keydown",e=>Bc(pd,this,Aee).call(this,e)),Te(Ys,this).addLocalHook("input",e=>Bc(pd,this,xee).call(this,e)),Te($a,this).addLocalHook("click",e=>Bc(pd,this,Hee).call(this,e)),Te(Fa,this).addLocalHook("click",e=>Bc(pd,this,Nee).call(this,e))}setItems(e){var n;To(No,this,e),(n=Te(Wt,this))===null||n===void 0||n.loadData(Te(No,this))}setLocale(e){To(vS,this,e)}getLocale(){return Te(vS,this)}getItems(){return[...Te(No,this)]}getValue(){return kee(Te(No,this))}getSearchInputElement(){return Te(Ys,this)}getSelectAllElement(){return Te($a,this)}getClearAllElement(){return Te(Fa,this)}isSelectedAllValues(){return Te(No,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,n=e.createElement("div"),r=new Wo(this.hot,{className:"htUISelectionControls",children:[Te($a,this),Te(Fa,this)]});this._element.appendChild(Te(Ys,this).element),this._element.appendChild(r.element),this._element.appendChild(n);const i=o=>{var s;if(!this._element)return;(s=Te(Wt,this))===null||s===void 0||s.destroy(),G(o,"htUIMultipleSelectHot"),To(Wt,this,new this.hot.constructor(o,{data:Te(No,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(u,c,h,d,f,g)=>{u.title=g.instance.getDataAtRowProp(c,g.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{Te(Wt,this).listen()},modifyColWidth:u=>{const c=Te(Wt,this).container.scrollWidth-vn(e);return u!==void 0&&u<c?c:u},maxCols:1,autoWrapCol:!0,height:110,copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},themeName:this.hot.getCurrentThemeName(),layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),Te(Wt,this).init(),this.hot.addHook("afterSetTheme",(u,c)=>{c||Te(Wt,this).useTheme(u)});const l=Te(Wt,this).getShortcutManager().getContext("grid");l.removeShortcutsByKeys(["Tab"]),l.removeShortcutsByKeys(["Shift","Tab"]),l.addShortcut({keys:[["Escape"]],callback:u=>{this.runLocalHooks("keydown",u,this)},group:DA}),l.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:u=>{Te(Wt,this).deselectCell(),this.runLocalHooks("keydown",u,this),this.runLocalHooks("listTabKeydown",u,this)},group:DA})};i(n),this.hot._registerTimeout(()=>i(n),100)}focus(){this.isBuilt()&&Te(Wt,this).listen()}reset(){Te(Ys,this).reset(),Te($a,this).reset(),Te(Fa,this).reset()}update(){this.isBuilt()&&(Te(Wt,this).loadData(Dee(Te(No,this),this.options.value)),super.update())}destroy(){var e;(e=Te(Wt,this))===null||e===void 0||e.destroy(),Te(Ys,this).destroy(),Te(Fa,this).destroy(),Te($a,this).destroy(),To(Ys,this,null),To(Fa,this,null),To($a,this,null),To(Wt,this,null),To(No,this,null),super.destroy()}}function xee(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let n;e===""?n=[...Te(No,this)]:n=Te(No,this).filter(r=>`${r.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),Te(Wt,this).loadData(n)}function Aee(t){this.runLocalHooks("keydown",t,this),BN(Bf,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),Ko(t),Te(Wt,this).listen(),Te(Wt,this).selectCell(0,0))}function Hee(t){const e=[];t.preventDefault(),Te(Wt,this).getSourceData().forEach((n,r)=>{n.checked=!0,e.push(_D(n,r)[0])}),Te(Wt,this).setSourceDataAtCell(e)}function Nee(t){const e=[];t.preventDefault(),Te(Wt,this).getSourceData().forEach((n,r)=>{n.checked=!1,e.push(_D(n,r)[0])}),Te(Wt,this).setSourceDataAtCell(e)}function Dee(t,e){const n=ng(e);return t.map(r=>(r.checked=n(r.value),r))}function kee(t){const e=[];return t.forEach(n=>{n.checked&&e.push(n.value)}),e}function Lee(t,e){$ee(t,e),e.add(t)}function $ee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fee(t,e,n){return(e=Vee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vee(t){var e=Wee(t,"string");return typeof e=="symbol"?e:e+""}function Wee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 am(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 wd=new WeakSet;class Bee extends tg{constructor(e,n){super(e,{id:n.id,stateless:!1}),Lee(this,wd),Fee(this,"name",""),this.name=n.name,this.elements.push(new _f(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>am(wd,this,jee).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,n)=>am(wd,this,Uee).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===Cu){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:Cu},args:[e.getValue()],itemsSnapshot:n}}updateState(e){const n=(r,i,o,s,a)=>{const[l]=Eu(i,h=>h.name===Cu),u={},c=this.hot.getTranslatedPhrase(qn);if(l){const h=s(r,a),d=Be(h,v=>v.value),f=new Map(h.map(v=>[v.value,this.hot.getCellMeta(v.meta.visualRow,v.meta.visualCol)])),g=XR(d);o&&(l.args[0]=o);const C=[],y=TA(g,l.args[0],c,v=>{v.checked&&C.push(v.value),am(wd,this,kA).call(this,v,f)}),E=e.editedConditionStack.column;u.locale=this.hot.getCellMeta(0,E).locale,u.args=[C],u.command=vu(Cu),u.itemsSnapshot=y}else u.args=[],u.command=vu(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 _f)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{G(n.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return G(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(qn),n=this._getColumnVisibleValues(),r=n.map(l=>l.value),i=new Map(n.map(l=>[l.value,l.meta])),o=XR(r),s=TA(o,o,e,l=>{am(wd,this,kA).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?[]:Be(this.hot.getDataAtCol(e.visualIndex),(n,r)=>({value:lT(n),meta:this.hot.getCellMeta(r,e.visualIndex)}))}}function jee(t){Bf(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Ko(t))}function kA(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function Uee(t,e){switch(e.type){case"numeric":return Ik(t,e);default:return t}}var WL;function zee(t,e){Yee(t,e),e.add(t)}function Yee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gee(t,e,n){return(e=Kee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kee(t){var e=qee(t,"string");return typeof e=="symbol"?e:e+""}function qee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xee(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 LA=new WeakSet;class Mf extends tg{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,n){super(e,{id:n.id,stateless:!0}),zee(this,LA),Gee(this,"name",""),this.name=n.name,this.elements.push(new hl(this.hot,{type:"button",value:Mi,className:"htUIButton htUIButtonOK",identifier:Mf.BUTTON_OK})),this.elements.push(new hl(this.hot,{type:"button",value:Ii,className:"htUIButton htUIButtonCancel",identifier:Mf.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){M(this.elements,e=>{e.addLocalHook("click",(n,r)=>Xee(LA,this,Zee).call(this,n,r))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(G(n.parentNode,"htFiltersMenuActionBar"),M(this.elements,r=>n.appendChild(r.element)),n)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}WL=Mf;function Zee(t,e){e.options.identifier===WL.BUTTON_OK?this.accept():this.cancel()}function CS(t,e,n){return(e=Qee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qee(t){var e=Jee(t,"string");return typeof e=="symbol"?e:e+""}function Jee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 $A="ConditionCollection.filteringStates";class dT{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;CS(this,"hot",void 0),CS(this,"isMapRegistrable",void 0),CS(this,"filteringStates",new xw),this.hot=e,this.isMapRegistrable=n,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap($A,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]:cl;return e.length?zJ(r)(e,n):!0}addCondition(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:cl,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(nt`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(It(Rf[r]))throw new Error(nt`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:dl(a,s)}]},i):u.push({name:a,args:s,func:dl(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($A),this.filteringStates=null,this.clearLocalHooks()}}ut(dT,Rn);function FA(t,e,n){return(e=ete(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ete(t){var e=tte(t,"string");return typeof e=="symbol"?e:e+""}function tte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 BL{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];FA(this,"conditionCollection",void 0),FA(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 nte(t,e){rte(t,e),e.add(t)}function rte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ul(t,e,n){return(e=ite(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ite(t){var e=ote(t,"string");return typeof e=="symbol"?e:e+""}function ote(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 yS(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var lm=new WeakSet;class jL{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];nte(this,lm),Ul(this,"hot",void 0),Ul(this,"conditionCollection",void 0),Ul(this,"columnDataFactory",void 0),Ul(this,"changes",[]),Ul(this,"grouping",!1),Ul(this,"latestEditedColumnPosition",-1),Ul(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=n,this.columnDataFactory=r,this.conditionCollection.addLocalHook("beforeRemove",i=>yS(lm,this,ste).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>yS(lm,this,ate).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>yS(lm,this,lte).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=uz(function(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const f=new dT(r.hot,!1),g=[].concat(c,d);f.importAllConditions(g);const C=r.columnDataFactory(h);let y;f.isEmpty()?y=C:y=new BL(f,v=>r.columnDataFactory(v)).filter(),y=Be(y,v=>v.meta.visualRow);const E=ng(y);return f.destroy(),Eu(C,v=>E(v.meta.visualRow))})(s),u=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:u},dependentConditionStacks:a,filteredRowsFactory:l,conditionArgsChange:n})}destroy(){this.clearLocalHooks(),He(this,(e,n)=>{this[n]=null})}}function ste(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function ate(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function lte(){M(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}ut(jL,Rn);function ute(t){return cL({initialPage:0,size:()=>t.length,onItemSelect:(n,r)=>{const i=t[n];if(i instanceof _f)return r;if(i.element&&!Jc(i.element))return!1;i.focus()}})}const vd="filters";function cte(t,e){let n=-1,r;const i=ute(e),o=h=>()=>{r.isOpened()&&r.getKeyboardShortcutsCtrl().listen(vd),i.setCurrentPage(e.indexOf(h))};e.forEach(h=>{h instanceof Wo&&(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(vd),callback:()=>{h.isSubMenu()&&h.close(),d.listen(vd)}}]),!h.isSubMenu()&&d.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:g=>{const C=r.getNavigator();C.getCurrentPage()>-1&&(n=C.getCurrentPage()),C.clear(),g.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{r.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:g=>{const C=e[i.getCurrentPage()];C instanceof Ef&&(C.openOptions(),g.preventDefault()),C instanceof Tf&&(C.activate(),g.preventDefault()),C instanceof Wo||g.preventDefault()}}],vd)}function a(){r.focus(),r.getKeyboardShortcutsCtrl().listen(vd)}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 hte(t,e){UL(t,e),e.add(t)}function bS(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 Cd(t,e,n){return(e=dte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dte(t){var e=fte(t,"string");return typeof e=="symbol"?e:e+""}function fte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 sp(t,e,n){return t.set(lr(t,e),n),n}function so(t,e){return t.get(lr(t,e))}function lr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const QR="filters",gte=250,VA=QR;var Zs=new WeakMap,JR=new WeakMap,gu=new WeakMap,Hi=new WeakSet;class mte extends Xe{static get PLUGIN_KEY(){return QR}static get PLUGIN_PRIORITY(){return gte}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var n;super(e),n=this,hte(this,Hi),Cd(this,"dropdownMenuPlugin",null),Cd(this,"conditionCollection",null),Cd(this,"conditionUpdateObserver",null),Cd(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),Cd(this,"filtersRowsMap",null),bS(this,Zs,void 0),bS(this,JR,new WeakSet),bS(this,gu,[]),this.hot.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return lr(Hi,n,Ste).call(n,...i)})}isEnabled(){return!!this.hot.getSettings()[QR]}enablePlugin(){var e=this;if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new Yf),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",()=>lr(Hi,this,WA).call(this,"accept")),a.addLocalHook("cancel",()=>lr(Hi,this,WA).call(this,"cancel")),a.addLocalHook("change",l=>lr(Hi,this,bte).call(this,a,l)),a),o=()=>`${this.hot.getTranslatedPhrase(Si)}:`,s=()=>`${this.hot.getTranslatedPhrase(Ri)}:`;if(!this.components.get("filter_by_condition")){const a=new ZR(this.hot,{id:"filter_by_condition",name:o,addSeparator:!1,menuContainer:r});a.addLocalHook("afterClose",()=>lr(Hi,this,BA).call(this)),this.components.set("filter_by_condition",i(a))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new Tee(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const a=new ZR(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:r});a.addLocalHook("afterClose",()=>lr(Hi,this,BA).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 Mf(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new dT(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new jL(this.hot,this.conditionCollection,a=>this.getDataMapAtColumn(a)),this.conditionUpdateObserver.addLocalHook("update",a=>lr(Hi,this,Rte).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 lr(Hi,e,yte).call(e,...l)}),this.addHook("beforeDropdownMenuShow",()=>lr(Hi,this,Cte).call(this)),this.addHook("afterDropdownMenuShow",()=>lr(Hi,this,wte).call(this)),this.addHook("afterDropdownMenuHide",()=>lr(Hi,this,vte).call(this)),this.addHook("afterChange",a=>lr(Hi,this,pte).call(this,a)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!so(Zs,this)&&this.dropdownMenuPlugin.enabled){const a=[{focus:()=>{const u=so(Zs,this).getMenu(),c=u.getNavigator(),h=so(Zs,this).getLastMenuPage();u.focus(),h>0?c.setCurrentPage(h):c.toFirstItem()}},...Array.from(this.components).map(u=>{let[,c]=u;return c.getElements()}).flat()];sp(Zs,this,cte(this.dropdownMenuPlugin.menu,a));const l=u=>{so(Zs,this).listen(),u.preventDefault(),Bf(u.keyCode,"TAB")&&(u.shiftKey?so(Zs,this).toPreviousItem():so(Zs,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:VA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(VA)}addCondition(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:cl;const o=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(o,{command:{key:n},args:r},i)}removeConditions(e){const n=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(n)}clearConditions(e){if(e===void 0)this.conditionCollection.clean();else{const n=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(n)}}importConditions(e){this.conditionCollection.importAllConditions(e)}exportConditions(){return this.conditionCollection.exportAllConditions()}filter(){const{navigableHeaders:e}=this.hot.getSettings(),n=this._createDataFilter(),r=!this.conditionCollection.isEmpty();let i=[];const o=this.exportConditions(),s=this.hot.runHooks("beforeFilter",o,so(gu,this));if(s!==!1&&r){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),i=Be(n.filter(),u=>u.meta.visualRow);const l=ng(i);de(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(),sp(gu,this,this.exportConditions())}else s!==!1&&!r?(sp(gu,this,this.exportConditions()),this.filtersRowsMap.clear()):this.importConditions(so(gu,this));this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col),s!==!1&&(this.hot.runHooks("afterFilter",o),this.hot.view.adjustElementsSize(),this.hot.render())}getSelectedColumn(){var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n?{visualIndex:n.col,physicalIndex:this.hot.toPhysicalColumn(n.col)}:null}getDataMapAtColumn(e){const n=this.hot.toVisualColumn(e),r=[];return 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:g}=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:g},value:lT(C)})}),r}updateValueComponentCondition(e){const n=this.hot.getDataAtCol(e),r=XR(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===$p&&n.command.key!==wn&&r.command.key!==wn&&i.command.key!==wn?o=cT:i.command.key!==wn&&(n.command.key===wn||r.command.key===wn)&&(o=cl),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 BL(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 pte(t){t&&M(t,e=>{const[,n]=e,r=this.hot.propToCol(n);this.conditionCollection.hasConditions(r)&&this.updateValueComponentCondition(r)})}function wte(){const t=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),t.updateMenuDimensions()}function vte(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function Cte(){const t=this.dropdownMenuPlugin.menu;so(JR,this).has(t)||so(Zs,this).setMenu(t),so(JR,this).add(t)}function yte(t){t.items.push({name:xe}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function WA(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 bte(t,e){const n=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),t.constructor===ZR&&!e.inputsCount&&this.setListeningDropdownMenu(),n.updateMenuDimensions()}function BA(){this.setListeningDropdownMenu()}function Ste(t,e,n){const r=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(r)&&n===this.hot.view.getColumnHeadersCount()-1?G(e,"htFiltersActive"):pe(e,"htFiltersActive")}function Rte(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)&&sp(gu,this,so(gu,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===Cu),s=n.filter(a=>a.name!==Cu);if(o.length>=2||s.length>=3)Ze(nt`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 zL="internal-use-in-handsontable",eE={licenseKey:zL,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 YL(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 GL(t){return Object.keys(t).reduce((e,n)=>(n!=="hyperformula"&&(e[n]=t[n]),e),{})}function Ete(t){var e;const n=t[xn],r=GL(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=YL(t);return{...eE,...r,...i}}function Tte(t){var e;const n=t[xn],r=GL(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=YL(t);return{...r,...i}}function _te(t,e){return Object.keys(e).some(n=>e[n]!==void 0&&e[n]!==t[n])}function ev(){const t="engine_relationship",e=qo(xn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function fT(){const t="shared_engine_usage",e=qo(xn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function Mte(t){const e=t.getSettings(),n=e[xn],r=n==null?void 0:n.engine;if(n===!0||It(r))return null;if(typeof r.hyperformula=="function"||typeof r=="function"){var i;return Ite((i=r.hyperformula)!==null&&i!==void 0?i:r,e,t)}else if(typeof r=="object"&&It(r.hyperformula)){const o=ev(),s=fT().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:zL}),(r.getConfig().leapYear1900!==eE.leapYear1900||QE(r.getConfig().nullDate,eE.nullDate)===!1)&&Ze(nt`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 Ite(t,e,n){const r=e[xn],i=Ete(e),o=ev(),s=fT();Pte(t,r.functions),Ote(t,r.language);const a=t.buildEmpty(i);return o.set(a,[n]),s.set(a,[n.guid]),xte(a,r.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function jA(t){var e;const n=ev(),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 UA(t,e){if(t){const n=ev(),r=n.get(t),i=fT(),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 Pte(t,e){e&&e.forEach(n=>{const{name:r,plugin:i,translations:o}=n;try{t.registerFunction(r,i,o)}catch(s){Ze(s.message)}})}function Ote(t,e){if(e){const{langCode:n}=e;try{t.registerLanguage(n,e)}catch(r){Ze(r.message)}}}function xte(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){Ze(a.message)}}),t.resumeEvaluation())}function Ate(t,e){return(It(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const KL="DD/MM/YYYY";function Hte(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function Nte(t){return Hte(t)?t.substr(1):t}function Dte(t){return typeof t=="string"&&t.startsWith("=")}function gT(t,e){return typeof t=="string"&&e==="date"}function qL(t,e){return X(t,e,!0).isValid()}function XL(t,e){return X(t,e,!0).format(KL)}function kte(t,e){return X(t,KL,!0).format(e)}function ZL(t,e){const r=new Date(Date.UTC(0,0,t+-1));return X(r).format(e)}function Lte(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 $te(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 Fte(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 mT(t,e,n){const r=$te(t,Lte(t,e,n));return Fte(r)}function zl(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 St(t,e){return t.get(QL(t,e))}function Va(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")}var yd=new WeakMap,Wa=new WeakMap,Ni=new WeakMap,um=new WeakMap,SS=new WeakMap,RS=new WeakMap,cm=new WeakMap;class zA{constructor(e,n,r){zl(this,yd,void 0),zl(this,Wa,void 0),zl(this,Ni,void 0),zl(this,um,[]),zl(this,SS,[]),zl(this,RS,void 0),zl(this,cm,[]),Va(yd,this,e),Va(Wa,this,n),Va(Ni,this,r)}setRemovedHfIndexes(e){return Va(cm,this,e.map(n=>{const r=St(Wa,this).getVisualFromPhysicalIndex(n);return this.getHfIndexFromVisualIndex(r)})),St(cm,this)}getRemovedHfIndexes(){return St(cm,this)}getHfIndexFromVisualIndex(e){const n=St(Wa,this).getIndexesSequence(),r=St(Wa,this).getNotTrimmedIndexes();return n.indexOf(r[e],e)}syncMoves(e){const r=`move${Uo(St(yd,this))}s`;St(Ni,this).getEngine().batch(()=>{e.forEach(i=>{const o=i.from!==i.to,s=i.from+1!==i.to;o&&s&&St(Ni,this).getEngine()[r](St(Ni,this).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,n,r){r!==!1&&(Va(SS,this,e.map(i=>this.getHfIndexFromVisualIndex(i))),Va(RS,this,this.getHfIndexFromVisualIndex(n)))}calculateAndSyncMoves(e,n){if(St(Ni,this).isPerformingUndoRedo()||e===!1||n===!1)return;const r=mT(St(SS,this),St(RS,this),St(Wa,this).getNumberOfIndexes());St(Ni,this).getSheetId()===null?St(Ni,this).getPostponeAction(()=>this.syncMoves(r)):this.syncMoves(r)}getIndexesChangeSyncMethod(){const e=`set${Uo(St(yd,this))}Order`;return n=>{if(St(Ni,this).isPerformingUndoRedo())return;const r=St(Wa,this).getIndexesSequence();if(n==="update"&&r.length>0){const i=St(um,this).map(l=>r.indexOf(l)),o=St(Ni,this).getEngine().getSheetDimensions(St(Ni,this).getSheetId());let s;St(yd,this)==="row"?s=o.height:s=o.width;const a=i.length;for(let l=a;l<s;l+=1)i.push(l);St(Ni,this).getEngine()[e](St(Ni,this).getSheetId(),i)}Va(um,this,r)}}init(){Va(um,this,St(Wa,this).getIndexesSequence())}}function Yl(t,e,n){Wte(t,e),e.set(t,n)}function Wte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gs(t,e){return t.get(JL(t,e))}function Gl(t,e,n){return t.set(JL(t,e),n),n}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 hm=new WeakMap,dm=new WeakMap,ES=new WeakMap,TS=new WeakMap,_S=new WeakMap,MS=new WeakMap,IS=new WeakMap;class Bte{constructor(e,n,r){Yl(this,hm,void 0),Yl(this,dm,void 0),Yl(this,ES,void 0),Yl(this,TS,!1),Yl(this,_S,!1),Yl(this,MS,null),Yl(this,IS,null),Gl(hm,this,new zA("row",e,this)),Gl(dm,this,new zA("column",n,this)),Gl(ES,this,r)}getForAxis(e){return e==="row"?Gs(hm,this):Gs(dm,this)}setPerformUndo(e){Gl(TS,this,e)}setPerformRedo(e){Gl(_S,this,e)}isPerformingUndoRedo(){return Gs(TS,this)||Gs(_S,this)}getSheetId(){return Gs(IS,this)}getEngine(){return Gs(MS,this)}getPostponeAction(){return Gs(ES,this)}setupSyncEndpoint(e,n){Gl(MS,this,e),Gl(IS,this,n),Gs(hm,this).init(),Gs(dm,this).init()}}function jte(t,e){e$(t,e),e.add(t)}function Kl(t,e,n){return(e=Ute(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ute(t){var e=zte(t,"string");return typeof e=="symbol"?e:e+""}function zte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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){e$(t,e),e.set(t,n)}function e$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fl(t,e,n){return t.set(Ye(t,e),n),n}function Ru(t,e){return t.get(Ye(t,e))}function Ye(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",Yte=["maxRows","maxColumns","language"],Gte=260;re.getSingleton().register("afterNamedExpressionAdded");re.getSingleton().register("afterNamedExpressionRemoved");re.getSingleton().register("afterSheetAdded");re.getSingleton().register("afterSheetRemoved");re.getSingleton().register("afterSheetRenamed");re.getSingleton().register("afterFormulasValuesUpdate");const Sh=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var ba=new WeakMap,tv=new WeakMap,bd=new WeakMap,qe=new WeakSet;class Kte extends Xe{constructor(){var e;super(...arguments),e=this,jte(this,qe),PS(this,ba,!1),PS(this,tv,!1),PS(this,bd,[["valuesUpdated",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(qe,e,cne).call(e,...r)}],["namedExpressionAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(qe,e,hne).call(e,...r)}],["namedExpressionRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(qe,e,dne).call(e,...r)}],["sheetAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(qe,e,fne).call(e,...r)}],["sheetRenamed",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(qe,e,gne).call(e,...r)}],["sheetRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(qe,e,mne).call(e,...r)}]]),Kl(this,"staticRegister",qo("formulas")),Kl(this,"engine",null),Kl(this,"sheetId",null),Kl(this,"sheetName",null),Kl(this,"indexSyncer",null),Kl(this,"rowAxisSyncer",null),Kl(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return xn}static get PLUGIN_PRIORITY(){return Gte}static get SETTING_KEYS(){return[xn,...Yte]}isEnabled(){return!!this.hot.getSettings()[xn]}enablePlugin(){var e,n=this;if(!this.enabled){if(this.engine=(e=Mte(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){Ze("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&&Ye(qe,this,qd).call(this,r)}this.addHook("beforeLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(qe,n,YA).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 Ye(qe,n,GA).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 Ye(qe,n,YA).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 Ye(qe,n,GA).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 Ye(qe,n,Qte).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 Ye(qe,n,Jte).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 Ye(qe,n,qte).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 Ye(qe,n,ene).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 Ye(qe,n,KA).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 Ye(qe,n,KA).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 Ye(qe,n,tne).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 Ye(qe,n,nne).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 Ye(qe,n,one).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 Ye(qe,n,sne).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 Ye(qe,n,rne).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 Ye(qe,n,ine).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 Ye(qe,n,ane).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 Ye(qe,n,lne).call(n,...i)}),this.indexSyncer=new Bte(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 Ye(qe,n,Zte).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 Ye(qe,n,une).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 Ye(qe,n,Xte).call(n,...i)}),Ru(bd,this).forEach(r=>{let[i,o]=r;return this.engine.on(i,o)}),super.enablePlugin()}}disablePlugin(){Ru(bd,this).forEach(e=>{let[n,r]=e;return this.engine.off(n,r)}),UA(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const n=Tte(this.hot.getSettings());_te(this.engine.getConfig(),n)&&this.engine.updateConfig(n);const r=this.hot.getSettings()[xn];if(ae(r)&&ae(r.sheetName)&&r.sheetName!==this.sheetName&&this.switchSheet(r.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[xn].sheetName;if(i&&this.engine.doesSheetExist(i))this.switchSheet(this.sheetName);else{const o=this.addSheet(i??void 0,this.hot.getSourceDataArray());Ye(qe,this,qd).call(this,o)}}super.updatePlugin(e)}destroy(){Ru(bd,this).forEach(e=>{var n;let[r,i]=e;return(n=this.engine)===null||n===void 0?void 0:n.off(r,i)}),fl(bd,this,null),UA(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,n){if(ae(n)&&!kK(n))return Ze("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return Ze("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 Ze(r.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){t0(`The sheet named \`${e}\` does not exist, switch aborted.`);return}Ye(qe,this,qd).call(this,e);const n=this.engine.getSheetSerialized(this.sheetId);n.length>0&&this.hot.loadData(n,`${Uo(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))}),jA(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 ae(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(ae(l)===!1||ae(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=jA(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)){Ze(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const o=this.hot.getCellMeta(e,n);return gT(r,o.type)&&(qL(r,o.dateFormat)?r=XL(r,o.dateFormat):Dte(r)===!1&&(r=`'${r}`)),this.engine.setCellContents(i,r)}}function qd(t){this.sheetName=t,this.sheetId=this.engine.getSheetId(this.sheetName)}function qte(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"&&Un(s)&&(s=ZL(s,o.dateFormat)),typeof s=="object"&&s!==null?s.value:s}return t}function Xte(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:g,col:C}=h.start,{row:y,col:E}=h.end,v=y-g+1,P=E-C+1;for(let O=0;O<f.length;O+=1)for(let L=0;L<f[O].length;L+=1){const T=f[O][L],A=g+O%v,K=C+L%P,U=this.hot.getCellMeta(A,K);gT(T,U.type)&&(T.startsWith("'")?f[O][L]=T.slice(1):this.isFormulaCellType(A,K,this.sheetId)===!1&&(f[O][L]=kte(T,U.dateFormat)))}return f}function YA(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(Uo(xn))||fl(tv,this,It(this.hot.getSettings().data))}function Zte(){if(Ru(tv,this)){this.switchSheet(this.sheetName);return}const t=this.hot.getSourceDataArray();t.forEach((n,r)=>{n.forEach((i,o)=>{const s=this.hot.getCellMeta(r,o,{skipMetaExtension:!0}),a=s.dateFormat;gT(i,s.type)&&(qL(i,a)?t[r][o]=XL(i,a):i.startsWith("=")||(t[r][o]=`'${i}`))})}),fl(ba,this,!0);const e=this.engine.setSheetContent(this.sheetId,t);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(e),fl(ba,this,!1)}function GA(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(n.includes(Uo(xn)))return;const r=Ate(this.engine,this.hot.getSettings()[xn].sheetName);if(Ye(qe,this,qd).call(this,r),n!=="updateSettings")if(Ru(tv,this))this.switchSheet(this.sheetName);else{const i=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,i)){fl(ba,this,!0);const o=this.engine.setSheetContent(this.sheetId,i);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(o),fl(ba,this,!1)}}}function Qte(t,e,n,r){if(r!=="get"||Ru(ba,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t);if(i===null||e===null)return;const o=this.getCellType(i,e);if(o==="VALUE"||o==="EMPTY"){n.value=Nte(n.value);return}const s={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let a=this.engine.getCellValue(s);const l=this.hot.getCellMeta(i,e,{skipMetaExtension:!0});l.type==="date"&&Un(a)&&(a=ZL(a,l.dateFormat)),n.value=typeof a=="object"&&a!==null?a.value:a}function Jte(t,e,n,r){if(r!=="get"||Ru(ba,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t),o=this.hot.propToCol(e);if(i===null||o===null)return;const s=this.getCellType(i,o);if(s==="VALUE"||s==="EMPTY")return;const a=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(a.width===0&&a.height===0)return;const l={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId};n.value=this.engine.getCellSerialized(l)}function KA(t,e){if(Sh(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 ene(t,e){if(Sh(e))return;const n=[],r=[];t.forEach(i=>{let[o,s,,a]=i;const l=this.hot.propToCol(s);if(!Un(l))return;const u={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(u)){Ze(`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 tne(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 nne(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 rne(t,e,n){return this.rowAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveRows(this.sheetId,[o,1]))===!1?!1:void 0}function ine(t,e,n){return this.columnAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[o,1]))===!1?!1:void 0}function one(t,e,n){if(Sh(n))return;const r=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function sne(t,e,n){if(Sh(n))return;const r=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function ane(t,e,n,r){if(Sh(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 lne(t,e,n,r){if(Sh(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 une(t,e,n){var r;fl(ba,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());fl(ba,this,!1),i.forEach((o,s)=>{o.forEach((a,l)=>{this.engine.setCellContents({col:l,row:n+s,sheet:this.sheetId},[[a]])})})}function cne(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function hne(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function dne(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function fne(t){this.hot.runHooks("afterSheetAdded",t)}function gne(t,e){Ye(qe,this,qd).call(this,e),this.hot.runHooks("afterSheetRenamed",t,e)}function mne(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function pne(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(Jr,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 wne(t){const e=[];return{key:"hidden_columns_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.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=Be(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(g=>n.includes(g)))}}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 vne(t,e){t$(t,e),e.add(t)}function Cne(t,e,n){t$(t,e),e.set(t,n)}function t$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ql(t,e){return t.get(Ka(t,e))}function qA(t,e,n){return t.set(Ka(t,e),n),n}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")}re.getSingleton().register("beforeHideColumns");re.getSingleton().register("afterHideColumns");re.getSingleton().register("beforeUnhideColumns");re.getSingleton().register("afterUnhideColumns");const XA="hiddenColumns",yne=310;var os=new WeakMap,Xl=new WeakSet;class bne extends Xe{constructor(){super(...arguments),vne(this,Xl),Cne(this,os,null)}static get PLUGIN_KEY(){return XA}static get PLUGIN_PRIORITY(){return yne}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[XA]}enablePlugin(){var e=this;this.enabled||(qA(os,this,new Ow),ql(os,this).addLocalHook("init",()=>Ka(Xl,this,Mne).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,ql(os,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ka(Xl,e,_ne).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>Ka(Xl,this,Rne).call(this,n,r,i)),this.addHook("modifyColWidth",(n,r)=>Ka(Xl,this,Sne).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 Ka(Xl,e,Tne).call(e,...r)}),this.addHook("modifyCopyableRange",n=>Ka(Xl,this,Ene).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.columnIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;const o=ql(os,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=wr(o,(u,c,h)=>(c&&u.push(this.hot.toVisualColumn(h)),u),[])}this.hot.runHooks("beforeUnhideColumns",n,i,r&&s)!==!1&&(r&&s&&ql(os,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=>{ql(os,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 Be(ql(os,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return ql(os,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(){qA(os,this,null),super.destroy()}}function Sne(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 Rne(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 Ene(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;de(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 Tne(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"),G(e,n)}function _ne(t){t.items.push({name:xe},pne(this),wne(this))}function Mne(){const t=this.getSetting("columns");Array.isArray(t)&&this.hideColumns(t)}function Ine(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(ti,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 Pne(t){const e=[];return{key:"hidden_rows_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(ni,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=Be(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(g=>n.includes(g)))}}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 One(t,e){n$(t,e),e.add(t)}function xne(t,e,n){n$(t,e),e.set(t,n)}function n$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zl(t,e){return t.get(qa(t,e))}function ZA(t,e,n){return t.set(qa(t,e),n),n}function qa(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeHideRows");re.getSingleton().register("afterHideRows");re.getSingleton().register("beforeUnhideRows");re.getSingleton().register("afterUnhideRows");const QA="hiddenRows",Ane=320;var ss=new WeakMap,Ql=new WeakSet;class Hne extends Xe{constructor(){super(...arguments),One(this,Ql),xne(this,ss,null)}static get PLUGIN_KEY(){return QA}static get PLUGIN_PRIORITY(){return Ane}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[QA]}enablePlugin(){var e=this;this.enabled||(ZA(ss,this,new Ow),Zl(ss,this).addLocalHook("init",()=>qa(Ql,this,Fne).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,Zl(ss,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return qa(Ql,e,$ne).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>qa(Ql,this,Dne).call(this,n,r,i)),this.addHook("modifyRowHeight",(n,r)=>qa(Ql,this,Nne).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 qa(Ql,e,Lne).call(e,...r)}),this.addHook("modifyCopyableRange",n=>qa(Ql,this,kne).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.rowIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;const o=Zl(ss,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=wr(o,(u,c,h)=>(c&&u.push(this.hot.toVisualRow(h)),u),[])}this.hot.runHooks("beforeUnhideRows",n,i,r&&s)!==!1&&(r&&s&&Zl(ss,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=>{Zl(ss,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 Be(Zl(ss,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return Zl(ss,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(){ZA(ss,this,null),super.destroy()}}function Nne(t,e){return this.isHidden(e)?0:t}function Dne(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 kne(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;de(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 Lne(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"),G(e,n)}function $ne(t){t.items.push({name:xe},Ine(this),Pne(this))}function Fne(){const t=this.getSetting("rows");Array.isArray(t)&&this.hideRows(t)}function Vne(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(Pr)},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 Wne(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(Or)},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 Bne(t,e){r$(t,e),e.add(t)}function jne(t,e,n){r$(t,e),e.set(t,n)}function r$(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(Vp(t,e))}function OS(t,e,n){return t.set(Vp(t,e),n),n}function Vp(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeColumnFreeze");re.getSingleton().register("afterColumnFreeze");re.getSingleton().register("beforeColumnUnfreeze");re.getSingleton().register("afterColumnUnfreeze");const JA="manualColumnFreeze",Une=110;var hu=new WeakMap,xS=new WeakSet;class zne extends Xe{constructor(){super(...arguments),Bne(this,xS),jne(this,hu,!1)}static get PLUGIN_KEY(){return JA}static get PLUGIN_PRIORITY(){return Une}isEnabled(){return!!this.hot.getSettings()[JA]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>Vp(xS,this,Yne).call(this,e)),this.addHook("beforeColumnMove",(e,n)=>Vp(xS,this,Gne).call(this,e,n)),super.enablePlugin())}disablePlugin(){OS(hu,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;tE(hu,this)||OS(hu,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;tE(hu,this)||OS(hu,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 Yne(t){t.items.push({name:"---------"},Vne(this),Wne(this))}function Gne(t,e){if(tE(hu,this)){const n=this.hot.getSettings().fixedColumnsStart;if(e<n||t.some(r=>r<n))return!1}}function fm(t,e,n){return(e=Kne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kne(t){var e=qne(t,"string");return typeof e=="symbol"?e:e+""}function qne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const AS=0,eH=1,tH=2,bc="px";let i$=class{constructor(e){fm(this,"hot",void 0),fm(this,"_element",null),fm(this,"state",AS),fm(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=tH}build(){this.state===AS&&(this._element=this.hot.rootDocument.createElement("div"),this.state=eH)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=AS}isAppended(){return this.state===tH}isBuilt(){return this.state>=eH}setPosition(e,n){Un(e)&&(this._element.style.top=e+bc),Un(n)&&(this._element.style[this.inlineProperty]=n+bc)}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){Un(e)&&(this._element.style.width=e+bc),Un(n)&&(this._element.style.height=n+bc)}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){Un(e)&&(this._element.style.marginTop=e+bc),Un(n)&&(this._element.style[`margin${Uo(this.inlineProperty)}`]=n+bc)}getOffset(){const e=this._element.style,n=`margin${Uo(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[n]?parseInt(e[n],10):0}}};const Xne="ht__manualColumnMove--backlight";let Zne=class extends i${build(){super.build(),G(this._element,Xne)}};const Qne="ht__manualColumnMove--guideline";let Jne=class extends i${build(){super.build(),G(this._element,Qne)}};function ere(t,e){o$(t,e),e.add(t)}function _o(t,e,n){o$(t,e),e.set(t,n)}function o$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gr(t,e,n){return t.set(Xa(t,e),n),n}function he(t,e){return t.get(Xa(t,e))}function Xa(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeColumnMove");re.getSingleton().register("afterColumnMove");const HS="manualColumnMove",tre=120,nH="ht__manualColumnMove",Wp="show-ui",nE="on-moving--columns",rE="after-selection--columns";var Bn=new WeakMap,Qa=new WeakMap,ha=new WeakMap,ap=new WeakMap,sl=new WeakMap,Wn=new WeakMap,gm=new WeakMap,no=new WeakMap,kc=new WeakMap,Bp=new WeakMap,Xd=new WeakMap,Jl=new WeakSet;class nre extends Xe{constructor(){super(...arguments),ere(this,Jl),_o(this,Bn,new Zne(this.hot)),_o(this,Qa,new Jne(this.hot)),_o(this,ha,[]),_o(this,ap,0),_o(this,sl,!1),_o(this,Wn,{}),_o(this,gm,void 0),_o(this,no,void 0),_o(this,kc,void 0),_o(this,Bp,void 0),_o(this,Xd,void 0)}static get PLUGIN_KEY(){return HS}static get PLUGIN_PRIORITY(){return tre}isEnabled(){return!!this.hot.getSettings()[HS]}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 Xa(Jl,e,rre).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 Xa(Jl,e,ore).call(e,...r)}),this.addHook("afterScrollVertically",()=>Xa(Jl,this,are).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 Xa(Jl,e,lre).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),G(this.hot.rootElement,nH),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){pe(this.hot.rootElement,nH),this.unregisterEvents(),he(Bn,this).destroy(),he(Qa,this).destroy(),super.disablePlugin()}moveColumn(e,n){return this.moveColumns([e],n)}moveColumns(e,n){const r=he(gm,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeColumnMove",e,n,r,i);if(gr(gm,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 gr(gm,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=wr(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()[HS];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 de(e,n,i=>{r.push(i)}),r}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(he(no,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(no,this)-1);const s=n.hider.offsetWidth,a=n.TBODY.offsetLeft,l=he(Bn,this).getOffset().start,u=he(Bn,this).getSize().width;let c=0,h=0;if(this.hot.isRtl()){const g=this.hot.rootWindow,C=Kt(this.hot.rootElement),y=g.innerWidth-he(kc,this)-C;h=g.innerWidth-he(Wn,this).eventPageX-y-(r.scrollX===void 0?i:0)}else h=he(Wn,this).eventPageX-(he(kc,this)-(r.scrollX===void 0?i:0));if(he(Bp,this)&&(c=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(he(no,this))&&(o+=i),o+=c,he(no,this)<0)he(Xd,this)>0?he(Wn,this).col=0:he(Wn,this).col=e>0?e-1:e;else if(he(Wn,this).TD.offsetWidth/2+o<=h){const g=he(no,this)>=he(ap,this)?he(ap,this)-1:he(no,this);he(Wn,this).col=g+1,o+=he(Wn,this).TD.offsetWidth}else he(Wn,this).col=he(no,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(no,this)<he(Xd,this)&&(f-=he(kc,this)<=r.scrollX?he(kc,this):0),he(Bn,this).setPosition(null,d),he(Qa,this).setPosition(null,f)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>Xa(Jl,this,ire).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Xa(Jl,this,sre).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){he(Bn,this).build(),he(Qa,this).build()}destroy(){he(Bn,this).destroy(),he(Qa,this).destroy(),super.destroy()}}function rre(t,e,n,r){const i=this.hot.view._wt.wtTable,o=this.hot.selection.isSelectedByColumnHeader(),s=this.hot.getSelectedRangeLast(),a=ve(t.target,"sortAction");if(!s||!o||he(sl,this)||t.button!==0||a){gr(sl,this,!1),he(ha,this).length=0,pe(this.hot.rootElement,[nE,Wp]);return}const l=he(Qa,this).isBuilt()&&!he(Qa,this).isAppended(),u=he(Bn,this).isBuilt()&&!he(Bn,this).isAppended();l&&u&&(he(Qa,this).appendTo(i.hider),he(Bn,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,gr(sl,this,!0);const g=n.firstChild?Tz(t,n.firstChild).x:t.offsetX;he(Wn,this).eventPageX=t.pageX,gr(no,this,e.col),he(Wn,this).TD=n,he(Wn,this).col=e.col,gr(ha,this,this.prepareColumnsToMoving(d,f)),gr(Bp,this,!!this.hot.getSettings().rowHeaders),gr(ap,this,this.hot.countCols()),gr(Xd,this,this.hot.getSettings().fixedColumnsStart),gr(kc,this,An(this.hot.rootElement).left);const C=he(Bp,this)?-1:0,y=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,E=e.col<he(Xd,this),v=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),P=Math.abs(g-(this.hot.isRtl()?n.offsetWidth:0)),O=this.getColumnsWidth(d,e.col-1)+P,L=this.getColumnsWidth(C,d-1)+(E?v:0)+O;he(Bn,this).setPosition(y,L),he(Bn,this).setSize(this.getColumnsWidth(d,f),i.hider.offsetHeight-y),he(Bn,this).setOffset(null,-O),G(this.hot.rootElement,nE)}else pe(this.hot.rootElement,rE),gr(sl,this,!1),he(ha,this).length=0}function ire(t){he(sl,this)&&(he(Wn,this).eventPageX=t.pageX,this.refreshPositions())}function ore(t,e,n,r){!this.hot.getSelectedRangeLast()||!he(sl,this)||(he(ha,this).indexOf(e.col)>-1?pe(this.hot.rootElement,Wp):G(this.hot.rootElement,Wp),r.row=!0,r.column=!0,r.cell=!0,gr(no,this,e.col),he(Wn,this).TD=n)}function sre(){const t=he(Wn,this).col,e=he(ha,this).length;if(gr(no,this,void 0),gr(sl,this,!1),pe(this.hot.rootElement,[nE,Wp,rE]),this.hot.selection.isSelectedByColumnHeader()&&G(this.hot.rootElement,rE),e<1||t===void 0)return;const n=he(ha,this)[0],r=this.hot.toPhysicalColumn(n),i=this.dragColumns(he(ha,this),t);if(he(ha,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 are(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,n=t.holder.scrollTop,r=e+n;he(Bn,this).setPosition(r),he(Bn,this).setSize(null,t.hider.offsetHeight-r)}function lre(){this.moveBySettingsOrLoad()}function ure(t,e){s$(t,e),e.add(t)}function _n(t,e,n){s$(t,e),e.set(t,n)}function s$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jt(t,e,n){return t.set(Do(t,e),n),n}function ie(t,e){return t.get(Do(t,e))}function Do(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 jp="manualColumnResize",cre=130,rH="manualColumnWidths";var na=new WeakMap,mm=new WeakMap,Bi=new WeakMap,Up=new WeakMap,Es=new WeakMap,hre=new WeakMap,Xc=new WeakMap,pm=new WeakMap,sr=new WeakMap,Qs=new WeakMap,Au=new WeakMap,zp=new WeakMap,Zd=new WeakMap,Qd=new WeakMap,Ui=new WeakMap,Jd=new WeakMap,as=new WeakSet;class dre extends Xe{static get PLUGIN_KEY(){return jp}static get PLUGIN_PRIORITY(){return cre}constructor(e){super(e),ure(this,as),_n(this,na,null),_n(this,mm,null),_n(this,Bi,[]),_n(this,Up,null),_n(this,Es,null),_n(this,hre,null),_n(this,Xc,null),_n(this,pm,null),_n(this,sr,this.hot.rootDocument.createElement("DIV")),_n(this,Qs,this.hot.rootDocument.createElement("DIV")),_n(this,Au,null),_n(this,zp,!1),_n(this,Zd,0),_n(this,Qd,null),_n(this,Ui,void 0),_n(this,Jd,void 0),G(ie(sr,this),"manualColumnResizer"),G(ie(Qs,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[jp]}enablePlugin(){var e=this;this.enabled||(jt(Ui,this,new vl),ie(Ui,this).addLocalHook("init",()=>Do(as,this,fre).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,ie(Ui,this)),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Do(as,e,Cre).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 Do(as,e,yre).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 Do(as,e,bre).call(e,...r)}),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){jt(Jd,this,ie(Ui,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",rH,ie(Ui,this).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",rH,e),e.value}setManualSize(e,n){const r=Math.max(n,20),i=this.hot.toPhysicalColumn(e);return ie(Ui,this).setValueAtIndex(i,r),r}clearManualSize(e){const n=this.hot.toPhysicalColumn(e);ie(Ui,this).setValueAtIndex(n,null)}setupHandlePosition(e){if(!e.parentNode)return;jt(na,this,e);const{_wt:n}=this.hot.view,r=n.wtTable.getCoords(ie(na,this)),i=r.col;if(i<0)return;const o=nn(ie(na,this)),s=ie(na,this).getBoundingClientRect(),a=i<n.getSetting("fixedColumnsStart");let l;a&&(l=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ie(na,this),r.row,r.col)),l||(l=n.wtOverlays.topOverlay.getRelativeCellPosition(ie(na,this),r.row,r.col)),jt(mm,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),jt(Bi,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;de(d,f,g=>{ie(Bi,this).includes(g)||ie(Bi,this).push(g)})})}ie(Bi,this).includes(ie(mm,this))||jt(Bi,this,[ie(mm,this)]),jt(pm,this,l.start-6),jt(Xc,this,parseInt(s.width,10)),ie(sr,this).style.top=`${l.top}px`,ie(sr,this).style[this.inlineDir]=`${ie(pm,this)+ie(Xc,this)}px`,ie(sr,this).style.height=`${o}px`,this.hot.rootElement.appendChild(ie(sr,this))}refreshHandlePosition(){ie(sr,this).style[this.inlineDir]=`${ie(pm,this)+ie(Up,this)}px`}setupGuidePosition(){const e=parseInt(nn(ie(sr,this)),10),n=parseInt(ie(sr,this).style.top,10)+e,r=this.hot.view.getTableHeight();G(ie(sr,this),"active"),G(ie(Qs,this),"active"),ie(Qs,this).style.top=`${n}px`,this.refreshGuidePosition(),ie(Qs,this).style.height=`${r-e}px`,this.hot.rootElement.appendChild(ie(Qs,this))}refreshGuidePosition(){ie(Qs,this).style[this.inlineDir]=ie(sr,this).style[this.inlineDir]}hideHandleAndGuide(){pe(ie(sr,this),"active"),pe(ie(Qs,this),"active")}checkIfColumnHeader(e){const n=Tu(e,["THEAD"],this.hot.rootElement),{topOverlay:r,topInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.THEAD,i.clone.wtTable.THEAD].includes(n)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},n=(r,i)=>{const o=this.hot.runHooks("beforeColumnResize",ie(Es,this),r,!0);o!==void 0&&jt(Es,this,o),this.setManualSize(r,ie(Es,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ie(Es,this),r,!0),i&&e()};ie(Zd,this)>=2&&(ie(Bi,this).length>1?(M(ie(Bi,this),i=>{n(i)}),e()):M(ie(Bi,this),i=>{n(i,!0)})),jt(Zd,this,0),jt(Qd,this,null)}bindEvents(){const{rootWindow:e,rootElement:n}=this.hot;this.eventManager.addEventListener(n,"mouseover",r=>Do(as,this,gre).call(this,r)),this.eventManager.addEventListener(n,"mousedown",r=>Do(as,this,mre).call(this,r)),this.eventManager.addEventListener(e,"mousemove",r=>Do(as,this,pre).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>Do(as,this,wre).call(this)),this.eventManager.addEventListener(ie(sr,this),"contextmenu",()=>Do(as,this,vre).call(this))}destroy(){super.destroy()}}function fre(){const t=this.hot.getSettings()[jp],e=this.loadManualColumnWidths();typeof e<"u"?this.hot.batchExecution(()=>{e.forEach((n,r)=>{ie(Ui,this).setValueAtIndex(r,n)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((n,r)=>{ie(Ui,this).setValueAtIndex(r,n)})},!0),jt(Jd,this,t)):t===!0&&Array.isArray(ie(Jd,this))&&this.hot.batchExecution(()=>{ie(Jd,this).forEach((n,r)=>{ie(Ui,this).setValueAtIndex(r,n)})},!0)}function gre(t){if(!FN(t.target)&&ie(zp,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")&&(ie(Au,this)||this.setupHandlePosition(e))}}function mre(t){t.target.parentNode===this.hot.rootElement&&ve(t.target,"manualColumnResizer")&&(this.setupHandlePosition(ie(na,this)),this.setupGuidePosition(),jt(Au,this,!0),ie(Qd,this)===null&&(jt(Qd,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ie(Qd,this))),jt(Zd,this,ie(Zd,this)+1),this.startX=t.pageX,jt(Es,this,ie(Xc,this)))}function pre(t){if(ie(Au,this)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();jt(Up,this,ie(Xc,this)+e),M(ie(Bi,this),n=>{jt(Es,this,this.setManualSize(n,ie(Up,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function wre(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(n,r)=>{this.hot.runHooks("beforeColumnResize",ie(Es,this),n,!1),r&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ie(Es,this),n,!1)};ie(Au,this)&&(this.hideHandleAndGuide(),jt(Au,this,!1),ie(Es,this)!==ie(Xc,this)&&(ie(Bi,this).length>1?(M(ie(Bi,this),r=>{e(r)}),t()):M(ie(Bi,this),r=>{e(r,!0)})),this.setupHandlePosition(ie(na,this)))}function vre(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ie(sr,this)),this.hot.rootElement.removeChild(ie(Qs,this)),jt(Au,this,!1),jt(zp,this,!0),this.hot._registerImmediate(()=>{jt(zp,this,!1)})}function Cre(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalColumn(e),i=ie(Ui,this).getValueAtIndex(r);this.hot.getSettings()[jp]&&i&&(n=i)}return n}function yre(t,e){const n=ie(Ui,this).getValueAtIndex(this.hot.toPhysicalColumn(e));return typeof n=="number"?n:t}function bre(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function NS(t,e,n){return(e=Sre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sre(t){var e=Rre(t,"string");return typeof e=="symbol"?e:e+""}function Rre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 DS=0,iH=1,oH=2,Sc="px";let a$=class{constructor(e){NS(this,"hot",void 0),NS(this,"_element",null),NS(this,"state",DS),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=oH}build(){this.state===DS&&(this._element=this.hot.rootDocument.createElement("div"),this.state=iH)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=DS}isAppended(){return this.state===oH}isBuilt(){return this.state>=iH}setPosition(e,n){e!==void 0&&(this._element.style.top=e+Sc),n!==void 0&&(this._element.style.left=n+Sc)}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+Sc),n&&(this._element.style.height=n+Sc)}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+Sc),n&&(this._element.style.marginLeft=n+Sc)}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 Ere="ht__manualRowMove--backlight";class Tre extends a${build(){super.build(),G(this._element,Ere)}}const _re="ht__manualRowMove--guideline";class Mre extends a${build(){super.build(),G(this._element,_re)}}function Ire(t,e){l$(t,e),e.add(t)}function Rc(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 yu(t,e,n){return t.set(Za(t,e),n),n}function Ee(t,e){return t.get(Za(t,e))}function Za(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeRowMove");re.getSingleton().register("afterRowMove");const kS="manualRowMove",Pre=140,sH="ht__manualRowMove",Yp="show-ui",iE="on-moving--rows",oE="after-selection--rows";var jn=new WeakMap,Ja=new WeakMap,da=new WeakMap,al=new WeakMap,mr=new WeakMap,wm=new WeakMap,eu=new WeakSet;class Ore extends Xe{constructor(){super(...arguments),Ire(this,eu),Rc(this,jn,new Tre(this.hot)),Rc(this,Ja,new Mre(this.hot)),Rc(this,da,[]),Rc(this,al,void 0),Rc(this,mr,{}),Rc(this,wm,void 0)}static get PLUGIN_KEY(){return kS}static get PLUGIN_PRIORITY(){return Pre}isEnabled(){return!!this.hot.getSettings()[kS]}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 Za(eu,e,xre).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 Za(eu,e,Hre).call(e,...r)}),this.addHook("afterScrollHorizontally",()=>Za(eu,this,Dre).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 Za(eu,e,kre).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),G(this.hot.rootElement,sH),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){pe(this.hot.rootElement,sH),this.unregisterEvents(),Ee(jn,this).destroy(),Ee(Ja,this).destroy(),super.disablePlugin()}moveRow(e,n){return this.moveRows([e],n)}moveRows(e,n){const r=Ee(wm,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeRowMove",e,n,r,i);if(yu(wm,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 yu(wm,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=wr(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()[kS];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 de(o,s,a=>{n.push(a)}),n}refreshPositions(){const e=Ee(mr,this).coords,n=this.hot.getFirstFullyVisibleRow(),r=this.hot.getLastFullyVisibleRow(),i=this.hot.countRows();this.isFixedRowTop(e.row)&&n>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(n-1,-1)),this.isFixedRowBottom(e.row)&&r<i&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(r+1,1),void 0,!0);const o=this.hot.view._wt.wtTable,s=Ee(mr,this).TD,a=this.hot.rootElement,l=An(a),u=df(a),c=o.holder.scrollTop,h=this.hot.rootWindow!==u?u.scrollTop:0,d=l.top-h,f=Ee(mr,this).eventPageY-d+c,g=o.hider.offsetHeight,C=o.TBODY.offsetTop,y=Ee(jn,this).getOffset().top,E=Ee(jn,this).getSize().height,v=s.offsetHeight/2,P=s.offsetHeight;let O=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const L=f>=O+v;this.isFixedRowTop(e.row)&&(O+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?Ee(mr,this).row=n>0?n-1:n:L?(Ee(mr,this).row=e.row+1,O+=e.row===0?P-1:P):Ee(mr,this).row=e.row;let T=f,A=O;f+E+y>=g?T=g-E-y:f+y<C&&(T=C+Math.abs(y)),O>=g-1&&(A=g-1),Ee(jn,this).setPosition(T),Ee(Ja,this).setPosition(A)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>Za(eu,this,Are).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Za(eu,this,Nre).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Ee(jn,this).build(),Ee(Ja,this).build()}destroy(){Ee(jn,this).destroy(),Ee(Ja,this).destroy(),super.destroy()}}function xre(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(al,this)||t.button!==0){yu(al,this,!1),Ee(da,this).length=0,pe(this.hot.rootElement,[iE,Yp]);return}const l=Ee(Ja,this).isBuilt()&&!Ee(Ja,this).isAppended(),u=Ee(jn,this).isBuilt()&&!Ee(jn,this).isAppended();l&&u&&(Ee(Ja,this).appendTo(i.hider),Ee(jn,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,yu(al,this,!0),Ee(mr,this).eventPageY=t.pageY,Ee(mr,this).coords=e,Ee(mr,this).TD=n,yu(da,this,this.prepareRowsToMoving());const g=i.holder.scrollLeft+o.getRowHeaderWidth(),C=this.getRowsHeight(d,e.row-1)+(t.clientY-n.getBoundingClientRect().top);Ee(jn,this).setPosition(null,g),Ee(jn,this).setSize(i.hider.offsetWidth-g,this.getRowsHeight(d,f)),Ee(jn,this).setOffset(-C,null),G(this.hot.rootElement,iE),this.refreshPositions()}else pe(this.hot.rootElement,oE),yu(al,this,!1),Ee(da,this).length=0}function Are(t){Ee(al,this)&&(Ee(mr,this).eventPageY=t.pageY,this.refreshPositions())}function Hre(t,e,n,r){!this.hot.getSelectedRangeLast()||!Ee(al,this)||(Ee(da,this).indexOf(e.row)>-1?pe(this.hot.rootElement,Yp):G(this.hot.rootElement,Yp),r.row=!0,r.column=!0,r.cell=!0,Ee(mr,this).coords=e,Ee(mr,this).TD=n)}function Nre(){const t=Ee(mr,this).row,e=Ee(da,this).length;if(yu(al,this,!1),pe(this.hot.rootElement,[iE,Yp,oE]),this.hot.selection.isSelectedByRowHeader()&&G(this.hot.rootElement,oE),e<1||t===void 0)return;const n=Ee(da,this)[0],r=this.hot.toPhysicalRow(n),i=this.dragRows(Ee(da,this),t);if(Ee(da,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 Dre(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),n=t.holder.scrollLeft,r=e+n;Ee(jn,this).setPosition(null,r),Ee(jn,this).setSize(t.hider.offsetWidth-r)}function kre(){this.moveBySettingsOrLoad()}function Lre(t,e){u$(t,e),e.add(t)}function Mn(t,e,n){u$(t,e),e.set(t,n)}function u$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nt(t,e,n){return t.set(ra(t,e),n),n}function ne(t,e){return t.get(ra(t,e))}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 Gp="manualRowResize",$re=30,aH="manualRowHeights";var vs=new WeakMap,vm=new WeakMap,ji=new WeakMap,ef=new WeakMap,el=new WeakMap,pT=new WeakMap,Zc=new WeakMap,Cm=new WeakMap,Fn=new WeakMap,ms=new WeakMap,Hu=new WeakMap,Kp=new WeakMap,tf=new WeakMap,nf=new WeakMap,$o=new WeakMap,rf=new WeakMap,Ba=new WeakSet;class Fre extends Xe{static get PLUGIN_KEY(){return Gp}static get PLUGIN_PRIORITY(){return $re}constructor(e){super(e),Lre(this,Ba),Mn(this,vs,null),Mn(this,vm,null),Mn(this,ji,[]),Mn(this,ef,null),Mn(this,el,null),Mn(this,pT,null),Mn(this,Zc,null),Mn(this,Cm,null),Mn(this,Fn,this.hot.rootDocument.createElement("DIV")),Mn(this,ms,this.hot.rootDocument.createElement("DIV")),Mn(this,Hu,!1),Mn(this,Kp,!1),Mn(this,tf,0),Mn(this,nf,null),Mn(this,$o,void 0),Mn(this,rf,void 0),G(ne(Fn,this),"manualRowResizer"),G(ne(ms,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Gp]}enablePlugin(){this.enabled||(Nt($o,this,new vl),ne($o,this).addLocalHook("init",()=>ra(Ba,this,Yre).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,ne($o,this)),this.addHook("modifyRowHeight",(e,n)=>ra(Ba,this,zre).call(this,e,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Nt(rf,this,ne($o,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",aH,ne($o,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",aH,e),e.value}setManualSize(e,n){const r=this.hot.toPhysicalRow(e),i=Math.max(n,this.hot.view.getDefaultRowHeight());return ne($o,this).setValueAtIndex(r,i),i}getLastDesiredRowHeight(){return ne(ef,this)}setupHandlePosition(e){Nt(vs,this,e);const{view:n}=this.hot,{_wt:r}=n,i=r.wtTable.getCoords(ne(vs,this)),o=i.row;if(o<0)return;const s=Kt(ne(vs,this)),a=ne(vs,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(vs,this),i.row,i.col):u&&(c=r.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(ne(vs,this),i.row,i.col)),c||(c=r.wtOverlays.inlineStartOverlay.getRelativeCellPosition(ne(vs,this),i.row,i.col)),Nt(vm,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(o)),Nt(ji,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 g=f.getTopStartCorner().row,C=f.getBottomStartCorner().row;de(g,C,y=>{ne(ji,this).includes(y)||ne(ji,this).push(y)})})}ne(ji,this).includes(ne(vm,this))||Nt(ji,this,[ne(vm,this)]),Nt(Cm,this,c.top-6),Nt(Zc,this,parseInt(a.height,10)),ne(Fn,this).style.top=`${ne(Cm,this)+ne(Zc,this)}px`,ne(Fn,this).style[this.inlineDir]=`${c.start}px`,ne(Fn,this).style.width=`${s}px`,this.hot.rootElement.appendChild(ne(Fn,this))}refreshHandlePosition(){ne(Fn,this).style.top=`${ne(Cm,this)+ne(ef,this)}px`}setupGuidePosition(){const e=parseInt(Kt(ne(Fn,this)),10),n=parseInt(ne(Fn,this).style[this.inlineDir],10)+e,r=this.hot.view.getTableWidth();G(ne(Fn,this),"active"),G(ne(ms,this),"active"),ne(ms,this).style.top=ne(Fn,this).style.top,ne(ms,this).style[this.inlineDir]=`${n}px`,ne(ms,this).style.width=`${r-e}px`,this.hot.rootElement.appendChild(ne(ms,this))}refreshGuidePosition(){ne(ms,this).style.top=ne(Fn,this).style.top}hideHandleAndGuide(){pe(ne(Fn,this),"active"),pe(ne(ms,this),"active")}checkIfRowHeader(e){const n=Tu(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(el,this)<n?n:ne(el,this)}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},n=(r,i)=>{const o=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(r),r,!0);o!==void 0&&Nt(el,this,o),this.setManualSize(r,ne(el,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!0),i&&e()};ne(tf,this)>=2&&(ne(ji,this).length>1?(M(ne(ji,this),i=>{n(i)}),e()):M(ne(ji,this),i=>{n(i,!0)})),Nt(tf,this,0),Nt(nf,this,null)}bindEvents(){const{rootElement:e,rootWindow:n}=this.hot;this.eventManager.addEventListener(e,"mouseover",r=>ra(Ba,this,Vre).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>ra(Ba,this,Wre).call(this,r)),this.eventManager.addEventListener(n,"mousemove",r=>ra(Ba,this,Bre).call(this,r)),this.eventManager.addEventListener(n,"mouseup",()=>ra(Ba,this,jre).call(this)),this.eventManager.addEventListener(ne(Fn,this),"contextmenu",()=>ra(Ba,this,Ure).call(this))}destroy(){super.destroy()}}function Vre(t){if(!FN(t.target)&&ne(Kp,this)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(ne(Hu,this)||this.setupHandlePosition(e))}}function Wre(t){ve(t.target,"manualRowResizer")&&(this.setupHandlePosition(ne(vs,this)),this.setupGuidePosition(),Nt(Hu,this,!0),ne(nf,this)===null&&(Nt(nf,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ne(nf,this))),Nt(tf,this,ne(tf,this)+1),Nt(pT,this,t.pageY),Nt(el,this,ne(Zc,this)))}function Bre(t){ne(Hu,this)&&(Nt(ef,this,ne(Zc,this)+(t.pageY-ne(pT,this))),M(ne(ji,this),e=>{Nt(el,this,this.setManualSize(e,ne(ef,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function jre(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(n,r)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(n),n,!1),r&&t(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(n),n,!1)};ne(Hu,this)&&(this.hideHandleAndGuide(),Nt(Hu,this,!1),ne(el,this)!==ne(Zc,this)&&(ne(ji,this).length>1?(M(ne(ji,this),r=>{e(r)}),t()):M(ne(ji,this),r=>{e(r,!0)})),this.setupHandlePosition(ne(vs,this)))}function Ure(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ne(Fn,this)),this.hot.rootElement.removeChild(ne(ms,this)),Nt(Hu,this,!1),Nt(Kp,this,!0),this.hot._registerImmediate(()=>{Nt(Kp,this,!1)})}function zre(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalRow(e),i=ne($o,this).getValueAtIndex(r);this.hot.getSettings()[Gp]&&i&&(n=i)}return n}function Yre(){const t=this.hot.getSettings()[Gp],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e<"u"?e.forEach((n,r)=>{ne($o,this).setValueAtIndex(r,n)}):Array.isArray(t)?(t.forEach((n,r)=>{ne($o,this).setValueAtIndex(r,n)}),Nt(rf,this,t)):t===!0&&Array.isArray(ne(rf,this))&&ne(rf,this).forEach((n,r)=>{ne($o,this).setValueAtIndex(r,n)})},!0)}var lH={},uH;function Gre(){if(uH)return lH;uH=1;var t=_w();return t("flatMap"),lH}Gre();var cH={},hH={},LS,dH;function Kre(){if(dH)return LS;dH=1;var t=sn(),e=ln(),n=Os(),r=CE();return LS=function(i,o){(!o||typeof i!="string")&&e(i);var s=r(i);return n(e(s!==void 0?t(s,i):i))},LS}var fH;function qre(){if(fH)return hH;fH=1;var t=dt(),e=sn(),n=pr(),r=ln(),i=Os(),o=Kre(),s=SE(),a=Yi(),l=gl(),u=pl(),c=!l&&u("flatMap",TypeError),h=s(function(){for(var d=this.iterator,f=this.mapper,g,C;;){if(C=this.inner)try{if(g=r(e(C.next,C.iterator)),!g.done)return g.value;this.inner=null}catch(y){a(d,"throw",y)}if(g=r(e(this.next,d)),this.done=!!g.done)return;try{this.inner=o(f(g.value,this.counter++),!1)}catch(y){a(d,"throw",y)}}});return t({target:"Iterator",proto:!0,real:!0,forced:l||c},{flatMap:function(f){r(this);try{n(f)}catch(g){a(this,"throw",g)}return c?e(c,this,f):new h(i(this),{mapper:f,inner:null})}}),hH}var gH;function Xre(){return gH||(gH=1,qre()),cH}Xre();function Zre(t,e,n){Qre(t,e),e.set(t,n)}function Qre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tu(t,e,n){return(e=Jre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jre(t){var e=eie(t,"string");return typeof e=="symbol"?e:e+""}function eie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 mH(t,e){return t.get(c$(t,e))}function ym(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 nu=new WeakMap;class Cs{constructor(e,n,r,i,o,s){tu(this,"row",void 0),tu(this,"col",void 0),tu(this,"rowspan",void 0),tu(this,"colspan",void 0),tu(this,"removed",!1),tu(this,"cellCoordsFactory",void 0),tu(this,"cellRangeFactory",void 0),Zre(this,nu,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 nt`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 nt`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 nt`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 nt`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),ym(nu,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,ym(nu,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 ym(nu,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 mH(nu,this)||ym(nu,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),mH(nu,this)}}function tie(t,e){nie(t,e),e.add(t)}function nie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bm(t,e,n){return(e=rie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rie(t){var e=iie(t,"string");return typeof e=="symbol"?e:e+""}function iie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ru(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 ja=new WeakSet;class qp{constructor(e){tie(this,ja),bm(this,"plugin",void 0),bm(this,"mergedCells",[]),bm(this,"mergedCellsMatrix",new Map),bm(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:n,col:r}=e;return nt`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)){Ze(qp.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 Cs(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),ru(ja,this,pH).call(this,a),a):(u&&Ze(qp.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),ru(ja,this,oie).call(this,r),r):!1}clear(){M(this.mergedCells,e=>{let{row:n,col:r,rowspan:i,colspan:o}=e;de(n,n+i,s=>{de(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=Ue(u,i,i+s-1),d=Ue(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=ru(ja,this,Sm).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=ru(ja,this,Sm).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=ru(ja,this,Sm).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=ru(ja,this,Sm).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=>{ru(ja,this,pH).call(this,s)})}}function Sm(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 pH(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 oie(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 $S(t,e,n){return(e=sie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sie(t){var e=aie(t,"string");return typeof e=="symbol"?e:e+""}function aie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class lie{constructor(e){$S(this,"plugin",void 0),$S(this,"mergedCellsCollection",void 0),$S(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,g=s-f,C=this.getFarthestCollection(e,n,r,i);if(C){if(r==="down"){const y=C.row+C.rowspan-a-g;o[2]+y>=this.plugin.hot.countRows()?o[2]-=g:o[2]+=g?y:0}else if(r==="right"){const y=C.col+C.colspan-l-g;o[3]+y>=this.plugin.hot.countCols()?o[3]-=g:o[3]+=g?y:0}else if(r==="up"){const y=u-g-C.row+1;o[0]+y<0?o[0]+=g:o[0]-=g?y:0}else if(r==="left"){const y=c-g-C.col+1;o[1]+y<0?o[1]+=g:o[1]-=g?y: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,g=Math.floor(d/f)*f,C=d-g;let y=null,E=null,v=null;switch(r){case"up":y="includesVertically",v=c-C+1;break;case"left":y="includesHorizontally",v=c-C+1;break;case"down":y="includesVertically",v=h+C-1;break;case"right":y="includesHorizontally",v=h+C-1;break}return M(i,P=>{P[y](v)&&P.isFarther(E,r)&&(E=P)}),E}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const n=this.getRangeFromChanges(e),r=this.currentFillData.foundMergedCells,i=this.currentFillData.dragDirection,o=(u,c)=>{switch(i){case"up":return u.row-c>=n.from.row;case"down":return u.row+u.rowspan-1+c<=n.to.row;case"left":return u.col-c>=n.from.column;case"right":return u.col+u.colspan-1+c<=n.to.column;default:return null}};let s=0,a=null,l=1;do for(let u=0;u<r.length;u+=1){if(a=r[u],s=l*this.currentFillData.cycleLength,o(a,s))switch(i){case"up":this.plugin.mergedCellsCollection.add({row:a.row-s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"down":this.plugin.mergedCellsCollection.add({row:a.row+s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"left":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col-s,colspan:a.colspan},!0);break;case"right":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col+s,colspan:a.colspan},!0);break}u===r.length-1&&(l+=1)}while(o(a,s));this.currentFillData=null,this.plugin.hot.render(),r.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const n={min:null,max:null},r={min:null,max:null};return 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(g=>{let{colspan:C}=g;return C===h.getWidth()}):!f.every(g=>{let{rowspan:C}=g;return C===h.getHeight()})}}function FS(t,e,n){return(e=uie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uie(t){var e=cie(t,"string");return typeof e=="symbol"?e:e+""}function cie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 hie{constructor(e){FS(this,"plugin",void 0),FS(this,"hot",void 0),FS(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 die(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(Ar)}return this.getTranslatedPhrase(xr)},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?Cs.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 of(t,e,n){return(e=fie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fie(t){var e=gie(t,"string");return typeof e=="symbol"?e:e+""}function gie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wH{constructor(e){of(this,"data",void 0),of(this,"next",null),of(this,"prev",null),this.data=e}}class Rm{constructor(){of(this,"first",null),of(this,"last",null)}push(e){const n=new wH(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 wH(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 mie(t,e){h$(t,e),e.add(t)}function iu(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 tt(t,e){return t.get(Xp(t,e))}function Di(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")}var ls=new WeakMap,us=new WeakMap,cs=new WeakMap,hs=new WeakMap,sE=new WeakMap,Em=new WeakMap,Tm=new WeakMap,VS=new WeakSet;class pie{constructor(e){let{mergedCellsGetter:n,rowIndexMapper:r,columnIndexMapper:i}=e;mie(this,VS),iu(this,ls,new Rm),iu(this,us,new Rm),iu(this,cs,null),iu(this,hs,null),iu(this,sE,null),iu(this,Em,null),iu(this,Tm,null),Di(sE,this,n),Di(Em,this,r),Di(Tm,this,i)}getCurrentVerticalNode(){return tt(hs,this).data}getFirstVerticalNode(){return tt(us,this).first.data}getNextVerticalNode(){return tt(hs,this).next.data}getPrevVerticalNode(){return tt(hs,this).prev.data}getCurrentHorizontalNode(){return tt(cs,this).data}getFirstHorizontalNode(){return tt(ls,this).first.data}getNextHorizontalNode(){return tt(cs,this).next.data}getPrevHorizontalNode(){return tt(cs,this).prev.data}setPrevNodeAsActive(){Di(hs,this,tt(hs,this).prev),Di(cs,this,tt(cs,this).prev)}setNextNodeAsActive(){Di(hs,this,tt(hs,this).next),Di(cs,this,tt(cs,this).next)}buildFocusOrder(e){const n=e.getTopStartCorner(),r=e.getBottomEndCorner(),i=new WeakSet;Di(ls,this,new Rm);for(let s=n.row;s<=r.row;s++)if(!tt(Em,this).isHidden(s))for(let a=n.col;a<=r.col;a++){if(tt(Tm,this).isHidden(a))continue;const l=Xp(VS,this,vH).call(this,e,tt(ls,this),i,s,a);l&&Di(cs,this,l)}tt(ls,this).first&&(tt(ls,this).first.prev=tt(ls,this).last,tt(ls,this).last.next=tt(ls,this).first);const o=new WeakSet;Di(us,this,new Rm);for(let s=n.col;s<=r.col;s++)if(!tt(Tm,this).isHidden(s))for(let a=n.row;a<=r.row;a++){if(tt(Em,this).isHidden(a))continue;const l=Xp(VS,this,vH).call(this,e,tt(us,this),o,a,s);l&&Di(hs,this,l)}tt(us,this).first&&(tt(us,this).first.prev=tt(us,this).last,tt(us,this).last.next=tt(us,this).first)}setActiveNode(e,n){return tt(ls,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return Di(cs,this,r),!1}),tt(us,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return Di(hs,this,r),!1}),this}}function vH(t,e,n,r,i){const o=t.getTopStartCorner(),s=t.getBottomEndCorner(),a=t.highlight.clone().normalize(),l=tt(sE,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 d$(t,e,n){const{view:r,rowIndexMapper:i}=t,o=r.getStylesHandler(),s=r.getDefaultRowHeight();let a=0;for(let u=e;u<e+n;u++)if(!i.isHidden(u)){var l;a+=(l=t.getRowHeight(u))!==null&&l!==void 0?l:s,u===0&&!o.isClassicTheme()&&(a+=1)}return a}function wie(t){const{hot:e}=t,{rowIndexMapper:n,columnIndexMapper:r}=e,i=new Map;function o(){}function s(a,l,u){const c=t.mergedCellsCollection.get(l,u);if(!Ae(c)){a.removeAttribute("rowspan"),a.removeAttribute("colspan"),yp()&&i.has(l)&&!e.getSettings().rowHeaders&&(a.style.height=`${i.get(l)}px`,i.delete(l)),a.style.display="";return}const{row:h,col:d,colspan:f,rowspan:g}=c,[C,y]=t.translateMergedCellToRenderable(h,g,d,f),E=t.getSetting("virtualized");if(yp()&&d===0&&!e.getSettings().rowHeaders){const j=d$(e,h,g);i.set(l,j/g)}const v=n.getRenderableFromVisualIndex(l),P=r.getRenderableFromVisualIndex(u),O=C-v+1,L=y-P+1;let T=n.getNearestNotHiddenIndex(h,1),A=r.getNearestNotHiddenIndex(d,1);if(E){const j=e.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(j)||(T=Math.max(T,e.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(j)||(A=Math.max(A,e.getFirstRenderedVisibleColumn()))}const K=Math.min(g,O),U=Math.min(f,L);T===l&&A===u?(a.setAttribute("rowspan",K),a.setAttribute("colspan",U)):(a.removeAttribute("rowspan"),a.removeAttribute("colspan"),a.style.display="none")}return{before:o,after:s}}function vie(t,e){f$(t,e),e.add(t)}function _m(t,e,n){f$(t,e),e.set(t,n)}function f$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function WS(t,e,n){return(e=Cie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cie(t){var e=yie(t,"string");return typeof e=="symbol"?e:e+""}function yie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function If(t,e,n){return t.set(rt(t,e),n),n}function ht(t,e){return t.get(rt(t,e))}function rt(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeMergeCells");re.getSingleton().register("afterMergeCells");re.getSingleton().register("beforeUnmergeCells");re.getSingleton().register("afterUnmergeCells");const aE="mergeCells",bie=150,CH=aE;var uo=new WeakMap,co=new WeakMap,Ts=new WeakMap,yH=new WeakMap,lt=new WeakSet;class Sie extends Xe{constructor(){super(...arguments),vie(this,lt),WS(this,"mergedCellsCollection",null),WS(this,"autofillCalculations",null),WS(this,"selectionCalculations",null),_m(this,uo,null),_m(this,co,{row:0,col:0}),_m(this,Ts,new pie({mergedCellsGetter:(e,n)=>this.mergedCellsCollection.get(e,n),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),_m(this,yH,wie(this))}static get PLUGIN_KEY(){return aE}static get PLUGIN_PRIORITY(){return bie}static get DEFAULT_SETTINGS(){return{[Ak]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[aE]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new qp(this),this.autofillCalculations=new lie(this),this.selectionCalculations=new hie(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Rie).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 rt(lt,e,Tie).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 rt(lt,e,_ie).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 rt(lt,e,Mie).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 rt(lt,e,Iie).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 rt(lt,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 rt(lt,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 rt(lt,e,Oie).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 rt(lt,e,xie).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 rt(lt,e,Aie).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 rt(lt,e,bH).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 rt(lt,e,bH).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 rt(lt,e,Eie).call(e,...r)}),this.addHook("afterRenderer",function(){return ht(yH,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 rt(lt,e,Pie).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 rt(lt,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 rt(lt,e,Nie).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 rt(lt,e,Die).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 rt(lt,e,kie).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 rt(lt,e,Lie).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 rt(lt,e,$ie).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Fie).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 rt(lt,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 rt(lt,e,Wie).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 rt(lt,e,Bie).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 rt(lt,e,jie).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 rt(lt,e,Uie).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 rt(lt,e,zie).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 rt(lt,e,Yie).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(!UN())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=wp(s,"backgroundColor").replace(")",", 0.99)"),e.push(s))})}),this.hot._registerTimeout(()=>{e.forEach(r=>{var i;r.style.background=(i=wp(r,"backgroundColor"))===null||i===void 0?void 0:i.replace(", 0.99)",")")})},1)}validateSetting(e){return e?Cs.containsNegativeValues(e)?(Ze(Cs.NEGATIVE_VALUES_WARNING(e)),!1):Cs.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(Ze(Cs.IS_OUT_OF_BOUNDS_WARNING(e)),!1):Cs.isSingleCell(e)?(Ze(Cs.IS_SINGLE_CELL(e)),!1):Cs.containsZeroSpan(e)?(Ze(Cs.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),de(0,s.rowspan-1,c=>{de(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),de(0,i.rowspan-1,o=>{de(0,i.colspan-1,s=>{this.hot.removeCellMeta(i.row+o,i.col+s,"hidden"),this.hot.removeCellMeta(i.row+o,i.col+s,"copyable")})}),this.hot.removeCellMeta(i.row,i.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,n),this.hot.render())}toggleMerge(e){const{from:n,to:r}=e.clone().normalize(),i=this.mergedCellsCollection.get(n.row,n.col);i.row===n.row&&i.col===n.col&&i.row+i.rowspan-1===r.row&&i.col+i.colspan-1===r.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,n,r,i){const o=this.hot._createCellCoords(e,n),s=this.hot._createCellCoords(r,i);this.mergeRange(this.hot._createCellRange(o,o,s))}unmerge(e,n,r,i){const o=this.hot._createCellCoords(e,n),s=this.hot._createCellCoords(r,i);this.unmergeRange(this.hot._createCellRange(o,o,s))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const r=this.hot.getSelectedRangeLast();r&&!r.isSingleHeader()&&(this.toggleMerge(r),this.hot.render())},runOnlyIf:r=>!r.altKey,group:CH})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(CH)}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 Rie(){this.generateFromSettings(),this.hot.render()}function Eie(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 Tie(t){ht(co,this).row=t.row,ht(co,this).col=t.col}function _ie(t){const e=this.hot.getSelectedRangeLast(),{highlight:n}=e,{columnIndexMapper:r,rowIndexMapper:i}=this.hot;ht(uo,this)&&(i.getRenderableFromVisualIndex(ht(uo,this).row)!==null&&(n.row=ht(uo,this).row),r.getRenderableFromVisualIndex(ht(uo,this).col)!==null&&(n.col=ht(uo,this).col),If(uo,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 Mie(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 Iie(){const t=this.hot.getSelectedRangeLast(),{highlight:e}=t;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){If(uo,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);If(uo,this,e.clone()),n&&e.assign(n)}function bH(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(),g=["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[Ue(g,u,h),Ue(C,c,d),Ue(this.hot.getLastRenderedVisibleRow(),u,h),Ue(this.hot.getLastRenderedVisibleColumn(),c,d)]}return[u,c,h,d]}function Pie(t){t.items.push({name:"---------"},die(this))}function SH(){If(uo,this,null)}function Oie(){if(ht(uo,this).isCell())return;const t=this.hot.getSelectedRangeLast(),e=t.getVerticalDirection(),n=t.getHorizontalDirection(),r=ht(uo,this).clone().normalize();ht(Ts,this).setActiveNode(r.row,r.col),ht(co,this).row>0||ht(co,this).col>0?ht(Ts,this).setPrevNodeAsActive():(n==="E-W"&&ht(co,this).col<0||e==="S-N"&&ht(co,this).row<0)&&ht(Ts,this).setNextNodeAsActive()}function xie(t,e){const n=this.hot.getSelectedRangeLast(),{columnIndexMapper:r,rowIndexMapper:i}=this.hot;let o=null,s=null;if(ht(co,this).col<0){const{rowEnd:a,colEnd:l}=ht(Ts,this).getPrevHorizontalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(ht(co,this).col>0){const{rowStart:a,colStart:l}=ht(Ts,this).getNextHorizontalNode();s=r.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}else if(ht(co,this).row<0){const{rowEnd:a,colEnd:l}=ht(Ts,this).getPrevVerticalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(ht(co,this).row>0){const{rowStart:a,colStart:l}=ht(Ts,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(Ts,this).setActiveNode(t,e),If(co,this,{row:0,col:0})}function Aie(){this.hot.getSelectedRangeLast().isHeader()||ht(Ts,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 Nie(t){if(this.getSetting("virtualized"))return;const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function Die(t){if(this.getSetting("virtualized"))return;const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function kie(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 Lie(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function $ie(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function Fie(t,e,n){n!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function Vie(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function Wie(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function Bie(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 jie(t,e,n,r){if(n)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,n,r)}function Uie(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function zie(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 Yie(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:g}=f;return Math.max(d,g)},1);let h=0;return u.length>1&&u[0].rowspan<c&&(h=c-u[0].rowspan),u.forEach(d=>{let{rowspan:f}=d,g=0;n==="top"||n==="top_inline_start_corner"?g=Math.min(c,this.hot.view.countNotHiddenFixedRowsTop()-e):g=f-h,t=Math.max(t??0,d$(this.hot,e,g))}),t}function Gie(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,g=(d.compareFunctionFactory?d.compareFunctionFactory:jk(u.type))(l,u,d)(c,h);if(g===_s){const C=a+1;if(typeof e[C]<"u")return s(C)}return g}(0)}}const g$="sort";function Kie(t,e,n){const r=[];return n===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&r.push(`${g$}-${t.getIndexOfColumnInSortQueue(e)+1}`),r}function qie(t){const e=t.className.split(" "),n=new RegExp(`^${g$}-[0-9]{1,2}$`);return e.filter(r=>n.test(r))}function Xie(t,e,n){return(e=Zie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zie(t){var e=Qie(t,"string");return typeof e=="symbol"?e:e+""}function Qie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Zp="multiColumnSorting",Jie=170,RH=Zp;Bk(Zp,Gie);class eoe extends Qk{constructor(){super(...arguments),Xie(this,"pluginKey",Zp)}static get PLUGIN_KEY(){return Zp}static get PLUGIN_PRIORITY(){return Jie}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,Ap)),!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:Cl,position:"before",group:RH})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(RH)}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),pe(e,qie(e)),this.enabled!==!1&&G(e,Kie(...r))}onAfterOnCellMouseDown(e,n){nT(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,Ap))):this.sort(this.getColumnNextConfig(n.col)))}}function EH(t,e,n){return(e=toe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function toe(t){var e=noe(t,"string");return typeof e=="symbol"?e:e+""}function noe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 roe="multipleSelectionHandles",ioe=160;class ooe extends Xe{constructor(){super(...arguments),EH(this,"dragged",[]),EH(this,"lastSetCell",null)}static get PLUGIN_KEY(){return roe}static get PLUGIN_PRIORITY(){return ioe}isEnabled(){return ua()}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(ve(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(ve(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(ve(i.target,"topSelectionHandle-HitArea"))return r.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(ve(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 lE(){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 m$(){return{label:"",isPlaceholder:!0}}function soe(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=lE();if(Ae(a)){const{label:c,colspan:h,headerClassName:d}=a;l.label=Pt(c),typeof h=="number"&&h>1&&(l.colspan=h,l.origColspan=h),typeof d=="string"&&(l.headerClassNames=[...d.split(" ")])}else l.label=Pt(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(m$());return!u})});const r=Math.max(...Be(n,i=>i.length));return M(n,i=>{if(i.length<r){const o=Be(new Array(r-i.length),()=>lE());i.splice(i.length,0,...o)}}),n}function BS(t,e,n){aoe(t,e),e.set(t,n)}function aoe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mo(t,e){return t.get(p$(t,e))}function Sd(t,e,n){return t.set(p$(t,e),n),n}function p$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const TH=["label","collapsible"];var Ks=new WeakMap,ou=new WeakMap,jS=new WeakMap;class loe{constructor(){BS(this,Ks,[]),BS(this,ou,0),BS(this,jS,1/0)}setColumnsLimit(e){Sd(jS,this,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Sd(Ks,this,soe(e,Mo(jS,this))),Sd(ou,this,Mo(Ks,this).length)}getData(){return Mo(Ks,this)}mergeWith(e){M(e,n=>{let{row:r,col:i,...o}=n;const s=this.getHeaderSettings(r,i);s!==null&&rn(s,o,TH)})}map(e){M(Mo(Ks,this),n=>{M(n,r=>{const i=e({...r});Ae(i)&&rn(r,i,TH)})})}getHeaderSettings(e,n){var r;if(e>=Mo(ou,this)||e<0)return null;const i=Mo(Ks,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>=Mo(ou,this)||e<0)return i;const o=Mo(Ks,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 Mo(ou,this)}getColumnsCount(){return Mo(ou,this)>0?Mo(Ks,this)[0].length:0}clear(){Sd(Ks,this,[]),Sd(ou,this,0)}}function US(t,e,n){return(e=uoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uoe(t){var e=coe(t,"string");return typeof e=="symbol"?e:e+""}function coe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 w$="DF-pre-order";function v$(t,e){let n=t.call(e,this);for(let r=0;r<this.childs.length;r++){if(n===!1)return!1;n=v$.call(this.childs[r],t,e)}return n}const hoe="DF-post-order";function C$(t,e){for(let n=0;n<this.childs.length;n++)if(C$.call(this.childs[n],t,e)===!1)return!1;return t.call(e,this)}const y$="BF";function doe(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 foe=y$,_H=new Map([[w$,v$],[hoe,C$],[y$,doe]]);class Qp{constructor(e){US(this,"data",{}),US(this,"parent",null),US(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 Qp({...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]:foe;if(!_H.has(n))throw new Error(`Traversal strategy "${n}" does not exist`);_H.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 zS(t,e,n){goe(t,e),e.set(t,n)}function goe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $n(t,e){return t.get(b$(t,e))}function moe(t,e,n){return t.set(b$(t,e),n),n}function b$(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 Ec=new WeakMap,su=new WeakMap,Tc=new WeakMap;class poe{constructor(e){zS(this,Ec,new Map),zS(this,su,new Map),zS(this,Tc,null),moe(Tc,this,e)}getRoots(){return Array.from($n(Ec,this).values())}getRootByColumn(e){let n;return $n(su,this).has(e)&&(n=$n(Ec,this).get($n(su,this).get(e))),n}getNode(e,n){const r=this.getRootByColumn(n);if(!r)return;const i=n-$n(su,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;$n(su,this).clear(),M($n(Ec,this),n=>{let[,{data:{colspan:r}}]=n;for(let i=e;i<e+r;i++)$n(su,this).set(i,e);e+=r})}buildTree(){this.clear();const e=$n(Tc,this).getColumnsCount();let n=0;for(;n<e;){const r=$n(Tc,this).getHeaderSettings(0,n),i=new Qp;$n(Ec,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=$n(Tc,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 Qp(a),e.addChild(l)),r<$n(Tc,this).getLayersCount()&&this.buildLeaves(l,n,r,s.origColspan),n+=s.origColspan})}clear(){$n(Ec,this).clear(),$n(su,this).clear()}}function S$(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 Jp(t,e){let{childs:n}=t;if(n.length!==0)return n[0].data[e]}function ew(t){return Jp(t,"origColspan")===t.data.origColspan}function wT(t){const{data:e,childs:n}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(ew(t))return wT(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,S$(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):ew(a)&&(l.isCollapsed=Jp(a,"isCollapsed"))}),{rollbackModification:()=>vT(t),affectedColumns:Array.from(o),colspanCompensation:s}}function vT(t){var e;const{data:n,childs:r}=t;if(n.isCollapsed||n.isHidden||n.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(ew(t))return vT(r[0]);n.isCollapsed=!0;const o=r.slice(1),s=new Set;if(o.length>0)M(o,l=>{S$(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=Jp(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):ew(l)&&(u.isCollapsed=Jp(l,"isCollapsed"))}),{rollbackModification:()=>wT(t),affectedColumns:Array.from(s),colspanCompensation:a}}function woe(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(nt`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 voe(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(nt`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 MH=new Map([["collapse",vT],["expand",wT],["hide-column",woe],["show-column",voe]]);function Coe(t,e,n){if(!MH.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return MH.get(t)(e,n)}function Mm(t){const e=[];return M(t,n=>{n.walkDown(r=>{const i=r.data,{origColspan:o,columnIndex:s,headerLevel:a,crossHiddenColumns:l}=i,u=boe(e,a);let c=!1;for(let h=s;h<s+o;h++)if(l.includes(h)||c)u.push(m$());else{const f=yoe(i);f.isRoot=!0,u.push(f),c=!0}})}),e}function yoe(t){const{crossHiddenColumns:e,...n}=lE(t);return n}function boe(t,e){let n;return Array.isArray(t[e])?n=t[e]:(n=[],t[e]=n),n}function YS(t,e,n){Soe(t,e),e.set(t,n)}function Soe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Rd(t,e,n){return t.set(R$(t,e),n),n}function xt(t,e){return t.get(R$(t,e))}function R$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ds=new WeakMap,or=new WeakMap,au=new WeakMap;class Roe{constructor(){YS(this,ds,new loe),YS(this,or,new poe(xt(ds,this))),YS(this,au,[[]])}setState(e){xt(ds,this).setData(e);let n=!1;try{xt(or,this).buildTree()}catch{xt(or,this).clear(),xt(ds,this).clear(),n=!0}return Rd(au,this,Mm(xt(or,this).getRoots())),n}setColumnsLimit(e){xt(ds,this).setColumnsLimit(e)}mergeStateWith(e){const n=Be(e,r=>{let{row:i,...o}=r;return{row:i<0?this.rowCoordsToLevel(i):i,...o}});xt(ds,this).mergeWith(n),xt(or,this).buildTree(),Rd(au,this,Mm(xt(or,this).getRoots()))}mapState(e){xt(ds,this).map(e),xt(or,this).buildTree(),Rd(au,this,Mm(xt(or,this).getRoots()))}mapNodes(e){return wr(xt(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=xt(or,this).getNode(n,r);let o;return i&&(o=Coe(e,i,r),Rd(au,this,Mm(xt(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=xt(au,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=xt(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=xt(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)},w$)}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 xt(ds,this).getLayersCount()}getColumnsCount(){return xt(ds,this).getColumnsCount()}clear(){Rd(au,this,[]),xt(ds,this).clear(),xt(or,this).clear()}}function Ed(t,e,n){return(e=Eoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Eoe(t){var e=Toe(t,"string");return typeof e=="symbol"?e:e+""}function Toe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 _oe{constructor(e,n){Ed(this,"hot",void 0),Ed(this,"nestedHeaderSettingsGetter",void 0),Ed(this,"layersCount",0),Ed(this,"container",void 0),Ed(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 g=f.label;s&&(g+='<button class="changeType"></button>'),ph(d,g),d.colSpan=f.colspan,u.appendChild(d)}}o.appendChild(u)}i.appendChild(o),e.appendChild(i)}clear(){this.widthsMap.clear(),this.container=null}}function Moe(t,e){E$(t,e),e.add(t)}function IH(t,e,n){return(e=Ioe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ioe(t){var e=Poe(t,"string");return typeof e=="symbol"?e:e+""}function Poe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Td(t,e,n){E$(t,e),e.set(t,n)}function E$(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 t.set(At(t,e),n),n}function Ve(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 PH="nestedHeaders",Ooe=280;var st=new WeakMap,Ua=new WeakMap,sf=new WeakMap,nv=new WeakMap,tw=new WeakMap,Ft=new WeakSet;class xoe extends Xe{constructor(){super(...arguments),Moe(this,Ft),Td(this,st,new Roe),Td(this,Ua,null),Td(this,sf,null),Td(this,nv,!1),Td(this,tw,null),IH(this,"ghostTable",new _oe(this.hot,(e,n)=>this.getHeaderSettings(e,n))),IH(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return PH}static get PLUGIN_PRIORITY(){return Ooe}isEnabled(){return!!this.hot.getSettings()[PH]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();(!Array.isArray(n)||!Array.isArray(n[0]))&&Ze(nt`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",()=>At(Ft,this,Goe).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 At(Ft,e,Koe).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 At(Ft,e,Doe).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 At(Ft,e,koe).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 At(Ft,e,Loe).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 At(Ft,e,$oe).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 At(Ft,e,Foe).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 At(Ft,e,Voe).call(e,...i)}),this.addHook("afterSelection",()=>At(Ft,this,Im).call(this)),this.addHook("afterSelectionFocusSet",()=>At(Ft,this,Im).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 At(Ft,e,Aoe).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",r=>At(Ft,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 At(Ft,e,Uoe).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 At(Ft,e,zoe).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 At(Ft,e,Hoe).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 At(Ft,e,Noe).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 At(Ft,e,Woe).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 At(Ft,e,joe).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 At(Ft,e,Yoe).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>At(Ft,this,Im).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>At(Ft,this,Im).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();Ve(st,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=Ve(st,this).setState(e)),this.detectedOverlappedHeaders&&Ze(nt`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";Ve(st,this).triggerColumnModification(i,r)}),!Ve(Ua,this)&&this.enabled&&fa(Ua,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(n=>{n.forEach(r=>{let{op:i,index:o,newValue:s}=r;if(i==="replace"){const a=s===!0?"hide-column":"show-column";Ve(st,this).triggerColumnModification(a,o)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),Ve(st,this).clear(),Ve(Ua,this).unsubscribe(),fa(Ua,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return Ve(st,this)}getLayersCount(){return Ve(st,this).getLayersCount()}getHeaderSettings(e,n){return Ve(st,this).getHeaderSettings(e,n)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,n=e.getSetting("columnHeaders").length,r=e.wtTable.THEAD,i=e.wtOverlays.topOverlay.clone.wtTable.THEAD,o=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let s=0;s<n;s++){const a=r.childNodes[s];if(!a)break;const l=i.childNodes[s],u=o?o.childNodes[s]:null;for(let c=0,h=a.childNodes.length;c<h;c++)a.childNodes[c].removeAttribute("colspan"),pe(a.childNodes[c],"hiddenHeader"),l&&l.childNodes[c]&&(l.childNodes[c].removeAttribute("colspan"),pe(l.childNodes[c],"hiddenHeader")),o&&u&&u.childNodes[c]&&(u.childNodes[c].removeAttribute("colspan"),pe(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"),pe(o,"hiddenHeader"),pe(o,"hiddenHeaderText");const{colspan:c,isHidden:h,isPlaceholder:d,headerClassNames:f}=(s=Ve(st,this).getHeaderSettings(e,u))!==null&&s!==void 0?s:{};if(d||h)G(o,"hiddenHeader");else if(c>1){var g,C,y;const{wtOverlays:E}=l._wt,v=(g=E.topInlineStartCornerOverlay)===null||g===void 0?void 0:g.clone.wtTable.THEAD.contains(o),P=(C=E.inlineStartOverlay)===null||C===void 0?void 0:C.clone.wtTable.THEAD.contains(o);((y=E.topOverlay)===null||y===void 0?void 0:y.clone.wtTable.THEAD.contains(o))&&u<r&&G(o,"hiddenHeaderText");const L=v||P?Math.min(c,r-i):c;L>1&&o.setAttribute("colspan",L)}if(this.hot.view.appendColHeader(u,o,function(){return n.getColumnHeaderValue(...arguments)},e),!d&&!h){const E=o.querySelector("div.relative");E&&f&&f.length>0&&(pe(E,this.hot.getColumnMeta(u).headerClassName),G(E,f))}}}getColumnHeaderValue(e,n){var r;const{isHidden:i,isPlaceholder:o}=(r=Ve(st,this).getHeaderSettings(n,e))!==null&&r!==void 0?r:{};return o||i?"":this.hot.getColHeader(e,n)}destroy(){fa(st,this,null),Ve(Ua,this)!==null&&(Ve(Ua,this).unsubscribe(),fa(Ua,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return Ve(st,this).getHeaderTreeNodeData(e.row,e.col)}}function Im(){var t;const e=(t=this.hot)===null||t===void 0?void 0:t.getSelectedRangeLast();if(!e)return;const{highlight:n}=e;if(n.isHeader()&&n.col>=0){const i=Ve(st,this).findLeftMostColumnIndex(n.row,n.col),o=this.hot.selection.highlight.getFocus();o.visualCellRange.highlight.col=i,o.visualCellRange.from.col=i,o.visualCellRange.to.col=i,o.commit()}}function Aoe(t,e){var n;const r=this.hot.getSelectedRangeLast();if(!r)return t;const{highlight:i}=r,{navigableHeaders:o}=this.hot.getSettings(),s=this.hot.selection.isSelectedByColumnHeader(),a=o?i.row:(n=Ve(tw,this))===null||n===void 0?void 0:n.row,l=s?t:i.col,u=a<0&&l>=0;if(fa(tw,this,null),!u)return t;const c=this.hot.getFirstFullyVisibleColumn(),h=this.hot.getLastFullyVisibleColumn(),d=h-c+1,f=Ve(st,this).findLeftMostColumnIndex(a,l),g=Ve(st,this).findRightMostColumnIndex(a,l),C=g-f+1;if(f<c&&g>h)return f;if(s){let y=null;return f>=c&&g>h?C>d?(e.value="start",y=f):(e.value="end",y=g):f<c&&g<=h&&(C>d?(e.value="end",y=g):(e.value="start",y=f)),y}return f<=c?f:g}function Hoe(t,e,n){const r=Ve(st,this).getHeaderTreeNodeData(e,t);if(!r)return t;const{columnCursor:i,selectionType:o,selectionWidth:s}=n,{isRoot:a,colspan:l}=Ve(st,this).getHeaderSettings(e,t);if(o===h0){if(!a)return r.columnIndex}else if(o===wD&&(l>s-i||!a))return null;return t}function Noe(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 g=c+f,C=d-a;if(C===0)continue;((i=Ve(st,this).getHeaderTreeNodeData(f,d))===null||i===void 0?void 0:i.isRoot)===!1&&(t[g][C]="")}}}function Doe(t,e,n,r){this._getHeaderTreeNodeDataByCoords(e)&&(r.column=!0)}function koe(t,e){const n=this._getHeaderTreeNodeDataByCoords(e);if(!n)return;fa(sf,this,e.clone()),fa(nv,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):(e0(t)||Mu(t)&&l||Ez(t))&&o.push(s,s+a-1,e.row),r.selectColumns(...o)}function Loe(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=Ue(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 $oe(){fa(nv,this,!1)}function Foe(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!Ve(nv,this)||!t)return;const e=this.hot.getSelectedRangeLast(),n=e.getTopStartCorner().col,r=e.getBottomEndCorner().col,{columnIndex:i,origColspan:o}=Ve(st,this).getHeaderTreeNodeData(Ve(sf,this).row,Ve(sf,this).col);if(e.setHighlight(Ve(sf,this)),o>e.getWidth()||i<n||i+o-1>r){const s=Ve(st,this).findTopMostEntireHeaderLevel(Ue(n,i,i+o-1),Ue(r,i,i+o-1));e.highlight.row=s,e.highlight.col=e.from.col}}function Voe(t){const{highlight:e}=this.hot.getSelectedRangeLast(),n=this.hot._createCellCoords(e.row+t.row,e.col+t.col);if(!(n.isHeader()&&n.col>=0))return;const i=Ve(st,this).findLeftMostColumnIndex(n.row,n.col),o=Ve(st,this).findRightMostColumnIndex(n.row,n.col);if(t.col<0){const s=e.col>=i&&e.col<=o?i-1:o,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,-1);a===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,e.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(a,e.col)-1,1)}else if(t.col>0){const s=e.col>=i&&e.col<=o?o+1:i,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,1);a===null?t.col=this.hot.view.countRenderableColumnsInRange(e.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(e.col,a)-1,1)}}function Woe(t,e,n){const r=t.row,i=this._getHeaderTreeNodeDataByCoords({row:r,col:t.col}),o=this._getHeaderTreeNodeDataByCoords({row:r,col:e.col});fa(tw,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(Ve(st,this).getLayersCount()>0){t.length=0;for(let e=0;e<Ve(st,this).getLayersCount();e++)t.push(this.headerRendererFactory(e))}}function joe(t){const e=Ve(st,this).getLayersCount();let n=t.startColumn,r=!!e;for(let i=0;i<e;i++){const o=Ve(st,this).findLeftMostColumnIndex(i,t.startColumn),s=this.hot.columnIndexMapper.getRenderableFromVisualIndex(o);if(o>=0&&(r=!1),Un(s)&&s<t.startColumn){n=s;break}}t.startColumn=r?Ve(st,this).getHeaderTreeNodeData(0,n).columnIndex:n}function Uoe(t,e){const n=this.ghostTable.getWidth(e);return t>n?t:n}function zoe(t,e,n){var r;const{label:i}=(r=Ve(st,this).getHeaderTreeNodeData(n,e))!==null&&r!==void 0?r:{label:""};return i}function Yoe(t,e){if(t<0)return this.hot.getCell(t,Ve(st,this).findLeftMostColumnIndex(t,e),!0)}function Goe(){this.updatePlugin()}function Koe(t,e){e||this.updatePlugin()}function _d(t,e,n){return(e=qoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qoe(t){var e=Xoe(t,"string");return typeof e=="symbol"?e:e+""}function Xoe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Zoe{constructor(e,n){_d(this,"hot",void 0),_d(this,"data",null),_d(this,"plugin",void 0),_d(this,"parentReference",new WeakMap),_d(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},de(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)?(de(e[0],e[2],d=>{const f=this.translateTrimmedRow(d);i.push(this.getDataObject(f))}),de(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),g=this.getRowIndex(f);this.hot.runHooks("beforeCreateRow",g+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=n;do r=this.getRowParent(r),r!==null&&(n=r);while(r!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(n),"__children",n.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,n,r,i){const o=n===this.hot.countRows(),s=this.getRowParent(e),a=this.getRowIndexWithinParent(e),l=s.__children.slice(a,a+1),u=e>n;let c=o?this.getRowParent(n-1):this.getRowParent(n);c==null&&(c=this.getRowParent(n-1)),c==null&&(c=this.getDataObject(n-1)),c?c.__children||(c.__children=[]):(c=this.getDataObject(n),c.__children=[]);const h=o||r||i?c.__children.length:this.getRowIndexWithinParent(n),d=s===c;c.__children.splice(h,0,l[0]),s.__children.splice(a+(u&&d?1:0),1),this.syncRowWithRawSource(s),d||this.syncRowWithRawSource(c)}translateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.translateTrimmedRow(e):e}untranslateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.untranslateTrimmedRow(e):e}}function OH(t,e,n){return(e=Qoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qoe(t){var e=Joe(t,"string");return typeof e=="symbol"?e:e+""}function Joe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class CT{constructor(e,n){OH(this,"hot",void 0),OH(this,"plugin",void 0),this.hot=n,this.plugin=e}}class bs extends CT{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)}),G(n,bs.CSS_CLASSES.indicatorContainer),i){const{rootDocument:c}=this.hot,h=a.cloneNode(!0);s.innerHTML="",de(0,i-1,()=>{const d=c.createElement("SPAN");G(d,bs.CSS_CLASSES.emptyIndicator),s.appendChild(d)}),s.appendChild(h)}if(this.dataManager.hasChildren(o)){const c=this.hot.rootDocument.createElement("DIV");u&&ye(c,[Wu()]),G(n,bs.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(r)?(G(c,`${bs.CSS_CLASSES.button} ${bs.CSS_CLASSES.expandButton}`),u&&ye(n,[ho(!1)])):(G(c,`${bs.CSS_CLASSES.button} ${bs.CSS_CLASSES.collapseButton}`),u&&ye(n,[ho(!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 ese extends CT{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)=>{de(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);ve(e.target,bs.CSS_CLASSES.button)&&(this.areChildrenCollapsed(r)?this.expandChildren(r):this.collapseChildren(r),Ko(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}function tse(t,e,n){nse(t,e),e.set(t,n)}function nse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rse(t,e,n){return(e=ise(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ise(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)}function sse(t,e){return t.get(ase(t,e))}function ase(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 xH=new WeakMap;class lse extends CT{constructor(){super(...arguments),rse(this,"dataManager",this.plugin.dataManager),tse(this,xH,{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(Zr)},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(Qr)},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 de(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 de(0,e.items.length-1,n=>{const r=sse(xH,this)[e.items[n].key];r!=null&&(e.items[n].callback=r)}),e}}function Pm(t,e,n){return(e=use(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function use(t){var e=cse(t,"string");return typeof e=="symbol"?e:e+""}function cse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class hse{constructor(e){Pm(this,"plugin",void 0),Pm(this,"hot",void 0),Pm(this,"dataManager",void 0),Pm(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(g=>{if(!l)return!1;const C=this.dataManager.translateTrimmedRow(g);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 It(i)&&(Ze(nt`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 dse(t,e){T$(t,e),e.add(t)}function AH(t,e,n){T$(t,e),e.set(t,n)}function T$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function GS(t,e,n){return(e=fse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fse(t){var e=gse(t,"string");return typeof e=="symbol"?e:e+""}function gse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function lp(t,e){return t.get(hn(t,e))}function nw(t,e,n){return t.set(hn(t,e),n),n}function hn(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 rw="nestedRows",mse=300,HH=rw,pse="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var rv=new WeakMap,_c=new WeakMap,pn=new WeakSet;class wse extends Xe{constructor(){super(...arguments),dse(this,pn),GS(this,"dataManager",null),GS(this,"headersUI",null),GS(this,"collapsedRowsMap",null),AH(this,rv,!1),AH(this,_c,!1)}static get PLUGIN_KEY(){return rw}static get PLUGIN_PRIORITY(){return mse}isEnabled(){return!!this.hot.getSettings()[rw]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new Yf),this.dataManager=new Zoe(this,this.hot),this.collapsingUI=new ese(this,this.hot),this.headersUI=new bs(this,this.hot),this.contextMenuUI=new lse(this,this.hot),this.rowMoveController=new hse(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return hn(pn,e,xse).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 hn(pn,e,Ase).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 hn(pn,e,yse).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 hn(pn,e,bse).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 hn(pn,e,Sse).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 hn(pn,e,Cse).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 hn(pn,e,Tse).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 hn(pn,e,Ese).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 hn(pn,e,_se).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 hn(pn,e,Mse).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 hn(pn,e,Ise).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 hn(pn,e,Pse).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 hn(pn,e,Rse).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 hn(pn,e,Ose).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 hn(pn,e,vse).call(e,...r)}),this.addHook("beforeLoadData",n=>hn(pn,this,NH).call(this,n)),this.addHook("beforeUpdateData",n=>hn(pn,this,NH).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:HH,relativeToGroup:Cl,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(HH)}disableCoreAPIModifiers(){nw(_c,this,!0)}enableCoreAPIModifiers(){nw(_c,this,!1)}onModifyRowData(e){if(!lp(_c,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!lp(_c,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,n,r){return lp(_c,this)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,n,r),!1)}destroy(){super.destroy()}}function vse(t,e,n,r){return this.rowMoveController.onBeforeRowMove(t,e,n,r)}function Cse(t,e,n){this.collapsingUI.toggleState(t,e,n)}function yse(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),nw(rv,this,!0),this.dataManager.getData().slice()}function bse(t){return this.contextMenuUI.appendOptions(t)}function Sse(t,e){this.headersUI.appendLevelIndicators(t,e)}function Rse(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function Ese(t,e,n,r){r!==this.pluginName&&this.hot._registerTimeout(()=>{nw(rv,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function Tse(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 _se(){this.collapsingUI.collapsedRowsStash.stash()}function Mse(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function Ise(){this.collapsingUI.collapsedRowsStash.stash()}function Pse(t,e,n){this.collapsingUI.collapsedRowsStash.shiftStash(n,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function Ose(){this.dataManager.rewriteCache()}function xse(){this.headersUI.updateRowHeaderWidth()}function Ase(t,e){lp(rv,this)&&(e.skipRender=!0)}function NH(t){if(!LK(t)){t0(pse),this.hot.getSettings()[rw]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function KS(t,e,n){return(e=Hse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hse(t){var e=Nse(t,"string");return typeof e=="symbol"?e:e+""}function Nse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Dse{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;KS(this,"rootWindow",void 0),KS(this,"prefix",void 0),KS(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 kse(t,e,n){return(e=Lse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lse(t){var e=$se(t,"string");return typeof e=="symbol"?e:e+""}function $se(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}re.getSingleton().register("persistentStateSave");re.getSingleton().register("persistentStateLoad");re.getSingleton().register("persistentStateReset");const DH="persistentState",Fse=0;class Vse extends Xe{constructor(){super(...arguments),kse(this,"storage",void 0)}static get PLUGIN_KEY(){return DH}static get PLUGIN_PRIORITY(){return Fse}isEnabled(){return!!this.hot.getSettings()[DH]}enablePlugin(){this.enabled||(this.storage||(this.storage=new Dse(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 Wse(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 qS(t,e,n){return(e=jse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jse(t){var e=Use(t,"string");return typeof e=="symbol"?e:e+""}function Use(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function kH(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 XS="search",zse=190,Yse="htSearchResult",Gse=function(t,e,n,r,i){t.getCellMeta(e,n).isSearchResult=i},Kse=function(t,e,n){return It(t)||t===null||!t.toLocaleLowerCase||t.length===0||It(e)||e===null?!1:e.toString().toLocaleLowerCase(n.locale).indexOf(t.toLocaleLowerCase(n.locale))!==-1};var ZS=new WeakSet;class qse extends Xe{constructor(){super(...arguments),Wse(this,ZS),qS(this,"callback",Gse),qS(this,"queryMethod",Kse),qS(this,"searchResultClass",Yse)}static get PLUGIN_KEY(){return XS}static get PLUGIN_PRIORITY(){return zse}isEnabled(){return this.hot.getSettings()[XS]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[XS];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 kH(ZS,e,LH).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 kH(ZS,e,LH).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 de(0,i-1,l=>{de(0,o-1,u=>{const c=this.hot.getDataAtCell(l,u),h=this.hot.getCellMeta(l,u),d=h.search.callback||n,g=(h.search.queryMethod||r)(e,c,h);if(g){const C={row:l,col:u,data:c};s.push(C)}d&&d(a,l,u,c,g)})}),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 LH(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 Om(t,e,n){return(e=Xse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xse(t){var e=Zse(t,"string");return typeof e=="symbol"?e:e+""}function Zse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 _${constructor(e){Om(this,"viewportWidth",void 0),Om(this,"overwriteColumnWidthFn",void 0),Om(this,"baseWidths",new Map),Om(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 Qse extends _${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),g=this.overwriteColumnWidthFn(f,d);f===g&&f>=eh?(i.push([d,g]),a+=g):f!==g&&(i.push([d,g]),o.push(d),s-=g)}),s<=eh){this.stretchedWidths.clear();return}const l=s/a;let u=-1,c=0;i.forEach((h,d)=>{let[f,g]=h,C=g;o.includes(f)||(C=Math.round(g*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 $H(t,e,n){Jse(t,e),e.set(t,n)}function Jse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function QS(t,e){return t.get(M$(t,e))}function xm(t,e,n){return t.set(M$(t,e),n),n}function M$(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 Am=new WeakMap,Md=new WeakMap;class eae extends _${constructor(){super(...arguments),$H(this,Am,0),$H(this,Md,-1)}prepare(e){super.prepare(e),xm(Am,this,0),xm(Md,this,-1)}setColumnBaseWidth(e,n){super.setColumnBaseWidth(e,n),xm(Md,this,e),xm(Am,this,n)}calculate(){if(QS(Md,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+QS(Am,this),0);this.stretchedWidths.set(QS(Md,this),n)}}function tae(t,e){I$(t,e),e.add(t)}function Hm(t,e,n){I$(t,e),e.set(t,n)}function I$(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(jc(t,e))}function JS(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")}const nae="stretchColumns";var On=new WeakMap,Mc=new WeakMap,eR=new WeakMap,Nm=new WeakMap,Id=new WeakSet;class rae{constructor(e){tae(this,Id),Hm(this,On,void 0),Hm(this,Mc,void 0),Hm(this,eR,new Map([["all",new Qse(jc(Id,this,FH).bind(this))],["last",new eae(jc(Id,this,FH).bind(this))]])),Hm(this,Nm,"none"),JS(On,this,e),JS(Mc,this,Vt(On,this).columnIndexMapper.createAndRegisterIndexMap(nae,"physicalIndexToValue"))}useStrategy(e){JS(Nm,this,Vt(eR,this).has(e)?e:"none")}refreshStretching(){if(Vt(Nm,this)==="none"){Vt(Mc,this).clear();return}Vt(On,this).batchExecution(()=>{Vt(Mc,this).clear();const e=Vt(eR,this).get(Vt(Nm,this));let r=Vt(On,this).view.getViewportWidth();jc(Id,this,iae).call(this)&&(r-=vn(Vt(On,this).rootDocument)),e.prepare({viewportWidth:r});for(let i=0;i<Vt(On,this).countCols();i++)Vt(On,this).columnIndexMapper.isHidden(Vt(On,this).toPhysicalColumn(i))||e.setColumnBaseWidth(i,jc(Id,this,oae).call(this,i));e.calculate(),e.getWidths().forEach(i=>{let[o,s]=i;Vt(Mc,this).setValueAtIndex(Vt(On,this).toPhysicalColumn(o),s)})},!0)}getStretchedWidth(e){return Vt(Mc,this).getValueAtIndex(Vt(On,this).toPhysicalColumn(e))}}function iae(){const{view:t}=Vt(On,this);if(t.isVerticallyScrollableByWindow())return!1;const e=t.getViewportHeight(),n=Vt(On,this).countRows(),r=t.getStylesHandler().getDefaultRowHeight();let i=0,o=!1;for(let a=0;a<n;a++){var s;if(i+=((s=Vt(On,this).getRowHeight(a))!==null&&s!==void 0?s:r)+(a===0?1:0),i>e){o=!0;break}}return o}function oae(t){var e;return(e=Vt(On,this).getColWidth(t,"StretchColumns"))!==null&&e!==void 0?e:eh}function FH(t,e){return Vt(On,this).runHooks("beforeStretchingColumnWidth",t,e)}function sae(t,e){P$(t,e),e.add(t)}function tR(t,e,n){P$(t,e),e.set(t,n)}function P$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nR(t,e,n){return t.set(iw(t,e),n),n}function Js(t,e){return t.get(iw(t,e))}function iw(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 aae="stretchColumns",lae=155;var Lc=new WeakMap,Dm=new WeakMap,Pd=new WeakMap,rR=new WeakSet;class uae extends Xe{constructor(){super(...arguments),sae(this,rR),tR(this,Lc,new rae(this.hot)),tR(this,Dm,null),tR(this,Pd,new ResizeObserver(e=>{requestAnimationFrame(()=>{var n;(n=this.hot)!==null&&n!==void 0&&n.view.isHorizontallyScrollableByWindow()&&e.forEach(r=>{let{contentRect:i}=r;Js(Dm,this)!==null&&Js(Dm,this)!==i.width&&(this.hot.refreshDimensions(),this.hot.view.adjustElementsSize()),nR(Dm,this,i.width)})})}))}static get PLUGIN_KEY(){return aae}static get PLUGIN_PRIORITY(){return lae}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(Js(Lc,this).useStrategy(this.hot.getSettings().stretchH),Js(Pd,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 iw(rR,e,hae).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 iw(rR,e,cae).call(e,...r)},10),super.enablePlugin())}updatePlugin(){Js(Lc,this).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),Js(Pd,this).unobserve(this.hot.rootElement)}getColumnWidth(e){return Js(Lc,this).getStretchedWidth(e)}destroy(){Js(Pd,this).disconnect(),nR(Pd,this,null),nR(Lc,this,null),super.destroy()}}function cae(t,e,n){if(n===this.pluginName)return;const r=this.getColumnWidth(e);return typeof r=="number"?r:t}function hae(t){t&&Js(Lc,this).refreshStretching()}function dae(t,e){fae(t,e),e.add(t)}function fae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function km(t,e,n){return(e=gae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gae(t){var e=mae(t,"string");return typeof e=="symbol"?e:e+""}function mae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 iR(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 pae="touchScroll",wae=200;var Lm=new WeakSet;class vae extends Xe{constructor(){super(...arguments),dae(this,Lm),km(this,"scrollbars",[]),km(this,"clones",[]),km(this,"lockedCollection",!1),km(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return pae}static get PLUGIN_PRIORITY(){return wae}static get SETTING_KEYS(){return!0}isEnabled(){return jN()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>iR(Lm,this,Cae).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>iR(Lm,this,yae).call(this)),this.addHook("afterMomentumScroll",()=>iR(Lm,this,bae).call(this))}}function Cae(){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 yae(){this.freezeOverlays=!0,M(this.clones,t=>{G(t,"hide-tween")})}function bae(){this.freezeOverlays=!1,M(this.clones,t=>{pe(t,"hide-tween"),G(t,"show-tween")}),this.hot._registerTimeout(()=>{M(this.clones,t=>{pe(t,"show-tween")})},400),M(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function Sae(t,e){Rae(t,e),e.add(t)}function Rae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Eae(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)}function Mae(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 up="trimRows",Iae=330;var VH=new WeakSet;class Pae extends Xe{constructor(){super(...arguments),Sae(this,VH),Eae(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return up}static get PLUGIN_PRIORITY(){return Iae}isEnabled(){return!!this.hot.getSettings()[up]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new Yf),this.trimmedRowsMap.addLocalHook("init",()=>Mae(VH,this,Oae).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[up];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=wr(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 Oae(){const t=this.hot.getSettings()[up];Array.isArray(t)&&this.hot.batchExecution(()=>{M(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}function xae(t,e,n){return(e=Aae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Aae(t){var e=Hae(t,"string");return typeof e=="symbol"?e:e+""}function Hae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Co{constructor(e){xae(this,"actionType",""),this.actionType=e}undo(){throw new Error("Not implemented")}redo(){throw new Error("Not implemented")}}function $m(t,e,n){return(e=Nae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nae(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 yT extends Co{constructor(e){let{stateBefore:n,range:r,type:i,alignment:o}=e;super("cell_alignment"),$m(this,"stateBefore",void 0),$m(this,"range",void 0),$m(this,"type",void 0),$m(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 yT({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){Ya(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 WH(t,e,n){return(e=kae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kae(t){var e=Lae(t,"string");return typeof e=="symbol"?e:e+""}function Lae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 bT extends Co{constructor(e){let{columns:n,finalIndex:r}=e;super("col_move"),WH(this,"columns",void 0),WH(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 bT({columns:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),mT(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 BH(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 ST extends Co{constructor(e){let{currentSortState:n,newSortState:r}=e;super("col_sort"),BH(this,"previousSortState",void 0),BH(this,"nextSortState",void 0),this.previousSortState=n,this.nextSortState=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnSort",(r,i,o)=>{o&&n.done(()=>new ST({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 jH(t,e,n){return(e=Vae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vae(t){var e=Wae(t,"string");return typeof e=="symbol"?e:e+""}function Wae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class RT extends Co{constructor(e){let{index:n,amount:r}=e;super("insert_col"),jH(this,"index",void 0),jH(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateCol",(r,i,o)=>{n.done(()=>new RT({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 UH(t,e,n){return(e=Bae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bae(t){var e=jae(t,"string");return typeof e=="symbol"?e:e+""}function jae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ET extends Co{constructor(e){let{index:n,amount:r}=e;super("insert_row"),UH(this,"index",void 0),UH(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateRow",(r,i,o)=>{n.done(()=>new ET({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 Fm(t,e,n){return(e=Uae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Uae(t){var e=zae(t,"string");return typeof e=="symbol"?e:e+""}function zae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class TT extends Co{constructor(e){let{changes:n,selected:r,countCols:i,countRows:o}=e;super("change"),Fm(this,"changes",void 0),Fm(this,"selected",void 0),Fm(this,"countCols",void 0),Fm(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 TT({changes:l,selected:u,countCols:e.countCols(),countRows:e.countRows()})};n.done(a,i)})}undo(e,n){const r=Gn(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=Gn(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 zH(t,e,n){return(e=Yae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yae(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 _T extends Co{constructor(e){let{conditionsStack:n,previousConditionsStack:r}=e;super("filter"),zH(this,"conditionsStack",void 0),zH(this,"previousConditionsStack",void 0),this.conditionsStack=n,this.previousConditionsStack=r}static startRegisteringEvents(e,n){e.addHook("beforeFilter",(r,i)=>{n.done(()=>new _T({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 Kae(t,e,n){return(e=qae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qae(t){var e=Xae(t,"string");return typeof e=="symbol"?e:e+""}function Xae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class MT extends Co{constructor(e){let{data:n,cellRange:r}=e;super("merge_cells"),Kae(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 MT({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)}}function O$(t,e,n,r,i){const o=["visualRow","visualCol","row","col","prop"],s=o.length,a=[];return de(r,i,l=>{de(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 qs(t,e,n){return(e=Zae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zae(t){var e=Qae(t,"string");return typeof e=="symbol"?e:e+""}function Qae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class IT extends Co{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"),qs(this,"index",void 0),qs(this,"indexes",void 0),qs(this,"data",void 0),qs(this,"amount",void 0),qs(this,"headers",void 0),qs(this,"columnPositions",void 0),qs(this,"rowPositions",void 0),qs(this,"fixedColumnsStart",void 0),qs(this,"removedCellMetas",void 0),this.index=n,this.indexes=r,this.data=i,this.amount=o,this.headers=s,this.columnPositions=a.slice(0),this.rowPositions=l.slice(0),this.fixedColumnsStart=u,this.removedCellMetas=c}static startRegisteringEvents(e,n){e.addHook("beforeRemoveCol",(r,i,o,s)=>{const a=()=>{const l=e.getSourceDataArray(),u=(e.countCols()+r)%e.countCols(),c=u+i-1,h=[],d=[],f=[];return de(l.length-1,g=>{const C=[],y=l[g];de(u,c,E=>{C.push(y[e.toPhysicalColumn(E)])}),h.push(C)}),de(i-1,g=>{f.push(e.toPhysicalColumn(u+g))}),Array.isArray(e.getSettings().colHeaders)&&de(i-1,g=>{d.push(e.getSettings().colHeaders[e.toPhysicalColumn(u+g)]||null)}),new IT({index:u,indexes:f,data:h,amount:i,headers:d,columnPositions:e.columnIndexMapper.getIndexesSequence(),rowPositions:e.rowIndexMapper.getIndexesSequence(),fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:O$(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(Be(this.data[c],o));const l=Be(this.headers,o),u=[];e.columnIndexMapper.setIndexesSequence(this.columnPositions),e.alter("insert_col_start",e.toVisualColumn(this.indexes[0]),this.indexes.length,"UndoRedo.undo"),e.batchExecution(()=>{e.rowIndexMapper.setIndexesSequence(this.rowPositions),e.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),M(e.getSourceDataArray(),(c,h)=>{M(i,(d,f)=>{c[d]=a[h][f],u.push([h,d,c[d]])})}),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.addHookOnce("afterViewRender",n),e.setSourceDataAtCell(u,null,null,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterRemoveCol",n),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}}function Ic(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=ele(t,"string");return typeof e=="symbol"?e:e+""}function ele(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 Co{constructor(e){let{index:n,data:r,fixedRowsBottom:i,fixedRowsTop:o,rowIndexesSequence:s,removedCellMetas:a}=e;super("remove_row"),Ic(this,"index",void 0),Ic(this,"data",void 0),Ic(this,"fixedRowsBottom",void 0),Ic(this,"fixedRowsTop",void 0),Ic(this,"rowIndexesSequence",void 0),Ic(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=Gn(e.getSourceData(l,0,l+i-1,e.countSourceCols()-1));return new PT({index:l,data:c,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:O$(e,l,u,0,e.countCols()-1)})};n.done(a,s)})}undo(e,n){const r=e.getSettings(),i=[];r.fixedRowsBottom=this.fixedRowsBottom,r.fixedRowsTop=this.fixedRowsTop,this.data.forEach((o,s)=>{Object.keys(o).forEach(a=>{const l=parseInt(a,10);i.push([this.index+s,isNaN(l)?a:l,o[a]])})}),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),e.alter("insert_row_above",e.toVisualRow(this.index),this.data.length,"UndoRedo.undo"),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),this.removedCellMetas.forEach(o=>{let[s,a,l]=o;e.setCellMetaObject(s,a,l)}),e.addHookOnce("afterViewRender",n),e.setSourceDataAtCell(i,null,null,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterRemoveRow",n),e.alter("remove_row",e.toVisualRow(this.index),this.data.length,"UndoRedo.redo")}}function YH(t,e,n){return(e=tle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tle(t){var e=nle(t,"string");return typeof e=="symbol"?e:e+""}function nle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 OT extends Co{constructor(e){let{rows:n,finalIndex:r}=e;super("row_move"),YH(this,"rows",void 0),YH(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 OT({rows:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),mT(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 rle(t,e,n){return(e=ile(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ile(t){var e=ole(t,"string");return typeof e=="symbol"?e:e+""}function ole(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 xT extends Co{constructor(e){let{cellRange:n}=e;super("unmerge_cells"),rle(this,"cellRange",void 0),this.cellRange=n}static startRegisteringEvents(e,n){e.addHook("afterUnmergeCells",(r,i)=>{i||n.done(()=>new xT({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 sle(t,e){[yT,bT,ST,RT,ET,TT,_T,MT,IT,PT,OT,xT].forEach(n=>n.startRegisteringEvents(t,e))}function ale(t,e){lle(t,e),e.add(t)}function lle(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oR(t,e,n){return(e=ule(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ule(t){var e=cle(t,"string");return typeof e=="symbol"?e:e+""}function cle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.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 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 GH="undoRedo",hle="undoRedo",dle=1e3;re.getSingleton().register("beforeUndo");re.getSingleton().register("afterUndo");re.getSingleton().register("beforeRedo");re.getSingleton().register("afterRedo");const KH=new Set;var Vm=new WeakSet;class fle extends Xe{static get PLUGIN_KEY(){return hle}static get PLUGIN_PRIORITY(){return dle}static get SETTING_KEYS(){return!0}constructor(e){super(e),ale(this,Vm),oR(this,"doneActions",[]),oR(this,"undoneActions",[]),oR(this,"ignoreNewActions",!1),sle(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 sR(Vm,e,gle).call(e,...r)}),this.registerShortcuts(),sR(Vm,this,mle).call(this),super.enablePlugin())}disablePlugin(){super.disablePlugin(),this.clear(),this.unregisterShortcuts(),sR(Vm,this,ple).call(this)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("grid"),i={runOnlyIf:o=>!o.altKey,group:GH};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(GH)}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=Gn(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=Gn(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 gle(t,e){e==="loadData"&&this.clear()}function mle(){const t=e=>{KH.has(e)||(Ze(nt`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}()\`).`),KH.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 ple(){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 wle(){ze(Ud),ze(x8),ze(zd),ze(lZ),ze(pZ),ze(Qk),ze(h7),ze(q7),ze(Xw),ze(iQ),ze(OQ),ze($Q),ze(Jw),ze(yJ),ze(mte),ze(Kte),ze(bne),ze(Hne),ze(zne),ze(nre),ze(dre),ze(Ore),ze(Fre),ze(Sie),ze(eoe),ze(ooe),ze(xoe),ze(wse),ze(Vse),ze(qse),ze(uae),ze(vae),ze(Pae),ze(fle)}function vle(){t9(),E6(),H6(),J6(),wle()}/**
282
+ * @preserve
283
+ * Authors: Stefan Salzl
284
+ * Last updated: Jan 08, 2018
285
+ *
286
+ * Description: Definition file for German - Germany language-country.
287
+ */const Cle={languageCode:"de-DE",[vr]:"Zeile einfügen oberhalb",[Cr]:"Zeile einfügen unterhalb",[yr]:"Spalte einfügen links",[br]:"Spalte einfügen rechts",[Sr]:["Zeile löschen","Zeilen löschen"],[Rr]:["Spalte löschen","Spalten löschen"],[Er]:"Rückgangig",[Tr]:"Wiederholen",[Kn]:"Nur Lesezugriff",[_r]:"Spalteninhalt löschen",[Lr]:"Ausrichtung",[$r]:"Linksbündig",[Fr]:"Zentriert",[Vr]:"Rechtsbündig",[Wr]:"Blocksatz",[Br]:"Oben",[jr]:"Mitte",[Ur]:"Unten",[Pr]:"Spalte fixieren",[Or]:"Spaltenfixierung aufheben",[zr]:"Rahmen",[Yr]:"Oben",[Gr]:"Rechts",[Kr]:"Unten",[qr]:"Links",[Xr]:"Kein Rahmen",[Hr]:"Kommentar hinzufügen",[Nr]:"Kommentar bearbeiten",[Dr]:"Kommentar löschen",[kr]:"Schreibschutz Kommentar",[xr]:"Zellen verbinden",[Ar]:"Zellen teilen",[Mr]:"Kopieren",[Ir]:"Ausschneiden",[Zr]:"Nachfolgerzeile einfügen",[Qr]:"Von Vorgängerzeile abkoppeln",[Jr]:["Spalte ausblenden","Spalten ausblenden"],[ei]:["Spalte einblenden","Spalten einblenden"],[ti]:["Zeile ausblenden","Zeilen ausblenden"],[ni]:["Zeile einblenden","Zeilen einblenden"],[Zn]:"Kein Filter",[ri]:"Ist leer",[ii]:"Ist nicht leer",[oi]:"Ist gleich",[si]:"Ist ungleich",[ai]:"Beginnt mit",[li]:"Endet mit",[ui]:"Enthält",[ci]:"Enthält nicht",[hi]:"Größer als",[di]:"Größer gleich",[fi]:"Kleiner als",[gi]:"Kleiner gleich",[mi]:"Zwischen",[pi]:"Außerhalb",[wi]:"Nach",[vi]:"Vor",[Ci]:"Heute",[yi]:"Morgen",[bi]:"Gestern",[qn]:"Leere Zellen",[Si]:"Per Bedingung filtern",[Ri]:"Nach Zahlen filtern",[Ei]:"Und",[Qn]:"Oder",[Ti]:"Alles auswählen",[_i]:"Auswahl aufheben",[Mi]:"OK",[Ii]:"Abbrechen",[Pi]:"Suchen",[Oi]:"Wert",[xi]:"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 yle={languageCode:"es-MX",[vr]:"Insertar fila arriba",[Cr]:"Insertar fila abajo",[yr]:"Insertar columna izquierda",[br]:"Insertar columna derecha",[Sr]:["Eliminar fila","Eliminar filas"],[Rr]:["Eliminar columna","Eliminar columnas"],[Er]:"Deshacer",[Tr]:"Rehacer",[Kn]:"Solo lectura",[_r]:"Limpiar columna",[Lr]:"Alineación",[$r]:"Izquierda",[Fr]:"Centro",[Vr]:"Derecha",[Wr]:"Justificar",[Br]:"Superior",[jr]:"Medio",[Ur]:"Inferior",[Pr]:"Congelar columna",[Or]:"Descongelar columna",[zr]:"Bordes",[Yr]:"Superior",[Gr]:"Derecho",[Kr]:"Inferior",[qr]:"Izquierdo",[Xr]:"Quitar borde(s)",[Hr]:"Agregar comentario",[Nr]:"Editar comentario",[Dr]:"Borrar comentario",[kr]:"Comentario Solo de lectura",[xr]:"Unir celdas",[Ar]:"Separar celdas",[Mr]:"Copiar",[Ta]:["Copiar con encabezado","Copiar con encabezados"],[_a]:["Copiar con encabezado de grupo","Copiar con encabezados de grupos"],[Ma]:["Copiar solo el encabezado","Copiar solo los encabezados"],[Ir]:"Cortar",[Zr]:"Insertar fila hija",[Qr]:"Separar del padre",[Jr]:["Esconder columna","Esconder columnas"],[ei]:["Mostrar columna","Mostrar columnas"],[ti]:["Esconder fila","Esconder filas"],[ni]:["Mostrar fila","Mostrar filas"],[Zn]:"Ninguna",[ri]:"Está vacío",[ii]:"No está vacío",[oi]:"Es igual a",[si]:"No es igual a",[ai]:"Comienza con",[li]:"Termina con",[ui]:"Contiene",[ci]:"No contiene",[hi]:"Mayor que",[di]:"Mayor o igual que",[fi]:"Menor que",[gi]:"Menor o igual que",[mi]:"Es entre",[pi]:"No es entre",[wi]:"Después",[vi]:"Antes",[Ci]:"Hoy",[yi]:"Mañana",[bi]:"Ayer",[qn]:"Celdas vacías",[Si]:"Filtrar por condición",[Ri]:"Filtrar por valor",[Ei]:"Y",[Qn]:"O",[Ti]:"Seleccionar todo",[_i]:"Borrar",[Mi]:"OK",[Ii]:"Cancelar",[Pi]:"Buscar",[Oi]:"Valor",[xi]:"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 ble={languageCode:"fr-FR",[vr]:"Insérer une ligne en haut",[Cr]:"Insérer une ligne en bas",[yr]:"Insérer une colonne à gauche",[br]:"Insérer une colonne à droite",[Sr]:["Supprimer une ligne","Supprimer les lignes"],[Rr]:["Supprimer une colonne","Supprimer les colonnes"],[Er]:"Annuler",[Tr]:"Rétablir",[Kn]:"Lecture seule",[_r]:"Effacer la colonne",[Lr]:"Alignement",[$r]:"Gauche",[Fr]:"Centre",[Vr]:"Droite",[Wr]:"Justifié",[Br]:"En haut",[jr]:"Au milieu",[Ur]:"En bas",[Pr]:"Figer la colonne",[Or]:"Libérer la colonne",[zr]:"Bordures",[Yr]:"Supérieure",[Gr]:"Droite",[Kr]:"Inférieure",[qr]:"Gauche",[Xr]:"Pas de bordure",[Hr]:"Ajouter commentaire",[Nr]:"Modifier commentaire",[Dr]:"Supprimer commentaire",[kr]:"Commentaire en lecture seule",[xr]:"Fusionner les cellules",[Ar]:"Séparer les cellules",[Mr]:"Copier",[Ir]:"Couper",[Zr]:"Insérer une sous-ligne",[Qr]:"Détacher de la ligne précédente",[Jr]:["Masquer colonne","Masquer les colonnes"],[ei]:["Afficher colonne","Afficher les colonnes"],[ti]:["Masquer ligne","Masquer les lignes"],[ni]:["Afficher ligne","Afficher les lignes"],[Zn]:"Aucun",[ri]:"Est vide",[ii]:"N'est pas vide",[oi]:"Egal à",[si]:"Est différent de",[ai]:"Commence par",[li]:"Finit par",[ui]:"Contient",[ci]:"Ne contient pas",[hi]:"Supérieur à",[di]:"Supérieur ou égal à",[fi]:"Inférieur à",[gi]:"Inférieur ou égal à",[mi]:"Est compris entre",[pi]:"N'est pas compris entre",[wi]:"Après le",[vi]:"Avant le",[Ci]:"Aujourd'hui",[yi]:"Demain",[bi]:"Hier",[qn]:"Cellules vides",[Si]:"Filtrer par conditions",[Ri]:"Filtrer par valeurs",[Ei]:"Et",[Qn]:"Ou",[Ti]:"Tout sélectionner",[_i]:"Effacer la sélection",[Mi]:"OK",[Ii]:"Annuler",[Pi]:"Chercher",[Oi]:"Valeur",[xi]:"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 Sle={languageCode:"it-IT",[vr]:"Inserisci riga sopra",[Cr]:"Inserisci riga sotto",[yr]:"Inserisci colonna a sinistra",[br]:"Inserisci colonna a destra",[Sr]:["Rimuovi riga","Rimuovi righe"],[Rr]:["Rimuovi colonna","Rimuovi colonne"],[Er]:"Annulla",[Tr]:"Ripeti",[Kn]:"Sola lettura",[_r]:"Svuota colonna",[Lr]:"Allineamento",[$r]:"Sinistra",[Fr]:"Centro",[Vr]:"Destra",[Wr]:"Giustificato",[Br]:"In alto",[jr]:"A metà",[Ur]:"In basso",[Pr]:"Blocca colonna",[Or]:"Sblocca colonna",[zr]:"Bordi",[Yr]:"Sopra",[Gr]:"Destra",[Kr]:"Sotto",[qr]:"Sinistra",[Xr]:"Rimuovi bordo(i)",[Hr]:"Aggiungi commento",[Nr]:"Modifica commento",[Dr]:"Rimuovi commento",[kr]:"Commento in sola lettura",[xr]:"Unisci celle",[Ar]:"Separa celle",[Mr]:"Copia",[Ta]:["Copia con intestazione","Copia con intestazioni"],[_a]:"Copia con intestazione completa",[Ma]:["Copia solo intestazione","Copia solo intestazioni"],[Ir]:"Taglia",[Zr]:"Inserisci riga figlia",[Qr]:"Scollega da riga madre",[Jr]:["Nascondi colonna","Nascondi colonne"],[ei]:["Mostra colonna","Mostra colonne"],[ti]:["Nascondi riga","Nascondi righe"],[ni]:["Mostra riga","Mostra righe"],[Zn]:"Nessuna",[ri]:"È vuoto",[ii]:"Non è vuoto",[oi]:"È uguale a",[si]:"È diverso da",[ai]:"Inizia con",[li]:"Termina con",[ui]:"Contiene",[ci]:"Non contiene",[hi]:"Maggiore",[di]:"Maggiore o uguale",[fi]:"Minore",[gi]:"Minore o uguale",[mi]:"È compreso tra",[pi]:"Non è compreso tra",[wi]:"Dopo",[vi]:"Prima",[Ci]:"Oggi",[yi]:"Domani",[bi]:"Ieri",[qn]:"Celle vuote",[Si]:"Filtra per condizione",[Ri]:"Filtra per valore",[Ei]:"E",[Qn]:"O",[Ti]:"Seleziona tutto",[_i]:"Pulisci",[Mi]:"OK",[Ii]:"Annulla",[Pi]:"Cerca",[Oi]:"Valore",[xi]:"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",[vr]:"行を上に挿入",[Cr]:"行を下に挿入",[yr]:"列を左に挿入",[br]:"列を右に挿入",[Sr]:["行を削除","行を削除"],[Rr]:["列を削除","列を削除"],[Er]:"元に戻す",[Tr]:"やり直し",[Kn]:"読み取り専用",[_r]:"列をクリア",[Lr]:"配置",[$r]:"左揃え",[Fr]:"中央揃え",[Vr]:"右揃え",[Wr]:"両端揃え",[Br]:"上揃え",[jr]:"中央揃え(垂直)",[Ur]:"下揃え",[Pr]:"列を固定",[Or]:"列の固定を解除",[zr]:"枠線",[Yr]:"上",[Gr]:"右",[Kr]:"下",[qr]:"左",[Xr]:"枠線を削除",[Hr]:"コメントを追加",[Nr]:"コメントを編集",[Dr]:"コメントを削除",[kr]:"読み取り専用コメント",[xr]:"セルを結合",[Ar]:"セルの結合を解除",[Mr]:"コピー",[Ta]:["ヘッダ付きでコピー","ヘッダ付きでコピー"],[_a]:["グループヘッダ付きでコピー","グループヘッダ付きでコピー"],[Ma]:["ヘッダのみコピー","ヘッダのみコピー"],[Ir]:"切り取り",[Zr]:"子の行を挿入",[Qr]:"親の行と切り離す",[Jr]:["列を非表示","列を非表示"],[ei]:["列を表示","列を表示"],[ti]:["行を非表示","行を非表示"],[ni]:["行を表示","行を表示"],[Zn]:"なし",[ri]:"空白",[ii]:"空白ではない",[oi]:"次と等しい",[si]:"次と等しくない",[ai]:"次で始まる",[li]:"次で終わる",[ui]:"次を含む",[ci]:"次を含まない",[hi]:"次より大きい",[di]:"以上",[fi]:"次より小さい",[gi]:"以下",[mi]:"次の間にある",[pi]:"次の間にない",[wi]:"次より後の日付",[vi]:"次より前の日付",[Ci]:"今日",[yi]:"明日",[bi]:"昨日",[qn]:"空白のセル",[Si]:"条件でフィルタ",[Ri]:"値でフィルタ",[Ei]:"かつ",[Qn]:"もしくは",[Ti]:"すべて選択",[_i]:"クリア",[Mi]:"OK",[Ii]:"キャンセル",[Pi]:"検索",[Oi]:"値",[xi]:"値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 Ele={languageCode:"ko-KR",[vr]:"위쪽에 행 삽입",[Cr]:"아래쪽에 행 삽입",[yr]:"왼쪽에 열 삽입",[br]:"오른쪽에 열 삽입",[Sr]:["행 삭제","여러 행 삭제"],[Rr]:["열 삭제","여러 열 삭제"],[Er]:"되돌리기",[Tr]:"다시하기",[Kn]:"읽기 전용",[_r]:"열 지우기",[Lr]:"정렬",[$r]:"왼쪽",[Fr]:"중앙",[Vr]:"오른쪽",[Wr]:"자동",[Br]:"위쪽",[jr]:"가운데",[Ur]:"아래쪽",[Pr]:"열 고정",[Or]:"열 고정 해제",[zr]:"테두리",[Yr]:"위쪽",[Gr]:"오른쪽",[Kr]:"아래쪽",[qr]:"왼쪽",[Xr]:"테두리 지우기",[Hr]:"댓글 달기",[Nr]:"댓글 편집",[Dr]:"댓글 삭제",[kr]:"읽기 전용 댓글",[xr]:"셀 병합",[Ar]:"셀 병합 해제",[Mr]:"복사",[Ir]:"잘라내기",[Zr]:"자녀 행 추가",[Qr]:"부모행에서 제거",[Jr]:["열 숨기기","여러 열 숨기기"],[ei]:["열 숨기기 해제","여러 열 숨기기 해제"],[ti]:["행 숨기기","여러 행 숨기기"],[ni]:["행 숨기기 해제","여러 행 숨기기 해제"],[Zn]:"조건없음",[ri]:"비어있음",[ii]:"비어있지 않음",[oi]:"같",[si]:"같지 않음",[ai]:"시작 문자",[li]:"끝 문자",[ui]:"포함",[ci]:"포함하지 않음",[hi]:"보다 큼",[di]:"크거나 같음",[fi]:"보다 작",[gi]:"작거나 같음",[mi]:"사이",[pi]:"사이 제외",[wi]:"다음",[vi]:"전",[Ci]:"오늘",[yi]:"내일",[bi]:"어제",[qn]:"공란",[Si]:"조건부 필터",[Ri]:"값 필터",[Ei]:"그리고",[Qn]:"또는",[Ti]:"전체선택",[_i]:"지우기",[Mi]:"확인",[Ii]:"취소",[Pi]:"찾기",[Oi]:"값",[xi]:"두번째 값"};/**
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 Tle={languageCode:"nl-NL",[vr]:"Rij boven invoegen",[Cr]:"Rij onder invoegen",[yr]:"Kolom links invoegen",[br]:"Kolom rechts invoegen",[Sr]:["Rij verwijderen","Rijen verwijderen"],[Rr]:["Kolom verwijderen","Kolommen verwijderen"],[Er]:"Ongedaan maken",[Tr]:"Opnieuw uitvoeren",[Kn]:"Alleen lezen",[_r]:"Kolom leegmaken",[Lr]:"Uitlijning",[$r]:"Links",[Fr]:"Gecentreerd",[Vr]:"Rechts",[Wr]:"Uitvullen",[Br]:"Boven",[jr]:"Midden",[Ur]:"Onder",[Pr]:"Kolom blokkeren",[Or]:"Kolom blokkering opheffen",[zr]:"Randen",[Yr]:"Boven",[Gr]:"Rechts",[Kr]:"Onder",[qr]:"Links",[Xr]:"Rand(en) verwijderen",[Hr]:"Opmerking toevoegen",[Nr]:"Opmerking bewerken",[Dr]:"Opmerking verwijderen",[kr]:"Opmerking Alleen-lezen",[xr]:"Cellen samenvoegen",[Ar]:"Samenvoeging van cellen opheffen",[Mr]:"Kopiëren",[Ta]:["Kopiëren met koptekst","Kopiëren met kopteksten"],[_a]:["Kopiëren met groepskoptekst","Kopiëren met groepskopteksten"],[Ma]:["Kopiëren koptekst","Kopiëren kopteksten"],[Ir]:"Knippen",[Zr]:"Geneste rij invoegen",[Qr]:"Geneste rij ontkoppelen",[Jr]:["Kolom verbergen","Kolommen verbergen"],[ei]:["Kolom zichbaar maken","Kolommen zichtbaar maken"],[ti]:["Rij verbergen","Rijen verbergen"],[ni]:["Rij zichtbaar maken","Rijen zichtbaar maken"],[Zn]:"Geen",[ri]:"Is leeg",[ii]:"Is niet leeg",[oi]:"Is gelijk aan",[si]:"Is niet gelijk aan",[ai]:"Begint met",[li]:"Eindigt op",[ui]:"Bevat",[ci]:"Bevat niet",[hi]:"Is groter",[di]:"Is groter of gelijk aan",[fi]:"Is kleiner dan",[gi]:"Is kleiner dan of gelijk aan",[mi]:"Is tussen",[pi]:"Ligt niet tussen",[wi]:"Na",[vi]:"Voor",[Ci]:"Vandaag",[yi]:"Morgen",[bi]:"Gisteren",[qn]:"Cellen leegmaken",[Si]:"Filteren op conditie",[Ri]:"Filteren op waarde",[Ei]:"En",[Qn]:"Of",[Ti]:"Alles selecteren",[_i]:"Leeg maken",[Mi]:"OK",[Ii]:"Annuleren",[Pi]:"Zoeken",[Oi]:"Waarde",[xi]:"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 _le={languageCode:"pl-PL",[Aw]:"Brak dostępnych opcji",[vr]:"Wstaw wiersz powyżej",[Cr]:"Wstaw wiersz poniżej",[yr]:"Wstaw kolumnę z lewej",[br]:"Wstaw kolumnę z prawej",[Sr]:["Usuń wiersz","Usuń wiersze"],[Rr]:["Usuń kolumnę","Usuń kolumny"],[Er]:"Cofnij",[Tr]:"Ponów",[Kn]:"Tylko do odczytu",[_r]:"Wyczyść kolumnę",[Lr]:"Wyrównanie",[$r]:"Do lewej",[Fr]:"Do środka",[Vr]:"Do prawej",[Wr]:"Wyjustuj",[Br]:"Do góry",[jr]:"Wyśrodkuj",[Ur]:"Do dołu",[Pr]:"Zablokuj kolumnę",[Or]:"Odblokuj kolumnę",[zr]:"Obramowanie",[Yr]:"Krawędź górna",[Gr]:"Krawędź prawa",[Kr]:"Krawędź dolna",[qr]:"Krawędź lewa",[Xr]:"Usuń obramowanie(a)",[Hr]:"Dodaj komentarz",[Nr]:"Edytuj komentarz",[Dr]:"Usuń komentarz",[kr]:"Komentarz tylko do odczytu",[xr]:"Scal komórki",[Ar]:"Rozdziel komórki",[Mr]:"Kopiuj",[Ta]:["Kopiuj z nagłówkiem","Kopiuj z nagłówkami"],[_a]:["Kopiuj z nagłówkiem grupowym","Kopiuj z nagłówkami grupowymi"],[Ma]:["Kopiuj sam nagłówek","Kopiuj same nagłówki"],[Ir]:"Wytnij",[Zr]:"Wstaw wiersz podrzędny",[Qr]:"Odłącz od nadrzędnego",[Jr]:["Ukryj kolumnę","Ukryj kolumny"],[ei]:["Pokaż kolumnę","Pokaż kolumny"],[ti]:["Ukryj wiersz","Ukryj wiersze"],[ni]:["Pokaż wiersz","Pokaż wiersze"],[Zn]:"Brak",[ri]:"Komórka jest pusta",[ii]:"Komórka nie jest pusta",[oi]:"Jest równe",[si]:"Jest różne od",[ai]:"Tekst zaczyna się od",[li]:"Tekst kończy się na",[ui]:"Tekst zawiera fragment",[ci]:"Tekst nie zawiera fragmentu",[hi]:"Większe niż",[di]:"Większe lub równe",[fi]:"Mniejsze niż",[gi]:"Mniejsze lub równe",[mi]:"Jest pomiędzy",[pi]:"Nie jest pomiędzy",[wi]:"Data późniejsza niż",[vi]:"Data wcześniejsza niż",[Ci]:"Dzisiaj",[yi]:"Jutro",[bi]:"Wczoraj",[qn]:"Puste miejsca",[Si]:"Filtruj wg warunku",[Ri]:"Filtruj wg wartości",[Ei]:"Oraz",[Qn]:"Lub",[Ti]:"Zaznacz wszystko",[_i]:"Wyczyść",[Mi]:"OK",[Ii]:"Anuluj",[Pi]:"Szukaj",[Oi]:"Wartość",[xi]:"Druga wartość",[Hw]:"Zaznaczony",[Nw]:"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 Mle={languageCode:"pt-BR",[vr]:"Inserir linha acima",[Cr]:"Inserir linha abaixo",[yr]:"Inserir coluna esquerda",[br]:"Inserir coluna direita",[Sr]:["Excluir linha","Excluir linhas"],[Rr]:["Excluir coluna","Excluir colunas"],[Er]:"Desfazer",[Tr]:"Refazer",[Kn]:"Somente leitura",[_r]:"Limpar coluna",[Lr]:"Alinhamento",[$r]:"Esquerda",[Fr]:"Centralizado",[Vr]:"Direita",[Wr]:"Justificado",[Br]:"Superior",[jr]:"Meio",[Ur]:"Inferior",[Pr]:"Congelar coluna",[Or]:"Descongelar coluna",[zr]:"Bordas",[Yr]:"Superior",[Gr]:"Direita",[Kr]:"Inferior",[qr]:"Esquerda",[Xr]:"Excluir bordas(s)",[Hr]:"Incluir comentário",[Nr]:"Editar comentário",[Dr]:"Remover comentário",[kr]:"Comentário somente leitura",[xr]:"Mesclar células",[Ar]:"Desfazer mesclagem de células",[Mr]:"Copiar",[Ir]:"Recortar",[Zr]:"Inserir linha filha",[Qr]:"Desanexar da linha pai",[Jr]:["Ocultar coluna","Ocultar colunas"],[ei]:["Exibir coluna","Exibir colunas"],[ti]:["Ocultar linha","Ocultar linhas"],[ni]:["Exibir linha","Exibir linhas"],[Zn]:"Nenhum",[ri]:"É vazio",[ii]:"Não é vazio",[oi]:"É igual a",[si]:"É diferente de",[ai]:"Começa com",[li]:"Termina com",[ui]:"Contém",[ci]:"Não contém",[hi]:"Maior que",[di]:"Maior ou igual a",[fi]:"Menor que",[gi]:"Maior ou igual a",[mi]:"Está entre",[pi]:"Não está entre",[wi]:"Depois",[vi]:"Antes",[Ci]:"Hoje",[yi]:"Amanhã",[bi]:"Ontem",[qn]:"Células vazias",[Si]:"Filtrar por condição",[Ri]:"Filtrar por valor",[Ei]:"E",[Qn]:"Ou",[Ti]:"Selecionar tudo",[_i]:"Limpar",[Mi]:"OK",[Ii]:"Cancelar",[Pi]:"Localizar",[Oi]:"Valor",[xi]:"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 Ile={languageCode:"ru-RU",[vr]:"Вставить строку выше",[Cr]:"Вставить строку ниже",[yr]:"Вставить столбец слева",[br]:"Вставить столбец справа",[Sr]:["Удалить строку","Удалить строки"],[Rr]:["Удалить столбец","Удалить столбцы"],[Er]:"Отменить",[Tr]:"Повторить",[Kn]:"Только для чтения",[_r]:"Очистить столбец",[Lr]:"Выравнивание",[$r]:"По левому краю",[Fr]:"По центру",[Vr]:"По правому краю",[Wr]:"По ширине",[Br]:"По верхнему краю",[jr]:"По центру",[Ur]:"По нижнему краю",[Pr]:"Закрепить столбец",[Or]:"Открепить столбец",[zr]:"Границы",[Yr]:"Сверху",[Gr]:"Справа",[Kr]:"Снизу",[qr]:"Слева",[Xr]:"Удалить границу(ы)",[Hr]:"Добавить комментарий",[Nr]:"Редактировать комментарий",[Dr]:"Удалить комментарий",[kr]:"Комментарий только для чтения",[xr]:"Объединить ячейки",[Ar]:"Разделить ячейки",[Mr]:"Копировать",[Ir]:"Вырезать",[Zr]:"Вставить дочернюю строку",[Qr]:"Отделить от родителя",[Jr]:["Скрыть столбец","Скрыть столбцы"],[ei]:["Показать столбец","Показать столбцы"],[ti]:["Скрыть строку","Скрыть строки"],[ni]:["Показать строку","Показать строки"],[Zn]:"Отсутствует",[ri]:"Пусто",[ii]:"Не пусто",[oi]:"Равно",[si]:"Не равно",[ai]:"Начинается на",[li]:"Заканчивается на",[ui]:"Содержит",[ci]:"Не содержит",[hi]:"Больше чем",[di]:"Больше или равно",[fi]:"Меньше чем",[gi]:"Меньше или равно",[mi]:"Между",[pi]:"Не между",[wi]:"После",[vi]:"До",[Ci]:"Сегодня",[yi]:"Завтра",[bi]:"Вчера",[qn]:"Пустые ячейки",[Si]:"Фильтр по условию",[Ri]:"Фильтр по значению",[Ei]:"И",[Qn]:"Или",[Ti]:"Выбрать все",[_i]:"Убрать",[Mi]:"OK",[Ii]:"Отмена",[Pi]:"Поиск",[Oi]:"Значение",[xi]:"Второе значение"};/**
342
+ * @preserve
343
+ * Authors: soakit, HChenZi
344
+ * Last updated: Mar 09, 2023
345
+ *
346
+ * Description: Definition file for Chinese - China language-country.
347
+ */const Ple={languageCode:"zh-CN",[vr]:"上方插入行",[Cr]:"下方插入行",[yr]:"左方插入列",[br]:"右方插入列",[Sr]:["移除该行","移除多行"],[Rr]:["移除该列","移除多列"],[Er]:"撤销",[Tr]:"恢复",[Kn]:"只读",[_r]:"清空该列",[Lr]:"对齐",[$r]:"左对齐",[Fr]:"水平居中",[Vr]:"右对齐",[Wr]:"两端对齐",[Br]:"顶端对齐",[jr]:"垂直居中",[Ur]:"底端对齐",[Pr]:"冻结该列",[Or]:"取消冻结",[zr]:"边框",[Yr]:"上",[Gr]:"右",[Kr]:"下",[qr]:"左",[Xr]:"移除边框",[Hr]:"插入批注",[Nr]:"编辑批注",[Dr]:"删除批注",[kr]:"只读批注",[xr]:"合并",[Ar]:"取消合并",[Mr]:"复制",[Ta]:"带标题的复制",[_a]:"带标题组的复制",[Ma]:"仅复制标题",[Ir]:"剪切",[Zr]:"插入子行",[Qr]:"与母行分离",[Jr]:["隐藏该列","隐藏多列"],[ei]:["显示该列","显示多列"],[ti]:["隐藏该行","隐藏多行"],[ni]:["显示该行","显示多行"],[Zn]:"无",[ri]:"为空",[ii]:"不为空",[oi]:"等于",[si]:"不等于",[ai]:"开头是",[li]:"结尾是",[ui]:"包含",[ci]:"不包含",[hi]:"大于",[di]:"大于或等于",[fi]:"小于",[gi]:"小于或等于",[mi]:"在此范围",[pi]:"不在此范围",[wi]:"之后",[vi]:"之前",[Ci]:"今天",[yi]:"明天",[bi]:"昨天",[qn]:"空白单元格",[Si]:"按条件过滤",[Ri]:"按值过滤",[Ei]:"且",[Qn]:"或",[Ti]:"全选",[_i]:"清除",[Mi]:"确认",[Ii]:"取消",[Pi]:"搜索",[Oi]:"值",[xi]:"第二值"};vle();const qH={de:Cle,en:P0,es:yle,fr:ble,it:Sle,ja:Rle,ko:Ele,nl:Tle,pl:_le,pt:Mle,ru:Ile,zh:Ple},Ole=document.documentElement.lang,x$=qH[Ole]??qH.en;O0(x$);const Zle=({config:t,data:e=[],onChange:n})=>{const{appearance:r}=$$(),[i,o]=Th.useState("ht-theme-main"),s=Th.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=Th.useRef(null);return Th.useEffect(()=>{a.current&&a.current.hotInstance.loadData(e)},[e]),Th.useEffect(()=>{o(r==="dark"?"ht-theme-main-dark":"ht-theme-main")},[r]),zT.jsx(ck,{themeName:i,language:x$.languageCode,ref:a,...t,afterChange:s,children:t.columns.map(l=>zT.jsx(lk,{data:l.data,...l},l.data))})};export{Zle as default};